2021-05-15 01:15:38 +00:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
2021-08-07 02:35:43 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
2023-07-28 22:46:58 +00:00
|
|
|
it('Browser E2E testing - WebGL backend', async function() {
|
|
|
|
|
await testFunction(ort, {executionProviders: ['webgl']});
|
2021-05-15 01:15:38 +00:00
|
|
|
});
|
2024-03-27 09:07:00 +00:00
|
|
|
|
|
|
|
|
it('Browser E2E testing - invalid buffer', async () => {
|
|
|
|
|
try {
|
|
|
|
|
await ort.InferenceSession.create(
|
|
|
|
|
new Uint8Array(Array.from({length: 100}, () => 42)), {executionProviders: ['webgl']});
|
|
|
|
|
|
|
|
|
|
// Should not reach here.
|
|
|
|
|
assert(false);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
assert(e.message.includes('as ONNX format'));
|
|
|
|
|
assert(e.message.includes('as ORT format'));
|
|
|
|
|
}
|
|
|
|
|
});
|