<!DOCTYPE html>
<html>
<title>Test that player state is correctly reflected when there is an error.</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../media-controls.js"></script>
<video controls width=400></video>
<script>
async_test(t => {
const video = document.querySelector('video');
checkControlsHasClasses(video, ['phase-pre-ready', 'state-no-source', 'use-default-poster']);
video.onerror = t.step_func_done(() => {
checkControlsHasClasses(video, ['phase-pre-ready', 'state-no-source', 'use-default-poster']);
});
video.src = "../content/missing.ogv";
// Catch the error promise.
video.play().catch(() => {});
});
</script>
</html>