зеркало из https://github.com/mozilla/gecko-dev.git
Bug 953005 - part2 - test_mobile_connections_array_uninitialized
This commit is contained in:
Родитель
a90c2e5d9b
Коммит
c271f580a8
|
@ -20,3 +20,4 @@ disabled = Bug 808783
|
|||
[test_call_barring_change_password.js]
|
||||
[test_mobile_set_radio.js]
|
||||
[test_mobile_last_known_network.js]
|
||||
[test_mobile_connections_array_uninitialized.js]
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 1000;
|
||||
|
||||
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 connections;
|
||||
|
||||
ifr.onload = function() {
|
||||
connections = ifr.contentWindow.navigator.mozMobileConnections;
|
||||
|
||||
// mozMobileConnections hasn't been initialized yet.
|
||||
ok(connections);
|
||||
is(connections.length, 1);
|
||||
|
||||
ifr.parentNode.removeChild(ifr);
|
||||
ifr = null;
|
||||
connections = null;
|
||||
|
||||
SpecialPowers.gc();
|
||||
cleanUp();
|
||||
};
|
||||
document.body.appendChild(ifr);
|
||||
|
||||
function cleanUp() {
|
||||
SpecialPowers.removePermission("mobileconnection", document);
|
||||
finish();
|
||||
}
|
Загрузка…
Ссылка в новой задаче