Bug 953005 - part2 - test_mobile_connections_array_uninitialized

This commit is contained in:
Hsin-Yi Tsai 2014-01-15 12:17:03 +08:00
Родитель a90c2e5d9b
Коммит c271f580a8
2 изменённых файлов: 33 добавлений и 0 удалений

Просмотреть файл

@ -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();
}