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

Unified Diff: mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc

Issue 2646853003: Mojo C++ bindings: Simplify associated interface API. (Closed)
Patch Set: . Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc b/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
index 0db42db25fc7e4f5a0c78ae02a8a4d31f9bc62a2..31963e0f5bbb44a87f6c636482b70bc992859989 100644
--- a/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
@@ -37,23 +37,16 @@ class MultiplexRouterTest : public testing::Test {
router1_ = new MultiplexRouter(std::move(pipe.handle1),
MultiplexRouter::MULTI_INTERFACE, true,
base::ThreadTaskRunnerHandle::Get());
- router0_->CreateEndpointHandlePair(&endpoint0_, &endpoint1_);
- endpoint1_ =
- EmulatePassingEndpointHandle(std::move(endpoint1_), router1_.get());
+ ScopedInterfaceEndpointHandle::CreatePairPendingAssociation(&endpoint0_,
+ &endpoint1_);
+ auto id = router0_->AssociateInterface(std::move(endpoint1_));
+ endpoint1_ = router1_->CreateLocalEndpointHandle(id);
}
void TearDown() override {}
void PumpMessages() { base::RunLoop().RunUntilIdle(); }
- ScopedInterfaceEndpointHandle EmulatePassingEndpointHandle(
- ScopedInterfaceEndpointHandle handle,
- MultiplexRouter* target) {
- CHECK(!handle.is_local());
-
- return target->CreateLocalEndpointHandle(handle.release());
- }
-
protected:
scoped_refptr<MultiplexRouter> router0_;
scoped_refptr<MultiplexRouter> router1_;
« no previous file with comments | « mojo/public/cpp/bindings/tests/associated_interface_unittest.cc ('k') | mojo/public/cpp/bindings/thread_safe_interface_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698