Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | <!-- |
michael@0 | 3 | Any copyright is dedicated to the Public Domain. |
michael@0 | 4 | http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 5 | --> |
michael@0 | 6 | <window title="DOM Worker Threads Test" |
michael@0 | 7 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 8 | onload="test();"> |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
michael@0 | 11 | <script type="application/javascript" src="dom_worker_helper.js"/> |
michael@0 | 12 | |
michael@0 | 13 | <script type="application/javascript"> |
michael@0 | 14 | <![CDATA[ |
michael@0 | 15 | function test() |
michael@0 | 16 | { |
michael@0 | 17 | const enabledPref = "dom.workers.enabled"; |
michael@0 | 18 | const message = "Hi"; |
michael@0 | 19 | |
michael@0 | 20 | var prefs = Components.classes["@mozilla.org/preferences-service;1"] |
michael@0 | 21 | .getService(Components.interfaces.nsIPrefBranch); |
michael@0 | 22 | is(prefs.getBoolPref(enabledPref), true, "Workers should be enabled."); |
michael@0 | 23 | |
michael@0 | 24 | prefs.setBoolPref(enabledPref, false); |
michael@0 | 25 | |
michael@0 | 26 | ok("Worker" in window, "Worker constructor should be available."); |
michael@0 | 27 | ok("ChromeWorker" in window, |
michael@0 | 28 | "ChromeWorker constructor should be available."); |
michael@0 | 29 | |
michael@0 | 30 | var worker = new ChromeWorker("workersDisabled_worker.js"); |
michael@0 | 31 | worker.onmessage = function(event) { |
michael@0 | 32 | is(event.data, message, "Good message."); |
michael@0 | 33 | prefs.clearUserPref(enabledPref); |
michael@0 | 34 | finish(); |
michael@0 | 35 | } |
michael@0 | 36 | worker.postMessage(message); |
michael@0 | 37 | |
michael@0 | 38 | waitForWorkerFinish(); |
michael@0 | 39 | } |
michael@0 | 40 | ]]> |
michael@0 | 41 | </script> |
michael@0 | 42 | |
michael@0 | 43 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 44 | <p id="display"></p> |
michael@0 | 45 | <div id="content" style="display:none;"></div> |
michael@0 | 46 | <pre id="test"></pre> |
michael@0 | 47 | </body> |
michael@0 | 48 | <label id="test-result"/> |
michael@0 | 49 | </window> |