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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "ipc/ipc_test_base.h" | 10 #include "ipc/ipc_test_base.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 void TestingDelegate::OnPipeAvailable( | 35 void TestingDelegate::OnPipeAvailable( |
36 mojo::embedder::ScopedPlatformHandle handle) { | 36 mojo::embedder::ScopedPlatformHandle handle) { |
37 passed_ = true; | 37 passed_ = true; |
38 base::MessageLoop::current()->Quit(); | 38 base::MessageLoop::current()->Quit(); |
39 } | 39 } |
40 | 40 |
41 void TestingDelegate::OnBootstrapError() { | 41 void TestingDelegate::OnBootstrapError() { |
42 base::MessageLoop::current()->Quit(); | 42 base::MessageLoop::current()->Quit(); |
43 } | 43 } |
44 | 44 |
45 TEST_F(IPCMojoBootstrapTest, Connect) { | 45 // Times out on Android; see http://crbug.com/502290 |
| 46 #if defined(OS_ANDROID) |
| 47 #define MAYBE_Connect DISABLED_Connect |
| 48 #else |
| 49 #define MAYBE_Connect Connect |
| 50 #endif |
| 51 TEST_F(IPCMojoBootstrapTest, MAYBE_Connect) { |
46 Init("IPCMojoBootstrapTestClient"); | 52 Init("IPCMojoBootstrapTestClient"); |
47 | 53 |
48 TestingDelegate delegate; | 54 TestingDelegate delegate; |
49 scoped_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create( | 55 scoped_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create( |
50 GetTestChannelHandle(), IPC::Channel::MODE_SERVER, &delegate, nullptr); | 56 GetTestChannelHandle(), IPC::Channel::MODE_SERVER, &delegate, nullptr); |
51 | 57 |
52 ASSERT_TRUE(bootstrap->Connect()); | 58 ASSERT_TRUE(bootstrap->Connect()); |
53 #if defined(OS_POSIX) | 59 #if defined(OS_POSIX) |
54 ASSERT_TRUE(StartClientWithFD(bootstrap->GetClientFileDescriptor())); | 60 ASSERT_TRUE(StartClientWithFD(bootstrap->GetClientFileDescriptor())); |
55 #else | 61 #else |
(...skipping 21 matching lines...) Expand all Loading... |
77 bootstrap->Connect(); | 83 bootstrap->Connect(); |
78 | 84 |
79 base::MessageLoop::current()->Run(); | 85 base::MessageLoop::current()->Run(); |
80 | 86 |
81 EXPECT_TRUE(delegate.passed()); | 87 EXPECT_TRUE(delegate.passed()); |
82 | 88 |
83 return 0; | 89 return 0; |
84 } | 90 } |
85 | 91 |
86 } // namespace | 92 } // namespace |
OLD | NEW |