Index: mojo/edk/test/mojo_test_base.cc |
diff --git a/mojo/edk/test/mojo_test_base.cc b/mojo/edk/test/mojo_test_base.cc |
index 4b044f6334c9f0c1709738516e07c1b1c39f1e82..b9b68604ca155190771e0cb163b2c892836a82fe 100644 |
--- a/mojo/edk/test/mojo_test_base.cc |
+++ b/mojo/edk/test/mojo_test_base.cc |
@@ -224,10 +224,16 @@ MojoHandle MojoTestBase::CreateBuffer(uint64_t size) { |
} |
// static |
-MojoHandle MojoTestBase::DuplicateBuffer(MojoHandle h) { |
+MojoHandle MojoTestBase::DuplicateBuffer(MojoHandle h, bool read_only) { |
MojoHandle new_handle; |
+ MojoDuplicateBufferHandleOptions options = { |
+ sizeof(MojoDuplicateBufferHandleOptions), |
+ MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE |
+ }; |
+ if (read_only) |
+ options.flags |= MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY; |
EXPECT_EQ(MOJO_RESULT_OK, |
- MojoDuplicateBufferHandle(h, nullptr, &new_handle)); |
+ MojoDuplicateBufferHandle(h, &options, &new_handle)); |
return new_handle; |
} |