|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 MARIONETTE_TIMEOUT = 60000; |
|
5 MARIONETTE_HEAD_JS = "head.js"; |
|
6 |
|
7 function check(aLongName, aShortName) { |
|
8 let network = mobileConnection.voice.network; |
|
9 |
|
10 is(network.longName, aLongName, "network.longName"); |
|
11 is(network.shortName, aShortName, "network.shortName"); |
|
12 is(network.mcc, "310", "network.mcc"); |
|
13 is(network.mnc, "260", "network.mnc"); |
|
14 } |
|
15 |
|
16 function test(aLongName, aShortName) { |
|
17 log("Testing '" + aLongName + "', '" + aShortName + "':"); |
|
18 |
|
19 let promises = []; |
|
20 promises.push(waitForManagerEvent("voicechange")); |
|
21 promises.push(setEmulatorOperatorNames("home", aLongName, aShortName)); |
|
22 return Promise.all(promises) |
|
23 .then(() => check(aLongName, aShortName)); |
|
24 } |
|
25 |
|
26 startTestCommon(function() { |
|
27 return getEmulatorOperatorNames() |
|
28 .then(function(aOperators) { |
|
29 return Promise.resolve() |
|
30 |
|
31 .then(() => test("Mozilla", "B2G")) |
|
32 .then(() => test("Mozilla", "")) |
|
33 .then(() => test("", "B2G")) |
|
34 .then(() => test("", "")) |
|
35 |
|
36 // Reset back to initial values. |
|
37 .then(() => test(aOperators[0].longName, aOperators[0].shortName)); |
|
38 }); |
|
39 }); |