5 <title>Bug
1188750 - WebCrypto must ensure NSS is initialized before deserializing
</title>
6 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"?>
10 <script type=
"application/javascript">
12 * Bug
1188750 - The WebCrypto API must ensure that NSS was initialized
13 * for the current process before trying to deserialize objects like
14 * CryptoKeys from e.g. IndexedDB.
18 const TEST_URI =
"https://example.com/tests/" +
19 "dom/crypto/test/file_indexedDB.html";
21 function createFrame() {
22 let frame = document.createElement(
"iframe");
25 return new Promise(resolve =
> {
26 addEventListener(
"message", event =
> {
27 is(event.source.frameElement, frame,
28 "Message must come from the correct iframe");
29 resolve([frame, event.data]);
32 document.body.appendChild(frame);
36 add_task(async function() {
37 // Load the test app once, to generate and store keys.
38 let [frame, result] = await createFrame();
39 is(result,
"ok",
"stored keys successfully");
42 // Load the test app again to retrieve stored keys.
43 let [recFrame, recResult] = await createFrame();
44 is(recResult,
"ok",
"retrieved keys successfully");