Bug 1001343 - Part 2: A new testcase. r=aknow
authorBen Hsu <bhsu@mozilla.com>
Mon, 02 Mar 2015 00:08:00 -0500
changeset 233770 d460c6c205e75342102d8f49f472ba6a90b9f1ce
parent 233769 2091be67caf419ff199e95e4d4f98088484c2145
child 233771 58122581b91d7def5ed971ac8e121f4d030aedde
push id28424
push usercbook@mozilla.com
push dateTue, 17 Mar 2015 10:13:09 +0000
treeherdermozilla-central@c3dc0e5f8b5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaknow
bugs1001343
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 1001343 - Part 2: A new testcase. r=aknow
dom/telephony/test/marionette/manifest.ini
dom/telephony/test/marionette/test_outgoing_from_stk.js
--- a/dom/telephony/test/marionette/manifest.ini
+++ b/dom/telephony/test/marionette/manifest.ini
@@ -39,15 +39,16 @@ qemu = true
 [test_multiple_hold.js]
 [test_outgoing_already_held.js]
 [test_outgoing_answer_hangup_oncallschanged.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_from_stk.js]
 [test_outgoing_onstatechange.js]
 [test_outgoing_radio_off.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]
new file mode 100644
--- /dev/null
+++ b/dom/telephony/test/marionette/test_outgoing_from_stk.js
@@ -0,0 +1,65 @@
+/* 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 = "5555552222";
+const outInfo = gOutCallStrPool(outNumber);
+let outCall;
+
+// Basic functions
+
+function outgoing() {
+  return gDialSTK(outNumber)
+    .then(call => outCall = call)
+    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]));
+}
+
+function localHangUp() {
+  return gHangUp(outCall)
+    .then(() => gCheckAll(null, [], "", [], []));
+}
+
+function remoteAnswer() {
+  return gRemoteAnswer(outCall)
+    .then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
+}
+
+function remoteHangUp() {
+  return gRemoteHangUp(outCall)
+    .then(() => gCheckAll(null, [], "", [], []));
+}
+
+// Sub tests
+
+function testOutgoingLocalHangUp(){
+  log("= testOutgoingLocalHangUp =");
+  return outgoing()
+    .then(() => localHangUp());
+}
+
+function testOutgoingRemoteHangUp() {
+  log("= testOutgoingRemoteHangUp =");
+  return outgoing()
+    .then(() => remoteHangUp());
+}
+
+function testOutgoingRemoteAnswerRemoteHangUp() {
+  log("= testOutgoingRemoreAnswerRemoteHangUp =");
+  return outgoing()
+    .then(() => remoteAnswer())
+    .then(() => remoteHangUp());
+}
+
+// Main test
+
+startTest(function() {
+  Promise.resolve()
+    .then(() => testOutgoingLocalHangUp())
+    .then(() => testOutgoingRemoteHangUp())
+    .then(() => testOutgoingRemoteAnswerRemoteHangUp())
+
+    .catch(error => ok(false, "Promise reject: " + error))
+    .then(finish);
+});