Bug 916695 - Fix cancelExistingCalls. r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Wed, 18 Sep 2013 15:44:08 +0800
changeset 147748 ba6395f2dc6e
parent 147747 3c9b91e9f8b6
child 147749 bbedf8c662e6
push id25315
push userkwierso@gmail.com
push date2013-09-19 00:09 +0000
treeherdermozilla-central@1907e00d4624 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs916695
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 916695 - Fix cancelExistingCalls. r=hsinyi
dom/telephony/test/marionette/test_crash_emulator.js
dom/telephony/test/marionette/test_emergency_label.js
dom/telephony/test/marionette/test_incoming_already_connected.js
dom/telephony/test/marionette/test_incoming_already_held.js
dom/telephony/test/marionette/test_incoming_answer_hangup.js
dom/telephony/test/marionette/test_incoming_answer_hangup_oncallschanged.js
dom/telephony/test/marionette/test_incoming_answer_remote_hangup.js
dom/telephony/test/marionette/test_incoming_connecting_hangup.js
dom/telephony/test/marionette/test_incoming_connecting_remote_hangup.js
dom/telephony/test/marionette/test_incoming_hangup_held.js
dom/telephony/test/marionette/test_incoming_hold_resume.js
dom/telephony/test/marionette/test_incoming_onstatechange.js
dom/telephony/test/marionette/test_incoming_reject.js
dom/telephony/test/marionette/test_incoming_remote_cancel.js
dom/telephony/test/marionette/test_incoming_remote_hangup_held.js
dom/telephony/test/marionette/test_multiple_hold.js
dom/telephony/test/marionette/test_outgoing_already_held.js
dom/telephony/test/marionette/test_outgoing_answer_hangup.js
dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js
dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js
dom/telephony/test/marionette/test_outgoing_badNumber.js
dom/telephony/test/marionette/test_outgoing_busy.js
dom/telephony/test/marionette/test_outgoing_emergency_in_airplane_mode.js
dom/telephony/test/marionette/test_outgoing_hangup_alerting.js
dom/telephony/test/marionette/test_outgoing_hangup_held.js
dom/telephony/test/marionette/test_outgoing_hold_resume.js
dom/telephony/test/marionette/test_outgoing_onstatechange.js
dom/telephony/test/marionette/test_outgoing_radio_off.js
dom/telephony/test/marionette/test_outgoing_reject.js
dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js
dom/telephony/test/marionette/test_redundant_operations.js
dom/telephony/test/marionette/test_swap_held_and_active.js
--- a/dom/telephony/test/marionette/test_crash_emulator.js
+++ b/dom/telephony/test/marionette/test_crash_emulator.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
@@ -43,17 +43,17 @@ function cancelExistingCalls(callList) {
 
 function dial() {
   log("Make an outgoing call.");
   outgoingCall = telephony.dial(outNumber);
 
   outgoingCall.onalerting = function onalerting(event) {
     log("Received 'alerting' call event.");
     answer();
-  };  
+  };
 }
 
 function answer() {
   log("Answering the outgoing call.");
 
   outgoingCall.onconnected = function onconnectedOut(event) {
     log("Received 'connected' call event for the original outgoing call.");
     // just some code to keep call active for awhile
@@ -68,9 +68,9 @@ function answer() {
 }
 
 function cleanUp(){
   outgoingCall.hangUp();
   ok("passed");
   finish();
 }
 
-getExistingCalls();
\ No newline at end of file
+getExistingCalls();
--- a/dom/telephony/test/marionette/test_emergency_label.js
+++ b/dom/telephony/test/marionette/test_emergency_label.js
@@ -27,17 +27,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_already_connected.js
+++ b/dom/telephony/test/marionette/test_incoming_already_connected.js
@@ -22,17 +22,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_already_held.js
+++ b/dom/telephony/test/marionette/test_incoming_already_held.js
@@ -21,17 +21,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_answer_hangup.js
+++ b/dom/telephony/test/marionette/test_incoming_answer_hangup.js
@@ -19,17 +19,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_answer_hangup_oncallschanged.js
+++ b/dom/telephony/test/marionette/test_incoming_answer_hangup_oncallschanged.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_answer_remote_hangup.js
+++ b/dom/telephony/test/marionette/test_incoming_answer_remote_hangup.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_connecting_hangup.js
+++ b/dom/telephony/test/marionette/test_incoming_connecting_hangup.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_connecting_remote_hangup.js
+++ b/dom/telephony/test/marionette/test_incoming_connecting_remote_hangup.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_hangup_held.js
+++ b/dom/telephony/test/marionette/test_incoming_hangup_held.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_hold_resume.js
+++ b/dom/telephony/test/marionette/test_incoming_hold_resume.js
@@ -19,17 +19,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_onstatechange.js
+++ b/dom/telephony/test/marionette/test_incoming_onstatechange.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_reject.js
+++ b/dom/telephony/test/marionette/test_incoming_reject.js
@@ -19,17 +19,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_remote_cancel.js
+++ b/dom/telephony/test/marionette/test_incoming_remote_cancel.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_incoming_remote_hangup_held.js
+++ b/dom/telephony/test/marionette/test_incoming_remote_hangup_held.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_multiple_hold.js
+++ b/dom/telephony/test/marionette/test_multiple_hold.js
@@ -20,17 +20,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_already_held.js
+++ b/dom/telephony/test/marionette/test_outgoing_already_held.js
@@ -20,17 +20,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_answer_hangup.js
+++ b/dom/telephony/test/marionette/test_outgoing_answer_hangup.js
@@ -19,17 +19,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js
+++ b/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js
+++ b/dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_badNumber.js
+++ b/dom/telephony/test/marionette/test_outgoing_badNumber.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_busy.js
+++ b/dom/telephony/test/marionette/test_outgoing_busy.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_emergency_in_airplane_mode.js
+++ b/dom/telephony/test/marionette/test_outgoing_emergency_in_airplane_mode.js
@@ -31,17 +31,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_hangup_alerting.js
+++ b/dom/telephony/test/marionette/test_outgoing_hangup_alerting.js
@@ -19,17 +19,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_hangup_held.js
+++ b/dom/telephony/test/marionette/test_outgoing_hangup_held.js
@@ -19,17 +19,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_hold_resume.js
+++ b/dom/telephony/test/marionette/test_outgoing_hold_resume.js
@@ -19,17 +19,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_onstatechange.js
+++ b/dom/telephony/test/marionette/test_outgoing_onstatechange.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_radio_off.js
+++ b/dom/telephony/test/marionette/test_outgoing_radio_off.js
@@ -116,11 +116,16 @@ function cleanUp() {
   }
   SpecialPowers.clearUserPref("dom.mozSettings.enabled");
   finish();
 }
 
 setRadioEnabled(false, function() {
   sendToEmulator("gsm clear", function(result) {
     is(result[0], "OK");
-    dial("0912345678");
+
+    waitFor(function() {
+      dial("0912345678");
+    }, function() {
+      return telephony.calls.length === 0;
+    });
   });
 });
--- a/dom/telephony/test/marionette/test_outgoing_reject.js
+++ b/dom/telephony/test/marionette/test_outgoing_reject.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js
+++ b/dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_redundant_operations.js
+++ b/dom/telephony/test/marionette/test_redundant_operations.js
@@ -18,17 +18,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };
--- a/dom/telephony/test/marionette/test_swap_held_and_active.js
+++ b/dom/telephony/test/marionette/test_swap_held_and_active.js
@@ -23,17 +23,17 @@ function getExistingCalls() {
       cancelExistingCalls(result);
     };
   });
 }
 
 function cancelExistingCalls(callList) {
   if (callList.length && callList[0] != "OK") {
     // Existing calls remain; get rid of the next one in the list
-    nextCall = callList.shift().split(' ')[2].trim();
+    nextCall = callList.shift().split(/\s+/)[2].trim();
     log("Cancelling existing call '" + nextCall +"'");
     runEmulatorCmd("gsm cancel " + nextCall, function(result) {
       if (result[0] == "OK") {
         cancelExistingCalls(callList);
       } else {
         log("Failed to cancel existing call");
         cleanUp();
       };