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

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

Issue 2909653002: SpdySession: Combine three frames into a single packet. (Closed)
Patch Set: Combine frames in tests. 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') | no next file » | 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 5493 matching lines...) Expand 10 before | Expand all | Expand 10 after
5504 EXPECT_EQ(1u, delegate.stream_id()); 5504 EXPECT_EQ(1u, delegate.stream_id());
5505 } 5505 }
5506 5506
5507 class SendInitialSettingsOnNewSpdySessionTest : public SpdySessionTest { 5507 class SendInitialSettingsOnNewSpdySessionTest : public SpdySessionTest {
5508 protected: 5508 protected:
5509 void RunInitialSettingsTest(const SettingsMap expected_settings) { 5509 void RunInitialSettingsTest(const SettingsMap expected_settings) {
5510 session_deps_.host_resolver->set_synchronous_mode(true); 5510 session_deps_.host_resolver->set_synchronous_mode(true);
5511 5511
5512 MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING)}; 5512 MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING)};
5513 5513
5514 SpdySerializedFrame preface(const_cast<char*>(kHttp2ConnectionHeaderPrefix),
5515 kHttp2ConnectionHeaderPrefixSize,
5516 /* owns_buffer = */ false);
5514 SpdySerializedFrame settings_frame( 5517 SpdySerializedFrame settings_frame(
5515 spdy_util_.ConstructSpdySettings(expected_settings)); 5518 spdy_util_.ConstructSpdySettings(expected_settings));
5516 MockWrite writes[] = {MockWrite(ASYNC, kHttp2ConnectionHeaderPrefix, 5519 const SpdySerializedFrame* frames[2] = {&preface, &settings_frame};
5517 kHttp2ConnectionHeaderPrefixSize), 5520 char combined_frames[100];
5518 CreateMockWrite(settings_frame)}; 5521 int combined_frames_len = CombineFrames(
5522 frames, arraysize(frames), combined_frames, arraysize(combined_frames));
5523 MockWrite writes[] = {
5524 MockWrite(ASYNC, combined_frames, combined_frames_len)};
5519 5525
5520 StaticSocketDataProvider data(reads, arraysize(reads), writes, 5526 StaticSocketDataProvider data(reads, arraysize(reads), writes,
5521 arraysize(writes)); 5527 arraysize(writes));
5522 session_deps_.socket_factory->AddSocketDataProvider(&data); 5528 session_deps_.socket_factory->AddSocketDataProvider(&data);
5523 AddSSLSocketData(); 5529 AddSSLSocketData();
5524 5530
5525 CreateNetworkSession(); 5531 CreateNetworkSession();
5526 5532
5527 SpdySessionPoolPeer pool_peer(spdy_session_pool_); 5533 SpdySessionPoolPeer pool_peer(spdy_session_pool_);
5528 pool_peer.SetEnableSendingInitialData(true); 5534 pool_peer.SetEnableSendingInitialData(true);
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
6140 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), 6146 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(),
6141 "spdy_pooling.pem"); 6147 "spdy_pooling.pem");
6142 ssl_info.is_issued_by_known_root = true; 6148 ssl_info.is_issued_by_known_root = true;
6143 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); 6149 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin));
6144 6150
6145 EXPECT_TRUE(SpdySession::CanPool( 6151 EXPECT_TRUE(SpdySession::CanPool(
6146 &tss, ssl_info, "www.example.org", "mail.example.org")); 6152 &tss, ssl_info, "www.example.org", "mail.example.org"));
6147 } 6153 }
6148 6154
6149 } // namespace net 6155 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/chromium/spdy_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698