Bug 1100200 - Part 4: Merge test cases into test_outgoing_basic_operations.js. r=hsinyi
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Wed, 17 Dec 2014 23:47:55 +0800
changeset 220160 6e009bb139fd5999a1279afb07f76737e4707d2e
parent 220159 426b1a22e1abe5b671301f8b9b9cf76034fa65d7
child 220161 a0d08d9c974847e8f2501329396db4eca8c29a1e
push id10457
push userryanvm@gmail.com
push dateThu, 18 Dec 2014 01:54:25 +0000
treeherderfx-team@0e441ff66c5e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1100200
milestone37.0a1
Bug 1100200 - Part 4: Merge test cases into test_outgoing_basic_operations.js. r=hsinyi
dom/telephony/test/marionette/manifest.ini
dom/telephony/test/marionette/test_incoming_basic_operations.js
dom/telephony/test/marionette/test_outgoing_answer_hangup.js
dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js
dom/telephony/test/marionette/test_outgoing_basic_operations.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_reject.js
dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js
--- a/dom/telephony/test/marionette/manifest.ini
+++ b/dom/telephony/test/marionette/manifest.ini
@@ -33,29 +33,23 @@ qemu = true
 [test_incoming_connecting_hangup.js]
 [test_incoming_onstatechange.js]
 [test_mmi.js]
 [test_mmi_call_forwarding.js]
 [test_mmi_change_pin.js]
 [test_mmi_unlock_puk.js]
 [test_multiple_hold.js]
 [test_outgoing_already_held.js]
-[test_outgoing_answer_hangup.js]
 [test_outgoing_answer_hangup_oncallschanged.js]
-[test_outgoing_answer_local_hangup.js]
 [test_outgoing_answer_radio_off.js]
 [test_outgoing_auto_hold.js]
 [test_outgoing_badNumber.js]
+[test_outgoing_basic_operations.js]
 [test_outgoing_busy.js]
 [test_outgoing_emergency_in_airplane_mode.js]
 [test_outgoing_error_state.js]
-[test_outgoing_hangup_alerting.js]
-[test_outgoing_hangup_held.js]
-[test_outgoing_hold_resume.js]
 [test_outgoing_onstatechange.js]
 [test_outgoing_radio_off.js]
-[test_outgoing_reject.js]
-[test_outgoing_remote_hangup_held.js]
 [test_outgoing_when_two_calls_on_line.js]
 [test_ready.js]
 [test_redundant_operations.js]
 [test_swap_held_and_active.js]
 [test_temporary_clir.js]
--- a/dom/telephony/test/marionette/test_incoming_basic_operations.js
+++ b/dom/telephony/test/marionette/test_incoming_basic_operations.js
@@ -14,36 +14,36 @@ function incoming() {
     .then(() => gCheckAll(null, [inCall], "", [], [inInfo.incoming]));
 }
 
 function answer() {
   return gAnswer(inCall)
     .then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
 }
 
+function hold() {
+  return gHold(inCall)
+    .then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]));
+}
+
+function resume() {
+  return gResume(inCall)
+    .then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
+}
+
 function hangUp() {
   return gHangUp(inCall)
     .then(() => gCheckAll(null, [], "", [], []));
 }
 
 function remoteHangUp() {
   return gRemoteHangUp(inCall)
     .then(() => gCheckAll(null, [], "", [], []));
 }
 
-function hold() {
-  return gHold(inCall)
-    .then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]));
-}
-
-function resume() {
-  return gResume(inCall)
-    .then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
-}
-
 // Test cases.
 
 function testIncomingReject() {
   log("= testIncomingReject =");
   return incoming()
     .then(() => hangUp());
 }
 
