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

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

Issue 1949743002: EDK: HandleTransport::CreateEquivalentDispatcherAndClose() -> CreateEquivalentHandleAndClose(). (Closed) Base URL: https://github.com/domokit/mojo.git@work791_edk_handle_12-x-work790_edk_handle_11-x-work788_edk_handle_10
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/message_pipe.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/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 1ae7d18662796ebe92f83ab3355a2d7011cc4a7e..8b47bd335297627ff8b0df1578285c5d971a9898 100644
--- a/mojo/edk/system/platform_handle_dispatcher_unittest.cc
+++ b/mojo/edk/system/platform_handle_dispatcher_unittest.cc
@@ -98,26 +98,30 @@ TEST(PlatformHandleDispatcherTest, CreateEquivalentDispatcherAndClose) {
auto dispatcher =
PlatformHandleDispatcher::Create(PlatformHandleFromFILE(std::move(fp)));
// TODO(vtl): Are these the correct rights for a |PlatformHandleDispatcher|?
- Handle handle(std::move(dispatcher), MOJO_HANDLE_RIGHT_TRANSFER |
- MOJO_HANDLE_RIGHT_READ |
- MOJO_HANDLE_RIGHT_WRITE);
+ const MojoHandleRights kRights = MOJO_HANDLE_RIGHT_TRANSFER |
+ MOJO_HANDLE_RIGHT_READ |
+ MOJO_HANDLE_RIGHT_WRITE;
+ Handle handle(std::move(dispatcher), kRights);
HandleTransport transport(test::HandleTryStartTransport(handle));
EXPECT_TRUE(transport.is_valid());
EXPECT_EQ(Dispatcher::Type::PLATFORM_HANDLE, transport.GetType());
EXPECT_FALSE(transport.IsBusy());
- auto generic_dispatcher =
- transport.CreateEquivalentDispatcherAndClose(nullptr, 0u);
- ASSERT_TRUE(generic_dispatcher);
+ Handle equivalent_handle =
+ transport.CreateEquivalentHandleAndClose(nullptr, 0u);
+ ASSERT_TRUE(equivalent_handle.dispatcher);
+ EXPECT_EQ(kRights, equivalent_handle.rights);
transport.End();
EXPECT_TRUE(handle.dispatcher->HasOneRef());
handle.reset();
- ASSERT_EQ(Dispatcher::Type::PLATFORM_HANDLE, generic_dispatcher->GetType());
- dispatcher = RefPtr<PlatformHandleDispatcher>(
- static_cast<PlatformHandleDispatcher*>(generic_dispatcher.get()));
+ ASSERT_EQ(Dispatcher::Type::PLATFORM_HANDLE,
+ equivalent_handle.dispatcher->GetType());
+ dispatcher =
+ RefPtr<PlatformHandleDispatcher>(static_cast<PlatformHandleDispatcher*>(
+ equivalent_handle.dispatcher.get()));
fp = FILEFromPlatformHandle(dispatcher->PassPlatformHandle(), "rb");
EXPECT_TRUE(fp);
« no previous file with comments | « mojo/edk/system/message_pipe.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698