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 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
michael@0 | 4 | <!-- |
michael@0 | 5 | Bug 336682: online/offline events tests. |
michael@0 | 6 | |
michael@0 | 7 | Any copyright is dedicated to the Public Domain. |
michael@0 | 8 | http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 9 | --> |
michael@0 | 10 | <window title="Mozilla Bug 336682" |
michael@0 | 11 | onoffline="trace('lt;body onoffline=...'); windowOnoffline(this, event)" |
michael@0 | 12 | ononline="trace('lt;body ononline=...'); windowOnonline(this, event)" |
michael@0 | 13 | |
michael@0 | 14 | xmlns:html="http://www.w3.org/1999/xhtml" |
michael@0 | 15 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
michael@0 | 16 | |
michael@0 | 17 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 18 | |
michael@0 | 19 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 20 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=336682"> |
michael@0 | 21 | Mozilla Bug 336682 (online/offline events)</a> |
michael@0 | 22 | <p id="display"></p> |
michael@0 | 23 | <div id="content" style="display: none"> |
michael@0 | 24 | </div> |
michael@0 | 25 | </body> |
michael@0 | 26 | |
michael@0 | 27 | <script type="text/javascript" src="test_bug336682.js"/> |
michael@0 | 28 | <script class="testbody" type="text/javascript"> |
michael@0 | 29 | <![CDATA[ |
michael@0 | 30 | addLoadEvent(function() { |
michael@0 | 31 | /** @see test_bug336682.js */ |
michael@0 | 32 | MAX_STATE = 4; |
michael@0 | 33 | |
michael@0 | 34 | function makeWindowHandler(eventName) { |
michael@0 | 35 | return function (aThis, aEvent) { |
michael@0 | 36 | var handler = makeHandler("<body on%1='...'>", eventName, [3,4]); |
michael@0 | 37 | handler(aEvent); |
michael@0 | 38 | } |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | for each(var event in ["online", "offline"]) { |
michael@0 | 42 | document.documentElement.addEventListener( |
michael@0 | 43 | event, |
michael@0 | 44 | makeHandler("document.body.addEventListener('%1', ..., false)", |
michael@0 | 45 | event, [1]), |
michael@0 | 46 | false); |
michael@0 | 47 | |
michael@0 | 48 | document.addEventListener( |
michael@0 | 49 | event, |
michael@0 | 50 | makeHandler("document.addEventListener('%1', ..., false)", |
michael@0 | 51 | event, [2]), |
michael@0 | 52 | false); |
michael@0 | 53 | |
michael@0 | 54 | window["windowOn" + event] = makeWindowHandler(event); |
michael@0 | 55 | |
michael@0 | 56 | window.addEventListener( |
michael@0 | 57 | event, |
michael@0 | 58 | makeHandler("window.addEventListener('%1', ..., false)", |
michael@0 | 59 | event, [3,4]), |
michael@0 | 60 | false); |
michael@0 | 61 | } |
michael@0 | 62 | |
michael@0 | 63 | doTest(); |
michael@0 | 64 | SimpleTest.finish(); |
michael@0 | 65 | }); |
michael@0 | 66 | |
michael@0 | 67 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 68 | ]]> |
michael@0 | 69 | </script> |
michael@0 | 70 | |
michael@0 | 71 | </window> |