b4ef0031c6
Skeleton tests included. Run the test with run.sh. Fixes: QTBUG-107744 Change-Id: Ic2734e24025f8edc0f8e710d981367aa321f9066 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
43 lines
914 B
JavaScript
43 lines
914 B
JavaScript
// 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();
|
|
})();
|