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

Unified Diff: chrome/browser/search_engines/template_url_service_unittest.cc

Issue 13727003: Remove unused BuildQueryTerms from TemplateURLService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « chrome/browser/search_engines/template_url_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_service_unittest.cc
diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc
index 128d3b9862e9ae2467e6ccac90c6a70b28f2b9bf..0256bf644ed4412d287a4541e154887e5c38d8cb 100644
--- a/chrome/browser/search_engines/template_url_service_unittest.cc
+++ b/chrome/browser/search_engines/template_url_service_unittest.cc
@@ -922,52 +922,6 @@ TEST_F(TemplateURLServiceTest, DefaultSearchProviderLoadedFromPrefs) {
AssertEquals(*cloned_url, *model()->GetDefaultSearchProvider());
}
-TEST_F(TemplateURLServiceTest, BuildQueryTerms) {
- struct TestData {
- const std::string url;
- const bool result;
- // Keys and values are a semicolon separated list of expected values in the
- // map.
- const std::string keys;
- const std::string values;
- } data[] = {
- // No query should return false.
- { "http://blah/", false, "", "" },
-
- // Query with empty key should return false.
- { "http://blah/foo?=y", false, "", "" },
-
- // Query with key occurring multiple times should return false.
- { "http://blah/foo?x=y&x=z", false, "", "" },
-
- { "http://blah/foo?x=y", true, "x", "y" },
- { "http://blah/foo?x=y&y=z", true, "x;y", "y;z" },
-
- // Key occurring multiple times should get an empty string.
- { "http://blah/foo?x=y&x=z&y=z", true, "x;y", ";z" },
- };
-
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
- TemplateURLService::QueryTerms terms;
- ASSERT_EQ(data[i].result,
- TemplateURLService::BuildQueryTerms(GURL(data[i].url), &terms));
- if (data[i].result) {
- std::vector<std::string> keys;
- std::vector<std::string> values;
- base::SplitString(data[i].keys, ';', &keys);
- base::SplitString(data[i].values, ';', &values);
- ASSERT_TRUE(keys.size() == values.size());
- ASSERT_EQ(keys.size(), terms.size());
- for (size_t j = 0; j < keys.size(); ++j) {
- TemplateURLService::QueryTerms::iterator term_iterator =
- terms.find(keys[j]);
- ASSERT_TRUE(term_iterator != terms.end());
- ASSERT_EQ(values[j], term_iterator->second);
- }
- }
- }
-}
-
TEST_F(TemplateURLServiceTest, UpdateKeywordSearchTermsForURL) {
struct TestData {
const std::string url;
« no previous file with comments | « chrome/browser/search_engines/template_url_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698