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

Unified Diff: ipc/ipc_channel_mojo_unittest.cc

Issue 2173303002: Revert of Support early associated interface binding on ChannelMojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicit-channel-ipc-task-runner
Patch Set: 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 | « ipc/ipc_channel_mojo.cc ('k') | ipc/ipc_channel_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_mojo_unittest.cc
diff --git a/ipc/ipc_channel_mojo_unittest.cc b/ipc/ipc_channel_mojo_unittest.cc
index f7652e7156c6d2eab2c4480e58a0a7c511ba07f9..041672023a6a84f173bc45e4c82c27d7ab6b89d2 100644
--- a/ipc/ipc_channel_mojo_unittest.cc
+++ b/ipc/ipc_channel_mojo_unittest.cc
@@ -758,10 +758,6 @@
}
void CreateProxy(IPC::Listener* listener) { runner_->CreateProxy(listener); }
void RunProxy() { runner_->RunProxy(); }
- void DestroyProxy() {
- runner_.reset();
- base::RunLoop().RunUntilIdle();
- }
IPC::ChannelProxy* proxy() { return runner_->proxy(); }
@@ -812,7 +808,6 @@
void RequestQuit(const RequestQuitCallback& callback) override {
received_quit_ = true;
callback.Run();
- binding_.Close();
base::MessageLoop::current()->QuitWhenIdle();
}
@@ -843,7 +838,7 @@
EXPECT_TRUE(WaitForClientShutdown());
EXPECT_TRUE(listener.received_all_messages());
- DestroyProxy();
+ base::RunLoop().RunUntilIdle();
}
class ChannelProxyClient {
@@ -853,10 +848,6 @@
}
void CreateProxy(IPC::Listener* listener) { runner_->CreateProxy(listener); }
void RunProxy() { runner_->RunProxy(); }
- void DestroyProxy() {
- runner_.reset();
- base::RunLoop().RunUntilIdle();
- }
IPC::ChannelProxy* proxy() { return runner_->proxy(); }
@@ -865,17 +856,26 @@
std::unique_ptr<ChannelProxyRunner> runner_;
};
-class DummyListener : public IPC::Listener {
- public:
+class ListenerThatWaitsForConnect : public IPC::Listener {
+ public:
+ explicit ListenerThatWaitsForConnect(const base::Closure& connect_handler)
+ : connect_handler_(connect_handler) {}
+
// IPC::Listener
bool OnMessageReceived(const IPC::Message& message) override { return true; }
+ void OnChannelConnected(int32_t) override { connect_handler_.Run(); }
+
+ private:
+ base::Closure connect_handler_;
};
DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT(ProxyThreadAssociatedInterfaceClient,
ChannelProxyClient) {
- DummyListener listener;
+ base::RunLoop connect_loop;
+ ListenerThatWaitsForConnect listener(connect_loop.QuitClosure());
CreateProxy(&listener);
RunProxy();
+ connect_loop.Run();
// Send a bunch of interleaved messages, alternating between the associated
// interface and a legacy IPC::Message.
@@ -889,8 +889,6 @@
}
driver->RequestQuit(base::MessageLoop::QuitWhenIdleClosure());
base::RunLoop().Run();
-
- DestroyProxy();
}
#if defined(OS_POSIX)
« no previous file with comments | « ipc/ipc_channel_mojo.cc ('k') | ipc/ipc_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698