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

Side by Side Diff: net/quic/core/quic_connection_test.cc

Issue 2591143003: Add QuicStrCat. (Closed)
Patch Set: correct quic_client_bin.cc Created 4 years 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
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/quic/core/quic_connection.h" 5 #include "net/quic/core/quic_connection.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <memory> 8 #include <memory>
9 #include <ostream> 9 #include <ostream>
10 #include <utility> 10 #include <utility>
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1143
1144 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece()); 1144 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece());
1145 EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(3); 1145 EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(3);
1146 QuicIpAddress host; 1146 QuicIpAddress host;
1147 host.FromString("1.1.1.1"); 1147 host.FromString("1.1.1.1");
1148 QuicSocketAddress self_address1(host, 443); 1148 QuicSocketAddress self_address1(host, 443);
1149 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address1, 1149 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address1,
1150 kPeerAddress); 1150 kPeerAddress);
1151 // Cause self_address change to mapped Ipv4 address. 1151 // Cause self_address change to mapped Ipv4 address.
1152 QuicIpAddress host2; 1152 QuicIpAddress host2;
1153 host2.FromString(base::StringPrintf( 1153 host2.FromString(
1154 "::ffff:%s", connection_.self_address().host().ToString().c_str())); 1154 QuicStrCat("::ffff:", connection_.self_address().host().ToString()));
1155 QuicSocketAddress self_address2(host2, connection_.self_address().port()); 1155 QuicSocketAddress self_address2(host2, connection_.self_address().port());
1156 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address2, 1156 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address2,
1157 kPeerAddress); 1157 kPeerAddress);
1158 EXPECT_TRUE(connection_.connected()); 1158 EXPECT_TRUE(connection_.connected());
1159 // self_address change back to Ipv4 address. 1159 // self_address change back to Ipv4 address.
1160 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address1, 1160 ProcessFramePacketWithAddresses(QuicFrame(&stream_frame), self_address1,
1161 kPeerAddress); 1161 kPeerAddress);
1162 EXPECT_TRUE(connection_.connected()); 1162 EXPECT_TRUE(connection_.connected());
1163 } 1163 }
1164 1164
(...skipping 3953 matching lines...) Expand 10 before | Expand all | Expand 10 after
5118 error_details, ConnectionCloseSource::FROM_PEER)); 5118 error_details, ConnectionCloseSource::FROM_PEER));
5119 connection_.set_perspective(Perspective::IS_CLIENT); 5119 connection_.set_perspective(Perspective::IS_CLIENT);
5120 connection_.CloseConnection(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, 5120 connection_.CloseConnection(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT,
5121 error_details, 5121 error_details,
5122 ConnectionCloseBehavior::SILENT_CLOSE); 5122 ConnectionCloseBehavior::SILENT_CLOSE);
5123 } 5123 }
5124 5124
5125 } // namespace 5125 } // namespace
5126 } // namespace test 5126 } // namespace test
5127 } // namespace net 5127 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698