dom/mobileconnection/tests/marionette/test_mobile_operator_names.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_HEAD_JS = "head.js";
michael@0 6
michael@0 7 function check(aLongName, aShortName) {
michael@0 8 let network = mobileConnection.voice.network;
michael@0 9
michael@0 10 is(network.longName, aLongName, "network.longName");
michael@0 11 is(network.shortName, aShortName, "network.shortName");
michael@0 12 is(network.mcc, "310", "network.mcc");
michael@0 13 is(network.mnc, "260", "network.mnc");
michael@0 14 }
michael@0 15
michael@0 16 function test(aLongName, aShortName) {
michael@0 17 log("Testing '" + aLongName + "', '" + aShortName + "':");
michael@0 18
michael@0 19 let promises = [];
michael@0 20 promises.push(waitForManagerEvent("voicechange"));
michael@0 21 promises.push(setEmulatorOperatorNames("home", aLongName, aShortName));
michael@0 22 return Promise.all(promises)
michael@0 23 .then(() => check(aLongName, aShortName));
michael@0 24 }
michael@0 25
michael@0 26 startTestCommon(function() {
michael@0 27 return getEmulatorOperatorNames()
michael@0 28 .then(function(aOperators) {
michael@0 29 return Promise.resolve()
michael@0 30
michael@0 31 .then(() => test("Mozilla", "B2G"))
michael@0 32 .then(() => test("Mozilla", ""))
michael@0 33 .then(() => test("", "B2G"))
michael@0 34 .then(() => test("", ""))
michael@0 35
michael@0 36 // Reset back to initial values.
michael@0 37 .then(() => test(aOperators[0].longName, aOperators[0].shortName));
michael@0 38 });
michael@0 39 });

mercurial