| OLD | NEW |
| 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "blimp/common/create_blimp_message.h" | 9 #include "blimp/common/create_blimp_message.h" |
| 10 #include "blimp/common/proto/blimp_message.pb.h" | 10 #include "blimp/common/proto/blimp_message.pb.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Integration test for TCPEngineTransport and TCPClientTransport. | 30 // Integration test for TCPEngineTransport and TCPClientTransport. |
| 31 class TCPTransportTest : public testing::Test { | 31 class TCPTransportTest : public testing::Test { |
| 32 protected: | 32 protected: |
| 33 TCPTransportTest() { | 33 TCPTransportTest() { |
| 34 net::IPEndPoint local_address(net::IPAddress(127, 0, 0, 1), 0); | 34 net::IPEndPoint local_address(net::IPAddress(127, 0, 0, 1), 0); |
| 35 engine_.reset(new TCPEngineTransport(local_address, nullptr)); | 35 engine_.reset(new TCPEngineTransport(local_address, nullptr)); |
| 36 } | 36 } |
| 37 | 37 |
| 38 net::IPEndPoint GetLocalEndpoint() const { | 38 net::IPEndPoint GetLocalEndpoint() const { |
| 39 net::IPEndPoint local_address; | 39 net::IPEndPoint local_address; |
| 40 CHECK_EQ(net::OK, engine_->GetLocalAddressForTesting(&local_address)); | 40 CHECK_EQ(net::OK, engine_->GetLocalAddress(&local_address)); |
| 41 return local_address; | 41 return local_address; |
| 42 } | 42 } |
| 43 | 43 |
| 44 base::MessageLoopForIO message_loop_; | 44 base::MessageLoopForIO message_loop_; |
| 45 std::unique_ptr<TCPEngineTransport> engine_; | 45 std::unique_ptr<TCPEngineTransport> engine_; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 TEST_F(TCPTransportTest, Connect) { | 48 TEST_F(TCPTransportTest, Connect) { |
| 49 net::TestCompletionCallback accept_callback; | 49 net::TestCompletionCallback accept_callback; |
| 50 engine_->Connect(accept_callback.callback()); | 50 engine_->Connect(accept_callback.callback()); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Client sends the second message. | 137 // Client sends the second message. |
| 138 net::TestCompletionCallback client_send_callback2; | 138 net::TestCompletionCallback client_send_callback2; |
| 139 client_connnection->GetOutgoingMessageProcessor()->ProcessMessage( | 139 client_connnection->GetOutgoingMessageProcessor()->ProcessMessage( |
| 140 std::move(client_message2), client_send_callback2.callback()); | 140 std::move(client_message2), client_send_callback2.callback()); |
| 141 EXPECT_EQ(net::OK, client_send_callback2.WaitForResult()); | 141 EXPECT_EQ(net::OK, client_send_callback2.WaitForResult()); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 | 145 |
| 146 } // namespace blimp | 146 } // namespace blimp |
| OLD | NEW |