mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
0d460e3432
This is split from the previous changeset since if we include dom/ the file size is too large for phabricator to handle. This is an autogenerated commit to handle scripts loading mochitest harness files, in the simple case where the script src is on the same line as the tag. This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170 using the `--part 2` argument. Differential Revision: https://phabricator.services.mozilla.com/D27457 --HG-- extra : moz-landing-system : lando
61 lines
1.9 KiB
HTML
61 lines
1.9 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Bug 1188750 - WebCrypto must ensure NSS is initialized before deserializing</title>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"?>
|
|
</head>
|
|
<body>
|
|
<script type="application/javascript">
|
|
/*
|
|
* 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(e) {
|
|
cb(frame, e.detail.message);
|
|
}, {once: true});
|
|
|
|
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((recFrame, recResult) => {
|
|
is(recResult, "ok", "retrieved keys successfully");
|
|
recFrame.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>
|