summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/popovers/popover-focus-harness.html
blob: a22a68ea2bdf2cc5ded85f93fe451f8d2f418baa (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
<!DOCTYPE html>
<meta charset="utf-8" />
<title>Popover utils - harness test</title>
<link rel="author" href="mailto:masonf@chromium.org">
<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/popover-utils.js"></script>

<button id=button1 tabindex="0">Button1</button>
<button id=button2 tabindex="0">Button2</button>
<button id=button3 tabindex="0">Button3</button>

<script>
promise_test(async t => {
  button1.focus();
  assert_equals(document.activeElement,button1);
  await sendTab();
  assert_equals(document.activeElement,button2,'Tab should move to button 2');
  await sendShiftTab();
  assert_equals(document.activeElement,button1,'Shift-Tab should move back to button 1');
}, "Test sendShiftTab");
</script>