Bug 1269209 - Port test_bug338427.html from chrome to plain; r?masayuki draft
authorAryeh Gregor <ayg@aryeh.name>
Mon, 22 Aug 2016 21:02:11 +0300
changeset 430271 323910f5d69cfd67ca78b8b9ab4b9b05da5bd11c
parent 430270 122f8fe3c136d0a733958a63ff06fe8fd0455c71
child 430272 7ae16a4a2d7fca75801210854802f4d99b85b533
push id33793
push userayg@aryeh.name
push dateThu, 27 Oct 2016 13:30:40 +0000
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
@@ -9,14 +9,15 @@ support-files =
   en-GB/en_GB.dic
   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]
+[test_bug338427.html]
 [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");