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

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

Issue 2100553002: Add Core methods for wait set. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_wait_set_5.4
Patch Set: Created 4 years, 6 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 829519bc4870cde6bad219c491cbfd28102f4bec..04d3ebc5af960b7d04b2ca0eebfadbf68f43923d 100644
--- a/mojo/edk/system/core_test_base.cc
+++ b/mojo/edk/system/core_test_base.cc
@@ -170,6 +170,31 @@ class MockDispatcher : public Dispatcher {
return MOJO_RESULT_UNIMPLEMENTED;
}
+ MojoResult WaitSetAddImpl(
+ RefPtr<Dispatcher>&& /*dispatcher*/,
+ MojoHandleSignals /*signals*/,
+ uint64_t /*cookie*/,
+ UserPointer<const MojoWaitSetAddOptions> /*options*/) override {
+ info_->IncrementWaitSetAddCallCount();
+ // Note: |mutex()| is *not* held.
+ return MOJO_RESULT_UNIMPLEMENTED;
+ }
+
+ MojoResult WaitSetRemoveImpl(uint64_t /*cookie*/) override {
+ info_->IncrementWaitSetRemoveCallCount();
+ // Note: |mutex()| is *not* held.
+ return MOJO_RESULT_UNIMPLEMENTED;
+ }
+
+ MojoResult WaitSetWaitImpl(MojoDeadline /*deadline*/,
+ UserPointer<uint32_t> /*num_results*/,
+ UserPointer<MojoWaitSetResult> /*results*/,
+ UserPointer<uint32_t> /*max_results*/) override {
+ info_->IncrementWaitSetWaitCallCount();
+ // Note: |mutex()| is *not* held.
+ return MOJO_RESULT_UNIMPLEMENTED;
+ }
+
MojoResult AddAwakableImplNoLock(Awakable* awakable,
uint64_t /*context*/,
bool /*persistent*/,
@@ -332,6 +357,21 @@ unsigned CoreTestBase_MockHandleInfo::GetMapBufferCallCount() const {
return map_buffer_call_count_;
}
+unsigned CoreTestBase_MockHandleInfo::GetWaitSetAddCallCount() const {
+ MutexLocker locker(&mutex_);
+ return wait_set_add_call_count_;
+}
+
+unsigned CoreTestBase_MockHandleInfo::GetWaitSetRemoveCallCount() const {
+ MutexLocker locker(&mutex_);
+ return wait_set_remove_call_count_;
+}
+
+unsigned CoreTestBase_MockHandleInfo::GetWaitSetWaitCallCount() const {
+ MutexLocker locker(&mutex_);
+ return wait_set_wait_call_count_;
+}
+
unsigned CoreTestBase_MockHandleInfo::GetAddAwakableCallCount() const {
MutexLocker locker(&mutex_);
return add_awakable_call_count_;
@@ -432,6 +472,21 @@ void CoreTestBase_MockHandleInfo::IncrementMapBufferCallCount() {
map_buffer_call_count_++;
}
+void CoreTestBase_MockHandleInfo::IncrementWaitSetAddCallCount() {
+ MutexLocker locker(&mutex_);
+ wait_set_add_call_count_++;
+}
+
+void CoreTestBase_MockHandleInfo::IncrementWaitSetRemoveCallCount() {
+ MutexLocker locker(&mutex_);
+ wait_set_remove_call_count_++;
+}
+
+void CoreTestBase_MockHandleInfo::IncrementWaitSetWaitCallCount() {
+ MutexLocker locker(&mutex_);
+ wait_set_wait_call_count_++;
+}
+
void CoreTestBase_MockHandleInfo::IncrementAddAwakableCallCount() {
MutexLocker locker(&mutex_);
add_awakable_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