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

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: fix 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..b82cb5b04f59a47c9e93c1b0b07dab545ff0dd8e 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
@@ -1,23 +1,23 @@
-<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(function() {
fs 2016/06/22 10:47:18 Nit: Use step_func_done?
Srirama 2016/06/22 11:15:58 Done.
+ assert_true(video.paused);
+ t.done();
+ }, 500);
+ });
video.src = findMediaFile("video", "content/test");
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698