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

Unified Diff: mojo/edk/system/core_test_base.cc

Issue 2001673003: EDK: Add Core::DuplicateHandleWithReducedRights(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « mojo/edk/system/core_test_base.h ('k') | mojo/edk/system/core_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core_test_base.cc
diff --git a/mojo/edk/system/core_test_base.cc b/mojo/edk/system/core_test_base.cc
index 0bddeaa67361497f11b6fa90e8ef3fad4054363e..be805c2dd8955409baff0b04b099a9f5ea7a1e9e 100644
--- a/mojo/edk/system/core_test_base.cc
+++ b/mojo/edk/system/core_test_base.cc
@@ -56,6 +56,13 @@ class MockDispatcher : public Dispatcher {
mutex().AssertHeld();
}
+ MojoResult DuplicateDispatcherImplNoLock(
+ util::RefPtr<Dispatcher>* new_dispatcher) override {
+ info_->IncrementDuplicateDispatcherCallCount();
+ *new_dispatcher = MockDispatcher::Create(info_);
+ return MOJO_RESULT_OK;
+ }
+
MojoResult WriteMessageImplNoLock(UserPointer<const void> bytes,
uint32_t num_bytes,
std::vector<HandleTransport>* transports,
@@ -261,6 +268,11 @@ unsigned CoreTestBase_MockHandleInfo::GetCloseCallCount() const {
return close_call_count_;
}
+unsigned CoreTestBase_MockHandleInfo::GetDuplicateDispatcherCallCount() const {
+ MutexLocker locker(&mutex_);
+ return duplicate_dispatcher_call_count_;
+}
+
unsigned CoreTestBase_MockHandleInfo::GetWriteMessageCallCount() const {
MutexLocker locker(&mutex_);
return write_message_call_count_;
@@ -357,6 +369,11 @@ void CoreTestBase_MockHandleInfo::IncrementCloseCallCount() {
close_call_count_++;
}
+void CoreTestBase_MockHandleInfo::IncrementDuplicateDispatcherCallCount() {
+ MutexLocker locker(&mutex_);
+ duplicate_dispatcher_call_count_++;
+}
+
void CoreTestBase_MockHandleInfo::IncrementWriteMessageCallCount() {
MutexLocker locker(&mutex_);
write_message_call_count_++;
« no previous file with comments | « mojo/edk/system/core_test_base.h ('k') | mojo/edk/system/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698