Bug 1112471 - Part 4: Test case for getting icc service state API. r=hsinyi
authorEdgar Chen <echen@mozilla.com>
Fri, 26 Dec 2014 16:09:11 +0800
changeset 248457 f1997f0cf24b33e067272ec52a24e2993d629d54
parent 248456 77324fcf60a058edfebee6fd294d5225678eec57
child 248458 0eab08995eeed36021081dc3e7d61d8406338d87
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1112471
milestone37.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 1112471 - Part 4: Test case for getting icc service state API. r=hsinyi
dom/icc/tests/marionette/manifest.ini
dom/icc/tests/marionette/test_icc_service_state.js
--- a/dom/icc/tests/marionette/manifest.ini
+++ b/dom/icc/tests/marionette/manifest.ini
@@ -26,8 +26,9 @@ qemu = true
 [test_stk_get_input.js]
 [test_stk_select_item.js]
 [test_stk_setup_menu.js]
 [test_stk_setup_idle_mode_text.js]
 [test_stk_bip_command.js]
 [test_icc_access_invalid_object.js]
 [test_icc_detected_undetected_event.js]
 [test_icc_match_mvno.js]
+[test_icc_service_state.js]
new file mode 100644
--- /dev/null
+++ b/dom/icc/tests/marionette/test_icc_service_state.js
@@ -0,0 +1,28 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_HEAD_JS = "head.js";
+
+function testUnsupportedService() {
+  try {
+    icc.getServiceState("unsupported-service");
+    ok(false, "should get exception");
+  } catch (aException) {
+    ok(true, "got exception: " + aException);
+  }
+}
+
+// Start tests
+startTestCommon(function() {
+  let icc = getMozIcc();
+
+  // Check fdn service state
+  return icc.getServiceState("fdn")
+    .then((aResult) => {
+      is(aResult, true, "check fdn service state");
+    })
+
+    // Test unsupported service
+    .then(() => testUnsupportedService());
+});