| 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/memory/linked_ptr.h" | 7 #include "base/memory/linked_ptr.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 void CreateHttpServer(HttpServerDelegatePtr delegate, | 561 void CreateHttpServer(HttpServerDelegatePtr delegate, |
| 562 NetAddressPtr* out_bound_to) { | 562 NetAddressPtr* out_bound_to) { |
| 563 network_service_->CreateHttpServer( | 563 network_service_->CreateHttpServer( |
| 564 GetLocalHostWithAnyPort(), delegate.Pass(), | 564 GetLocalHostWithAnyPort(), delegate.Pass(), |
| 565 [out_bound_to](NetworkErrorPtr result, NetAddressPtr bound_to) { | 565 [out_bound_to](NetworkErrorPtr result, NetAddressPtr bound_to) { |
| 566 ASSERT_EQ(net::OK, result->code); | 566 ASSERT_EQ(net::OK, result->code); |
| 567 EXPECT_NE(0u, bound_to->ipv4->port); | 567 EXPECT_NE(0u, bound_to->ipv4->port); |
| 568 *out_bound_to = bound_to.Pass(); | 568 *out_bound_to = bound_to.Pass(); |
| 569 }); | 569 }); |
| 570 network_service_.WaitForIncomingMethodCall(); | 570 network_service_.WaitForIncomingResponse(); |
| 571 } | 571 } |
| 572 | 572 |
| 573 NetworkServicePtr network_service_; | 573 NetworkServicePtr network_service_; |
| 574 | 574 |
| 575 private: | 575 private: |
| 576 base::MessageLoop message_loop_; | 576 base::MessageLoop message_loop_; |
| 577 | 577 |
| 578 DISALLOW_COPY_AND_ASSIGN(HttpServerAppTest); | 578 DISALLOW_COPY_AND_ASSIGN(HttpServerAppTest); |
| 579 }; | 579 }; |
| 580 | 580 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 682 |
| 683 socket_1.Send("How do"); | 683 socket_1.Send("How do"); |
| 684 socket_1.Send("you do?"); | 684 socket_1.Send("you do?"); |
| 685 | 685 |
| 686 socket_0.WaitForMessage(2); | 686 socket_0.WaitForMessage(2); |
| 687 EXPECT_EQ("How do", socket_0.received_messages()[0]); | 687 EXPECT_EQ("How do", socket_0.received_messages()[0]); |
| 688 EXPECT_EQ("you do?", socket_0.received_messages()[1]); | 688 EXPECT_EQ("you do?", socket_0.received_messages()[1]); |
| 689 } | 689 } |
| 690 | 690 |
| 691 } // namespace mojo | 691 } // namespace mojo |
| OLD | NEW |