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

Unified Diff: net/proxy/proxy_service_unittest.cc

Issue 449973002: Use data reduction proxy when managed proxy config returns direct (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-uma-in-proxy-service
Patch Set: Addressed comment and nit Created 6 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
« net/base/network_delegate.h ('K') | « net/proxy/proxy_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service_unittest.cc
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index a2dcf3fd8101a18985741d9af990ea4b26ac4877..1d5b1c7e5875ed95d668123d4866c2c39a710c53 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -161,12 +161,16 @@ class TestResolveProxyNetworkDelegate : public NetworkDelegate {
TestResolveProxyNetworkDelegate()
: on_resolve_proxy_called_(false),
add_proxy_(false),
- remove_proxy_(false) {
+ remove_proxy_(false),
+ proxy_service_(NULL) {
}
- virtual void OnResolveProxy(
- const GURL& url, int load_flags, ProxyInfo* result) OVERRIDE {
+ virtual void OnResolveProxy(const GURL& url,
+ int load_flags,
+ const ProxyService& proxy_service,
+ ProxyInfo* result) OVERRIDE {
on_resolve_proxy_called_ = true;
+ proxy_service_ = &proxy_service;
DCHECK(!add_proxy_ || !remove_proxy_);
if (add_proxy_) {
result->UseNamedProxy("delegate_proxy.com");
@@ -187,10 +191,15 @@ class TestResolveProxyNetworkDelegate : public NetworkDelegate {
remove_proxy_ = remove_proxy;
}
+ const ProxyService* proxy_service() const {
+ return proxy_service_;
+ }
+
private:
bool on_resolve_proxy_called_;
bool add_proxy_;
bool remove_proxy_;
+ const ProxyService* proxy_service_;
};
// A test network delegate that exercises the OnProxyFallback callback.
@@ -299,6 +308,7 @@ TEST_F(ProxyServiceTest, OnResolveProxyCallbackAddProxy) {
url, net::LOAD_NORMAL, &info, callback.callback(), NULL, &delegate,
log.bound());
EXPECT_TRUE(delegate.on_resolve_proxy_called());
+ EXPECT_EQ(&service, delegate.proxy_service());
// Verify that the NetworkDelegate's behavior is stateless across
// invocations of ResolveProxy. Start by having the callback add a proxy
« net/base/network_delegate.h ('K') | « net/proxy/proxy_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698