dom/telephony/test/marionette/test_dsds_connection_conflict.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 muxModem(id) {
     8   let deferred = Promise.defer();
    10   emulator.run("mux modem " + id, function() {
    11     deferred.resolve();
    12   });
    14   return deferred.promise;
    15 }
    17 function testNewCallWhenOtherConnectionInUse(firstServiceId, secondServiceId) {
    18   log("= testNewCallWhenOtherConnectionInUse =");
    19   log("1st call on " + firstServiceId + ", 2nd call on " + secondServiceId);
    21   let outCall;
    23   return Promise.resolve()
    24     .then(() => muxModem(firstServiceId))
    25     .then(() => {
    26       return telephony.dial("0912345000", firstServiceId);
    27     })
    28     .then(call => {
    29       outCall = call;
    30       is(outCall.serviceId, firstServiceId);
    31     })
    32     .then(() => gRemoteAnswer(outCall))
    33     .then(() => {
    34       return telephony.dial("0912345001", secondServiceId);
    35     })
    36     .then(() => {
    37       log("The promise should not be resolved");
    38       ok(false);
    39     }, cause => {
    40       is(cause, "OtherConnectionInUse");
    41     })
    42     .then(() => gRemoteHangUp(outCall));
    43 }
    45 startDSDSTest(function() {
    46   testNewCallWhenOtherConnectionInUse(0, 1)
    47     .then(() => testNewCallWhenOtherConnectionInUse(1, 0))
    48     .then(() => muxModem(0))
    49     .then(null, () => {
    50       ok(false, "promise rejects during test.");
    51     })
    52     .then(finish);
    53 });

mercurial