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

Unified Diff: third_party/WebKit/LayoutTests/media/video-autoplay.html

Issue 2060353005: Convert video-autoplay*, video-black* and video-buffered* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit Created 4 years, 6 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/LayoutTests/media/video-autoplay-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/video-autoplay.html
diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay.html b/third_party/WebKit/LayoutTests/media/video-autoplay.html
index a151039f4dddf71716f7795c9bb2b0cf9a8a4e3c..5d3d8fff05486a26f551dd79d9c25a6941dbda84 100644
--- a/third_party/WebKit/LayoutTests/media/video-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-autoplay.html
@@ -1,12 +1,19 @@
-<video autoplay controls></video>
-<script src=media-file.js></script>
-<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
-<script src=video-test.js></script>
-
+<!DOCTYPE html>
+<title>Verify that "autoplay" attribute on a media element starts playback automatically.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video autoplay></video>
<script>
- testExpected("video.autoplay", true);
- testExpected("video.getAttribute('autoplay')", null, '!=');
- waitForEvent('play', function () { testExpected("video.paused", false); endTest(); } );
+async_test(function(t) {
+ var video = document.querySelector("video");
+ assert_true(video.autoplay);
+ assert_not_equals(video.getAttribute("autoplay"), null);
+
+ video.onplay = t.step_func_done(function () {
+ assert_false(video.paused);
+ });
+
video.src = findMediaFile("video", "content/test");
-</script>
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-autoplay-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698