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

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: Address comments 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 <script src="../../resources/js-test.js"></script>
3 <script>
4 var dragEndExpected = true;
5
6 window.onload = function()
7 {
8 var dragger = document.getElementById('dragMe');
9 dragger.addEventListener('dragstart', dragStart);
10 dragger.addEventListener('drag', dragging);
11 dragger.addEventListener('dragend', dragEnd);
12 if (!window.testRunner)
13 return;
14
15 var x = dragger.offsetLeft + dragger.offsetWidth / 2;
16 var y = dragger.offsetTop + dragger.offsetHeight / 2;
17
18 eventSender.mouseMoveTo(x, y);
19 eventSender.mouseDown();
20 eventSender.leapForward(100);
21 eventSender.mouseMoveTo(x + 100, y + 100);
22 eventSender.mouseUp();
23 }
24
25 function dragStart(e)
26 {
27 if (window.testRunner)
28 dragEndExpected = false;
29 debug('Started drag.');
30 var emptyDiv = document.createElement('div');
31 e.dataTransfer.setDragImage(emptyDiv, 0, 0);
32 }
33
34 function dragging()
35 {
36 dragEndExpected = true;
37 }
38
39 function dragEnd()
40 {
41 if (!dragEndExpected)
42 testFailed('Not expecting drag end!');
43 else
44 testPassed('Ended drag.');
45 }
46 </script>
47 <style>
48 html, body {
49 height: 100%;
50 margin: 0;
51 }
52
53 #dragMe {
54 border: 1px solid black;
55 }
56 </style>
57 <body>
58 <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.
59 <div id="dragMe" draggable="true">Drag Me</div>
60 <div id="console"></div>
61 </body>
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