Index: third_party/WebKit/LayoutTests/media/track/tracklist-is-reachable-no-crash.html |
diff --git a/third_party/WebKit/LayoutTests/media/track/tracklist-is-reachable-no-crash.html b/third_party/WebKit/LayoutTests/media/track/tracklist-is-reachable-no-crash.html |
index 0b3127b472efb91925a25f7533449c02f043a736..f64dc535dcaef9fb5c3b3e54ed7d4a8cb44003bd 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/tracklist-is-reachable-no-crash.html |
+++ b/third_party/WebKit/LayoutTests/media/track/tracklist-is-reachable-no-crash.html |
@@ -1,42 +1,30 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
+<title>Test that a detached TextTrackList can still be used without crashing.</title> |
+<script src="../../resources/gc.js"></script> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+async_test(function(t) { |
+ var video = document.createElement("video"); |
- <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> |
- var tracks; |
+ // Register an event handler on video element's TextTrackList. |
+ var tracks = video.textTracks; |
+ tracks.onaddtrack = handler; |
- function handler() |
- { |
- consoleWrite("PASS (no crash)"); |
- } |
+ // Clear "video" to bring about its release. |
+ video = null; |
- function start() |
- { |
- var video = document.createElement("video"); |
+ // Force garbage collection. |
+ gc(); |
- consoleWrite("** Register an event handler on video element's TextTrackList."); |
- tracks = video.textTracks; |
- tracks.onaddtrack = handler; |
+ setTimeout(t.step_func_done(function() { |
+ // Inspect and invoke the handler. |
+ assert_equals(tracks.onaddtrack, handler); |
+ tracks.onaddtrack(); |
+ }), 0); |
- // Clear 'video' to bring about its release (non-Oilpan.) |
- video = null; |
- consoleWrite("<br>** Force garbage collection."); |
- gc(); |
- consoleWrite("** Inspect and invoke the handler."); |
- testExpected("tracks.onaddtrack", handler); |
- tracks.onaddtrack(); |
- consoleWrite(""); |
- endTest(); |
- } |
- |
- </script> |
- </head> |
- <body onload="start()"> |
- <p>Test that a detached TextTrackList can still be used without crashing.</p> |
- </body> |
-</html> |
+ function handler() { |
+ // PASS (no crash). |
+ } |
+}); |
+</script> |