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

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: Fix more '->" in the new test. [2] is now pending review at wpt. 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..7199ccca21333b470d8ae0de24898e3d9693d7d1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-preload.html
@@ -0,0 +1,83 @@
+<!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 video = document.createElement("video");
+ var mediaSource = new MediaSource();
+ var mediaSourceURL = URL.createObjectURL(mediaSource);
+
+ video.preload = preload;
+ document.body.appendChild(video);
+ test.add_cleanup(function() {
+ document.body.removeChild(video);
+ URL.revokeObjectURL(mediaSourceURL);
+ });
+
+ var listener = test.step_func(function(event) { test.done(); });
+ mediaSource.addEventListener("sourceopen", listener);
+ video.src = mediaSourceURL;
+ }, "sourceopen occurs with element preload=" + preload);
+ }
+
+ attachWithPreloadTest("auto");
+ attachWithPreloadTest("metadata");
+ attachWithPreloadTest("none");
+
+ function errorWithPreloadTest(preload, bogusURLStyle)
+ {
+ var testURLdescription;
+ var mediaSource = new MediaSource();
+ var bogusURL;
+
+ if (bogusURLStyle == "revoked") {
+ testURLdescription = "revoked MediaSource object URL";
+ bogusURL = URL.createObjectURL(mediaSource);
+ URL.revokeObjectURL(bogusURL);
+ } else if (bogusURLStyle == "corrupted") {
+ testURLdescription = "corrupted MediaSource object URL";
+ bogusURL = URL.createObjectURL(mediaSource);
+ bogusURL += "0";
+ } else {
+ testURLdescription = bogusURL = bogusURLStyle;
+ }
+
+ async_test(function(test)
+ {
+ var video = document.createElement("video");
+
+ video.preload = preload;
+ document.body.appendChild(video);
+ test.add_cleanup(function() { document.body.removeChild(video); });
+
+ var listener = test.step_func(function(event) { test.fail(); });
+ mediaSource.addEventListener("sourceopen", listener);
+
+ video.onerror = test.step_func(function(event) { test.done(); });
+ video.src = bogusURL;
+ }, "error occurs with bogus blob URL (" + testURLdescription + ") and element preload=" + preload);
+ }
+
+ errorWithPreloadTest("auto", "revoked");
+ errorWithPreloadTest("metadata", "revoked");
+ errorWithPreloadTest("none", "revoked");
+
+ errorWithPreloadTest("auto", "blob:a");
+ errorWithPreloadTest("metadata", "blob:a");
+ errorWithPreloadTest("none", "blob:a");
+
+ errorWithPreloadTest("auto", "corrupted");
+ errorWithPreloadTest("metadata", "corrupted");
+ errorWithPreloadTest("none", "corrupted");
+ </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