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

Unified Diff: net/quic/quic_network_transaction_unittest.cc

Issue 138283005: Enable QUIC proxies to be used for HTTP URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: QUIC proxies should be secure Created 6 years, 10 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 | « net/http/http_stream_factory_impl_job.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_network_transaction_unittest.cc
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index dd0bdb7b28a289caea4416d195bd2260be7397f1..851371d7e0cc634891621cd924ffa9af31fdb768 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -396,6 +396,43 @@ TEST_P(QuicNetworkTransactionTest, ForceQuic) {
EXPECT_EQ(3, log_stream_id);
}
+TEST_P(QuicNetworkTransactionTest, QuicProxy) {
+ proxy_service_.reset(
+ ProxyService::CreateFixedFromPacResult("QUIC myproxy:70"));
+
+ QuicStreamId stream_id = GetParam() > QUIC_VERSION_12 ? 5 : 3;
+ MockQuicData mock_quic_data;
+ if (GetParam() > QUIC_VERSION_12) {
+ mock_quic_data.AddWrite(
+ ConstructRequestHeadersPacket(1, stream_id, true, true,
+ GetRequestHeaders("GET", "http", "/")));
+ mock_quic_data.AddRead(
+ ConstructResponseHeadersPacket(1, stream_id, false, false,
+ GetResponseHeaders("200 OK")));
+ mock_quic_data.AddRead(
+ ConstructDataPacket(2, stream_id, false, true, 0, "hello!"));
+ mock_quic_data.AddWrite(ConstructAckPacket(2, 1));
+ } else {
+ mock_quic_data.AddWrite(
+ ConstructDataPacket(1, stream_id, true, true, 0,
+ GetRequestString("GET", "http", "/")));
+ mock_quic_data.AddRead(
+ ConstructDataPacket(1, stream_id, false, true, 0,
+ GetResponseString("200 OK", "hello!")));
+ mock_quic_data.AddWrite(ConstructAckPacket(1, 0));
+ }
+ mock_quic_data.AddRead(SYNCHRONOUS, 0); // EOF
+
+ mock_quic_data.AddDelayedSocketDataToFactory(&socket_factory_, 1);
+
+ // There is no need to set up an alternate protocol job, because
+ // no attempt will be made to speak to the proxy over TCP.
+
+ CreateSession();
+
+ SendRequestAndExpectQuicResponse("hello!");
+}
+
TEST_P(QuicNetworkTransactionTest, ForceQuicWithErrorConnecting) {
params_.origin_to_force_quic_on =
HostPortPair::FromString("www.google.com:80");
« no previous file with comments | « net/http/http_stream_factory_impl_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698