Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: LayoutTests/http/tests/media/video-load-metadata-decode-error.cgi

Issue 330593005: HTMLMediaElement::webMediaPlayer() should never be null if m_readyState >= HAVE_METADATA (media eng… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updated as per review comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/perl -wT
2
3 use strict;
4
5 use CGI;
6 use File::stat;
7
8 my $query = new CGI;
9
10 my $name = $query->param('name');
11 my $filesize = stat($name)->size;
12
13 # Get MIME type.
14 my $type = $query->param('type');
15 if (!$type) {
16 print "Status: 400 Bad Request\r\n";
17 return;
18 }
19
20 my $rangeEnd = $filesize - 1;
21
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";
26
27 print "\n";
28
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);
36
37 while (($n = read FILE, $data, 1024) != 0) {
38 print $data;
39
40 $total += $n;
41 if ($total >= $filesize) {
42 last;
43 }
44
45 if ($total >= $break) {
46 print $string;
47 $total += length($string);
48 }
49
50 }
51 close(FILE);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698