on-audio-invalid-behavior.tentative.html (1309B)
1 <!doctype html> 2 <meta charset="utf-8" /> 3 <meta name="author" title="Keith Cirkel" href="mailto:wpt@keithcirkel.co.uk" /> 4 <meta name="timeout" content="long" /> 5 <link rel="help" href="https://open-ui.org/components/invokers.explainer/" /> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/resources/testdriver.js"></script> 9 <script src="/resources/testdriver-actions.js"></script> 10 <script src="/resources/testdriver-vendor.js"></script> 11 <script src="resources/invoker-utils.js"></script> 12 13 <audio controls id="invokee" src="/media/sound_5.mp3"></audio> 14 <button id="invokerbutton" commandfor="invokee"></button> 15 16 <script> 17 // invalid actions on audio 18 [ 19 "", 20 "foo-bar", 21 "playpause", 22 "show-popover", 23 "show-modal", 24 "show-picker", 25 "open", 26 "close", 27 ].forEach((action) => { 28 promise_test(async function (t) { 29 t.add_cleanup(() => invokerbutton.removeAttribute("command")); 30 invokerbutton.setAttribute("command", action); 31 assert_true(invokee.paused); 32 assert_false(invokee.muted); 33 await clickOn(invokerbutton); 34 await waitForRender(); 35 assert_true(invokee.paused); 36 assert_false(invokee.muted); 37 }, `invoking (as ${action}) on audio does nothing`); 38 }); 39 </script>