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

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

Issue 7558014: Add a URL param to indicate group selection in Instant field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thread safe handling of Profiles Created 9 years, 4 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
Index: chrome/browser/search_engines/search_host_to_urls_map_unittest.cc
diff --git a/chrome/browser/search_engines/search_host_to_urls_map_unittest.cc b/chrome/browser/search_engines/search_host_to_urls_map_unittest.cc
index 501b7c723143caf94b10d5fa822fa60b02886ea8..f7e9af3d345f4dc1695cd0907ef8a9c474ec7837 100644
--- a/chrome/browser/search_engines/search_host_to_urls_map_unittest.cc
+++ b/chrome/browser/search_engines/search_host_to_urls_map_unittest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/search_engines/search_host_to_urls_map.h"
#include "chrome/browser/search_engines/search_terms_data.h"
#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/test/base/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
typedef SearchHostToURLsMap::TemplateURLSet TemplateURLSet;
@@ -29,6 +30,7 @@ class SearchHostToURLsMapTest : public testing::Test {
scoped_ptr<SearchHostToURLsMap> provider_map_;
TemplateURL t_urls_[2];
std::string host_;
+ TestingProfile profile_;
Peter Kasting 2011/08/10 20:54:06 You don't need this. None of the SearchHostToURLs
DISALLOW_COPY_AND_ASSIGN(SearchHostToURLsMapTest);
};
@@ -44,7 +46,7 @@ void SearchHostToURLsMapTest::SetUp() {
template_urls.push_back(&t_urls_[1]);
provider_map_.reset(new SearchHostToURLsMap);
- UIThreadSearchTermsData search_terms_data;
+ UIThreadSearchTermsData search_terms_data(&profile_);
provider_map_->Init(template_urls, search_terms_data);
}
@@ -52,14 +54,14 @@ TEST_F(SearchHostToURLsMapTest, Add) {
std::string new_host = "example.com";
TemplateURL new_t_url;
new_t_url.SetURL("http://" + new_host + "/", 0, 0);
- UIThreadSearchTermsData search_terms_data;
+ UIThreadSearchTermsData search_terms_data(&profile_);
provider_map_->Add(&new_t_url, search_terms_data);
ASSERT_EQ(&new_t_url, provider_map_->GetTemplateURLForHost(new_host));
}
TEST_F(SearchHostToURLsMapTest, Remove) {
- provider_map_->Remove(&t_urls_[0]);
+ provider_map_->Remove(&t_urls_[0], &profile_);
const TemplateURL* found_url = provider_map_->GetTemplateURLForHost(host_);
ASSERT_TRUE(found_url == &t_urls_[1]);
@@ -81,15 +83,15 @@ TEST_F(SearchHostToURLsMapTest, Update) {
TemplateURL new_values;
new_values.SetURL("http://" + new_host + "/", 0, 0);
- UIThreadSearchTermsData search_terms_data;
- provider_map_->Update(&t_urls_[0], new_values, search_terms_data);
+ UIThreadSearchTermsData search_terms_data(&profile_);
+ provider_map_->Update(&t_urls_[0], new_values, search_terms_data, &profile_);
ASSERT_EQ(&t_urls_[0], provider_map_->GetTemplateURLForHost(new_host));
ASSERT_EQ(&t_urls_[1], provider_map_->GetTemplateURLForHost(host_));
}
TEST_F(SearchHostToURLsMapTest, UpdateGoogleBaseURLs) {
- UIThreadSearchTermsData search_terms_data;
+ UIThreadSearchTermsData search_terms_data(&profile_);
std::string google_base_url = "google.com";
SetGoogleBaseURL("http://" + google_base_url +"/");

Powered by Google App Engine
This is Rietveld 408576698