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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html » ('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/track/track-webvtt-slow-loading.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html
index 949f19b8b24cf3927ed0139f71f05ee89689abcb..e12cc1b55b8569c313847c154f340110909ac3c9 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html
@@ -1,34 +1,23 @@
-<!doctype html>
-<title>Slow loading WebVTT file interrupted just after a cue text linebreak</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 just after a cue text linebreak.</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=49&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=49&stallFor=1";
track.track.mode = "hidden";
-}
-</script>
-<p>Slow loading WebVTT file interrupted just after a cue text linebreak.</p>
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698