Bug 1269209 - Port test_bug366682.html from chrome to plain; r=masayuki
☠☠ backed out by d1e5c08797c2 ☠ ☠
authorAryeh Gregor <ayg@aryeh.name>
Mon, 22 Aug 2016 21:11:37 +0300
changeset 319738 ecf28a55600faef6f2b2451692f05aa82309bd9d
parent 319737 cea0421beffa3dde557dfd1edc1a780e7a0fbd92
child 319739 a3d0e9ed7d8565655fa6894f8b315c30decd19e8
push id20748
push userphilringnalda@gmail.com
push dateFri, 28 Oct 2016 03:39:55 +0000
treeherderfx-team@715360440695 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1269209, 366682
milestone52.0a1
Bug 1269209 - Port test_bug366682.html from chrome to plain; r=masayuki MozReview-Commit-ID: EB8je1gkEwM
editor/libeditor/tests/chrome.ini
editor/libeditor/tests/mochitest.ini
editor/libeditor/tests/test_bug366682.html
--- a/editor/libeditor/tests/chrome.ini
+++ b/editor/libeditor/tests/chrome.ini
@@ -1,14 +1,12 @@
 [DEFAULT]
 skip-if = buildapp == 'b2g' || os == 'android'
 support-files = green.png
 
-[test_bug366682.html]
-support-files = spellcheck.js
 [test_bug471319.html]
 [test_bug483651.html]
 [test_bug489202.xul]
 [test_bug490879.xul]
 subsuite = clipboard
 [test_bug569988.html]
 skip-if = buildapp == 'mulet'
 [test_bug599983.xul]
--- a/editor/libeditor/tests/mochitest.ini
+++ b/editor/libeditor/tests/mochitest.ini
@@ -20,16 +20,17 @@ support-files =
 skip-if = os != "mac"
 [test_bug290026.html]
 [test_bug291780.html]
 [test_bug309731.html]
 [test_bug316447.html]
 [test_bug318065.html]
 [test_bug332636.html]
 support-files = test_bug332636.html^headers^
+[test_bug366682.html]
 [test_bug372345.html]
 skip-if = toolkit == 'android'
 [test_bug404320.html]
 [test_bug408231.html]
 skip-if = toolkit == 'android'
 [test_bug410986.html]
 subsuite = clipboard
 skip-if = toolkit == 'android'
--- a/editor/libeditor/tests/test_bug366682.html
+++ b/editor/libeditor/tests/test_bug366682.html
@@ -1,18 +1,18 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=366682
 -->
 <head>
   <title>Test for Bug 366682</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
+  <script src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="spellcheck.js"></script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=366682">Mozilla Bug 366682</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
@@ -29,32 +29,33 @@ function getEdit() {
   return document.getElementById('edit');
 }
 
 function editDoc() {
   return getEdit().contentDocument;
 }
 
 function getEditor() {
-  var Ci = Components.interfaces;
+  var Ci = SpecialPowers.Ci;
   var win = editDoc().defaultView;
-  var editingSession = win.QueryInterface(Ci.nsIInterfaceRequestor)
-                          .getInterface(Ci.nsIWebNavigation)
-                          .QueryInterface(Ci.nsIInterfaceRequestor)
-                          .getInterface(Ci.nsIEditingSession);
+  var editingSession = SpecialPowers.wrap(win)
+    .QueryInterface(Ci.nsIInterfaceRequestor)
+    .getInterface(Ci.nsIWebNavigation)
+    .QueryInterface(Ci.nsIInterfaceRequestor)
+    .getInterface(Ci.nsIEditingSession);
   return editingSession.getEditorForWindow(win);
 }
 
 function runTest() {
   editDoc().body.innerHTML = "<div>errror and an other errror</div>";
   gMisspeltWords = ["errror", "errror"];
   editDoc().designMode = "on";
 
-  Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
-  onSpellCheck(editDoc().documentElement, evalTest);
+  SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
+               .onSpellCheck(editDoc().documentElement, evalTest);
 }
 
 function evalTest() {
   ok(isSpellingCheckOk(getEditor(), gMisspeltWords),
      "All misspellings accounted for.");
   SimpleTest.finish();
 }
 </script>