| 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 "mojo/public/cpp/bindings/lib/multiplex_router.h" | 5 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 base::ThreadTaskRunnerHandle::Get()); | 37 base::ThreadTaskRunnerHandle::Get()); |
| 38 router1_ = new MultiplexRouter(true, std::move(pipe.handle1), | 38 router1_ = new MultiplexRouter(true, std::move(pipe.handle1), |
| 39 base::ThreadTaskRunnerHandle::Get()); | 39 base::ThreadTaskRunnerHandle::Get()); |
| 40 router0_->CreateEndpointHandlePair(&endpoint0_, &endpoint1_); | 40 router0_->CreateEndpointHandlePair(&endpoint0_, &endpoint1_); |
| 41 endpoint1_ = | 41 endpoint1_ = |
| 42 EmulatePassingEndpointHandle(std::move(endpoint1_), router1_.get()); | 42 EmulatePassingEndpointHandle(std::move(endpoint1_), router1_.get()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void TearDown() override {} | 45 void TearDown() override {} |
| 46 | 46 |
| 47 void PumpMessages() { loop_.RunUntilIdle(); } | 47 void PumpMessages() { base::RunLoop().RunUntilIdle(); } |
| 48 | 48 |
| 49 ScopedInterfaceEndpointHandle EmulatePassingEndpointHandle( | 49 ScopedInterfaceEndpointHandle EmulatePassingEndpointHandle( |
| 50 ScopedInterfaceEndpointHandle handle, | 50 ScopedInterfaceEndpointHandle handle, |
| 51 MultiplexRouter* target) { | 51 MultiplexRouter* target) { |
| 52 CHECK(!handle.is_local()); | 52 CHECK(!handle.is_local()); |
| 53 | 53 |
| 54 return target->CreateLocalEndpointHandle(handle.release()); | 54 return target->CreateLocalEndpointHandle(handle.release()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 protected: | 57 protected: |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 EXPECT_FALSE(generator.responder_is_valid()); | 337 EXPECT_FALSE(generator.responder_is_valid()); |
| 338 generator.CompleteWithResponse(); // This should end up doing nothing. | 338 generator.CompleteWithResponse(); // This should end up doing nothing. |
| 339 } | 339 } |
| 340 | 340 |
| 341 // TODO(yzshen): add more tests. | 341 // TODO(yzshen): add more tests. |
| 342 | 342 |
| 343 } // namespace | 343 } // namespace |
| 344 } // namespace test | 344 } // namespace test |
| 345 } // namespace mojo | 345 } // namespace mojo |
| OLD | NEW |