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

Side by Side Diff: components/search_engines/default_search_manager_unittest.cc

Issue 2659353002: Fix TemplateUrl::MatchesData comparison of search_terms_replacement_key (reland) (Closed)
Patch Set: Fixed deps Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/search_engines/default_search_manager.h" 5 #include "components/search_engines/default_search_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 data.alternate_urls.push_back("http://foo1/alt"); 111 data.alternate_urls.push_back("http://foo1/alt");
112 data.favicon_url = GURL("http://icon1"); 112 data.favicon_url = GURL("http://icon1");
113 data.safe_for_autoreplace = true; 113 data.safe_for_autoreplace = true;
114 data.input_encodings = base::SplitString( 114 data.input_encodings = base::SplitString(
115 "UTF-8;UTF-16", ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 115 "UTF-8;UTF-16", ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
116 data.date_created = base::Time(); 116 data.date_created = base::Time();
117 data.last_modified = base::Time(); 117 data.last_modified = base::Time();
118 data.last_modified = base::Time(); 118 data.last_modified = base::Time();
119 119
120 manager.SetUserSelectedDefaultSearchEngine(data); 120 manager.SetUserSelectedDefaultSearchEngine(data);
121 TemplateURLData* read_data = manager.GetDefaultSearchEngine(NULL); 121 const TemplateURLData* read_data = manager.GetDefaultSearchEngine(nullptr);
122 ExpectSimilar(&data, read_data); 122 ExpectSimilar(&data, read_data);
123 } 123 }
124 124
125 // Test DefaultSearchmanager handles user-selected DSEs correctly. 125 // Test DefaultSearchmanager handles user-selected DSEs correctly.
126 TEST_F(DefaultSearchManagerTest, DefaultSearchSetByUserPref) { 126 TEST_F(DefaultSearchManagerTest, DefaultSearchSetByUserPref) {
127 size_t default_search_index = 0; 127 size_t default_search_index = 0;
128 DefaultSearchManager manager(pref_service(), 128 DefaultSearchManager manager(pref_service(),
129 DefaultSearchManager::ObserverCallback()); 129 DefaultSearchManager::ObserverCallback());
130 std::vector<std::unique_ptr<TemplateURLData>> prepopulated_urls = 130 std::vector<std::unique_ptr<TemplateURLData>> prepopulated_urls =
131 TemplateURLPrepopulateData::GetPrepopulatedEngines(pref_service(), 131 TemplateURLPrepopulateData::GetPrepopulatedEngines(pref_service(),
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 ExpectSimilar(extension_data_3.get(), 262 ExpectSimilar(extension_data_3.get(),
263 manager.GetDefaultSearchEngine(&source)); 263 manager.GetDefaultSearchEngine(&source));
264 EXPECT_EQ(DefaultSearchManager::FROM_EXTENSION, source); 264 EXPECT_EQ(DefaultSearchManager::FROM_EXTENSION, source);
265 265
266 manager.ClearExtensionControlledDefaultSearchEngine(); 266 manager.ClearExtensionControlledDefaultSearchEngine();
267 267
268 ExpectSimilar(data.get(), manager.GetDefaultSearchEngine(&source)); 268 ExpectSimilar(data.get(), manager.GetDefaultSearchEngine(&source));
269 EXPECT_EQ(DefaultSearchManager::FROM_USER, source); 269 EXPECT_EQ(DefaultSearchManager::FROM_USER, source);
270 } 270 }
OLDNEW
« no previous file with comments | « components/search_engines/default_search_manager.cc ('k') | components/search_engines/template_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698