Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html |
| diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html |
| index 1fc1f758a2744c2e86f2ebaf9526962aeb01ff68..a84d5063d3f009d2168a261844b5df378ffdc203 100644 |
| --- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html |
| +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html |
| @@ -1,57 +1,29 @@ |
| <!DOCTYPE html> |
| -<html> |
| - <head> |
| - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| - |
| - <script src=../media-file.js></script> |
| - <script src=../media-controls.js></script> |
| - <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| - (Please avoid writing new tests using video-test.js) --> |
| - <script src=../video-test.js></script> |
| - |
| - <script> |
| - function emptyVideoTextContent() |
| - { |
| - consoleWrite(""); |
| - consoleWrite("** Empty the contents of the video element when it is ready to play **"); |
| - video.textContent = ""; |
| - |
| - consoleWrite(""); |
| - consoleWrite("** Text track should not be rendered anymore **"); |
| - try { |
| - var textTrackCueBox = textTrackDisplayElement(video, 'display'); |
| - } catch (e) { |
| - consoleWrite(e); |
| - } |
| - |
| - consoleWrite(""); |
| - consoleWrite("No crash. PASS."); |
| - consoleWrite(""); |
| - |
| - endTest(); |
| +<title>Tests that the cue display tree has been removed properly and no crash happens.</title> |
| +<script src="../media-file.js"></script> |
| +<script src="../media-controls.js"></script> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<video> |
| + <track src="captions-webvtt/captions.vtt" kind="captions" mode="showing"> |
| +</video> |
| +<script> |
| +async_test(function(t) { |
| + var video = document.querySelector("video"); |
| + video.src = findMediaFile("video", "../content/test"); |
| + |
| + video.play(); |
| + video.oncanplaythrough = t.step_func(function() { |
| + // Empty the contents of the video element when it is ready to play. |
| + video.textContent = ""; |
| + |
| + // Text track should not be rendered anymore. |
| + try { |
| + textTrackDisplayElement(video, "display"); |
| + } catch(e) { |
| + // Test passes if it throws an exception. |
| + 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.
|
| } |
| - |
| - function initElements() |
| - { |
| - consoleWrite("** Set the mode of the text track to showing **"); |
| - testTrack = document.querySelector('track'); |
| - testTrack.track.mode = "showing"; |
| - |
| - consoleWrite(""); |
| - consoleWrite("** Initialize the video element **"); |
| - findMediaElement(); |
| - video.src = findMediaFile('video', '../content/test'); |
| - |
| - video.play(); |
| - waitForEvent('canplaythrough', emptyVideoTextContent); |
| - } |
| - |
| - </script> |
| - </head> |
| - <body onload="initElements()"> |
| - <p>Tests that the cue display tree has been removed properly and no crash happens.</p> |
| - <video controls> |
| - <track src="captions-webvtt/captions.vtt" kind="captions"> |
| - </video> |
| - </body> |
| -</html> |
| + }); |
| +}); |
| +</script> |