Index: third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html |
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html b/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html |
index bf555773564c82a6043e3d8ea8b5588765683df1..5c643b043c2cc38dcd3dee686a4ba1f6b99cfe43 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html |
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html |
@@ -1,42 +1,17 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
- |
- <script src=../media-file.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 startTest() |
- { |
- findMediaElement(); |
- |
- consoleWrite("** Add a text track through JS to the video element **"); |
- var t = video.addTextTrack('captions', 'English', 'en'); |
- |
- consoleWrite("** Add cue to the text track **"); |
- t.addCue(new VTTCue(0.0, 10.0, 'wow wow')); |
- |
- consoleWrite("** Set the track mode to showing **"); |
- t.mode = "showing"; |
- |
- consoleWrite(""); |
- consoleWrite("No crash. PASS."); |
- consoleWrite(""); |
- |
- endTest(); |
- } |
- </script> |
- </head> |
- |
- <body onload="startTest()"> |
- <p>Tests that adding a track and changing its mode through JS doesn't crash the browser.</p> |
- <video controls> |
- <!-- If the src is specified through JS after the body load, the test doesn't crash anymore. --> |
- <source src="../content/test.mp4" type="video/mp4"> |
- <source src="../content/test.ogv" type="video/ogg"> |
- </video> |
- </body> |
-</html> |
+<title>Tests that adding a track and changing its mode through JS doesn't crash the browser.</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<video> |
+ <!-- If the src is specified through JS after the body load, the test doesn't crash anymore. --> |
+ <source src="../content/test.mp4" type="video/mp4"> |
+ <source src="../content/test.ogv" type="video/ogg"> |
+</video> |
+<script> |
+test(function() { |
+ var video = document.querySelector('video'); |
+ var track = video.addTextTrack('captions', 'English', 'en'); |
+ track.addCue(new VTTCue(0.0, 10.0, 'wow wow')); |
+ track.mode = 'showing'; |
+}); |
+</script> |