blob: 756b09f5660a761549966e2c941655901a9282bf [file] [log] [blame]
<!DOCTYPE html>
<title>Test that removing a media element from the tree pauses playback but does not unload the media.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="media-file.js"></script>
<video autoplay></video>
<script>
async_test(function(t) {
var video = document.querySelector("video");
video.src = findMediaFile("video", "content/test");
video.oncanplaythrough = t.step_func_done(function() {
assert_not_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
assert_false(video.paused);
document.body.removeChild(video);
assert_not_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
assert_true(video.paused);
});
});
</script>