Index: mojo/system/core_test_base.cc |
diff --git a/mojo/system/core_test_base.cc b/mojo/system/core_test_base.cc |
index c91437c42c655162be93c987331f15ec8a9f0c84..c02b1188c1204f0a3f9af4c9075db6b294bad770 100644 |
--- a/mojo/system/core_test_base.cc |
+++ b/mojo/system/core_test_base.cc |
@@ -68,8 +68,8 @@ class MockDispatcher : public Dispatcher { |
virtual MojoResult ReadMessageImplNoLock( |
void* bytes, |
uint32_t* num_bytes, |
- DispatcherVector* /*dispatchers*/, |
- uint32_t* /*num_dispatchers*/, |
+ DispatcherVector* dispatchers, |
+ uint32_t* num_dispatchers, |
MojoReadMessageFlags /*flags*/) OVERRIDE { |
info_->IncrementReadMessageCallCount(); |
lock().AssertAcquired(); |
@@ -77,6 +77,14 @@ class MockDispatcher : public Dispatcher { |
if (num_bytes && !VerifyUserPointerWithSize<1>(bytes, *num_bytes)) |
return MOJO_RESULT_INVALID_ARGUMENT; |
+ if (num_dispatchers) { |
+ *num_dispatchers = 1; |
+ if (dispatchers) { |
+ // Okay to leave an invalid dispatcher. |
+ dispatchers->resize(1); |
+ } |
+ } |
+ |
return MOJO_RESULT_OK; |
} |