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

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

Issue 1689053003: Support read-only duplicates of Mojo shared buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-shm-interop
Patch Set: Rebase and fix comment. Created 4 years, 8 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/shared_buffer_dispatcher.cc ('k') | mojo/edk/system/shared_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/shared_buffer_dispatcher_unittest.cc
diff --git a/mojo/edk/system/shared_buffer_dispatcher_unittest.cc b/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
index 5605264172a350afa395bfa2b6135c9aff1e8a54..6e26bf9f1bd897631e3a233c57a45dc66ea00067 100644
--- a/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
+++ b/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
@@ -220,6 +220,8 @@ TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsValid) {
MojoDuplicateBufferHandleOptions options[] = {
{sizeof(MojoDuplicateBufferHandleOptions),
MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE},
+ {sizeof(MojoDuplicateBufferHandleOptions),
+ MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY},
{sizeof(MojoDuplicateBufferHandleOptionsFlags), ~0u}};
for (size_t i = 0; i < arraysize(options); i++) {
scoped_refptr<Dispatcher> dispatcher2;
@@ -227,6 +229,10 @@ TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsValid) {
&options[i], &dispatcher2));
ASSERT_TRUE(dispatcher2);
EXPECT_EQ(Dispatcher::Type::SHARED_BUFFER, dispatcher2->GetType());
+ {
+ scoped_ptr<PlatformSharedBufferMapping> mapping;
+ EXPECT_EQ(MOJO_RESULT_OK, dispatcher2->MapBuffer(0, 100, 0, &mapping));
+ }
EXPECT_EQ(MOJO_RESULT_OK, dispatcher2->Close());
}
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.cc ('k') | mojo/edk/system/shared_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698