Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/controls-timeline.html |
| diff --git a/third_party/WebKit/LayoutTests/media/controls-timeline.html b/third_party/WebKit/LayoutTests/media/controls-timeline.html |
| index f214c5d740ec1c2fbafaa0ed13356e2cdee49b28..478d0d1a88994c9f9ad0fd5cda59f2a9448ff5a9 100644 |
| --- a/third_party/WebKit/LayoutTests/media/controls-timeline.html |
| +++ b/third_party/WebKit/LayoutTests/media/controls-timeline.html |
| @@ -1,35 +1,29 @@ |
| -<!doctype html> |
| -<html> |
| - <head> |
| - <title>media controls timeline</title> |
| - <script src="media-file.js"></script> |
| - <script src="media-controls.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> |
| - </head> |
| - <body> |
| - <video controls></video> |
| - <script> |
| - findMediaElement(); |
| - video.src = findMediaFile("video", "content/test"); |
| - waitForEvent("loadedmetadata", function() |
| - { |
| - testExpected("video.currentTime", 0); |
| - testExpected("video.seeking", false); |
| +<!DOCTYPE html> |
| +<title>Test seeking on the media controls timeline</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="media-file.js"></script> |
| +<script src="media-controls.js"></script> |
| +<video controls></video> |
| +<script> |
| +async_test(function(t) { |
| + var video = document.querySelector("video"); |
| + video.src = findMediaFile("video", "content/test"); |
| - // click the middle of the timeline |
| - var coords = mediaControlsButtonCoordinates(video, "timeline"); |
| - eventSender.mouseMoveTo(coords[0], coords[1]); |
| - eventSender.mouseDown(); |
| - eventSender.mouseUp(); |
| + video.onloadedmetadata = t.step_func_done(function() { |
| + assert_equals(video.currentTime, 0); |
| + assert_equals(video.seeking, false); |
| - testExpected("video.currentTime / video.duration", 0.4, '>'); |
| - testExpected("video.currentTime / video.duration", 0.6, '<'); |
| - testExpected("video.seeking", true); |
| + // click the middle of the timeline |
| + var coords = mediaControlsButtonCoordinates(video, "timeline"); |
| + eventSender.mouseMoveTo(coords[0], coords[1]); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| - endTest(); |
| - }); |
| - </script> |
| - </body> |
| -</html> |
| + var time = video.currentTime / video.duration; |
|
fs
2016/05/29 14:52:43
Nit: Maybe 'normalizedTime'?
Srirama
2016/05/30 07:55:14
Done.
|
| + assert_greater_than(time, 0.4); |
| + assert_less_than(time, 0.6); |
| + assert_equals(video.seeking, true); |
| + }); |
| +}); |
| +</script> |