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';
|
|
|
|
|
|
2024-08-14 23:51:22 +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 {
|
2024-08-14 23:51:22 +00:00
|
|
|
await ort.InferenceSession.create(new Uint8Array(Array.from({ length: 100 }, () => 42)), {
|
|
|
|
|
executionProviders: ['webgl'],
|
|
|
|
|
});
|
2024-03-27 09:07:00 +00:00
|
|
|
|
|
|
|
|
// Should not reach here.
|
|
|
|
|
assert(false);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
assert(e.message.includes('as ONNX format'));
|
|
|
|
|
assert(e.message.includes('as ORT format'));
|
|
|
|
|
}
|
|
|
|
|
});
|