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

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

Issue 1781513002: Implement MojoGetBufferInformation(), part 2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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 70213dadb6c70e9fb762ecc3e98b9c48b89cbf75..542eadbc202b7d86912bb0700509572f80d3d29e 100644
--- a/mojo/edk/system/core_test_base.cc
+++ b/mojo/edk/system/core_test_base.cc
@@ -130,6 +130,33 @@ class MockDispatcher : public Dispatcher {
return MOJO_RESULT_UNIMPLEMENTED;
}
+ MojoResult DuplicateBufferHandleImplNoLock(
+ UserPointer<const MojoDuplicateBufferHandleOptions> /*options*/,
+ RefPtr<Dispatcher>* /*new_dispatcher*/) override {
+ info_->IncrementDuplicateBufferHandleCallCount();
+ mutex().AssertHeld();
+ return MOJO_RESULT_UNIMPLEMENTED;
+ }
+
+ MojoResult GetBufferInformationImplNoLock(
+ UserPointer<MojoBufferInformation> /*info*/,
+ uint32_t /*info_num_bytes*/) override {
+ info_->IncrementGetBufferInformationCallCount();
+ mutex().AssertHeld();
+ return MOJO_RESULT_UNIMPLEMENTED;
+ }
+
+ MojoResult MapBufferImplNoLock(
+ uint64_t /*offset*/,
+ uint64_t /*num_bytes*/,
+ MojoMapBufferFlags /*flags*/,
+ std::unique_ptr<platform::PlatformSharedBufferMapping>* /*mapping*/)
+ override {
+ info_->IncrementMapBufferCallCount();
+ mutex().AssertHeld();
+ return MOJO_RESULT_UNIMPLEMENTED;
+ }
+
MojoResult AddAwakableImplNoLock(Awakable* awakable,
MojoHandleSignals /*signals*/,
uint32_t /*context*/,
@@ -197,26 +224,9 @@ MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) {
// CoreTestBase_MockHandleInfo -------------------------------------------------
-CoreTestBase_MockHandleInfo::CoreTestBase_MockHandleInfo()
- : ctor_call_count_(0),
- dtor_call_count_(0),
- close_call_count_(0),
- write_message_call_count_(0),
- read_message_call_count_(0),
- write_data_call_count_(0),
- begin_write_data_call_count_(0),
- end_write_data_call_count_(0),
- read_data_call_count_(0),
- begin_read_data_call_count_(0),
- end_read_data_call_count_(0),
- add_awakable_call_count_(0),
- remove_awakable_call_count_(0),
- cancel_all_awakables_call_count_(0),
- add_awakable_allowed_(false) {
-}
+CoreTestBase_MockHandleInfo::CoreTestBase_MockHandleInfo() {}
-CoreTestBase_MockHandleInfo::~CoreTestBase_MockHandleInfo() {
-}
+CoreTestBase_MockHandleInfo::~CoreTestBase_MockHandleInfo() {}
unsigned CoreTestBase_MockHandleInfo::GetCtorCallCount() const {
MutexLocker locker(&mutex_);
@@ -273,6 +283,22 @@ unsigned CoreTestBase_MockHandleInfo::GetEndReadDataCallCount() const {
return end_read_data_call_count_;
}
+unsigned CoreTestBase_MockHandleInfo::GetDuplicateBufferHandleCallCount()
+ const {
+ MutexLocker locker(&mutex_);
+ return duplicate_buffer_handle_call_count_;
+}
+
+unsigned CoreTestBase_MockHandleInfo::GetGetBufferInformationCallCount() const {
+ MutexLocker locker(&mutex_);
+ return get_buffer_information_call_count_;
+}
+
+unsigned CoreTestBase_MockHandleInfo::GetMapBufferCallCount() const {
+ MutexLocker locker(&mutex_);
+ return map_buffer_call_count_;
+}
+
unsigned CoreTestBase_MockHandleInfo::GetAddAwakableCallCount() const {
MutexLocker locker(&mutex_);
return add_awakable_call_count_;
@@ -353,6 +379,21 @@ void CoreTestBase_MockHandleInfo::IncrementEndReadDataCallCount() {
end_read_data_call_count_++;
}
+void CoreTestBase_MockHandleInfo::IncrementDuplicateBufferHandleCallCount() {
+ MutexLocker locker(&mutex_);
+ duplicate_buffer_handle_call_count_++;
+}
+
+void CoreTestBase_MockHandleInfo::IncrementGetBufferInformationCallCount() {
+ MutexLocker locker(&mutex_);
+ get_buffer_information_call_count_++;
+}
+
+void CoreTestBase_MockHandleInfo::IncrementMapBufferCallCount() {
+ MutexLocker locker(&mutex_);
+ map_buffer_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