blob: f64dc535dcaef9fb5c3b3e54ed7d4a8cb44003bd [file] [log] [blame]
<!DOCTYPE html>
<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>
async_test(function(t) {
var video = document.createElement("video");
// Register an event handler on video element's TextTrackList.
var tracks = video.textTracks;
tracks.onaddtrack = handler;
// Clear "video" to bring about its release.
video = null;
// Force garbage collection.
setTimeout(t.step_func_done(function() {
// Inspect and invoke the handler.
assert_equals(tracks.onaddtrack, handler);
}), 0);
function handler() {
// PASS (no crash).