Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / js / xpconnect / tests / mochitest / test_crosscompartment_weakmap.html
blobd7d364fdeb85f4dfcbdfdea1a8751abd51d34937
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test Cross-Compartment DOM WeakMaps</title>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
7 </head>
8 <body>
9 <p id="display"></p>
10 <script type="application/javascript">
12 var my_map = new WeakMap();
14 function setup() {
15 var item = window.frames[0].document.querySelector("body");
17 my_map.set(item, "success_string");
20 function runTest() {
21 setup();
22 SpecialPowers.forceGC();
23 SpecialPowers.forceCC();
24 SpecialPowers.forceGC();
25 SpecialPowers.forceCC();
26 var item = window.frames[0].document.querySelector("body");
27 is(my_map.get(item), "success_string", "Preserve reflectors used cross-compartment as weak map keys.");
30 </script>
31 <iframe src="file_crosscompartment_weakmap.html" onload="runTest()"></iframe>
34 </pre>
35 </body>
36 </html>