| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ipc/mojo/ipc_mojo_bootstrap.h" | 5 #include "ipc/mojo/ipc_mojo_bootstrap.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 IPC::mojom::ChannelAssociatedRequest receive_channel, | 52 IPC::mojom::ChannelAssociatedRequest receive_channel, |
| 53 int32_t peer_pid) { | 53 int32_t peer_pid) { |
| 54 passed_ = true; | 54 passed_ = true; |
| 55 quit_callback_.Run(); | 55 quit_callback_.Run(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void TestingDelegate::OnBootstrapError() { | 58 void TestingDelegate::OnBootstrapError() { |
| 59 quit_callback_.Run(); | 59 quit_callback_.Run(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Times out on Android; see http://crbug.com/502290 | 62 TEST_F(IPCMojoBootstrapTest, Connect) { |
| 63 #if defined(OS_ANDROID) | |
| 64 #define MAYBE_Connect DISABLED_Connect | |
| 65 #else | |
| 66 #define MAYBE_Connect Connect | |
| 67 #endif | |
| 68 TEST_F(IPCMojoBootstrapTest, MAYBE_Connect) { | |
| 69 base::MessageLoop message_loop; | 63 base::MessageLoop message_loop; |
| 70 base::RunLoop run_loop; | 64 base::RunLoop run_loop; |
| 71 TestingDelegate delegate(run_loop.QuitClosure()); | 65 TestingDelegate delegate(run_loop.QuitClosure()); |
| 72 std::unique_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create( | 66 std::unique_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create( |
| 73 helper_.StartChild("IPCMojoBootstrapTestClient"), | 67 helper_.StartChild("IPCMojoBootstrapTestClient"), |
| 74 IPC::Channel::MODE_SERVER, &delegate); | 68 IPC::Channel::MODE_SERVER, &delegate); |
| 75 | 69 |
| 76 bootstrap->Connect(); | 70 bootstrap->Connect(); |
| 77 run_loop.Run(); | 71 run_loop.Run(); |
| 78 | 72 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 93 IPC::Channel::MODE_CLIENT, &delegate); | 87 IPC::Channel::MODE_CLIENT, &delegate); |
| 94 | 88 |
| 95 bootstrap->Connect(); | 89 bootstrap->Connect(); |
| 96 | 90 |
| 97 run_loop.Run(); | 91 run_loop.Run(); |
| 98 | 92 |
| 99 return delegate.passed() ? 0 : 1; | 93 return delegate.passed() ? 0 : 1; |
| 100 } | 94 } |
| 101 | 95 |
| 102 } // namespace | 96 } // namespace |
| OLD | NEW |