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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html

Issue 2179433002: Convert track-webvtt* 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/track/track-webvtt-slow-loading-2.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html
index d2802d8b9afbfb40240a1c81cac52fee0f1d12ee..28045df0751845c514dce2b39dec83585415f9ac 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html
@@ -1,34 +1,23 @@
-<!doctype html>
-<title>Slow loading WebVTT file interrupted in the middle of a timestamp line</title>
-<!-- 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>
+<!DOCTYPE html>
+<title>Slow loading WebVTT file interrupted in the middle of a timestamp line.</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script>
-function loadAndStall()
-{
- return "http://127.0.0.1:8000/resources/load-and-stall.php";
-}
+async_test(function(t) {
+ var video = document.createElement("video");
+ var track = document.createElement("track");
+ video.appendChild(track);
-function vttTrack()
-{
- return "?name=../../../media/track/captions-webvtt/captions-multiline-lf.vtt&mimeType=text%2Fvtt";
-}
+ track.onload = t.step_func_done(function() {
+ assert_equals(track.track.cues.length, 2);
+ assert_equals(track.track.cues[0].text, "Lorem\u000aipsum");
+ });
-window.onload = function()
-{
- video = document.createElement('video');
- track = document.createElement('track');
- video.appendChild(track);
- track.onload = function() {
- testExpected("track.track.cues.length", 2, "===");
- testExpected("track.track.cues[0].text", 'Lorem\u000aipsum', "===");
- endTest();
- };
- track.onerror = function() {
- failTest();
- };
- track.src = loadAndStall() + vttTrack() + "&stallAt=32&stallFor=1";
+ track.onerror = t.unreached_func();
+
+ var loadAndStallUrl = "http://127.0.0.1:8000/resources/load-and-stall.php";
+ var vttTrackUrl = "?name=../../../media/track/captions-webvtt/captions-multiline-lf.vtt&mimeType=text%2Fvtt";
+ track.src = loadAndStallUrl + vttTrackUrl + "&stallAt=32&stallFor=1";
track.track.mode = "hidden";
-}
-</script>
-<p>Slow loading WebVTT file interrupted in the middle of a timestamp line.</p>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698