3 <title>Test for IME state on plugin
</title>
4 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
5 <script src=
"file_ime_state_test_helper.js"></script>
6 <link rel=
"stylesheet" href=
"chrome://mochikit/content/tests/SimpleTest/test.css">
10 <object type=
"application/x-test"></object>
14 SimpleTest
.waitForExplicitFinish();
15 SimpleTest
.waitForFocus(() => {
16 const tipWrapper
= new TIPWrapper(window
);
17 const plugin
= document
.querySelector("object");
19 // Plugins are not supported and their elements should not accept focus;
20 // therefore, IME should not enable when we play with it.
22 document
.activeElement
?.blur();
24 window
.windowUtils
.IMEStatus
,
25 Ci
.nsIDOMWindowUtils
.IME_STATUS_DISABLED
,
26 "IME enabled state should be disabled when no element has focus"
29 !tipWrapper
.IMEHasFocus
,
30 "IME should not have focus when no element has focus"
35 window
.windowUtils
.IMEStatus
,
36 Ci
.nsIDOMWindowUtils
.IME_STATUS_DISABLED
,
37 "IME enabled state should be disabled when an <object> for plugin has focus"
40 !tipWrapper
.IMEHasFocus
,
41 "IME should not have focus when an <object> for plugin has focus"
46 window
.windowUtils
.IMEStatus
,
47 Ci
.nsIDOMWindowUtils
.IME_STATUS_DISABLED
,
48 "IME enabled state should be disabled when an <object> for plugin gets blurred"
51 !tipWrapper
.IMEHasFocus
,
52 "IME should not have focus when an <object> for plugin gets blurred"
57 window
.windowUtils
.IMEStatus
,
58 Ci
.nsIDOMWindowUtils
.IME_STATUS_DISABLED
,
59 "IME enabled state should be disabled when an <object> for plugin gets focused again"
62 !tipWrapper
.IMEHasFocus
,
63 "IME should not have focus when an <object> for plugin gets focused again"
68 window
.windowUtils
.IMEStatus
,
69 Ci
.nsIDOMWindowUtils
.IME_STATUS_DISABLED
,
70 "IME enabled state should be disabled when focused <object> for plugin is removed from the document"
73 !tipWrapper
.IMEHasFocus
,
74 "IME should not have focus when focused <object> for plugin is removed from the document"
77 document
.querySelector("input").focus();
79 window
.windowUtils
.IMEStatus
,
80 Ci
.nsIDOMWindowUtils
.IME_STATUS_ENABLED
,
81 "IME enabled state should be enabled after <input> gets focus"
84 tipWrapper
.IMEHasFocus
,
85 "IME should have focus after <input> gets focus"