Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: dom/events/test/chrome.toml
<?xml version="1.0"?>
<!--
-->
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=547996">Mozilla Bug 547996</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
<script>//<![CDATA[
/* mouseEvent.inputSource attribute */
var expectedInputSource = null;
function check(event) {
is(event.inputSource, expectedInputSource, ".inputSource");
}
function doTest() {
setup();
expectedInputSource = MouseEvent.MOZ_SOURCE_MOUSE;
testMouse();
expectedInputSource = MouseEvent.MOZ_SOURCE_UNKNOWN;
testScriptedClicks();
cleanup();
SimpleTest.finish();
}
function testMouse() {
synthesizeMouse($("xulButtonTarget"), 0, 0, {});
}
function testScriptedClicks() {
$("xulButtonTarget").click();
}
function setup() {
$("xulButtonTarget").addEventListener("click", check);
}
function cleanup() {
$("xulButtonTarget").removeEventListener("click", check);
}
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(doTest, window);
//]]>
</script>
</pre>
<xul:button id="xulButtonTarget" accesskey="t">XUL Button</xul:button>
</body>
</html>