mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
3dfd6c1bac
--HG-- extra : rebase_source : d635a4f39c587d4d381b486dd63de747865b77a2
41 lines
945 B
HTML
41 lines
945 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title> WorkerGlobalScope API: setTimeout() </title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id=log></div>
|
|
<script>
|
|
|
|
var FileName = './support/Timer.js';
|
|
var DATA = "TimeoutHandler";
|
|
var ExpectedResult = ["hello", "worker", "worker"];
|
|
var ActualResult = [];
|
|
|
|
var t = async_test("Test Description: WorkerGlobalScope API: setTimeout().");
|
|
|
|
var worker = new Worker(FileName);
|
|
|
|
worker.onmessage = t.step_func(function(evt)
|
|
{
|
|
ActualResult.push(evt.data);
|
|
|
|
if (ActualResult.length == 3)
|
|
{
|
|
setTimeout(t.step_func(VerifyResult), 100);
|
|
}
|
|
});
|
|
|
|
worker.postMessage(DATA);
|
|
|
|
function VerifyResult()
|
|
{
|
|
assert_array_equals(ActualResult, ExpectedResult)
|
|
t.done();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|