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

Unified Diff: components/search_engines/default_search_policy_handler_unittest.cc

Issue 2497853002: Create TemplateUrlData to base::Dictionary utility functions (Closed)
Patch Set: Fixed android compilation Created 4 years, 1 month 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
Index: components/search_engines/default_search_policy_handler_unittest.cc
diff --git a/components/search_engines/default_search_policy_handler_unittest.cc b/components/search_engines/default_search_policy_handler_unittest.cc
index fece4e7a298eebc33e48f89c25e6e7803a1d6cf5..3f9c6ac1c4066c95eddb453d17ef1a7c889b356b 100644
--- a/components/search_engines/default_search_policy_handler_unittest.cc
+++ b/components/search_engines/default_search_policy_handler_unittest.cc
@@ -14,13 +14,6 @@
#include "components/search_engines/default_search_manager.h"
#include "components/search_engines/search_engines_pref_names.h"
-namespace {
-// TODO(caitkp): Should we find a way to route this through DefaultSearchManager
-// to avoid hardcoding this here?
-const char kDefaultSearchProviderData[] =
- "default_search_provider_data.template_url_data";
-} // namespace
-
namespace policy {
class DefaultSearchPolicyHandlerTest
@@ -133,7 +126,8 @@ TEST_F(DefaultSearchPolicyHandlerTest, MissingUrl) {
UpdateProviderPolicy(policy);
const base::Value* temp = nullptr;
- EXPECT_FALSE(store_->GetValue(kDefaultSearchProviderData, &temp));
+ EXPECT_FALSE(store_->GetValue(
+ DefaultSearchManager::kDefaultSearchProviderDataPrefName, &temp));
}
// Checks that if the default search policy is invalid, that no elements of the
@@ -148,7 +142,8 @@ TEST_F(DefaultSearchPolicyHandlerTest, Invalid) {
UpdateProviderPolicy(policy);
const base::Value* temp = nullptr;
- EXPECT_FALSE(store_->GetValue(kDefaultSearchProviderData, &temp));
+ EXPECT_FALSE(store_->GetValue(
+ DefaultSearchManager::kDefaultSearchProviderDataPrefName, &temp));
}
// Checks that for a fully defined search policy, all elements have been
@@ -162,7 +157,8 @@ TEST_F(DefaultSearchPolicyHandlerTest, FullyDefined) {
const base::DictionaryValue* dictionary;
std::string value;
const base::ListValue* list_value;
- EXPECT_TRUE(store_->GetValue(kDefaultSearchProviderData, &temp));
+ EXPECT_TRUE(store_->GetValue(
+ DefaultSearchManager::kDefaultSearchProviderDataPrefName, &temp));
temp->GetAsDictionary(&dictionary);
EXPECT_TRUE(dictionary->GetString(DefaultSearchManager::kURL, &value));
@@ -224,7 +220,8 @@ TEST_F(DefaultSearchPolicyHandlerTest, Disabled) {
UpdateProviderPolicy(policy);
const base::Value* temp = NULL;
const base::DictionaryValue* dictionary;
- EXPECT_TRUE(store_->GetValue(kDefaultSearchProviderData, &temp));
+ EXPECT_TRUE(store_->GetValue(
+ DefaultSearchManager::kDefaultSearchProviderDataPrefName, &temp));
temp->GetAsDictionary(&dictionary);
bool disabled = false;
EXPECT_TRUE(dictionary->GetBoolean(DefaultSearchManager::kDisabledByPolicy,
@@ -248,7 +245,8 @@ TEST_F(DefaultSearchPolicyHandlerTest, MinimallyDefined) {
const base::DictionaryValue* dictionary;
std::string value;
const base::ListValue* list_value;
- EXPECT_TRUE(store_->GetValue(kDefaultSearchProviderData, &temp));
+ EXPECT_TRUE(store_->GetValue(
+ DefaultSearchManager::kDefaultSearchProviderDataPrefName, &temp));
temp->GetAsDictionary(&dictionary);
// Name and keyword should be derived from host.
@@ -306,7 +304,8 @@ TEST_F(DefaultSearchPolicyHandlerTest, FileURL) {
const base::DictionaryValue* dictionary;
std::string value;
- EXPECT_TRUE(store_->GetValue(kDefaultSearchProviderData, &temp));
+ EXPECT_TRUE(store_->GetValue(
+ DefaultSearchManager::kDefaultSearchProviderDataPrefName, &temp));
temp->GetAsDictionary(&dictionary);
EXPECT_TRUE(dictionary->GetString(DefaultSearchManager::kURL, &value));
« no previous file with comments | « components/search_engines/default_search_manager_unittest.cc ('k') | components/search_engines/template_url_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698