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

Side by Side Diff: net/spdy/chromium/spdy_session_unittest.cc

Issue 2943113002: Reset pushed stream unless using GET or HEAD method. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « net/spdy/chromium/spdy_session.cc ('k') | net/spdy/chromium/spdy_test_util_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/chromium/spdy_session.h" 5 #include "net/spdy/chromium/spdy_session.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 5204 matching lines...) Expand 10 before | Expand all | Expand 10 after
5215 // Read EOF. 5215 // Read EOF.
5216 data.Resume(); 5216 data.Resume();
5217 base::RunLoop().RunUntilIdle(); 5217 base::RunLoop().RunUntilIdle();
5218 EXPECT_FALSE(session_); 5218 EXPECT_FALSE(session_);
5219 } 5219 }
5220 5220
5221 TEST_F(SpdySessionTest, IgnoreReservedRemoteStreamsCount) { 5221 TEST_F(SpdySessionTest, IgnoreReservedRemoteStreamsCount) {
5222 SpdySerializedFrame push_a(spdy_util_.ConstructSpdyPush( 5222 SpdySerializedFrame push_a(spdy_util_.ConstructSpdyPush(
5223 nullptr, 0, 2, 1, "https://www.example.org/a.dat")); 5223 nullptr, 0, 2, 1, "https://www.example.org/a.dat"));
5224 SpdyHeaderBlock push_headers; 5224 SpdyHeaderBlock push_headers;
5225 push_headers[":method"] = "GET";
5225 spdy_util_.AddUrlToHeaderBlock("https://www.example.org/b.dat", 5226 spdy_util_.AddUrlToHeaderBlock("https://www.example.org/b.dat",
5226 &push_headers); 5227 &push_headers);
5227 SpdySerializedFrame push_b( 5228 SpdySerializedFrame push_b(
5228 spdy_util_.ConstructInitialSpdyPushFrame(std::move(push_headers), 4, 1)); 5229 spdy_util_.ConstructInitialSpdyPushFrame(std::move(push_headers), 4, 1));
5229 SpdySerializedFrame headers_b( 5230 SpdySerializedFrame headers_b(
5230 spdy_util_.ConstructSpdyPushHeaders(4, nullptr, 0)); 5231 spdy_util_.ConstructSpdyPushHeaders(4, nullptr, 0));
5231 MockRead reads[] = { 5232 MockRead reads[] = {
5232 MockRead(ASYNC, ERR_IO_PENDING, 1), CreateMockRead(push_a, 2), 5233 MockRead(ASYNC, ERR_IO_PENDING, 1), CreateMockRead(push_a, 2),
5233 MockRead(ASYNC, ERR_IO_PENDING, 4), CreateMockRead(push_b, 5), 5234 MockRead(ASYNC, ERR_IO_PENDING, 4), CreateMockRead(push_b, 5),
5234 MockRead(ASYNC, ERR_IO_PENDING, 7), CreateMockRead(headers_b, 8), 5235 MockRead(ASYNC, ERR_IO_PENDING, 7), CreateMockRead(headers_b, 8),
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
5309 5310
5310 // Read EOF. 5311 // Read EOF.
5311 data.Resume(); 5312 data.Resume();
5312 base::RunLoop().RunUntilIdle(); 5313 base::RunLoop().RunUntilIdle();
5313 EXPECT_FALSE(session_); 5314 EXPECT_FALSE(session_);
5314 } 5315 }
5315 5316
5316 TEST_F(SpdySessionTest, CancelReservedStreamOnHeadersReceived) { 5317 TEST_F(SpdySessionTest, CancelReservedStreamOnHeadersReceived) {
5317 const char kPushedUrl[] = "https://www.example.org/a.dat"; 5318 const char kPushedUrl[] = "https://www.example.org/a.dat";
5318 SpdyHeaderBlock push_headers; 5319 SpdyHeaderBlock push_headers;
5320 push_headers[":method"] = "GET";
5319 spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_headers); 5321 spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_headers);
5320 SpdySerializedFrame push_promise( 5322 SpdySerializedFrame push_promise(
5321 spdy_util_.ConstructInitialSpdyPushFrame(std::move(push_headers), 2, 1)); 5323 spdy_util_.ConstructInitialSpdyPushFrame(std::move(push_headers), 2, 1));
5322 SpdySerializedFrame headers_frame( 5324 SpdySerializedFrame headers_frame(
5323 spdy_util_.ConstructSpdyPushHeaders(2, nullptr, 0)); 5325 spdy_util_.ConstructSpdyPushHeaders(2, nullptr, 0));
5324 MockRead reads[] = { 5326 MockRead reads[] = {
5325 MockRead(ASYNC, ERR_IO_PENDING, 1), CreateMockRead(push_promise, 2), 5327 MockRead(ASYNC, ERR_IO_PENDING, 1), CreateMockRead(push_promise, 2),
5326 MockRead(ASYNC, ERR_IO_PENDING, 4), CreateMockRead(headers_frame, 5), 5328 MockRead(ASYNC, ERR_IO_PENDING, 4), CreateMockRead(headers_frame, 5),
5327 MockRead(ASYNC, ERR_IO_PENDING, 7), MockRead(ASYNC, 0, 8), 5329 MockRead(ASYNC, ERR_IO_PENDING, 7), MockRead(ASYNC, 0, 8),
5328 }; 5330 };
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
6144 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), 6146 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(),
6145 "spdy_pooling.pem"); 6147 "spdy_pooling.pem");
6146 ssl_info.is_issued_by_known_root = true; 6148 ssl_info.is_issued_by_known_root = true;
6147 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); 6149 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin));
6148 6150
6149 EXPECT_TRUE(SpdySession::CanPool( 6151 EXPECT_TRUE(SpdySession::CanPool(
6150 &tss, ssl_info, "www.example.org", "mail.example.org")); 6152 &tss, ssl_info, "www.example.org", "mail.example.org"));
6151 } 6153 }
6152 6154
6153 } // namespace net 6155 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/chromium/spdy_session.cc ('k') | net/spdy/chromium/spdy_test_util_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698