chromium/third_party/blink/web_tests/fast/dom/click-method-on-html-element.html

<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/element_names.js"></script>

<p>The support of click() method on HTMLElement.</p>

<script>
function runTest(tagName) {
  test(t => {
    const element = document.createElement(tagName);
    let success = false;
    element.addEventListener('click', () => {success=true;}, false);
    element.click();
    assert_true(success,'Click handler was not called');
  },tagName);
}

// This list used to also contain 'layer', 'listing', and 'nolayer'.
const tagNames = [...HTML5_ELEMENTS, ...HTML5_DEPRECATED_ELEMENTS];
for (var i =0 ; i < tagNames.length; i++)
    runTest(tagNames[i]);

</script>