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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!DOCTYPE html>
2 <title>Slow loading WebVTT file interrupted in the middle of a timestamp line</t itle> 2 <title>Slow loading WebVTT file interrupted in the middle of a timestamp line.</ title>
3 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 3 <script src="../../resources/testharness.js"></script>
4 (Please avoid writing new tests using video-test.js) --> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script src=/media-resources/video-test.js></script>
6 <script> 5 <script>
7 function loadAndStall() 6 async_test(function(t) {
8 { 7 var video = document.createElement("video");
9 return "http://127.0.0.1:8000/resources/load-and-stall.php"; 8 var track = document.createElement("track");
10 } 9 video.appendChild(track);
11 10
12 function vttTrack() 11 track.onload = t.step_func_done(function() {
13 { 12 assert_equals(track.track.cues.length, 2);
14 return "?name=../../../media/track/captions-webvtt/captions-multiline-lf.vtt &mimeType=text%2Fvtt"; 13 assert_equals(track.track.cues[0].text, "Lorem\u000aipsum");
15 } 14 });
16 15
17 window.onload = function() 16 track.onerror = t.unreached_func();
18 { 17
19 video = document.createElement('video'); 18 var loadAndStallUrl = "http://127.0.0.1:8000/resources/load-and-stall.php";
20 track = document.createElement('track'); 19 var vttTrackUrl = "?name=../../../media/track/captions-webvtt/captions-multi line-lf.vtt&mimeType=text%2Fvtt";
21 video.appendChild(track); 20 track.src = loadAndStallUrl + vttTrackUrl + "&stallAt=32&stallFor=1";
22 track.onload = function() {
23 testExpected("track.track.cues.length", 2, "===");
24 testExpected("track.track.cues[0].text", 'Lorem\u000aipsum', "===");
25 endTest();
26 };
27 track.onerror = function() {
28 failTest();
29 };
30 track.src = loadAndStall() + vttTrack() + "&stallAt=32&stallFor=1";
31 track.track.mode = "hidden"; 21 track.track.mode = "hidden";
32 } 22 });
33 </script> 23 </script>
34 <p>Slow loading WebVTT file interrupted in the middle of a timestamp line.</p>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698