Chromium Code Reviews| 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> |