зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1351074 - Part 2. Use testing-common for AsyncSpellCheckTestHelper.jsm. r=masayuki
TESTING_JS_MODULES uses testing-common, not gre. So we should replace gre with testing-common for mochitest. MozReview-Commit-ID: BqsS2D3IGR6 --HG-- extra : rebase_source : 2143fcdf33c428c82c6b2e00b542649b958aeccc
This commit is contained in:
Родитель
8426259e4a
Коммит
cd8761e0f4
|
@ -17,7 +17,9 @@ function openContextMenuFor(element, shiftkey, waitForSpellCheck) {
|
|||
}
|
||||
|
||||
if (waitForSpellCheck) {
|
||||
var { onSpellCheck } = SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", {});
|
||||
var { onSpellCheck } =
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", {});
|
||||
onSpellCheck(element, actuallyOpenContextMenuFor);
|
||||
} else {
|
||||
actuallyOpenContextMenuFor();
|
||||
|
@ -278,7 +280,9 @@ function* test_contextmenu(selector, menuItems, options = {}) {
|
|||
if (options.waitForSpellCheck) {
|
||||
info("Waiting for spell check");
|
||||
yield ContentTask.spawn(gBrowser.selectedBrowser, selector, function*(contentSelector) {
|
||||
let {onSpellCheck} = Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", {});
|
||||
let {onSpellCheck} =
|
||||
Cu.import("resource://testing-common/AsyncSpellCheckTestHelper.jsm",
|
||||
{});
|
||||
let element = content.document.querySelector(contentSelector);
|
||||
yield new Promise(resolve => onSpellCheck(element, resolve));
|
||||
info("Spell check running");
|
||||
|
|
|
@ -24,7 +24,8 @@ function start() {
|
|||
var textarea = document.getElementById("editor");
|
||||
textarea.focus();
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/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");
|
||||
|
|
|
@ -101,7 +101,8 @@ function continueTest(evt) {
|
|||
editor.setSpellcheckUserOverride(true);
|
||||
var inlineSpellChecker = editor.getInlineSpellChecker(true);
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck(elem, function () {
|
||||
var spellchecker = inlineSpellChecker.spellChecker;
|
||||
try {
|
||||
|
|
|
@ -67,7 +67,8 @@ var loadListener = function(evt) {
|
|||
editor.setSpellcheckUserOverride(true);
|
||||
var inlineSpellChecker = editor.getInlineSpellChecker(true);
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck(elem, function () {
|
||||
var spellchecker = inlineSpellChecker.spellChecker;
|
||||
try {
|
||||
|
|
|
@ -29,8 +29,8 @@ var selcon_de;
|
|||
var script;
|
||||
|
||||
var onSpellCheck =
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck;
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm").onSpellCheck;
|
||||
|
||||
/** Test for Bug 1205983 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
|
|
@ -37,8 +37,8 @@ var script;
|
|||
*/
|
||||
|
||||
var onSpellCheck =
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck;
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm").onSpellCheck;
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(function() {
|
||||
|
|
|
@ -29,8 +29,8 @@ var spellchecker;
|
|||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(function() {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
|
||||
window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
|
||||
var elem = document.getElementById('en-US');
|
||||
elem.focus();
|
||||
|
|
|
@ -21,7 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338427
|
|||
/** Test for Bug 338427 **/
|
||||
function init() {
|
||||
var onSpellCheck =
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck;
|
||||
var textarea = document.getElementById("editor");
|
||||
var editor = SpecialPowers.wrap(textarea).editor;
|
||||
|
|
|
@ -60,7 +60,8 @@ var loadListener = function(evt) {
|
|||
editor.setSpellcheckUserOverride(true);
|
||||
var inlineSpellChecker = editor.getInlineSpellChecker(true);
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck(elem, function () {
|
||||
var spellchecker = inlineSpellChecker.spellChecker;
|
||||
try {
|
||||
|
|
|
@ -28,7 +28,8 @@ var editor_de;
|
|||
var script;
|
||||
|
||||
var onSpellCheck =
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck;
|
||||
|
||||
/** Test for Bug 697981 **/
|
||||
|
|
|
@ -62,7 +62,8 @@ var loadListener = function(evt) {
|
|||
editor.setSpellcheckUserOverride(true);
|
||||
var inlineSpellChecker = editor.getInlineSpellChecker(true);
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck(elem, function () {
|
||||
var spellchecker = inlineSpellChecker.spellChecker;
|
||||
try {
|
||||
|
|
|
@ -49,7 +49,8 @@ function runTest() {
|
|||
gMisspeltWords = ["errror", "errror"];
|
||||
editDoc().designMode = "on";
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm")
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm")
|
||||
.onSpellCheck(editDoc().documentElement, evalTest);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,8 @@ function runTest() {
|
|||
var edit = document.getElementById("edit");
|
||||
edit.focus();
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(edit, function () {
|
||||
ok(isSpellingCheckOk(getEditor(), gMisspeltWords),
|
||||
"All misspellings before editing are accounted for.");
|
||||
|
|
|
@ -112,7 +112,8 @@ function runTest()
|
|||
var edit = document.getElementById("edit");
|
||||
edit.focus();
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(edit, runOnFocus);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
|
||||
window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
var x = document.getElementById("x");
|
||||
x.focus();
|
||||
onSpellCheck(x, function () {
|
||||
|
|
|
@ -67,7 +67,8 @@ function RunTest() {
|
|||
ok(map.exists());
|
||||
hunspell.addDirectory(map);
|
||||
|
||||
Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
|
||||
Components.utils.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm");
|
||||
onSpellCheck(textbox, function () {
|
||||
|
||||
// test that base and map dictionaries are available
|
||||
|
|
|
@ -13,7 +13,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1170484
|
|||
|
||||
/** Test for Bug 1170484 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
|
||||
SimpleTest.waitForFocus(doTest, window);
|
||||
function doTest() {
|
||||
|
|
|
@ -54,7 +54,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1272623
|
|||
}
|
||||
|
||||
add_task(function* () {
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
|
||||
// Wait for the page to be ready
|
||||
yield new Promise(resolve => SimpleTest.waitForFocus(() => SimpleTest.executeSoon(resolve), window));
|
||||
|
|
|
@ -12,7 +12,8 @@ x
|
|||
var p = document.getElementById('p');
|
||||
var div = p.parentNode;
|
||||
div.focus();
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(div, function () {
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
|
|
|
@ -19,7 +19,8 @@ x
|
|||
sel.addRange(range);
|
||||
p.parentNode.focus();
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(p.parentNode, function () {
|
||||
sendKey('DOWN'); // now after "1"
|
||||
sendKey('DOWN'); // now make sure we get to the end
|
||||
|
|
|
@ -12,7 +12,8 @@ x
|
|||
var p = document.getElementById('p');
|
||||
var div = p.parentNode;
|
||||
div.focus();
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(div, function () {
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
|
|
|
@ -19,7 +19,8 @@ x
|
|||
sel.addRange(range);
|
||||
p.parentNode.focus();
|
||||
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(p.parentNode, function () {
|
||||
sendKey('DOWN'); // now after "1"
|
||||
sendKey('DOWN'); // now below the P element
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script>
|
||||
document.body.firstChild.focus();
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
|
||||
window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(document.body.firstChild, function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
});
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<script>
|
||||
var div = document.body.firstChild;
|
||||
div.focus();
|
||||
SpecialPowers.Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm",
|
||||
window);
|
||||
SpecialPowers.Cu.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm", window);
|
||||
onSpellCheck(div, function() {
|
||||
div.innerHTML = 'something missspelled<br>something elsed#';
|
||||
onSpellCheck(div, function() {
|
||||
|
|
|
@ -40,7 +40,8 @@ function startTests()
|
|||
textbox.focus();
|
||||
testNum = 0;
|
||||
|
||||
Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
|
||||
Components.utils.import(
|
||||
"resource://testing-common/AsyncSpellCheckTestHelper.jsm");
|
||||
onSpellCheck(textbox, function () {
|
||||
bringUpContextMenu(textbox);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче