Backed out changeset dda3cfcd2b5c (bug 1269209)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 28 Oct 2016 00:38:34 +0200
changeset 319775 83b80367c29c497b5963316258d88292d16b09aa
parent 319774 4d44d784fa155136b064582e637c33bf9dff49de
child 319776 423f556eda8c0860136125f62b9944d196856530
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 outdda3cfcd2b5c96bc42b9ca481f21d0fa8fea63a7
Backed out changeset dda3cfcd2b5c (bug 1269209) MozReview-Commit-ID: BvcUYSfSJtR
editor/composer/test/chrome.ini
editor/composer/test/mochitest.ini
editor/composer/test/test_bug717433.html
--- a/editor/composer/test/chrome.ini
+++ b/editor/composer/test/chrome.ini
@@ -1,10 +1,11 @@
 [DEFAULT]
 skip-if = buildapp == 'b2g' || os == 'android'
 
 [test_bug434998.xul]
+[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
@@ -17,10 +17,9 @@ support-files =
 [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_bug717433.html]
 [test_bug738440.html]
--- a/editor/composer/test/test_bug717433.html
+++ b/editor/composer/test/test_bug717433.html
@@ -1,17 +1,17 @@
 <!DOCTYPE html>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=717433
 -->
 <head>
   <title>Test for Bug 717433</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=717433">Mozilla Bug 717433</a>
 <p id="display"></p>
 <iframe id="content"></iframe>
 
 </div>
 <pre id="test">
@@ -22,53 +22,48 @@ SimpleTest.waitForExplicitFinish();
 var content = document.getElementById('content');
 // Load a subframe containing an editor with language "en". At first
 // load, it will set the dictionary to en-GB or en-US. We set the other one.
 // At second load, it will return the current dictionary. We can check that the
 // dictionary is correctly remembered between loads.
 
 var firstLoad = true;
 var expected = "";
-var script;
+var en_GB;
+var hunspell;
 
 var loadListener = function(evt) {
+  Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
 
   if (firstLoad) {
-    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");
+    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");
 
-      var hunspell = Components.classes["@mozilla.org/spellchecker/engine;1"]
-                               .getService(Components.interfaces.mozISpellCheckingEngine);
+    hunspell = Components.classes["@mozilla.org/spellchecker/engine;1"]
+                         .getService(Components.interfaces.mozISpellCheckingEngine);
 
-      // Install en-GB dictionary.
-      var en_GB = dir.clone();
-      en_GB.append("en-GB");
-      hunspell.addDirectory(en_GB);
-
-      addMessageListener("en_GB-exists", () => en_GB.exists());
-      addMessageListener("destroy", () => hunspell.removeDirectory(en_GB));
-    });
-    is(script.sendSyncMessage("en_GB-exists")[0][0], true,
-       "true expected (en-GB directory should exist)");
+    // Install en-GB dictionary.
+    en_GB = dir.clone();
+    en_GB.append("en-GB");
+    is(en_GB.exists(), true, "true expected (en-GB directory should exist)");
+    hunspell.addDirectory(en_GB);
   }
 
   var doc = evt.target.contentDocument;
   var elem = doc.getElementById('textarea');
-  var editor = SpecialPowers.wrap(elem).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor;
+  var editor = elem.QueryInterface(Components.interfaces.nsIDOMNSEditableElement).editor;
   editor.setSpellcheckUserOverride(true);
   var inlineSpellChecker = editor.getInlineSpellChecker(true);
 
-  SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
-  .onSpellCheck(elem, function () {
+  onSpellCheck(elem, function () {
     var spellchecker = inlineSpellChecker.spellChecker;
     try {
       var currentDictonary = spellchecker.GetCurrentDictionary();
     } catch(e) {}
 
     if (firstLoad) {
       firstLoad = false;
 
@@ -83,17 +78,17 @@ var loadListener = function(evt) {
         is(true, false, "Neither en-US nor en-GB are current");
       }
       content.src = 'http://mochi.test:8888/tests/editor/composer/test/bug717433_subframe.html?firstload=false';
     } else {
       is(currentDictonary, expected, expected + " expected");
       content.removeEventListener('load', loadListener, false);
 
       // Remove the fake en-GB dictionary again, since it's otherwise picked up by later tests.
-      script.sendSyncMessage("destroy");
+      hunspell.removeDirectory(en_GB);
 
       // This will clear the content preferences and reset "spellchecker.dictionary".
       spellchecker.SetCurrentDictionary("");
       SimpleTest.finish();
     }
   });
 }