| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <sys/epoll.h> | 7 #include <sys/epoll.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 | 1083 |
| 1084 TEST_P(EndToEndTest, ConnectionMigrationClientIPChanged) { | 1084 TEST_P(EndToEndTest, ConnectionMigrationClientIPChanged) { |
| 1085 // Tests that the client's IP can not change during an established QUIC | 1085 // Tests that the client's IP can not change during an established QUIC |
| 1086 // connection. If it changes, the connection is closed by the server as we do | 1086 // connection. If it changes, the connection is closed by the server as we do |
| 1087 // not yet support IP migration. | 1087 // not yet support IP migration. |
| 1088 ASSERT_TRUE(Initialize()); | 1088 ASSERT_TRUE(Initialize()); |
| 1089 | 1089 |
| 1090 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 1090 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
| 1091 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); | 1091 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); |
| 1092 | 1092 |
| 1093 scoped_ptr<WrongAddressWriter> writer(new WrongAddressWriter()); | 1093 WrongAddressWriter* writer = new WrongAddressWriter(); |
| 1094 | 1094 |
| 1095 writer->set_writer(new QuicDefaultPacketWriter(client_->client()->fd())); | 1095 writer->set_writer(new QuicDefaultPacketWriter(client_->client()->fd())); |
| 1096 QuicConnectionPeer::SetWriter(client_->client()->session()->connection(), | 1096 QuicConnectionPeer::SetWriter(client_->client()->session()->connection(), |
| 1097 writer.get()); | 1097 writer, |
| 1098 true /* owns_writer */); |
| 1098 | 1099 |
| 1099 client_->SendSynchronousRequest("/bar"); | 1100 client_->SendSynchronousRequest("/bar"); |
| 1100 | 1101 |
| 1101 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); | 1102 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); |
| 1102 EXPECT_EQ(QUIC_ERROR_MIGRATING_ADDRESS, client_->connection_error()); | 1103 EXPECT_EQ(QUIC_ERROR_MIGRATING_ADDRESS, client_->connection_error()); |
| 1103 } | 1104 } |
| 1104 | 1105 |
| 1105 TEST_P(EndToEndTest, ConnectionMigrationClientPortChanged) { | 1106 TEST_P(EndToEndTest, ConnectionMigrationClientPortChanged) { |
| 1106 // Tests that the client's port can change during an established QUIC | 1107 // Tests that the client's port can change during an established QUIC |
| 1107 // connection, and that doing so does not result in the connection being | 1108 // connection, and that doing so does not result in the connection being |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 session->flow_controller(); | 1305 session->flow_controller(); |
| 1305 EXPECT_EQ(kSessionIFCW, QuicFlowControllerPeer::ReceiveWindowSize( | 1306 EXPECT_EQ(kSessionIFCW, QuicFlowControllerPeer::ReceiveWindowSize( |
| 1306 server_connection_flow_controller)); | 1307 server_connection_flow_controller)); |
| 1307 server_thread_->Resume(); | 1308 server_thread_->Resume(); |
| 1308 } | 1309 } |
| 1309 | 1310 |
| 1310 } // namespace | 1311 } // namespace |
| 1311 } // namespace test | 1312 } // namespace test |
| 1312 } // namespace tools | 1313 } // namespace tools |
| 1313 } // namespace net | 1314 } // namespace net |
| OLD | NEW |