OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <p id="text"> |
| 8 TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT |
| 9 </p> |
| 10 <script> |
| 11 description('Test for <a href="https://code.google.com/p/chromium/issues/det
ail?id=346473">bug' + |
| 12 '346473</a>: Text selection should happen even if mousemove eve
nt is cancelled,' + |
| 13 'since there is no default action specified for mousemove event
in the spec which ' + |
| 14 'is to be prevented on defaultPrevent. To test manually try to
select the text in ' + |
| 15 'the paragraph, selection should happen.'); |
| 16 |
| 17 var testElem = document.getElementById("text"); |
| 18 testElem.addEventListener("mousemove", function(event) { |
| 19 event.preventDefault(); |
| 20 }, false); |
| 21 |
| 22 var text_x = testElem.offsetLeft; |
| 23 var text_y = testElem.offsetTop; |
| 24 |
| 25 eventSender.mouseMoveTo(text_x, text_y); |
| 26 eventSender.mouseDown(); |
| 27 |
| 28 // Create the selection |
| 29 eventSender.mouseMoveTo(text_x + 10, text_y); |
| 30 eventSender.mouseUp(); |
| 31 |
| 32 shouldBe('window.getSelection().getRangeAt(0).toString().length','1'); |
| 33 </script> |
| 34 </body> |
| 35 </html> |
OLD | NEW |