Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / media / video-load-metadata-decode-error.cgi
blob82df86f5d53a01319624ba27055162a009485b5f
1 #!/usr/bin/perl -wT
3 use strict;
5 use CGI;
6 use File::stat;
8 my $query = new CGI;
10 my $name = $query->param('name');
11 my $filesize = stat($name)->size;
13 # Get MIME type.
14 my $type = $query->param('type');
15 if (!$type) {
16 print "Status: 400 Bad Request\r\n";
17 return;
20 my $rangeEnd = $filesize - 1;
22 # Print HTTP Header, disabling cache.
23 print "Cache-Control: no-cache\n";
24 print "Content-Length: " . $filesize . "\n";
25 print "Content-Type: " . $type . "\n";
27 print "\n";
29 open FILE, $name or die;
30 binmode FILE;
31 my ($data, $n);
32 my $total = 0;
33 my $break = $filesize / 4;
34 my $string = "corrupt video";
35 seek(FILE, 0, 0);
37 while (($n = read FILE, $data, 1024) != 0) {
38 print $data;
40 $total += $n;
41 if ($total >= $filesize) {
42 last;
45 if ($total >= $break) {
46 print $string;
47 $total += length($string);
51 close(FILE);