dom/telephony/test/marionette/test_crash_emulator.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 let outNumber = "5555551111";
     8 let outgoingCall;
    10 function dial() {
    11   log("Make an outgoing call.");
    12   telephony.dial(outNumber).then(call => {
    13     outgoingCall = call;
    14     outgoingCall.onalerting = function onalerting(event) {
    15       log("Received 'alerting' call event.");
    16       answer();
    17     };
    18   });
    19 }
    21 function answer() {
    22   log("Answering the outgoing call.");
    24   outgoingCall.onconnected = function onconnectedOut(event) {
    25     log("Received 'connected' call event for the original outgoing call.");
    26     // just some code to keep call active for awhile
    27     callStartTime = Date.now();
    28     waitFor(cleanUp,function() {
    29       callDuration = Date.now() - callStartTime;
    30       log("Waiting while call is active, call duration (ms): " + callDuration);
    31       return(callDuration >= 2000);
    32     });
    33   };
    34   emulator.run("gsm accept " + outNumber);
    35 }
    37 function cleanUp(){
    38   outgoingCall.hangUp();
    39   ok("passed");
    40   finish();
    41 }
    43 startTest(function() {
    44   dial();
    45 });

mercurial