Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / workers / resources / worker-navigator.js
blob9fe39359523d95d7ccc81a5c211926d1912de91d
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 typeof navigator");
13 worker.postMessage("eval navigator");
14 worker.postMessage("eval navigator.appName");
15 worker.postMessage("eval navigator.appVersion.indexOf('WebKit') != 0");
16 worker.postMessage("eval typeof navigator.platform");
17 worker.postMessage("eval navigator.userAgent.indexOf('WebKit') != 0");
18 worker.postMessage("eval typeof navigator.onLine");
19 worker.postMessage("eval navigator.appCodeName === 'Mozilla'");
20 worker.postMessage("eval navigator.product === 'Gecko'");
21 worker.postMessage("eval foo//bar");
23 worker.onmessage = function(evt) {
24     if (!/foo\/\/bar/.test(evt.data))
25         log(evt.data.replace(new RegExp("/.*LayoutTests"), "<...>"));
26     else {
27         log("DONE");
28         if (window.testRunner)
29             testRunner.notifyDone();
30     }