summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/http/tests/incremental/doc-write-before-end.pl
blob: f0dcf86910e0c8eba9d130ee49cf4d11a5efca07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl -w

# Flush STDOUT after each print.
select (STDOUT);
$| = 1;

print "Content-Type: text/html; charset=utf-8\n";
print "Expires: Thu, 01 Dec 2003 16:00:00 GMT\n";
print "Cache-Control: no-store, no-cache, must-revalidate\n";
print "Pragma: no-cache\n";
print "\n";

print "\xef\xbb\xbf<!DOCTYPE html><body>";
print "<script>if (window.testRunner) window.testRunner.dumpAsText();</script>";
print "<img src='404.gif' onerror='document.write(\"PASS\");'>";
# Dump some spaces to bypass CFNetwork buffering.
for ($count = 1; $count < 4000; $count++) {
    print "   ";
}

# Delay to force the second line of text to be decoded as a separate chunk.
sleep 1;
print "FAIL</body>";