blob: b610af163aca0f8d3f79699c95eb7a2ca14ba348 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" onload="runTest()">
<script type="text/ecmascript"><![CDATA[
var states = [];
var clicked;
function testClickAt(x, y) {
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
states.push(clicked);
clicked = false;
}
function checkResults() {
var testAgainst = [true, false];
for (var i = 0; i < testAgainst.length; i++) {
if (testAgainst[i] != states[i]) {
alert("was: " + states);
alert("shouldBe: " + testAgainst);
return false;
}
}
return true;
}
function runTest() {
if (window.eventSender) {
testClickAt(91*2, 71*2);
testClickAt(91*2, 21*2);
document.getElementById("status").textContent = "Failed";
if (checkResults())
document.getElementById("status").textContent = "Passed";
} else {
// in manual mode
alert("Please use run_web_tests.py.");
}
}
]]></script>
<g transform="scale(2)">
<text x="70" y="70" onmousedown="clicked=true;">Click me</text>
<text x="10" y="130" onmousedown="clicked=true;">Status:</text>
<text id="status" x="90" y="130" onmousedown="clicked=true;">Unknown</text>
</g>
</svg>