Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / charset-sniffer-end-sniffing.html
blobed54dc1db63e0bfd60b659aea024c772571e6ca4
1 <html>
2 <script>
4 var time1 = 0;
5 var time2 = 0;
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
12 function log(message)
14 document.getElementById("log").innerText += message + "\n";
17 function firstScript()
19 log("Running first script.");
20 time1 = new Date().getTime();
23 function secondScript()
25 log("Running second script.");
26 time2 = new Date().getTime();
29 function test()
31 // Second script is sent after a 1 second delay. If time delta
32 // between both scripts running is really small, that means they
33 // ran back-to-back instead of the first script running before
34 // the second script was loaded.
35 if (time2 - time1 < 50)
36 log("FAIL: Gap between script runs unexpectedly small.");
37 else
38 log("PASS: First script ran before second script was loaded.");
40 if (window.testRunner)
41 testRunner.notifyDone();
43 </script>
44 <body onload="test()">
45 <pre id="log"></pre>
46 <iframe id="frame" src="resources/charset-sniffer-end-sniffing.php"></iframe>
47 <p>This test is for a bug where the charset sniffer would not stop looking
48 for charset if the body contains no tags. Charset sniffer is supposed to stop
49 looking for charset after 1024 bytes.</p>
50 </body>
51 </html>