blob: 0a937ea4af773de3cf2179536cb44a81ad52e3bf [file] [log] [blame]
<script src="../js/resources/js-test-pre.js"></script>
<style>
#pusher {
width: 1000px;
height: 1000px;
outline: 1px solid black;
}
</style>
<div id="console"></div>
<div id="testArea">
<div id="pusher">This box is here to create scrollbars.</div>
</div>
<script>
var event;
function sendClick()
{
if (window.eventSender) {
eventSender.mouseMoveTo(100, 100);
eventSender.mouseDown();
eventSender.mouseUp();
}
}
function zoomPageIn()
{
if (window.eventSender) {
eventSender.zoomPageIn();
}
}
function zoomPageOut()
{
if (window.eventSender) {
eventSender.zoomPageOut();
}
}
function scrollPage(x, y)
{
window.scrollTo(x, y);
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
// Default.
function base(e)
{
event = e;
debug("Base");
shouldBe("event.clientX", "100");
shouldBe("event.clientY", "100");
shouldBe("event.pageX", "100");
shouldBe("event.pageY", "100");
}
window.addEventListener("click", base, false);
sendClick();
window.removeEventListener("click", base, false);
// Just zoomed.
function justZoomed(e)
{
event = e;
debug("\nJust zoomed");
shouldBe("event.clientX", "83");
shouldBe("event.clientY", "83");
shouldBe("event.pageX", "83");
shouldBe("event.pageY", "83");
}
window.addEventListener("click", justZoomed, false);
zoomPageIn();
sendClick();
zoomPageOut();
window.removeEventListener("click", justZoomed, false);
// Just scrolled.
function justScrolled(e)
{
event = e;
debug("\nJust scrolled");
shouldBe("event.clientX", "100");
shouldBe("event.clientY", "100");
shouldBe("event.pageX", "150");
shouldBe("event.pageY", "150");
}
window.addEventListener("click", justScrolled, false);
scrollPage(50, 50);
sendClick();
scrollPage(0, 0);
window.removeEventListener("click", justScrolled, false);
// Zoomed and scrolled.
function zoomedAndScrolled(e)
{
event = e;
debug("\nZoomed and scrolled");
shouldBe("event.clientX", "84");
shouldBe("event.clientY", "84");
shouldBe("event.pageX", "133");
shouldBe("event.pageY", "133");
}
window.addEventListener("click", zoomedAndScrolled, false);
zoomPageIn();
scrollPage(50, 50);
sendClick();
zoomPageOut();
scrollPage(0, 0);
window.removeEventListener("click", zoomedAndScrolled, false);
if (window.layoutTestController) {
var area = document.getElementById('testArea');
area.parentNode.removeChild(area);
layoutTestController.notifyDone();
}
successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>