Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / tokenizer / flush-characters-in-document-write-evil.html
blob006bc7747afbedfd60d00699fb012bd5d2f1ae2d
1 <head>
2 <script>
3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
8 function test() {
9 document.write("<div>Should be 12:</div><div>1");
11 if (document.getElementsByTagName("div").length != 2)
12 alert("Error - wrong number of DIVs at step 1");
14 if (document.getElementsByTagName("div")[1].textContent != "1")
15 alert("Error - incorrect div content at step 1");
17 setTimeout(test2, 10);
20 function test2() {
21 document.write("2</div>")
23 if (document.getElementsByTagName("div").length != 2)
24 alert("Error - wrong number of DIVs at step 2");
26 if (document.getElementsByTagName("div")[1].textContent != "12")
27 alert("Error - incorrect div content at step 2");
29 document.close();
31 setTimeout("testRunner.notifyDone()", 10);
33 </script>
34 </head>
35 <body onload="test()">
36 </body>