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

Unified Diff: third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html

Issue 2103783002: Convert video-seeking*, video-set* and video-single* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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-set-rate-from-pause.html
diff --git a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
index b076cbe64c02976b91dde8c532061aea35801d68..c3f2a93e8884795ef04f2b558ec4f4bd79b3642b 100644
--- a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
+++ b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
@@ -1,31 +1,20 @@
<!DOCTYPE html>
-<html>
- <head>
- <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>
- <script>
- function init() {
- findMediaElement();
- waitForEvent('canplaythrough', receivedCanPlayThrough);
- video.src = findMediaFile("video", "content/test");
- }
+<title>Test that setting a non-zero rate causes an async timeupdate event.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
- function receivedCanPlayThrough() {
- waitForEvent('play', receivedPlay);
- video.playbackRate = 0;
- video.play();
- }
+ video.onplay = t.step_func(function() {
+ video.ontimeupdate = t.step_func_done();
+ video.playbackRate = 1;
+ });
- function receivedPlay() {
- waitForEventAndEnd('timeupdate');
- video.playbackRate = 1;
- }
- </script>
- </head>
- <body onload="init()">
- <video controls></video>
- <p>Test that setting a non-zero rate causes an async timeupdate event.</p>
- </body>
-</html>
+ video.src = findMediaFile("video", "content/test");
+ video.playbackRate = 0;
+ video.play();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698