Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | Bug 925437: online/offline events tests. |
michael@0 | 5 | |
michael@0 | 6 | Any copyright is dedicated to the Public Domain. |
michael@0 | 7 | http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 8 | --> |
michael@0 | 9 | <head> |
michael@0 | 10 | <title>Test for Bug 925437 (worker online/offline events)</title> |
michael@0 | 11 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 12 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 13 | </head> |
michael@0 | 14 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=925437">Mozilla Bug 925437</a> |
michael@0 | 15 | <p id="display"></p> |
michael@0 | 16 | <div id="content" style="display: none"> |
michael@0 | 17 | |
michael@0 | 18 | </div> |
michael@0 | 19 | <pre id="test"> |
michael@0 | 20 | </pre> |
michael@0 | 21 | |
michael@0 | 22 | <script class="testbody" type="text/javascript"> |
michael@0 | 23 | |
michael@0 | 24 | addLoadEvent(function() { |
michael@0 | 25 | var w = new Worker("onLine_worker.js"); |
michael@0 | 26 | |
michael@0 | 27 | w.onmessage = function(e) { |
michael@0 | 28 | if (e.data.type === 'ready') { |
michael@0 | 29 | doTest(); |
michael@0 | 30 | } else if (e.data.type === 'ok') { |
michael@0 | 31 | ok(e.data.test, e.data.message); |
michael@0 | 32 | } else if (e.data.type === 'finished') { |
michael@0 | 33 | SimpleTest.finish(); |
michael@0 | 34 | } |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | function doTest() { |
michael@0 | 38 | var iosvc = SpecialPowers.Cc["@mozilla.org/network/io-service;1"] |
michael@0 | 39 | .getService(SpecialPowers.Ci.nsIIOService2); |
michael@0 | 40 | iosvc.manageOfflineStatus = false; |
michael@0 | 41 | |
michael@0 | 42 | info("setting iosvc.offline = true"); |
michael@0 | 43 | iosvc.offline = true; |
michael@0 | 44 | |
michael@0 | 45 | info("setting iosvc.offline = false"); |
michael@0 | 46 | iosvc.offline = false; |
michael@0 | 47 | |
michael@0 | 48 | info("setting iosvc.offline = true"); |
michael@0 | 49 | iosvc.offline = true; |
michael@0 | 50 | |
michael@0 | 51 | for (var i = 0; i < 10; ++i) { |
michael@0 | 52 | iosvc.offline = !iosvc.offline; |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | info("setting iosvc.offline = false"); |
michael@0 | 56 | w.postMessage('lastTest'); |
michael@0 | 57 | iosvc.offline = false; |
michael@0 | 58 | } |
michael@0 | 59 | }); |
michael@0 | 60 | |
michael@0 | 61 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 62 | </script> |
michael@0 | 63 | </body> |
michael@0 | 64 | </html> |