OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Tests that removing track nodes while their parent is being deleted doesn
't crash</title> |
3 <head> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src=../media-file.js></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <script src=../media-controls.js></script> | 5 <label id="label1"> |
6 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 6 <video autoplay> |
7 (Please avoid writing new tests using video-test.js) --> | 7 <!-- Can't use findMediaElement() as test doesn't crash, so source needs t
o be specified here --> |
8 <script src=../video-test.js></script> | 8 <source src="../content/test.ogv"> |
| 9 <source src="../content/test.mp4"> |
| 10 <track src="captions-webvtt/captions-fast.vtt"> |
| 11 <track src="captions-webvtt/captions-fast.vtt"> |
| 12 </video> |
| 13 </label> |
| 14 <script> |
| 15 async_test(function(t) { |
| 16 document.getElementsByTagName('track')[0].track.mode = 'showing'; |
| 17 document.getElementsByTagName('track')[1].track.mode = 'showing'; |
9 | 18 |
10 <script> | 19 setTimeout(t.step_func(CFcrash), 10); |
11 function startTest() | |
12 { | |
13 document.getElementsByTagName('track')[0].track.mode = 'showing'; | |
14 document.getElementsByTagName('track')[1].track.mode = 'showing'; | |
15 | 20 |
16 setTimeout("CFcrash()", 10); | 21 function CFcrash() { |
17 } | 22 document1 = document.implementation.createDocument('', null); |
| 23 document1.appendChild(label1); |
18 | 24 |
19 function CFcrash() | 25 delete document1; |
20 { | |
21 document1 = document.implementation.createDocument("", null); | |
22 document1.appendChild(label1); | |
23 | 26 |
24 delete document1; | 27 setTimeout(t.step_func_done(runGCAndEndTest), 0); |
| 28 } |
25 | 29 |
26 setTimeout(runGCAndEndTest, 0); | 30 function runGCAndEndTest() { |
27 } | 31 gc(); |
28 | 32 // No crash. PASS. |
29 function runGCAndEndTest() | 33 } |
30 { | 34 }); |
31 gc(); | 35 </script> |
32 | |
33 consoleWrite(""); | |
34 consoleWrite("No crash. PASS."); | |
35 consoleWrite(""); | |
36 | |
37 endTest(); | |
38 } | |
39 | |
40 document.addEventListener("DOMContentLoaded", startTest, false); | |
41 </script> | |
42 </head> | |
43 | |
44 <body> | |
45 <p>Tests that removing track nodes while their parent is being deleted d
oesn't crash</p> | |
46 <label id="label1"> | |
47 <video autoplay> | |
48 <!-- Can't use findMediaElement() as test doesn't crash, so source
needs to be specified here --> | |
49 <source src="../content/test.ogv"> | |
50 <source src="../content/test.mp4"> | |
51 <track src="captions-webvtt/captions-fast.vtt"> | |
52 <track src="captions-webvtt/captions-fast.vtt"> | |
53 </video> | |
54 </label> | |
55 </body> | |
56 </html> | |
OLD | NEW |