2011-04-20 16:54:43 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test for plugin input event</title>
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
2012-06-26 19:26:38 -07:00
|
|
|
<script type="text/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"></script>
|
2011-04-20 16:54:43 -07:00
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p id="display">
|
|
|
|
<embed id="plugin" type="application/x-test" wmode="opaque">
|
|
|
|
</p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
var gPlugin = document.getElementById("plugin");
|
|
|
|
|
|
|
|
var gUtils = window.
|
|
|
|
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
|
|
|
getInterface(Components.interfaces.nsIDOMWindowUtils);
|
|
|
|
|
|
|
|
function doTest() {
|
|
|
|
gPlugin.focus();
|
|
|
|
|
|
|
|
is(gUtils.IMEStatus, gUtils.IME_STATUS_PLUGIN,
|
|
|
|
"Plugin failed to get focus");
|
|
|
|
|
|
|
|
is(gPlugin.getLastKeyText(), "", "Must be empty before first key test");
|
|
|
|
|
|
|
|
gUtils.sendNativeKeyEvent(0x409 /* US */,
|
2012-06-26 19:26:38 -07:00
|
|
|
WIN_VK_A, 0,
|
2011-04-20 16:54:43 -07:00
|
|
|
"a", "a");
|
|
|
|
is(gPlugin.getLastKeyText(), "a", "Invalid character was inputted");
|
|
|
|
|
|
|
|
gUtils.sendNativeKeyEvent(0x407 /* German */,
|
2012-06-26 19:26:38 -07:00
|
|
|
WIN_VK_OEM_PLUS, 0,
|
2011-04-20 16:54:43 -07:00
|
|
|
"+", "+");
|
|
|
|
is(gPlugin.getLastKeyText(), "+", "Invalid character was inputted");
|
|
|
|
|
|
|
|
gUtils.sendNativeKeyEvent(0x407 /* German */,
|
2012-06-26 19:26:38 -07:00
|
|
|
WIN_VK_OEM_PLUS, 0x1400 /* Ctrl + Alt (AltGr) */,
|
2011-04-20 16:54:43 -07:00
|
|
|
"~", "+");
|
|
|
|
is(gPlugin.getLastKeyText(), "~", "Invalid character was inputted");
|
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForFocus(doTest);
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|