[js/web] update test to explicitly fail for webnn without proxy (#17554)

### Description

Update test to explicitly fail for webnn without proxy.

I am doing this change because if I test webnn with other backend
together, it silently enables proxy. I want to make test runner behave
with less implicit flag reset. If proxy is not enabled, webnn test
should fail.

@Honry please let me know if other places (eg. CI scripts) should change
also.
This commit is contained in:
Yulong Wang 2023-09-15 14:40:22 -07:00 committed by GitHub
parent 155887593d
commit efd416b71f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -382,8 +382,7 @@ export function parseTestRunnerCliArgs(cmdlineArgs: string[]): TestRunnerCliArgs
const globalEnvFlags = parseGlobalEnvFlags(args);
if (backend.includes('webnn') && !globalEnvFlags.wasm!.proxy) {
// Backend webnn is restricted in the dedicated worker.
globalEnvFlags.wasm!.proxy = true;
throw new Error('Backend webnn requires flag "wasm-enable-proxy" to be set to true.');
}
// Options: