dom/system/gonk/tests/marionette/test_dsds_numRadioInterfaces.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 MARIONETTE_TIMEOUT = 60000;
michael@0 5 MARIONETTE_CONTEXT = "chrome";
michael@0 6
michael@0 7 Cu.import("resource://gre/modules/Promise.jsm");
michael@0 8 Cu.import("resource://gre/modules/systemlibs.js");
michael@0 9
michael@0 10 const NS_RIL_CONTRACTID = "@mozilla.org/ril;1";
michael@0 11
michael@0 12 const PROP_RO_MOZ_RIL_NUMCLIENTS = "ro.moz.ril.numclients";
michael@0 13
michael@0 14 const PREF_RIL_NUM_RADIO_INTERFACES = "ril.numRadioInterfaces";
michael@0 15
michael@0 16 ok(libcutils, "libcutils is available");
michael@0 17
michael@0 18 let propNum = (function() {
michael@0 19 try {
michael@0 20 let numString = libcutils.property_get(PROP_RO_MOZ_RIL_NUMCLIENTS, "1");
michael@0 21 let num = parseInt(numString, 10);
michael@0 22 if (num >= 0) {
michael@0 23 return num;
michael@0 24 }
michael@0 25 } catch (e) {}
michael@0 26 })();
michael@0 27
michael@0 28 log("Retrieved '" + PROP_RO_MOZ_RIL_NUMCLIENTS + "' = " + propNum);
michael@0 29 ok(propNum, PROP_RO_MOZ_RIL_NUMCLIENTS);
michael@0 30
michael@0 31 let prefNum = Services.prefs.getIntPref(PREF_RIL_NUM_RADIO_INTERFACES);
michael@0 32 log("Retrieved '" + PREF_RIL_NUM_RADIO_INTERFACES + "' = " + prefNum);
michael@0 33
michael@0 34 let ril = Cc[NS_RIL_CONTRACTID].getService(Ci.nsIRadioInterfaceLayer);
michael@0 35 ok(ril, "ril.constructor is " + ril.constructor);
michael@0 36
michael@0 37 let ifaceNum = ril.numRadioInterfaces;
michael@0 38 log("Retrieved 'nsIRadioInterfaceLayer.numRadioInterfaces' = " + ifaceNum);
michael@0 39
michael@0 40 is(propNum, prefNum);
michael@0 41 is(propNum, ifaceNum);
michael@0 42
michael@0 43 finish();

mercurial