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

Side by Side Diff: mojo/public/cpp/bindings/tests/sync_method_unittest.cc

Issue 2696233002: Mojo C++ bindings: remove some usage of AssociatedGroup from user code. (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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <utility> 5 #include <utility>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 class SyncMethodAssociatedTest : public SyncMethodTest { 263 class SyncMethodAssociatedTest : public SyncMethodTest {
264 public: 264 public:
265 SyncMethodAssociatedTest() {} 265 SyncMethodAssociatedTest() {}
266 ~SyncMethodAssociatedTest() override {} 266 ~SyncMethodAssociatedTest() override {}
267 267
268 protected: 268 protected:
269 void SetUp() override { 269 void SetUp() override {
270 master_impl_.reset(new TestSyncMasterImpl(MakeRequest(&master_ptr_))); 270 master_impl_.reset(new TestSyncMasterImpl(MakeRequest(&master_ptr_)));
271 271
272 master_ptr_.associated_group()->CreateAssociatedInterface( 272 asso_request_ = MakeRequest(&asso_ptr_info_);
273 AssociatedGroup::WILL_PASS_REQUEST, &asso_ptr_info_, &asso_request_); 273 opposite_asso_request_ = MakeRequest(&opposite_asso_ptr_info_);
274 master_ptr_.associated_group()->CreateAssociatedInterface(
275 AssociatedGroup::WILL_PASS_PTR, &opposite_asso_ptr_info_,
276 &opposite_asso_request_);
277 274
278 master_impl_->set_send_interface_handler( 275 master_impl_->set_send_interface_handler(
279 [this](TestSyncAssociatedPtrInfo ptr) { 276 [this](TestSyncAssociatedPtrInfo ptr) {
280 opposite_asso_ptr_info_ = std::move(ptr); 277 opposite_asso_ptr_info_ = std::move(ptr);
281 }); 278 });
282 base::RunLoop run_loop; 279 base::RunLoop run_loop;
283 master_impl_->set_send_request_handler( 280 master_impl_->set_send_request_handler(
284 [this, &run_loop](TestSyncAssociatedRequest request) { 281 [this, &run_loop](TestSyncAssociatedRequest request) {
285 asso_request_ = std::move(request); 282 asso_request_ = std::move(request);
286 run_loop.Quit(); 283 run_loop.Quit();
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 int32_t result_value = -1; 730 int32_t result_value = -1;
734 ASSERT_TRUE(master_ptr_->Echo(456, &result_value)); 731 ASSERT_TRUE(master_ptr_->Echo(456, &result_value));
735 EXPECT_EQ(456, result_value); 732 EXPECT_EQ(456, result_value);
736 } 733 }
737 734
738 // TODO(yzshen): Add more tests related to associated interfaces. 735 // TODO(yzshen): Add more tests related to associated interfaces.
739 736
740 } // namespace 737 } // namespace
741 } // namespace test 738 } // namespace test
742 } // namespace mojo 739 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/binding_set_unittest.cc ('k') | services/service_manager/public/cpp/lib/service_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698