blob: 033f94a8ca2ad1318ae67c8a3f0f3114f92d7630 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p id="description"></p>
<div style="cursor:progress; border: 2px solid red;" id="test">Try selecting this text by dragging the cursor. Progress cursor should be displayed while doing so.</div>
<div id="console"></div>
<script src="../../resources/js-test.js"></script>
<script>
if (window.eventSender && window.internals) {
description('Tests whether explicitly set caret style is retained on performing text selection');
var div = document.getElementById("test");
div.focus();
var y = div.offsetTop + div.offsetHeight / 2;
function leapForwardAndMove(x) {
eventSender.leapForward(200);
eventSender.mouseMoveTo(div.offsetLeft + x, y);
}
eventSender.dragMode = false;
leapForwardAndMove(div.offsetLeft + 5);
eventSender.mouseDown();
leapForwardAndMove(10);
leapForwardAndMove(div.offsetWidth - 10);
var cursorInfo = window.internals.getCurrentCursorInfo();
var currentCursorType = cursorInfo.substring(cursorInfo.indexOf('=') + 1, cursorInfo.lastIndexOf(' '));
shouldBeEqualToString('currentCursorType', 'Progress');
}
</script>
</body>
</html>