Skip to content

Commit

Permalink
[js/webgpu] Support Chrome Canary in unit tests (#21750)
Browse files Browse the repository at this point in the history
Chrome Canary is helpful to test some new features. With this PR, we can
enable Chrome Canary in unit tests with command like "npm test -- op
abs.jsonc -b=webgpu -e=chromecanary".
  • Loading branch information
Yang Gu authored Aug 16, 2024
1 parent 754dba2 commit f8efc08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/web/script/test-runner-cli-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Examples:
export declare namespace TestRunnerCliArgs {
type Mode = 'suite0' | 'suite1' | 'model' | 'unittest' | 'op';
type Backend = 'cpu' | 'webgl' | 'webgpu' | 'wasm' | 'onnxruntime' | 'webnn';
type Environment = 'chrome' | 'edge' | 'firefox' | 'electron' | 'safari' | 'node' | 'bs';
type Environment = 'chrome' | 'chromecanary' | 'edge' | 'firefox' | 'electron' | 'safari' | 'node' | 'bs';
type BundleMode = 'dev' | 'perf';
type IOBindingMode = 'none' | 'gpu-tensor' | 'gpu-location';
}
Expand Down Expand Up @@ -385,7 +385,7 @@ export function parseTestRunnerCliArgs(cmdlineArgs: string[]): TestRunnerCliArgs
// Option: -e=<...>, --env=<...>
const envArg = args.env || args.e;
const env = typeof envArg !== 'string' ? 'chrome' : envArg;
if (['chrome', 'edge', 'firefox', 'electron', 'safari', 'node', 'bs'].indexOf(env) === -1) {
if (['chrome', 'chromecanary', 'edge', 'firefox', 'electron', 'safari', 'node', 'bs'].indexOf(env) === -1) {
throw new Error(`not supported env ${env}`);
}

Expand Down
2 changes: 2 additions & 0 deletions js/web/script/test-runner-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@ async function main() {
switch (env) {
case 'chrome':
return 'ChromeTest';
case 'chromecanary':
return 'ChromeCanaryTest';
case 'edge':
return 'EdgeTest';
case 'firefox':
Expand Down

0 comments on commit f8efc08

Please sign in to comment.