|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 MARIONETTE_TIMEOUT = 30000; |
|
5 |
|
6 SpecialPowers.addPermission("mobilenetwork", true, document); |
|
7 |
|
8 let connection = navigator.mozMobileConnections[0]; |
|
9 ok(connection instanceof MozMobileConnection, |
|
10 "connection is instanceof " + connection.constructor); |
|
11 |
|
12 |
|
13 function testLastKnownNetwork() { |
|
14 log("testLastKnownNetwork: " + connection.lastKnownNetwork); |
|
15 // The emulator's hard coded operatoer's mcc and mnc codes. |
|
16 is(connection.lastKnownNetwork, "310-260"); |
|
17 runNextTest(); |
|
18 } |
|
19 |
|
20 function testLastKnownHomeNetwork() { |
|
21 log("testLastKnownHomeNetwork: " + connection.lastKnownHomeNetwork); |
|
22 // The emulator's hard coded icc's mcc and mnc codes. |
|
23 is(connection.lastKnownHomeNetwork, "310-260"); |
|
24 runNextTest(); |
|
25 } |
|
26 |
|
27 let tests = [ |
|
28 testLastKnownNetwork, |
|
29 testLastKnownHomeNetwork |
|
30 ]; |
|
31 |
|
32 function runNextTest() { |
|
33 let test = tests.shift(); |
|
34 if (!test) { |
|
35 cleanUp(); |
|
36 return; |
|
37 } |
|
38 |
|
39 test(); |
|
40 } |
|
41 |
|
42 function cleanUp() { |
|
43 SpecialPowers.removePermission("mobilenetwork", document); |
|
44 finish(); |
|
45 } |
|
46 |
|
47 runNextTest(); |