WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch for landing
spelling-unit_test.patch (text/plain), 21.68 KB, created by
Grzegorz Czajkowski
on 2012-10-17 03:48:26 PDT
(
hide
)
Description:
patch for landing
Filename:
MIME Type:
Creator:
Grzegorz Czajkowski
Created:
2012-10-17 03:48:26 PDT
Size:
21.68 KB
patch
obsolete
>diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 5034831..d3fe806 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,27 @@ >+2012-10-17 Grzegorz Czajkowski <g.czajkowski@samsung.com> >+ >+ [WK2][EFL] Add unit tests for Spelling >+ https://bugs.webkit.org/show_bug.cgi?id=95956 >+ >+ Reviewed by Gyuyoung Kim. >+ >+ Add the unit tests which covers API from ewk_text_checker.h >+ and text checker settings from ewk_settings.h >+ >+ * PlatformEfl.cmake: >+ * UIProcess/API/efl/tests/resources/spelling_test.html: Added. >+ * UIProcess/API/efl/tests/test_ewk2_text_checker.cpp: Added. >+ (resetCallbacksExecutionStats): >+ (onTimeout): >+ (onSettingChange): >+ (onSpellDocumentTag): >+ (onSpellDocumentTagClose): >+ (onSpellingCheck): >+ (onWordGuesses): >+ (onWordLearn): >+ (onWordIgnore): >+ (TEST_F): >+ > 2012-10-17 Grzegorz Czajkowski <g.czajkowski@samsung.com>, Michal Roj <m.roj@samsung.com> > > Implementation of spellchecking feature. >diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake >index d603c59..6df5d3a 100644 >--- a/Source/WebKit2/PlatformEfl.cmake >+++ b/Source/WebKit2/PlatformEfl.cmake >@@ -339,6 +339,7 @@ SET(EWK2UnitTests_BINARIES > test_ewk2_refptr_evas_object > test_ewk2_intents > test_ewk2_settings >+ test_ewk2_text_checker > test_ewk2_view > ) > >diff --git a/Source/WebKit2/UIProcess/API/efl/tests/resources/spelling_test.html b/Source/WebKit2/UIProcess/API/efl/tests/resources/spelling_test.html >new file mode 100644 >index 0000000..bf93820 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/tests/resources/spelling_test.html >@@ -0,0 +1,23 @@ >+<!-- >+ The page contains the input field element which is filled >+ with the misspelled word to perform spelling. >+--> >+<HTML> >+<HEAD> >+ <TITLE>Testing Web Page for Spelling</TITLE> >+ <SCRIPT> >+ function setInputFieldValue() >+ { >+ // The input field has to be focused before typing to it. >+ document.getElementById("input").focus(); >+ >+ // 'Space' notifies WebKit that word has been inserted. >+ document.getElementById("input").value = "aa "; >+ } >+ </SCRIPT> >+</HEAD> >+ >+<BODY onload="setInputFieldValue()"> >+<INPUT type="text" id="input"> >+</BODY> >+</HTML> >diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp >new file mode 100644 >index 0000000..5fcde5c >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp >@@ -0,0 +1,535 @@ >+/* >+ * Copyright (C) 2012 Samsung Electronics >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING >+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+/** >+ * @brief covers API from ewk_text_checker.h >+ * @file test_ewk2_text_checker.cpp >+ */ >+ >+#include "config.h" >+ >+#include "UnitTestUtils/EWK2UnitTestBase.h" >+#include "UnitTestUtils/EWK2UnitTestEnvironment.h" >+#include <EWebKit2.h> >+#include <Ecore.h> >+#include <Eina.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 Ecore_Timer* timeoutTimer = 0; >+static double defaultTimeoutInSeconds = 0.5; >+ >+/** >+ * Structure keeps information which callbacks were called. >+ * Its values are reset before each test. >+ */ >+static struct { >+ bool spellDocumentTag : 1; >+ bool spellDocumentTagClose : 1; >+ bool spellingCheck : 1; >+ bool wordGuesses : 1; >+ bool wordLearn : 1; >+ bool wordIgnore : 1; >+} callbacksExecutionStats; >+ >+static void resetCallbacksExecutionStats() >+{ >+ callbacksExecutionStats.spellDocumentTag = false; >+ callbacksExecutionStats.spellDocumentTagClose = false; >+ callbacksExecutionStats.spellingCheck = false; >+ callbacksExecutionStats.wordGuesses = false; >+ callbacksExecutionStats.wordLearn = false; >+ callbacksExecutionStats.wordIgnore = false; >+} >+ >+/** >+ * Handle the timeout, it may happen for the asynchronous tests. >+ * >+ * @internal >+ * >+ * @return the ECORE_CALLBACK_CANCEL flag to delete the timer automatically >+ */ >+static Eina_Bool onTimeout(void*) >+{ >+ ecore_main_loop_quit(); >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+/** >+ * This callback tests whether the client's callback is called when the spell checking setting was changed. >+ * >+ * @internal >+ * >+ * Verify the new setting value (passes in the @a flag parameter) if it equals to the previously set. >+ * >+ * @internal >+ * >+ * @param flag the new setting value >+ */ >+static void onSettingChange(Eina_Bool flag) >+{ >+ EXPECT_EQ(isSettingEnabled, flag); >+ >+ ecore_timer_del(timeoutTimer); >+ timeoutTimer = 0; >+ ecore_main_loop_quit(); >+} >+ >+/** >+ * Returns unique tag (an identifier). >+ * >+ * @internal >+ * >+ * It will be used for onSpellingCheck, onWordGuesses etc. to notify >+ * the client on which object (associated to the tag) the spelling is being invoked. >+ * >+ * @param ewkView the view object to get unique tag >+ * >+ * @return unique tag for the given @a ewkView object >+ */ >+static uint64_t onSpellDocumentTag(const Evas_Object* ewkView) >+{ >+ EXPECT_EQ(defaultView, ewkView); >+ callbacksExecutionStats.spellDocumentTag = true; >+ >+ return defaultDocumentTag; >+} >+ >+/** >+ * The view which is associated to the @a tag has been destroyed. >+ * >+ * @internal >+ * >+ * @param tag the tag to be closed >+ */ >+static void onSpellDocumentTagClose(uint64_t tag) >+{ >+ ASSERT_EQ(defaultDocumentTag, tag); >+ callbacksExecutionStats.spellDocumentTagClose = true; >+} >+ >+/** >+ * Checks spelling for the given @a text. >+ * >+ * @internal >+ * >+ * @param tag unique tag to notify the client on which object the spelling is being performed >+ * @param text the text containing the words to spellcheck >+ * @param misspelling_location a pointer to store the beginning of the misspelled @a text, @c -1 if the @a text is correct >+ * @param misspelling_length a pointer to store the length of misspelled @a text, @c 0 if the @a text is correct >+ */ >+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); >+ >+ // The client is able to show the misselled text through its location (the beginning of misspelling) >+ // and length (the end of misspelling). >+ *misspellingLocation = 0; >+ *misspellingLength = strlen(expectedMisspelledWord); >+ >+ callbacksExecutionStats.spellingCheck = true; >+} >+ >+/** >+ * Gets a list of suggested spellings for a misspelled @a word. >+ * >+ * @internal >+ * >+ * @param tag unique tag to notify the client on which object the spelling is being performed >+ * @param word the word to get guesses >+ * @return a list of dynamically allocated strings (as char*) and >+ * caller is responsible for destroying them. >+ */ >+static Eina_List* onWordGuesses(uint64_t tag, const char* word) >+{ >+ EXPECT_EQ(defaultDocumentTag, tag); >+ EXPECT_STREQ(expectedMisspelledWord, word); >+ >+ Eina_List* suggestionsForWord = 0; >+ // FIXME: Fill the Eina_List with suggestions for the misspelled word. >+ callbacksExecutionStats.wordGuesses = true; >+ >+ return suggestionsForWord; >+} >+ >+/** >+ * Adds the @a word to the spell checker dictionary. >+ * >+ * @internal >+ * >+ * @param tag unique tag to notify the client on which object the spelling is being performed >+ * @param word the word to add >+ */ >+static void onWordLearn(uint64_t tag, const char* word) >+{ >+ ASSERT_EQ(defaultDocumentTag, tag); >+ ASSERT_STREQ(expectedMisspelledWord, word); >+ callbacksExecutionStats.wordLearn = true; >+} >+ >+/** >+ * Tells the spell checker to ignore a given @a word. >+ * >+ * @internal >+ * >+ * @param tag unique tag to notify the client on which object the spelling is being performed >+ * @param word the word to ignore >+ */ >+static void onWordIgnore(uint64_t tag, const char* word) >+{ >+ ASSERT_EQ(defaultDocumentTag, tag); >+ ASSERT_STREQ(expectedMisspelledWord, word); >+ callbacksExecutionStats.wordIgnore = true; >+} >+ >+/** >+ * Test setter/getter for the continous spell checking: >+ * - ewk_settings_continuous_spell_checking_enabled_get >+ * - ewk_settings_continuous_spell_checking_enabled_set >+ */ >+TEST_F(EWK2UnitTestBase, ewk_settings_continuous_spell_checking_enabled) >+{ >+ ewk_settings_continuous_spell_checking_enabled_set(true); >+#if ENABLE(SPELLCHECK) >+ EXPECT_TRUE(ewk_settings_continuous_spell_checking_enabled_get()); >+ >+ // When the spell checking has been enabled, the default language is set (if the user >+ // didn't set any). The languages are being loaded on the idler, wait for them. >+ timeoutTimer = ecore_timer_add(defaultTimeoutInSeconds, onTimeout, 0); >+ ecore_main_loop_begin(); >+ >+ Eina_List* loadedLanguages = ewk_settings_spell_checking_languages_get(); >+ // No dictionary is available/installed. >+ if (!loadedLanguages) >+ return; >+ >+ EXPECT_EQ(1, eina_list_count(loadedLanguages)); >+ >+ void* data; >+ EINA_LIST_FREE(loadedLanguages, data) >+ eina_stringshare_del(static_cast<const char*>(data)); >+#else >+ EXPECT_FALSE(ewk_settings_continuous_spell_checking_enabled_get()); >+#endif >+ >+ ewk_settings_continuous_spell_checking_enabled_set(false); >+ EXPECT_FALSE(ewk_settings_continuous_spell_checking_enabled_get()); >+} >+ >+/** >+ * Test whether the callback is called when the spell checking setting has been changed. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_settings_continuous_spell_checking_change_cb_set) >+{ >+ ewk_settings_continuous_spell_checking_change_cb_set(onSettingChange); >+ >+ isSettingEnabled = ewk_settings_continuous_spell_checking_enabled_get(); >+ isSettingEnabled = !isSettingEnabled; >+ ewk_settings_continuous_spell_checking_enabled_set(isSettingEnabled); >+ >+ timeoutTimer = ecore_timer_add(defaultTimeoutInSeconds, onTimeout, 0); >+ >+ // Start proccesing Ecore events, the notification about the change of the spell >+ // checking setting is called on idler. >+ // We can't call ecore_main_loop_iterate because it doesn't process the idlers. >+ ecore_main_loop_begin(); >+ >+#if ENABLE(SPELLCHECK) >+ EXPECT_FALSE(timeoutTimer); >+#else >+ EXPECT_TRUE(timeoutTimer); >+#endif >+ >+ // The callback shouldn't be called if the setting option is already set. >+ isSettingEnabled = ewk_settings_continuous_spell_checking_enabled_get(); >+ ewk_settings_continuous_spell_checking_enabled_set(isSettingEnabled); >+ >+ timeoutTimer = ecore_timer_add(defaultTimeoutInSeconds, onTimeout, 0); >+ ecore_main_loop_begin(); >+ >+ // When the SPELLCHECK macro is disabled the callback won't be called too. >+ EXPECT_TRUE(timeoutTimer); >+ >+ // The callback shouldn't be called if the user has invalidated it. >+ ewk_settings_continuous_spell_checking_change_cb_set(0); >+ isSettingEnabled = ewk_settings_continuous_spell_checking_enabled_get(); >+ isSettingEnabled = !isSettingEnabled; >+ ewk_settings_continuous_spell_checking_enabled_set(isSettingEnabled); >+ >+ timeoutTimer = ecore_timer_add(defaultTimeoutInSeconds, onTimeout, 0); >+ ecore_main_loop_begin(); >+ >+ // If the SPELLCHECK macro is disabled, the callback is not set. >+ EXPECT_TRUE(timeoutTimer); >+} >+ >+/** >+ * This unit test sets all available/installed dictionaries and verifies them >+ * if they are in use. >+ * All the dictionaries from the list can be set to perform spellchecking. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_settings_spell_checking_available_languages_get) >+{ >+ Eina_List* availableLanguages = ewk_settings_spell_checking_available_languages_get(); >+ // No dictionary is available/installed or the SPELLCHECK macro is disabled. >+ if (!availableLanguages) >+ return; >+ >+ // Helper to create one string with comma separated languages. >+ 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)); >+ // Add the comma after all but the last language IDs. >+ if (i++ != lastIndex) >+ languages.append(','); >+ } >+ >+ // Set all available languages. >+ ewk_settings_spell_checking_languages_set(languages.toString().utf8().data()); >+ >+ // Languages are being loaded on the idler, wait for them. >+ timeoutTimer = ecore_timer_add(defaultTimeoutInSeconds, onTimeout, 0); >+ ecore_main_loop_begin(); >+ >+ // Get the languages in use. >+ Eina_List* loadedLanguages = ewk_settings_spell_checking_languages_get(); >+ ASSERT_EQ(eina_list_count(loadedLanguages), eina_list_count(availableLanguages)); >+ >+ i = 0; >+ void* expected = 0; >+ // Verify whether the loaded languages list is equal to the available languages list. >+ EINA_LIST_FOREACH(loadedLanguages, listIterator, actual) { >+ expected = eina_list_nth(availableLanguages, i++); >+ EXPECT_STREQ(static_cast<const char*>(expected), static_cast<const char*>(actual)); >+ } >+ >+ // Delete the lists. >+ 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)); >+} >+ >+/** >+ * Here we test the following scenarios: >+ * - setting the default language, >+ * - if two arbitrarily selected dictionaries are set correctly. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_settings_spell_checking_languages) >+{ >+ // Set the default language. >+ ewk_settings_spell_checking_languages_set(0); >+ >+ // Languages are being loaded on the idler, wait for them. >+ timeoutTimer = ecore_timer_add(defaultTimeoutInSeconds, onTimeout, 0); >+ ecore_main_loop_begin(); >+ >+ Eina_List* loadedLanguages = ewk_settings_spell_checking_languages_get(); >+ // No dictionary is available/installed or the SPELLCHECK macro is disabled. >+ if (!loadedLanguages) >+ return; >+ >+ ASSERT_EQ(1, eina_list_count(loadedLanguages)); >+ >+ // Delete the list. >+ void* actual = 0; >+ EINA_LIST_FREE(loadedLanguages, actual) >+ eina_stringshare_del(static_cast<const char*>(actual)); >+ >+ // Get the first and last language from installed dictionaries. >+ Eina_List* availableLanguages = ewk_settings_spell_checking_available_languages_get(); >+ unsigned numberOfAvailableLanguages = eina_list_count(availableLanguages); >+ // We assume that user has installed at lest two dictionaries. >+ 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))); >+ >+ // Case sensitivity of dictionaries doesn't affect on loading the dictionaries, >+ // the Enchant library will 'normalize' them. >+ WTF::StringBuilder languages; >+ languages.append(String(firstExpected).upper()); >+ languages.append(','); >+ languages.append(String(lastExpected).lower()); >+ >+ // Set both languages (the first and the last) from the list. >+ ewk_settings_spell_checking_languages_set(languages.toString().utf8().data()); >+ >+ timeoutTimer = ecore_timer_add(defaultTimeoutInSeconds, onTimeout, 0); >+ ecore_main_loop_begin(); >+ >+ loadedLanguages = ewk_settings_spell_checking_languages_get(); >+ 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))); >+ >+ // Delete the lists. >+ 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 whether the client's callbacks aren't called (if not specified). >+ */ >+TEST_F(EWK2UnitTestBase, ewk_text_checker) >+{ >+ resetCallbacksExecutionStats(); >+ ewk_settings_continuous_spell_checking_enabled_set(true); >+ >+ ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data())); >+ >+ // If user doesn't specify callback functions responsible for spelling >+ // the default WebKit implementation (based on the Enchant library) will be used. >+ ASSERT_FALSE(callbacksExecutionStats.spellDocumentTag); >+ ASSERT_FALSE(callbacksExecutionStats.spellDocumentTagClose); >+ ASSERT_FALSE(callbacksExecutionStats.spellingCheck); >+ >+ // It doesn't make sense to verify others callbacks (onWordGuesses, >+ // onWordLearn, onWordIgnore) as they need the context menu feature >+ // which is not implemented for WK2-EFL. >+} >+ >+/** >+ * Test whether the client's callbacks (onSpellDocumentTag, onSpellDocumentTagClose) are called. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_text_checker_unique_spell_document_tag) >+{ >+ resetCallbacksExecutionStats(); >+ defaultView = webView(); >+ ewk_settings_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())); >+ >+ // Check whether the callback was called. >+ ASSERT_TRUE(callbacksExecutionStats.spellDocumentTag); >+ // It's not possible to check whether onSpellDocumentTagClose was called here, because >+ // it's invoked when WebPage is being destroyed. >+ // It should be verified for example when view is freed. >+} >+ >+/** >+ * Test whether the client's callback (onSpellingCheck) is called when >+ * the word to input field was put. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_text_checker_string_spelling_check_cb_set) >+{ >+ resetCallbacksExecutionStats(); >+ defaultView = webView(); >+ ewk_settings_continuous_spell_checking_enabled_set(true); >+ >+ ewk_text_checker_string_spelling_check_cb_set(onSpellingCheck); >+ >+ ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data())); >+ >+ // Check whether the callback was called. >+ ASSERT_TRUE(callbacksExecutionStats.spellingCheck); >+} >+ >+/** >+ * Test whether the client's callback (onWordGuesses) is called when >+ * the context menu was shown on the misspelled word. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_text_checker_word_guesses_get_cb_set) >+{ >+ resetCallbacksExecutionStats(); >+ defaultView = webView(); >+ ewk_settings_continuous_spell_checking_enabled_set(true); >+ >+ ewk_text_checker_word_guesses_get_cb_set(onWordGuesses); >+ >+ ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data())); >+ >+ /* FIXME: >+ 1) Invoke the context menu on the misspelled word (not implemented for WK2), >+ the word has to be selected first. >+ 2) Fill the suggestion list in the onWordGuesses callback. >+ 3) Compare context menu suggestions to the suggestion list. >+ 4) Check whether the callback was called. */ >+} >+ >+/** >+ * Test whether the client's callback (onWordLearn) is called when >+ * the context menu option "Learn spelling" was choosen. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_text_checker_word_learn_cb_set) >+{ >+ resetCallbacksExecutionStats(); >+ defaultView = webView(); >+ ewk_settings_continuous_spell_checking_enabled_set(true); >+ >+ ewk_text_checker_word_learn_cb_set(onWordLearn); >+ >+ ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data())); >+ >+ /* FIXME: >+ 1) Invoke the context menu on the misspelled word (not implemented for WK2), >+ the word has to be selected first. >+ 2) Check whether the callback was called. */ >+} >+ >+/** >+ * Test whether the client's callback (onWordIgnore) is called when >+ * the context menu option "Ignore spelling" was choosen. >+ */ >+TEST_F(EWK2UnitTestBase, ewk_text_checker_word_ignore_cb_set) >+{ >+ resetCallbacksExecutionStats(); >+ defaultView = webView(); >+ ewk_settings_continuous_spell_checking_enabled_set(true); >+ >+ ewk_text_checker_word_ignore_cb_set(onWordIgnore); >+ >+ ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data())); >+ >+ /* FIXME: >+ 1) Invoke the context menu on the misspelled word (not implemented for WK2), >+ the word has to be selected first. >+ 2) Check whether the callback was called. */ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 95956
:
165326
|
165609
|
167953
|
168424
|
168702
|
168893
|
168947
| 169149