-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
js/web/test/e2e/browser-test-wasm-path-override-filename-jsep.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
'use strict'; | ||
|
||
it('Browser E2E testing - WebAssembly backend (path override filename)', async function () { | ||
// check base URL port from test args | ||
if (typeof __ort_arg_port === 'undefined') { | ||
throw new Error('test flag --port=<PORT> is required'); | ||
} | ||
const base = `http://localhost:${__ort_arg_port}/`; | ||
|
||
ort.env.wasm.wasmPaths = {}; | ||
|
||
if (typeof __ort_arg_files === 'string' && __ort_arg_files.includes('wasm')) { | ||
const overrideWasmUrl = new URL('./test-wasm-path-override/jsep-renamed.wasm', base).href; | ||
console.log(`ort.env.wasm.wasmPaths['wasm'] = ${JSON.stringify(overrideWasmUrl)};`); | ||
ort.env.wasm.wasmPaths.wasm = overrideWasmUrl; | ||
} | ||
|
||
if (typeof __ort_arg_files === 'string' && __ort_arg_files.includes('mjs')) { | ||
const overrideMjsUrl = new URL('./test-wasm-path-override/jsep-renamed.mjs', base).href; | ||
console.log(`ort.env.wasm.wasmPaths['mjs'] = ${JSON.stringify(overrideMjsUrl)};`); | ||
ort.env.wasm.wasmPaths.mjs = overrideMjsUrl; | ||
} | ||
|
||
await testFunction(ort, { executionProviders: ['wasm'] }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters