OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <div id="box">This is a test box. ABC 123</div> | 7 <div id="box">This is a test box. ABC 123</div> |
8 <script> | 8 <script> |
9 if (window.testRunner) { | 9 if (window.testRunner) { |
10 description("This tests to make sure that right clicking when the left-mous
e button is pressed disables the drag."); | 10 description("This tests to make sure that right clicking when the left-mous
e button is pressed disables the drag."); |
11 var box = document.getElementById("box"); | 11 var box = document.getElementById("box"); |
12 var x = box.offsetLeft; | 12 var x = box.offsetLeft; |
13 var y = box.offsetTop + box.offsetHeight / 2; | 13 var y = box.offsetTop + box.offsetHeight / 2; |
14 eventSender.dragMode = false; | 14 eventSender.dragMode = false; |
15 eventSender.mouseMoveTo(x, y); | 15 eventSender.mouseMoveTo(x, y); |
16 // Start a mouse down with the left mouse button. | 16 // Start a mouse down with the left mouse button. |
17 eventSender.mouseDown(); | 17 eventSender.mouseDown(); |
18 // On some platforms, the page only sees a right MouseDown before displayin
g the | 18 // On some platforms, the page only sees a right MouseDown before displayin
g the |
19 // context menu. The context menu can also be dismissed via Esc and so ther
e is | 19 // context menu. The context menu can also be dismissed via Esc and so ther
e is |
20 // no guarantee that a page will see MouseUp. | 20 // no guarantee that a page will see MouseUp. |
21 eventSender.contextClick(); | 21 eventSender.contextClick(); |
22 x = x + 30; | 22 x = x + 30; |
23 // Move the mouse to initiate a drag. | 23 // Move the mouse to initiate a drag. |
24 eventSender.mouseMoveTo(x, y); | 24 eventSender.mouseMoveTo(x, y); |
25 shouldBeTrue("window.getSelection().isCollapsed"); | 25 shouldBeTrue("window.getSelection().isCollapsed"); |
26 } | 26 } |
27 </script> | 27 </script> |
28 </body> | 28 </body> |
29 </html> | 29 </html> |
OLD | NEW |