Bug 1269209 - Port test_bug338427.html from chrome to plain; r=masayuki
authorAryeh Gregor <ayg@aryeh.name>
Mon, 31 Oct 2016 18:06:46 +0200
changeset 347257 1ef54328003acde85d1283ab5523e1524c16c0fc
parent 347256 8e7f4f0b0ebb294b3604a50e6b634aa376120114
child 347258 4bc05800d117587c7fcd73e79849bb91dd3805b3
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1269209, 338427
milestone52.0a1
Bug 1269209 - Port test_bug338427.html from chrome to plain; r=masayuki MozReview-Commit-ID: HiDXAKaZlQA
editor/composer/test/chrome.ini
editor/composer/test/mochitest.ini
editor/composer/test/test_bug338427.html
--- a/editor/composer/test/chrome.ini
+++ b/editor/composer/test/chrome.ini
@@ -1,12 +1,11 @@
 [DEFAULT]
 skip-if = buildapp == 'b2g' || os == 'android'
 
-[test_bug338427.html]
 [test_bug434998.xul]
 [test_bug678842.html]
 [test_bug697981.html]
 [test_bug717433.html]
 [test_bug1204147.html]
 [test_bug1200533.html]
 [test_bug1205983.html]
 [test_bug1209414.html]
--- a/editor/composer/test/mochitest.ini
+++ b/editor/composer/test/mochitest.ini
@@ -10,14 +10,16 @@ support-files =
   en-GB/en_GB.aff
   en-AU/en_AU.dic
   en-AU/en_AU.aff
   de-DE/de_DE.dic
   de-DE/de_DE.aff
 
 [test_async_UpdateCurrentDictionary.html]
 skip-if = os == 'android'
+[test_bug338427.html]
+skip-if = os == 'android'
 [test_bug348497.html]
 [test_bug384147.html]
 [test_bug389350.html]
 skip-if = toolkit == 'android'
 [test_bug519928.html]
 [test_bug738440.html]
--- a/editor/composer/test/test_bug338427.html
+++ b/editor/composer/test/test_bug338427.html
@@ -1,34 +1,35 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=338427
 -->
 <head>
   <title>Test for Bug 338427</title>
-  <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" />
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=338427">Mozilla Bug 338427</a>
 <p id="display"></p>
 <div id="content">
 <textarea id="editor" lang="testing-XX" spellcheck="true"></textarea>
 
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 338427 **/
 function init() {
-    Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
-
+    var onSpellCheck =
+      SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
+                   .onSpellCheck;
     var textarea = document.getElementById("editor");
-    var editor = textarea.editor;
+    var editor = SpecialPowers.wrap(textarea).editor;
     var spellchecker = editor.getInlineSpellChecker(true);
     spellchecker.enableRealTimeSpell = true;
     textarea.focus();
 
     onSpellCheck(textarea, function () {
         var list = {}, count = {};
         spellchecker.spellChecker.GetDictionaryList(list, count);
         ok(count.value > 0, "At least one dictionary should be present");