| OLD | NEW |
| 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 5498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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), | 5514 SpdySerializedFrame preface(const_cast<char*>(kHttp2ConnectionHeaderPrefix), |
| 5515 kHttp2ConnectionHeaderPrefixSize, | 5515 kHttp2ConnectionHeaderPrefixSize, |
| 5516 /* owns_buffer = */ false); | 5516 /* owns_buffer = */ false); |
| 5517 SpdySerializedFrame settings_frame( | 5517 SpdySerializedFrame settings_frame( |
| 5518 spdy_util_.ConstructSpdySettings(expected_settings)); | 5518 spdy_util_.ConstructSpdySettings(expected_settings)); |
| 5519 const SpdySerializedFrame* frames[2] = {&preface, &settings_frame}; | 5519 |
| 5520 char combined_frames[100]; | 5520 SpdySerializedFrame combined_frame = |
| 5521 int combined_frames_len = CombineFrames( | 5521 CombineFrames({&preface, &settings_frame}); |
| 5522 frames, arraysize(frames), combined_frames, arraysize(combined_frames)); | 5522 MockWrite writes[] = {CreateMockWrite(combined_frame, 0)}; |
| 5523 MockWrite writes[] = { | |
| 5524 MockWrite(ASYNC, combined_frames, combined_frames_len)}; | |
| 5525 | 5523 |
| 5526 StaticSocketDataProvider data(reads, arraysize(reads), writes, | 5524 StaticSocketDataProvider data(reads, arraysize(reads), writes, |
| 5527 arraysize(writes)); | 5525 arraysize(writes)); |
| 5528 session_deps_.socket_factory->AddSocketDataProvider(&data); | 5526 session_deps_.socket_factory->AddSocketDataProvider(&data); |
| 5529 AddSSLSocketData(); | 5527 AddSSLSocketData(); |
| 5530 | 5528 |
| 5531 CreateNetworkSession(); | 5529 CreateNetworkSession(); |
| 5532 | 5530 |
| 5533 SpdySessionPoolPeer pool_peer(spdy_session_pool_); | 5531 SpdySessionPoolPeer pool_peer(spdy_session_pool_); |
| 5534 pool_peer.SetEnableSendingInitialData(true); | 5532 pool_peer.SetEnableSendingInitialData(true); |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6146 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), | 6144 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), |
| 6147 "spdy_pooling.pem"); | 6145 "spdy_pooling.pem"); |
| 6148 ssl_info.is_issued_by_known_root = true; | 6146 ssl_info.is_issued_by_known_root = true; |
| 6149 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); | 6147 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); |
| 6150 | 6148 |
| 6151 EXPECT_TRUE(SpdySession::CanPool( | 6149 EXPECT_TRUE(SpdySession::CanPool( |
| 6152 &tss, ssl_info, "www.example.org", "mail.example.org")); | 6150 &tss, ssl_info, "www.example.org", "mail.example.org")); |
| 6153 } | 6151 } |
| 6154 | 6152 |
| 6155 } // namespace net | 6153 } // namespace net |
| OLD | NEW |