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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.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 <style>
5 #div {
6 height: 100px;
7 width: 100px;
8 background: red;
9 }
10 </style>
11 <script src="../../../resources/js-test.js"></script>
12 </head>
13 <body>
14 <div id="div"></div>
15 <dialog id="dialog"></dialog>
16 <script>
17 description('Test for bug 110952. Ensure that non-modal dialogs do not block mou se events. To test manually, click the red box. The test succeeds if the red box turns green.');
18
19 function clickOn(element)
20 {
21 if (!window.eventSender)
22 return;
23
24 var absoluteTop = 0;
25 var absoluteLeft = 0;
26 for (var parentNode = element; parentNode; parentNode = parentNode.offsetPar ent) {
27 absoluteLeft += parentNode.offsetLeft;
28 absoluteTop += parentNode.offsetTop;
29 }
30
31 var x = absoluteLeft + element.offsetWidth / 2;
32 var y = absoluteTop + element.offsetHeight / 2;
33 eventSender.mouseMoveTo(x, y);
34 eventSender.mouseDown();
35 eventSender.mouseUp()
36 eventSender.mouseMoveTo(0, 0);
37 }
38
39 if (window.testRunner)
40 testRunner.dumpAsText();
41
42 dialog = document.getElementById('dialog');
43 dialog.show();
44
45 div = document.getElementById('div');
46 div.firedOn = false;
47 div.addEventListener('click', function(event) {
48 div.firedOn = true;
49 div.style.backgroundColor = 'green';
50 });
51
52 clickOn(div);
53
54 shouldBeTrue('div.firedOn');
55 </script>
56 </body>
57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698