deleted file mode 100644
--- a/dom/telephony/test/marionette/test_outgoing_answer_hangup.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-MARIONETTE_HEAD_JS = 'head.js';
-
-const outNumber = "5555551111";
-const outInfo = gOutCallStrPool(outNumber);
-let outCall;
-
-startTest(function() {
-  gDial(outNumber)
-    .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
-    .then(() => gRemoteAnswer(outCall))
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
-
-    // Hang-up
-    .then(() => gRemoteHangUp(outCall))
-    .then(() => gCheckAll(null, [], "", [], []))
-
-    .catch(error => ok(false, "Promise reject: " + error))
-    .then(finish);
-});
deleted file mode 100644
--- a/dom/telephony/test/marionette/test_outgoing_answer_local_hangup.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-MARIONETTE_HEAD_JS = 'head.js';
-
-const outNumber = "5555551111";
-const outInfo = gOutCallStrPool(outNumber);
-let outCall;
-
-startTest(function() {
-  gDial(outNumber)
-    .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
-    .then(() => gRemoteAnswer(outCall))
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
-
-    // Hang-up
-    .then(() => gHangUp(outCall))
-    .then(() => gCheckAll(null, [], "", [], []))
-
-    .catch(error => ok(false, "Promise reject: " + error))
-    .then(finish);
-});
new file mode 100644
--- /dev/null
+++ b/dom/telephony/test/marionette/test_outgoing_basic_operations.js
@@ -0,0 +1,117 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+MARIONETTE_TIMEOUT = 90000;
+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]));
+}
+
+function answer() {
+  return gRemoteAnswer(outCall)
+    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
+}
+
+function hangUp() {
+  return gHangUp(outCall)
+    .then(() => gCheckAll(null, [], "", [], []));
+}
+
+function remoteHangUp() {
+  return gRemoteHangUp(outCall)
+    .then(() => gCheckAll(null, [], "", [], []));
+}
+
+function hold() {
+  return gHold(outCall)
+    .then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]));
+}
+
+function resume() {
+  return gResume(outCall)
+    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
+}
+
+// Test cases.
+
+function testOutgoingReject() {
+  log("= testOutgoingReject =");
+  return outgoing()
+    .then(() => remoteHangUp());
+}
+
+function testOutgoingCancel() {
+  log("= testOutgoingCancel =");
+  return outgoing()
+    .then(() => hangUp());
+}
+
+function testOutgoingAnswerHangUp() {
+  log("= testOutgoingAnswerHangUp =");
+  return outgoing()
+    .then(() => answer())
+    .then(() => hangUp());
+}
+
+function testOutgoingAnswerRemoteHangUp() {
+  log("= testOutgoingAnswerRemoteHangUp =");
+  return outgoing()
+    .then(() => answer())
+    .then(() => remoteHangUp());
+}
+
+function testOutgoingAnswerHoldHangUp() {
+  log("= testOutgoingAnswerHoldHangUp =");
+  return outgoing()
+    .then(() => answer())
+    .then(() => hold())
+    .then(() => hangUp());
+}
+
+function testOutgoingAnswerHoldRemoteHangUp() {
+  log("= testOutgoingAnswerHoldRemoteHangUp =");
+  return outgoing()
+    .then(() => answer())
+    .then(() => hold())
+    .then(() => remoteHangUp());
+}
+
+function testOutgoingAnswerHoldResumeHangUp() {
+  log("= testOutgoingAnswerHoldResumeHangUp =");
+  return outgoing()
+    .then(() => answer())
+    .then(() => hold())
+    .then(() => resume())
+    .then(() => hangUp());
+}
+
+function testOutgoingAnswerHoldResumeRemoteHangUp() {
+  log("= testOutgoingAnswerHoldResumeRemoteHangUp =");
+  return outgoing()
+    .then(() => answer())
+    .then(() => hold())
+    .then(() => resume())
+    .then(() => remoteHangUp());
+}
+
+startTest(function() {
+  Promise.resolve()
+    .then(() => testOutgoingReject())
+    .then(() => testOutgoingCancel())
+    .then(() => testOutgoingAnswerHangUp())
+    .then(() => testOutgoingAnswerRemoteHangUp())
+    .then(() => testOutgoingAnswerHoldHangUp())
+    .then(() => testOutgoingAnswerHoldRemoteHangUp())
+    .then(() => testOutgoingAnswerHoldResumeHangUp())
+    .then(() => testOutgoingAnswerHoldResumeRemoteHangUp())
+
+    .catch(error => ok(false, "Promise reject: " + error))
+    .then(finish);
+});
deleted file mode 100644
--- a/dom/telephony/test/marionette/test_outgoing_hangup_alerting.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-MARIONETTE_HEAD_JS = 'head.js';
-
-const outNumber = "5555551111";
-const outInfo = gOutCallStrPool(outNumber);
-let outCall;
-
-startTest(function() {
-  gDial(outNumber)
-    .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
-
-    // Hang-up
-    .then(() => gRemoteHangUp(outCall))
-    .then(() => gCheckAll(null, [], "", [], []))
-
-    .catch(error => ok(false, "Promise reject: " + error))
-    .then(finish);
-});
deleted file mode 100644
--- a/dom/telephony/test/marionette/test_outgoing_hangup_held.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-MARIONETTE_HEAD_JS = 'head.js';
-
-const outNumber = "5555551111";
-const outInfo = gOutCallStrPool(outNumber);
-let outCall;
-
-startTest(function() {
-  gDial(outNumber)
-    .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
-    .then(() => gRemoteAnswer(outCall))
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
-    .then(() => gHold(outCall))
-    .then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
-
-    // Hang-up
-    .then(() => gHangUp(outCall))
-    .then(() => gCheckAll(null, [], "", [], []))
-
-    .catch(error => ok(false, "Promise reject: " + error))
-    .then(finish);
-});
deleted file mode 100644
--- a/dom/telephony/test/marionette/test_outgoing_hold_resume.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-MARIONETTE_HEAD_JS = 'head.js';
-
-const outNumber = "5555551111";
-const outInfo = gOutCallStrPool(outNumber);
-let outCall;
-
-startTest(function() {
-  gDial(outNumber)
-    .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
-    .then(() => gRemoteAnswer(outCall))
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
-    .then(() => gHold(outCall))
-    .then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
-    .then(() => gResume(outCall))
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
-
-    // Hang-up
-    .then(() => gRemoteHangUp(outCall))
-    .then(() => gCheckAll(null, [], "", [], []))
-
-    .catch(error => ok(false, "Promise reject: " + error))
-    .then(finish);
-});
deleted file mode 100644
--- a/dom/telephony/test/marionette/test_outgoing_reject.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-MARIONETTE_HEAD_JS = 'head.js';
-
-const outNumber = "5555551111";
-const outInfo = gOutCallStrPool(outNumber);
-let outCall;
-
-startTest(function() {
-  gDial(outNumber)
-    .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
-
-    // Hang-up
-    .then(() => gRemoteHangUp(outCall))
-    .then(() => gCheckAll(null, [], "", [], []))
-
-    .catch(error => ok(false, "Promise reject: " + error))
-    .then(finish);
-});
deleted file mode 100644
--- a/dom/telephony/test/marionette/test_outgoing_remote_hangup_held.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-MARIONETTE_TIMEOUT = 60000;
-MARIONETTE_HEAD_JS = 'head.js';
-
-const outNumber = "5555551111";
-const outInfo = gOutCallStrPool(outNumber);
-let outCall;
-
-startTest(function() {
-  gDial(outNumber)
-    .then(call => outCall = call)
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
-    .then(() => gRemoteAnswer(outCall))
-    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
-    .then(() => gHold(outCall))
-    .then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
-
-    // Hang-up
-    .then(() => gRemoteHangUp(outCall))
-    .then(() => gCheckAll(null, [], "", [], []))
-
-    .catch(error => ok(false, "Promise reject: " + error))
-    .then(finish);
-});