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

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 nit 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(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 try {
14 { 22 textTrackDisplayElement(video, "display");
15 consoleWrite(""); 23 } catch(e) {
16 consoleWrite("** Empty the contents of the video element when it is ready to play **"); 24 // Test passes if it throws an exception.
17 video.textContent = ""; 25 t.done();
mlamouri (slow - plz ping) 2016/04/26 15:21:35 Instead of doing that, could you check if there wa
Srirama 2016/04/27 05:39:22 Problem is it currently throws a message, **** th
philipj_slow 2016/04/27 09:02:29 Try assert_throws(null, function() { textTrackDisp
Srirama 2016/04/27 10:39:03 Thanks, works fine now.
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 } 26 }
33 27 });
34 function initElements() 28 });
35 { 29 </script>
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