| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src=../video-test.js></script> |
| |
| <script> |
| function logEvent(evt) |
| { |
| consoleWrite("EVENT(" + evt.type + ")"); |
| } |
| |
| function startTest() |
| { |
| track1 = document.getElementsByTagName('track')[0] |
| track1.track.mode = 'showing'; |
| track1.addEventListener('removetrack', logEvent); |
| |
| track2 = document.getElementsByTagName('track')[1] |
| track2.track.mode = 'showing'; |
| track2.addEventListener('removetrack', logEvent); |
| |
| video = document.getElementsByTagName('video')[0]; |
| |
| setTimeout("attemptCrash()", 0); |
| } |
| document.addEventListener("DOMContentLoaded", startTest, false); |
| |
| function ForceGC() |
| { |
| try { gc(); } catch(e) {} |
| |
| consoleWrite(""); |
| consoleWrite("No crash. PASS."); |
| consoleWrite(""); |
| |
| endTest(); |
| } |
| |
| function attemptCrash() |
| { |
| newDocument = document.implementation.createDocument("", null); |
| newDocument.appendChild(video); |
| delete newDocument; |
| |
| setTimeout(ForceGC, 0); |
| } |
| </script> |
| </head> |
| |
| <body> |
| <p>Tests that removing a track while its parent is being deleted does not crash.</p> |
| <video autoplay controls > |
| <source src="../content/test.ogv" type="video/ogg" > |
| <source src="../content/test.mp4" type="video/mp4" > |
| <track src="captions-webvtt/captions-fast.vtt"> |
| <track src="captions-webvtt/captions-fast.vtt"> |
| </video> |
| </label> |
| </body> |
| </html> |