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.

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

mercurial