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

Unified Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/spdy/spdy_network_transaction_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 21401b5e1f7c276fbc5b89b198427accc3edb21b..e286333617d117775414cc0ef3f4aeb901bb205c 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -417,7 +417,7 @@ class SpdyNetworkTransactionTest
DataVector data_vector_;
AlternateVector alternate_vector_;
AlternateDeterministicVector alternate_deterministic_vector_;
- const BoundNetLog& log_;
+ const BoundNetLog log_;
SpdyNetworkTransactionTestParams test_params_;
int port_;
bool deterministic_;
@@ -4556,6 +4556,27 @@ TEST_P(SpdyNetworkTransactionTest, CloseWithActiveStream) {
helper.VerifyDataConsumed();
}
+// HTTP_1_1_REQUIRED results in ERR_HTTP_1_1_REQUIRED.
+TEST_P(SpdyNetworkTransactionTest, HTTP11RequiredError) {
+ // HTTP_1_1_REQUIRED is only supported by SPDY4.
+ if (spdy_util_.spdy_version() < SPDY4)
+ return;
+
+ NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY,
+ BoundNetLog(), GetParam(), nullptr);
+
+ scoped_ptr<SpdyFrame> go_away(spdy_util_.ConstructSpdyGoAway(
+ 0, GOAWAY_HTTP_1_1_REQUIRED, "Try again using HTTP/1.1 please."));
+ MockRead reads[] = {
+ CreateMockRead(*go_away),
+ };
+ DelayedSocketData data(0, reads, arraysize(reads), nullptr, 0);
+
+ helper.RunToCompletion(&data);
+ TransactionHelperResult out = helper.output();
+ EXPECT_EQ(ERR_HTTP_1_1_REQUIRED, out.rv);
+}
+
// Retry with HTTP/1.1 when receiving HTTP_1_1_REQUIRED. Note that no actual
// protocol negotiation happens, instead this test forces protocols for both
// sockets.
« no previous file with comments | « net/spdy/spdy_http_utils.cc ('k') | net/spdy/spdy_protocol.h » ('j') | shell/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698