Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / css / missing-repaint-after-slow-style-sheet.pl
1 #!/usr/bin/perl -wT
2
3 my $pre_chunked = ($ENV{"SERVER_SOFTWARE"} && index($ENV{"SERVER_SOFTWARE"}, "LightTPD") != -1);
4
5 sub print_maybe_chunked
6 {
7     my $string = shift;
8     if ($pre_chunked) {
9         print $string;
10         return;
11     }
12     printf "%lx\r\n", length($string);
13     print "$string\r\n";
14 }
15
16 print "Content-type: text/html\r\n";
17 if (!$pre_chunked) {
18     print "Transfer-encoding: chunked\r\n";
19 }
20
21 select (STDOUT);
22 $| = 1;
23
24 print "\r\n";
25 print_maybe_chunked "<!DOCTYPE html><style>h2 { background-color: green; }</style>";
26 print_maybe_chunked "<link rel='stylesheet' onload='start()'>";
27 print_maybe_chunked "<body><script>document.getElementsByTagName('link')[0].href='resources/slow-loading-sheet.php?color=green&sleep=500000'; document.body.offsetTop; requestAnimationFrame(function() { console.log('requestAnimationFrame ran'); });";
28 print_maybe_chunked "function start() { console.log('Stylesheet loaded'); } console.log('Inline script done');</script>";
29 print_maybe_chunked "<h1>Styled by external stylesheet</h1><div style='height: 200px'></div><h2>Noncomposited</h2><h2 style='transform:translateZ(0)'>Composited</h2>";
30 sleep(1);
31 print_maybe_chunked "";