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

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

Issue 1927223002: Convert track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Tests that the TextTrack "id" attribute is set appropriately.</title>
3 <head> 3 <video>
4 <track id="LoremIpsum" src="captions-webvtt/captions-fast.vtt" default>
5 </video>
6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 <script>
9 test(function() {
10 var video = document.querySelector("video");
4 11
5 <script src=../media-file.js></script> 12 var track = document.querySelector("track");
6 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 13
7 (Please avoid writing new tests using video-test.js) --> 14 var textTrack = track.track;
8 <script src=../video-test.js></script>
9 <script>
10 15
11 var textTrack; 16 // Test default attribute value.
17 assert_equals(textTrack.id, "LoremIpsum");
18 assert_equals(video.textTracks[0].id, "LoremIpsum");
12 19
13 function start() 20 // Make sure we can look up tracks by id.
14 { 21 assert_equals(video.textTracks.getTrackById("LoremIpsum"), textTrack);
15 findMediaElement();
16 consoleWrite("");
17 22
18 textTrack = document.getElementById("LoremIpsum").track; 23 // Test that it's readonly.
19 24 textTrack.id = "newvalue";
mlamouri (slow - plz ping) 2016/04/29 12:42:11 I'm surprised this doesn't actually throws an exce
Srirama 2016/04/29 13:21:24 Yes, i didn't debug further but just noted it down
20 consoleWrite("<b>++ Test default attribute value</b>"); 25 assert_equals(textTrack.id, "LoremIpsum");
21 testExpected("textTrack.id", "LoremIpsum"); 26 });
22 testExpected("video.textTracks[0].id", "LoremIpsum"); 27 </script>
23 consoleWrite("");
24
25 consoleWrite("<b>++ Make sure we can look tracks up by id</b>");
26 testExpected("video.textTracks.getTrackById('LoremIpsum')", text Track);
27 consoleWrite("");
28
29 consoleWrite("<b>++ Test that it's readonly</b>");
30 run("textTrack.id = 'newvalue';");
31 testExpected("textTrack.id", "LoremIpsum");
32
33 endTest();
34 }
35
36 </script>
37 </head>
38 <body >
39 <p>Tests that the TextTrack "id" attribute is appropriately set.</p>
40 <video>
41 <track id="LoremIpsum" src="captions-webvtt/captions-fast.vtt" onloa d="start()" default>
42 </video>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698