blob: 381ff6925cb0698ddbbe6c5e994653e173bf3865 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script src="resources/expect-cursor-update.js"></script>
<style type="text/css">
#test-container {
position: relative;
padding: 10px;
#target {
cursor: text;
background-color: blue;
width: 100px;
height: 100px;
#overlay {
cursor: wait;
width: 200px;
height: 200px;
background: rgba(255,0,0,0.2);
position: absolute;
left: 0;
top: 0;
<p id="description"></p>
<p><a href="">Bug 26723</a></p>
<div id="test-container">
<div id="target"></div>
<div id="console"></div>
description("Test that mouse cursors are changed correctly after layout.");
// Ensure the shouldBe calls don't trigger layouts during our testing.
if (window.testRunner) {
window.jsTestIsAsync = true;
var overlay;
function addOverlay() {
var testContainer = document.getElementById('test-container');
overlay = document.createElement('div');'overlay';
// Can't do anything useful here without eventSender
if (window.eventSender) {
var target = document.getElementById('target');
eventSender.dragMode = false;
debug('Mouse move');
var rect = target.getBoundingClientRect();
eventSender.mouseMoveTo(rect.left + 3, + 3);
shouldBeEqualToString('internals.getCurrentCursorInfo()', 'type=IBeam hotSpot=0,0');
debug('Adding overlay element');
expectSendFakeMouseMove('type=Wait hotSpot=0,0', function() {
debug('Moving overlay element'); = "100px";
expectSendFakeMouseMove('type=IBeam hotSpot=0,0', function() {
} else {
testFailed('This test requires DumpRenderTree. Click to manually update layout.');
document.addEventListener('click', addOverlay);