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

Unified Diff: third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.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: address nits 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-timeupdate-before-playback.html
diff --git a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
index 2d0fa8cefe65ffc9aa0309622a49e6a8acebe3b2..3f0b2c541100e2b9cbe1ee920b8da5b5baf6130d 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
@@ -1,25 +1,23 @@
<!DOCTYPE html>
-<html>
-<body>
- <p>Test that no timeupdate event fires during loading.</p>
- <video></video>
- <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>
- waitForEvent("loadstart");
- waitForEvent("loadedmetadata");
- waitForEvent("loadeddata");
- waitForEvent("canplay");
- waitForEvent("canplaythrough", function()
- {
- // Let pending async events fire before ending the test.
- window.setTimeout(function() { endTest(); }, 0);
- });
- waitForEventAndFail("timeupdate");
+<title>Test that no timeupdate event fires during loading.</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");
+ video.onloadstart = t.step_func(function() {});
+ video.onloadedmetadata = t.step_func(function() {});
+ video.onloadeddata = t.step_func(function() {});
+ video.oncanplay = t.step_func(function() {});
- video.src = findMediaFile("video", "content/test");
- </script>
-</body>
-</html>
+ video.oncanplaythrough = t.step_func(function() {
+ // Let pending async events fire before ending the test.
+ setTimeout(t.step_func_done(), 0);
+ });
+
+ video.ontimeupdate = t.unreached_func();
+ video.src = findMediaFile("video", "content/test");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698