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

Unified Diff: ipc/ipc_mojo_bootstrap_unittest.cc

Issue 2163633003: 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_mojo_bootstrap.cc ('k') | mojo/public/cpp/bindings/lib/interface_endpoint_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_mojo_bootstrap_unittest.cc
diff --git a/ipc/ipc_mojo_bootstrap_unittest.cc b/ipc/ipc_mojo_bootstrap_unittest.cc
index 876ce67bfef9357f3ff2b53e4292265984d022b4..9d4aaf732dab2e5162c03f40169a76ad72daf9c3 100644
--- a/ipc/ipc_mojo_bootstrap_unittest.cc
+++ b/ipc/ipc_mojo_bootstrap_unittest.cc
@@ -35,10 +35,9 @@ class TestingDelegate : public IPC::MojoBootstrap::Delegate {
explicit TestingDelegate(const base::Closure& quit_callback)
: passed_(false), quit_callback_(quit_callback) {}
- void OnPipesAvailable(IPC::mojom::ChannelAssociatedPtrInfo send_channel,
- IPC::mojom::ChannelAssociatedRequest receive_channel,
- int32_t peer_pid) override;
- void OnBootstrapError() override;
+ void OnPipesAvailable(
+ IPC::mojom::ChannelAssociatedPtr sender,
+ IPC::mojom::ChannelAssociatedRequest receiver) override;
bool passed() const { return passed_; }
@@ -48,24 +47,20 @@ class TestingDelegate : public IPC::MojoBootstrap::Delegate {
};
void TestingDelegate::OnPipesAvailable(
- IPC::mojom::ChannelAssociatedPtrInfo send_channel,
- IPC::mojom::ChannelAssociatedRequest receive_channel,
- int32_t peer_pid) {
+ IPC::mojom::ChannelAssociatedPtr sender,
+ IPC::mojom::ChannelAssociatedRequest receiver) {
passed_ = true;
quit_callback_.Run();
}
-void TestingDelegate::OnBootstrapError() {
- quit_callback_.Run();
-}
-
TEST_F(IPCMojoBootstrapTest, Connect) {
base::MessageLoop message_loop;
base::RunLoop run_loop;
TestingDelegate delegate(run_loop.QuitClosure());
std::unique_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create(
helper_.StartChild("IPCMojoBootstrapTestClient"),
- IPC::Channel::MODE_SERVER, &delegate);
+ IPC::Channel::MODE_SERVER, &delegate,
+ base::ThreadTaskRunnerHandle::Get());
bootstrap->Connect();
run_loop.Run();
@@ -84,7 +79,8 @@ MULTIPROCESS_TEST_MAIN_WITH_SETUP(
std::unique_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create(
mojo::edk::CreateChildMessagePipe(
mojo::edk::test::MultiprocessTestHelper::primordial_pipe_token),
- IPC::Channel::MODE_CLIENT, &delegate);
+ IPC::Channel::MODE_CLIENT, &delegate,
+ base::ThreadTaskRunnerHandle::Get());
bootstrap->Connect();
« no previous file with comments | « ipc/ipc_mojo_bootstrap.cc ('k') | mojo/public/cpp/bindings/lib/interface_endpoint_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698