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/tests/mochitest/general/frameStoragePrevented.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/tests/mochitest/general/frameStoragePrevented.html')
-rw-r--r-- | dom/tests/mochitest/general/frameStoragePrevented.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/tests/mochitest/general/frameStoragePrevented.html b/dom/tests/mochitest/general/frameStoragePrevented.html new file mode 100644 index 000000000..3554d6082 --- /dev/null +++ b/dom/tests/mochitest/general/frameStoragePrevented.html @@ -0,0 +1,47 @@ + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>frame for storage prevented test</title> + +<script type="text/javascript" src="https://example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script> +<script type="text/javascript;version=1.7"> + + task(function* () { + // We shouldn't be able to access storage + yield storagePrevented(); + + // This hash of the URI is set to #nullprincipal by the test if the current page has a null principal, + // and thus attempting to create a dedicated worker will throw + if (location.hash == "#nullprincipal") { + function createWorker() { + return new Promise((resolve, reject) => { + var w; + try { + w = new Worker("workerStoragePrevented.js"); + } catch (e) { + ok(true, "Running workers was prevented"); + resolve(); + } + + w.onerror = function() { + ok(true, "Running workers was prevented"); + resolve(); + } + }); + } + + yield createWorker(); + return; + } + + // Try to run a worker, which shouldn't be able to access storage + yield runWorker("workerStoragePrevented.js"); + }); + +</script> + +</head> + +<body> +</body> +</html> |