Bug 844767 - B2G RIL: correct telephony marionette test_outgoing_onstatechange.js. r=allstars.chh
authorHsin-Yi Tsai <htsai@mozilla.com>
Mon, 25 Feb 2013 19:28:07 +0800
changeset 125373 5cec3a86714d693f383b8302c504141bde0dee89
parent 125372 b2942eb4d283fd453152247b75e345e110863875
child 125374 96fb830b930da758dba84adf179fb168f2842243
push id24450
push userryanvm@gmail.com
push dateTue, 19 Mar 2013 13:43:35 +0000
treeherdermozilla-central@2c41bf87b4e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersallstars.chh
bugs844767
milestone22.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 844767 - B2G RIL: correct telephony marionette test_outgoing_onstatechange.js. r=allstars.chh
dom/telephony/test/marionette/test_outgoing_onstatechange.js
--- a/dom/telephony/test/marionette/test_outgoing_onstatechange.js
+++ b/dom/telephony/test/marionette/test_outgoing_onstatechange.js
@@ -39,24 +39,27 @@ function dial() {
   is(outgoingCall, telephony.active);
   is(telephony.calls.length, 1);
   is(telephony.calls[0], outgoingCall);
 
   outgoingCall.onstatechange = function statechangering(event) {
     log("Received 'onstatechange' call event.");
 
     is(outgoingCall, event.call);
-    is(outgoingCall.state, "alerting");
+    let expectedStates = ["dialing", "alerting"];
+    ok(expectedStates.indexOf(event.call.state) != -1);
 
-    runEmulatorCmd("gsm list", function(result) {
-      log("Call list is now: " + result);
-      is(result[0], "outbound to  " + outNumber + " : ringing");
-      is(result[1], "OK");
-      answer();
-    });
+    if (event.call.state == "alerting") {
+      runEmulatorCmd("gsm list", function(result) {
+        log("Call list is now: " + result);
+        is(result[0], "outbound to  " + outNumber + " : ringing");
+        is(result[1], "OK");
+        answer();
+      });
+    }
   };
 }
 
 function answer() {
   log("Answering the outgoing call.");
 
   // We get no "connecting" event when the remote party answers the call.