Bug 1286530 - Switch Input-related mochitests to chrome draft
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Mon, 09 May 2016 17:11:13 +0200
changeset 387110 90818e16f8d71a72a1b1f463a8e87d22ff63c784
parent 387109 c6099d263b29e967d79d0cacdeed5778d2ade6f8
child 387111 740cec0648c088b2a282ecf94318a4ae6d858490
push id22896
push userbmo:lissyx+mozillians@lissyx.dyndns.org
push dateWed, 13 Jul 2016 13:02:44 +0000
bugs1286530
milestone50.0a1
Bug 1286530 - Switch Input-related mochitests to chrome MozReview-Commit-ID: KzkxWa9teRG
dom/inputmethod/mochitest/chrome.ini
dom/inputmethod/mochitest/file_test_bug1066515.html
dom/inputmethod/mochitest/file_test_bug1137557.html
dom/inputmethod/mochitest/file_test_bug1175399.html
dom/inputmethod/mochitest/file_test_focus_blur_manage_events.html
dom/inputmethod/mochitest/file_test_setSupportsSwitching.html
dom/inputmethod/mochitest/file_test_simple_manage_events.html
dom/inputmethod/mochitest/file_test_sync_edit.html
dom/inputmethod/mochitest/file_test_two_inputs.html
dom/inputmethod/mochitest/file_test_two_selects.html
dom/inputmethod/mochitest/file_test_unload.html
dom/inputmethod/mochitest/file_test_unload_action.html
dom/inputmethod/mochitest/inputmethod_common.js
dom/inputmethod/mochitest/mochitest.ini
dom/inputmethod/mochitest/test_basic.html
dom/inputmethod/mochitest/test_bug1026997.html
dom/inputmethod/mochitest/test_bug1043828.html
dom/inputmethod/mochitest/test_bug1059163.html
dom/inputmethod/mochitest/test_bug1066515.html
dom/inputmethod/mochitest/test_bug1137557.html
dom/inputmethod/mochitest/test_bug1175399.html
dom/inputmethod/mochitest/test_bug944397.html
dom/inputmethod/mochitest/test_bug949059.html
dom/inputmethod/mochitest/test_bug953044.html
dom/inputmethod/mochitest/test_bug960946.html
dom/inputmethod/mochitest/test_bug978918.html
dom/inputmethod/mochitest/test_focus_blur_manage_events.html
dom/inputmethod/mochitest/test_forward_hardware_key_to_ime.html
dom/inputmethod/mochitest/test_input_registry_events.html
dom/inputmethod/mochitest/test_sendkey_cancel.html
dom/inputmethod/mochitest/test_setSupportsSwitching.html
dom/inputmethod/mochitest/test_simple_manage_events.html
dom/inputmethod/mochitest/test_sync_edit.html
dom/inputmethod/mochitest/test_two_inputs.html
dom/inputmethod/mochitest/test_two_selects.html
dom/inputmethod/mochitest/test_unload.html
dom/inputmethod/moz.build
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/chrome.ini
@@ -0,0 +1,49 @@
+[DEFAULT]
+# Not supported on Android, bug 983015 for B2G emulator
+skip-if = (toolkit == 'android' || toolkit == 'gonk') || e10s
+support-files =
+  bug1110030_helper.js
+  inputmethod_common.js
+  file_inputmethod.html
+  file_blank.html
+  file_test_app.html
+  file_test_bug1066515.html
+  file_test_bug1137557.html
+  file_test_bug1175399.html
+  file_test_empty_app.html
+  file_test_focus_blur_manage_events.html
+  file_test_sendkey_cancel.html
+  file_test_setSupportsSwitching.html
+  file_test_simple_manage_events.html
+  file_test_sms_app.html
+  file_test_sms_app_1066515.html
+  file_test_sync_edit.html
+  file_test_two_inputs.html
+  file_test_two_selects.html
+  file_test_unload.html
+  file_test_unload_action.html
+
+[test_basic.html]
+[test_bug944397.html]
+[test_bug949059.html]
+[test_bug953044.html]
+[test_bug960946.html]
+[test_bug978918.html]
+[test_bug1026997.html]
+[test_bug1043828.html]
+[test_bug1059163.html]
+[test_bug1066515.html]
+[test_bug1137557.html]
+[test_bug1175399.html]
+[test_focus_blur_manage_events.html]
+[test_forward_hardware_key_to_ime.html]
+skip-if = buildapp != 'mulet'
+[test_input_registry_events.html]
+disabled = timeout on pine
+[test_sendkey_cancel.html]
+[test_setSupportsSwitching.html]
+[test_simple_manage_events.html]
+[test_sync_edit.html]
+[test_two_inputs.html]
+[test_two_selects.html]
+[test_unload.html]
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_bug1066515.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<div id="text" contenteditable>Jan Jongboom</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_bug1137557.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<textarea rows=30 cols=30></textarea>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_bug1175399.html
@@ -0,0 +1,1 @@
+<html><body><input value="First" readonly></body></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_focus_blur_manage_events.html
@@ -0,0 +1,22 @@
+<html><body>
+<input type="text">
+<input type="search">
+<textarea></textarea>
+<p contenteditable></p>
+<input type="number">
+<input type="tel">
+<input type="url">
+<input type="email">
+<input type="password">
+<input type="datetime">
+<input type="date" value="2015-08-03" min="1990-01-01" max="2020-01-01">
+<input type="month">
+<input type="week">
+<input type="time">
+<input type="datetime-local">
+<input type="color">
+<select><option selected>foo</option><option disabled>bar</option>
+<optgroup label="group"><option>baz</option></optgroup></select>
+<select multiple><option selected>foo</option><option disabled>bar</option>
+<optgroup label="group"><option>baz</option></optgroup></select>
+</body></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_setSupportsSwitching.html
@@ -0,0 +1,5 @@
+<html><body>
+<input type="text">
+<input type="number">
+<input type="password">
+</body></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_simple_manage_events.html
@@ -0,0 +1,1 @@
+<html><body><input type="text"></body></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_sync_edit.html
@@ -0,0 +1,1 @@
+<html><body><input value="First"></body></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_two_inputs.html
@@ -0,0 +1,1 @@
+<html><body><input value="First"><input value="Second"></body></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_two_selects.html
@@ -0,0 +1,1 @@
+<html><body><select><option>First</option></select><select><option>Second</option></select></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_unload.html
@@ -0,0 +1,1 @@
+<html><body><form id="form"><input value="First"><input type="submit"></form></body></html>
new file mode 100644
--- /dev/null
+++ b/dom/inputmethod/mochitest/file_test_unload_action.html
@@ -0,0 +1,1 @@
+<html><body><input value="Second"></body></html>
--- a/dom/inputmethod/mochitest/inputmethod_common.js
+++ b/dom/inputmethod/mochitest/inputmethod_common.js
@@ -2,33 +2,22 @@ function inputmethod_setup(callback) {
   SimpleTest.waitForExplicitFinish();
   SimpleTest.requestCompleteLog();
   let appInfo = SpecialPowers.Cc['@mozilla.org/xre/app-info;1']
                 .getService(SpecialPowers.Ci.nsIXULAppInfo);
   if (appInfo.name != 'B2G') {
     SpecialPowers.Cu.import("resource://gre/modules/Keyboard.jsm", this);
   }
 
-  let permissions = [];
-  ['input', 'input-manage', 'browser'].forEach(function(name) {
-    permissions.push({
-      type: name,
-      allow: true,
-      context: document
-    });
-  });
-
-  SpecialPowers.pushPermissions(permissions, function() {
-    let prefs = [
-      ['dom.mozBrowserFramesEnabled', true],
-      // Enable navigator.mozInputMethod.
-      ['dom.mozInputMethod.enabled', true]
-    ];
-    SpecialPowers.pushPrefEnv({set: prefs}, function() {
-      SimpleTest.waitForFocus(callback);
-    });
+  let prefs = [
+    ['dom.mozBrowserFramesEnabled', true],
+    // Enable navigator.mozInputMethod.
+    ['dom.mozInputMethod.enabled', true]
+  ];
+  SpecialPowers.pushPrefEnv({set: prefs}, function() {
+    SimpleTest.waitForFocus(callback);
   });
 }
 
 function inputmethod_cleanup() {
   SpecialPowers.wrap(navigator.mozInputMethod).setActive(false);
   SimpleTest.finish();
 }
deleted file mode 100644
--- a/dom/inputmethod/mochitest/mochitest.ini
+++ /dev/null
@@ -1,38 +0,0 @@
-[DEFAULT]
-# Not supported on Android, bug 983015 for B2G emulator
-skip-if = (toolkit == 'android' || toolkit == 'gonk') || e10s
-support-files =
-  inputmethod_common.js
-  file_inputmethod.html
-  file_blank.html
-  file_test_app.html
-  file_test_sendkey_cancel.html
-  file_test_sms_app.html
-  file_test_sms_app_1066515.html
-
-[test_basic.html]
-[test_bug944397.html]
-[test_bug949059.html]
-[test_bug953044.html]
-[test_bug960946.html]
-[test_bug978918.html]
-[test_bug1026997.html]
-[test_bug1043828.html]
-[test_bug1059163.html]
-[test_bug1066515.html]
-[test_bug1175399.html]
-[test_bug1137557.html]
-[test_focus_blur_manage_events.html]
-[test_forward_hardware_key_to_ime.html]
-skip-if = buildapp != 'mulet'
-support-files =
-  bug1110030_helper.js
-  file_test_empty_app.html
-[test_input_registry_events.html]
-[test_sendkey_cancel.html]
-[test_setSupportsSwitching.html]
-[test_simple_manage_events.html]
-[test_sync_edit.html]
-[test_two_inputs.html]
-[test_two_selects.html]
-[test_unload.html]
--- a/dom/inputmethod/mochitest/test_basic.html
+++ b/dom/inputmethod/mochitest/test_basic.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=932145
 -->
 <head>
   <title>Basic test for InputMethod API.</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=932145">Mozilla Bug 932145</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 SimpleTest.requestFlakyTimeout("untriaged");
--- a/dom/inputmethod/mochitest/test_bug1026997.html
+++ b/dom/inputmethod/mochitest/test_bug1026997.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1026997
 -->
 <head>
   <title>SelectionChange on InputMethod API.</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1026997">Mozilla Bug 1026997</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 inputmethod_setup(function() {
--- a/dom/inputmethod/mochitest/test_bug1043828.html
+++ b/dom/inputmethod/mochitest/test_bug1043828.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1043828
 -->
 <head>
   <title>Basic test for Switching Keyboards.</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1043828">Mozilla Bug 1043828</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 SimpleTest.requestFlakyTimeout("untriaged");
@@ -81,55 +81,44 @@ function runTest() {
 
     keyboardB = document.createElement('iframe');
     keyboardB.setAttribute('mozbrowser', true);
     document.body.appendChild(keyboardB);
 
     // simulate two different keyboard apps
     let imeUrl = basePath + '/file_blank.html';
 
-    SpecialPowers.pushPermissions([{
-      type: 'input',
-      allow: true,
-      context: {
-        url: imeUrl,
-        originAttributes: {
-          inIsolatedMozBrowser: true
-        }
-      }
-    }], function() {
-      keyboardA.src = imeUrl;
-      keyboardB.src = imeUrl;
+    keyboardA.src = imeUrl;
+    keyboardB.src = imeUrl;
 
-      var handler = {
-        handleEvent: function(){
-          keyboardB.removeEventListener('mozbrowserloadend', this);
+    var handler = {
+      handleEvent: function(){
+        keyboardB.removeEventListener('mozbrowserloadend', this);
 
-          mmKeyboardB = SpecialPowers.getBrowserFrameMessageManager(keyboardB);
+        mmKeyboardB = SpecialPowers.getBrowserFrameMessageManager(keyboardB);
+
+        mmKeyboardB.loadFrameScript('data:,(' + kbFrameScript.toString() + ')();', false);
 
-          mmKeyboardB.loadFrameScript('data:,(' + kbFrameScript.toString() + ')();', false);
-
-          mmKeyboardB.addMessageListener('test:InputMethod:getText:Resolve', function() {
-            info('getText() was resolved');
-            inputmethod_cleanup();
-          });
+        mmKeyboardB.addMessageListener('test:InputMethod:getText:Resolve', function() {
+          info('getText() was resolved');
+          inputmethod_cleanup();
+        });
 
-          mmKeyboardB.addMessageListener('test:InputMethod:getText:Reject', function() {
-            ok(false, 'getText() was rejected');
-            inputmethod_cleanup();
-          });
+        mmKeyboardB.addMessageListener('test:InputMethod:getText:Reject', function() {
+          ok(false, 'getText() was rejected');
+          inputmethod_cleanup();
+        });
 
-          setTimeout(function(){
-            step2();
-          }, WAIT_TIME);
-        }
-      };
+        setTimeout(function(){
+          step2();
+        }, WAIT_TIME);
+      }
+    };
 
-      keyboardB.addEventListener('mozbrowserloadend', handler);
-    });
+    keyboardB.addEventListener('mozbrowserloadend', handler);
   }
 
   // STEP 2: Set keyboard A active
   function step2() {
     info('step2');
     let req = keyboardA.setInputMethodActive(true);
 
     req.onsuccess = function(){
--- a/dom/inputmethod/mochitest/test_bug1059163.html
+++ b/dom/inputmethod/mochitest/test_bug1059163.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1059163
 -->
 <head>
   <title>Basic test for repeat sendKey events</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1059163">Mozilla Bug 1059163</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 inputmethod_setup(function() {
   runTest();
@@ -41,19 +41,20 @@ function appFrameScript() {
 function runTest() {
   let im = navigator.mozInputMethod;
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
 
   // Create an app frame to recieve keyboard inputs.
   let app = document.createElement('iframe');
-  app.src = 'data:text/html,<html><body><div id="text" contenteditable>Jan Jongboom</div></html>';
+  app.src = 'file_test_bug1066515.html';
   app.setAttribute('mozbrowser', true);
   document.body.appendChild(app);
+
   app.addEventListener('mozbrowserloadend', function() {
     let mm = SpecialPowers.getBrowserFrameMessageManager(app);
     mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
 
     im.oninputcontextchange = function() {
       is(im.inputcontext.type, 'contenteditable', 'type');
       is(im.inputcontext.inputType, 'textarea', 'inputType');
 
--- a/dom/inputmethod/mochitest/test_bug1066515.html
+++ b/dom/inputmethod/mochitest/test_bug1066515.html
@@ -1,19 +1,19 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1066515
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1066515</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1066515">Mozilla Bug 1066515</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 // The input context.
--- a/dom/inputmethod/mochitest/test_bug1137557.html
+++ b/dom/inputmethod/mochitest/test_bug1137557.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1137557
 -->
 <head>
   <title>Test for new API arguments accepting D3E properties</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1137557">Mozilla Bug 1137557</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 inputmethod_setup(function() {
@@ -1729,17 +1729,17 @@ function runRepeatTests() {
 
 function runTest() {
   let im = navigator.mozInputMethod;
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body><textarea rows=30 cols=30></textarea></body></html>';
+  iframe.src = 'file_test_bug1137557.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
 
   iframe.addEventListener('mozbrowserloadend', function() {
     mm.addMessageListener('test:eventDetail', function(msg) {
       gEventDetails.push(msg.data);
--- a/dom/inputmethod/mochitest/test_bug1175399.html
+++ b/dom/inputmethod/mochitest/test_bug1175399.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1175399
 -->
 <head>
   <title>Test focus when page unloads</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1175399">Mozilla Bug 1175399</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 inputmethod_setup(function() {
@@ -30,17 +30,17 @@ let appFrameScript = function appFrameSc
 
 function runTest() {
   let im = navigator.mozInputMethod;
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body><input value="First" readonly></body></html>';
+  iframe.src = 'file_test_bug1175399.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
   im.oninputcontextchange = function() {
     is(false, 'should not receive inputcontextchange event');
   };
 
--- a/dom/inputmethod/mochitest/test_bug944397.html
+++ b/dom/inputmethod/mochitest/test_bug944397.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=944397
 -->
 <head>
   <title>Basic test for InputMethod API.</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=944397">Mozilla Bug 944397</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 SimpleTest.requestFlakyTimeout("untriaged");
@@ -68,43 +68,32 @@ function runTest() {
     // STEP 2a: Create a browser frame to load the input method app.
     keyboard = document.createElement('iframe');
     keyboard.setAttribute('mozbrowser', true);
     document.body.appendChild(keyboard);
 
     // STEP 2b: Grant input privileges to the keyboard iframe
     let imeUrl = basePath + '/file_inputmethod.html#data';
 
-    SpecialPowers.pushPermissions([{
-      type: 'input',
-      allow: true,
-      context: {
-        url: imeUrl,
-        originAttributes: {
-          inIsolatedMozBrowser: true
-        }
-      }
-    }], function() {
-      // STEP 2c: Tell Gecko to use this iframe as its keyboard app
-      let req = keyboard.setInputMethodActive(true);
+    // STEP 2c: Tell Gecko to use this iframe as its keyboard app
+    let req = keyboard.setInputMethodActive(true);
+
+    req.onsuccess = function() {
+      ok(true, 'setInputMethodActive succeeded.');
+    };
 
-      req.onsuccess = function() {
-        ok(true, 'setInputMethodActive succeeded.');
-      };
+    req.onerror = function() {
+      ok(false, 'setInputMethodActive failed: ' + this.error.name);
+      inputmethod_cleanup();
+    };
 
-      req.onerror = function() {
-        ok(false, 'setInputMethodActive failed: ' + this.error.name);
-        inputmethod_cleanup();
-      };
-
-      // STEP 3: Loads the input method app to the browser frame after a delay.
-      setTimeout(function() {
-        keyboard.src = imeUrl;
-      }, 100);
-    });
+    // STEP 3: Loads the input method app to the browser frame after a delay.
+    setTimeout(function() {
+      keyboard.src = imeUrl;
+    }, 100);
   }
 
   function step4(val) {
     ok(true, 'Keyboard input was received.');
     is(val, '#dataYuan', 'Input value');
     inputmethod_cleanup();
   }
 
--- a/dom/inputmethod/mochitest/test_bug949059.html
+++ b/dom/inputmethod/mochitest/test_bug949059.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=949059
 -->
 <head>
   <title>Test "mgmt" property of MozInputMethod.</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=949059">Mozilla Bug 949059</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 inputmethod_setup(function() {
--- a/dom/inputmethod/mochitest/test_bug953044.html
+++ b/dom/inputmethod/mochitest/test_bug953044.html
@@ -1,18 +1,18 @@
 <!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="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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() {
--- a/dom/inputmethod/mochitest/test_bug960946.html
+++ b/dom/inputmethod/mochitest/test_bug960946.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=960946
 -->
 <head>
   <title>Basic test for repeat sendKey events</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=960946">Mozilla Bug 960946</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 // The input context.
--- a/dom/inputmethod/mochitest/test_bug978918.html
+++ b/dom/inputmethod/mochitest/test_bug978918.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=978918
 -->
 <head>
   <title>Basic test for InputMethod API.</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=978918">Mozilla Bug 978918</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 // The input context.
--- a/dom/inputmethod/mochitest/test_focus_blur_manage_events.html
+++ b/dom/inputmethod/mochitest/test_focus_blur_manage_events.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1201407
 -->
 <head>
   <title>Test inputcontextfocus and inputcontextblur event</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1201407">Mozilla Bug 1201407</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 let contentFrameMM;
@@ -128,40 +128,31 @@ function setupInputAppFrame() {
 
     let path = location.pathname;
     let basePath = location.protocol + '//' + location.host +
                  path.substring(0, path.lastIndexOf('/'));
     let imeUrl = basePath + '/file_blank.html';
 
     let inputAppFrame = document.createElement('iframe');
     inputAppFrame.setAttribute('mozbrowser', true);
+    // FIXME: Bug 1270790
+    inputAppFrame.setAttribute('remote', true);
     inputAppFrame.src = imeUrl;
     document.body.appendChild(inputAppFrame);
 
-    SpecialPowers.pushPermissions([{
-      type: 'input',
-      allow: true,
-      context: {
-        url: imeUrl,
-        originAttributes: {
-          inIsolatedMozBrowser: true
-        }
-      }
-    }], function() {
-      let mm = SpecialPowers.getBrowserFrameMessageManager(inputAppFrame);
-      inputAppFrame.addEventListener('mozbrowserloadend', function() {
-        mm.addMessageListener('text:appEvent', function(msg) {
-          ok(false, 'Input app should not receive ' + msg.data.type + ' event.');
-        });
-        mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
+    let mm = SpecialPowers.getBrowserFrameMessageManager(inputAppFrame);
+    inputAppFrame.addEventListener('mozbrowserloadend', function() {
+      mm.addMessageListener('text:appEvent', function(msg) {
+        ok(false, 'Input app should not receive ' + msg.data.type + ' event.');
+      });
+      mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
 
-        // Set the input app frame to be active
-        let req = inputAppFrame.setInputMethodActive(true);
-        resolve(req);
-      });
+      // Set the input app frame to be active
+      let req = inputAppFrame.setInputMethodActive(true);
+      resolve(req);
     });
   });
 }
 
 function setupContentFrame() {
   info('setupContentFrame');
   return new Promise((resolve, reject) => {
     let contentFrameScript = function contentFrameScript() {
@@ -172,38 +163,17 @@ function setupContentFrame() {
       input.focus();
 
       addMessageListener('test:next', function() {
         content.document.body.children[++i].focus();
       });
     };
 
     let iframe = document.createElement('iframe');
-    iframe.src = 'data:text/html,<html><body>' +
-      '<input type="text">' +
-      '<input type="search">' +
-      '<textarea></textarea>' +
-      '<p contenteditable></p>' +
-      '<input type="number">' +
-      '<input type="tel">' +
-      '<input type="url">' +
-      '<input type="email">' +
-      '<input type="password">' +
-      '<input type="datetime">' +
-      '<input type="date" value="2015-08-03" min="1990-01-01" max="2020-01-01">' +
-      '<input type="month">' +
-      '<input type="week">' +
-      '<input type="time">' +
-      '<input type="datetime-local">' +
-      '<input type="color">' +
-      '<select><option selected>foo</option><option disabled>bar</option>' +
-        '<optgroup label="group"><option>baz</option></optgroup></select>' +
-      '<select multiple><option selected>foo</option><option disabled>bar</option>' +
-        '<optgroup label="group"><option>baz</option></optgroup></select>' +
-      '</body></html>';
+    iframe.src = 'file_test_focus_blur_manage_events.html';
     iframe.setAttribute('mozbrowser', true);
     document.body.appendChild(iframe);
 
     let mm = contentFrameMM =
       SpecialPowers.getBrowserFrameMessageManager(iframe);
 
     iframe.addEventListener('mozbrowserloadend', function() {
       mm.loadFrameScript('data:,(' + encodeURIComponent(contentFrameScript.toString()) + ')();', false);
--- a/dom/inputmethod/mochitest/test_forward_hardware_key_to_ime.html
+++ b/dom/inputmethod/mochitest/test_forward_hardware_key_to_ime.html
@@ -1,21 +1,21 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1110030
 -->
 <head>
   <title>Forwarding Hardware Key to InputMethod</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/NativeKeyCodes.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"></script>
   <script type="text/javascript" src="bug1110030_helper.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <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=1110030">Mozilla Bug 1110030</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 // The input context.
 var gContext = null;
--- a/dom/inputmethod/mochitest/test_input_registry_events.html
+++ b/dom/inputmethod/mochitest/test_input_registry_events.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1201407
 -->
 <head>
   <title>Test addinputrequest and removeinputrequest event</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1201407">Mozilla Bug 1201407</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 let appFrameMM;
@@ -57,46 +57,37 @@ function setupInputAppFrame() {
 
     let path = location.pathname;
     let basePath = location.protocol + '//' + location.host +
                  path.substring(0, path.lastIndexOf('/'));
     let imeUrl = basePath + '/file_blank.html';
 
     let inputAppFrame = document.createElement('iframe');
     inputAppFrame.setAttribute('mozbrowser', true);
+    // FIXME: Bug 1270790
+    inputAppFrame.setAttribute('remote', true);
     inputAppFrame.src = imeUrl;
     document.body.appendChild(inputAppFrame);
 
-    SpecialPowers.pushPermissions([{
-      type: 'input',
-      allow: true,
-      context: {
-        url: imeUrl,
-        originAttributes: {
-          inIsolatedMozBrowser: true
-        }
-      }
-    }], function() {
-      let mm = appFrameMM =
-        SpecialPowers.getBrowserFrameMessageManager(inputAppFrame);
+    let mm = appFrameMM =
+      SpecialPowers.getBrowserFrameMessageManager(inputAppFrame);
 
-      inputAppFrame.addEventListener('mozbrowserloadend', function() {
-        mm.addMessageListener('test:appEvent', function(msg) {
-          ok(false, 'Input app should not receive ' + msg.data.type + ' event.');
-        });
-        mm.addMessageListener('test:resolved', function(msg) {
-          nextStep && nextStep(msg.data);
-        });
-        mm.addMessageListener('test:rejected', function(msg) {
-          nextStep && nextStep(msg.data);
-        });
-        mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
+    inputAppFrame.addEventListener('mozbrowserloadend', function() {
+      mm.addMessageListener('test:appEvent', function(msg) {
+        ok(false, 'Input app should not receive ' + msg.data.type + ' event.');
+      });
+      mm.addMessageListener('test:resolved', function(msg) {
+        nextStep && nextStep(msg.data);
+      });
+      mm.addMessageListener('test:rejected', function(msg) {
+        nextStep && nextStep(msg.data);
+      });
+      mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
 
-        resolve();
-      });
+      resolve();
     });
   });
 }
 
 function Deferred() {
   this.promise = new Promise((res, rej) => {
     this.resolve = res;
     this.reject = rej;
--- a/dom/inputmethod/mochitest/test_sendkey_cancel.html
+++ b/dom/inputmethod/mochitest/test_sendkey_cancel.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=952080
 -->
 <head>
   <title>SendKey with canceled keydown test for InputMethod API.</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=952080">Mozilla Bug 952080</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 // The input context.
--- a/dom/inputmethod/mochitest/test_setSupportsSwitching.html
+++ b/dom/inputmethod/mochitest/test_setSupportsSwitching.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1197682
 -->
 <head>
   <title>Test inputcontext#inputType and MozInputMethodManager#supportsSwitching()</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1197682">Mozilla Bug 1197682</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 inputmethod_setup(function() {
@@ -108,21 +108,17 @@ function runTest() {
   };
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
   // Set text and password inputs as supports switching (and not supported for number type)
   im.mgmt.setSupportsSwitchingTypes(['text', 'password']);
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body>' +
-    '<input type="text">' +
-    '<input type="number">' +
-    '<input type="password">' +
-    '</body></html>';
+  iframe.src = 'file_test_setSupportsSwitching.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
 
   iframe.addEventListener('mozbrowserloadend', function() {
     mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
   });
--- a/dom/inputmethod/mochitest/test_simple_manage_events.html
+++ b/dom/inputmethod/mochitest/test_simple_manage_events.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1201407
 -->
 <head>
   <title>Test simple manage notification events on MozInputMethodManager</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1201407">Mozilla Bug 1201407</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 let appFrameMM;
@@ -93,55 +93,44 @@ function setupInputAppFrame() {
                  path.substring(0, path.lastIndexOf('/'));
     let imeUrl = basePath + '/file_blank.html';
 
     let inputAppFrame = document.createElement('iframe');
     inputAppFrame.setAttribute('mozbrowser', true);
     inputAppFrame.src = imeUrl;
     document.body.appendChild(inputAppFrame);
 
-    SpecialPowers.pushPermissions([{
-      type: 'input',
-      allow: true,
-      context: {
-        url: imeUrl,
-        originAttributes: {
-          inIsolatedMozBrowser: true
-        }
-      }
-    }], function() {
-      let mm = appFrameMM =
-        SpecialPowers.getBrowserFrameMessageManager(inputAppFrame);
+    let mm = appFrameMM =
+      SpecialPowers.getBrowserFrameMessageManager(inputAppFrame);
 
-      inputAppFrame.addEventListener('mozbrowserloadend', function() {
-        mm.addMessageListener('test:appEvent', function(msg) {
-          ok(false, 'Input app should not receive ' + msg.data.type + ' event.');
-        });
-        mm.addMessageListener('test:inputcontextchange', function(msg) {
-          nextStep && nextStep({ type: 'inputcontextchange' });
-        });
-        mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
+    inputAppFrame.addEventListener('mozbrowserloadend', function() {
+      mm.addMessageListener('test:appEvent', function(msg) {
+        ok(false, 'Input app should not receive ' + msg.data.type + ' event.');
+      });
+      mm.addMessageListener('test:inputcontextchange', function(msg) {
+        nextStep && nextStep({ type: 'inputcontextchange' });
+      });
+      mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
 
-        // Set the input app frame to be active
-        let req = inputAppFrame.setInputMethodActive(true);
-        resolve(req);
-      });
+      // Set the input app frame to be active
+      let req = inputAppFrame.setInputMethodActive(true);
+      resolve(req);
     });
   });
 }
 
 function setupContentFrame() {
   let contentFrameScript = function contentFrameScript() {
     let input = content.document.body.firstElementChild;
 
     input.focus();
   };
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body><input type="text"></body></html>';
+  iframe.src = 'file_test_simple_manage_events.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
 
   iframe.addEventListener('mozbrowserloadend', function() {
     mm.loadFrameScript('data:,(' + encodeURIComponent(contentFrameScript.toString()) + ')();', false);
   });
--- a/dom/inputmethod/mochitest/test_sync_edit.html
+++ b/dom/inputmethod/mochitest/test_sync_edit.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1079455
 -->
 <head>
   <title>Sync edit of an input</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1079455">Mozilla Bug 1079455</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 inputmethod_setup(function() {
@@ -59,17 +59,17 @@ function runTest() {
         inputmethod_cleanup();
     }
   };
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body><input value="First"></body></html>';
+  iframe.src = 'file_test_sync_edit.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
   iframe.addEventListener('mozbrowserloadend', function() {
     mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
   });
 }
--- a/dom/inputmethod/mochitest/test_two_inputs.html
+++ b/dom/inputmethod/mochitest/test_two_inputs.html
@@ -1,19 +1,19 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1057898
 https://bugzilla.mozilla.org/show_bug.cgi?id=952741
 -->
 <head>
   <title>Test switching between two inputs</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1057898">Mozilla Bug 1057898</a>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=952741">Mozilla Bug 952741</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
@@ -161,17 +161,17 @@ function runTest() {
         break;
     }
   };
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body><input value="First"><input value="Second"></body></html>';
+  iframe.src = 'file_test_two_inputs.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
 
   iframe.addEventListener('mozbrowserloadend', function() {
     mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
   });
--- a/dom/inputmethod/mochitest/test_two_selects.html
+++ b/dom/inputmethod/mochitest/test_two_selects.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1079728
 -->
 <head>
   <title>Test switching between two inputs</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1079728">Mozilla Bug 1079728</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 inputmethod_setup(function() {
@@ -159,17 +159,17 @@ function runTest() {
         break;
     }
   };
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body><select><option>First</option></select><select><option>Second</option></select></html>';
+  iframe.src = 'file_test_two_selects.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
 
   iframe.addEventListener('mozbrowserloadend', function() {
     mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
   });
--- a/dom/inputmethod/mochitest/test_unload.html
+++ b/dom/inputmethod/mochitest/test_unload.html
@@ -1,19 +1,19 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1122463
 https://bugzilla.mozilla.org/show_bug.cgi?id=820057
 -->
 <head>
   <title>Test focus when page unloads</title>
-  <script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <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="/tests/SimpleTest/test.css"/>
+  <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=1122463">Mozilla Bug 1122463</a>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=820057">Mozilla Bug 820057</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
@@ -27,17 +27,17 @@ let appFrameScript = function appFrameSc
   let submit1 = form1.lastElementChild;
   let input2;
 
   let cancelSubmit = function(evt) {
     evt.preventDefault();
   };
 
   // Content of the second page.
-  form1.action = 'data:text/html,<html><body><input value="Second"></body></html>';
+  form1.action = 'file_test_unload_action.html';
 
   let i = 1;
 
   input1.focus();
 
   addMessageListener('test:next', function() {
     i++;
     switch (i) {
@@ -137,17 +137,17 @@ function runTest() {
         break;
     }
   }
 
   // Set current page as an input method.
   SpecialPowers.wrap(im).setActive(true);
 
   let iframe = document.createElement('iframe');
-  iframe.src = 'data:text/html,<html><body><form id="form"><input value="First"><input type="submit"></form></body></html>';
+  iframe.src = 'file_test_unload.html';
   iframe.setAttribute('mozbrowser', true);
   document.body.appendChild(iframe);
 
   let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
   im.oninputcontextchange = nextStep;
 
   let frameScriptLoaded = false;
   iframe.addEventListener('mozbrowserloadend', function() {
--- a/dom/inputmethod/moz.build
+++ b/dom/inputmethod/moz.build
@@ -33,9 +33,9 @@ EXTRA_COMPONENTS += [
 ]
 
 EXTRA_PP_JS_MODULES += [
     'Keyboard.jsm',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
-MOCHITEST_MANIFESTS += ['mochitest/mochitest.ini']
+MOCHITEST_CHROME_MANIFESTS += ['mochitest/chrome.ini']