test_ewk2_text_checker.cpp [plain text]
#include "config.h"
#include "UnitTestUtils/EWK2UnitTestBase.h"
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
using namespace EWK2UnitTest;
extern EWK2UnitTestEnvironment* environment;
static const uint64_t defaultDocumentTag = 123;
static const char expectedMisspelledWord[] = "aa";
static const Evas_Object* defaultView = 0;
static bool isSettingEnabled = false;
static double defaultTimeoutInSeconds = 0.5;
static bool wasContextMenuShown = false;
static const char* clientSuggestionsForWord[] = { "clientSuggestion1", "clientSuggestion2", "clientSuggestion3" };
static unsigned contextMenuItemsNumber = 0;
static String knownWord;
static struct {
bool settingChange;
bool spellDocumentTag;
bool spellDocumentTagClose;
bool spellingCheck;
bool wordGuesses;
bool wordLearn;
bool wordIgnore;
} callbacksExecutionStats;
class EWK2TextCheckerTest : public EWK2UnitTestBase {
public:
static void resetCallbacksExecutionStats()
{
callbacksExecutionStats.settingChange = false;
callbacksExecutionStats.spellDocumentTag = false;
callbacksExecutionStats.spellDocumentTagClose = false;
callbacksExecutionStats.spellingCheck = false;
callbacksExecutionStats.wordGuesses = false;
callbacksExecutionStats.wordLearn = false;
callbacksExecutionStats.wordIgnore = false;
}
static void onSettingChange(Eina_Bool flag)
{
EXPECT_EQ(isSettingEnabled, flag);
callbacksExecutionStats.settingChange = true;
}
static uint64_t onSpellDocumentTag(const Evas_Object* ewkView)
{
EXPECT_EQ(defaultView, ewkView);
callbacksExecutionStats.spellDocumentTag = true;
return defaultDocumentTag;
}
static void onSpellDocumentTagClose(uint64_t tag)
{
ASSERT_EQ(defaultDocumentTag, tag);
callbacksExecutionStats.spellDocumentTagClose = true;
}
static void onSpellingCheck(uint64_t tag, const char* text, int32_t* misspellingLocation, int32_t* misspellingLength)
{
ASSERT_EQ(defaultDocumentTag, tag);
ASSERT_STREQ(expectedMisspelledWord, text);
ASSERT_TRUE(misspellingLocation);
ASSERT_TRUE(misspellingLength);
*misspellingLocation = 0;
*misspellingLength = strlen(expectedMisspelledWord);
callbacksExecutionStats.spellingCheck = true;
}
static void onSpellingForKnownWord(uint64_t, const char* text, int32_t* misspellingLocation, int32_t* misspellingLength)
{
ASSERT_STREQ(knownWord.utf8().data(), text);
ASSERT_TRUE(misspellingLocation);
ASSERT_TRUE(misspellingLength);
*misspellingLocation = -1;
*misspellingLength = 0;
callbacksExecutionStats.spellingCheck = true;
}
static Eina_List* onWordGuesses(uint64_t tag, const char* word)
{
EXPECT_EQ(defaultDocumentTag, tag);
EXPECT_STREQ(expectedMisspelledWord, word);
Eina_List* suggestionsForWord = 0;
size_t numberOfSuggestions = WTF_ARRAY_LENGTH(clientSuggestionsForWord);
for (size_t i = 0; i < numberOfSuggestions; ++i)
suggestionsForWord = eina_list_append(suggestionsForWord, strdup(clientSuggestionsForWord[i]));
callbacksExecutionStats.wordGuesses = true;
return suggestionsForWord;
}
static void onWordLearn(uint64_t tag, const char* word)
{
ASSERT_EQ(defaultDocumentTag, tag);
ASSERT_STREQ(expectedMisspelledWord, word);
knownWord = word;
callbacksExecutionStats.wordLearn = true;
}
static void onWordIgnore(uint64_t tag, const char* word)
{
ASSERT_EQ(defaultDocumentTag, tag);
ASSERT_STREQ(expectedMisspelledWord, word);
knownWord = word;
callbacksExecutionStats.wordIgnore = true;
}
static Ewk_Context_Menu_Item* findContextMenuItem(const Ewk_Context_Menu* contextMenu, Ewk_Context_Menu_Item_Action itemAction, Ewk_Context_Menu_Item_Type itemType)
{
const Eina_List* contextMenuItems = ewk_context_menu_items_get(contextMenu);
void* itemData;
const Eina_List* listIterator;
EINA_LIST_FOREACH(contextMenuItems, listIterator, itemData) {
Ewk_Context_Menu_Item* item = static_cast<Ewk_Context_Menu_Item*>(itemData);
if (ewk_context_menu_item_action_get(item) == itemAction
&& ewk_context_menu_item_type_get(item) == itemType)
return item;
}
return 0;
}
static Eina_Bool checkCorrectnessOfSpellingItems(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
{
Ewk_Context_Menu_Item* noGuessesItem = findContextMenuItem(contextMenu, EWK_CONTEXT_MENU_ITEM_TAG_NO_GUESSES_FOUND, EWK_ACTION_TYPE);
EXPECT_FALSE(noGuessesItem);
Ewk_Context_Menu_Item* ignoreSpellingItem = findContextMenuItem(contextMenu, EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_SPELLING, EWK_ACTION_TYPE);
EXPECT_TRUE(ignoreSpellingItem);
Ewk_Context_Menu_Item* learnSpellingItem = findContextMenuItem(contextMenu, EWK_CONTEXT_MENU_ITEM_TAG_LEARN_SPELLING, EWK_ACTION_TYPE);
EXPECT_TRUE(learnSpellingItem);
wasContextMenuShown = true;
return true;
}
static Eina_Bool toogleCheckSpellingWhileTyping(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
{
Ewk_Context_Menu_Item* spellingAndGrammarItem = findContextMenuItem(contextMenu, EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU, EWK_SUBMENU_TYPE);
EXPECT_TRUE(spellingAndGrammarItem);
Ewk_Context_Menu* spellingAndGrammarSubmenu = ewk_context_menu_item_submenu_get(spellingAndGrammarItem);
Ewk_Context_Menu_Item* checkSpellingWhileTypingItem = findContextMenuItem(spellingAndGrammarSubmenu, EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING_WHILE_TYPING, EWK_CHECKABLE_ACTION_TYPE);
EXPECT_TRUE(checkSpellingWhileTypingItem);
return ewk_context_menu_item_select(spellingAndGrammarSubmenu, checkSpellingWhileTypingItem);
}
static Eina_Bool checkClientSuggestionsForWord(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
{
const Eina_List* contextMenuItems = ewk_context_menu_items_get(contextMenu);
size_t numberOfSuggestions = WTF_ARRAY_LENGTH(clientSuggestionsForWord);
if (numberOfSuggestions > eina_list_count(contextMenuItems)) {
ADD_FAILURE();
return true;
}
for (size_t i = 0; i < numberOfSuggestions; ++i) {
Ewk_Context_Menu_Item* item = static_cast<Ewk_Context_Menu_Item*>(eina_list_data_get(contextMenuItems));
EXPECT_STREQ(clientSuggestionsForWord[i], ewk_context_menu_item_title_get(item));
contextMenuItems = eina_list_next(contextMenuItems);
}
wasContextMenuShown = true;
return true;
}
static Eina_Bool selectLearnSpelling(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
{
Ewk_Context_Menu_Item* learnSpellingItem = findContextMenuItem(contextMenu, EWK_CONTEXT_MENU_ITEM_TAG_LEARN_SPELLING, EWK_ACTION_TYPE);
EXPECT_TRUE(learnSpellingItem);
return ewk_context_menu_item_select(contextMenu, learnSpellingItem);
}
static Eina_Bool selectIgnoreSpelling(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
{
Ewk_Context_Menu_Item* ignoreSpellingItem = findContextMenuItem(contextMenu, EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_SPELLING, EWK_ACTION_TYPE);
EXPECT_TRUE(ignoreSpellingItem);
return ewk_context_menu_item_select(contextMenu, ignoreSpellingItem);
}
static Eina_Bool countContextMenuItems(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
{
contextMenuItemsNumber = eina_list_count(ewk_context_menu_items_get(contextMenu));
wasContextMenuShown = true;
return true;
}
protected:
enum Line { FirstLine, SecondLine };
enum Button { SelectAllWordsWithSpellcheckButton, SelectAllWordsWithoutSpellcheckButton, SelectSubWordWithSpellcheckButton };
void clickButton(Button button)
{
switch (button) {
case SelectAllWordsWithSpellcheckButton:
mouseClick(60, 60);
break;
case SelectAllWordsWithoutSpellcheckButton:
mouseClick(500, 60);
break;
case SelectSubWordWithSpellcheckButton :
mouseClick(200, 60);
break;
}
}
void showContextMenu(Line line)
{
switch (line) {
case FirstLine:
mouseClick(10, 20, 3);
break;
case SecondLine:
mouseClick(35, 35, 3);
break;
}
}
void selectFirstWord(Line line)
{
switch (line) {
case FirstLine:
mouseDoubleClick(10, 20);
break;
case SecondLine:
mouseDoubleClick(35, 35);
break;
}
}
};
TEST_F(EWK2TextCheckerTest, spelling_suggestion_for_context_click)
{
wasContextMenuShown = false;
ewkViewClass()->context_menu_show = countContextMenuItems;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
unsigned numberItemsWithoutSpellCheck = contextMenuItemsNumber;
wasContextMenuShown = false;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
showContextMenu(SecondLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
EXPECT_LT(numberItemsWithoutSpellCheck, contextMenuItemsNumber);
}
TEST_F(EWK2TextCheckerTest, no_spelling_suggestion_for_multiword_selection)
{
wasContextMenuShown = false;
ewkViewClass()->context_menu_show = countContextMenuItems;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
clickButton(SelectAllWordsWithoutSpellcheckButton);
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
unsigned numberItemsWithoutSpellCheck = contextMenuItemsNumber;
wasContextMenuShown = false;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
clickButton(SelectAllWordsWithSpellcheckButton);
showContextMenu(SecondLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
EXPECT_EQ(numberItemsWithoutSpellCheck, contextMenuItemsNumber);
}
TEST_F(EWK2TextCheckerTest, no_spelling_suggestion_for_subword_selection)
{
wasContextMenuShown = false;
ewkViewClass()->context_menu_show = countContextMenuItems;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
clickButton(SelectAllWordsWithoutSpellcheckButton);
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
unsigned numberItemsWithoutSpellCheck = contextMenuItemsNumber;
wasContextMenuShown = false;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
clickButton(SelectSubWordWithSpellcheckButton);
showContextMenu(SecondLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
EXPECT_EQ(numberItemsWithoutSpellCheck, contextMenuItemsNumber);
}
TEST_F(EWK2TextCheckerTest, spelling_suggestion_for_double_clicked_word)
{
wasContextMenuShown = false;
ewkViewClass()->context_menu_show = countContextMenuItems;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
clickButton(SelectAllWordsWithoutSpellcheckButton);
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
unsigned numberItemsWithoutSpellCheck = contextMenuItemsNumber;
wasContextMenuShown = false;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_selection_tests.html").data()));
selectFirstWord(SecondLine);
showContextMenu(SecondLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
EXPECT_LT(numberItemsWithoutSpellCheck, contextMenuItemsNumber);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_spell_checking_languages_get)
{
ewk_text_checker_continuous_spell_checking_enabled_set(false);
Eina_List* loadedLanguages = waitUntilSpellingLanguagesLoaded(1, defaultTimeoutInSeconds);
if (!loadedLanguages)
return;
EXPECT_EQ(1, eina_list_count(loadedLanguages));
void* data;
EINA_LIST_FREE(loadedLanguages, data)
eina_stringshare_del(static_cast<Eina_Stringshare*>(data));
ewk_text_checker_continuous_spell_checking_enabled_set(true);
loadedLanguages = waitUntilSpellingLanguagesLoaded(1, defaultTimeoutInSeconds);
if (!loadedLanguages)
return;
EXPECT_EQ(1, eina_list_count(loadedLanguages));
EINA_LIST_FREE(loadedLanguages, data)
eina_stringshare_del(static_cast<Eina_Stringshare*>(data));
}
TEST_F(EWK2TextCheckerTest, context_menu_spelling_items_availability)
{
wasContextMenuShown = false;
ewk_text_checker_continuous_spell_checking_enabled_set(false);
ewkViewClass()->context_menu_show = checkCorrectnessOfSpellingItems;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_continuous_spell_checking_enabled)
{
ewk_text_checker_continuous_spell_checking_enabled_set(true);
#if ENABLE(SPELLCHECK)
EXPECT_TRUE(ewk_text_checker_continuous_spell_checking_enabled_get());
#else
EXPECT_FALSE(ewk_text_checker_continuous_spell_checking_enabled_get());
#endif
ewk_text_checker_continuous_spell_checking_enabled_set(false);
EXPECT_FALSE(ewk_text_checker_continuous_spell_checking_enabled_get());
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_check_spelling_while_typing_toggle)
{
resetCallbacksExecutionStats();
ewkViewClass()->context_menu_show = toogleCheckSpellingWhileTyping;
ewk_text_checker_continuous_spell_checking_change_cb_set(onSettingChange);
isSettingEnabled = !ewk_text_checker_continuous_spell_checking_enabled_get();
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(callbacksExecutionStats.settingChange));
resetCallbacksExecutionStats();
isSettingEnabled = !isSettingEnabled;
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(callbacksExecutionStats.settingChange));
ewk_text_checker_continuous_spell_checking_change_cb_set(0);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_continuous_spell_checking_change_cb_set)
{
resetCallbacksExecutionStats();
ewk_text_checker_continuous_spell_checking_change_cb_set(onSettingChange);
isSettingEnabled = ewk_text_checker_continuous_spell_checking_enabled_get();
isSettingEnabled = !isSettingEnabled;
ewk_text_checker_continuous_spell_checking_enabled_set(isSettingEnabled);
ASSERT_FALSE(waitUntilTrue(callbacksExecutionStats.settingChange, 0));
ewk_text_checker_continuous_spell_checking_change_cb_set(0);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_continuous_spell_checking_change_cb_unset)
{
resetCallbacksExecutionStats();
ewkViewClass()->context_menu_show = toogleCheckSpellingWhileTyping;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
showContextMenu(FirstLine);
ASSERT_FALSE(waitUntilTrue(callbacksExecutionStats.settingChange, 0));
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_spell_checking_available_languages_get)
{
Eina_List* availableLanguages = ewk_text_checker_spell_checking_available_languages_get();
if (!availableLanguages)
return;
void* actual = 0;
WTF::StringBuilder languages;
Eina_List* listIterator = 0;
unsigned lastIndex = eina_list_count(availableLanguages) - 1;
unsigned i = 0;
EINA_LIST_FOREACH(availableLanguages, listIterator, actual) {
languages.append(static_cast<const char*>(actual));
if (i++ != lastIndex)
languages.append(',');
}
ewk_text_checker_spell_checking_languages_set(languages.toString().utf8().data());
Eina_List* loadedLanguages = waitUntilSpellingLanguagesLoaded(eina_list_count(availableLanguages), defaultTimeoutInSeconds);
ASSERT_EQ(eina_list_count(loadedLanguages), eina_list_count(availableLanguages));
i = 0;
void* expected = 0;
EINA_LIST_FOREACH(loadedLanguages, listIterator, actual) {
expected = eina_list_nth(availableLanguages, i++);
EXPECT_STREQ(static_cast<const char*>(expected), static_cast<const char*>(actual));
}
EINA_LIST_FREE(availableLanguages, actual)
eina_stringshare_del(static_cast<const char*>(actual));
EINA_LIST_FREE(loadedLanguages, actual)
eina_stringshare_del(static_cast<const char*>(actual));
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_spell_checking_languages)
{
ewk_text_checker_spell_checking_languages_set(0);
Eina_List* loadedLanguages = waitUntilSpellingLanguagesLoaded(1, defaultTimeoutInSeconds);
if (!loadedLanguages)
return;
ASSERT_EQ(1, eina_list_count(loadedLanguages));
void* actual = 0;
EINA_LIST_FREE(loadedLanguages, actual)
eina_stringshare_del(static_cast<const char*>(actual));
Eina_List* availableLanguages = ewk_text_checker_spell_checking_available_languages_get();
unsigned numberOfAvailableLanguages = eina_list_count(availableLanguages);
if (numberOfAvailableLanguages < 2)
return;
const char* firstExpected = static_cast<const char*>(eina_list_nth(availableLanguages, 0));
const char* lastExpected = static_cast<const char*>(eina_list_data_get(eina_list_last(availableLanguages)));
WTF::StringBuilder languages;
languages.append(String(firstExpected).upper());
languages.append(',');
languages.append(String(lastExpected).lower());
ewk_text_checker_spell_checking_languages_set(languages.toString().utf8().data());
loadedLanguages = waitUntilSpellingLanguagesLoaded(2, defaultTimeoutInSeconds);
ASSERT_EQ(2, eina_list_count(loadedLanguages));
EXPECT_STREQ(firstExpected, static_cast<const char*>(eina_list_nth(loadedLanguages, 0)));
EXPECT_STREQ(lastExpected, static_cast<const char*>(eina_list_nth(loadedLanguages, 1)));
EINA_LIST_FREE(availableLanguages, actual)
eina_stringshare_del(static_cast<const char*>(actual));
EINA_LIST_FREE(loadedLanguages, actual)
eina_stringshare_del(static_cast<const char*>(actual));
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker)
{
resetCallbacksExecutionStats();
ewk_text_checker_continuous_spell_checking_enabled_set(true);
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
ASSERT_FALSE(callbacksExecutionStats.spellDocumentTag);
ASSERT_FALSE(callbacksExecutionStats.spellDocumentTagClose);
ASSERT_FALSE(callbacksExecutionStats.spellingCheck);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_unique_spell_document_tag)
{
resetCallbacksExecutionStats();
defaultView = webView();
ewk_text_checker_continuous_spell_checking_enabled_set(true);
ewk_text_checker_unique_spell_document_tag_get_cb_set(onSpellDocumentTag);
ewk_text_checker_unique_spell_document_tag_close_cb_set(onSpellDocumentTagClose);
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
ASSERT_TRUE(callbacksExecutionStats.spellDocumentTag);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_string_spelling_check_cb_set)
{
resetCallbacksExecutionStats();
defaultView = webView();
ewk_text_checker_continuous_spell_checking_enabled_set(true);
ewk_text_checker_string_spelling_check_cb_set(onSpellingCheck);
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
ASSERT_TRUE(callbacksExecutionStats.spellingCheck);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_word_guesses_get_cb_set)
{
resetCallbacksExecutionStats();
wasContextMenuShown = false;
defaultView = webView();
ewkViewClass()->context_menu_show = checkClientSuggestionsForWord;
ewk_text_checker_word_guesses_get_cb_set(onWordGuesses);
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
ASSERT_TRUE(callbacksExecutionStats.wordGuesses);
ewk_text_checker_word_guesses_get_cb_set(0);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_word_learn_cb_set)
{
resetCallbacksExecutionStats();
knownWord = emptyString();
defaultView = webView();
ewk_text_checker_word_learn_cb_set(onWordLearn);
ewkViewClass()->context_menu_show = selectLearnSpelling;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
selectFirstWord(FirstLine);
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(callbacksExecutionStats.wordLearn));
resetCallbacksExecutionStats();
ewk_text_checker_string_spelling_check_cb_set(onSpellingForKnownWord);
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
ASSERT_TRUE(callbacksExecutionStats.spellingCheck);
ewk_text_checker_string_spelling_check_cb_set(0);
ewk_text_checker_word_learn_cb_set(0);
}
TEST_F(EWK2TextCheckerTest, ewk_text_checker_word_ignore_cb_set)
{
resetCallbacksExecutionStats();
knownWord = emptyString();
defaultView = webView();
ewk_text_checker_word_ignore_cb_set(onWordIgnore);
ewkViewClass()->context_menu_show = selectIgnoreSpelling;
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
selectFirstWord(FirstLine);
showContextMenu(FirstLine);
ASSERT_TRUE(waitUntilTrue(callbacksExecutionStats.wordIgnore));
resetCallbacksExecutionStats();
ewk_text_checker_string_spelling_check_cb_set(onSpellingForKnownWord);
ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
ASSERT_TRUE(callbacksExecutionStats.spellingCheck);
ewk_text_checker_string_spelling_check_cb_set(0);
ewk_text_checker_word_ignore_cb_set(0);
}