4 <div id=
"description"/>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText();
9 testRunner
.waitUntilDone();
12 var console
= document
.getElementById("console");
15 function recieveMessage(evt
) {
19 console
.innerHTML
+= "Done."
20 if (window
.testRunner
)
21 testRunner
.notifyDone();
24 if (data
.i
< maxCount
) {
26 for (var j
= data
.i
; j
< maxCount
; j
++) {
27 success
= success
&& data
.a
[j
] == j
;
29 console
.innerHTML
+= "Failure: data.i = " + data
.i
+ " j = " + j
+ " data.a[j] = " + data
.a
[j
] + "<br>";
33 if (data
.a
.foobar
!= "FooBar")
35 if (data
.a
.length
!= maxCount
) {
37 console
.innerHTML
+= "FAIL: i = " + data
.i
+ " length = " + data
.a
.length
;
40 console
.innerHTML
+= "PASS: i = " + data
.i
+ "<br>";
42 console
.innerHTML
+= "FAIL: i = " + data
.i
+ " array: " + JSON
.stringify(data
.a
) + "<br>";
45 for (var j
= data
.i
- 1; j
< maxCount
; j
++) {
49 window
.postMessage({i
:data
.i
- 1, a
:a
}, '*');
52 console
.innerHTML
+= "Exception " + e
+ "<br>";
53 if (window
.testRunner
)
54 testRunner
.notifyDone();
57 window
.addEventListener('message', recieveMessage
, false);
59 window
.postMessage({i
:maxCount
}, '*');