Bug 1686668 [wpt PR 27185] - Update wpt metadata, a=testonly
[gecko.git] / dom / base / test / test_window_extensible.html
blobddc6e0d3d0dee2bbd73ca6938fe1774f58be5e96
1 <!DOCTYPE html>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=856384
5 -->
6 <head>
7 <meta charset="UTF-8">
8 <title>Test for Bug 856384</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=856384">Mozilla Bug 856384</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 </div>
17 <iframe name="constructor" src="about:blank"></iframe>
18 <pre id="test">
19 <script type="application/javascript">
20 SimpleTest.waitForExplicitFinish();
22 function run()
24 is(Object.isExtensible(window), true, "Windows are extensible by default");
26 try
28 Object.preventExtensions(window);
29 throw "didn't throw";
31 catch (e)
33 is(e instanceof TypeError, true,
34 "preventExtensions(window) should throw a TypeError, instead got: " + e);
35 is(Object.isExtensible(window), true,
36 'Windows are extensible after an extensibility "change" attempt');
39 SimpleTest.finish();
42 window.addEventListener("load", run);
43 </script>
44 </pre>
45 </body>
46 </html>