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

Unified Diff: net/quic/quic_network_transaction_unittest.cc

Issue 1137073003: Add a new disable_insecure_quic finch parameter to disable insecure QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 5 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
« chrome/browser/io_thread.h ('K') | « net/http/http_stream_factory_impl.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 4472d40cbf3818b8e8ec2785caaddc3d8246914d..4ae59afff1dbb62d543b22b75206c28eaf50d6eb 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -691,6 +691,29 @@ TEST_P(QuicNetworkTransactionTest, DontUseAlternateProtocolProbabilityForQuic) {
SendRequestAndExpectHttpResponse("hello world");
}
+TEST_P(QuicNetworkTransactionTest, DontUseAlternateProtocolForInsecureQuic) {
+ MockRead http_reads[] = {MockRead("HTTP/1.1 200 OK\r\n"),
+ MockRead("Content-length: 11\r\n"),
+ MockRead("Alternate-Protocol: 443:quic\r\n\r\n"),
+ MockRead("hello world"),
+ MockRead("HTTP/1.1 200 OK\r\n"),
+ MockRead("Content-length: 11\r\n"),
+ MockRead("Alternate-Protocol: 443:quic\r\n\r\n"),
+ MockRead("hello world"),
+ MockRead(ASYNC, OK)};
+
+ StaticSocketDataProvider http_data(http_reads, arraysize(http_reads), nullptr,
+ 0);
+ socket_factory_.AddSocketDataProvider(&http_data);
+ socket_factory_.AddSocketDataProvider(&http_data);
+
+ params_.disable_insecure_quic = true;
+ CreateSessionWithNextProtos();
+
+ SendRequestAndExpectHttpResponse("hello world");
+ SendRequestAndExpectHttpResponse("hello world");
+}
+
TEST_P(QuicNetworkTransactionTest,
DontUseAlternateProtocolWithBadProbabilityForQuic) {
MockRead http_reads[] = {
« chrome/browser/io_thread.h ('K') | « net/http/http_stream_factory_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698