|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=953044 |
|
5 --> |
|
6 <head> |
|
7 <title>Basic test for InputMethod API.</title> |
|
8 <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="application/javascript;version=1.7" src="inputmethod_common.js"></script> |
|
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
11 </head> |
|
12 <body> |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=953044">Mozilla Bug 953044</a> |
|
14 <p id="display"></p> |
|
15 <pre id="test"> |
|
16 <script class="testbody" type="application/javascript;version=1.7"> |
|
17 |
|
18 inputmethod_setup(function() { |
|
19 runTest(); |
|
20 }); |
|
21 |
|
22 function runTest() { |
|
23 // Create an app frame to recieve keyboard inputs. |
|
24 let app = document.createElement('iframe'); |
|
25 app.src = 'file_test_app.html'; |
|
26 app.setAttribute('mozbrowser', true); |
|
27 document.body.appendChild(app); |
|
28 |
|
29 // Create a browser frame to load the input method app. |
|
30 let keyboard = document.createElement('iframe'); |
|
31 keyboard.setAttribute('mozbrowser', true); |
|
32 document.body.appendChild(keyboard); |
|
33 |
|
34 // Bug 953044 setInputMethodActive(false) before input method app loads should |
|
35 // always succeed. |
|
36 let req = keyboard.setInputMethodActive(false); |
|
37 req.onsuccess = function() { |
|
38 ok(true, 'setInputMethodActive before loading succeeded.'); |
|
39 inputmethod_cleanup(); |
|
40 }; |
|
41 |
|
42 req.onerror = function() { |
|
43 ok(false, 'setInputMethodActive before loading failed: ' + this.error.name); |
|
44 inputmethod_cleanup(); |
|
45 }; |
|
46 } |
|
47 |
|
48 </script> |
|
49 </pre> |
|
50 </body> |
|
51 </html> |
|
52 |