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

Side by Side Diff: mojo/edk/test/mojo_test_base.cc

Issue 2466433002: Add mojo::edk::ClosePeerConnection. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « mojo/edk/test/mojo_test_base.h ('k') | mojo/edk/test/multiprocess_test_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "mojo/edk/test/mojo_test_base.h" 5 #include "mojo/edk/test/mojo_test_base.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "mojo/edk/embedder/embedder.h" 10 #include "mojo/edk/embedder/embedder.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 g_mach_broker->AddPlaceholderForPid(helper_.test_child().Handle()); 69 g_mach_broker->AddPlaceholderForPid(helper_.test_child().Handle());
70 #endif 70 #endif
71 #endif 71 #endif
72 } 72 }
73 73
74 MojoTestBase::ClientController::~ClientController() { 74 MojoTestBase::ClientController::~ClientController() {
75 CHECK(was_shutdown_) 75 CHECK(was_shutdown_)
76 << "Test clients should be waited on explicitly with WaitForShutdown()."; 76 << "Test clients should be waited on explicitly with WaitForShutdown().";
77 } 77 }
78 78
79 void MojoTestBase::ClientController::ClosePeerConnection() {
80 #if !defined(OS_IOS)
81 helper_.ClosePeerConnection();
82 #endif
83 }
84
79 int MojoTestBase::ClientController::WaitForShutdown() { 85 int MojoTestBase::ClientController::WaitForShutdown() {
80 was_shutdown_ = true; 86 was_shutdown_ = true;
81 #if !defined(OS_IOS) 87 #if !defined(OS_IOS)
82 int retval = helper_.WaitForChildShutdown(); 88 int retval = helper_.WaitForChildShutdown();
83 #if defined(OS_MACOSX) 89 #if defined(OS_MACOSX)
84 base::AutoLock lock(g_mach_broker->GetLock()); 90 base::AutoLock lock(g_mach_broker->GetLock());
85 g_mach_broker->InvalidatePid(helper_.test_child().Handle()); 91 g_mach_broker->InvalidatePid(helper_.test_child().Handle());
86 #endif 92 #endif
87 return retval; 93 return retval;
88 #else 94 #else
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 MOJO_WRITE_DATA_FLAG_ALL_OR_NONE), 309 MOJO_WRITE_DATA_FLAG_ALL_OR_NONE),
304 MOJO_RESULT_OK); 310 MOJO_RESULT_OK);
305 CHECK_EQ(num_bytes, static_cast<uint32_t>(size)); 311 CHECK_EQ(num_bytes, static_cast<uint32_t>(size));
306 312
307 return std::string(buffer.data(), buffer.size()); 313 return std::string(buffer.data(), buffer.size());
308 } 314 }
309 315
310 } // namespace test 316 } // namespace test
311 } // namespace edk 317 } // namespace edk
312 } // namespace mojo 318 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/test/mojo_test_base.h ('k') | mojo/edk/test/multiprocess_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698