Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert.html

Issue 2671603003: Move DIALOG element tests to html/dialog/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <style>
4 dialog {
5 /* Don't needlessly span the whole screen. */
6 width: 50px;
7 }
8 </style>
9 <body>
10 <script src="../../../resources/js-test.js"></script>
11 <button>Click me</button>
12 <div id="div">Click me too</div>
13 <dialog></dialog>
14 <script>
15 description('Test that inert nodes still get programmatic click events');
16 dialog = document.querySelector('dialog');
17 dialog.showModal();
18
19 button = document.querySelector('button');
20 div = document.getElementById('div');
21 clicked = null;
22
23 [button, div].forEach(function(element) {
24 element.addEventListener('click', function(e) { clicked = element; });
25 expectedElement = element;
26
27 clicked = null;
28 debug('Calling click() on ' + element.tagName);
29 element.click();
30 shouldBe('clicked', 'expectedElement');
31
32 clicked = null;
33 debug('Calling dispatchEvent() on ' + element.tagName);
34 element.dispatchEvent(new Event('click'));
35 shouldBe('clicked', 'expectedElement');
36 });
37 </script>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698