Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 MARIONETTE_TIMEOUT = 60000;
5 MARIONETTE_CONTEXT = "chrome";
7 Cu.import("resource://gre/modules/Promise.jsm");
8 Cu.import("resource://gre/modules/systemlibs.js");
10 const NS_RIL_CONTRACTID = "@mozilla.org/ril;1";
12 const PROP_RO_MOZ_RIL_NUMCLIENTS = "ro.moz.ril.numclients";
14 const PREF_RIL_NUM_RADIO_INTERFACES = "ril.numRadioInterfaces";
16 ok(libcutils, "libcutils is available");
18 let propNum = (function() {
19 try {
20 let numString = libcutils.property_get(PROP_RO_MOZ_RIL_NUMCLIENTS, "1");
21 let num = parseInt(numString, 10);
22 if (num >= 0) {
23 return num;
24 }
25 } catch (e) {}
26 })();
28 log("Retrieved '" + PROP_RO_MOZ_RIL_NUMCLIENTS + "' = " + propNum);
29 ok(propNum, PROP_RO_MOZ_RIL_NUMCLIENTS);
31 let prefNum = Services.prefs.getIntPref(PREF_RIL_NUM_RADIO_INTERFACES);
32 log("Retrieved '" + PREF_RIL_NUM_RADIO_INTERFACES + "' = " + prefNum);
34 let ril = Cc[NS_RIL_CONTRACTID].getService(Ci.nsIRadioInterfaceLayer);
35 ok(ril, "ril.constructor is " + ril.constructor);
37 let ifaceNum = ril.numRadioInterfaces;
38 log("Retrieved 'nsIRadioInterfaceLayer.numRadioInterfaces' = " + ifaceNum);
40 is(propNum, prefNum);
41 is(propNum, ifaceNum);
43 finish();