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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc
index 0416461c20b943127a027ff815a380597a54309e..240b7ee3b6cb3e39a7d4fe80eca832eaec4631e4 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc
@@ -26,9 +26,11 @@ const char kDataReductionProxyOrigin[] = "https://foo.com:443/";
const char kDataReductionProxyDev[] = "http://foo-dev.com:80";
template <class C>
-void data_reduction_proxy::DataReductionProxySettingsTestBase::ResetSettings() {
+void data_reduction_proxy::DataReductionProxySettingsTestBase::ResetSettings(
+ bool allowed, bool fallback_allowed, bool alt_allowed, bool promo_allowed) {
MockDataReductionProxySettings<C>* settings =
- new MockDataReductionProxySettings<C>;
+ new MockDataReductionProxySettings<C>(
+ allowed, fallback_allowed, alt_allowed, promo_allowed);
EXPECT_CALL(*settings, GetOriginalProfilePrefs())
.Times(AnyNumber())
.WillRepeatedly(Return(&pref_service_));
@@ -68,7 +70,10 @@ void data_reduction_proxy::DataReductionProxySettingsTestBase::SetProbeResult(
template void
data_reduction_proxy::DataReductionProxySettingsTestBase::ResetSettings<
- DataReductionProxySettingsAndroid>();
+ DataReductionProxySettingsAndroid>(bool allowed,
+ bool fallback_allowed,
+ bool alt_allowed,
+ bool promo_allowed);
template void
data_reduction_proxy::DataReductionProxySettingsTestBase::SetProbeResult<
@@ -103,7 +108,8 @@ TEST_F(DataReductionProxySettingsAndroidTest, TestGetDataReductionProxyOrigin) {
Settings()->GetDataReductionProxyOrigin(env_, NULL);
ASSERT_TRUE(result.obj());
const base::android::JavaRef<jstring>& str_ref = result;
- EXPECT_EQ(kDataReductionProxyOrigin, ConvertJavaStringToUTF8(str_ref));
+ EXPECT_EQ(GURL(kDataReductionProxyOrigin),
+ GURL(ConvertJavaStringToUTF8(str_ref)));
}
TEST_F(DataReductionProxySettingsAndroidTest,
@@ -112,11 +118,13 @@ TEST_F(DataReductionProxySettingsAndroidTest,
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
data_reduction_proxy::switches::kDataReductionProxyDev,
kDataReductionProxyDev);
+ ResetSettings(true, true, false, true);
ScopedJavaLocalRef<jstring> result =
Settings()->GetDataReductionProxyOrigin(env_, NULL);
ASSERT_TRUE(result.obj());
const base::android::JavaRef<jstring>& str_ref = result;
- EXPECT_EQ(kDataReductionProxyDev, ConvertJavaStringToUTF8(str_ref));
+ EXPECT_EQ(GURL(kDataReductionProxyDev),
+ GURL(ConvertJavaStringToUTF8(str_ref)));
}
TEST_F(DataReductionProxySettingsAndroidTest, TestGetDailyContentLengths) {

Powered by Google App Engine
This is Rietveld 408576698