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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/tracklist-is-reachable-no-crash.html

Issue 1952323003: Convert tracklist-* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: deleted tracklist-is-reachable.html as it is not useful 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>Test that a detached TextTrackList can still be used without crashing.</t itle>
3 <head> 3 <script src="../../resources/gc.js"></script>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script>
7 async_test(function(t) {
8 var video = document.createElement("video");
5 9
6 <script src=../media-file.js></script> 10 // Register an event handler on video element's TextTrackList.
7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 11 var tracks = video.textTracks;
8 (Please avoid writing new tests using video-test.js) --> 12 tracks.onaddtrack = handler;
9 <script src=../video-test.js></script>
10 <script>
11 var tracks;
12 13
13 function handler() 14 // Clear "video" to bring about its release.
14 { 15 video = null;
15 consoleWrite("PASS (no crash)");
16 }
17 16
18 function start() 17 // Force garbage collection.
19 { 18 gc();
20 var video = document.createElement("video");
21 19
22 consoleWrite("** Register an event handler on video element's Te xtTrackList."); 20 setTimeout(t.step_func_done(function() {
23 tracks = video.textTracks; 21 // Inspect and invoke the handler.
24 tracks.onaddtrack = handler; 22 assert_equals(tracks.onaddtrack, handler);
23 tracks.onaddtrack();
24 }), 0);
25 25
26 // Clear 'video' to bring about its release (non-Oilpan.) 26 function handler() {
27 video = null; 27 // PASS (no crash).
28 consoleWrite("<br>** Force garbage collection."); 28 }
29 gc(); 29 });
30 consoleWrite("** Inspect and invoke the handler."); 30 </script>
31 testExpected("tracks.onaddtrack", handler);
32 tracks.onaddtrack();
33 consoleWrite("");
34 endTest();
35 }
36
37 </script>
38 </head>
39 <body onload="start()">
40 <p>Test that a detached TextTrackList can still be used without crashing .</p>
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698