mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-04 16:25:27 +08:00
qt 6.5.1 original
This commit is contained in:
19
tests/manual/wasm/qtloader/tst_qtloader.html
Normal file
19
tests/manual/wasm/qtloader/tst_qtloader.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!--
|
||||
Copyright (C) 2022 The Qt Company Ltd.
|
||||
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Qt Loader tests</title>
|
||||
<script type="text/javascript" src="https://sinonjs.org/releases/sinon-14.0.0.js"
|
||||
integrity="sha384-z8J4N1s2hPDn6ClmFXDQkKD/e738VOWcR8JmhztPRa+PgezxQupgZu3LzoBO4Jw8"
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="/src/plugins/platforms/wasm/qtloader.js"></script>
|
||||
<script src="tst_qtloader.js" type="module" defer></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
42
tests/manual/wasm/qtloader/tst_qtloader.js
Normal file
42
tests/manual/wasm/qtloader/tst_qtloader.js
Normal file
@ -0,0 +1,42 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||||
|
||||
import { TestRunner } from '../shared/testrunner.js';
|
||||
|
||||
class QtLoaderTests
|
||||
{
|
||||
async beforeEach() { sinon.stub(window, 'alert'); }
|
||||
|
||||
async afterEach() { sinon.restore(); }
|
||||
|
||||
async sampleTestCase()
|
||||
{
|
||||
await new Promise(resolve =>
|
||||
{
|
||||
window.alert();
|
||||
sinon.assert.calledOnce(window.alert);
|
||||
window.setTimeout(resolve, 4000);
|
||||
});
|
||||
}
|
||||
|
||||
async sampleTestCase2()
|
||||
{
|
||||
await new Promise(resolve =>
|
||||
{
|
||||
window.alert();
|
||||
sinon.assert.calledOnce(window.alert);
|
||||
window.setTimeout(resolve, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
async constructQtLoader()
|
||||
{
|
||||
new QtLoader({});
|
||||
}
|
||||
}
|
||||
|
||||
(async () =>
|
||||
{
|
||||
const runner = new TestRunner(new QtLoaderTests());
|
||||
await runner.runAll();
|
||||
})();
|
Reference in New Issue
Block a user