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.
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 handleConferenceAddError(callToAdd) { |
michael@0 | 8 | log('Handle conference add error.'); |
michael@0 | 9 | |
michael@0 | 10 | let deferred = Promise.defer(); |
michael@0 | 11 | |
michael@0 | 12 | conference.onerror = function(evt) { |
michael@0 | 13 | log('Receiving a conference error event.'); |
michael@0 | 14 | conference.onerror = null; |
michael@0 | 15 | |
michael@0 | 16 | is(evt.name, 'addError', 'conference addError'); |
michael@0 | 17 | |
michael@0 | 18 | deferred.resolve(); |
michael@0 | 19 | } |
michael@0 | 20 | conference.add(callToAdd); |
michael@0 | 21 | |
michael@0 | 22 | return deferred.promise; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | function testConferenceAddError() { |
michael@0 | 26 | log('= testConferenceAddError ='); |
michael@0 | 27 | |
michael@0 | 28 | let outCall, inCall, inCall2, inCall3, inCall4, inCall5; |
michael@0 | 29 | let outNumber = "5555550101"; |
michael@0 | 30 | let inNumber = "5555550201"; |
michael@0 | 31 | let inNumber2 = "5555550202"; |
michael@0 | 32 | let inNumber3 = "5555550203"; |
michael@0 | 33 | let inNumber4 = "5555550204"; |
michael@0 | 34 | let inNumber5 = "5555550205"; |
michael@0 | 35 | let outInfo = gOutCallStrPool(outNumber); |
michael@0 | 36 | let inInfo = gInCallStrPool(inNumber); |
michael@0 | 37 | let inInfo2 = gInCallStrPool(inNumber2); |
michael@0 | 38 | let inInfo3 = gInCallStrPool(inNumber3); |
michael@0 | 39 | let inInfo4 = gInCallStrPool(inNumber4); |
michael@0 | 40 | let inInfo5 = gInCallStrPool(inNumber5); |
michael@0 | 41 | |
michael@0 | 42 | return Promise.resolve() |
michael@0 | 43 | .then(() => gSetupConferenceFiveCalls(outNumber, inNumber, inNumber2, |
michael@0 | 44 | inNumber3, inNumber4)) |
michael@0 | 45 | .then(calls => { |
michael@0 | 46 | [outCall, inCall, inCall2, inCall3, inCall4] = calls; |
michael@0 | 47 | }) |
michael@0 | 48 | .then(() => gRemoteDial(inNumber5)) |
michael@0 | 49 | .then(call => {inCall5 = call;}) |
michael@0 | 50 | .then(() => gAnswer(inCall5, function() { |
michael@0 | 51 | gCheckState(inCall5, [inCall5], 'held', |
michael@0 | 52 | [outCall, inCall, inCall2, inCall3, inCall4]); |
michael@0 | 53 | })) |
michael@0 | 54 | .then(() => gCheckAll(inCall5, [inCall5], 'held', |
michael@0 | 55 | [outCall, inCall, inCall2, inCall3, inCall4], |
michael@0 | 56 | [outInfo.held, inInfo.held, inInfo2.held, |
michael@0 | 57 | inInfo3.held, inInfo4.held, inInfo5.active])) |
michael@0 | 58 | // Maximum number of conference participants is 5. |
michael@0 | 59 | .then(() => handleConferenceAddError(inCall5)) |
michael@0 | 60 | .then(() => gRemoteHangUpCalls([outCall, inCall, inCall2, inCall3, inCall4, |
michael@0 | 61 | inCall5])); |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | // Start the test |
michael@0 | 65 | startTest(function() { |
michael@0 | 66 | testConferenceAddError() |
michael@0 | 67 | .then(null, error => { |
michael@0 | 68 | ok(false, 'promise rejects during test.'); |
michael@0 | 69 | }) |
michael@0 | 70 | .then(finish); |
michael@0 | 71 | }); |