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

mercurial