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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.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
Index: third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
index 50d7fe8222202a727d7bbfed4c468dbdbcc5e36e..0cc49a928428ed671943ce23e351b655c38f56cf 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
@@ -1,21 +1,19 @@
+<!DOCTYPE html>
+<title>Test that stalling very early, while loading meta-data, stops delaying the load event.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
<video></video>
-<p>Test that stalling very early, while loading meta-data, stops delaying the load event.</p>
-<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>
+async_test(function(t) {
+ var video = document.querySelector("video");
- // Expected events.
- waitForEvent("loadstart");
- waitForEvent("stalled");
- waitForEvent("suspend");
-
- // We want to make sure the onload event fires.
- window.onload = function() {
- consoleWrite("EVENT(window.onload)");
- endTest();
- };
+ var expectedEvents = ["loadstart", "stalled"];
+ var watcher = new EventWatcher(t, video, expectedEvents);
+ watcher.wait_for(expectedEvents).then(t.step_func(function() {
+ // We want to make sure the onload event fires.
+ window.onload = t.step_func_done();
+ }));
// Find a supported media file.
var mediaFile = findMediaFile("video", "content/test");
@@ -23,5 +21,5 @@
// Load should stall very early in the loading process.
video.src = "http://127.0.0.1:8000/resources/load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=1&stallFor=4";
-
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698