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

Unified Diff: ipc/ipc_channel_proxy_unittest.cc

Issue 2455583002: Revert of Change most IPC tests to use ChannelMojo. (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 | « ipc/ipc_channel_mojo_unittest.cc ('k') | ipc/ipc_fuzzing_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy_unittest.cc
diff --git a/ipc/ipc_channel_proxy_unittest.cc b/ipc/ipc_channel_proxy_unittest.cc
index 1a70734fdefde6e34d9bfe1392eae6ead3ee0222..8f31e85d0651453a704fe6a6ec7fe3bd9902629f 100644
--- a/ipc/ipc_channel_proxy_unittest.cc
+++ b/ipc/ipc_channel_proxy_unittest.cc
@@ -232,13 +232,13 @@
bool message_filtering_enabled_;
};
-class IPCChannelProxyTest : public IPCChannelMojoTestBase {
+class IPCChannelProxyTest : public IPCTestBase {
public:
IPCChannelProxyTest() {}
~IPCChannelProxyTest() override {}
void SetUp() override {
- IPCChannelMojoTestBase::SetUp();
+ IPCTestBase::SetUp();
Init("ChannelProxyClient");
@@ -248,16 +248,16 @@
thread_->StartWithOptions(options);
listener_.reset(new QuitListener());
- channel_proxy_ = IPC::ChannelProxy::Create(
- TakeHandle().release(), IPC::Channel::MODE_SERVER, listener_.get(),
- thread_->task_runner());
+ CreateChannelProxy(listener_.get(), thread_->task_runner().get());
+
+ ASSERT_TRUE(StartClient());
}
void TearDown() override {
- channel_proxy_.reset();
+ DestroyChannelProxy();
thread_.reset();
listener_.reset();
- IPCChannelMojoTestBase::TearDown();
+ IPCTestBase::TearDown();
}
void SendQuitMessageAndWaitForIdle() {
@@ -270,13 +270,9 @@
return listener_->bad_message_received_;
}
- IPC::ChannelProxy* channel_proxy() { return channel_proxy_.get(); }
- IPC::Sender* sender() { return channel_proxy_.get(); }
-
private:
std::unique_ptr<base::Thread> thread_;
std::unique_ptr<QuitListener> listener_;
- std::unique_ptr<IPC::ChannelProxy> channel_proxy_;
};
TEST_F(IPCChannelProxyTest, MessageClassFilters) {
@@ -429,13 +425,17 @@
#endif
-DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT(ChannelProxyClient) {
+MULTIPROCESS_IPC_TEST_CLIENT_MAIN(ChannelProxyClient) {
+ base::MessageLoopForIO main_message_loop;
ChannelReflectorListener listener;
- Connect(&listener);
- listener.Init(channel());
+ std::unique_ptr<IPC::Channel> channel(IPC::Channel::CreateClient(
+ IPCTestBase::GetChannelName("ChannelProxyClient"), &listener,
+ main_message_loop.task_runner()));
+ CHECK(channel->Connect());
+ listener.Init(channel.get());
base::RunLoop().Run();
- Close();
+ return 0;
}
} // namespace
« no previous file with comments | « ipc/ipc_channel_mojo_unittest.cc ('k') | ipc/ipc_fuzzing_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698