b=450088 backing out (new reftest failed)
[wine-gecko.git] / testing / mochitest / tests / test_bug332848.xhtml
blob1087455867ffe3ea25442df68e403f7a7c672113
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=332848
4 -->
5 <head>
6 <title>Test for Bug 332848</title>
7 <script type="text/javascript" src="/MochiKit/packed.js"></script>
8 <script type="text/javascript" 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=332848">Mozilla Bug 332848</a>
13 <p id="display"></p>
14 <div id="content" style="display: none">
16 </div>
17 <pre id="test">
18 <script class="testbody" type="text/javascript">
19 <![CDATA[
21 /** Test for Bug 332848 **/
23 // parseChecker will become true if we keep parsing after calling close().
24 var parseChecker = false;
26 function test() {
27 try {
28 document.open();
29 is(0, 1, "document.open succeeded");
30 } catch (e) {
31 is (e.code, DOMException.NOT_SUPPORTED_ERR,
32 "Wrong exception from document.open");
35 try {
36 document.write("aaa");
37 is(0, 1, "document.write succeeded");
38 } catch (e) {
39 is (e.code, DOMException.NOT_SUPPORTED_ERR,
40 "Wrong exception from document.write");
43 try {
44 document.close();
45 is(0, 1, "document.close succeeded");
46 } catch (e) {
47 is (e.code, DOMException.NOT_SUPPORTED_ERR,
48 "Wrong exception from document.close");
52 function loadTest() {
53 is(parseChecker, true, "Parsing stopped");
54 test();
55 SimpleTest.finish();
58 window.onload = loadTest;
60 SimpleTest.waitForExplicitFinish();
62 test();
63 ]]>
64 </script>
65 <script>
66 parseChecker = true;
67 </script>
68 </pre>
69 </body>
70 </html>