|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 MARIONETTE_TIMEOUT = 60000; |
|
5 MARIONETTE_CONTEXT = "chrome"; |
|
6 |
|
7 Cu.import("resource://gre/modules/Promise.jsm"); |
|
8 Cu.import("resource://gre/modules/systemlibs.js"); |
|
9 |
|
10 const NS_RIL_CONTRACTID = "@mozilla.org/ril;1"; |
|
11 |
|
12 const PROP_RO_MOZ_RIL_NUMCLIENTS = "ro.moz.ril.numclients"; |
|
13 |
|
14 const PREF_RIL_NUM_RADIO_INTERFACES = "ril.numRadioInterfaces"; |
|
15 |
|
16 ok(libcutils, "libcutils is available"); |
|
17 |
|
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 })(); |
|
27 |
|
28 log("Retrieved '" + PROP_RO_MOZ_RIL_NUMCLIENTS + "' = " + propNum); |
|
29 ok(propNum, PROP_RO_MOZ_RIL_NUMCLIENTS); |
|
30 |
|
31 let prefNum = Services.prefs.getIntPref(PREF_RIL_NUM_RADIO_INTERFACES); |
|
32 log("Retrieved '" + PREF_RIL_NUM_RADIO_INTERFACES + "' = " + prefNum); |
|
33 |
|
34 let ril = Cc[NS_RIL_CONTRACTID].getService(Ci.nsIRadioInterfaceLayer); |
|
35 ok(ril, "ril.constructor is " + ril.constructor); |
|
36 |
|
37 let ifaceNum = ril.numRadioInterfaces; |
|
38 log("Retrieved 'nsIRadioInterfaceLayer.numRadioInterfaces' = " + ifaceNum); |
|
39 |
|
40 is(propNum, prefNum); |
|
41 is(propNum, ifaceNum); |
|
42 |
|
43 finish(); |