<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<div id="box">This is a test box. ABC 123</div>
<script>
if (window.testRunner) {
description("This tests to make sure that right clicking when the left-mouse button is pressed disables the drag.");
var box = document.getElementById("box");
var x = box.offsetLeft;
var y = box.offsetTop + box.offsetHeight / 2;
eventSender.dragMode = false;
eventSender.mouseMoveTo(x, y);
// Start a mouse down with the left mouse button.
eventSender.mouseDown();
// On some platforms, the page only sees a right MouseDown before displaying the
// context menu. The context menu can also be dismissed via Esc and so there is
// no guarantee that a page will see MouseUp.
eventSender.contextClick();
x = x + 30;
// Move the mouse to initiate a drag.
eventSender.mouseMoveTo(x, y);
shouldBeTrue("window.getSelection().isCollapsed");
}
</script>
</body>
</html>