Bug 814629 - Part 5: modify mozMobileConnection related tests. r=hsinyi,khuey
--- a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js
+++ b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_etws.js
@@ -258,11 +258,11 @@ function cleanUp() {
SpecialPowers.removePermission("mobileconnection", document);
SpecialPowers.removePermission("cellbroadcast", true, document);
finish();
}
waitFor(testEtwsMessageAttributes, function () {
- return navigator.mozMobileConnection.voice.connected;
+ return navigator.mozMobileConnections[0].voice.connected;
});
--- a/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js
+++ b/dom/cellbroadcast/tests/marionette/test_cellbroadcast_gsm.js
@@ -471,11 +471,11 @@ function cleanUp() {
SpecialPowers.removePermission("mobileconnection", document);
SpecialPowers.removePermission("cellbroadcast", true, document);
finish();
}
waitFor(testGsmMessageAttributes, function () {
- return navigator.mozMobileConnection.voice.connected;
+ return navigator.mozMobileConnections[0].voice.connected;
});
--- a/dom/network/tests/marionette/test_call_barring_change_password.js
+++ b/dom/network/tests/marionette/test_call_barring_change_password.js
@@ -5,17 +5,17 @@ MARIONETTE_TIMEOUT = 60000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let connection;
ifr.onload = function() {
- connection = ifr.contentWindow.navigator.mozMobileConnection;
+ connection = ifr.contentWindow.navigator.mozMobileConnections[0];
ok(connection instanceof ifr.contentWindow.MozMobileConnection,
"connection is instanceof " + connection.constructor);
setTimeout(testChangeCallBarringPasswordWithFailure, 0);
};
document.body.appendChild(ifr);
--- a/dom/network/tests/marionette/test_call_barring_get_option.js
+++ b/dom/network/tests/marionette/test_call_barring_get_option.js
@@ -5,17 +5,17 @@ MARIONETTE_TIMEOUT = 60000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let connection;
ifr.onload = function() {
- connection = ifr.contentWindow.navigator.mozMobileConnection;
+ connection = ifr.contentWindow.navigator.mozMobileConnections[0];
ok(connection instanceof ifr.contentWindow.MozMobileConnection,
"connection is instanceof " + connection.constructor);
testGetCallBarringOption();
};
document.body.appendChild(ifr);
--- a/dom/network/tests/marionette/test_call_barring_set_error.js
+++ b/dom/network/tests/marionette/test_call_barring_set_error.js
@@ -5,17 +5,17 @@ MARIONETTE_TIMEOUT = 60000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let connection;
ifr.onload = function() {
- connection = ifr.contentWindow.navigator.mozMobileConnection;
+ connection = ifr.contentWindow.navigator.mozMobileConnections[0];
ok(connection instanceof ifr.contentWindow.MozMobileConnection,
"connection is instanceof " + connection.constructor);
nextTest();
};
document.body.appendChild(ifr);
--- a/dom/network/tests/marionette/test_mobile_data_connection.js
+++ b/dom/network/tests/marionette/test_mobile_data_connection.js
@@ -8,17 +8,17 @@ const DATA_ROAMING_KEY = "ril.data.roami
const APN_KEY = "ril.data.apnSettings";
SpecialPowers.setBoolPref("dom.mozSettings.enabled", true);
SpecialPowers.addPermission("mobileconnection", true, document);
SpecialPowers.addPermission("settings-read", true, document);
SpecialPowers.addPermission("settings-write", true, document);
let settings = window.navigator.mozSettings;
-let connection = window.navigator.mozMobileConnection;
+let connection = window.navigator.mozMobileConnections[0];
ok(connection instanceof MozMobileConnection,
"connection is instanceof " + connection.constructor);
let pendingEmulatorCmdCount = 0;
function sendCmdToEmulator(cmd, callback) {
++pendingEmulatorCmdCount;
--- a/dom/network/tests/marionette/test_mobile_data_location.js
+++ b/dom/network/tests/marionette/test_mobile_data_location.js
@@ -5,17 +5,17 @@ MARIONETTE_TIMEOUT = 20000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let mobileConnection;
ifr.onload = function() {
- mobileConnection = ifr.contentWindow.navigator.mozMobileConnection;
+ mobileConnection = ifr.contentWindow.navigator.mozMobileConnections[0];
// Start the test
verifyInitialState();
};
document.body.appendChild(ifr);
let emulatorStartLac = 0;
let emulatorStartCid = 0;
--- a/dom/network/tests/marionette/test_mobile_data_state.js
+++ b/dom/network/tests/marionette/test_mobile_data_state.js
@@ -5,17 +5,17 @@ MARIONETTE_TIMEOUT = 30000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let mobileConnection;
ifr.onload = function() {
- mobileConnection = ifr.contentWindow.navigator.mozMobileConnection;
+ mobileConnection = ifr.contentWindow.navigator.mozMobileConnections[0];
// Start the test
verifyInitialState();
};
document.body.appendChild(ifr);
function verifyInitialState() {
log("Verifying initial state.");
--- a/dom/network/tests/marionette/test_mobile_mmi.js
+++ b/dom/network/tests/marionette/test_mobile_mmi.js
@@ -5,17 +5,17 @@ MARIONETTE_TIMEOUT = 20000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let mobileConnection;
ifr.onload = function() {
- mobileConnection = ifr.contentWindow.navigator.mozMobileConnection;
+ mobileConnection = ifr.contentWindow.navigator.mozMobileConnections[0];
tasks.run();
};
document.body.appendChild(ifr);
let tasks = {
// List of test functions. Each of them should call |tasks.next()| when
// completed or |tasks.abort()| to jump to the last one.
--- a/dom/network/tests/marionette/test_mobile_networks.js
+++ b/dom/network/tests/marionette/test_mobile_networks.js
@@ -1,17 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// getNetworks() can take some time..
MARIONETTE_TIMEOUT = 60000;
SpecialPowers.addPermission("mobileconnection", true, document);
-let connection = navigator.mozMobileConnection;
+let connection = navigator.mozMobileConnections[0];
ok(connection instanceof MozMobileConnection,
"connection is instanceof " + connection.constructor);
is(connection.networkSelectionMode, "automatic");
let androidNetwork = null;
let telkilaNetwork = null;
--- a/dom/network/tests/marionette/test_mobile_operator_names.js
+++ b/dom/network/tests/marionette/test_mobile_operator_names.js
@@ -10,17 +10,17 @@ const OPERATOR_ROAMING = 1;
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let connection;
let voice;
let network;
ifr.onload = function() {
- connection = ifr.contentWindow.navigator.mozMobileConnection;
+ connection = ifr.contentWindow.navigator.mozMobileConnections[0];
ok(connection instanceof ifr.contentWindow.MozMobileConnection,
"connection is instanceof " + connection.constructor);
voice = connection.voice;
ok(voice, "voice connection valid");
network = voice.network;
ok(network, "voice network info valid");
--- a/dom/network/tests/marionette/test_mobile_preferred_network_type.js
+++ b/dom/network/tests/marionette/test_mobile_preferred_network_type.js
@@ -55,11 +55,11 @@ function cleanUp() {
SpecialPowers.removePermission("mobileconnection", document);
SpecialPowers.removePermission("settings-write", document);
SpecialPowers.removePermission("settings-read", document);
finish();
}
waitFor(test_revert_previous_setting_on_invalid_value, function () {
- return navigator.mozMobileConnection.voice.connected;
+ return navigator.mozMobileConnections[0].voice.connected;
});
--- a/dom/network/tests/marionette/test_mobile_roaming_preference.js
+++ b/dom/network/tests/marionette/test_mobile_roaming_preference.js
@@ -1,16 +1,16 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
SpecialPowers.addPermission("mobileconnection", true, document);
-let connection = navigator.mozMobileConnection;
+let connection = navigator.mozMobileConnections[0];
ok(connection instanceof MozMobileConnection,
"connection is instanceof " + connection.constructor);
function failedToSetRoamingPreference(mode, expectedErrorMessage, callback) {
let request = connection.setRoamingPreference(mode);
ok(request instanceof DOMRequest,
"request instanceof " + request.constructor);
--- a/dom/network/tests/marionette/test_mobile_voice_state.js
+++ b/dom/network/tests/marionette/test_mobile_voice_state.js
@@ -5,17 +5,17 @@ MARIONETTE_TIMEOUT = 30000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let connection;
ifr.onload = function() {
- connection = ifr.contentWindow.navigator.mozMobileConnection;
+ connection = ifr.contentWindow.navigator.mozMobileConnections[0];
ok(connection instanceof ifr.contentWindow.MozMobileConnection,
"connection is instanceof " + connection.constructor);
testConnectionInfo();
};
document.body.appendChild(ifr);
let emulatorCmdPendingCount = 0;
function setEmulatorVoiceState(state) {
--- a/dom/permission/tests/test_mobileconnection.html
+++ b/dom/permission/tests/test_mobileconnection.html
@@ -14,17 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cg
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
<script type="application/javascript;version=1.8" src="file_framework.js"></script>
<script type="application/javascript;version=1.8">
var gData = [
{
perm: ["mobileconnection"],
- obj: "mozMobileConnection",
- idl: "nsIDOMMozMobileConnection",
+ obj: "mozMobileConnections",
+ webidl: "MozMobileConnectionArray",
},
]
</script>
</pre>
</body>
</html>
--- a/dom/telephony/test/marionette/test_outgoing_radio_off.js
+++ b/dom/telephony/test/marionette/test_outgoing_radio_off.js
@@ -76,17 +76,17 @@ function cleanUp() {
}
let permissions = [
"mobileconnection",
"settings-write"
];
startTestWithPermissions(permissions, function() {
- connection = navigator.mozMobileConnection;
+ connection = navigator.mozMobileConnections[0];
ok(connection instanceof MozMobileConnection,
"connection is instanceof " + connection.constructor);
icc = navigator.mozIccManager;
ok(icc instanceof MozIccManager, "icc is instanceof " + icc.constructor);
setRadioEnabled(false, function() {
dial("0912345678");
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -346,16 +346,17 @@ var interfaceNamesInGlobalScope =
"MozCSSKeyframesRule",
{name: "MozEmergencyCbModeEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
{name: "MozIccManager", b2g: true, pref: "dom.icc.enabled"},
{name: "MozInputContext", b2g: true},
{name: "MozInputMethodManager", b2g: true},
"MozMmsEvent",
"MozMmsMessage",
{name: "MozMobileConnection", b2g: true, pref: "dom.mobileconnection.enabled"},
+ {name: "MozMobileConnectionArray", b2g: true, pref: "dom.mobileconnection.enabled"},
"MozMobileMessageManager",
"MozMobileMessageThread",
"MozNamedAttrMap",
{name: "MozOtaStatusEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
"MozPowerManager",
"mozRTCIceCandidate",
"mozRTCPeerConnection",
"mozRTCSessionDescription",