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

Unified Diff: chrome/browser/metrics/variations/variations_service_unittest.cc

Issue 1320503005: Revert of Turn VariationsService::GetVariationsServerURL into instance method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/metrics/variations/variations_service_unittest.cc
diff --git a/chrome/browser/metrics/variations/variations_service_unittest.cc b/chrome/browser/metrics/variations/variations_service_unittest.cc
index aea69feb1bd60d4f5596e11a14e8fbd5654cef40..dee8dfa45d87c21d84c55fcc8449f62012fe7556 100644
--- a/chrome/browser/metrics/variations/variations_service_unittest.cc
+++ b/chrome/browser/metrics/variations/variations_service_unittest.cc
@@ -264,22 +264,20 @@
VariationsService::GetDefaultVariationsServerURLForTesting();
std::string value;
- TestVariationsService service(
- new web_resource::TestRequestAllowedNotifier(prefs), prefs);
- GURL url = service.GetVariationsServerURL(prefs, std::string());
+ GURL url = VariationsService::GetVariationsServerURL(prefs, std::string());
EXPECT_TRUE(base::StartsWith(url.spec(), default_variations_url,
base::CompareCase::SENSITIVE));
EXPECT_FALSE(net::GetValueForKeyInQuery(url, "restrict", &value));
prefs_store.SetVariationsRestrictParameterPolicyValue("restricted");
- url = service.GetVariationsServerURL(prefs, std::string());
+ url = VariationsService::GetVariationsServerURL(prefs, std::string());
EXPECT_TRUE(base::StartsWith(url.spec(), default_variations_url,
base::CompareCase::SENSITIVE));
EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value));
EXPECT_EQ("restricted", value);
// The override value should take precedence over what's in prefs.
- url = service.GetVariationsServerURL(prefs, "override");
+ url = VariationsService::GetVariationsServerURL(prefs, "override");
EXPECT_TRUE(base::StartsWith(url.spec(), default_variations_url,
base::CompareCase::SENSITIVE));
EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value));
@@ -289,9 +287,8 @@
TEST_F(VariationsServiceTest, VariationsURLHasOSNameParam) {
TestingPrefServiceSimple prefs;
VariationsService::RegisterPrefs(prefs.registry());
- TestVariationsService service(
- new web_resource::TestRequestAllowedNotifier(&prefs), &prefs);
- const GURL url = service.GetVariationsServerURL(&prefs, std::string());
+ const GURL url =
+ VariationsService::GetVariationsServerURL(&prefs, std::string());
std::string value;
EXPECT_TRUE(net::GetValueForKeyInQuery(url, "osname", &value));
@@ -339,7 +336,7 @@
TestVariationsService service(
new web_resource::TestRequestAllowedNotifier(&prefs), &prefs);
service.variations_server_url_ =
- service.GetVariationsServerURL(&prefs, std::string());
+ VariationsService::GetVariationsServerURL(&prefs, std::string());
service.set_intercepts_fetch(false);
net::TestURLFetcherFactory factory;
@@ -370,7 +367,7 @@
make_scoped_ptr(new ChromeVariationsServiceClient()),
new web_resource::TestRequestAllowedNotifier(&prefs), &prefs, NULL);
service.variations_server_url_ =
- service.GetVariationsServerURL(&prefs, std::string());
+ VariationsService::GetVariationsServerURL(&prefs, std::string());
for (size_t i = 0; i < arraysize(non_ok_status_codes); ++i) {
net::TestURLFetcherFactory factory;
service.DoActualFetch();
@@ -391,7 +388,7 @@
TestVariationsService service(
new web_resource::TestRequestAllowedNotifier(&prefs), &prefs);
service.variations_server_url_ =
- service.GetVariationsServerURL(&prefs, std::string());
+ VariationsService::GetVariationsServerURL(&prefs, std::string());
service.set_intercepts_fetch(false);
net::TestURLFetcherFactory factory;
« no previous file with comments | « chrome/browser/metrics/variations/variations_service.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698