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/crypto/test/test_indexedDB.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/crypto/test/test_indexedDB.html')
-rw-r--r-- | dom/crypto/test/test_indexedDB.html | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/dom/crypto/test/test_indexedDB.html b/dom/crypto/test/test_indexedDB.html new file mode 100644 index 000000000..630c16e0e --- /dev/null +++ b/dom/crypto/test/test_indexedDB.html @@ -0,0 +1,61 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Bug 1188750 - WebCrypto must ensure NSS is initialized before deserializing</title> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"?> +</head> +<body> + <script type="application/javascript;version=1.8"> + /* + * Bug 1188750 - The WebCrypto API must ensure that NSS was initialized + * for the current process before trying to deserialize objects like + * CryptoKeys from e.g. IndexedDB. + */ + "use strict"; + + const TEST_URI = "http://www.example.com/tests/" + + "dom/crypto/test/file_indexedDB.html"; + + SimpleTest.waitForExplicitFinish(); + + function createMozBrowserFrame(cb) { + let frame = document.createElement("iframe"); + SpecialPowers.wrap(frame).mozbrowser = true; + frame.src = TEST_URI; + + frame.addEventListener("mozbrowsershowmodalprompt", function onPrompt(e) { + frame.removeEventListener("mozbrowsershowmodalprompt", onPrompt); + cb(frame, e.detail.message); + }); + + document.body.appendChild(frame); + } + + function runTest() { + // Load the test app once, to generate and store keys. + createMozBrowserFrame((frame, result) => { + is(result, "ok", "stored keys successfully"); + frame.remove(); + + // Load the test app again to retrieve stored keys. + createMozBrowserFrame((frame, result) => { + is(result, "ok", "retrieved keys successfully"); + frame.remove(); + SimpleTest.finish(); + }); + }); + } + + addEventListener("load", function () { + SpecialPowers.addPermission("browser", true, document); + SpecialPowers.pushPrefEnv({set: [ + ["dom.ipc.browser_frames.oop_by_default", true], + ["dom.mozBrowserFramesEnabled", true], + ["network.disable.ipc.security", true] + ]}, runTest); + }); + </script> +</body> +</html> |