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.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 MARIONETTE_TIMEOUT = 30000;
     6 SpecialPowers.addPermission("mobilenetwork", true, document);
     8 let connection = navigator.mozMobileConnections[0];
     9 ok(connection instanceof MozMobileConnection,
    10    "connection is instanceof " + connection.constructor);
    13 function testLastKnownNetwork() {
    14   log("testLastKnownNetwork: " + connection.lastKnownNetwork);
    15   // The emulator's hard coded operatoer's mcc and mnc codes.
    16   is(connection.lastKnownNetwork, "310-260");
    17   runNextTest();
    18 }
    20 function testLastKnownHomeNetwork() {
    21   log("testLastKnownHomeNetwork: " + connection.lastKnownHomeNetwork);
    22   // The emulator's hard coded icc's mcc and mnc codes.
    23   is(connection.lastKnownHomeNetwork, "310-260");
    24   runNextTest();
    25 }
    27 let tests = [
    28   testLastKnownNetwork,
    29   testLastKnownHomeNetwork
    30 ];
    32 function runNextTest() {
    33   let test = tests.shift();
    34   if (!test) {
    35     cleanUp();
    36     return;
    37   }
    39   test();
    40 }
    42 function cleanUp() {
    43   SpecialPowers.removePermission("mobilenetwork", document);
    44   finish();
    45 }
    47 runNextTest();

mercurial