dom/inputmethod/mochitest/test_bug953044.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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">
    18 inputmethod_setup(function() {
    19   runTest();
    20 });
    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);
    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);
    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   };
    42   req.onerror = function() {
    43     ok(false, 'setInputMethodActive before loading failed: ' + this.error.name);
    44     inputmethod_cleanup();
    45   };
    46 }
    48 </script>
    49 </pre>
    50 </body>
    51 </html>

mercurial