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

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

Issue 30883003: Simple fallback implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patched
Patch Set: Created 7 years, 2 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 4b2f79bc55a06226ed932230123e07f86b31fa6e..f384ea9f589ad2cc8b360fdf79f416ef158f1297 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,7 +26,9 @@
#include "url/gurl.h"
const char kDataReductionProxyOrigin[] = "https://foo:443/";
-const char kDataReductionProxyOriginHostPort[] = "foo:443";
+const char kDataReductionProxyOriginPAC[] = "HTTPS foo:443;";
+const char kDataReductionProxyFallback[] = "http://bar:80/";
+const char kDataReductionProxyFallbackPAC[] = "HTTP bar:80;";
const char kDataReductionProxyAuth[] = "12345";
class TestDataReductionProxySettingsAndroid
@@ -174,9 +176,13 @@ TEST_F(DataReductionProxySettingsAndroidTest, TestBypassPACRules) {
}
TEST_F(DataReductionProxySettingsAndroidTest, TestSetProxyPac) {
+ AddProxyToCommandLine();
settings_->AddDefaultProxyBypassRules();
+ std::string raw_pac = settings_->GetProxyPacScript();
+ EXPECT_NE(raw_pac.find(kDataReductionProxyOriginPAC), std::string::npos);
+ EXPECT_NE(raw_pac.find(kDataReductionProxyFallbackPAC), std::string::npos);;
std::string pac;
- base::Base64Encode(settings_->GetProxyPacScript(), &pac);
+ base::Base64Encode(raw_pac, &pac);
std::string expected_pac_url =
"data:application/x-ns-proxy-autoconfig;base64," + pac;
// Test setting the PAC, without generating histograms.

Powered by Google App Engine
This is Rietveld 408576698