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

Unified Diff: services/ui/common/gpu_type_converters_unittest.cc

Issue 2109593006: Add ChannelHandle::mojo_handle to mus' ChannelHandle mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase update. Created 4 years, 5 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 | « services/ui/common/gpu_type_converters.cc ('k') | services/ui/public/interfaces/channel_handle.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/gpu_type_converters_unittest.cc
diff --git a/services/ui/common/gpu_type_converters_unittest.cc b/services/ui/common/gpu_type_converters_unittest.cc
index 08fc52b22b3e4d35a7e58766e55bd95822b611a6..67b304761e24db3148d6fc97db0c64c7b8c22aec 100644
--- a/services/ui/common/gpu_type_converters_unittest.cc
+++ b/services/ui/common/gpu_type_converters_unittest.cc
@@ -57,6 +57,28 @@ TEST(MusGpuTypeConvertersTest, ChannelHandle) {
base::ScopedFD socped_fd3(handle.socket.fd);
}
#endif
+
+ {
+ const std::string channel_name = "test_channel_name";
+ mojo::MessagePipe message_pipe;
+ mojo::MessagePipeHandle mp_handle = message_pipe.handle0.release();
+ EXPECT_TRUE(mp_handle.is_valid());
+ IPC::ChannelHandle handle(mp_handle);
+ handle.name = channel_name;
+
+ ui::mojom::ChannelHandlePtr mojo_handle =
+ ui::mojom::ChannelHandle::From(handle);
+ ASSERT_EQ(mojo_handle->name, channel_name);
+ ASSERT_EQ(mojo_handle->mojo_handle.get(), mp_handle);
+ EXPECT_FALSE(mojo_handle->socket.is_valid());
+
+ handle = mojo_handle.To<IPC::ChannelHandle>();
+ ASSERT_EQ(handle.name, channel_name);
+ ASSERT_EQ(handle.mojo_handle, mp_handle);
+#if defined(OS_POSIX)
+ ASSERT_EQ(handle.socket.fd, -1);
+#endif
+ }
}
// Test for mojo TypeConverter of ui::mojom::GpuMemoryBufferHandle
« no previous file with comments | « services/ui/common/gpu_type_converters.cc ('k') | services/ui/public/interfaces/channel_handle.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698