summaryrefslogtreecommitdiffstats
path: root/dom/inputmethod/mochitest/test_bug953044.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/inputmethod/mochitest/test_bug953044.html')
-rw-r--r--dom/inputmethod/mochitest/test_bug953044.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/dom/inputmethod/mochitest/test_bug953044.html b/dom/inputmethod/mochitest/test_bug953044.html
new file mode 100644
index 000000000..2b1f022a6
--- /dev/null
+++ b/dom/inputmethod/mochitest/test_bug953044.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=953044
+-->
+<head>
+ <title>Basic test for InputMethod API.</title>
+ <script type="application/javascript;version=1.7" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <script type="application/javascript;version=1.7" src="inputmethod_common.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=953044">Mozilla Bug 953044</a>
+<p id="display"></p>
+<pre id="test">
+<script class="testbody" type="application/javascript;version=1.7">
+
+inputmethod_setup(function() {
+ runTest();
+});
+
+function runTest() {
+ // Create an app frame to recieve keyboard inputs.
+ let app = document.createElement('iframe');
+ app.src = 'file_test_app.html';
+ app.setAttribute('mozbrowser', true);
+ document.body.appendChild(app);
+
+ // Create a browser frame to load the input method app.
+ let keyboard = document.createElement('iframe');
+ keyboard.setAttribute('mozbrowser', true);
+ document.body.appendChild(keyboard);
+
+ // Bug 953044 setInputMethodActive(false) before input method app loads should
+ // always succeed.
+ let req = keyboard.setInputMethodActive(false);
+ req.onsuccess = function() {
+ ok(true, 'setInputMethodActive before loading succeeded.');
+ inputmethod_cleanup();
+ };
+
+ req.onerror = function() {
+ ok(false, 'setInputMethodActive before loading failed: ' + this.error.name);
+ inputmethod_cleanup();
+ };
+}
+
+</script>
+</pre>
+</body>
+</html>
+