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

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

Issue 2088143003: Convert video-muted* and video-no* tests to testharness.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits 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
Index: third_party/WebKit/LayoutTests/media/video-no-autoplay.html
diff --git a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
index cc91fcc0d2bd2ca1cb4669f1b5da2fccb08d4fe0..d10b5cc0b97a314452dd64f743f4c5501c12ede9 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
@@ -1,23 +1,22 @@
-<video controls></video>
-<p>Test that play event does not fire when "src" set with no autoplay attribute.</p>
-<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>Test that play event does not fire when "src" set with no autoplay attribute.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
<script>
- testExpected("video.paused", true);
+async_test(function(t) {
+ var video = document.querySelector("video");
+ assert_true(video.paused);
- waitForEvent('play', function () {
- logResult(false, "PLAY fired");
- endTest();
- } );
+ video.onplay = t.unreached_func();
- function testPaused ()
- {
- testExpected("video.paused", true);
- endTest();
- }
- waitForEvent('canplaythrough', function () { setTimeout(testPaused, 500);} );
+ video.oncanplaythrough = t.step_func(function() {
+ setTimeout(t.step_func_done(function() {
+ assert_true(video.paused);
+ }), 500);
+ });
video.src = findMediaFile("video", "content/test");
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698