Bug 1269209 - Port test_bug338427.html from chrome to plain; r?masayuki
MozReview-Commit-ID: HiDXAKaZlQA
--- 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");