Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / workers / resources / worker-replace-self.js
blobe38884bdef4178403d63f7dbf773d30a21d2ef9b
1 function log(message)
3     document.getElementById("result").innerHTML += message + "<br>";
6 if (window.testRunner) {
7     testRunner.dumpAsText();
8     testRunner.waitUntilDone();
11 var worker = createWorker();
12 worker.postMessage("eval self='PASS'");
13 worker.postMessage("eval self");
14 worker.postMessage("eval foo//bar");
16 worker.onmessage = function(evt) {
17     if (!/foo\/\/bar/.test(evt.data))
18         log(evt.data.replace(new RegExp("/.*LayoutTests"), "<...>"));
19     else {
20         log("DONE");
21         if (window.testRunner)
22             testRunner.notifyDone();
23     }