Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <p id="description">Tests whether explicitly set caret style is retained on perf orming text selection</p> | |
|
yosin_UTC9
2013/09/18 03:42:26
See below for example of how to use description().
| |
| 5 <div style="cursor:progress" id="test">Try selecting this text by dragging the c ursor.</div> | |
| 6 </body> | |
| 7 <script src="../../fast/js/resources/js-test-pre.js"></script> | |
| 8 <script> | |
| 9 if (window.eventSender && window.internals) { | |
| 10 var cursorType = 'Progress'; | |
| 11 | |
| 12 var div = document.getElementById("test"); | |
| 13 div.focus(); | |
| 14 | |
| 15 var y = div.offsetTop + div.offsetHeight / 2; | |
| 16 | |
| 17 function leapForwardAndMove(x) { | |
| 18 eventSender.leapForward(200); | |
| 19 eventSender.mouseMoveTo(div.offsetLeft + x, y); | |
| 20 } | |
| 21 | |
| 22 eventSender.dragMode = false; | |
| 23 eventSender.mouseMoveTo(div.offsetLeft + 5, y); | |
|
yosin_UTC9
2013/09/18 03:42:26
We can also use leapForwardAndMove() here.
| |
| 24 eventSender.mouseDown(); | |
| 25 | |
| 26 leapForwardAndMove(10); | |
| 27 | |
| 28 leapForwardAndMove(div.offsetWidth - 10); | |
| 29 | |
| 30 var cursorInfo = window.internals.getCurrentCursorInfo(document); | |
| 31 var currentCursorType = cursorInfo.substring(cursorInfo.indexOf('=') + 1, cu rsorInfo.lastIndexOf(' ')); | |
| 32 shouldBeEqualToString('currentCursorType', cursorType); | |
| 33 } | |
| 34 </script> | |
| 35 </html> | |
|
yosin_UTC9
2013/09/18 03:42:26
You should load js-test-post.js, and start test st
| |
| OLD | NEW |