| 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;
|
|
|
|
|