summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/activation/click_checkbox.html
blob: ab81cbf063254b59ec0e2579ba37e6a80c067623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!doctype html>
<title>Interaction of UI input and the click in progress flag</title>
<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>
<p>When you mouse click the checkbox below it should not be checked:</p>
<p><input type=checkbox onclick=this.click() id="target"></p>
<p>Now keyboard "click" the checkbox and confirm it's still not checked.</p>
<script>
promise_test(async t => {
  var target = document.getElementById("target");
  var received = false;
  target.addEventListener("click", t.step_func(function(e) {
  	received = true;
    assert_false(target.checked, "The checkbox should not be checked")
  }));

  await test_driver.click(target);
  assert_true(received, "click event should have been dispatched synchronously");
});
</script>