Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html |
| diff --git a/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html b/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html |
| index fa1e0f8ed60e5227036c4d7896ce5e6264346bbd..aff85edaa86519bc201a326851c7c11acf2b9168 100644 |
| --- a/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html |
| +++ b/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html |
| @@ -1,30 +1,19 @@ |
| -<!-- 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> |
| -<video poster="content/abe.png"> |
| - <source src="content/bogus" type="bogus"> |
| -</video> |
| +<!DOCTYPE html> |
| +<title>Test that media dimensions are equal to poster dimensions when "src" is invalid.</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<video poster="content/abe.png"></video> |
| <script> |
| - findMediaElement(); |
| +async_test(function(t) { |
| + var video = document.querySelector("video"); |
| - function listenForWidthAndHeight(expectedWidth, expectedHeight, callback) { |
| - if (video.clientWidth == expectedWidth && video.clientHeight == expectedHeight) { |
| - callback(); |
| - } else { |
| - // This uses a 20ms sleep loop to accomplish the wait, since the |
| - // standard specifies no events that fire on poster load or error. |
| - window.setTimeout(listenForWidthAndHeight, 20, expectedWidth, expectedHeight, callback); |
| - } |
| - } |
| - |
| - function expected() { |
| - testExpected("video.clientWidth", 76); |
| - testExpected("video.clientHeight", 103); |
| - endTest(); |
| - } |
| - |
| - run("video.load()"); |
| - waitForEvent("loadstart", function () { |
| - listenForWidthAndHeight(76, 103, expected); |
| + video.onloadstart = t.step_func(function () { |
| + setTimeout(t.step_func_done(function() { |
|
fs
2016/06/25 16:38:39
Can we guarantee that the poster image has finishe
Srirama
2016/06/28 17:02:51
Done.
|
| + assert_equals(video.clientWidth, 76); |
| + assert_equals(video.clientHeight, 103); |
| + }), 0); |
| }); |
| -</script> |
| + |
| + video.src = "content/bogus"; |
| +}); |
| +</script> |