click_checkbox.html (962B)
1 <!doctype html> 2 <title>Interaction of UI input and the click in progress flag</title> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <script src="/resources/testdriver.js"></script> 6 <script src="/resources/testdriver-actions.js"></script> 7 <script src="/resources/testdriver-vendor.js"></script> 8 <p>When you mouse click the checkbox below it should not be checked:</p> 9 <p><input type=checkbox onclick=this.click() id="target"></p> 10 <p>Now keyboard "click" the checkbox and confirm it's still not checked.</p> 11 <script> 12 promise_test(async t => { 13 var target = document.getElementById("target"); 14 var received = false; 15 target.addEventListener("click", t.step_func(function(e) { 16 received = true; 17 assert_false(target.checked, "The checkbox should not be checked") 18 })); 19 20 await test_driver.click(target); 21 assert_true(received, "click event should have been dispatched synchronously"); 22 }); 23 </script>