diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-30 11:37:48 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-30 11:38:52 +0200 |
commit | 89e2486a48b739f8d771d69ede5a6a1b244a10fc (patch) | |
tree | 503b1a7812cf97d93704c32437eb5f62dc1a1ff9 /Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp | |
parent | 625f028249cb37c55bbbd153f3902afd0b0756d9 (diff) | |
download | qtwebkit-89e2486a48b739f8d771d69ede5a6a1b244a10fc.tar.gz |
Imported WebKit commit 0282df8ca7c11d8c8a66ea18543695c69f545a27 (http://svn.webkit.org/repository/webkit/trunk@124002)
New snapshot with prospective Mountain Lion build fix
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp index e7d43a13d..f42feafb7 100644 --- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp @@ -231,11 +231,38 @@ static void testWebContextURIScheme(URISchemeTest* test, gconstpointer) g_assert(!test->m_loadEvents.contains(LoadTrackingTest::LoadFailed)); } +static void testWebContextSpellChecker(Test* test, gconstpointer) +{ + GRefPtr<WebKitWebContext> webContext(webkit_web_context_get_default()); + + // Set the language to a specific one, an empty one and a list of them. + webkit_web_context_set_spell_checking_languages(webContext.get(), "en_US"); + const gchar* currentLanguage(webkit_web_context_get_spell_checking_languages(webContext.get())); + g_assert_cmpstr(currentLanguage, ==, "en_US"); + + webkit_web_context_set_spell_checking_languages(webContext.get(), 0); + currentLanguage = webkit_web_context_get_spell_checking_languages(webContext.get()); + g_assert_cmpstr(currentLanguage, ==, 0); + + webkit_web_context_set_spell_checking_languages(webContext.get(), "es_ES,en_US"); + currentLanguage = webkit_web_context_get_spell_checking_languages(webContext.get()); + g_assert_cmpstr(currentLanguage, ==, "es_ES,en_US"); + + // Check disabling and re-enabling spell checking. + webkit_web_context_set_spell_checking_enabled(webContext.get(), FALSE); + gboolean isSpellCheckingEnabled = webkit_web_context_get_spell_checking_enabled(webContext.get()); + g_assert(!isSpellCheckingEnabled); + webkit_web_context_set_spell_checking_enabled(webContext.get(), TRUE); + isSpellCheckingEnabled = webkit_web_context_get_spell_checking_enabled(webContext.get()); + g_assert(isSpellCheckingEnabled); +} + void beforeAll() { Test::add("WebKitWebContext", "default-context", testWebContextDefault); PluginsTest::add("WebKitWebContext", "get-plugins", testWebContextGetPlugins); URISchemeTest::add("WebKitWebContext", "uri-scheme", testWebContextURIScheme); + Test::add("WebKitWebContext", "spell-checker", testWebContextSpellChecker); } void afterAll() |