dom/telephony/test/marionette/test_outgoing_badNumber.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 let number = "****5555552368****";
michael@0 8 let outgoing;
michael@0 9
michael@0 10
michael@0 11 function dial() {
michael@0 12 log("Make an outgoing call to an invalid number.");
michael@0 13
michael@0 14 // Note: The number is valid from the view of phone and the call could be
michael@0 15 // dialed out successfully. However, it will later receive the BadNumberError
michael@0 16 // from network side.
michael@0 17 telephony.dial(number).then(call => {
michael@0 18 outgoing = call;
michael@0 19 ok(outgoing);
michael@0 20 is(outgoing.number, number);
michael@0 21 is(outgoing.state, "dialing");
michael@0 22
michael@0 23 is(outgoing, telephony.active);
michael@0 24 is(telephony.calls.length, 1);
michael@0 25 is(telephony.calls[0], outgoing);
michael@0 26
michael@0 27 outgoing.onerror = function onerror(event) {
michael@0 28 log("Received 'error' event.");
michael@0 29 is(event.call, outgoing);
michael@0 30 ok(event.call.error);
michael@0 31 is(event.call.error.name, "BadNumberError");
michael@0 32
michael@0 33 emulator.run("gsm list", function(result) {
michael@0 34 log("Initial call list: " + result);
michael@0 35 is(result[0], "OK");
michael@0 36 cleanUp();
michael@0 37 });
michael@0 38 };
michael@0 39 });
michael@0 40 }
michael@0 41
michael@0 42 function cleanUp() {
michael@0 43 finish();
michael@0 44 }
michael@0 45
michael@0 46 startTest(function() {
michael@0 47 dial();
michael@0 48 });

mercurial