Bug 1043165 - Part 4: Update test cases. r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Thu, 26 Mar 2015 16:39:40 +0800
changeset 265974 bd080330d361fa430661afbf15b1ebb78454d415
parent 265973 f42d8e5bb0c3cefc18b59005cfddabc86fc4e8bb
child 265975 cf87796cb96c0ab68a9013cedbff5d711b4759e4
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1043165
milestone39.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 1043165 - Part 4: Update test cases. r=hsinyi
dom/telephony/test/marionette/test_incoming_basic_operations.js
dom/telephony/test/marionette/test_outgoing_badNumber.js
dom/telephony/test/marionette/test_outgoing_basic_operations.js
dom/telephony/test/marionette/test_outgoing_busy.js
--- a/dom/telephony/test/marionette/test_incoming_basic_operations.js
+++ b/dom/telephony/test/marionette/test_incoming_basic_operations.js
@@ -6,42 +6,48 @@ MARIONETTE_HEAD_JS = 'head.js';
 
 const inNumber = "5555552222";
 const inInfo = gInCallStrPool(inNumber);
 let inCall;
 
 function incoming() {
   return gRemoteDial(inNumber)
     .then(call => inCall = call)
-    .then(() => gCheckAll(null, [inCall], "", [], [inInfo.incoming]));
+    .then(() => gCheckAll(null, [inCall], "", [], [inInfo.incoming]))
+    .then(() => is(inCall.disconnectedReason, null));
 }
 
 function answer() {
   return gAnswer(inCall)
-    .then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
+    .then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]))
+    .then(() => is(inCall.disconnectedReason, null));
 }
 
 function hold() {
   return gHold(inCall)
-    .then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]));
+    .then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]))
+    .then(() => is(inCall.disconnectedReason, null));
 }
 
 function resume() {
   return gResume(inCall)
-    .then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
+    .then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]))
+    .then(() => is(inCall.disconnectedReason, null));
 }
 
 function hangUp() {
   return gHangUp(inCall)
-    .then(() => gCheckAll(null, [], "", [], []));
+    .then(() => gCheckAll(null, [], "", [], []))
+    .then(() => is(inCall.disconnectedReason, "NormalCallClearing"));
 }
 
 function remoteHangUp() {
   return gRemoteHangUp(inCall)
-    .then(() => gCheckAll(null, [], "", [], []));
+    .then(() => gCheckAll(null, [], "", [], []))
+    .then(() => is(inCall.disconnectedReason, "NormalCallClearing"));
 }
 
 // Test cases.
 
 function testIncomingReject() {
   log("= testIncomingReject =");
   return incoming()
     .then(() => hangUp());
--- a/dom/telephony/test/marionette/test_outgoing_badNumber.js
+++ b/dom/telephony/test/marionette/test_outgoing_badNumber.js
@@ -22,16 +22,17 @@ function testDialOutInvalidNumber() {
     is(outCall, telephony.active);
     is(telephony.calls.length, 1);
     is(telephony.calls[0], outCall);
 
     return gWaitForEvent(outCall, "error").then(event => {
       is(event.call, outCall);
       ok(event.call.error);
       is(event.call.error.name, "BadNumberError");
+      is(event.call.disconnectedReason, "BadNumber");
     })
     .then(() => gCheckAll(null, [], "", [], []));
   });
 }
 
 startTest(function() {
   testDialOutInvalidNumber()
     .catch(error => ok(false, "Promise reject: " + error))
--- a/dom/telephony/test/marionette/test_outgoing_basic_operations.js
+++ b/dom/telephony/test/marionette/test_outgoing_basic_operations.js
@@ -6,42 +6,48 @@ MARIONETTE_HEAD_JS = 'head.js';
 
 const outNumber = "5555551111";
 const outInfo = gOutCallStrPool(outNumber);
 let outCall;
 
 function outgoing() {
   return gDial(outNumber)
     .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]));
+    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
+    .then(() => is(outCall.disconnectedReason, null));
 }
 
 function answer() {
   return gRemoteAnswer(outCall)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
+    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
+    .then(() => is(outCall.disconnectedReason, null));
 }
 
 function hangUp() {
   return gHangUp(outCall)
-    .then(() => gCheckAll(null, [], "", [], []));
+    .then(() => gCheckAll(null, [], "", [], []))
+    .then(() => is(outCall.disconnectedReason, "NormalCallClearing"));
 }
 
 function remoteHangUp() {
   return gRemoteHangUp(outCall)
-    .then(() => gCheckAll(null, [], "", [], []));
+    .then(() => gCheckAll(null, [], "", [], []))
+    .then(() => is(outCall.disconnectedReason, "NormalCallClearing"));
 }
 
 function hold() {
   return gHold(outCall)
-    .then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]));
+    .then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
+    .then(() => is(outCall.disconnectedReason, null));
 }
 
 function resume() {
   return gResume(outCall)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
+    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
+    .then(() => is(outCall.disconnectedReason, null));
 }
 
 // Test cases.
 
 function testOutgoingReject() {
   log("= testOutgoingReject =");
   return outgoing()
     .then(() => remoteHangUp());
--- a/dom/telephony/test/marionette/test_outgoing_busy.js
+++ b/dom/telephony/test/marionette/test_outgoing_busy.js
@@ -12,16 +12,17 @@ startTest(function() {
   gDial(outNumber)
     .then(call => outCall = call)
     .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
     .then(() => {
       let p1 = gWaitForEvent(outCall, "error")
         .then(event => {
           is(event.call, outCall);
           is(event.call.error.name, "BusyError");
+          is(event.call.disconnectedReason, "Busy");
         });
       let p2 = emulator.runCmd("gsm busy " + outNumber);
       return Promise.all([p1, p2]);
     })
     .then(() => gCheckAll(null, [], "", [], []))
     .catch(error => ok(false, "Promise reject: " + error))
     .then(finish);
 });