From 79fa19386be3167994efa82e3d08bf903e9bc2fa Mon Sep 17 00:00:00 2001 From: Hsin-Yi Tsai Date: Tue, 24 Jun 2014 18:36:59 +0800 Subject: [PATCH 01/26] Bug 1023141 - query ril.ecclist per dial request - part 0 - rename. r=aknow --- dom/telephony/test/marionette/head.js | 22 +++++++++---------- .../test/marionette/test_crash_emulator.js | 2 +- .../test_dsds_connection_conflict.js | 2 +- .../test/marionette/test_dsds_normal_call.js | 2 +- .../test/marionette/test_emergency.js | 10 ++++----- .../marionette/test_emergency_badNumber.js | 2 +- .../test_incoming_already_connected.js | 16 +++++++------- .../marionette/test_incoming_already_held.js | 18 +++++++-------- .../marionette/test_incoming_answer_hangup.js | 8 +++---- ...t_incoming_answer_hangup_oncallschanged.js | 8 +++---- .../test_incoming_answer_remote_hangup.js | 10 ++++----- .../test_incoming_connecting_hangup.js | 6 ++--- .../test_incoming_connecting_remote_hangup.js | 8 +++---- .../marionette/test_incoming_hangup_held.js | 10 ++++----- .../marionette/test_incoming_hold_resume.js | 12 +++++----- .../marionette/test_incoming_onstatechange.js | 12 +++++----- .../test/marionette/test_incoming_reject.js | 6 ++--- .../marionette/test_incoming_remote_cancel.js | 8 +++---- .../test_incoming_remote_hangup_held.js | 12 +++++----- .../test/marionette/test_multiple_hold.js | 20 ++++++++--------- .../marionette/test_outgoing_already_held.js | 18 +++++++-------- .../marionette/test_outgoing_answer_hangup.js | 10 ++++----- ...t_outgoing_answer_hangup_oncallschanged.js | 8 +++---- .../test_outgoing_answer_local_hangup.js | 8 +++---- .../test_outgoing_answer_radio_off.js | 2 +- .../marionette/test_outgoing_badNumber.js | 2 +- .../test/marionette/test_outgoing_busy.js | 6 ++--- .../test_outgoing_hangup_alerting.js | 4 ++-- .../marionette/test_outgoing_hangup_held.js | 10 ++++----- .../marionette/test_outgoing_hold_resume.js | 12 +++++----- .../marionette/test_outgoing_onstatechange.js | 12 +++++----- .../marionette/test_outgoing_radio_off.js | 2 +- .../test/marionette/test_outgoing_reject.js | 6 ++--- .../test_outgoing_remote_hangup_held.js | 12 +++++----- .../marionette/test_redundant_operations.js | 12 +++++----- .../marionette/test_swap_held_and_active.js | 20 ++++++++--------- 36 files changed, 169 insertions(+), 169 deletions(-) diff --git a/dom/telephony/test/marionette/head.js b/dom/telephony/test/marionette/head.js index 2232abba2d5..dbf02e7053e 100644 --- a/dom/telephony/test/marionette/head.js +++ b/dom/telephony/test/marionette/head.js @@ -16,10 +16,10 @@ let emulator = (function() { // Overwritten it so people could not call this function directly. runEmulatorCmd = function() { - throw "Use emulator.runWithCallback(cmd, callback) instead of runEmulatorCmd"; + throw "Use emulator.runCmdWithCallback(cmd, callback) instead of runEmulatorCmd"; }; - function run(cmd) { + function runCmd(cmd) { let deferred = Promise.defer(); pendingCmdCount++; @@ -36,8 +36,8 @@ let emulator = (function() { return deferred.promise; } - function runWithCallback(cmd, callback) { - run(cmd).then(result => { + function runCmdWithCallback(cmd, callback) { + runCmd(cmd).then(result => { if (callback && typeof callback === "function") { callback(result); } @@ -60,8 +60,8 @@ let emulator = (function() { } return { - run: run, - runWithCallback: runWithCallback, + runCmd: runCmd, + runCmdWithCallback: runCmdWithCallback, waitFinish: waitFinish }; }()); @@ -123,7 +123,7 @@ let emulator = (function() { return Promise.all(hangUpPromises) .then(() => { - return emulator.run("gsm clear"); + return emulator.runCmd("gsm clear").then(waitForNoCall); }) .then(waitForNoCall); } @@ -361,7 +361,7 @@ let emulator = (function() { * @return A deferred promise. */ function checkEmulatorCallList(expectedCallList) { - return emulator.run("gsm list").then(result => { + return emulator.runCmd("gsm list").then(result => { log("Call list is now: " + result); for (let i = 0; i < expectedCallList.length; ++i) { is(result[i], expectedCallList[i], "emulator calllist"); @@ -611,7 +611,7 @@ let emulator = (function() { numberPresentation = numberPresentation || ""; name = name || ""; namePresentation = namePresentation || ""; - emulator.run("gsm call " + number + "," + numberPresentation + "," + name + + emulator.runCmd("gsm call " + number + "," + numberPresentation + "," + name + "," + namePresentation); return deferred.promise; } @@ -634,7 +634,7 @@ let emulator = (function() { checkEventCallState(event, call, "connected"); deferred.resolve(call); }; - emulator.run("gsm accept " + call.id.number); + emulator.runCmd("gsm accept " + call.id.number); return deferred.promise; } @@ -657,7 +657,7 @@ let emulator = (function() { checkEventCallState(event, call, "disconnected"); deferred.resolve(call); }; - emulator.run("gsm cancel " + call.id.number); + emulator.runCmd("gsm cancel " + call.id.number); return deferred.promise; } diff --git a/dom/telephony/test/marionette/test_crash_emulator.js b/dom/telephony/test/marionette/test_crash_emulator.js index e66a248bff3..29b29761f77 100644 --- a/dom/telephony/test/marionette/test_crash_emulator.js +++ b/dom/telephony/test/marionette/test_crash_emulator.js @@ -31,7 +31,7 @@ function answer() { return(callDuration >= 2000); }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } function cleanUp(){ diff --git a/dom/telephony/test/marionette/test_dsds_connection_conflict.js b/dom/telephony/test/marionette/test_dsds_connection_conflict.js index fa6a79bdad0..5ada8e48d74 100644 --- a/dom/telephony/test/marionette/test_dsds_connection_conflict.js +++ b/dom/telephony/test/marionette/test_dsds_connection_conflict.js @@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js'; function muxModem(id) { let deferred = Promise.defer(); - emulator.runWithCallback("mux modem " + id, function() { + emulator.runCmdWithCallback("mux modem " + id, function() { deferred.resolve(); }); diff --git a/dom/telephony/test/marionette/test_dsds_normal_call.js b/dom/telephony/test/marionette/test_dsds_normal_call.js index 4aea2d179b3..ece526920ae 100644 --- a/dom/telephony/test/marionette/test_dsds_normal_call.js +++ b/dom/telephony/test/marionette/test_dsds_normal_call.js @@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js'; function muxModem(id) { let deferred = Promise.defer(); - emulator.runWithCallback("mux modem " + id, function() { + emulator.runCmdWithCallback("mux modem " + id, function() { deferred.resolve(); }); diff --git a/dom/telephony/test/marionette/test_emergency.js b/dom/telephony/test/marionette/test_emergency.js index 009db2fbddb..9dd70776f7d 100644 --- a/dom/telephony/test/marionette/test_emergency.js +++ b/dom/telephony/test/marionette/test_emergency.js @@ -28,7 +28,7 @@ function dial() { is(outgoing.state, "alerting"); is(outgoing.emergency, true); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : ringing"); answer(); @@ -49,13 +49,13 @@ function answer() { is(outgoing, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : active"); hangUp(); }); }; - emulator.runWithCallback("gsm accept " + number); + emulator.runCmdWithCallback("gsm accept " + number); } function hangUp() { @@ -71,12 +71,12 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm cancel " + number); + emulator.runCmdWithCallback("gsm cancel " + number); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_emergency_badNumber.js b/dom/telephony/test/marionette/test_emergency_badNumber.js index c33e8e02b94..84afb568f43 100644 --- a/dom/telephony/test/marionette/test_emergency_badNumber.js +++ b/dom/telephony/test/marionette/test_emergency_badNumber.js @@ -16,7 +16,7 @@ function dial() { is(telephony.calls.length, 0); is(cause, "BadNumberError"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Initial call list: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_already_connected.js b/dom/telephony/test/marionette/test_incoming_already_connected.js index 0867813f46a..d7c3205989b 100644 --- a/dom/telephony/test/marionette/test_incoming_already_connected.js +++ b/dom/telephony/test/marionette/test_incoming_already_connected.js @@ -27,7 +27,7 @@ function dial() { is(outgoingCall, event.call); is(outgoingCall.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : ringing"); answer(); @@ -47,7 +47,7 @@ function answer() { is(outgoingCall.state, "connected"); is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); @@ -61,7 +61,7 @@ function answer() { } }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } // With one connected call already, simulate an incoming call @@ -80,14 +80,14 @@ function simulateIncoming() { is(telephony.calls[0], outgoingCall); is(telephony.calls[1], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); is(result[1], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } // Answer incoming call; original outgoing call should be held @@ -111,7 +111,7 @@ function answerIncoming() { is(incomingCall, telephony.active); is(outgoingCall.state, "held"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); is(result[1], "inbound from " + inNumber + " : active"); @@ -143,7 +143,7 @@ function hangUpOutgoing() { is(telephony.calls.length, 1); is(incomingCall.state, "connected"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); hangUpIncoming(); @@ -174,7 +174,7 @@ function hangUpIncoming() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_already_held.js b/dom/telephony/test/marionette/test_incoming_already_held.js index 601f8b1a499..6e37614c6fd 100644 --- a/dom/telephony/test/marionette/test_incoming_already_held.js +++ b/dom/telephony/test/marionette/test_incoming_already_held.js @@ -27,7 +27,7 @@ function dial() { is(outgoingCall, event.call); is(outgoingCall.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : ringing"); answer(); @@ -47,7 +47,7 @@ function answer() { is(outgoingCall.state, "connected"); is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); @@ -61,7 +61,7 @@ function answer() { } }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } function holdCall() { @@ -85,7 +85,7 @@ function holdCall() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); simulateIncoming(); @@ -110,14 +110,14 @@ function simulateIncoming() { is(telephony.calls[0], outgoingCall); is(telephony.calls[1], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); is(result[1], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } // Answer incoming call; original outgoing call should be held @@ -141,7 +141,7 @@ function answerIncoming() { is(incomingCall, telephony.active); is(outgoingCall.state, "held"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); is(result[1], "inbound from " + inNumber + " : active"); @@ -173,7 +173,7 @@ function hangUpOutgoing() { is(telephony.calls.length, 1); is(incomingCall.state, "connected"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); hangUpIncoming(); @@ -204,7 +204,7 @@ function hangUpIncoming() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_answer_hangup.js b/dom/telephony/test/marionette/test_incoming_answer_hangup.js index c5699786f5a..38c9c118ef4 100644 --- a/dom/telephony/test/marionette/test_incoming_answer_hangup.js +++ b/dom/telephony/test/marionette/test_incoming_answer_hangup.js @@ -22,13 +22,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incoming); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : incoming"); answer(); }); }; - emulator.runWithCallback("gsm call " + number); + emulator.runCmdWithCallback("gsm call " + number); } function answer() { @@ -50,7 +50,7 @@ function answer() { is(incoming, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : active"); hangUp(); @@ -79,7 +79,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_answer_hangup_oncallschanged.js b/dom/telephony/test/marionette/test_incoming_answer_hangup_oncallschanged.js index 045554396d4..7dae153f5a9 100644 --- a/dom/telephony/test/marionette/test_incoming_answer_hangup_oncallschanged.js +++ b/dom/telephony/test/marionette/test_incoming_answer_hangup_oncallschanged.js @@ -28,14 +28,14 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incoming); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : incoming"); answer(); }); }; - emulator.runWithCallback("gsm call " + number); + emulator.runCmdWithCallback("gsm call " + number); } function answer() { @@ -60,7 +60,7 @@ function answer() { is(incoming, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : active"); hangUp(); @@ -109,7 +109,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_answer_remote_hangup.js b/dom/telephony/test/marionette/test_incoming_answer_remote_hangup.js index 917884eba9a..86a3a1dd79a 100644 --- a/dom/telephony/test/marionette/test_incoming_answer_remote_hangup.js +++ b/dom/telephony/test/marionette/test_incoming_answer_remote_hangup.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -48,7 +48,7 @@ function answerIncoming() { is(incomingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); remoteHangUp(); @@ -70,12 +70,12 @@ function remoteHangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm cancel " + inNumber); + emulator.runCmdWithCallback("gsm cancel " + inNumber); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_incoming_connecting_hangup.js b/dom/telephony/test/marionette/test_incoming_connecting_hangup.js index 2b283e4dbae..4df52b854bc 100644 --- a/dom/telephony/test/marionette/test_incoming_connecting_hangup.js +++ b/dom/telephony/test/marionette/test_incoming_connecting_hangup.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -77,7 +77,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_connecting_remote_hangup.js b/dom/telephony/test/marionette/test_incoming_connecting_remote_hangup.js index 91426625c47..75ebe1f3b8e 100644 --- a/dom/telephony/test/marionette/test_incoming_connecting_remote_hangup.js +++ b/dom/telephony/test/marionette/test_incoming_connecting_remote_hangup.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -59,12 +59,12 @@ function remoteHangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm cancel " + inNumber); + emulator.runCmdWithCallback("gsm cancel " + inNumber); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_incoming_hangup_held.js b/dom/telephony/test/marionette/test_incoming_hangup_held.js index e2edf605b2a..436614ec01b 100644 --- a/dom/telephony/test/marionette/test_incoming_hangup_held.js +++ b/dom/telephony/test/marionette/test_incoming_hangup_held.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -48,7 +48,7 @@ function answerIncoming() { is(incomingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); hold(); @@ -78,7 +78,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); hangUp(); @@ -107,7 +107,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_hold_resume.js b/dom/telephony/test/marionette/test_incoming_hold_resume.js index 723be17e425..f7ce52d31fb 100644 --- a/dom/telephony/test/marionette/test_incoming_hold_resume.js +++ b/dom/telephony/test/marionette/test_incoming_hold_resume.js @@ -21,13 +21,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : incoming"); answer(); }); }; - emulator.runWithCallback("gsm call " + number); + emulator.runCmdWithCallback("gsm call " + number); } function answer() { @@ -49,7 +49,7 @@ function answer() { is(incomingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : active"); hold(); @@ -79,7 +79,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : held"); // Wait on hold for a couple of seconds @@ -111,7 +111,7 @@ function resume() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : active"); hangUp(); @@ -140,7 +140,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_onstatechange.js b/dom/telephony/test/marionette/test_incoming_onstatechange.js index 1f621867062..6316bd85a1d 100644 --- a/dom/telephony/test/marionette/test_incoming_onstatechange.js +++ b/dom/telephony/test/marionette/test_incoming_onstatechange.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -45,7 +45,7 @@ function answerIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); hold(); @@ -71,7 +71,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); resume(); @@ -97,7 +97,7 @@ function resume() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); hangUp(); @@ -122,7 +122,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_reject.js b/dom/telephony/test/marionette/test_incoming_reject.js index 618f351e889..c3c2c20dc96 100644 --- a/dom/telephony/test/marionette/test_incoming_reject.js +++ b/dom/telephony/test/marionette/test_incoming_reject.js @@ -22,13 +22,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incoming); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + number + " : incoming"); reject(); }); }; - emulator.runWithCallback("gsm call " + number); + emulator.runCmdWithCallback("gsm call " + number); } function reject() { @@ -51,7 +51,7 @@ function reject() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_incoming_remote_cancel.js b/dom/telephony/test/marionette/test_incoming_remote_cancel.js index 90887d96842..269dd08cd57 100644 --- a/dom/telephony/test/marionette/test_incoming_remote_cancel.js +++ b/dom/telephony/test/marionette/test_incoming_remote_cancel.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); cancelIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function cancelIncoming(){ @@ -42,12 +42,12 @@ function cancelIncoming(){ is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm cancel " + inNumber); + emulator.runCmdWithCallback("gsm cancel " + inNumber); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_incoming_remote_hangup_held.js b/dom/telephony/test/marionette/test_incoming_remote_hangup_held.js index 6df36a52531..5d3fa235401 100644 --- a/dom/telephony/test/marionette/test_incoming_remote_hangup_held.js +++ b/dom/telephony/test/marionette/test_incoming_remote_hangup_held.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -48,7 +48,7 @@ function answerIncoming() { is(incomingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); hold(); @@ -78,7 +78,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); hangUp(); @@ -100,12 +100,12 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm cancel " + inNumber); + emulator.runCmdWithCallback("gsm cancel " + inNumber); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_multiple_hold.js b/dom/telephony/test/marionette/test_multiple_hold.js index fffaf8deb78..063760f2e63 100644 --- a/dom/telephony/test/marionette/test_multiple_hold.js +++ b/dom/telephony/test/marionette/test_multiple_hold.js @@ -22,13 +22,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -49,7 +49,7 @@ function answerIncoming() { ok(gotConnecting); is(incomingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); holdCall(); @@ -80,7 +80,7 @@ function holdCall() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); dial(); @@ -108,7 +108,7 @@ function dial() { is(outgoingCall, event.call); is(outgoingCall.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); is(result[1], "outbound to " + outNumber + " : ringing"); @@ -129,14 +129,14 @@ function answerOutgoing() { is(outgoingCall.state, "connected"); is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); is(result[1], "outbound to " + outNumber + " : active"); holdSecondCall(); }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } // With one held call and one active, hold the active one; expect the first @@ -187,7 +187,7 @@ function verifyCalls() { is(telephony.calls[0], incomingCall); is(telephony.calls[1], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); is(result[1], "outbound to " + outNumber + " : held"); @@ -218,7 +218,7 @@ function hangUpIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); hangUpOutgoing(); @@ -249,7 +249,7 @@ function hangUpOutgoing() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_already_held.js b/dom/telephony/test/marionette/test_outgoing_already_held.js index 2708f8cc31b..e1d45a9c71c 100644 --- a/dom/telephony/test/marionette/test_outgoing_already_held.js +++ b/dom/telephony/test/marionette/test_outgoing_already_held.js @@ -29,13 +29,13 @@ function simulateIncoming() { }; let rcvdEmulatorCallback = false; - emulator.runWithCallback("gsm call " + inNumber, function(result) { + emulator.runCmdWithCallback("gsm call " + inNumber, function(result) { rcvdEmulatorCallback = true; }); } function verifyCallList(){ - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); @@ -61,7 +61,7 @@ function answerIncoming() { is(incomingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); holdCall(); @@ -92,7 +92,7 @@ function holdCall(){ is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); dial(); @@ -121,7 +121,7 @@ function dial() { is(outgoingCall, event.call); is(outgoingCall.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); is(result[1], "outbound to " + outNumber + " : ringing"); @@ -150,13 +150,13 @@ function answerOutgoing() { }; let rcvdEmulatorCallback = false; - emulator.runWithCallback("gsm accept " + outNumber, function(result) { + emulator.runCmdWithCallback("gsm accept " + outNumber, function(result) { rcvdEmulatorCallback = true; }); } function checkCallList(){ - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); is(result[1], "outbound to " + outNumber + " : active"); @@ -187,7 +187,7 @@ function hangUpIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); hangUpOutgoing(); @@ -218,7 +218,7 @@ function hangUpOutgoing() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_answer_hangup.js b/dom/telephony/test/marionette/test_outgoing_answer_hangup.js index 83976145967..38907ac5cc5 100644 --- a/dom/telephony/test/marionette/test_outgoing_answer_hangup.js +++ b/dom/telephony/test/marionette/test_outgoing_answer_hangup.js @@ -27,7 +27,7 @@ function dial() { is(outgoing, event.call); is(outgoing.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : ringing"); answer(); @@ -48,13 +48,13 @@ function answer() { is(outgoing, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : active"); hangUp(); }); }; - emulator.runWithCallback("gsm accept " + number); + emulator.runCmdWithCallback("gsm accept " + number); } function hangUp() { @@ -70,12 +70,12 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm cancel " + number); + emulator.runCmdWithCallback("gsm cancel " + number); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js b/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js index 2a19b6598de..7a79472232c 100644 --- a/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js +++ b/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js @@ -46,7 +46,7 @@ function dial() { } function checkCallList() { - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); if (((result[0] == "outbound to " + number + " : unknown") || (result[0] == "outbound to " + number + " : dialing"))) { @@ -69,19 +69,19 @@ function answer() { is(outgoing, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list (after 'connected' event) is now: " + result); is(result[0], "outbound to " + number + " : active"); hangUp(); }); }; - emulator.runWithCallback("gsm accept " + number); + emulator.runCmdWithCallback("gsm accept " + number); } function hangUp() { log("Hanging up the outgoing call."); - emulator.runWithCallback("gsm cancel " + number); + emulator.runCmdWithCallback("gsm cancel " + number); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js b/dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js index aec488255ec..766ebe9330a 100644 --- a/dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js +++ b/dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js @@ -26,7 +26,7 @@ function dial() { is(outgoingCall, event.call); is(outgoingCall.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : ringing"); answer(); @@ -47,13 +47,13 @@ function answer() { is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); hangUp(); }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } function hangUp() { @@ -76,7 +76,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_answer_radio_off.js b/dom/telephony/test/marionette/test_outgoing_answer_radio_off.js index 78fd30d3c4f..437d30c0f85 100644 --- a/dom/telephony/test/marionette/test_outgoing_answer_radio_off.js +++ b/dom/telephony/test/marionette/test_outgoing_answer_radio_off.js @@ -59,7 +59,7 @@ function remoteAnswer(call) { is(call.state, "connected"); deferred.resolve(call); }; - emulator.runWithCallback("gsm accept " + call.id.number); + emulator.runCmdWithCallback("gsm accept " + call.id.number); return deferred.promise; } diff --git a/dom/telephony/test/marionette/test_outgoing_badNumber.js b/dom/telephony/test/marionette/test_outgoing_badNumber.js index 26fda57300e..6bd0c198dae 100644 --- a/dom/telephony/test/marionette/test_outgoing_badNumber.js +++ b/dom/telephony/test/marionette/test_outgoing_badNumber.js @@ -30,7 +30,7 @@ function dial() { ok(event.call.error); is(event.call.error.name, "BadNumberError"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Initial call list: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_busy.js b/dom/telephony/test/marionette/test_outgoing_busy.js index 7886a8968bf..853a390f99b 100644 --- a/dom/telephony/test/marionette/test_outgoing_busy.js +++ b/dom/telephony/test/marionette/test_outgoing_busy.js @@ -25,7 +25,7 @@ function dial() { is(outgoing, event.call); is(outgoing.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : ringing"); busy(); @@ -42,13 +42,13 @@ function busy() { is(outgoing, event.call); is(event.call.error.name, "BusyError"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm busy " + number); + emulator.runCmdWithCallback("gsm busy " + number); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_outgoing_hangup_alerting.js b/dom/telephony/test/marionette/test_outgoing_hangup_alerting.js index cf03e822bc0..bf75e3833de 100644 --- a/dom/telephony/test/marionette/test_outgoing_hangup_alerting.js +++ b/dom/telephony/test/marionette/test_outgoing_hangup_alerting.js @@ -24,7 +24,7 @@ function dial() { outgoing.onalerting = function onalerting(event) { log("Received 'alerting' call event."); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : ringing"); hangUp(); @@ -54,7 +54,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_hangup_held.js b/dom/telephony/test/marionette/test_outgoing_hangup_held.js index 5f8855ec044..87a5ecf9f44 100644 --- a/dom/telephony/test/marionette/test_outgoing_hangup_held.js +++ b/dom/telephony/test/marionette/test_outgoing_hangup_held.js @@ -26,7 +26,7 @@ function dial() { is(outgoing, event.call); is(outgoing.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : ringing"); answer(); @@ -47,13 +47,13 @@ function answer() { is(outgoing, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : active"); hold(); }); }; - emulator.runWithCallback("gsm accept " + number); + emulator.runCmdWithCallback("gsm accept " + number); } function hold() { @@ -75,7 +75,7 @@ function hold() { is(telephony.active, null); is(telephony.calls.length, 1); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : held"); hangUp(); @@ -104,7 +104,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_hold_resume.js b/dom/telephony/test/marionette/test_outgoing_hold_resume.js index ad2b7e0e998..18258075377 100644 --- a/dom/telephony/test/marionette/test_outgoing_hold_resume.js +++ b/dom/telephony/test/marionette/test_outgoing_hold_resume.js @@ -26,7 +26,7 @@ function dial() { is(outgoingCall, event.call); is(outgoingCall.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : ringing"); answer(); @@ -47,13 +47,13 @@ function answer() { is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : active"); hold(); }); }; - emulator.runWithCallback("gsm accept " + number); + emulator.runCmdWithCallback("gsm accept " + number); } function hold() { @@ -77,7 +77,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : held"); // Bug 781604: emulator assertion if outgoing call kept on hold @@ -111,7 +111,7 @@ function resume() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : active"); hangUp(); @@ -140,7 +140,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_onstatechange.js b/dom/telephony/test/marionette/test_outgoing_onstatechange.js index 8aa850b2ea8..a0c984d30d2 100644 --- a/dom/telephony/test/marionette/test_outgoing_onstatechange.js +++ b/dom/telephony/test/marionette/test_outgoing_onstatechange.js @@ -28,7 +28,7 @@ function dial() { ok(expectedStates.indexOf(event.call.state) != -1); if (event.call.state == "alerting") { - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : ringing"); answer(); @@ -49,13 +49,13 @@ function answer() { is(outgoingCall.state, "connected"); is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); hold(); }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } function hold() { @@ -74,7 +74,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); resume(); @@ -100,7 +100,7 @@ function resume() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); hangUp(); @@ -125,7 +125,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_radio_off.js b/dom/telephony/test/marionette/test_outgoing_radio_off.js index 17334beb555..92de9015567 100644 --- a/dom/telephony/test/marionette/test_outgoing_radio_off.js +++ b/dom/telephony/test/marionette/test_outgoing_radio_off.js @@ -47,7 +47,7 @@ function dial(number) { is(telephony.calls.length, 0); is(cause, "RadioNotAvailable"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Initial call list: " + result); setRadioEnabled(true, cleanUp); diff --git a/dom/telephony/test/marionette/test_outgoing_reject.js b/dom/telephony/test/marionette/test_outgoing_reject.js index 1dfe738065d..fe5ab199f69 100644 --- a/dom/telephony/test/marionette/test_outgoing_reject.js +++ b/dom/telephony/test/marionette/test_outgoing_reject.js @@ -25,7 +25,7 @@ function dial() { is(outgoing, event.call); is(outgoing.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + number + " : ringing"); reject(); @@ -53,13 +53,13 @@ function reject() { }; let rcvdEmulatorCallback = false; - emulator.runWithCallback("gsm cancel " + number, function(result) { + emulator.runCmdWithCallback("gsm cancel " + number, function(result) { rcvdEmulatorCallback = true; }); } function verifyCallList(){ - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); diff --git a/dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js b/dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js index c4ed18e9e76..b8fc026a66c 100644 --- a/dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js +++ b/dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js @@ -25,7 +25,7 @@ function dial() { is(outgoingCall, event.call); is(outgoingCall.state, "alerting"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : ringing"); answer(); @@ -46,13 +46,13 @@ function answer() { is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); hold(); }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } function hold() { @@ -75,7 +75,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); hangUp(); @@ -97,12 +97,12 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); }; - emulator.runWithCallback("gsm cancel " + outNumber); + emulator.runCmdWithCallback("gsm cancel " + outNumber); } function cleanUp() { diff --git a/dom/telephony/test/marionette/test_redundant_operations.js b/dom/telephony/test/marionette/test_redundant_operations.js index 6a607894f21..671fee935df 100644 --- a/dom/telephony/test/marionette/test_redundant_operations.js +++ b/dom/telephony/test/marionette/test_redundant_operations.js @@ -20,13 +20,13 @@ function simulateIncoming() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } function answerIncoming() { @@ -48,7 +48,7 @@ function answerIncoming() { is(incomingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); answerAlreadyConnected(); @@ -100,7 +100,7 @@ function hold() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); holdAlreadyHeld(); @@ -176,7 +176,7 @@ function resume() { is(telephony.calls.length, 1); is(telephony.calls[0], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : active"); resumeNonHeld(); @@ -227,7 +227,7 @@ function hangUp() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); answerDisconnected(); }); diff --git a/dom/telephony/test/marionette/test_swap_held_and_active.js b/dom/telephony/test/marionette/test_swap_held_and_active.js index 7233141b7dd..946c59cfb7d 100644 --- a/dom/telephony/test/marionette/test_swap_held_and_active.js +++ b/dom/telephony/test/marionette/test_swap_held_and_active.js @@ -29,7 +29,7 @@ function dial() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : ringing"); answer(); @@ -49,7 +49,7 @@ function answer() { is(outgoingCall.state, "connected"); is(outgoingCall, telephony.active); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); @@ -63,7 +63,7 @@ function answer() { } }); }; - emulator.runWithCallback("gsm accept " + outNumber); + emulator.runCmdWithCallback("gsm accept " + outNumber); } function holdCall() { @@ -87,7 +87,7 @@ function holdCall() { is(telephony.calls.length, 1); is(telephony.calls[0], outgoingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); simulateIncoming(); @@ -112,14 +112,14 @@ function simulateIncoming() { is(telephony.calls[0], outgoingCall); is(telephony.calls[1], incomingCall); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); is(result[1], "inbound from " + inNumber + " : incoming"); answerIncoming(); }); }; - emulator.runWithCallback("gsm call " + inNumber); + emulator.runCmdWithCallback("gsm call " + inNumber); } // Answer incoming call; original outgoing call should be held @@ -145,7 +145,7 @@ function answerIncoming() { is(outgoingCall.state, "held"); is(incomingCall.state, "connected"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : held"); is(result[1], "inbound from " + inNumber + " : active"); @@ -198,7 +198,7 @@ function verifySwap() { is(outgoingCall.state, "connected"); is(incomingCall.state, "held"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "outbound to " + outNumber + " : active"); is(result[1], "inbound from " + inNumber + " : held"); @@ -230,7 +230,7 @@ function hangUpOutgoing() { is(telephony.calls.length, 1); is(incomingCall.state, "held"); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); is(result[0], "inbound from " + inNumber + " : held"); hangUpIncoming(); @@ -261,7 +261,7 @@ function hangUpIncoming() { is(telephony.active, null); is(telephony.calls.length, 0); - emulator.runWithCallback("gsm list", function(result) { + emulator.runCmdWithCallback("gsm list", function(result) { log("Call list is now: " + result); cleanUp(); }); From 9fdd9aeaf947ecc153a95ea3e77ecd2cce08eac4 Mon Sep 17 00:00:00 2001 From: Hsin-Yi Tsai Date: Tue, 24 Jun 2014 18:32:41 +0800 Subject: [PATCH 02/26] Bug 1023141 - query ril.ecclist per dial request - part 1 - fix. r=aknow --- dom/system/gonk/RadioInterfaceLayer.js | 4 +- dom/system/gonk/ril_worker.js | 132 +++++++++++-------------- dom/telephony/gonk/TelephonyService.js | 30 +++++- 3 files changed, 86 insertions(+), 80 deletions(-) diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index afe9bb76813..55520bce7c1 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -1629,9 +1629,7 @@ WorkerMessenger.prototype = { libcutils.property_get("ro.moz.ril.send_stk_profile_dl", "false") == "true", dataRegistrationOnDemand: RILQUIRKS_DATA_REGISTRATION_ON_DEMAND, subscriptionControl: RILQUIRKS_SUBSCRIPTION_CONTROL - }, - rilEmergencyNumbers: libcutils.property_get("ril.ecclist") || - libcutils.property_get("ro.ril.ecclist") + } }; this.send(null, "setInitialOptions", options); diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 40998f4353c..70b86f66ff1 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -52,9 +52,6 @@ if (!this.debug) { }; } -let RIL_EMERGENCY_NUMBERS; -const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"]; - // Timeout value for emergency callback mode. const EMERGENCY_CB_MODE_TIMEOUT_MS = 300000; // 5 mins = 300000 ms. @@ -1555,7 +1552,7 @@ RilObject.prototype = { cachedDialRequest : null, /** - * Dial the phone. + * Dial a non-emergency number. * * @param number * String containing the number to dial. @@ -1564,34 +1561,13 @@ RilObject.prototype = { * @param uusInfo * Integer doing something XXX TODO */ - dial: function(options) { + dialNonEmergencyNumber: function(options) { let onerror = (function onerror(options, errorMsg) { options.success = false; options.errorMsg = errorMsg; this.sendChromeMessage(options); }).bind(this, options); - if (this._isEmergencyNumber(options.number)) { - this.dialEmergencyNumber(options, onerror); - } else { - if (!this._isCdma) { - // TODO: Both dial() and sendMMI() functions should be unified at some - // point in the future. In the mean time we handle temporary CLIR MMI - // commands through the dial() function. Please see bug 889737. - let mmi = this._parseMMI(options.number); - if (mmi && this._isTemporaryModeCLIR(mmi)) { - options.number = mmi.dialNumber; - // In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI - // presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B. - options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ? - CLIR_SUPPRESSION : CLIR_INVOCATION; - } - } - this.dialNonEmergencyNumber(options, onerror); - } - }, - - dialNonEmergencyNumber: function(options, onerror) { if (this.radioState == GECKO_RADIOSTATE_OFF) { // Notify error in establishing the call without radio. onerror(GECKO_ERROR_RADIO_NOT_AVAILABLE); @@ -1609,17 +1585,41 @@ RilObject.prototype = { this.exitEmergencyCbMode(); } - if (this._isCdma && Object.keys(this.currentCalls).length == 1) { - // Make a Cdma 3way call. - options.featureStr = options.number; - this.sendCdmaFlashCommand(options); - } else { - options.request = REQUEST_DIAL; - this.sendDialRequest(options); + if (!this._isCdma) { + // TODO: Both dial() and sendMMI() functions should be unified at some + // point in the future. In the mean time we handle temporary CLIR MMI + // commands through the dial() function. Please see bug 889737. + let mmi = this._parseMMI(options.number); + if (mmi && this._isTemporaryModeCLIR(mmi)) { + options.number = mmi.dialNumber; + // In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI + // presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B. + options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ? + CLIR_SUPPRESSION : CLIR_INVOCATION; + } } + + options.request = REQUEST_DIAL; + this.sendDialRequest(options); }, - dialEmergencyNumber: function(options, onerror) { + /** + * Dial an emergency number. + * + * @param number + * String containing the number to dial. + * @param clirMode + * Integer for showing/hidding the caller Id to the called party. + * @param uusInfo + * Integer doing something XXX TODO + */ + dialEmergencyNumber: function(options) { + let onerror = (function onerror(options, errorMsg) { + options.success = false; + options.errorMsg = errorMsg; + this.sendChromeMessage(options); + }).bind(this, options); + options.request = RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL ? REQUEST_DIAL_EMERGENCY_CALL : REQUEST_DIAL; if (this.radioState == GECKO_RADIOSTATE_OFF) { @@ -1636,20 +1636,20 @@ RilObject.prototype = { return; } + this.sendDialRequest(options); + }, + + sendDialRequest: function(options) { if (this._isCdma && Object.keys(this.currentCalls).length == 1) { // Make a Cdma 3way call. options.featureStr = options.number; this.sendCdmaFlashCommand(options); } else { - this.sendDialRequest(options); + this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial, + options); } }, - sendDialRequest: function(options) { - this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial, - options); - }, - sendRilRequestDial: function(options) { let Buf = this.context.Buf; Buf.newParcel(options.request, options); @@ -2417,9 +2417,8 @@ RilObject.prototype = { return false; } - if (this._isEmergencyNumber(mmiString)) { - return false; - } + // TODO: Should take care of checking if the string is an emergency number + // in Bug 889737. See Bug 1023141 for more background. // In a call case. if (Object.getOwnPropertyNames(this.currentCalls).length > 0) { @@ -3309,38 +3308,18 @@ RilObject.prototype = { }, /** - * Check a given number against the list of emergency numbers provided by the RIL. + * Checks whether to temporarily suppress caller id for the call. * - * @param number - * The number to look up. + * @param mmi + * MMI full object. */ - _isEmergencyNumber: function(number) { - // Check ril provided numbers first. - let numbers = RIL_EMERGENCY_NUMBERS; - - if (numbers) { - numbers = numbers.split(","); - } else { - // No ecclist system property, so use our own list. - numbers = DEFAULT_EMERGENCY_NUMBERS; - } - - return numbers.indexOf(number) != -1; - }, - - /** - * Checks whether to temporarily suppress caller id for the call. - * - * @param mmi - * MMI full object. - */ - _isTemporaryModeCLIR: function(mmi) { - return (mmi && - mmi.serviceCode == MMI_SC_CLIR && - mmi.dialNumber && - (mmi.procedure == MMI_PROCEDURE_ACTIVATION || - mmi.procedure == MMI_PROCEDURE_DEACTIVATION)); - }, + _isTemporaryModeCLIR: function(mmi) { + return (mmi && + mmi.serviceCode == MMI_SC_CLIR && + mmi.dialNumber && + (mmi.procedure == MMI_PROCEDURE_ACTIVATION || + mmi.procedure == MMI_PROCEDURE_DEACTIVATION)); + }, /** * Report STK Service is running. @@ -4055,6 +4034,7 @@ RilObject.prototype = { for (let i in newCalls) { if (newCalls[i].state !== CALL_STATE_INCOMING) { callIndex = newCalls[i].callIndex; + newCalls[i].isEmergency = options.isEmergency; break; } } @@ -4105,9 +4085,9 @@ RilObject.prototype = { newCall.isOutgoing = true; } - // Set flag for outgoing emergency call. - newCall.isEmergency = newCall.isOutgoing && - this._isEmergencyNumber(newCall.number); + if (newCall.isEmergency === undefined) { + newCall.isEmergency = false; + } // Set flag for conference. newCall.isConference = newCall.isMpty ? true : false; diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index a10c4340b9c..03e5244ca5a 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -10,6 +10,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Promise.jsm"); +Cu.import("resource://gre/modules/systemlibs.js"); var RIL = {}; Cu.import("resource://gre/modules/ril_consts.js", RIL); @@ -47,6 +48,8 @@ const AUDIO_STATE_NAME = [ "PHONE_STATE_IN_CALL" ]; +const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"]; + let DEBUG; function debug(s) { dump("TelephonyService: " + s + "\n"); @@ -327,6 +330,26 @@ TelephonyService.prototype = { }).bind(this)); }, + /** + * Check a given number against the list of emergency numbers provided by the + * RIL. + * + * @param aNumber + * The number to look up. + */ + _isEmergencyNumber: function(aNumber) { + // Check ril provided numbers first. + let numbers = libcutils.property_get("ril.ecclist") || + libcutils.property_get("ro.ril.ecclist"); + if (numbers) { + numbers = numbers.split(","); + } else { + // No ecclist system property, so use our own list. + numbers = DEFAULT_EMERGENCY_NUMBERS; + } + return numbers.indexOf(aNumber) != -1; + }, + /** * nsITelephonyService interface. */ @@ -474,9 +497,14 @@ TelephonyService.prototype = { this.notifyCallStateChanged(aClientId, parentCall); }; + let isEmergencyNumber = this._isEmergencyNumber(aNumber); + let msg = isEmergencyNumber ? + "dialEmergencyNumber" : + "dialNonEmergencyNumber"; this.isDialing = true; - this._getClient(aClientId).sendWorkerMessage("dial", { + this._getClient(aClientId).sendWorkerMessage(msg, { number: aNumber, + isEmergency: isEmergencyNumber, isDialEmergency: aIsEmergency }, (function(response) { this.isDialing = false; From 8933ead71dc864c3300044e211f05c6c9bcb16e3 Mon Sep 17 00:00:00 2001 From: Hsin-Yi Tsai Date: Tue, 24 Jun 2014 18:47:12 +0800 Subject: [PATCH 03/26] Bug 1023141 - query ril.ecclist per dial request - part 2 - test case. r=aknow --- dom/telephony/test/marionette/head.js | 26 +++++++- .../test/marionette/test_emergency_label.js | 65 +++++++++++++++++-- 2 files changed, 83 insertions(+), 8 deletions(-) diff --git a/dom/telephony/test/marionette/head.js b/dom/telephony/test/marionette/head.js index dbf02e7053e..14edaa2e318 100644 --- a/dom/telephony/test/marionette/head.js +++ b/dom/telephony/test/marionette/head.js @@ -14,11 +14,19 @@ let emulator = (function() { let pendingCmdCount = 0; let originalRunEmulatorCmd = runEmulatorCmd; + let pendingShellCount = 0; + let originalRunEmulatorShell = runEmulatorShell; + // Overwritten it so people could not call this function directly. runEmulatorCmd = function() { throw "Use emulator.runCmdWithCallback(cmd, callback) instead of runEmulatorCmd"; }; + // Overwritten it so people could not call this function directly. + runEmulatorShell = function() { + throw "Use emulator.runShellCmd(cmd, callback) instead of runEmulatorShell"; + }; + function runCmd(cmd) { let deferred = Promise.defer(); @@ -44,6 +52,21 @@ let emulator = (function() { }); } + /** + * @return Promise + */ + function runShellCmd(aCommands) { + let deferred = Promise.defer(); + + ++pendingShellCount; + originalRunEmulatorShell(aCommands, function(aResult) { + --pendingShellCount; + deferred.resolve(aResult); + }); + + return deferred.promise; + } + /** * @return Promise */ @@ -53,7 +76,7 @@ let emulator = (function() { waitFor(function() { deferred.resolve(); }, function() { - return pendingCmdCount === 0; + return pendingCmdCount === 0 && pendingShellCount === 0; }); return deferred.promise; @@ -62,6 +85,7 @@ let emulator = (function() { return { runCmd: runCmd, runCmdWithCallback: runCmdWithCallback, + runShellCmd: runShellCmd, waitFinish: waitFinish }; }()); diff --git a/dom/telephony/test/marionette/test_emergency_label.js b/dom/telephony/test/marionette/test_emergency_label.js index caa92919632..41854468acd 100644 --- a/dom/telephony/test/marionette/test_emergency_label.js +++ b/dom/telephony/test/marionette/test_emergency_label.js @@ -4,7 +4,43 @@ MARIONETTE_TIMEOUT = 60000; MARIONETTE_HEAD_JS = 'head.js'; -function testEmergencyLabel(number, emergency) { +const DEFAULT_ECC_LIST = "112,911"; + +function setEccListProperty(list) { + log("Set property ril.ecclist: " + list); + + let deferred = Promise.defer(); + try { + emulator.runShellCmd(["setprop","ril.ecclist", list]).then(function() { + deferred.resolve(list); + }); + } catch (e) { + deferred.reject(e); + } + return deferred.promise; +} + +function getEccListProperty() { + log("Get property ril.ecclist."); + + let deferred = Promise.defer(); + try { + emulator.runShellCmd(["getprop","ril.ecclist"]).then(function(aResult) { + let list = !aResult.length ? "" : aResult[0]; + deferred.resolve(list); + }); + } catch (e) { + deferred.reject(e); + } + return deferred.promise; +} + +function testEmergencyLabel(number, list) { + if (!list) { + list = DEFAULT_ECC_LIST; + } + let index = list.split(",").indexOf(number); + let emergency = index != -1; log("= testEmergencyLabel = " + number + " should be " + (emergency ? "emergency" : "normal") + " call"); @@ -23,12 +59,27 @@ function testEmergencyLabel(number, emergency) { } startTest(function() { - testEmergencyLabel("112", true) - .then(() => testEmergencyLabel("911", true)) - .then(() => testEmergencyLabel("0912345678", false)) - .then(() => testEmergencyLabel("777", false)) - .then(null, () => { - ok(false, 'promise rejects during test.'); + let origEccList; + let eccList; + + getEccListProperty() + .then(list => { + origEccList = eccList = list; + }) + .then(() => testEmergencyLabel("112", eccList)) + .then(() => testEmergencyLabel("911", eccList)) + .then(() => testEmergencyLabel("0912345678", eccList)) + .then(() => testEmergencyLabel("777", eccList)) + .then(() => { + eccList = "777,119"; + return setEccListProperty(eccList); + }) + .then(() => testEmergencyLabel("777", eccList)) + .then(() => testEmergencyLabel("119", eccList)) + .then(() => testEmergencyLabel("112", eccList)) + .then(() => setEccListProperty(origEccList)) + .then(null, error => { + ok(false, 'promise rejects during test: ' + error); }) .then(finish); }); From 50446da4a01cf40127aac914d7df29186bb5cb39 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 29 Jun 2014 21:35:23 -0700 Subject: [PATCH 04/26] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ffb53607d294 Author: DouglasSherk Desc: Revert "bug 1021857 - Ensure z-index for AttentionScreen makes it top-most." This reverts commit 38a367ba17e8ce3f2a44884c584448f977a81eaf. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 71e0d1b9e83..98e342b8d6b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "b6c6dcfdef46399b88637c93a4f76d4425f7c096", + "revision": "ffb53607d2941324814de17e527531b7ae91df77", "repo_path": "/integration/gaia-central" } From 7d45a9e90451704bc5cc4b3f5ce6f9b569643f69 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 29 Jun 2014 21:41:39 -0700 Subject: [PATCH 05/26] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 996fd0b7072..c6b706d3852 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index a5886edefca..8be9dccc068 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ad638cc5972..34cbd0c5e99 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 996fd0b7072..c6b706d3852 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index fefa31b873d..9a4fd6f01f6 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 4183f922c93..1e82597625a 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 0bfb9bb09ec..d554a0720d2 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 12c1903b0fa..23a663bb945 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index be2cc1dee81..aa328b3e6e2 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 24d088957f06434bd49cf9b9c6c665474b4e7c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Wed, 7 May 2014 15:53:16 -0700 Subject: [PATCH 06/26] Bug 1024157 - Lazy load more js modules - part 1: NFC r=psiddh --- dom/apps/src/AppsUtils.jsm | 1 - dom/system/gonk/Nfc.js | 7 +++++-- dom/system/gonk/NfcContentHelper.js | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dom/apps/src/AppsUtils.jsm b/dom/apps/src/AppsUtils.jsm index c18f0d6da8d..5ad40162333 100644 --- a/dom/apps/src/AppsUtils.jsm +++ b/dom/apps/src/AppsUtils.jsm @@ -11,7 +11,6 @@ const Cr = Components.results; Cu.import("resource://gre/modules/osfile.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Promise.jsm"); diff --git a/dom/system/gonk/Nfc.js b/dom/system/gonk/Nfc.js index c5c821f9362..9d41c32f091 100644 --- a/dom/system/gonk/Nfc.js +++ b/dom/system/gonk/Nfc.js @@ -22,8 +22,11 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -let NFC = {}; -Cu.import("resource://gre/modules/nfc_consts.js", NFC); +XPCOMUtils.defineLazyGetter(this, "NFC", function () { + let obj = {}; + Cu.import("resource://gre/modules/nfc_consts.js", obj); + return obj; +}); Cu.import("resource://gre/modules/systemlibs.js"); const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true"; diff --git a/dom/system/gonk/NfcContentHelper.js b/dom/system/gonk/NfcContentHelper.js index b31879c747e..d55839be592 100644 --- a/dom/system/gonk/NfcContentHelper.js +++ b/dom/system/gonk/NfcContentHelper.js @@ -23,8 +23,11 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/DOMRequestHelper.jsm"); -let NFC = {}; -Cu.import("resource://gre/modules/nfc_consts.js", NFC); +XPCOMUtils.defineLazyGetter(this, "NFC", function () { + let obj = {}; + Cu.import("resource://gre/modules/nfc_consts.js", obj); + return obj; +}); Cu.import("resource://gre/modules/systemlibs.js"); const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true"; From 481ef86e6dc01ee23f0f27ada38afef4045378b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Wed, 7 May 2014 15:53:16 -0700 Subject: [PATCH 07/26] Bug 1024157 - Lazy load more js modules - Part 2: contacts r=gwagner --- dom/contacts/fallback/ContactDB.jsm | 4 +++- dom/contacts/fallback/ContactService.jsm | 7 +++++-- dom/phonenumberutils/PhoneNumber.jsm | 8 ++++++-- dom/phonenumberutils/PhoneNumberUtils.jsm | 9 ++++++--- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dom/contacts/fallback/ContactDB.jsm b/dom/contacts/fallback/ContactDB.jsm index 8cc9737a9ea..0caad00b496 100644 --- a/dom/contacts/fallback/ContactDB.jsm +++ b/dom/contacts/fallback/ContactDB.jsm @@ -15,9 +15,11 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/IndexedDBHelper.jsm"); -Cu.import("resource://gre/modules/PhoneNumberUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberUtils", + "resource://gre/modules/PhoneNumberUtils.jsm"); Cu.importGlobalProperties(["indexedDB"]); /* all exported symbols need to be bound to this on B2G - Bug 961777 */ diff --git a/dom/contacts/fallback/ContactService.jsm b/dom/contacts/fallback/ContactService.jsm index 68f0dad9afe..8040e7d8dde 100644 --- a/dom/contacts/fallback/ContactService.jsm +++ b/dom/contacts/fallback/ContactService.jsm @@ -15,8 +15,11 @@ this.EXPORTED_SYMBOLS = ["ContactService"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/ContactDB.jsm"); -Cu.import("resource://gre/modules/PhoneNumberUtils.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "ContactDB", + "resource://gre/modules/ContactDB.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberUtils", + "resource://gre/modules/PhoneNumberUtils.jsm"); XPCOMUtils.defineLazyServiceGetter(this, "ppmm", "@mozilla.org/parentprocessmessagemanager;1", diff --git a/dom/phonenumberutils/PhoneNumber.jsm b/dom/phonenumberutils/PhoneNumber.jsm index 1b100eea35f..849fe639d2a 100644 --- a/dom/phonenumberutils/PhoneNumber.jsm +++ b/dom/phonenumberutils/PhoneNumber.jsm @@ -8,9 +8,13 @@ this.EXPORTED_SYMBOLS = ["PhoneNumber"]; -Components.utils.import("resource://gre/modules/PhoneNumberMetaData.jsm"); -Components.utils.import("resource://gre/modules/PhoneNumberNormalizer.jsm"); +const Cu = Components.utils; +Cu.import('resource://gre/modules/XPCOMUtils.jsm'); +XPCOMUtils.defineLazyModuleGetter(this, "PHONE_NUMBER_META_DATA", + "resource://gre/modules/PhoneNumberMetaData.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberNormalizer", + "resource://gre/modules/PhoneNumberNormalizer.jsm"); this.PhoneNumber = (function (dataBase) { // Use strict in our context only - users might not want it 'use strict'; diff --git a/dom/phonenumberutils/PhoneNumberUtils.jsm b/dom/phonenumberutils/PhoneNumberUtils.jsm index dcd4e9d453f..64ca55574ed 100644 --- a/dom/phonenumberutils/PhoneNumberUtils.jsm +++ b/dom/phonenumberutils/PhoneNumberUtils.jsm @@ -14,8 +14,10 @@ const Ci = Components.interfaces; Cu.import("resource://gre/modules/Services.jsm"); Cu.import('resource://gre/modules/XPCOMUtils.jsm'); -Cu.import("resource://gre/modules/PhoneNumberNormalizer.jsm"); -Cu.import("resource://gre/modules/mcc_iso3166_table.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberNormalizer", + "resource://gre/modules/PhoneNumberNormalizer.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "MCC_ISO3166_TABLE", + "resource://gre/modules/mcc_iso3166_table.jsm"); #ifdef MOZ_B2G_RIL XPCOMUtils.defineLazyServiceGetter(this, "mobileConnection", @@ -196,7 +198,8 @@ this.PhoneNumberUtils = { let inParent = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime) .processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; if (inParent) { - Cu.import("resource://gre/modules/PhoneNumber.jsm"); + XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumber", + "resource://gre/modules/PhoneNumber.jsm"); XPCOMUtils.defineLazyServiceGetter(this, "ppmm", "@mozilla.org/parentprocessmessagemanager;1", "nsIMessageListenerManager"); From 6a00695aa4b91b50642c65a62e3ebbf5ed826b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Wed, 7 May 2014 15:53:17 -0700 Subject: [PATCH 08/26] Bug 1024157 - Lazy load more js modules - Part 3: RIL r=gene --- dom/mobilemessage/src/gonk/MobileMessageDB.jsm | 7 +++++-- dom/system/gonk/RILContentHelper.js | 7 +++++-- dom/system/gonk/RadioInterfaceLayer.js | 7 +++++-- dom/telephony/gonk/TelephonyService.js | 7 +++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dom/mobilemessage/src/gonk/MobileMessageDB.jsm b/dom/mobilemessage/src/gonk/MobileMessageDB.jsm index 2322e1646df..365f097197c 100644 --- a/dom/mobilemessage/src/gonk/MobileMessageDB.jsm +++ b/dom/mobilemessage/src/gonk/MobileMessageDB.jsm @@ -11,8 +11,11 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PhoneNumberUtils.jsm"); Cu.importGlobalProperties(["indexedDB"]); -var RIL = {}; -Cu.import("resource://gre/modules/ril_consts.js", RIL); +XPCOMUtils.defineLazyGetter(this, "RIL", function () { + let obj = {}; + Cu.import("resource://gre/modules/ril_consts.js", obj); + return obj; +}); const RIL_GETMESSAGESCURSOR_CID = Components.ID("{484d1ad8-840e-4782-9dc4-9ebc4d914937}"); diff --git a/dom/system/gonk/RILContentHelper.js b/dom/system/gonk/RILContentHelper.js index cada95afd96..334942ba41e 100644 --- a/dom/system/gonk/RILContentHelper.js +++ b/dom/system/gonk/RILContentHelper.js @@ -21,8 +21,11 @@ Cu.import("resource://gre/modules/DOMRequestHelper.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -var RIL = {}; -Cu.import("resource://gre/modules/ril_consts.js", RIL); +XPCOMUtils.defineLazyGetter(this, "RIL", function () { + let obj = {}; + Cu.import("resource://gre/modules/ril_consts.js", obj); + return obj; +}); const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown"; diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 55520bce7c1..98134c33327 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -24,8 +24,11 @@ Cu.import("resource://gre/modules/systemlibs.js"); Cu.import("resource://gre/modules/Promise.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); -var RIL = {}; -Cu.import("resource://gre/modules/ril_consts.js", RIL); +XPCOMUtils.defineLazyGetter(this, "RIL", function () { + let obj = {}; + Cu.import("resource://gre/modules/ril_consts.js", obj); + return obj; +}); // Ril quirk to attach data registration on demand. let RILQUIRKS_DATA_REGISTRATION_ON_DEMAND = diff --git a/dom/telephony/gonk/TelephonyService.js b/dom/telephony/gonk/TelephonyService.js index 03e5244ca5a..b523d914a04 100644 --- a/dom/telephony/gonk/TelephonyService.js +++ b/dom/telephony/gonk/TelephonyService.js @@ -12,8 +12,11 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Promise.jsm"); Cu.import("resource://gre/modules/systemlibs.js"); -var RIL = {}; -Cu.import("resource://gre/modules/ril_consts.js", RIL); +XPCOMUtils.defineLazyGetter(this, "RIL", function () { + let obj = {}; + Cu.import("resource://gre/modules/ril_consts.js", obj); + return obj; +}); const GONK_TELEPHONYSERVICE_CONTRACTID = "@mozilla.org/telephony/gonktelephonyservice;1"; From 95167634d4829955a2dc14fe96b7f1c15d95a5a0 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 30 Jun 2014 11:02:39 +1200 Subject: [PATCH 09/26] Bug 1024300 - Allow GMPs to be segregated by origin. r=josh --- content/media/gmp/GMPParent.cpp | 21 +++++++ content/media/gmp/GMPParent.h | 24 ++++++++ content/media/gmp/GMPService.cpp | 60 +++++++++++++++---- content/media/gmp/GMPService.h | 8 ++- content/media/gmp/GMPVideoHost.cpp | 2 +- .../media/gmp/mozIGeckoMediaPluginService.idl | 20 +++++-- .../src/media-conduit/WebrtcGmpVideoCodec.cpp | 15 ++++- 7 files changed, 127 insertions(+), 23 deletions(-) diff --git a/content/media/gmp/GMPParent.cpp b/content/media/gmp/GMPParent.cpp index 23dc12e1a98..2e3a5d228f4 100644 --- a/content/media/gmp/GMPParent.cpp +++ b/content/media/gmp/GMPParent.cpp @@ -420,5 +420,26 @@ GMPParent::ReadGMPMetaData() return NS_OK; } +bool +GMPParent::CanBeSharedCrossOrigin() const +{ + return mOrigin.IsEmpty(); +} + +bool +GMPParent::CanBeUsedFrom(const nsAString& aOrigin) const +{ + return (mOrigin.IsEmpty() && State() == GMPStateNotLoaded) || + mOrigin.Equals(aOrigin); +} + +void +GMPParent::SetOrigin(const nsAString& aOrigin) +{ + MOZ_ASSERT(!aOrigin.IsEmpty()); + MOZ_ASSERT(CanBeUsedFrom(aOrigin)); + mOrigin = aOrigin; +} + } // namespace gmp } // namespace mozilla diff --git a/content/media/gmp/GMPParent.h b/content/media/gmp/GMPParent.h index 7ed3d391e4c..508af8671ed 100644 --- a/content/media/gmp/GMPParent.h +++ b/content/media/gmp/GMPParent.h @@ -56,6 +56,27 @@ public: nsIThread* GMPThread(); #endif + // A GMP can either be a single instance shared across all origins (like + // in the OpenH264 case), or we can require a new plugin instance for every + // origin running the plugin (as in the EME plugin case). + // + // Plugins are associated with an origin by calling SetOrigin() before + // loading. + // + // If a plugin has no origin specified and it is loaded, it is assumed to + // be shared across origins. + + // Specifies that a GMP can only work with the specified origin. + void SetOrigin(const nsAString& aOrigin); + + // Returns true if a plugin can be or is being used across multiple origins. + bool CanBeSharedCrossOrigin() const; + + // A GMP can be used from an origin if it's already been set to work with + // that origin, or if it's not been set to work with any origin and has + // not yet been loaded (i.e. it's not shared across origins). + bool CanBeUsedFrom(const nsAString& aOrigin) const; + private: ~GMPParent(); bool EnsureProcessLoaded(); @@ -80,6 +101,9 @@ private: #ifdef DEBUG nsCOMPtr mGMPThread; #endif + // Origin the plugin is assigned to, or empty if the the plugin is not + // assigned to an origin. + nsAutoString mOrigin; }; } // namespace gmp diff --git a/content/media/gmp/GMPService.cpp b/content/media/gmp/GMPService.cpp index 6d21466503a..9d84b63c9c2 100644 --- a/content/media/gmp/GMPService.cpp +++ b/content/media/gmp/GMPService.cpp @@ -191,16 +191,23 @@ GeckoMediaPluginService::GetThread(nsIThread** aThread) } NS_IMETHODIMP -GeckoMediaPluginService::GetGMPVideoDecoderVP8(GMPVideoHost** aOutVideoHost, GMPVideoDecoder** aGMPVD) +GeckoMediaPluginService::GetGMPVideoDecoder(nsTArray* aTags, + const nsAString& aOrigin, + GMPVideoHost** aOutVideoHost, + GMPVideoDecoder** aGMPVD) { MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread); + NS_ENSURE_ARG(aTags && aTags->Length() > 0); + NS_ENSURE_ARG(aOutVideoHost); + NS_ENSURE_ARG(aGMPVD); if (mShuttingDownOnGMPThread) { return NS_ERROR_FAILURE; } - nsRefPtr gmp = SelectPluginForAPI(NS_LITERAL_CSTRING("decode-video"), - NS_LITERAL_CSTRING("vp8")); + nsRefPtr gmp = SelectPluginForAPI(aOrigin, + NS_LITERAL_CSTRING("decode-video"), + *aTags); if (!gmp) { return NS_ERROR_FAILURE; } @@ -218,16 +225,23 @@ GeckoMediaPluginService::GetGMPVideoDecoderVP8(GMPVideoHost** aOutVideoHost, GMP } NS_IMETHODIMP -GeckoMediaPluginService::GetGMPVideoEncoderVP8(GMPVideoHost** aOutVideoHost, GMPVideoEncoder** aGMPVE) +GeckoMediaPluginService::GetGMPVideoEncoder(nsTArray* aTags, + const nsAString& aOrigin, + GMPVideoHost** aOutVideoHost, + GMPVideoEncoder** aGMPVE) { MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread); + NS_ENSURE_ARG(aTags && aTags->Length() > 0); + NS_ENSURE_ARG(aOutVideoHost); + NS_ENSURE_ARG(aGMPVE); if (mShuttingDownOnGMPThread) { return NS_ERROR_FAILURE; } - nsRefPtr gmp = SelectPluginForAPI(NS_LITERAL_CSTRING("encode-video"), - NS_LITERAL_CSTRING("vp8")); + nsRefPtr gmp = SelectPluginForAPI(aOrigin, + NS_LITERAL_CSTRING("encode-video"), + *aTags); if (!gmp) { return NS_ERROR_FAILURE; } @@ -259,30 +273,50 @@ GeckoMediaPluginService::UnloadPlugins() } GMPParent* -GeckoMediaPluginService::SelectPluginForAPI(const nsCString& aAPI, - const nsCString& aTag) +GeckoMediaPluginService::SelectPluginForAPI(const nsAString& aOrigin, + const nsCString& aAPI, + const nsTArray& aTags) { MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread); - GMPParent* gmp = SelectPluginFromListForAPI(aAPI, aTag); + GMPParent* gmp = SelectPluginFromListForAPI(aOrigin, aAPI, aTags); if (gmp) { return gmp; } RefreshPluginList(); - return SelectPluginFromListForAPI(aAPI, aTag); + return SelectPluginFromListForAPI(aOrigin, aAPI, aTags); } GMPParent* -GeckoMediaPluginService::SelectPluginFromListForAPI(const nsCString& aAPI, - const nsCString& aTag) +GeckoMediaPluginService::SelectPluginFromListForAPI(const nsAString& aOrigin, + const nsCString& aAPI, + const nsTArray& aTags) { MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread); for (uint32_t i = 0; i < mPlugins.Length(); i++) { GMPParent* gmp = mPlugins[i]; - if (gmp->SupportsAPI(aAPI, aTag)) { + bool supportsAllTags = true; + for (uint32_t t = 0; t < aTags.Length(); t++) { + const nsCString& tag = aTags[t]; + if (!gmp->SupportsAPI(aAPI, tag)) { + supportsAllTags = false; + break; + } + } + if (!supportsAllTags) { + continue; + } + if (aOrigin.IsEmpty()) { + if (gmp->CanBeSharedCrossOrigin()) { + return gmp; + } + } else if (gmp->CanBeUsedFrom(aOrigin)) { + if (!aOrigin.IsEmpty()) { + gmp->SetOrigin(aOrigin); + } return gmp; } } diff --git a/content/media/gmp/GMPService.h b/content/media/gmp/GMPService.h index f17cf13df57..4e2d5fa9977 100644 --- a/content/media/gmp/GMPService.h +++ b/content/media/gmp/GMPService.h @@ -38,8 +38,12 @@ public: private: ~GeckoMediaPluginService(); - GMPParent* SelectPluginFromListForAPI(const nsCString& aAPI, const nsCString& aTag); - GMPParent* SelectPluginForAPI(const nsCString& aAPI, const nsCString& aTag); + GMPParent* SelectPluginFromListForAPI(const nsAString& aOrigin, + const nsCString& aAPI, + const nsTArray& aTags); + GMPParent* SelectPluginForAPI(const nsAString& aOrigin, + const nsCString& aAPI, + const nsTArray& aTags); void UnloadPlugins(); void RefreshPluginList(); diff --git a/content/media/gmp/GMPVideoHost.cpp b/content/media/gmp/GMPVideoHost.cpp index 657ba51dd69..654431e6a92 100644 --- a/content/media/gmp/GMPVideoHost.cpp +++ b/content/media/gmp/GMPVideoHost.cpp @@ -96,7 +96,7 @@ GMPVideoHostImpl::ActorDestroyed() mEncodedFrames[i - 1]->ActorDestroyed(); mEncodedFrames.RemoveElementAt(i - 1); } - mSharedMemMgr = nullptr; + mSharedMemMgr = nullptr; } void diff --git a/content/media/gmp/mozIGeckoMediaPluginService.idl b/content/media/gmp/mozIGeckoMediaPluginService.idl index 759e3304dc9..4a96b0e14a1 100644 --- a/content/media/gmp/mozIGeckoMediaPluginService.idl +++ b/content/media/gmp/mozIGeckoMediaPluginService.idl @@ -5,8 +5,11 @@ #include "nsISupports.idl" #include "nsIThread.idl" +#include "nsIPrincipal.idl" %{C++ +#include "nsTArray.h" +#include "nsStringGlue.h" class GMPVideoDecoder; class GMPVideoEncoder; class GMPVideoHost; @@ -16,6 +19,7 @@ class GMPVideoHost; [ptr] native GMPVideoEncoder(GMPVideoEncoder); [ptr] native GMPVideoHost(GMPVideoHost); [ptr] native MessageLoop(MessageLoop); +[ptr] native TagArray(nsTArray); [uuid(BF5A9086-70F5-4D38-832D-1609BBF963CD)] interface mozIGeckoMediaPluginService : nsISupports @@ -24,11 +28,19 @@ interface mozIGeckoMediaPluginService : nsISupports // Callable from any thread. readonly attribute nsIThread thread; - // Returns a video decoder API object that should support VP8. + // Returns a video decoder that supports the specified tags. + // The array of tags should at least contain a codec tag, and optionally + // other tags such as for EME keysystem. // Callable only on GMP thread. - GMPVideoDecoder getGMPVideoDecoderVP8(out GMPVideoHost outVideoHost); + GMPVideoDecoder getGMPVideoDecoder(in TagArray tags, + [optional] in AString origin, + out GMPVideoHost outVideoHost); - // Returns a video encoder API object that should support VP8. + // Returns a video encoder that supports the specified tags. + // The array of tags should at least contain a codec tag, and optionally + // other tags. // Callable only on GMP thread. - GMPVideoEncoder getGMPVideoEncoderVP8(out GMPVideoHost outVideoHost); + GMPVideoEncoder getGMPVideoEncoder(in TagArray tags, + [optional] in AString origin, + out GMPVideoHost outVideoHost); }; diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp index 6b6c222092f..080e43828aa 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp +++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp @@ -123,7 +123,12 @@ WebrtcGmpVideoEncoder::InitEncode_g(const webrtc::VideoCodec* aCodecSettings, GMPVideoHost* host = nullptr; GMPVideoEncoder* gmp = nullptr; - nsresult rv = mMPS->GetGMPVideoEncoderVP8(&host, &gmp); + nsTArray tags; + tags.AppendElement(NS_LITERAL_CSTRING("vp8")); + nsresult rv = mMPS->GetGMPVideoEncoder(&tags, + NS_LITERAL_STRING(""), + &host, + &gmp); if (NS_FAILED(rv)) { return WEBRTC_VIDEO_CODEC_ERROR; } @@ -458,8 +463,12 @@ WebrtcGmpVideoDecoder::InitDecode_g(const webrtc::VideoCodec* aCodecSettings, GMPVideoHost* host = nullptr; GMPVideoDecoder* gmp = nullptr; - if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoDecoderVP8(&host, &gmp)))) - { + nsTArray tags; + tags.AppendElement(NS_LITERAL_CSTRING("vp8")); + if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoDecoder(&tags, + NS_LITERAL_STRING(""), + &host, + &gmp)))) { return WEBRTC_VIDEO_CODEC_ERROR; } From 90ecdd4036efef1590f4518a40cca1be3b003a90 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 30 Jun 2014 11:23:04 +1200 Subject: [PATCH 10/26] Bug 1024405 - Discard enqueued samples when making video decoders dormant. r=kinetik --- content/media/MediaDecoderStateMachine.cpp | 58 +++++++++++++--------- content/media/MediaDecoderStateMachine.h | 5 ++ 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/content/media/MediaDecoderStateMachine.cpp b/content/media/MediaDecoderStateMachine.cpp index e4df2d85954..5db4955a8d3 100644 --- a/content/media/MediaDecoderStateMachine.cpp +++ b/content/media/MediaDecoderStateMachine.cpp @@ -2243,31 +2243,10 @@ nsresult MediaDecoderStateMachine::RunStateMachine() StopPlayback(); } - // Put a task in the decode queue to abort any decoding operations. - // The reader is not supposed to put any tasks to deliver samples into - // the queue after we call this (unless we request another sample from it). - RefPtr task; - task = NS_NewRunnableMethod(mReader, &MediaDecoderReader::ResetDecode); - mDecodeTaskQueue->Dispatch(task); - - { - // Wait for the thread decoding to abort decoding operations and run - // any pending callbacks. This is important, as we don't want any - // pending tasks posted to the task queue by the reader to deliver - // any samples after we've posted the reader Shutdown() task below, - // as the sample-delivery tasks will keep video frames alive until - // after we've called Reader::Shutdown(), and shutdown on B2G will - // fail as there are outstanding video frames alive. - ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor()); - mDecodeTaskQueue->Flush(); - } - - // We must reset playback so that all references to frames queued - // in the state machine are dropped, else the Shutdown() call below - // can fail on B2G. - ResetPlayback(); + FlushDecoding(); // Put a task in the decode queue to shutdown the reader. + RefPtr task; task = NS_NewRunnableMethod(mReader, &MediaDecoderReader::Shutdown); mDecodeTaskQueue->Dispatch(task); @@ -2325,6 +2304,7 @@ nsresult MediaDecoderStateMachine::RunStateMachine() if (IsPlaying()) { StopPlayback(); } + FlushDecoding(); StopAudioThread(); // Now that those threads are stopped, there's no possibility of // mPendingWakeDecoder being needed again. Revoke it. @@ -2467,6 +2447,38 @@ nsresult MediaDecoderStateMachine::RunStateMachine() return NS_OK; } +void +MediaDecoderStateMachine::FlushDecoding() +{ + NS_ASSERTION(OnStateMachineThread() || OnDecodeThread(), + "Should be on state machine or decode thread."); + mDecoder->GetReentrantMonitor().AssertNotCurrentThreadIn(); + + // Put a task in the decode queue to abort any decoding operations. + // The reader is not supposed to put any tasks to deliver samples into + // the queue after we call this (unless we request another sample from it). + RefPtr task; + task = NS_NewRunnableMethod(mReader, &MediaDecoderReader::ResetDecode); + mDecodeTaskQueue->Dispatch(task); + + { + // Wait for the thread decoding to abort decoding operations and run + // any pending callbacks. This is important, as we don't want any + // pending tasks posted to the task queue by the reader to deliver + // any samples after we've posted the reader Shutdown() task below, + // as the sample-delivery tasks will keep video frames alive until + // after we've called Reader::Shutdown(), and shutdown on B2G will + // fail as there are outstanding video frames alive. + ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor()); + mDecodeTaskQueue->Flush(); + } + + // We must reset playback so that all references to frames queued + // in the state machine are dropped, else subsequent calls to Shutdown() + // or ReleaseMediaResources() can fail on B2G. + ResetPlayback(); +} + void MediaDecoderStateMachine::RenderVideoFrame(VideoData* aData, TimeStamp aTarget) { diff --git a/content/media/MediaDecoderStateMachine.h b/content/media/MediaDecoderStateMachine.h index 80faf60b98c..9fb34c29e12 100644 --- a/content/media/MediaDecoderStateMachine.h +++ b/content/media/MediaDecoderStateMachine.h @@ -445,6 +445,11 @@ protected: // Resets playback timing data. Called when we seek, on the decode thread. void ResetPlayback(); + // Orders the Reader to stop decoding, and blocks until the Reader + // has stopped decoding and finished delivering samples, then calls + // ResetPlayback() to discard all enqueued data. + void FlushDecoding(); + // Returns the audio clock, if we have audio, or -1 if we don't. // Called on the state machine thread. int64_t GetAudioClock(); From 3cc901260325debce46faa43fe2fbcc39896db3c Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Mon, 30 Jun 2014 03:00:10 +0100 Subject: [PATCH 11/26] Bug 965967 - Use Moz2D instead of a Thebes backed gfxContext in PluginInstanceChild::PaintRectToSurface. r=mattwoodrow --- dom/plugins/ipc/PluginInstanceChild.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index 60d27eb70b3..a54ab1dd623 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -3199,12 +3199,16 @@ PluginInstanceChild::PaintRectToSurface(const nsIntRect& aRect, #endif if (mIsTransparent && !CanPaintOnBackground()) { - // Clear surface content for transparent rendering - nsRefPtr ctx = new gfxContext(renderSurface); - ctx->SetDeviceColor(aColor); - ctx->SetOperator(gfxContext::OPERATOR_SOURCE); - ctx->Rectangle(GfxFromNsRect(plPaintRect)); - ctx->Fill(); + RefPtr dt = CreateDrawTargetForSurface(renderSurface); + gfx::Rect rect(plPaintRect.x, plPaintRect.y, + plPaintRect.width, plPaintRect.height); + // Moz2D treats OP_SOURCE operations as unbounded, so we need to + // clip to the rect that we want to fill: + dt->PushClipRect(rect); + dt->FillRect(rect, ColorPattern(ToColor(aColor)), + DrawOptions(1.f, CompositionOp::OP_SOURCE)); + dt->PopClip(); + dt->Flush(); } PaintRectToPlatformSurface(plPaintRect, renderSurface); From 10a5f23c40a1d0018112136b7600292d6768469e Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Mon, 30 Jun 2014 14:25:11 +1000 Subject: [PATCH 12/26] Bug 1031199 - Disallow aWeight = 0 when calling gfxUserFontSet::AddFontFace. r=jdaggett --- gfx/thebes/gfxUserFontSet.cpp | 6 +++--- gfx/thebes/gfxUserFontSet.h | 2 +- layout/style/nsFontFaceLoader.cpp | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 487efac812b..9d4eb99cc84 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -129,14 +129,14 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName, const nsString& aLanguageOverride, gfxSparseBitSet *aUnicodeRanges) { + MOZ_ASSERT(aWeight != 0, + "aWeight must not be 0; use NS_FONT_WEIGHT_NORMAL instead"); + nsAutoString key(aFamilyName); ToLowerCase(key); bool found; - if (aWeight == 0) - aWeight = NS_FONT_WEIGHT_NORMAL; - // stretch, italic/oblique ==> zero implies normal gfxMixedFontFamily *family = mFontFamilies.GetWeak(key, &found); diff --git a/gfx/thebes/gfxUserFontSet.h b/gfx/thebes/gfxUserFontSet.h index 446e236ee88..2424ef219f2 100644 --- a/gfx/thebes/gfxUserFontSet.h +++ b/gfx/thebes/gfxUserFontSet.h @@ -167,7 +167,7 @@ public: // add in a font face - // weight - 0 == unknown, [100, 900] otherwise (multiples of 100) + // weight - [100, 900] (multiples of 100) // stretch = [NS_FONT_STRETCH_ULTRA_CONDENSED, NS_FONT_STRETCH_ULTRA_EXPANDED] // italic style = constants in gfxFontConstants.h, e.g. NS_FONT_STYLE_NORMAL // TODO: support for unicode ranges not yet implemented diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index fa7e479bdfe..3e94cfce56a 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -578,6 +578,9 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType, unit = val.GetUnit(); if (unit == eCSSUnit_Integer || unit == eCSSUnit_Enumerated) { weight = val.GetIntValue(); + if (weight == 0) { + weight = NS_STYLE_FONT_STYLE_NORMAL; + } } else if (unit == eCSSUnit_Normal) { weight = NS_STYLE_FONT_WEIGHT_NORMAL; } else { From 54ac31ae11caf7e62feb767b7b2615f07299fa31 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Mon, 30 Jun 2014 14:25:21 +1000 Subject: [PATCH 13/26] Bug 1031205 - Make gfxUserFontSet methods take already-parsed language override values. r=jdaggett --- gfx/thebes/gfxUserFontSet.cpp | 9 +++------ gfx/thebes/gfxUserFontSet.h | 3 ++- layout/style/nsFontFaceLoader.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 9d4eb99cc84..8b1db5e77b3 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -126,7 +126,7 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName, int32_t aStretch, uint32_t aItalicStyle, const nsTArray& aFeatureSettings, - const nsString& aLanguageOverride, + uint32_t aLanguageOverride, gfxSparseBitSet *aUnicodeRanges) { MOZ_ASSERT(aWeight != 0, @@ -145,9 +145,6 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName, mFontFamilies.Put(key, family); } - uint32_t languageOverride = - gfxFontStyle::ParseFontLanguageOverride(aLanguageOverride); - // If there's already a proxy in the family whose descriptors all match, // we can just move it to the end of the list instead of adding a new // face that will always "shadow" the old one. @@ -164,7 +161,7 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName, static_cast(fontList[i].get()); if (!existingProxyEntry->Matches(aFontFaceSrcList, aWeight, aStretch, aItalicStyle, - aFeatureSettings, languageOverride, + aFeatureSettings, aLanguageOverride, aUnicodeRanges)) { continue; } @@ -181,7 +178,7 @@ gfxUserFontSet::AddFontFace(const nsAString& aFamilyName, new gfxProxyFontEntry(aFontFaceSrcList, aWeight, aStretch, aItalicStyle, aFeatureSettings, - languageOverride, + aLanguageOverride, aUnicodeRanges); family->AddFontEntry(proxyEntry); #ifdef PR_LOGGING diff --git a/gfx/thebes/gfxUserFontSet.h b/gfx/thebes/gfxUserFontSet.h index 2424ef219f2..0937b842c0e 100644 --- a/gfx/thebes/gfxUserFontSet.h +++ b/gfx/thebes/gfxUserFontSet.h @@ -170,6 +170,7 @@ public: // weight - [100, 900] (multiples of 100) // stretch = [NS_FONT_STRETCH_ULTRA_CONDENSED, NS_FONT_STRETCH_ULTRA_EXPANDED] // italic style = constants in gfxFontConstants.h, e.g. NS_FONT_STYLE_NORMAL + // language override = result of calling gfxFontStyle::ParseFontLanguageOverride // TODO: support for unicode ranges not yet implemented gfxFontEntry *AddFontFace(const nsAString& aFamilyName, const nsTArray& aFontFaceSrcList, @@ -177,7 +178,7 @@ public: int32_t aStretch, uint32_t aItalicStyle, const nsTArray& aFeatureSettings, - const nsString& aLanguageOverride, + uint32_t aLanguageOverride, gfxSparseBitSet *aUnicodeRanges = nullptr); // add in a font face for which we have the gfxFontEntry already diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index 3e94cfce56a..fed687e3ba3 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -571,7 +571,7 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType, uint32_t weight = NS_STYLE_FONT_WEIGHT_NORMAL; int32_t stretch = NS_STYLE_FONT_STRETCH_NORMAL; uint32_t italicStyle = NS_STYLE_FONT_STYLE_NORMAL; - nsString languageOverride; + uint32_t languageOverride = NO_FONT_LANGUAGE_OVERRIDE; // set up weight aRule->GetDesc(eCSSFontDesc_Weight, val); @@ -631,7 +631,9 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType, if (unit == eCSSUnit_Normal) { // empty feature string } else if (unit == eCSSUnit_String) { - val.GetStringValue(languageOverride); + nsString stringValue; + val.GetStringValue(stringValue); + languageOverride = gfxFontStyle::ParseFontLanguageOverride(stringValue); } else { NS_ASSERTION(unit == eCSSUnit_Null, "@font-face font-language-override has unexpected unit"); From f0254899d9913902babec89221bca69a0dc835b4 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Mon, 30 Jun 2014 16:26:09 +1200 Subject: [PATCH 14/26] Bug 1028237 - Account for device offset for thebes layer masks. r=roc --- gfx/layers/basic/BasicThebesLayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/layers/basic/BasicThebesLayer.cpp b/gfx/layers/basic/BasicThebesLayer.cpp index 521f926d879..f766a3d7fe4 100644 --- a/gfx/layers/basic/BasicThebesLayer.cpp +++ b/gfx/layers/basic/BasicThebesLayer.cpp @@ -119,7 +119,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext, AutoMoz2DMaskData mask; SourceSurface* maskSurface = nullptr; Matrix maskTransform; - if (GetMaskData(aMaskLayer, Point(), &mask)) { + if (GetMaskData(aMaskLayer, aContext->GetDeviceOffset(), &mask)) { maskSurface = mask.GetSurface(); maskTransform = mask.GetTransform(); } From 1fa0e6607e527a84e349b2e67ba40194d2768b78 Mon Sep 17 00:00:00 2001 From: Tim Chien Date: Sun, 29 Jun 2014 03:47:00 +0200 Subject: [PATCH 15/26] Bug 1022852 - Fix setInputMethodActive test that rely on order of async message. r=yxl --- .../browserElement_SetInputMethodActive.js | 115 +++++++++++++----- 1 file changed, 85 insertions(+), 30 deletions(-) diff --git a/dom/browser-element/mochitest/browserElement_SetInputMethodActive.js b/dom/browser-element/mochitest/browserElement_SetInputMethodActive.js index 8d63d0abb6f..dcf95e85ad1 100644 --- a/dom/browser-element/mochitest/browserElement_SetInputMethodActive.js +++ b/dom/browser-element/mochitest/browserElement_SetInputMethodActive.js @@ -145,6 +145,12 @@ function startTest() { var gCount = 0; +var gFrameMsgCounts = { + 'input': 0, + 'im0': 0, + 'im1': 0 +}; + function next(msg) { let wrappedMsg = SpecialPowers.wrap(msg); let from = wrappedMsg.data.from; @@ -156,21 +162,49 @@ function next(msg) { return; } - gCount++; + let fromId = from; + if (from === 'im') { + fromId += value[1]; + } + gFrameMsgCounts[fromId]++; // The texts sent from the first and the second input method are '#0' and // '#1' respectively. switch (gCount) { - case 1: - is(from, 'im', 'Message sequence unexpected (1).'); - is(value, '#0true', 'First frame should get the context first.'); - // Do nothing and wait for the input to show up in input frame. - break; + case 0: + switch (fromId) { + case 'im0': + if (gFrameMsgCounts.im0 === 1) { + is(value, '#0true', 'First frame should get the context first.'); + } else { + ok(false, 'Unexpected multiple messages from im0.') + } - case 2: - is(from, 'input', 'Message sequence unexpected (2).'); - is(value, '#0hello', - 'Failed to get correct input from the first iframe.'); + break; + + case 'im1': + is(false, 'Shouldn\'t be hearing anything from second frame.'); + + break; + + case 'input': + if (gFrameMsgCounts.input === 1) { + is(value, '#0hello', + 'Failed to get correct input from the first iframe.'); + } else { + ok(false, 'Unexpected multiple messages from input.') + } + + break; + } + + if (gFrameMsgCounts.input !== 1 || + gFrameMsgCounts.im0 !== 1 || + gFrameMsgCounts.im1 !== 0) { + return; + } + + gCount++; let req0 = gFrames[0].setInputMethodActive(false); req0.onsuccess = function() { @@ -181,43 +215,64 @@ function next(msg) { }; let req1 = gFrames[1].setInputMethodActive(true); req1.onsuccess = function() { - ok(true, 'setInputMethodActive succeeded (1).'); + ok(true, 'setInputMethodActive succeeded (1).'); }; req1.onerror = function() { - ok(false, 'setInputMethodActive failed (1): ' + this.error.name); + ok(false, 'setInputMethodActive failed (1): ' + this.error.name); }; + break; - case 3: - is(from, 'im', 'Message sequence unexpected (3).'); - is(value, '#0false', 'First frame should have the context removed.'); - // Do nothing and wait for the second frame to get the context; - break; + case 1: + switch (fromId) { + case 'im0': + if (gFrameMsgCounts.im0 === 2) { + is(value, '#0false', 'First frame should have the context removed.'); + } else { + ok(false, 'Unexpected multiple messages from im0.') + } + break; - case 4: - is(from, 'im', 'Message sequence unexpected (4).'); - is(value, '#1true', 'Second frame should get the context.'); - // Do nothing and wait for the input to show up in input frame. - break; + case 'im1': + if (gFrameMsgCounts.im1 === 1) { + is(value, '#1true', 'Second frame should get the context.'); + } else { + ok(false, 'Unexpected multiple messages from im0.') + } - case 5: - is(from, 'input', 'Message sequence unexpected (5).'); - is(value, '#0#1hello', - 'Failed to get correct input from the second iframe.'); + break; + + case 'input': + if (gFrameMsgCounts.input === 2) { + is(value, '#0#1hello', + 'Failed to get correct input from the second iframe.'); + } else { + ok(false, 'Unexpected multiple messages from input.') + } + break; + } + + if (gFrameMsgCounts.input !== 2 || + gFrameMsgCounts.im0 !== 2 || + gFrameMsgCounts.im1 !== 1) { + return; + } + + gCount++; // Receive the second input from the second iframe. // Deactive the second iframe. let req3 = gFrames[1].setInputMethodActive(false); req3.onsuccess = function() { - ok(true, 'setInputMethodActive(false) succeeded (3).'); + ok(true, 'setInputMethodActive(false) succeeded (2).'); }; req3.onerror = function() { - ok(false, 'setInputMethodActive(false) failed (3): ' + this.error.name); + ok(false, 'setInputMethodActive(false) failed (2): ' + this.error.name); }; break; - case 6: - is(from, 'im', 'Message sequence unexpected (6).'); + case 2: + is(fromId, 'im1', 'Message sequence unexpected (3).'); is(value, '#1false', 'Second frame should have the context removed.'); tearDown(); From f61501591a3252d4d6f4e9a315e17d82c6e01a17 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Tue, 24 Jun 2014 21:42:00 +0200 Subject: [PATCH 16/26] Bug 1029956 - Fix mLayerRef init for color layers. r=dglastonbury We didn't initialize the mLayerRef in the constructor of DebugGLColorData. Just fix it. --- gfx/layers/LayerScope.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gfx/layers/LayerScope.cpp b/gfx/layers/LayerScope.cpp index f79c146da87..42c974602b8 100644 --- a/gfx/layers/LayerScope.cpp +++ b/gfx/layers/LayerScope.cpp @@ -511,6 +511,7 @@ class DebugGLColorData : public DebugGLData { public: DebugGLColorData(void* layerRef, const gfxRGBA& color, int width, int height) : DebugGLData(DebugGLData::ColorData), + mLayerRef(layerRef), mColor(color.Packed()), mSize(width, height) { } From dc2c5c4b937bf4899e2e10ac78e4a8bd2006ff05 Mon Sep 17 00:00:00 2001 From: Pranav Maddi Date: Fri, 27 Jun 2014 10:02:00 +0200 Subject: [PATCH 17/26] Bug 1031395 - Remove a double assignment to "limit" to fix a minor warning found by scan-build, the LLVM/Clang static analyzer. r=ehsan --- layout/base/nsBidi.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/layout/base/nsBidi.cpp b/layout/base/nsBidi.cpp index 11d15225fc5..de646ef54e3 100644 --- a/layout/base/nsBidi.cpp +++ b/layout/base/nsBidi.cpp @@ -1452,7 +1452,7 @@ bool nsBidi::GetRuns() GetSingleRun(mParaLevel); } else /* NSBIDI_MIXED, length>0 */ { /* mixed directionality */ - int32_t length=mLength, limit=length; + int32_t length=mLength, limit=mTrailingWSStart; /* * If there are WS characters at the end of the line @@ -1465,7 +1465,6 @@ bool nsBidi::GetRuns() * In other words, for the trailing WS, it may be * levels[]!=paraLevel but we have to treat it like it were so. */ - limit=mTrailingWSStart; if(limit==0) { /* there is only WS on this line */ GetSingleRun(mParaLevel); From 1079ca9d7fc5d1d51871594d3db91b5630b8c881 Mon Sep 17 00:00:00 2001 From: CJKu Date: Fri, 27 Jun 2014 11:12:00 +0200 Subject: [PATCH 18/26] Bug 976923 - reftest fails - font-inflation disable-fontinfl-on-mobile-4.html. r=mbrubeck --- .../disable-fontinfl-on-mobile-4.html | 20 ------------------- layout/reftests/font-inflation/reftest.list | 1 - 2 files changed, 21 deletions(-) delete mode 100644 layout/reftests/font-inflation/disable-fontinfl-on-mobile-4.html diff --git a/layout/reftests/font-inflation/disable-fontinfl-on-mobile-4.html b/layout/reftests/font-inflation/disable-fontinfl-on-mobile-4.html deleted file mode 100644 index c692c96f693..00000000000 --- a/layout/reftests/font-inflation/disable-fontinfl-on-mobile-4.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - -

Some uninflated text.

- - - diff --git a/layout/reftests/font-inflation/reftest.list b/layout/reftests/font-inflation/reftest.list index 28a7a72feb2..22d9e07f835 100644 --- a/layout/reftests/font-inflation/reftest.list +++ b/layout/reftests/font-inflation/reftest.list @@ -55,7 +55,6 @@ asserts-if(gtk2Widget,0-4) test-pref(font.size.inflation.emPerLine,15) test-pref test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile.html disable-fontinfl-on-mobile-ref.html test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-2.html disable-fontinfl-on-mobile-ref.html test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-3.html disable-fontinfl-on-mobile-ref.html -test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == disable-fontinfl-on-mobile-4.html disable-fontinfl-on-mobile-ref.html test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) != disable-fontinfl-on-mobile-5.html disable-fontinfl-on-mobile-ref.html test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == preformatted-text.html preformatted-text-ref.html test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == fixed-height-body.html fixed-height-body-ref.html From bb1b9224ce50662d03ca3608a446ea477529c5f6 Mon Sep 17 00:00:00 2001 From: Michael Pruett Date: Fri, 27 Jun 2014 09:59:09 -0500 Subject: [PATCH 19/26] Bug 1024360 - Remove usage of deprecated mozIStorageBaseStatement methods. r=mak --- .../templates/tests/chrome/test_bug476634.xul | 24 +++++++++---------- dom/indexedDB/OpenDatabaseHelper.cpp | 6 ++--- .../android/chrome/content/aboutDownloads.js | 10 ++++---- mobile/android/chrome/content/browser.js | 2 +- mobile/android/modules/Sanitizer.jsm | 12 +++++----- .../tests/chrome/test_bug_412360.xul | 8 +++---- .../tests/chrome/test_cleanup_search.xul | 8 +++---- .../tests/chrome/test_multi_select.xul | 8 +++---- .../tests/chrome/test_multiword_search.xul | 12 +++++----- .../tests/chrome/test_search_clearlist.xul | 8 +++---- .../tests/chrome/test_select_all.xul | 6 ++--- 11 files changed, 52 insertions(+), 52 deletions(-) diff --git a/content/xul/templates/tests/chrome/test_bug476634.xul b/content/xul/templates/tests/chrome/test_bug476634.xul index 56554eaafbd..cee01d41a2e 100644 --- a/content/xul/templates/tests/chrome/test_bug476634.xul +++ b/content/xul/templates/tests/chrome/test_bug476634.xul @@ -39,23 +39,23 @@ function startup() { db.createTable("test", "id TEXT, value INTEGER"); var stmt = db.createStatement("INSERT INTO test (id, value) VALUES (?,?)"); - stmt.bindStringParameter(0, "test1"); - stmt.bindInt32Parameter(1, 0); + stmt.bindByIndex(0, "test1"); + stmt.bindByIndex(1, 0); stmt.execute(); - stmt.bindStringParameter(0, "test2"); - stmt.bindInt32Parameter(1, 2147483647); + stmt.bindByIndex(0, "test2"); + stmt.bindByIndex(1, 2147483647); stmt.execute(); - stmt.bindStringParameter(0, "test3"); - stmt.bindInt32Parameter(1, -2147483648); + stmt.bindByIndex(0, "test3"); + stmt.bindByIndex(1, -2147483648); stmt.execute(); - stmt.bindStringParameter(0, "test4"); - stmt.bindInt64Parameter(1, 0); + stmt.bindByIndex(0, "test4"); + stmt.bindByIndex(1, 0); stmt.execute(); - stmt.bindStringParameter(0, "test5"); - stmt.bindInt64Parameter(1, 3147483647); + stmt.bindByIndex(0, "test5"); + stmt.bindByIndex(1, 3147483647); stmt.execute(); - stmt.bindStringParameter(0, "test6"); - stmt.bindInt64Parameter(1, -3147483648); + stmt.bindByIndex(0, "test6"); + stmt.bindByIndex(1, -3147483648); stmt.execute(); stmt.finalize(); diff --git a/dom/indexedDB/OpenDatabaseHelper.cpp b/dom/indexedDB/OpenDatabaseHelper.cpp index 158327566fe..6f7cdf5ca6c 100644 --- a/dom/indexedDB/OpenDatabaseHelper.cpp +++ b/dom/indexedDB/OpenDatabaseHelper.cpp @@ -371,13 +371,13 @@ UpgradeSchemaFrom4To5(mozIStorageConnection* aConnection) { mozStorageStatementScoper scoper(stmt); - rv = stmt->BindStringParameter(0, name); + rv = stmt->BindStringByName(NS_LITERAL_CSTRING("name"), name); NS_ENSURE_SUCCESS(rv, rv); - rv = stmt->BindInt32Parameter(1, intVersion); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("version"), intVersion); NS_ENSURE_SUCCESS(rv, rv); - rv = stmt->BindInt64Parameter(2, dataVersion); + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("dataVersion"), dataVersion); NS_ENSURE_SUCCESS(rv, rv); rv = stmt->Execute(); diff --git a/mobile/android/chrome/content/aboutDownloads.js b/mobile/android/chrome/content/aboutDownloads.js index f031ac73c55..689fcffabe5 100644 --- a/mobile/android/chrome/content/aboutDownloads.js +++ b/mobile/android/chrome/content/aboutDownloads.js @@ -418,11 +418,11 @@ let Downloads = { let stmt = this._initStatement(aParams.isPrivate); stmt.reset(); - stmt.bindInt32Parameter(0, Ci.nsIDownloadManager.DOWNLOAD_NOTSTARTED); - stmt.bindInt32Parameter(1, Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING); - stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_PAUSED); - stmt.bindInt32Parameter(3, Ci.nsIDownloadManager.DOWNLOAD_QUEUED); - stmt.bindInt32Parameter(4, Ci.nsIDownloadManager.DOWNLOAD_SCANNING); + stmt.bindByIndex(0, Ci.nsIDownloadManager.DOWNLOAD_NOTSTARTED); + stmt.bindByIndex(1, Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING); + stmt.bindByIndex(2, Ci.nsIDownloadManager.DOWNLOAD_PAUSED); + stmt.bindByIndex(3, Ci.nsIDownloadManager.DOWNLOAD_QUEUED); + stmt.bindByIndex(4, Ci.nsIDownloadManager.DOWNLOAD_SCANNING); let entries = []; while (entry = this._getEntry(stmt)) { diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 103984e3ccd..9274b0c0cf9 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -7042,7 +7042,7 @@ var SearchEngines = { let mDBConn = Services.storage.openDatabase(dbFile); let stmts = []; stmts[0] = mDBConn.createStatement("SELECT favicon FROM history_with_favicons WHERE url = ?"); - stmts[0].bindStringParameter(0, docURI.spec); + stmts[0].bindByIndex(0, docURI.spec); let favicon = null; Services.search.init(function addEngine_cb(rv) { if (!Components.isSuccessCode(rv)) { diff --git a/mobile/android/modules/Sanitizer.jsm b/mobile/android/modules/Sanitizer.jsm index 1dd35515034..08ff25a53f2 100644 --- a/mobile/android/modules/Sanitizer.jsm +++ b/mobile/android/modules/Sanitizer.jsm @@ -27,12 +27,12 @@ let downloads = { let dbConn = dlmgr.DBConnection; let stmt = dbConn.createStatement("SELECT id FROM moz_downloads WHERE " + "state = ? OR state = ? OR state = ? OR state = ? OR state = ? OR state = ?"); - stmt.bindInt32Parameter(0, Ci.nsIDownloadManager.DOWNLOAD_FINISHED); - stmt.bindInt32Parameter(1, Ci.nsIDownloadManager.DOWNLOAD_FAILED); - stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_CANCELED); - stmt.bindInt32Parameter(3, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_PARENTAL); - stmt.bindInt32Parameter(4, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_POLICY); - stmt.bindInt32Parameter(5, Ci.nsIDownloadManager.DOWNLOAD_DIRTY); + stmt.bindByIndex(0, Ci.nsIDownloadManager.DOWNLOAD_FINISHED); + stmt.bindByIndex(1, Ci.nsIDownloadManager.DOWNLOAD_FAILED); + stmt.bindByIndex(2, Ci.nsIDownloadManager.DOWNLOAD_CANCELED); + stmt.bindByIndex(3, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_PARENTAL); + stmt.bindByIndex(4, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED_POLICY); + stmt.bindByIndex(5, Ci.nsIDownloadManager.DOWNLOAD_DIRTY); while (stmt.executeStep()) { aCallback(dlmgr.getDownload(stmt.row.id)); } diff --git a/toolkit/mozapps/downloads/tests/chrome/test_bug_412360.xul b/toolkit/mozapps/downloads/tests/chrome/test_bug_412360.xul index d9b97b4c496..081da42266b 100644 --- a/toolkit/mozapps/downloads/tests/chrome/test_bug_412360.xul +++ b/toolkit/mozapps/downloads/tests/chrome/test_bug_412360.xul @@ -86,20 +86,20 @@ function test() try { // Saving javascript URIs doesn't work - stmt.bindStringParameter(0, "javascript:5"); + stmt.bindByIndex(0, "javascript:5"); // Download to a temp local file file = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile); file.append("javascriptURI"); file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); - stmt.bindStringParameter(1, Cc["@mozilla.org/network/io-service;1"]. + stmt.bindByIndex(1, Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService).newFileURI(file).spec); // Start it as canceled - stmt.bindInt32Parameter(2, dm.DOWNLOAD_CANCELED); + stmt.bindByIndex(2, dm.DOWNLOAD_CANCELED); - stmt.bindInt32Parameter(3, Date.now() * 1000); + stmt.bindByIndex(3, Date.now() * 1000); // Add it! stmt.execute(); diff --git a/toolkit/mozapps/downloads/tests/chrome/test_cleanup_search.xul b/toolkit/mozapps/downloads/tests/chrome/test_cleanup_search.xul index 4efabc9c9d7..1a135baaba9 100644 --- a/toolkit/mozapps/downloads/tests/chrome/test_cleanup_search.xul +++ b/toolkit/mozapps/downloads/tests/chrome/test_cleanup_search.xul @@ -50,10 +50,10 @@ function test() try { for each (let site in ["delete.me", "i.live"]) { - stmt.bindStringParameter(0, "Super Pimped Download"); - stmt.bindStringParameter(1, filePath); - stmt.bindStringParameter(2, "http://" + site + "/file"); - stmt.bindInt32Parameter(3, dm.DOWNLOAD_FINISHED); + stmt.bindByIndex(0, "Super Pimped Download"); + stmt.bindByIndex(1, filePath); + stmt.bindByIndex(2, "http://" + site + "/file"); + stmt.bindByIndex(3, dm.DOWNLOAD_FINISHED); // Add it! stmt.execute(); diff --git a/toolkit/mozapps/downloads/tests/chrome/test_multi_select.xul b/toolkit/mozapps/downloads/tests/chrome/test_multi_select.xul index 219d7ab93ac..c61a111b61f 100644 --- a/toolkit/mozapps/downloads/tests/chrome/test_multi_select.xul +++ b/toolkit/mozapps/downloads/tests/chrome/test_multi_select.xul @@ -49,10 +49,10 @@ function test() let fileSpec = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService).newFileURI(file).spec; - stmt.bindStringParameter(0, "http://" + site + "/file"); - stmt.bindInt32Parameter(1, dm.DOWNLOAD_FINISHED); - stmt.bindStringParameter(2, fileSpec); - stmt.bindStringParameter(3, "http://referrer/"); + stmt.bindByIndex(0, "http://" + site + "/file"); + stmt.bindByIndex(1, dm.DOWNLOAD_FINISHED); + stmt.bindByIndex(2, fileSpec); + stmt.bindByIndex(3, "http://referrer/"); // Add it! stmt.execute(); diff --git a/toolkit/mozapps/downloads/tests/chrome/test_multiword_search.xul b/toolkit/mozapps/downloads/tests/chrome/test_multiword_search.xul index ce33328a195..a3bf4955a86 100644 --- a/toolkit/mozapps/downloads/tests/chrome/test_multiword_search.xul +++ b/toolkit/mozapps/downloads/tests/chrome/test_multiword_search.xul @@ -48,12 +48,12 @@ function test() try { for each (let site in ["ed.agadak.net", "mozilla.org"]) { - stmt.bindStringParameter(0, "Super Pimped Download"); - stmt.bindStringParameter(1, filePath); - stmt.bindStringParameter(2, "http://" + site + "/file"); - stmt.bindInt32Parameter(3, dm.DOWNLOAD_FINISHED); - stmt.bindInt64Parameter(4, new Date(1985, 7, 2) * 1000); - stmt.bindInt64Parameter(5, 111222333444); + stmt.bindByIndex(0, "Super Pimped Download"); + stmt.bindByIndex(1, filePath); + stmt.bindByIndex(2, "http://" + site + "/file"); + stmt.bindByIndex(3, dm.DOWNLOAD_FINISHED); + stmt.bindByIndex(4, new Date(1985, 7, 2) * 1000); + stmt.bindByIndex(5, 111222333444); // Add it! stmt.execute(); diff --git a/toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul b/toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul index 97456de2b41..348cd11e3ee 100644 --- a/toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul +++ b/toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul @@ -56,11 +56,11 @@ function test() try { for each (let site in sites) { - stmt.bindStringParameter(0, filePath); - stmt.bindStringParameter(1, "http://" + site + "/file"); - stmt.bindInt32Parameter(2, dm.DOWNLOAD_FINISHED); + stmt.bindByIndex(0, filePath); + stmt.bindByIndex(1, "http://" + site + "/file"); + stmt.bindByIndex(2, dm.DOWNLOAD_FINISHED); // Make the one that matches slightly older so it appears last - stmt.bindInt64Parameter(3, 1112223334445556 - (site == searchTerm)); + stmt.bindByIndex(3, 1112223334445556 - (site == searchTerm)); // Add it! stmt.execute(); diff --git a/toolkit/mozapps/downloads/tests/chrome/test_select_all.xul b/toolkit/mozapps/downloads/tests/chrome/test_select_all.xul index ca0bb6b9ed9..e3d12a97d47 100644 --- a/toolkit/mozapps/downloads/tests/chrome/test_select_all.xul +++ b/toolkit/mozapps/downloads/tests/chrome/test_select_all.xul @@ -50,9 +50,9 @@ function test() let sites = ["mozilla.org", "mozilla.com", "select.all"]; try { for each (let site in sites) { - stmt.bindStringParameter(0, filePath); - stmt.bindStringParameter(1, "http://" + site + "/file"); - stmt.bindInt32Parameter(2, dm.DOWNLOAD_FINISHED); + stmt.bindByIndex(0, filePath); + stmt.bindByIndex(1, "http://" + site + "/file"); + stmt.bindByIndex(2, dm.DOWNLOAD_FINISHED); // Add it! stmt.execute(); From 6ea0f9460aa65c9a78fd84e445174a408c218b09 Mon Sep 17 00:00:00 2001 From: Joshua Cranmer Date: Sun, 29 Jun 2014 17:46:13 -0500 Subject: [PATCH 20/26] Bug 1025998 - add a missed symbol for comm-central debug builds, rs=glandium, a=philor for landing on m-c directly. --- security/build/nss.def | 1 + 1 file changed, 1 insertion(+) diff --git a/security/build/nss.def b/security/build/nss.def index 727094d1ab7..8d497bee067 100644 --- a/security/build/nss.def +++ b/security/build/nss.def @@ -189,6 +189,7 @@ NSS_CMSEnvelopedData_AddRecipient NSS_CMSEnvelopedData_Create NSS_CMSEnvelopedData_GetContentInfo NSS_CMSMessage_ContentLevel +NSS_CMSMessage_ContentLevelCreate NSS_CMSMessage_Create NSS_CMSMessage_CreateFromDER NSS_CMSMessage_Destroy From c571752cd4e40843a6d5b567e466da759425c6c6 Mon Sep 17 00:00:00 2001 From: Joshua Cranmer Date: Sun, 29 Jun 2014 21:34:47 -0500 Subject: [PATCH 21/26] Fix spelling mistake in changeset 3018d1b623ab (bug 1025998), r=bustage-fix a=bustage-fix --HG-- extra : amend_source : 021b1b14fee5068e2176be9395c5c461f3333947 --- security/build/nss.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/build/nss.def b/security/build/nss.def index 8d497bee067..64e5b245fcd 100644 --- a/security/build/nss.def +++ b/security/build/nss.def @@ -189,7 +189,7 @@ NSS_CMSEnvelopedData_AddRecipient NSS_CMSEnvelopedData_Create NSS_CMSEnvelopedData_GetContentInfo NSS_CMSMessage_ContentLevel -NSS_CMSMessage_ContentLevelCreate +NSS_CMSMessage_ContentLevelCount NSS_CMSMessage_Create NSS_CMSMessage_CreateFromDER NSS_CMSMessage_Destroy From 6af25130b6e3e5bd9b1962af20f1a448c173b1f8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 29 Jun 2014 23:40:24 -0700 Subject: [PATCH 22/26] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/d75252e83e48 Author: Rudy Lu Desc: Merge pull request #21101 from RudyLu/system/Bug1030058-remove_assets Bug 1030058 - apps/system/style/themes/default/images/ui/time_pattern.pn... r=pivanov ======== https://hg.mozilla.org/integration/gaia-central/rev/e17f6c52cc14 Author: Rudy Lu Desc: Bug 1030058 - apps/system/style/themes/default/images/ui/time_pattern.png should be removed. ======== https://hg.mozilla.org/integration/gaia-central/rev/7759d2755889 Author: steveck-chung Desc: Merge pull request #19991 from rnowm/1013296 Bug 1013296 - Compose. Change send button to an paper plane icon. r=steveck-chung ======== https://hg.mozilla.org/integration/gaia-central/rev/b48b7d480d04 Author: rnowm Desc: Bug 1013296 - Compose. Change send button to an paper plane icon --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 98e342b8d6b..15f72441d9a 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ffb53607d2941324814de17e527531b7ae91df77", + "revision": "d75252e83e48713c76466e299805ae2b35078e6a", "repo_path": "/integration/gaia-central" } From 3b220f6f8029a0fa00ae3927dbe08f15e6caa74e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 29 Jun 2014 23:41:46 -0700 Subject: [PATCH 23/26] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c6b706d3852..7d97f6bfffe 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@
- + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 8be9dccc068..48e26e1157c 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 34cbd0c5e99..3baa112c480 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c6b706d3852..7d97f6bfffe 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 9a4fd6f01f6..0caac4398c5 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1e82597625a..c09cc47ef24 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index d554a0720d2..b47f0cfb864 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 23a663bb945..f7b2f2ccba1 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index aa328b3e6e2..b8817809f74 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 28bdf2c297a65f0e3daae12ba40082244543d310 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 30 Jun 2014 00:50:26 -0700 Subject: [PATCH 24/26] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/2c2f2fa0a101 Author: chirarobert Desc: Merge pull request #21063 from zacc/bug_1005057_app_perms LGTM, merging as the failure from Travis is unrelated to the changes. ======== https://hg.mozilla.org/integration/gaia-central/rev/f132e488ea36 Author: Zac Desc: Bug 1005057 - Switch to system frame inside get/set permission test methods ======== https://hg.mozilla.org/integration/gaia-central/rev/3af7d2f1dc87 Author: steveck-chung Desc: Merge pull request #21100 from steveck-chung/bug-1021513 Bug 1021513 - [Messages] Recipients list container scroll up automatically when dragging down. r=azasypkin ======== https://hg.mozilla.org/integration/gaia-central/rev/3d93cbb9fa5c Author: Steve Chung Desc: Bug 1021513 - [Messages] Recipients list container scroll up automatically when dragging down the container for multiline recipients list mode --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 15f72441d9a..8e4c8d266bc 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "d75252e83e48713c76466e299805ae2b35078e6a", + "revision": "2c2f2fa0a101f07cbb206cca2e69ef3a7b18244c", "repo_path": "/integration/gaia-central" } From 083f69fd599708b8c5acd75c5efa97c6547e18f4 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 30 Jun 2014 00:51:47 -0700 Subject: [PATCH 25/26] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7d97f6bfffe..e6a6a561d18 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 48e26e1157c..6b13719a6eb 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 3baa112c480..047d1a6aff7 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7d97f6bfffe..e6a6a561d18 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 0caac4398c5..7d77041665e 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c09cc47ef24..60b0ce04d13 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index b47f0cfb864..7dc63e1b46b 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index f7b2f2ccba1..7c25d9710cb 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index b8817809f74..8eda7941769 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 7c1eb4aff932b99ee9e7f4dd500d6b07e9e74337 Mon Sep 17 00:00:00 2001 From: Hsin-Yi Tsai Date: Mon, 30 Jun 2014 14:48:41 +0800 Subject: [PATCH 26/26] Bug 1023141 - query ril.ecclist per dial request - part 3 - fix xpcshell. r=aknow --- dom/system/gonk/tests/test_ril_worker_ecm.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dom/system/gonk/tests/test_ril_worker_ecm.js b/dom/system/gonk/tests/test_ril_worker_ecm.js index 97627fa3600..2c6c88cf843 100644 --- a/dom/system/gonk/tests/test_ril_worker_ecm.js +++ b/dom/system/gonk/tests/test_ril_worker_ecm.js @@ -122,8 +122,9 @@ add_test(function test_request_exit_emergencyCbMode_when_dial() { }; // Dial non-emergency call. - context.RIL.dial({number: "0912345678", - isDialEmergency: false}); + context.RIL.dialNonEmergencyNumber({number: "0912345678", + isEmergency: false, + isDialEmergency: false}); // Should clear timeout event. do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);