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

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

Issue 1915153002: EDK: Add Dispatcher::SupportsEntrypointClass(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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') | no next file » | 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 b0cc9a4654d93264bb79abe42306962b91a9a3b1..276a0b4abec1b1b12b3c0cda3e7cd84397f96b28 100644
--- a/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
+++ b/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
@@ -183,6 +183,28 @@ TEST_F(SharedBufferDispatcherTest, CreateAndMapBuffer) {
EXPECT_EQ('y', static_cast<char*>(mapping1->GetBase())[kSize / 2 + 1]);
}
+TEST_F(SharedBufferDispatcherTest, SupportsEntrypointClass) {
+ MojoResult result = MOJO_RESULT_INTERNAL;
+ auto d = SharedBufferDispatcher::Create(
+ platform_support(), SharedBufferDispatcher::kDefaultCreateOptions, 100u,
+ &result);
+ ASSERT_TRUE(d);
+ EXPECT_EQ(MOJO_RESULT_OK, result);
+
+ EXPECT_FALSE(
+ d->SupportsEntrypointClass(Dispatcher::EntrypointClass::MESSAGE_PIPE));
+ EXPECT_FALSE(d->SupportsEntrypointClass(
+ Dispatcher::EntrypointClass::DATA_PIPE_PRODUCER));
+ EXPECT_FALSE(d->SupportsEntrypointClass(
+ Dispatcher::EntrypointClass::DATA_PIPE_CONSUMER));
+ EXPECT_TRUE(d->SupportsEntrypointClass(Dispatcher::EntrypointClass::BUFFER));
+
+ // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT|
+ // for methods in unsupported entrypoint classes.
+
+ EXPECT_EQ(MOJO_RESULT_OK, d->Close());
+}
+
TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandle) {
const uint64_t kSize = 100u;
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698