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

Side by Side Diff: chrome/browser/search_engines/search_provider_install_data_unittest.cc

Issue 9982018: Move most TemplateURL data members to a new struct, TemplateURLData. This allows us to eliminate t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 service->SetManagedPref(prefs::kDefaultSearchProviderPrepopulateID, 225 service->SetManagedPref(prefs::kDefaultSearchProviderPrepopulateID,
226 new StringValue(std::string())); 226 new StringValue(std::string()));
227 util_.model()->Observe(chrome::NOTIFICATION_PREF_CHANGED, 227 util_.model()->Observe(chrome::NOTIFICATION_PREF_CHANGED,
228 content::Source<PrefService>(util_.profile()->GetTestingPrefService()), 228 content::Source<PrefService>(util_.profile()->GetTestingPrefService()),
229 content::Details<std::string>(NULL)); 229 content::Details<std::string>(NULL));
230 } 230 }
231 231
232 TemplateURL* SearchProviderInstallDataTest::AddNewTemplateURL( 232 TemplateURL* SearchProviderInstallDataTest::AddNewTemplateURL(
233 const std::string& url, 233 const std::string& url,
234 const string16& keyword) { 234 const string16& keyword) {
235 TemplateURL* t_url = new TemplateURL(); 235 TemplateURLData data;
236 t_url->set_short_name(keyword); 236 data.short_name = keyword;
237 t_url->set_keyword(keyword); 237 data.SetKeyword(keyword);
238 t_url->SetURL(url); 238 data.SetURL(url);
239 TemplateURL* t_url = new TemplateURL(data);
239 util_.model()->Add(t_url); 240 util_.model()->Add(t_url);
240 return t_url; 241 return t_url;
241 } 242 }
242 243
243 244
244 // Actual tests --------------------------------------------------------------- 245 // Actual tests ---------------------------------------------------------------
245 246
246 TEST_F(SearchProviderInstallDataTest, GetInstallState) { 247 TEST_F(SearchProviderInstallDataTest, GetInstallState) {
247 // Set up the database. 248 // Set up the database.
248 util_.ChangeModelToLoadState(); 249 util_.ChangeModelToLoadState();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // Change the Google base url. 320 // Change the Google base url.
320 google_host = "foo.com"; 321 google_host = "foo.com";
321 util_.SetGoogleBaseURL("http://" + google_host + "/"); 322 util_.SetGoogleBaseURL("http://" + google_host + "/");
322 // Wait for the I/O thread to process the update notification. 323 // Wait for the I/O thread to process the update notification.
323 TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests(); 324 TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests();
324 325
325 // Verify that the change got picked up. 326 // Verify that the change got picked up.
326 test_get_install_state->set_search_provider_host(google_host); 327 test_get_install_state->set_search_provider_host(google_host);
327 EXPECT_TRUE(test_get_install_state->RunTests()); 328 EXPECT_TRUE(test_get_install_state->RunTests());
328 } 329 }
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/search_host_to_urls_map_unittest.cc ('k') | chrome/browser/search_engines/template_url.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698