| 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 17dee75b4797069238db5b03ec7eee92e921a021..8dc02372670a0f6819cf2850dc611f61f325b791 100644
|
| --- a/net/spdy/spdy_network_transaction_unittest.cc
|
| +++ b/net/spdy/spdy_network_transaction_unittest.cc
|
| @@ -6452,6 +6452,67 @@ TEST_P(SpdyNetworkTransactionTest, FlowControlNegativeSendWindowSize) {
|
| helper.VerifyDataConsumed();
|
| }
|
|
|
| +TEST_P(SpdyNetworkTransactionTest, GoAwayOnOddPushStreamId) {
|
| + if (spdy_util_.spdy_version() < SPDY3)
|
| + return;
|
| +
|
| + scoped_ptr<SpdyHeaderBlock> push_headers(new SpdyHeaderBlock);
|
| + spdy_util_.AddUrlToHeaderBlock("http://www.google.com/a.dat",
|
| + push_headers.get());
|
| + scoped_ptr<SpdyFrame> push(
|
| + spdy_util_.ConstructInitialSpdyPushFrame(push_headers.Pass(), 3, 1));
|
| + MockRead reads[] = {CreateMockRead(*push, 1)};
|
| +
|
| + scoped_ptr<SpdyFrame> req(
|
| + spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
|
| + scoped_ptr<SpdyFrame> goaway(spdy_util_.ConstructSpdyGoAway(
|
| + 0, GOAWAY_PROTOCOL_ERROR, "Odd push stream id."));
|
| + MockWrite writes[] = {
|
| + CreateMockWrite(*req, 0), CreateMockWrite(*goaway, 2),
|
| + };
|
| +
|
| + DelayedSocketData data(1, reads, arraysize(reads), writes, arraysize(writes));
|
| + NormalSpdyTransactionHelper helper(
|
| + CreateGetRequest(), DEFAULT_PRIORITY, BoundNetLog(), GetParam(), NULL);
|
| + helper.RunToCompletion(&data);
|
| + TransactionHelperResult out = helper.output();
|
| + EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv);
|
| +}
|
| +
|
| +TEST_P(SpdyNetworkTransactionTest,
|
| + GoAwayOnPushStreamIdLesserOrEqualThanLastAccepted) {
|
| + if (spdy_util_.spdy_version() < SPDY3)
|
| + return;
|
| +
|
| + scoped_ptr<SpdyFrame> push_a(spdy_util_.ConstructSpdyPush(
|
| + NULL, 0, 4, 1, "http://www.google.com/a.dat"));
|
| + scoped_ptr<SpdyHeaderBlock> push_b_headers(new SpdyHeaderBlock);
|
| + spdy_util_.AddUrlToHeaderBlock("http://www.google.com/b.dat",
|
| + push_b_headers.get());
|
| + scoped_ptr<SpdyFrame> push_b(
|
| + spdy_util_.ConstructInitialSpdyPushFrame(push_b_headers.Pass(), 2, 1));
|
| + MockRead reads[] = {
|
| + CreateMockRead(*push_a, 1), CreateMockRead(*push_b, 2),
|
| + };
|
| +
|
| + scoped_ptr<SpdyFrame> req(
|
| + spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
|
| + scoped_ptr<SpdyFrame> goaway(spdy_util_.ConstructSpdyGoAway(
|
| + 4,
|
| + GOAWAY_PROTOCOL_ERROR,
|
| + "New push stream id must be greater than the last accepted."));
|
| + MockWrite writes[] = {
|
| + CreateMockWrite(*req, 0), CreateMockWrite(*goaway, 3),
|
| + };
|
| +
|
| + DelayedSocketData data(1, reads, arraysize(reads), writes, arraysize(writes));
|
| + NormalSpdyTransactionHelper helper(
|
| + CreateGetRequest(), DEFAULT_PRIORITY, BoundNetLog(), GetParam(), NULL);
|
| + helper.RunToCompletion(&data);
|
| + TransactionHelperResult out = helper.output();
|
| + EXPECT_EQ(ERR_SPDY_PROTOCOL_ERROR, out.rv);
|
| +}
|
| +
|
| class SpdyNetworkTransactionNoTLSUsageCheckTest
|
| : public SpdyNetworkTransactionTest {
|
| protected:
|
|
|