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

Side by Side Diff: net/http/bidirectional_stream_unittest.cc

Issue 1904483004: Change SupportsSpdy dict, SpdySettingsMap, ServerNetworkStatsMap, AlternativeServiceMap and disk da… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile after sync code, introduced by commit 388755 Created 4 years, 8 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/http/bidirectional_stream.cc ('k') | net/http/http_network_transaction.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/http/bidirectional_stream.h" 5 #include "net/http/bidirectional_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 spdy_util_.ConstructSpdyGetSynReply(kExtraResponseHeaders, 1, 1)); 1330 spdy_util_.ConstructSpdyGetSynReply(kExtraResponseHeaders, 1, 1));
1331 std::unique_ptr<SpdySerializedFrame> body_frame( 1331 std::unique_ptr<SpdySerializedFrame> body_frame(
1332 spdy_util_.ConstructSpdyBodyFrame(1, true)); 1332 spdy_util_.ConstructSpdyBodyFrame(1, true));
1333 1333
1334 MockRead reads[] = { 1334 MockRead reads[] = {
1335 CreateMockRead(*resp, 1), CreateMockRead(*body_frame, 2), 1335 CreateMockRead(*resp, 1), CreateMockRead(*body_frame, 2),
1336 MockRead(SYNCHRONOUS, 0, 3), 1336 MockRead(SYNCHRONOUS, 0, 3),
1337 }; 1337 };
1338 1338
1339 HostPortPair host_port_pair("www.example.org", 443); 1339 HostPortPair host_port_pair("www.example.org", 443);
1340 url::SchemeHostPort server("https", "www.example.org", 443);
1340 SpdySessionKey key(host_port_pair, ProxyServer::Direct(), 1341 SpdySessionKey key(host_port_pair, ProxyServer::Direct(),
1341 PRIVACY_MODE_DISABLED); 1342 PRIVACY_MODE_DISABLED);
1342 session_deps_.parse_alternative_services = true; 1343 session_deps_.parse_alternative_services = true;
1343 // Enable QUIC so that the alternative service header can be added to 1344 // Enable QUIC so that the alternative service header can be added to
1344 // HttpServerProperties. 1345 // HttpServerProperties.
1345 session_deps_.enable_quic = true; 1346 session_deps_.enable_quic = true;
1346 InitSession(reads, arraysize(reads), writes, arraysize(writes), key); 1347 InitSession(reads, arraysize(reads), writes, arraysize(writes), key);
1347 1348
1348 std::unique_ptr<BidirectionalStreamRequestInfo> request_info( 1349 std::unique_ptr<BidirectionalStreamRequestInfo> request_info(
1349 new BidirectionalStreamRequestInfo); 1350 new BidirectionalStreamRequestInfo);
(...skipping 14 matching lines...) Expand all
1364 EXPECT_EQ(alt_svc_header_value, response_headers.find("alt-svc")->second); 1365 EXPECT_EQ(alt_svc_header_value, response_headers.find("alt-svc")->second);
1365 EXPECT_EQ(0, delegate->on_data_sent_count()); 1366 EXPECT_EQ(0, delegate->on_data_sent_count());
1366 EXPECT_EQ(kProtoHTTP2, delegate->GetProtocol()); 1367 EXPECT_EQ(kProtoHTTP2, delegate->GetProtocol());
1367 EXPECT_EQ(kUploadData, delegate->data_received()); 1368 EXPECT_EQ(kUploadData, delegate->data_received());
1368 EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), 1369 EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)),
1369 delegate->GetTotalSentBytes()); 1370 delegate->GetTotalSentBytes());
1370 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), 1371 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)),
1371 delegate->GetTotalReceivedBytes()); 1372 delegate->GetTotalReceivedBytes());
1372 1373
1373 AlternativeServiceVector alternative_service_vector = 1374 AlternativeServiceVector alternative_service_vector =
1374 http_session_->http_server_properties()->GetAlternativeServices( 1375 http_session_->http_server_properties()->GetAlternativeServices(server);
1375 host_port_pair);
1376 ASSERT_EQ(1u, alternative_service_vector.size()); 1376 ASSERT_EQ(1u, alternative_service_vector.size());
1377 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3), 1377 EXPECT_EQ(AlternateProtocolFromNextProto(kProtoQUIC1SPDY3),
1378 alternative_service_vector[0].protocol); 1378 alternative_service_vector[0].protocol);
1379 EXPECT_EQ("www.example.org", alternative_service_vector[0].host); 1379 EXPECT_EQ("www.example.org", alternative_service_vector[0].host);
1380 EXPECT_EQ(443, alternative_service_vector[0].port); 1380 EXPECT_EQ(443, alternative_service_vector[0].port);
1381 } 1381 }
1382 1382
1383 } // namespace net 1383 } // namespace net
OLDNEW
« no previous file with comments | « net/http/bidirectional_stream.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698