Bug 1269209 - Port test_async_UpdateCurrentDictionary.html from chrome to plain; r=masayuki
authorAryeh Gregor <ayg@aryeh.name>
Mon, 22 Aug 2016 21:00:48 +0300
changeset 432252 8e7f4f0b0ebb294b3604a50e6b634aa376120114
parent 432251 6a381d07b7f1570fd1f9d9980aef58d1cf5b4785
child 432253 1ef54328003acde85d1283ab5523e1524c16c0fc
push id34240
push userbmo:ttromey@mozilla.com
push dateTue, 01 Nov 2016 14:41:32 +0000
reviewersmasayuki
bugs1269209
milestone52.0a1
Bug 1269209 - Port test_async_UpdateCurrentDictionary.html from chrome to plain; r=masayuki MozReview-Commit-ID: 3dneNqKrYCe
editor/composer/test/chrome.ini
editor/composer/test/mochitest.ini
editor/composer/test/test_async_UpdateCurrentDictionary.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_async_UpdateCurrentDictionary.html]
 [test_bug338427.html]
 [test_bug434998.xul]
 [test_bug678842.html]
 [test_bug697981.html]
 [test_bug717433.html]
 [test_bug1204147.html]
 [test_bug1200533.html]
 [test_bug1205983.html]
--- a/editor/composer/test/mochitest.ini
+++ b/editor/composer/test/mochitest.ini
@@ -8,14 +8,16 @@ support-files =
   bug1204147_subframe2.html
   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]
+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_async_UpdateCurrentDictionary.html
+++ b/editor/composer/test/test_async_UpdateCurrentDictionary.html
@@ -1,37 +1,37 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=856270
 -->
 <head>
   <title>Test for Bug 856270 - Async UpdateCurrentDictionary</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=856270">Mozilla Bug 856270</a>
 <p id="display"></p>
 <div id="content">
 <textarea id="editor" spellcheck="true"></textarea>
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript;version=1.8">
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(start);
 
 function start() {
-  Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
   var textarea = document.getElementById("editor");
   textarea.focus();
 
-  onSpellCheck(textarea, function () {
-    var isc = textarea.editor.getInlineSpellChecker(false);
+  SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
+  .onSpellCheck(textarea, function () {
+    var isc = SpecialPowers.wrap(textarea).editor.getInlineSpellChecker(false);
     ok(isc, "Inline spell checker should exist after focus and spell check");
     var sc = isc.spellChecker;
     isnot(sc.GetCurrentDictionary(), lang,
           "Current dictionary should not be set yet.");
 
     // First, set the lang attribute on the textarea, call Update, and make
     // sure the spell checker's language was updated appropriately.
     var lang = "en-US";