4 <p>Test setTimeOut,fired in increasing order in Web Workers.
</p>
5 <div id=
"result"></div>
6 <script type=
"text/javascript">
9 document
.getElementById("result").innerHTML
+= message
+ "</br>";
12 if (window
.testRunner
) {
13 testRunner
.dumpAsText();
14 testRunner
.waitUntilDone();
17 var worker
= new Worker('resources/worker-timeout-increasing-order.js');
18 var lastTestResult
= 0;
19 var testCounterLimit
= 3;
21 var testStarted
= false;
22 var testAlreadyFailed
= false;
24 worker
.postMessage("TS");
26 worker
.onmessage = function(evt
) {
28 var currentNum
= evt
.data
;
29 if(lastTestResult
== currentNum
- 1 && !testAlreadyFailed
) {
30 lastTestResult
= currentNum
;
32 // we got all the results in order
33 if(lastTestResult
== testCounterLimit
&& timerLimit
== 0)
34 log("PASS: Timeouts executed in order.");
37 testAlreadyFailed
= true;
40 log("FAIL: PASS: Timeouts executed out of order.");
43 if(evt
.data
== "Test started.") {
47 if (evt
.data
== "DONE") {
49 if (window
.testRunner
)
50 testRunner
.notifyDone();