Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/autoplay-muted.html |
| diff --git a/third_party/WebKit/LayoutTests/media/autoplay.html b/third_party/WebKit/LayoutTests/media/autoplay-muted.html |
| similarity index 51% |
| copy from third_party/WebKit/LayoutTests/media/autoplay.html |
| copy to third_party/WebKit/LayoutTests/media/autoplay-muted.html |
| index ca59be325e0c3c18f55759b24e6354649e8b6360..bd957771ad6f3d102ddc9a5fd5a96d82f5f77307 100644 |
| --- a/third_party/WebKit/LayoutTests/media/autoplay.html |
| +++ b/third_party/WebKit/LayoutTests/media/autoplay-muted.html |
| @@ -1,17 +1,16 @@ |
| -<!doctype html> |
| -<!-- original: https://github.com/w3c/web-platform-tests/blob/6b3893bb99f70e4238011dbcd1f380891e89ec5e/html/semantics/embedded-content-0/media-elements/autoplay.html --> |
| -<title>autoplay</title> |
| -<script src="../resources/testharness.js"></script> |
| +<!DOCTYPE html> |
| +<title>Test for autoplay of muted video</title> |
| +<script src="../resource/testharness.js"></script> |
|
mlamouri (slow - plz ping)
2016/06/07 15:40:14
You have a typo here I think :(
whywhat
2016/06/07 17:40:15
Right, fixed :)
|
| <script src="../resources/testharnessreport.js"></script> |
| <script src="media-file.js"></script> |
| -<div id="log"></div> |
| <script> |
| -function autoplay_test(tagName, src) |
| -{ |
| - async_test(function(t) |
| + window.internals.settings.setMediaPlaybackRequiresUserGesture(true); |
| + |
| + async_test(function(t)) |
| { |
| - var e = document.createElement(tagName); |
| - e.src = src; |
| + var e = document.createElement('video'); |
| + e.src = findMediaFile('video', 'content/test'); |
| + e.muted = true; |
| e.autoplay = true; |
| var actual_events = []; |
| var expected_events = ['canplay', 'play', 'playing', 'canplaythrough']; |
| @@ -28,9 +27,14 @@ function autoplay_test(tagName, src) |
| } |
| })); |
| }); |
| - }, tagName + '.autoplay'); |
| -} |
| + }, "muted-autoplay"); |
| -autoplay_test('audio', findMediaFile('audio', 'content/test')); |
| -autoplay_test('video', findMediaFile('video', 'content/test')); |
| + async_test(function(t)) |
| + { |
| + if (window.internals && internals.runtimeFlags.videosAsImagesEnabled) { |
| + var e = document.createElement('video'); |
| + e.src = findMediaFile('video', 'content/test'); |
| + e.muted = true; |
| + e.play().then(function() { t.done(); }); |
| + }, "muted-playjs"); |
| </script> |