Sat, 03 Jan 2015 20:18:00 +0100
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 handleConferenceRemoveError(callToRemove) {
8 log('Handle conference remove error.');
10 let deferred = Promise.defer();
12 conference.onerror = function(evt) {
13 log('Receiving a conference error event.');
14 conference.onerror = null;
16 is(evt.name, 'removeError', 'conference removeError');
18 deferred.resolve();
19 }
20 conference.remove(callToRemove);
22 return deferred.promise;
23 }
25 function testConferenceRemoveError() {
26 log('= testConferenceRemoveError =');
28 let outCall;
29 let inCall;
30 let inCall2;
31 let outNumber = "5555550101";
32 let inNumber = "5555550201";
33 let inNumber2 = "5555550202";
34 let outInfo = gOutCallStrPool(outNumber);
35 let inInfo = gInCallStrPool(inNumber);
36 let inInfo2 = gInCallStrPool(inNumber2);
38 return Promise.resolve()
39 .then(() => gSetupConferenceTwoCalls(outNumber, inNumber))
40 .then(calls => {
41 [outCall, inCall] = calls;
42 })
43 .then(() => gRemoteDial(inNumber2))
44 .then(call => {inCall2 = call;})
45 .then(() => gCheckAll(conference, [inCall2], 'connected', [outCall, inCall],
46 [outInfo.active, inInfo.active, inInfo2.incoming]))
47 .then(() => gAnswer(inCall2, function() {
48 gCheckState(inCall2, [inCall2], 'held', [outCall, inCall]);
49 }))
50 .then(() => gCheckAll(inCall2, [inCall2], 'held', [outCall, inCall],
51 [outInfo.held, inInfo.held, inInfo2.active]))
52 .then(() => gResumeConference([outCall, inCall], function() {
53 gCheckState(conference, [inCall2], 'connected', [outCall, inCall]);
54 }))
55 // Not allowed to remove a call when there are one connected and one held
56 // calls.
57 .then(() => handleConferenceRemoveError(outCall))
58 .then(() => gRemoteHangUpCalls([outCall, inCall, inCall2]));
59 }
61 // Start the test
62 startTest(function() {
63 testConferenceRemoveError()
64 .then(null, error => {
65 ok(false, 'promise rejects during test.');
66 })
67 .then(finish);
68 });