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

Unified Diff: mojo/edk/system/platform_handle_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/platform_handle_dispatcher.cc ('k') | mojo/edk/system/shared_buffer_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/platform_handle_dispatcher_unittest.cc
diff --git a/mojo/edk/system/platform_handle_dispatcher_unittest.cc b/mojo/edk/system/platform_handle_dispatcher_unittest.cc
index a930c479482517b02a519fe437d1007e32196817..e57c5112445b3b1c968580fe81b5c0fd5868e8f0 100644
--- a/mojo/edk/system/platform_handle_dispatcher_unittest.cc
+++ b/mojo/edk/system/platform_handle_dispatcher_unittest.cc
@@ -60,6 +60,34 @@ TEST(PlatformHandleDispatcherTest, Basic) {
EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close());
}
+TEST(PlatformHandleDispatcher, SupportsEntrypointClass) {
+ test::ScopedTestDir test_dir;
+
+ util::ScopedFILE fp(test_dir.CreateFile());
+ ASSERT_TRUE(fp);
+
+ ScopedPlatformHandle h(PlatformHandleFromFILE(std::move(fp)));
+ EXPECT_FALSE(fp);
+ ASSERT_TRUE(h.is_valid());
+
+ auto d = PlatformHandleDispatcher::Create(h.Pass());
+ ASSERT_TRUE(d);
+ EXPECT_FALSE(h.is_valid());
+
+ 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_FALSE(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(PlatformHandleDispatcherTest, CreateEquivalentDispatcherAndClose) {
test::ScopedTestDir test_dir;
« no previous file with comments | « mojo/edk/system/platform_handle_dispatcher.cc ('k') | mojo/edk/system/shared_buffer_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698