OLD | NEW |
1 function log(message) | 1 function log(message) |
2 { | 2 { |
3 document.getElementById("result").innerHTML += message + "<br>"; | 3 document.getElementById("result").innerHTML += message + "<br>"; |
4 } | 4 } |
5 | 5 |
6 function gc() | 6 function gc() |
7 { | 7 { |
8 if (window.GCController) | 8 if (window.GCController) |
9 return GCController.collect(); | 9 return GCController.collect(); |
10 | 10 |
11 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) | 11 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) |
12 var s = new String("abc"); | 12 var s = new String("abc"); |
13 } | 13 } |
14 } | 14 } |
15 | 15 |
16 if (window.testRunner) { | 16 if (window.testRunner) { |
17 testRunner.dumpAsText(); | 17 testRunner.dumpAsText(); |
18 testRunner.waitUntilDone(); | 18 testRunner.waitUntilDone(); |
19 } | 19 } |
20 | 20 |
21 var worker = createWorker(); | 21 var worker = createWorker(); |
22 worker.postMessage("eval WorkerLocation"); | 22 worker.postMessage("eval WorkerLocation"); |
23 worker.postMessage("eval typeof location"); | 23 worker.postMessage("eval typeof location"); |
24 worker.postMessage("eval location"); | 24 worker.postMessage("eval location"); |
25 worker.postMessage("eval location.href"); | 25 worker.postMessage("eval location.href"); |
| 26 worker.postMessage("eval location.origin"); |
26 worker.postMessage("eval location.protocol"); | 27 worker.postMessage("eval location.protocol"); |
27 worker.postMessage("eval location.host"); | 28 worker.postMessage("eval location.host"); |
28 worker.postMessage("eval location.hostname"); | 29 worker.postMessage("eval location.hostname"); |
29 worker.postMessage("eval location.port"); | 30 worker.postMessage("eval location.port"); |
30 worker.postMessage("eval location.pathname"); | 31 worker.postMessage("eval location.pathname"); |
31 worker.postMessage("eval location.search"); | 32 worker.postMessage("eval location.search"); |
32 worker.postMessage("eval location.hash"); | 33 worker.postMessage("eval location.hash"); |
33 worker.postMessage("eval foo//bar"); | 34 worker.postMessage("eval foo//bar"); |
34 | 35 |
35 worker.onmessage = function(evt) { | 36 worker.onmessage = function(evt) { |
36 if (!/foo\/\/bar/.test(evt.data)) | 37 if (!/foo\/\/bar/.test(evt.data)) |
37 log(evt.data.replace(new RegExp("/.*LayoutTests"), "<...>")); | 38 log(evt.data.replace(new RegExp("/.*LayoutTests"), "<...>")); |
38 else { | 39 else { |
39 log("DONE"); | 40 log("DONE"); |
40 if (window.testRunner) | 41 if (window.testRunner) |
41 testRunner.notifyDone(); | 42 testRunner.notifyDone(); |
42 } | 43 } |
43 } | 44 } |
OLD | NEW |