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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html

Issue 2177003002: Convert video-play* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/video-play-progress-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
index 1aef38acf6ad4e7bfa1386c7ca529e1556e684e9..68cedea1dab7b7e0df30a16bc0773cd7330f1ced 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
@@ -1,28 +1,18 @@
-<html>
- <head>
- <script src=../../media-resources/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=../../media-resources/video-test.js></script>
- <script>
- function start() {
- findMediaElement();
+<!DOCTYPE html>
+<title>Test that at least one progress event is fired after starting to load the video.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
+<video></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
- var progressCount = 0;
+ var watcher = new EventWatcher(t, video, ["loadstart", "progress"]);
+ watcher.wait_for(["loadstart", "progress"]).then(t.step_func_done());
- // Make sure we've at least reached NETWORK_LOADING before waiting for progress.
- waitForEvent('loadstart', function() {
- waitForEventAndEnd('progress')
- } );
-
- var mediaFile = findMediaFile("video", "resources/test");
- video.src = "http://127.0.0.1:8000/" + mediaFile;
- run("video.play()");
- }
- </script>
- </head>
- <body onload="start()">
- <video></video>
- <p>Test that at least one progress event is fired after starting to load the video.</p>
- </body>
-</html>
+ var mediaFile = findMediaFile("video", "resources/test");
+ video.src = "http://127.0.0.1:8000/" + mediaFile;
+ video.play();
+ });
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/video-play-progress-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698