dom/mobileconnection/tests/marionette/test_mobile_last_known_network.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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 = 30000;
michael@0 5
michael@0 6 SpecialPowers.addPermission("mobilenetwork", true, document);
michael@0 7
michael@0 8 let connection = navigator.mozMobileConnections[0];
michael@0 9 ok(connection instanceof MozMobileConnection,
michael@0 10 "connection is instanceof " + connection.constructor);
michael@0 11
michael@0 12
michael@0 13 function testLastKnownNetwork() {
michael@0 14 log("testLastKnownNetwork: " + connection.lastKnownNetwork);
michael@0 15 // The emulator's hard coded operatoer's mcc and mnc codes.
michael@0 16 is(connection.lastKnownNetwork, "310-260");
michael@0 17 runNextTest();
michael@0 18 }
michael@0 19
michael@0 20 function testLastKnownHomeNetwork() {
michael@0 21 log("testLastKnownHomeNetwork: " + connection.lastKnownHomeNetwork);
michael@0 22 // The emulator's hard coded icc's mcc and mnc codes.
michael@0 23 is(connection.lastKnownHomeNetwork, "310-260");
michael@0 24 runNextTest();
michael@0 25 }
michael@0 26
michael@0 27 let tests = [
michael@0 28 testLastKnownNetwork,
michael@0 29 testLastKnownHomeNetwork
michael@0 30 ];
michael@0 31
michael@0 32 function runNextTest() {
michael@0 33 let test = tests.shift();
michael@0 34 if (!test) {
michael@0 35 cleanUp();
michael@0 36 return;
michael@0 37 }
michael@0 38
michael@0 39 test();
michael@0 40 }
michael@0 41
michael@0 42 function cleanUp() {
michael@0 43 SpecialPowers.removePermission("mobilenetwork", document);
michael@0 44 finish();
michael@0 45 }
michael@0 46
michael@0 47 runNextTest();

mercurial