summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-audio-invalid-behavior.tentative.html
blob: 9e15ce38e859e09a4dae5c84afff397a03d428d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!doctype html>
<meta charset="utf-8" />
<meta name="author" title="Keith Cirkel" href="mailto:wpt@keithcirkel.co.uk" />
<meta name="timeout" content="long" />
<link rel="help" href="https://open-ui.org/components/invokers.explainer/" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/invoker-utils.js"></script>

<audio controls id="invokee" src="/media/sound_5.mp3"></audio>
<button id="invokerbutton" invoketarget="invokee"></button>

<script>
  // invalid actions on audio
  [
    "foo-bar",
    "showpopover",
    "showmodal",
    "showpicker",
    "open",
    "close",
  ].forEach((action) => {
    promise_test(async function (t) {
      t.add_cleanup(() => invokerbutton.removeAttribute("invokeaction"));
      invokerbutton.setAttribute("invokeaction", action);
      assert_true(invokee.paused);
      assert_false(invokee.muted);
      await clickOn(invokerbutton);
      await waitForRender();
      assert_true(invokee.paused);
      assert_false(invokee.muted);
    }, `invoking (as ${action}) on audio does nothing`);
  });
</script>