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

Unified Diff: chrome/browser/spellchecker/spelling_service_client_unittest.cc

Issue 2159283003: [WIP][DO NOT LAND] Componentize spellcheck Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « chrome/browser/spellchecker/spelling_service_client.cc ('k') | chrome/browser/spellchecker/word_trimmer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spelling_service_client_unittest.cc
diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc
index bf424119708286da0d5ff5f0565e06c38160b708..d9fae8661ccd0db11e94e38b66ed37df3c24d1c6 100644
--- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc
+++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/spellchecker/spelling_service_client.h"
+#include "components/spellcheck/browser/spelling_service_client.h"
#include <stddef.h>
@@ -16,8 +16,9 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/common/spellcheck_result.h"
+//#include "chrome/common/pref_names.h"
+#include "components/spellcheck/browser/pref_names.h"
+#include "components/spellcheck/common/spellcheck_result.h"
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
@@ -331,8 +332,8 @@ TEST_F(SpellingServiceClientTest, RequestTextCheck) {
};
PrefService* pref = profile_.GetPrefs();
- pref->SetBoolean(prefs::kEnableContinuousSpellcheck, true);
- pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
+ pref->SetBoolean(spellcheck::prefs::kEnableContinuousSpellcheck, true);
+ pref->SetBoolean(spellcheck::prefs::kSpellCheckUseSpellingService, true);
for (size_t i = 0; i < arraysize(kTests); ++i) {
client_.SetHTTPRequest(kTests[i].request_type,
@@ -343,7 +344,7 @@ TEST_F(SpellingServiceClientTest, RequestTextCheck) {
kTests[i].corrected_text);
base::ListValue dictionary;
dictionary.AppendString(kTests[i].language);
- pref->Set(prefs::kSpellCheckDictionaries, dictionary);
+ pref->Set(spellcheck::prefs::kSpellCheckDictionaries, dictionary);
client_.RequestTextCheck(
&profile_,
@@ -366,20 +367,20 @@ TEST_F(SpellingServiceClientTest, AvailableServices) {
// When a user disables spellchecking or prevent using the Spelling service,
// this function should return false both for suggestions and for spellcheck.
PrefService* pref = profile_.GetPrefs();
- pref->SetBoolean(prefs::kEnableContinuousSpellcheck, false);
- pref->SetBoolean(prefs::kSpellCheckUseSpellingService, false);
+ pref->SetBoolean(spellcheck::prefs::kEnableContinuousSpellcheck, false);
+ pref->SetBoolean(spellcheck::prefs::kSpellCheckUseSpellingService, false);
EXPECT_FALSE(client_.IsAvailable(&profile_, kSuggest));
EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck));
- pref->SetBoolean(prefs::kEnableContinuousSpellcheck, true);
- pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
+ pref->SetBoolean(spellcheck::prefs::kEnableContinuousSpellcheck, true);
+ pref->SetBoolean(spellcheck::prefs::kSpellCheckUseSpellingService, true);
// For locales supported by the SpellCheck service, this function returns
// false for suggestions and true for spellcheck. (The comment in
// SpellingServiceClient::IsAvailable() describes why this function returns
// false for suggestions.) If there is no language set, then we
// do not allow any remote.
- pref->Set(prefs::kSpellCheckDictionaries, base::ListValue());
+ pref->Set(spellcheck::prefs::kSpellCheckDictionaries, base::ListValue());
EXPECT_FALSE(client_.IsAvailable(&profile_, kSuggest));
EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck));
@@ -392,7 +393,7 @@ TEST_F(SpellingServiceClientTest, AvailableServices) {
for (size_t i = 0; i < arraysize(kSupported); ++i) {
base::ListValue dictionary;
dictionary.AppendString(kSupported[i]);
- pref->Set(prefs::kSpellCheckDictionaries, dictionary);
+ pref->Set(spellcheck::prefs::kSpellCheckDictionaries, dictionary);
EXPECT_FALSE(client_.IsAvailable(&profile_, kSuggest));
EXPECT_TRUE(client_.IsAvailable(&profile_, kSpellcheck));
@@ -410,7 +411,7 @@ TEST_F(SpellingServiceClientTest, AvailableServices) {
SCOPED_TRACE(std::string("Expected language ") + kUnsupported[i]);
base::ListValue dictionary;
dictionary.AppendString(kUnsupported[i]);
- pref->Set(prefs::kSpellCheckDictionaries, dictionary);
+ pref->Set(spellcheck::prefs::kSpellCheckDictionaries, dictionary);
EXPECT_TRUE(client_.IsAvailable(&profile_, kSuggest));
EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck));
« no previous file with comments | « chrome/browser/spellchecker/spelling_service_client.cc ('k') | chrome/browser/spellchecker/word_trimmer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698