mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
36 lines
880 B
JavaScript
36 lines
880 B
JavaScript
|
/* Any copyright is dedicated to the Public Domain.
|
||
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||
|
|
||
|
MARIONETTE_TIMEOUT = 60000;
|
||
|
|
||
|
SpecialPowers.addPermission("telephony", true, document);
|
||
|
|
||
|
function cleanUp() {
|
||
|
SpecialPowers.removePermission("telephony", document);
|
||
|
finish();
|
||
|
}
|
||
|
|
||
|
let telephony = window.navigator.mozTelephony;
|
||
|
ok(telephony);
|
||
|
|
||
|
telephony.onready = function() {
|
||
|
log("Receive 'ready' event");
|
||
|
|
||
|
// Test registering 'ready' event in another window.
|
||
|
let iframe = document.createElement("iframe");
|
||
|
iframe.addEventListener("load", function load() {
|
||
|
iframe.removeEventListener("load", load);
|
||
|
|
||
|
let iframeTelephony = iframe.contentWindow.navigator.mozTelephony;
|
||
|
ok(iframeTelephony);
|
||
|
|
||
|
iframeTelephony.onready = function() {
|
||
|
log("Receive 'ready' event in iframe");
|
||
|
|
||
|
cleanUp();
|
||
|
};
|
||
|
});
|
||
|
|
||
|
document.body.appendChild(iframe);
|
||
|
};
|