Bug 1269209 - Port test_async_UpdateCurrentDictionary.html from chrome to plain; r?masayuki
MozReview-Commit-ID: 3dneNqKrYCe
--- 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,15 @@ 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]
[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";