Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: layout/xul/test/chrome.toml
<?xml version="1.0"?>
<!--
XUL Widget Test for the resizer element
-->
<window title="Titlebar" width="200" height="200"
onload="setTimeout(test_resizer_ctrl_click, 0);"
<resizer id="resizer" dir="bottomend" width="16" height="16"/>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
SimpleTest.waitForExplicitFinish();
function test_resizer_ctrl_click()
{
let resizer = document.getElementById("resizer");
let isCommandFired = false;
resizer.addEventListener("click", function(aEvent) {
// Delay check for command event, because it is fired after click event.
setTimeout(() => {
ok(isCommandFired, "Check if command event is fired");
SimpleTest.finish();
}, 0);
});
resizer.addEventListener("command", function(aEvent) {
isCommandFired = true;
ok(aEvent.ctrlKey, "Check ctrlKey for command event");
ok(!aEvent.shiftKey, "Check shiftKey for command event");
ok(!aEvent.altKey, "Check altKey for command event");
ok(!aEvent.metaKey, "Check metaKey for command event");
is(aEvent.inputSource, MouseEvent.MOZ_SOURCE_MOUSE,
"Check inputSource for command event");
});
synthesizeMouseAtCenter(resizer, { ctrlKey: true });
}
]]>
</script>
</window>