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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-distributed-child-is-not-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 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <dialog>
8 <content></content>
9 </dialog>
10 <div id="host">
11 <button>Click me</button>
12 </div>
13 <script>
14 function clickOn(element)
15 {
16 if (!window.eventSender)
17 return;
18 var rect = element.getBoundingClientRect();
19 eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
20 eventSender.mouseDown();
21 eventSender.mouseUp();
22 }
23
24 jsTestIsAsync = true;
25 description('Tests that nodes transposed into the dialog are not inert. The test passes if you can click the button.');
26
27 dialog = document.querySelector('dialog');
28 root = document.querySelector('#host').createShadowRoot();
29 root.appendChild(dialog);
30 dialog.showModal();
31
32 button = document.querySelector('button');
33 dialog.addEventListener('click', function(event) {
34 if (event.target == button)
35 testPassed('button was clicked');
36 else
37 testFailed('button was not clicked');
38 finishJSTest();
39 });
40 clickOn(button);
41 </script>
42 </body>
43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698