diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html')
-rw-r--r-- | dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html b/dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html new file mode 100644 index 000000000..3a6060310 --- /dev/null +++ b/dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html @@ -0,0 +1,60 @@ +<!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;version=1.7"> + +"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> |