For bug discussed earlier in here and here, here is the Mochitest.
<!DOCTYPE HTML>
<html>
<!—
https://bugzilla.mozilla.org/show_bug.cgi?id=565031
—>
<head>
<title>Test for Bug 565031</title>
<script src="/MochiKit/packed.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=565031">Mozilla Bug 565031</a>
<p id="display">
<script>
var simple = false;
var tabs = false;
var onlyTabs = false;
</script>
<map name="map">
<area coords="1 1 1 1" onclick="simple = true;" />
<area coords="2, 1, 2, 1" onclick="tabs = true;" />
<area coords="3 1 3 1" onclick="onlyTabs = true;" />
</map>
<img id="image" src="image.png" usemap="#map" width="200" height="200" />
</p>
<div id="content" style="display: none"></div>
<pre id="test">
<script>
/** Test for Bug 565031 **/
SimpleTest.waitForExplicitFinish();
function runTest() { SimpleTest.waitForFocus(function() { var image = document.getElementById("image"); synthesizeMouse(image, 1, 1, {}); synthesizeMouse(image, 2, 1, {}); synthesizeMouse(image, 3, 1, {});ok(simple, "Simple Space");
ok(tabs, "Tabs");
ok(!onlyTabs, "Only Tabs"); // should fail
SimpleTest.finish();
});
}
addLoadEvent(runTest);
</script>
</pre>
</body>
</html>
To run the test, do:
make -C obj-ff-dbg mochitest-plain
Though, this test here only addresses issues raised in #565031. Other cases, as documented here, are not covered.