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

Unified Diff: components/search_engines/template_url_prepopulate_data_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
« no previous file with comments | « components/search_engines/template_url_prepopulate_data.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url_prepopulate_data_unittest.cc
diff --git a/components/search_engines/template_url_prepopulate_data_unittest.cc b/components/search_engines/template_url_prepopulate_data_unittest.cc
index e57a940cf8947923a3ddc2deaa1f7e8a6dd5cb0d..096208c4e026a28d3278f70de4351756792c7125 100644
--- a/components/search_engines/template_url_prepopulate_data_unittest.cc
+++ b/components/search_engines/template_url_prepopulate_data_unittest.cc
@@ -19,6 +19,7 @@
#include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
+#include "components/search_engines/template_url_data_util.h"
#include "components/search_engines/template_url_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -153,6 +154,9 @@ TEST_F(TemplateURLPrepopulateDataTest, ProvidersFromPrefs) {
EXPECT_TRUE(t_urls[0]->instant_url.empty());
EXPECT_EQ(0u, t_urls[0]->alternate_urls.size());
EXPECT_TRUE(t_urls[0]->search_terms_replacement_key.empty());
+ EXPECT_TRUE(t_urls[0]->safe_for_autoreplace);
+ EXPECT_TRUE(t_urls[0]->date_created.is_null());
+ EXPECT_TRUE(t_urls[0]->last_modified.is_null());
// Test the optional settings too.
entry->SetString("suggest_url", "http://foo.com/suggest?q={searchTerms}");
@@ -272,6 +276,9 @@ TEST_F(TemplateURLPrepopulateDataTest, ProvidersFromPrepopulated) {
ASSERT_FALSE(GetHostFromTemplateURLData(*t_urls[i]).empty());
ASSERT_FALSE(t_urls[i]->input_encodings.empty());
EXPECT_GT(t_urls[i]->prepopulate_id, 0);
+ EXPECT_TRUE(t_urls[0]->safe_for_autoreplace);
+ EXPECT_TRUE(t_urls[0]->date_created.is_null());
+ EXPECT_TRUE(t_urls[0]->last_modified.is_null());
}
// Ensures the default URL is Google and has the optional fields filled.
@@ -357,8 +364,7 @@ TEST_F(TemplateURLPrepopulateDataTest, GetEngineTypeForAllPrepopulatedEngines) {
TemplateURLPrepopulateData::GetAllPrepopulatedEngines();
for (const PrepopulatedEngine* engine : all_engines) {
std::unique_ptr<TemplateURLData> data =
- TemplateURLPrepopulateData::MakeTemplateURLDataFromPrepopulatedEngine(
- *engine);
+ TemplateURLDataFromPrepopulatedEngine(*engine);
EXPECT_EQ(engine->type,
TemplateURL(*data).GetEngineType(SearchTermsData()));
}
« no previous file with comments | « components/search_engines/template_url_prepopulate_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698