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

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

Issue 1946763002: EDK: Add MojoHandleRights to DispatcherTransport. (Closed) Base URL: https://github.com/domokit/mojo.git@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
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 eb7ebed5c84489d1a3173f982aaca10ad928ec37..b2f12fd266814d3f4e11ae951bf0a34f7d2ba781 100644
--- a/mojo/edk/system/platform_handle_dispatcher_unittest.cc
+++ b/mojo/edk/system/platform_handle_dispatcher_unittest.cc
@@ -9,6 +9,7 @@
#include <utility>
#include "mojo/edk/platform/platform_handle_utils_posix.h"
+#include "mojo/edk/system/handle.h"
#include "mojo/edk/system/handle_transport.h"
#include "mojo/edk/system/test/scoped_test_dir.h"
#include "mojo/edk/util/scoped_file.h"
@@ -96,9 +97,12 @@ 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);
- DispatcherTransport transport(
- test::DispatcherTryStartTransport(dispatcher.get()));
+ DispatcherTransport transport(test::HandleTryStartTransport(handle));
EXPECT_TRUE(transport.is_valid());
EXPECT_EQ(Dispatcher::Type::PLATFORM_HANDLE, transport.GetType());
EXPECT_FALSE(transport.IsBusy());
@@ -108,8 +112,8 @@ TEST(PlatformHandleDispatcherTest, CreateEquivalentDispatcherAndClose) {
ASSERT_TRUE(generic_dispatcher);
transport.End();
- EXPECT_TRUE(dispatcher->HasOneRef());
- dispatcher = nullptr;
+ EXPECT_TRUE(handle.dispatcher->HasOneRef());
+ handle.reset();
ASSERT_EQ(Dispatcher::Type::PLATFORM_HANDLE, generic_dispatcher->GetType());
dispatcher = RefPtr<PlatformHandleDispatcher>(
« no previous file with comments | « mojo/edk/system/multiprocess_message_pipe_unittest.cc ('k') | mojo/edk/system/remote_data_pipe_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698