5 /* Don't needlessly span the whole screen. */
10 <script src=
"../../../resources/js-test.js"></script>
11 <button>Click me
</button>
12 <div id=
"div">Click me too
</div>
15 description('Test that inert nodes still get programmatic click events');
16 dialog
= document
.querySelector('dialog');
19 button
= document
.querySelector('button');
20 div
= document
.getElementById('div');
23 [button
, div
].forEach(function(element
) {
24 element
.addEventListener('click', function(e
) { clicked
= element
; });
25 expectedElement
= element
;
28 debug('Calling click() on ' + element
.tagName
);
30 shouldBe('clicked', 'expectedElement');
33 debug('Calling dispatchEvent() on ' + element
.tagName
);
34 element
.dispatchEvent(new Event('click'));
35 shouldBe('clicked', 'expectedElement');