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

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

Issue 10173001: Add a Profile* member to TemplateURL. This makes some invocations of ReplaceSearchTerms() a bit le… (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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 content::NotificationService::NoDetails()); 229 content::NotificationService::NoDetails());
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 TemplateURLData data; 235 TemplateURLData data;
236 data.short_name = keyword; 236 data.short_name = keyword;
237 data.SetKeyword(keyword); 237 data.SetKeyword(keyword);
238 data.SetURL(url); 238 data.SetURL(url);
239 TemplateURL* t_url = new TemplateURL(data); 239 TemplateURL* t_url = new TemplateURL(util_.profile(), data);
240 util_.model()->Add(t_url); 240 util_.model()->Add(t_url);
241 return t_url; 241 return t_url;
242 } 242 }
243 243
244 244
245 // Actual tests --------------------------------------------------------------- 245 // Actual tests ---------------------------------------------------------------
246 246
247 TEST_F(SearchProviderInstallDataTest, GetInstallState) { 247 TEST_F(SearchProviderInstallDataTest, GetInstallState) {
248 // Set up the database. 248 // Set up the database.
249 util_.ChangeModelToLoadState(); 249 util_.ChangeModelToLoadState();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // Change the Google base url. 320 // Change the Google base url.
321 google_host = "foo.com"; 321 google_host = "foo.com";
322 util_.SetGoogleBaseURL(GURL("http://" + google_host + "/")); 322 util_.SetGoogleBaseURL(GURL("http://" + google_host + "/"));
323 // Wait for the I/O thread to process the update notification. 323 // Wait for the I/O thread to process the update notification.
324 TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests(); 324 TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests();
325 325
326 // Verify that the change got picked up. 326 // Verify that the change got picked up.
327 test_get_install_state->set_search_provider_host(google_host); 327 test_get_install_state->set_search_provider_host(google_host);
328 EXPECT_TRUE(test_get_install_state->RunTests()); 328 EXPECT_TRUE(test_get_install_state->RunTests());
329 } 329 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698