blob: 3a2dcd02fddfe9da3bc1fb53b14ce5f0e1f9331e [file] [edit]
<!DOCTYPE html>
<html>
<head>
<title>video-is-playing-audio-after-load</title>
<script src=video-test.js></script>
<script src=media-file.js></script>
<script>
async function runTest() {
findMediaElement();
run('video.src = findMediaFile("video", "content/audio-tracks")');
await waitFor(video, 'canplay');
testExpected('video.audioTracks.length', '1', '>');
runWithKeyDown('video.play()');
await waitFor(video, 'playing');
testExpected('internals.pageMediaState().includes("IsPlayingAudio")', true);
run('video.src = ""');
run('video.load()');
await waitFor(video, 'emptied');
testExpected('internals.pageMediaState().includes("IsPlayingAudio")', false);
};
window.addEventListener('load', event => {
runTest().then(endTest).catch(failTest);
});
</script>
</head>
<body>
<video loop></video>
</body>
</html>