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 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | MARIONETTE_TIMEOUT = 60000; |
michael@0 | 5 | MARIONETTE_HEAD_JS = "head.js"; |
michael@0 | 6 | |
michael@0 | 7 | function check(aLongName, aShortName) { |
michael@0 | 8 | let network = mobileConnection.voice.network; |
michael@0 | 9 | |
michael@0 | 10 | is(network.longName, aLongName, "network.longName"); |
michael@0 | 11 | is(network.shortName, aShortName, "network.shortName"); |
michael@0 | 12 | is(network.mcc, "310", "network.mcc"); |
michael@0 | 13 | is(network.mnc, "260", "network.mnc"); |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | function test(aLongName, aShortName) { |
michael@0 | 17 | log("Testing '" + aLongName + "', '" + aShortName + "':"); |
michael@0 | 18 | |
michael@0 | 19 | let promises = []; |
michael@0 | 20 | promises.push(waitForManagerEvent("voicechange")); |
michael@0 | 21 | promises.push(setEmulatorOperatorNames("home", aLongName, aShortName)); |
michael@0 | 22 | return Promise.all(promises) |
michael@0 | 23 | .then(() => check(aLongName, aShortName)); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | startTestCommon(function() { |
michael@0 | 27 | return getEmulatorOperatorNames() |
michael@0 | 28 | .then(function(aOperators) { |
michael@0 | 29 | return Promise.resolve() |
michael@0 | 30 | |
michael@0 | 31 | .then(() => test("Mozilla", "B2G")) |
michael@0 | 32 | .then(() => test("Mozilla", "")) |
michael@0 | 33 | .then(() => test("", "B2G")) |
michael@0 | 34 | .then(() => test("", "")) |
michael@0 | 35 | |
michael@0 | 36 | // Reset back to initial values. |
michael@0 | 37 | .then(() => test(aOperators[0].longName, aOperators[0].shortName)); |
michael@0 | 38 | }); |
michael@0 | 39 | }); |