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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/media/video-load-metadata-decode-error.cgi
diff --git a/LayoutTests/http/tests/media/video-load-metadata-decode-error.cgi b/LayoutTests/http/tests/media/video-load-metadata-decode-error.cgi
new file mode 100755
index 0000000000000000000000000000000000000000..82df86f5d53a01319624ba27055162a009485b5f
--- /dev/null
+++ b/LayoutTests/http/tests/media/video-load-metadata-decode-error.cgi
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -wT
+
+use strict;
+
+use CGI;
+use File::stat;
+
+my $query = new CGI;
+
+my $name = $query->param('name');
+my $filesize = stat($name)->size;
+
+# Get MIME type.
+my $type = $query->param('type');
+if (!$type) {
+ print "Status: 400 Bad Request\r\n";
+ return;
+}
+
+my $rangeEnd = $filesize - 1;
+
+# Print HTTP Header, disabling cache.
+print "Cache-Control: no-cache\n";
+print "Content-Length: " . $filesize . "\n";
+print "Content-Type: " . $type . "\n";
+
+print "\n";
+
+open FILE, $name or die;
+binmode FILE;
+my ($data, $n);
+my $total = 0;
+my $break = $filesize / 4;
+my $string = "corrupt video";
+seek(FILE, 0, 0);
+
+while (($n = read FILE, $data, 1024) != 0) {
+ print $data;
+
+ $total += $n;
+ if ($total >= $filesize) {
+ last;
+ }
+
+ if ($total >= $break) {
+ print $string;
+ $total += length($string);
+ }
+
+}
+close(FILE);

Powered by Google App Engine
This is Rietveld 408576698