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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-preload-none.html

Issue 1933203002: Import web-platform-tests@343606cdf8f6c7442d1a0309a9fcdd47d6244eca (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against web-platform tests to pick up my whitespace fix upstream 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
Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-preload-none.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-preload-none.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-preload-none.html
new file mode 100644
index 0000000000000000000000000000000000000000..1ce3c3931313c9c6db05f6a6c5129f4233ec7b15
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-preload-none.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<!-- Copyright © 2016 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
+<html>
+ <head>
+ <title>Test that the HTMLMediaElement preload 'none' attribute value is ignored for MediaStream used as srcObject and MediaStream object URLs used as src.</title>>
+ <link rel="author" title="Matthew Wolenetz" href="mailto:wolenetz@chromium.org"/>
+ <script src="../../../resources/testharness.js"></script>
+ <script src="../../../resources/testharnessreport.js"></script>
+ <script src="../../../resources/vendor-prefix.js" data-prefixed-objects='[{"ancestors":["navigator"], "name":"getUserMedia"}, {"ancestors":["window"], "name":"MediaStream"}]'></script>
+ </head>
+ <body>
+ <p class="instructions" style="display:none">When prompted, accept to share your audio and video streams.</p>
+ <h1 class="instructions" style="display:none">Description</h1>
+ <p class="instructions" style="display:none">This test checks that the HTMLMediaElement preload 'none' attribute value is ignored for MediaStream used as srcObject and MediaStream object URLs used as src.</p>
+
+ <audio preload="none"></audio>
+ <video preload="none"></video>
+
+ <script>
+ function testPreloadNone(t, mediaElement, setSourceStreamFunc)
+ {
+ // The optional deferred load steps (for preload none) for MediaStream resources should be skipped.
+ mediaElement.addEventListener("suspend", t.unreached_func("'suspend' should not be fired."));
+
+ mediaElement.addEventListener("loadeddata", t.step_func(function()
+ {
+ assert_equals(mediaElement.networkState, mediaElement.NETWORK_LOADING);
+ t.done();
+ }));
+
+ setSourceStreamFunc();
+ assert_equals(mediaElement.networkState, mediaElement.NETWORK_NO_SOURCE); // Resource selection is active.
+ }
+
+ async_test(function(t)
+ {
+ var aud = document.querySelector("audio");
+ navigator.getUserMedia({audio:true}, t.step_func(function(stream)
+ {
+ testPreloadNone(t, aud, t.step_func(function()
+ {
+ aud.src = URL.createObjectURL(stream);
+ t.add_cleanup(function() { URL.revokeObjectURL(aud.src); });
+ }));
+ }), t.unreached_func("getUserMedia error callback was invoked."));
+ }, "Test that preload 'none' is ignored for MediaStream object URL used as src");
+
+ async_test(function(t)
+ {
+ var vid = document.querySelector("video");
+ navigator.getUserMedia({video:true}, t.step_func(function(stream)
+ {
+ testPreloadNone(t, vid, t.step_func(function() { vid.srcObject = stream; }));
+ }), t.unreached_func("getUserMedia error callback was invoked."));
+ }, "Test that preload 'none' is ignored for MediaStream used as srcObject");
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698