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

Unified Diff: content/renderer/pepper/pepper_broker_unittest.cc

Issue 2302053004: Use ChannelMojo for plugin-renderer channels. (Closed)
Patch Set: Created 4 years, 2 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 | « content/renderer/pepper/pepper_broker.cc ('k') | content/renderer/pepper/plugin_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_broker_unittest.cc
diff --git a/content/renderer/pepper/pepper_broker_unittest.cc b/content/renderer/pepper/pepper_broker_unittest.cc
index d7949d8e681dcc508a287627946990dc6e5588a0..62c2574a3e5e2c08847f8bcc96e0eb06c523b2d4 100644
--- a/content/renderer/pepper/pepper_broker_unittest.cc
+++ b/content/renderer/pepper/pepper_broker_unittest.cc
@@ -39,23 +39,10 @@ TEST_F(PepperBrokerTest, InitFailure) {
// On valid ChannelHandle, initialization should succeed.
TEST_F(PepperBrokerTest, InitSuccess) {
PepperBrokerDispatcherWrapper dispatcher_wrapper;
- const char kChannelName[] = "PepperHelperImplTestChannelName";
-#if defined(OS_POSIX)
- int fds[2] = {-1, -1};
- ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, fds));
- // Channel::ChannelImpl::CreatePipe needs the fd to be non-blocking.
- ASSERT_EQ(0, fcntl(fds[1], F_SETFL, O_NONBLOCK));
- base::FileDescriptor file_descriptor(fds[1], true); // Auto close.
- IPC::ChannelHandle valid_channel(kChannelName, file_descriptor);
-#else
- IPC::ChannelHandle valid_channel(kChannelName);
-#endif // defined(OS_POSIX));
+ mojo::MessagePipe pipe;
+ IPC::ChannelHandle valid_channel(pipe.handle0.release());
EXPECT_TRUE(dispatcher_wrapper.Init(base::kNullProcessId, valid_channel));
-
-#if defined(OS_POSIX)
- EXPECT_EQ(0, ::close(fds[0]));
-#endif // defined(OS_POSIX));
}
} // namespace content
« no previous file with comments | « content/renderer/pepper/pepper_broker.cc ('k') | content/renderer/pepper/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698