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

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: 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') | Source/core/html/HTMLMediaElement.cpp » ('J')
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..f18b10ceca9846065ce0136abac6016db93bb1c9
--- /dev/null
+++ b/LayoutTests/media/autoplay.html
@@ -0,0 +1,31 @@
+<!doctype 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) {
acolwell GONE FROM CHROMIUM 2014/02/18 18:30:37 nit: 4-space indent here and everywhere else in th
philipj_slow 2014/02/19 03:10:05 I thought it was best to minimize the changes to t
+ 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) {
acolwell GONE FROM CHROMIUM 2014/02/18 18:30:37 nit: { on next line here and below to match Blink
+ 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') | Source/core/html/HTMLMediaElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698