blob: 04c7c290b67afa6bf3600274553b26cabdc676cc [file] [log] [blame]
Nicolás Peña Morenobc01db72020-04-18 00:14:011<!DOCTYPE html>
2<html>
3<meta charset=utf-8 />
4<script src=/resources/testharness.js></script>
5<script src=/resources/testharnessreport.js></script>
6<script src=/resources/testdriver.js></script>
7<script src=/resources/testdriver-vendor.js></script>
8
9<script src=resources/event-timing-test-utils.js></script>
10
11<button id='the_button'>ClickMe</button>
12
13<script>
14async_test(function(t) {
15 assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
16 const observer = new PerformanceObserver(t.step_func_done((entryList) => {
Hongbo Song13817e22021-12-14 22:42:1117 const entries = entryList.getEntries().filter(e => e.name === 'pointerdown');
Nicolás Peña Morenoe3c77c72020-05-17 20:45:1818 if (entries.length === 0)
19 return;
Nicolás Peña Morenobc01db72020-04-18 00:14:0120 // There must only be one click entry.
21 assert_equals(entries.length, 1);
22 const entry = entries[0];
23 // This checks that entry.target returns the correct button Node.
24 verifyClickEvent(entry, 'the_button', true);
25 const button = document.getElementById('the_button');
26 button.parentNode.removeChild(button);
27 // After removing the button, entry.target should now return null.
28 assert_equals(entry.target, null);
29 }));
30 observer.observe({entryTypes: ['event']});
31 clickAndBlockMain('the_button');
32}, "Event Timing: when target is disconnected, entry.target returns null.");
33</script>
34</html>