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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 1547273003: Set trusted SPDY proxy dynamically on per-profile basis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated based on design doc discussion Created 4 years, 11 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: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index ed7470b3a618ffba8be29837496992d3e2f5ca21..2c9c93e5c81a329d47c46ead6e1dfed14ad1e79a 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -32,6 +32,7 @@
#include "net/base/load_timing_info.h"
#include "net/base/load_timing_info_test_util.h"
#include "net/base/net_errors.h"
+#include "net/base/proxy_delegate.h"
#include "net/base/request_priority.h"
#include "net/base/test_completion_callback.h"
#include "net/base/test_data_directory.h"
@@ -63,6 +64,7 @@
#include "net/proxy/proxy_config_service_fixed.h"
#include "net/proxy/proxy_info.h"
#include "net/proxy/proxy_resolver.h"
+#include "net/proxy/proxy_server.h"
#include "net/proxy/proxy_service.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/client_socket_pool_manager.h"
@@ -7687,6 +7689,10 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) {
// Test that an explicitly trusted SPDY proxy can push a resource from an
// origin that is different from that of its associated resource.
TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPush) {
bengr 2016/01/26 23:23:26 CrossOriginSPDYProxyPush
tbansal1 2016/01/27 00:13:34 Done.
+ // Configure proxy delegate to enable cross-origin push.
bengr 2016/01/26 23:23:26 proxy -> the proxy enable -> allow push -> SPDY pu
tbansal1 2016/01/27 00:13:34 Done.
+ scoped_ptr<TestProxyDelegate> proxy_delegate(new TestProxyDelegate());
+ proxy_delegate->set_trusted_spdy_proxy(net::ProxyServer::FromURI(
+ "https://myproxy:443", net::ProxyServer::SCHEME_HTTP));
HttpRequestInfo request;
HttpRequestInfo push_request;
@@ -7695,14 +7701,13 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPush) {
push_request.method = "GET";
push_request.url = GURL("http://www.another-origin.com/foo.dat");
- // Configure against https proxy server "myproxy:70".
+ // Configure against https proxy server "myproxy:443".
session_deps_.proxy_service =
- ProxyService::CreateFixedFromPacResult("HTTPS myproxy:70");
+ ProxyService::CreateFixedFromPacResult("HTTPS myproxy:443");
BoundTestNetLog log;
session_deps_.net_log = log.bound().net_log();
- // Enable cross-origin push.
- session_deps_.trusted_spdy_proxy = "myproxy:70";
+ session_deps_.proxy_delegate.reset(proxy_delegate.release());
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
@@ -7804,18 +7809,22 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPush) {
// Test that an explicitly trusted SPDY proxy cannot push HTTPS content.
TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPushCorrectness) {
+ // Configure proxy delegate to enable cross-origin push.
bengr 2016/01/26 23:23:26 See above wording suggestions.
tbansal1 2016/01/27 00:13:34 Done.
+ scoped_ptr<TestProxyDelegate> proxy_delegate(new TestProxyDelegate());
+ proxy_delegate->set_trusted_spdy_proxy(net::ProxyServer::FromURI(
+ "https://myproxy:443", net::ProxyServer::SCHEME_HTTP));
HttpRequestInfo request;
request.method = "GET";
request.url = GURL("http://www.example.org/");
- // Configure against https proxy server "myproxy:70".
- session_deps_.proxy_service = ProxyService::CreateFixed("https://myproxy:70");
+ session_deps_.proxy_service =
+ ProxyService::CreateFixed("https://myproxy:443");
BoundTestNetLog log;
session_deps_.net_log = log.bound().net_log();
// Enable cross-origin push.
- session_deps_.trusted_spdy_proxy = "myproxy:70";
+ session_deps_.proxy_delegate.reset(proxy_delegate.release());
scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));

Powered by Google App Engine
This is Rietveld 408576698