blob: 60880ee8a2cbcd7658e50a7d0eb93431b3502416 [file] [log] [blame]
<!DOCTYPE html>
<title>Test removing keywords from controlsList shows buttons</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../media-resources/media-controls.js"></script>
<video controlslist="nodownload nofullscreen" id="disabled-controls" width="500px"></video>
<script>
async_test(t => {
var v = document.getElementById('disabled-controls');
v.addEventListener('canplaythrough', t.step_func(e => {
assert_equals(getComputedStyle(fullscreenButton(v)).display, 'none');
assert_equals(getComputedStyle(downloadButton(v)).display, 'none');
v.controlsList.remove('nodownload');
testRunner.layoutAndPaintAsyncThen(t.step_func(() => {
assert_equals(getComputedStyle(fullscreenButton(v)).display, 'none');
assert_not_equals(getComputedStyle(downloadButton(v)).display, 'none');
v.controlsList.remove('nofullscreen');
testRunner.layoutAndPaintAsyncThen(t.step_func_done(() => {
assert_not_equals(getComputedStyle(fullscreenButton(v)).display, 'none');
assert_not_equals(getComputedStyle(downloadButton(v)).display, 'none');
}));
}));
}));
v.src = '../resources/test.ogv';
}, 'Test enabling controls on the video element with them enabled.');
</script>