dom/mobileconnection/tests/marionette/test_mobile_voice_location.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 = 60000;
     5 MARIONETTE_HEAD_JS = "head.js";
     7 function verifyVoiceCellLocationInfo(aLac, aCid) {
     8   let cell = mobileConnection.voice.cell;
     9   ok(cell, "location available");
    11   // Initial LAC/CID. Android emulator initializes both value to
    12   // 0xffff/0xffffffff.
    13   is(cell.gsmLocationAreaCode, aLac, "check voice.cell.gsmLocationAreaCode");
    14   is(cell.gsmCellId, aCid, "check voice.cell.gsmCellId");
    15   is(cell.cdmaBaseStationId, -1, "check voice.cell.cdmaBaseStationId");
    16   is(cell.cdmaBaseStationLatitude, -2147483648,
    17      "check voice.cell.cdmaBaseStationLatitude");
    18   is(cell.cdmaBaseStationLongitude, -2147483648,
    19      "check voice.cell.cdmaBaseStationLongitude");
    20   is(cell.cdmaSystemId, -1, "check voice.cell.cdmaSystemId");
    21   is(cell.cdmaNetworkId, -1, "check voice.cell.cdmaNetworkId");
    22 }
    24 /* Test Voice Cell Location Info Change */
    25 function testVoiceCellLocationUpdate(aLac, aCid) {
    26   // Set emulator's lac/cid and wait for 'onvoicechange' event.
    27   log("Test cell location with lac=" + aLac + " and cid=" + aCid);
    29   let promises = [];
    30   promises.push(waitForManagerEvent("voicechange"));
    31   promises.push(setEmulatorGsmLocation(aLac, aCid));
    32   return Promise.all(promises)
    33     .then(() => verifyVoiceCellLocationInfo(aLac, aCid));
    34 }
    36 startTestCommon(function() {
    37   return getEmulatorGsmLocation()
    38     .then(function(aResult) {
    39       log("Test initial voice location info");
    40       verifyVoiceCellLocationInfo(aResult.lac, aResult.cid);
    42       return Promise.resolve()
    43         .then(() => testVoiceCellLocationUpdate(100, 100))
    44         .then(() => testVoiceCellLocationUpdate(2000, 2000))
    46         // Reset back to initial values.
    47         .then(() => testVoiceCellLocationUpdate(aResult.lac, aResult.cid));
    48     });
    49 });

mercurial