Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / mochitest / test_bug655297-2.html
blob67da7964bd1b84ae1a0bc28f1ded8dfde546e2d6
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=655297
5 -->
6 <head>
7 <title>Test for Bug 655297</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=655297">Mozilla Bug 655297</a>
13 <p id="display"></p>
14 <div id="content" style="display: none">
16 </div>
17 <p>0</p> <p>1</p> <p>2</p> <p>3</p> <p>4</p>
18 <p>5</p> <p>6</p> <p>7</p> <p>8</p> <p>9</p>
19 <pre id="test">
20 <script type="application/javascript">
22 /** Test for Bug 655297 **/
24 var map = new WeakMap();
25 function f() {
26 var paras = document.getElementsByTagName("p");
27 for (var i = 0; i < paras.length; i++)
28 map.set(paras[i], "ok");
30 function g() {
31 var paras = document.getElementsByTagName("p");
32 for (var i = 0; i < paras.length; i++) {
33 if (map.get(paras[i]) != "ok") {
34 return false;
37 return true;
40 f();
41 SpecialPowers.forceGC();
42 ok(g(), "Failed to keep XPCWrappedNative used as WeakMap key alive.");
44 </script>
47 </pre>
48 </body>
49 </html>