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

Unified Diff: LayoutTests/media/autoplay.html

Issue 169223003: Fire canplaythrough after play and playing when autoplaying (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: style Created 6 years, 10 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 | LayoutTests/media/autoplay-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/autoplay.html
diff --git a/LayoutTests/media/autoplay.html b/LayoutTests/media/autoplay.html
new file mode 100644
index 0000000000000000000000000000000000000000..ca59be325e0c3c18f55759b24e6354649e8b6360
--- /dev/null
+++ b/LayoutTests/media/autoplay.html
@@ -0,0 +1,36 @@
+<!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>
+<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)
+ {
+ var e = document.createElement(tagName);
+ e.src = src;
+ e.autoplay = true;
+ var actual_events = [];
+ var expected_events = ['canplay', 'play', 'playing', 'canplaythrough'];
+ expected_events.forEach(function(type)
+ {
+ e.addEventListener(type, t.step_func(function()
+ {
+ assert_equals(e.readyState, e.HAVE_ENOUGH_DATA);
+ assert_false(e.paused);
+ actual_events.push(type);
+ if (type == 'canplaythrough') {
+ assert_array_equals(actual_events, expected_events);
+ t.done();
+ }
+ }));
+ });
+ }, tagName + '.autoplay');
+}
+
+autoplay_test('audio', findMediaFile('audio', 'content/test'));
+autoplay_test('video', findMediaFile('video', 'content/test'));
+</script>
« no previous file with comments | « no previous file | LayoutTests/media/autoplay-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698