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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/images/drag-image-2.html

Issue 2496663002: Merge css3/image/ and fast/images/ to images/ (Closed)
Patch Set: Address failing tests (3 of them) Created 4 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 body {
4 background-color: red;
5 }
6
7 #image {
8 width: 50px;
9 height: 50px;
10 background-image: url('resources/grid-transparent.png');
11 -webkit-user-drag: element;
12 }
13 </style>
14 <body>
15 <!-- Simulate dragging an element and dump the generated drag image.
16 The expected result should be the same as the input image,
17 without seeing a red background. -->
18 <div id="image"></div>
19 </body>
20 <script>
21 function drag() {
22 testRunner.dumpDragImage();
23
24 var image = document.getElementById('image');
25 var startX = image.offsetLeft + image.offsetWidth / 2;
26 var startY = image.offsetTop + image.offsetHeight / 2;
27 var positionX = startX + image.offsetWidth;
28 var positionY = startY + image.offsetHeight;
29
30 eventSender.dragMode = true;
31 eventSender.mouseMoveTo(startX, startY);
32 eventSender.mouseDown();
33 eventSender.mouseMoveTo(positionX, positionY);
34 eventSender.mouseUp();
35 }
36
37 if (!window.testRunner || !window.eventSender) {
38 document.write("This test does not work in manual mode.");
39 } else {
40 window.onload = drag;
41 }
42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698