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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc

Issue 279633003: Use non-static set_key interface on DataReductionProxySettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp Created 6 years, 7 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
« no previous file with comments | « components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
index ddb56a9ea84b297f27479d584101561ad8fce455..56778a758c22600453e90a93b8a8134107fc1a13 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
@@ -41,7 +41,8 @@ class DataReductionProxySettingsTest
TEST_F(DataReductionProxySettingsTest, TestAuthenticationInit) {
AddProxyToCommandLine();
net::HttpAuthCache cache;
- DataReductionProxySettings::InitDataReductionAuthentication(&cache);
+ DataReductionProxySettings::InitDataReductionAuthentication(
+ &cache, kDataReductionProxyKey);
DataReductionProxySettings::DataReductionProxyList proxies =
DataReductionProxySettings::GetDataReductionProxies();
for (DataReductionProxySettings::DataReductionProxyList::iterator it =
@@ -120,7 +121,8 @@ TEST_F(DataReductionProxySettingsTest, TestAuthHashGeneration) {
std::string salted_key = salt + kDataReductionProxyKey + salt;
base::string16 expected_hash = base::UTF8ToUTF16(base::MD5String(salted_key));
EXPECT_EQ(expected_hash,
- DataReductionProxySettings::AuthHashForSalt(8675309));
+ DataReductionProxySettings::AuthHashForSalt(
+ 8675309, kDataReductionProxyKey));
}
// Test that the auth key set by preprocessor directive is not used
@@ -131,7 +133,8 @@ TEST_F(DataReductionProxySettingsTest,
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kDataReductionProxy, kDataReductionProxy);
EXPECT_EQ(base::string16(),
- DataReductionProxySettings::AuthHashForSalt(8675309));
+ DataReductionProxySettings::AuthHashForSalt(
+ 8675309, kDataReductionProxyKey));
}
TEST_F(DataReductionProxySettingsTest, TestIsProxyEnabledOrManaged) {
@@ -207,8 +210,7 @@ TEST_F(DataReductionProxySettingsTest, TestChallengeTokens) {
auth_info->challenger =
net::HostPortPair::FromString(kDataReductionProxy);
auth_info->realm = tests[i].realm;
- base::string16 token =
- DataReductionProxySettings::GetTokenForAuthChallenge(auth_info.get());
+ base::string16 token = settings_->GetTokenForAuthChallenge(auth_info.get());
EXPECT_EQ(tests[i].expected_empty_token, token.empty());
}
}
« no previous file with comments | « components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698