2014-07-30 00:11:00 +00:00
|
|
|
/* 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();
|
|
|
|
}
|
|
|
|
|
2015-09-15 18:19:45 +00:00
|
|
|
var telephony = window.navigator.mozTelephony;
|
2014-07-30 00:11:00 +00:00
|
|
|
ok(telephony);
|
|
|
|
|
2014-12-16 22:57:23 +00:00
|
|
|
telephony.ready.then(function() {
|
|
|
|
log("Telephony got ready");
|
2014-07-30 00:11:00 +00:00
|
|
|
|
2014-12-16 22:57:23 +00:00
|
|
|
// Test telephony.ready in another window.
|
2014-07-30 00:11:00 +00:00
|
|
|
let iframe = document.createElement("iframe");
|
|
|
|
iframe.addEventListener("load", function load() {
|
|
|
|
iframe.removeEventListener("load", load);
|
|
|
|
|
|
|
|
let iframeTelephony = iframe.contentWindow.navigator.mozTelephony;
|
|
|
|
ok(iframeTelephony);
|
|
|
|
|
2014-12-16 22:57:23 +00:00
|
|
|
iframeTelephony.ready.then(function() {
|
|
|
|
log("Telephony in iframe got ready");
|
2014-07-30 00:11:00 +00:00
|
|
|
|
|
|
|
cleanUp();
|
2014-12-16 22:57:23 +00:00
|
|
|
});
|
2014-07-30 00:11:00 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
document.body.appendChild(iframe);
|
2014-12-16 22:57:23 +00:00
|
|
|
});
|