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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html

Issue 1881733004: MSE, MS, and any blob URL: Ignore preload 'none' on resource fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated .cpp, added invalidBlobURL tests, MediaStream test PR needs prep at web-platform-tests upst… Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html
new file mode 100644
index 0000000000000000000000000000000000000000..aac25baf038eae44ba8507028b67fb72d5fe618d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="/w3c/resources/testharness.js"></script>
+ <script src="/w3c/resources/testharnessreport.js"></script>
+ <script src="mediasource-util.js"></script>
+ <link rel="stylesheet" href="/w3c/resources/testharness.css">
+ </head>
+ <body>
+ <script>
+ function attachWithPreloadTest(preload)
+ {
+ async_test(function(test)
+ {
+ var videoTag = document.createElement('video');
philipj_slow 2016/04/22 09:22:15 I was thinking just "video", I take "tag" to mean
wolenetz 2016/04/25 19:43:21 Done.
+ var mediaSource = new MediaSource();
+ var mediaSourceURL = URL.createObjectURL(mediaSource);
+
+ videoTag.preload = preload;
+ document.body.appendChild(videoTag);
+ test.add_cleanup(function() {
+ document.body.removeChild(videoTag);
+ URL.revokeObjectURL(mediaSourceURL);
+ });
+
+ var listener = test.step_func(function(event)
+ {
+ mediaSource.removeEventListener("sourceopen", listener);
philipj_slow 2016/04/22 09:22:15 Do you need to remove the event listener, can the
wolenetz 2016/04/25 19:43:21 Done.
+ test.done();
+ });
+
+ mediaSource.addEventListener("sourceopen", listener);
+ videoTag.src = mediaSourceURL;
+ }, "sourceopen occurs with element preload=" + preload);
+ }
+
+ attachWithPreloadTest('auto');
+ attachWithPreloadTest('metadata');
+ attachWithPreloadTest('none');
+
+ function errorWithPreloadTest(preload)
+ {
+ async_test(function(test)
+ {
+ var videoTag = document.createElement('video');
+ var mediaSource = new MediaSource();
+ var mediaSourceURL = URL.createObjectURL(mediaSource);
+ URL.revokeObjectURL(mediaSourceURL);
+
+ videoTag.preload = preload;
+ document.body.appendChild(videoTag);
+ test.add_cleanup(function() { document.body.removeChild(videoTag); });
+
+ var listener = test.step_func(function(event)
+ {
+ mediaSource.removeEventListener("sourceopen", listener);
+ test.fail();
+ });
+
+ mediaSource.addEventListener("sourceopen", listener);
+
+ videoTag.onerror = test.step_func(function(event) { test.done(); });
+ videoTag.src = mediaSourceURL;
+ }, "error occurs with bogus (revoked) object URL and element preload=" + preload);
philipj_slow 2016/04/22 09:22:15 This is good, I didn't think to test revoked URLs.
wolenetz 2016/04/25 19:43:21 Done. (blob:a and real unrevoked MediaSource objec
+ }
+
+ errorWithPreloadTest('auto');
+ errorWithPreloadTest('metadata');
+ errorWithPreloadTest('none');
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698