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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html

Issue 1913423002: 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 comment 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 cue display tree has been removed properly and no crash ha ppens.</title>
3 <head> 3 <script src="../media-file.js"></script>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4 <script src="../media-controls.js"></script>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <video>
8 <track src="captions-webvtt/captions.vtt" kind="captions" mode="showing">
9 </video>
10 <script>
11 async_test(function(t) {
12 var video = document.querySelector("video");
13 video.src = findMediaFile("video", "../content/test");
5 14
6 <script src=../media-file.js></script> 15 video.play();
7 <script src=../media-controls.js></script> 16 video.oncanplaythrough = t.step_func_done(function() {
8 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 17 // Empty the contents of the video element when it is ready to play.
9 (Please avoid writing new tests using video-test.js) --> 18 video.textContent = "";
10 <script src=../video-test.js></script>
11 19
12 <script> 20 // Text track should not be rendered anymore.
13 function emptyVideoTextContent() 21 assert_throws(null, function() { textTrackDisplayElement(video, "display "); });
14 { 22 });
15 consoleWrite(""); 23 });
16 consoleWrite("** Empty the contents of the video element when it is ready to play **"); 24 </script>
17 video.textContent = "";
18
19 consoleWrite("");
20 consoleWrite("** Text track should not be rendered anymore **");
21 try {
22 var textTrackCueBox = textTrackDisplayElement(video, 'displa y');
23 } catch (e) {
24 consoleWrite(e);
25 }
26
27 consoleWrite("");
28 consoleWrite("No crash. PASS.");
29 consoleWrite("");
30
31 endTest();
32 }
33
34 function initElements()
35 {
36 consoleWrite("** Set the mode of the text track to showing **");
37 testTrack = document.querySelector('track');
38 testTrack.track.mode = "showing";
39
40 consoleWrite("");
41 consoleWrite("** Initialize the video element **");
42 findMediaElement();
43 video.src = findMediaFile('video', '../content/test');
44
45 video.play();
46 waitForEvent('canplaythrough', emptyVideoTextContent);
47 }
48
49 </script>
50 </head>
51 <body onload="initElements()">
52 <p>Tests that the cue display tree has been removed properly and no cras h happens.</p>
53 <video controls>
54 <track src="captions-webvtt/captions.vtt" kind="captions">
55 </video>
56 </body>
57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698