Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / constructors-overriding.html
blob2bbd33a2b2e8eab955b3cea9a39269aacdd9a48f
1 <html>
2 <head>
3 <script>
4 function print(message, color)
6 var paragraph = document.createElement("div");
7 paragraph.appendChild(document.createTextNode(message));
8 paragraph.style.fontFamily = "monospace";
9 if (color)
10 paragraph.style.color = color;
11 document.getElementById("console").appendChild(paragraph);
14 function shouldBe(a, b)
16 var evalA = eval(a);
17 if (evalA == b)
18 print("PASS: " + a + " should be " + b + " and is.", "green");
19 else
20 print("FAIL: " + a + " should be " + b + " but instead is " + evalA + ".", "red");
23 function test()
25 if (window.testRunner)
26 testRunner.dumpAsText();
28 window.Image = 1;
29 window.Option = 1;
30 window.XMLHttpRequest = 1;
31 window.XMLSerializer = 1;
32 window.DOMParser = 1;
33 window.XSLTProcessor = 1;
35 shouldBe("window.Image", 1);
36 shouldBe("window.Option", 1);
37 shouldBe("window.XMLHttpRequest", 1);
38 shouldBe("window.XMLSerializer", 1);
39 shouldBe("window.DOMParser", 1);
40 shouldBe("window.XSLTProcessor", 1);
42 </script>
43 </head>
45 <body onload="test();">
46 <p>This page tests whether certain global constructors are read-only. Previous versions of WebKit incorrectly
47 made them read-only.</p>
48 <p>If the test passes, you'll see a series of pass message below.</p>
49 <hr>
51 <div id='console'></div>
53 </body>
54 </html>