forked from mirrors/gecko-dev
This is based on the same rules as for the majority of the rest of mozilla-central. MozReview-Commit-ID: 2O1jH8cNXIj --HG-- extra : rebase_source : b6788a231f70521398ef8783bebce99384a344d9
60 lines
1.2 KiB
HTML
60 lines
1.2 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Test for sandboxed auxiliary navigation flag in receiver page</title>
|
|
</head>
|
|
<body>
|
|
<div id="content"></div>
|
|
<script type="application/javascript">
|
|
|
|
"use strict";
|
|
|
|
function is(a, b, msg) {
|
|
alert((a === b ? "OK " : "KO ") + msg);
|
|
}
|
|
|
|
function ok(a, msg) {
|
|
alert((a ? "OK " : "KO ") + msg);
|
|
}
|
|
|
|
function info(msg) {
|
|
alert("INFO " + msg);
|
|
}
|
|
|
|
function command(msg) {
|
|
alert("COMMAND " + JSON.stringify(msg));
|
|
}
|
|
|
|
function finish() {
|
|
alert("DONE");
|
|
}
|
|
|
|
function testConnectionAvailable() {
|
|
return new Promise(function(aResolve, aReject) {
|
|
ok(navigator.presentation, "navigator.presentation should be available in OOP receiving pages.");
|
|
ok(navigator.presentation.receiver, "navigator.presentation.receiver should be available in receiving pages.");
|
|
|
|
aResolve();
|
|
});
|
|
}
|
|
|
|
function testOpenWindow() {
|
|
return new Promise(function(aResolve, aReject) {
|
|
try {
|
|
window.open("http://example.com");
|
|
ok(false, "receiver page should not be able to open a new window.");
|
|
} catch (e) {
|
|
ok(true, "receiver page should not be able to open a new window.");
|
|
aResolve();
|
|
}
|
|
});
|
|
}
|
|
|
|
testConnectionAvailable().
|
|
then(testOpenWindow).
|
|
then(finish);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|