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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-default-attribute.html

Issue 1925243002: Convert track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-default-attribute-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Tests that a track with the "default" attribute loads automatically.</tit le>
3 <head> 3 <video>
4 <script src=../media-file.js></script> 4 <track kind="captions" src="captions-webvtt/tc005-default-styles.vtt">
5 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 5 <track kind="captions" src="captions-webvtt/tc005-metadata-area.vtt">
6 (Please avoid writing new tests using video-test.js) --> 6 <track default kind="captions" src="captions-webvtt/tc004-webvtt-file.vtt" i d="default">
7 <script src=../video-test.js></script> 7 </video>
8 <script> 8 <script src="../../resources/testharness.js"></script>
9 9 <script src="../../resources/testharnessreport.js"></script>
10 var timer = null; 10 <script>
11 11 async_test(function(t) {
12 function trackLoaded() 12 var timer = null;
13 { 13 var tracks = document.querySelectorAll("track");
14 consoleWrite("EVENT(load)"); 14 for (var track of tracks) {
15 testExpected("event.target.readyState", HTMLTrackElement.LOADED) ; 15 track.onload = t.step_func(function() {
16 testExpected("event.target.id", "default"); 16 assert_equals(event.target.readyState, HTMLTrackElement.LOADED);
17 testExpected("event.target.default", true); 17 assert_equals(event.target.id, "default");
18 consoleWrite(""); 18 assert_true(event.target.default);
19 19 // End the test after a brief pause so we allow other tracks to load if they will.
20 // End the test after a brief pause so we allow other tracks to load if they will. 20 if (timer)
21 if (timer) 21 clearTimeout(timer);
22 clearTimeout(timer); 22 timer = setTimeout(function() { t.done(); }, 200);
23 timer = setTimeout(function() { endTest() }, 200); 23 });
24 } 24 }
25 25 });
26 </script> 26 </script>
27 </head>
28 <body>
29 <p>Tests that a track with the 'default' attribute loads automatically.< /p>
30 <video>
31 <track kind="captions" src="captions-webvtt/tc005-default-styles.vtt " onload="trackLoaded()">
32 <track kind="captions" src="captions-webvtt/tc005-metadata-area.vtt" onload="trackLoaded()">
33 <track default kind="captions" src="captions-webvtt/tc004-webvtt-fil e.vtt" onload="trackLoaded()" id="default" >
34 </video>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-default-attribute-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698