summaryrefslogtreecommitdiffstats
path: root/dom/system/gonk/tests/marionette/test_dsds_numRadioInterfaces.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/system/gonk/tests/marionette/test_dsds_numRadioInterfaces.js')
-rw-r--r--dom/system/gonk/tests/marionette/test_dsds_numRadioInterfaces.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/dom/system/gonk/tests/marionette/test_dsds_numRadioInterfaces.js b/dom/system/gonk/tests/marionette/test_dsds_numRadioInterfaces.js
new file mode 100644
index 000000000..e178b8b65
--- /dev/null
+++ b/dom/system/gonk/tests/marionette/test_dsds_numRadioInterfaces.js
@@ -0,0 +1,43 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_CONTEXT = "chrome";
+
+Cu.import("resource://gre/modules/Promise.jsm");
+Cu.import("resource://gre/modules/systemlibs.js");
+
+const NS_RIL_CONTRACTID = "@mozilla.org/ril;1";
+
+const PROP_RO_MOZ_RIL_NUMCLIENTS = "ro.moz.ril.numclients";
+
+const PREF_RIL_NUM_RADIO_INTERFACES = "ril.numRadioInterfaces";
+
+ok(libcutils, "libcutils is available");
+
+var propNum = (function() {
+ try {
+ let numString = libcutils.property_get(PROP_RO_MOZ_RIL_NUMCLIENTS, "1");
+ let num = parseInt(numString, 10);
+ if (num >= 0) {
+ return num;
+ }
+ } catch (e) {}
+})();
+
+log("Retrieved '" + PROP_RO_MOZ_RIL_NUMCLIENTS + "' = " + propNum);
+ok(propNum, PROP_RO_MOZ_RIL_NUMCLIENTS);
+
+var prefNum = Services.prefs.getIntPref(PREF_RIL_NUM_RADIO_INTERFACES);
+log("Retrieved '" + PREF_RIL_NUM_RADIO_INTERFACES + "' = " + prefNum);
+
+var ril = Cc[NS_RIL_CONTRACTID].getService(Ci.nsIRadioInterfaceLayer);
+ok(ril, "ril.constructor is " + ril.constructor);
+
+var ifaceNum = ril.numRadioInterfaces;
+log("Retrieved 'nsIRadioInterfaceLayer.numRadioInterfaces' = " + ifaceNum);
+
+is(propNum, prefNum);
+is(propNum, ifaceNum);
+
+finish();