Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc

Issue 252643004: Remove --use-spelling-suggestions flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Force suggest mode in a function. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/spellchecker/spelling_service_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc
diff --git a/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc b/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc
index 1cde7c6fa16b094558b1d428c9b5af9f94809018..59d1372e7f7c56fe62d68a5493ddb7ba9dc6ca16 100644
--- a/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc
+++ b/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc
@@ -232,6 +232,16 @@ class SpellingMenuObserverTest : public InProcessBrowserTest {
observer_->InitMenu(params);
}
+ void ForceSuggestMode() {
+ menu()->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
+ // Force a non-empty and non-"en" locale so SUGGEST is available.
+ menu()->GetPrefs()->SetString(prefs::kSpellCheckDictionary, "fr");
+ ASSERT_TRUE(SpellingServiceClient::IsAvailable(
+ menu()->GetProfile(), SpellingServiceClient::SUGGEST));
+ ASSERT_FALSE(SpellingServiceClient::IsAvailable(
+ menu()->GetProfile(), SpellingServiceClient::SPELLCHECK));
+ }
+
virtual ~SpellingMenuObserverTest();
MockRenderViewContextMenu* menu() { return menu_.get(); }
SpellingMenuObserver* observer() { return observer_.get(); }
@@ -323,15 +333,7 @@ IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest, EnableSpellingService) {
// Test that there will be a separator after "no suggestions" if
// SpellingServiceClient::SUGGEST is on.
IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest, SeparatorAfterSuggestions) {
- menu()->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- command_line->AppendSwitch(switches::kUseSpellingSuggestions);
-
- // Force a non-empty locale so SUGGEST is available.
- menu()->GetPrefs()->SetString(prefs::kSpellCheckDictionary, "en");
- EXPECT_TRUE(SpellingServiceClient::IsAvailable(menu()->GetProfile(),
- SpellingServiceClient::SUGGEST));
-
+ ForceSuggestMode();
InitMenu("jhhj", NULL);
// The test should see a top separator, "No spelling suggestions",
@@ -467,9 +469,7 @@ IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest, SuggestionsForceTopSeparator) {
// Case #3. Misspelled word, suggestion service is on.
Reset(false);
- menu()->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- command_line->AppendSwitch(switches::kUseSpellingSuggestions);
+ ForceSuggestMode();
InitMenu("asdfkj", NULL);
// Should have at least 2 entries. Separator, suggestion.
« no previous file with comments | « no previous file | chrome/browser/spellchecker/spelling_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698