# HG changeset patch # Parent 9090f2185b56912d10a3c8a1c7b82cbc9ac9f38c # User Jorg K Bug 1205983 - Remove all observer code (tests). r=ehsan diff --git a/editor/composer/test/chrome.ini b/editor/composer/test/chrome.ini --- a/editor/composer/test/chrome.ini +++ b/editor/composer/test/chrome.ini @@ -4,8 +4,9 @@ skip-if = buildapp == 'b2g' || os == 'an [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] diff --git a/editor/composer/test/test_bug1205983.html b/editor/composer/test/test_bug1205983.html new file mode 100644 --- /dev/null +++ b/editor/composer/test/test_bug1205983.html @@ -0,0 +1,122 @@ + + + + + Test for Bug 1205983 + + + + +Mozilla Bug 1205983 +

+ + +
German heute ist ein guter Tag
+ + +
+
+
+ + diff --git a/editor/composer/test/test_bug697981.html b/editor/composer/test/test_bug697981.html --- a/editor/composer/test/test_bug697981.html +++ b/editor/composer/test/test_bug697981.html @@ -93,16 +93,21 @@ function enFocus() { // So far all was boring. The important thing is whether the spell check result // in the de-DE editor is still the same. After losing focus, no spell check // updates should take place there. is(getMisspelledWords(editor_de), "German", "one misspelled word expected: German"); // Remove the fake de_DE dictionary again. hunspell.removeDirectory(de_DE); + // Focus again, so the spelling gets updated, but before we need to kill the focus handler. + elem_de.onfocus = null; + elem_de.blur(); + elem_de.focus(); + // After removal, the de_DE editor should refresh the spelling with en-US. onSpellCheck(elem_de, function () { spellchecker = inlineSpellChecker.spellChecker; try { currentDictonary = spellchecker.GetCurrentDictionary(); } catch(e) {} // Check that the default English dictionary is loaded and that the spell check has worked. diff --git a/extensions/spellcheck/tests/chrome/test_add_remove_dictionaries.xul b/extensions/spellcheck/tests/chrome/test_add_remove_dictionaries.xul --- a/extensions/spellcheck/tests/chrome/test_add_remove_dictionaries.xul +++ b/extensions/spellcheck/tests/chrome/test_add_remove_dictionaries.xul @@ -77,27 +77,35 @@ function RunTest() { onSpellCheck(textbox, function () { // test that base dictionary is in use is(getMisspelledWords(editor), "Frühstück" + "qwertyu", "base misspellings"); is(getCurrentDictionary(editor), "base-utf", "current dictionary"); // select map dictionary setCurrentDictionary(editor, "maputf"); + // Focus again, so the spelling gets updated. + textbox.blur(); + textbox.focus(); + onSpellCheck(textbox, function () { // test that map dictionary is in use - is(getMisspelledWords(editor), "created" + "imply" + "tomorrow" + "qwertyu", "map misspellings"); + is(getMisspelledWords(editor), "created" + "imply" + "tomorrow" + "qwertyu", "map misspellings (1)"); is(getCurrentDictionary(editor), "maputf", "current dictionary"); // uninstall map dictionary hunspell.removeDirectory(map); + // Focus again, so the spelling gets updated. + textbox.blur(); + textbox.focus(); + onSpellCheck(textbox, function () { // test that map dictionary is not in use - isnot(getMisspelledWords(editor), "created" + "imply" + "tomorrow" + "qwertyu", "map misspellings"); + isnot(getMisspelledWords(editor), "created" + "imply" + "tomorrow" + "qwertyu", "map misspellings (2)"); isnot(getCurrentDictionary(editor), "maputf", "current dictionary"); // test that base dictionary is available and map dictionary is unavailable var dicts = getDictionaryList(editor); isnot(dicts.indexOf("base-utf"), -1, "base is available"); is(dicts.indexOf("maputf"), -1, "map is unavailable"); // uninstall base dictionary