popover-focus-harness.html (957B)
1 <!DOCTYPE html> 2 <meta charset="utf-8" /> 3 <title>Popover utils - harness test</title> 4 <link rel="author" href="mailto:masonf@chromium.org"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/resources/testdriver.js"></script> 8 <script src="/resources/testdriver-actions.js"></script> 9 <script src="/resources/testdriver-vendor.js"></script> 10 <script src="resources/popover-utils.js"></script> 11 12 <button id=button1 tabindex="0">Button1</button> 13 <button id=button2 tabindex="0">Button2</button> 14 <button id=button3 tabindex="0">Button3</button> 15 16 <script> 17 promise_test(async t => { 18 button1.focus(); 19 assert_equals(document.activeElement,button1); 20 await sendTab(); 21 assert_equals(document.activeElement,button2,'Tab should move to button 2'); 22 await sendShiftTab(); 23 assert_equals(document.activeElement,button1,'Shift-Tab should move back to button 1'); 24 }, "Test sendShiftTab"); 25 </script>