Backed out changeset 19eb42e6b3eb (bug 1269209)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 28 Oct 2016 00:38:38 +0200
changeset 319776 423f556eda8c0860136125f62b9944d196856530
parent 319775 83b80367c29c497b5963316258d88292d16b09aa
child 319777 4eefe302ced5bf7f7008e94e9436778bafee14af
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)
bugs1269209
milestone52.0a1
backs out19eb42e6b3eb8db48f6c81bdf95c30d1c9125592
Backed out changeset 19eb42e6b3eb (bug 1269209) MozReview-Commit-ID: 6JC2Zy7luDl
editor/composer/test/chrome.ini
editor/composer/test/mochitest.ini
editor/composer/test/test_bug697981.html
--- a/editor/composer/test/chrome.ini
+++ b/editor/composer/test/chrome.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 skip-if = buildapp == 'b2g' || os == 'android'
 
 [test_bug434998.xul]
+[test_bug697981.html]
 [test_bug717433.html]
 [test_bug1204147.html]
 [test_bug1200533.html]
 [test_bug1205983.html]
 [test_bug1209414.html]
 [test_bug1219928.html]
 [test_bug1266815.html]
--- a/editor/composer/test/mochitest.ini
+++ b/editor/composer/test/mochitest.ini
@@ -16,10 +16,9 @@ support-files =
 [test_async_UpdateCurrentDictionary.html]
 [test_bug338427.html]
 [test_bug348497.html]
 [test_bug384147.html]
 [test_bug389350.html]
 skip-if = toolkit == 'android'
 [test_bug519928.html]
 [test_bug678842.html]
-[test_bug697981.html]
 [test_bug738440.html]
--- a/editor/composer/test/test_bug697981.html
+++ b/editor/composer/test/test_bug697981.html
@@ -1,73 +1,66 @@
 <!DOCTYPE html>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=697981
 -->
 <head>
   <title>Test for Bug 697981</title>
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
+  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.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=697981">Mozilla Bug 697981</a>
 <p id="display"></p>
 </div>
 
 <textarea id="de-DE" lang="de-DE" onfocus="deFocus()">German heute ist ein guter Tag</textarea>
 <textarea id="en-US" lang="en-US" onfocus="enFocus()">Nogoodword today is a nice day</textarea>
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function getMisspelledWords(editor) {
-  return editor.selectionController.getSelection(SpecialPowers.Ci.nsISelectionController.SELECTION_SPELLCHECK).toString();
+  return editor.selectionController.getSelection(Components.interfaces.nsISelectionController.SELECTION_SPELLCHECK).toString();
 }
 
 var elem_de;
 var editor_de;
-var script;
-
-var onSpellCheck =
-  SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
-               .onSpellCheck;
+var de_DE;
+var hunspell;
 
 /** Test for Bug 697981 **/
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(function() {
-  script = SpecialPowers.loadChromeScript(function() {
-    var dir = Components.classes["@mozilla.org/file/directory_service;1"]
-                        .getService(Components.interfaces.nsIProperties)
-                        .get("CurWorkD", Components.interfaces.nsIFile);
-    dir.append("tests");
-    dir.append("editor");
-    dir.append("composer");
-    dir.append("test");
+  Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
 
-    var hunspell = Components.classes["@mozilla.org/spellchecker/engine;1"]
-                             .getService(Components.interfaces.mozISpellCheckingEngine);
+  var dir = Components.classes["@mozilla.org/file/directory_service;1"]
+                      .getService(Components.interfaces.nsIProperties)
+                      .get("CurWorkD", Components.interfaces.nsIFile);
+  dir.append("tests");
+  dir.append("editor");
+  dir.append("composer");
+  dir.append("test");
 
-    // Install de-DE dictionary.
-    var de_DE = dir.clone();
-    de_DE.append("de-DE");
-    hunspell.addDirectory(de_DE);
+  hunspell = Components.classes["@mozilla.org/spellchecker/engine;1"]
+                       .getService(Components.interfaces.mozISpellCheckingEngine);
 
-    addMessageListener("de_DE-exists", () => de_DE.exists());
-    addMessageListener("destroy", () => hunspell.removeDirectory(de_DE));
-  });
-  is(script.sendSyncMessage("de_DE-exists")[0][0], true,
-     "true expected (de_DE directory should exist)");
+  // Install de-DE dictionary.
+  de_DE = dir.clone();
+  de_DE.append("de-DE");
+  is(de_DE.exists(), true, "true expected (de_DE directory should exist)");
+  hunspell.addDirectory(de_DE);
 
   document.getElementById('de-DE').focus();
 });
 
 function deFocus() {
   elem_de = document.getElementById('de-DE');
-  editor_de = SpecialPowers.wrap(elem_de).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor;
+  editor_de = elem_de.QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
   editor_de.setSpellcheckUserOverride(true);
   var inlineSpellChecker = editor_de.getInlineSpellChecker(true);
 
   onSpellCheck(elem_de, function () {
     var spellchecker = inlineSpellChecker.spellChecker;
     try {
       var currentDictonary = spellchecker.GetCurrentDictionary();
     } catch(e) {}
@@ -78,17 +71,17 @@ function deFocus() {
 
     // Now focus the other textarea, which requires English spelling.
     document.getElementById('en-US').focus();
   });
 }
 
 function enFocus() {
   var elem_en = document.getElementById('en-US');
-  var editor_en = SpecialPowers.wrap(elem_en).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor;
+  var editor_en = elem_en.QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
   editor_en.setSpellcheckUserOverride(true);
   var inlineSpellChecker = editor_en.getInlineSpellChecker(true);
 
   onSpellCheck(elem_en, function () {
     var spellchecker = inlineSpellChecker.spellChecker;
     try {
       currentDictonary = spellchecker.GetCurrentDictionary();
     } catch(e) {}
@@ -98,17 +91,17 @@ function enFocus() {
     is(getMisspelledWords(editor_en), "Nogoodword", "one misspelled word expected: Nogoodword");
 
     // So far all was boring. The important thing is whether the spell check result
     // in the de-DE editor is still the same. After losing focus, no spell check
     // updates should take place there.
     is(getMisspelledWords(editor_de), "German", "one misspelled word expected: German");
 
     // Remove the fake de_DE dictionary again.
-    script.sendSyncMessage("destroy");
+    hunspell.removeDirectory(de_DE);
 
     // Focus again, so the spelling gets updated, but before we need to kill the focus handler.
     elem_de.onfocus = null;
     elem_de.blur();
     elem_de.focus();
 
     // After removal, the de_DE editor should refresh the spelling with en-US.
     onSpellCheck(elem_de, function () {