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

Side by Side Diff: LayoutTests/fast/events/setDragImage-with-detached-node.html

Issue 724663002: Don't abort drags if drag image generation fails. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/events/setDragImage-with-detached-node-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
Rick Byers 2014/11/13 22:22:19 nit: omit html, head: http://www.chromium.org/blin
dcheng 2014/11/13 22:29:30 Done.
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 var dragEndExpected = true;
7
8 function runTest()
9 {
10 var dragger = document.getElementById('dragMe');
11 dragger.addEventListener('dragstart', dragStart);
12 dragger.addEventListener('drag', dragging);
13 dragger.addEventListener('dragend', dragEnd);
14 if (!window.testRunner)
15 return;
16
17 var x = dragger.offsetLeft + dragger.offsetWidth / 2;
18 var y = dragger.offsetTop + dragger.offsetHeight / 2;
19
20 eventSender.mouseMoveTo(x, y);
21 eventSender.mouseDown();
22 eventSender.leapForward(100);
23 eventSender.mouseMoveTo(x + 100, y + 100);
24 eventSender.mouseUp();
25 }
26
27 function dragStart(e)
28 {
29 if (window.testRunner)
30 dragEndExpected = false;
31 debug('Started drag.');
32 var emptyDiv = document.createElement('div');
33 e.dataTransfer.setDragImage(emptyDiv, 0, 0);
34 }
35
36 function dragging()
37 {
38 dragEndExpected = true;
39 }
40
41 function dragEnd()
42 {
43 if (!dragEndExpected)
44 testFailed('Not expecting drag end!');
45 else
46 testPassed('Ended drag.');
47 }
48 </script>
49 <style>
50 html, body {
51 height: 100%;
52 margin: 0;
53 }
54
55 #dragMe {
56 border: 1px solid black;
57 }
58 </style>
59 </head>
60 <body onload="runTest()">
Rick Byers 2014/11/13 22:22:19 nit: you can replace this with window.onload = fun
dcheng 2014/11/13 22:29:30 Done.
61 <p>Test that calling setDragImage() with a detached node doesn't immediately abo rt the drag. This test can be manually run by dragging the 'Drag Me' div around and then ending the drag.
62 <div id="dragMe" draggable="true">Drag Me</div>
63 <div id="console"></div>
64 </body>
65 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/setDragImage-with-detached-node-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698