Bug 751403 - Use window.navigator instead of just navigator in telephony tests, r=mdas, a=b2g-only, npotb

This commit is contained in:
Jonathan Griffin 2012-05-03 11:41:29 -07:00
Родитель 5d831f034d
Коммит 8845cb0d2e
3 изменённых файлов: 11 добавлений и 11 удалений

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

@ -17,12 +17,12 @@ class MultiEmulatorDialTest(MarionetteTestCase):
# a global variable when an incoming call is received.
receiver.set_context("chrome")
self.assertTrue(receiver.execute_script("""
return navigator.mozTelephony != undefined && navigator.mozTelephony != null;
return window.navigator.mozTelephony != undefined && window.navigator.mozTelephony != null;
"""))
receiver.execute_script("""
window.wrappedJSObject.incoming = null;
navigator.mozTelephony.addEventListener("incoming", function test_incoming(e) {
navigator.mozTelephony.removeEventListener("incoming", test_incoming);
window.navigator.mozTelephony.addEventListener("incoming", function test_incoming(e) {
window.navigator.mozTelephony.removeEventListener("incoming", test_incoming);
window.wrappedJSObject.incoming = e.call;
});
""")
@ -32,7 +32,7 @@ navigator.mozTelephony.addEventListener("incoming", function test_incoming(e) {
fromPhoneNumber = "1555521%d" % sender.emulator.port
sender.set_context("chrome")
sender.execute_script("""
window.wrappedJSObject.call = navigator.mozTelephony.dial("%s");
window.wrappedJSObject.call = window.navigator.mozTelephony.dial("%s");
""" % toPhoneNumber)
# On the receiver, wait up to 30s for an incoming call to be

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

@ -17,11 +17,11 @@ class MultiEmulatorDialTest(MarionetteTestCase):
# a global variable when an incoming call is received.
receiver.set_context("chrome")
self.assertTrue(receiver.execute_script("""
return navigator.mozTelephony != undefined && navigator.mozTelephony != null;
return window.navigator.mozTelephony != undefined && window.navigator.mozTelephony != null;
"""))
receiver.execute_script("""
window.wrappedJSObject.incoming = "none";
navigator.mozTelephony.addEventListener("incoming", function(e) {
window.navigator.mozTelephony.addEventListener("incoming", function(e) {
window.wrappedJSObject.incoming = e.call.number;
});
""")
@ -31,7 +31,7 @@ navigator.mozTelephony.addEventListener("incoming", function(e) {
fromPhoneNumber = "1555521%d" % sender.emulator.port
sender.set_context("chrome")
sender.execute_script("""
navigator.mozTelephony.dial("%s");
window.navigator.mozTelephony.dial("%s");
""" % toPhoneNumber)
# On the receiver, wait up to 30s for an incoming call to be

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

@ -22,12 +22,12 @@ class DialListenerTest(MarionetteTestCase):
# Setup the event listsener on the receiver, which should store
# a global variable when an incoming call is received.
self.assertTrue(receiver.execute_script("""
return navigator.mozTelephony != undefined && navigator.mozTelephony != null;
return window.navigator.mozTelephony != undefined && window.navigator.mozTelephony != null;
"""))
receiver.execute_script("""
window.wrappedJSObject.incoming = null;
navigator.mozTelephony.addEventListener("incoming", function test_incoming(e) {
navigator.mozTelephony.removeEventListener("incoming", test_incoming);
window.navigator.mozTelephony.addEventListener("incoming", function test_incoming(e) {
window.navigator.mozTelephony.removeEventListener("incoming", test_incoming);
window.wrappedJSObject.incoming = e.call;
});
""")
@ -35,7 +35,7 @@ navigator.mozTelephony.addEventListener("incoming", function test_incoming(e) {
# dial the receiver from the sender
sender.execute_script("""
window.wrappedJSObject.sender_state = [];
window.wrappedJSObject.sender_call = navigator.mozTelephony.dial("%s");
window.wrappedJSObject.sender_call = window.navigator.mozTelephony.dial("%s");
window.wrappedJSObject.sender_call.addEventListener("statechange", function test_sender_statechange(e) {
if (e.call.state == 'disconnected')
window.wrappedJSObject.sender_call.removeEventListener("statechange", test_sender_statechange);