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 // Note: This file also tests child_process.*. | 5 // Note: This file also tests child_process.*. |
6 | 6 |
7 #include "shell/child_process_host.h" | 7 #include "shell/child_process_host.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 VLOG(2) << "TestChildProcessHostDelegate::WillStart()"; | 26 VLOG(2) << "TestChildProcessHostDelegate::WillStart()"; |
27 } | 27 } |
28 void DidStart(bool success) override { | 28 void DidStart(bool success) override { |
29 VLOG(2) << "TestChildProcessHostDelegate::DidStart(" << success << ")"; | 29 VLOG(2) << "TestChildProcessHostDelegate::DidStart(" << success << ")"; |
30 base::MessageLoop::current()->QuitWhenIdle(); | 30 base::MessageLoop::current()->QuitWhenIdle(); |
31 } | 31 } |
32 }; | 32 }; |
33 | 33 |
34 typedef testing::Test ChildProcessHostTest; | 34 typedef testing::Test ChildProcessHostTest; |
35 | 35 |
36 TEST_F(ChildProcessHostTest, Basic) { | 36 #if defined(OS_ANDROID) |
| 37 // TODO(qsr): Multiprocess shell tests are not supported on android. |
| 38 #define MAYBE_Basic DISABLED_Basic |
| 39 #else |
| 40 #define MAYBE_Basic Basic |
| 41 #endif // defined(OS_ANDROID) |
| 42 TEST_F(ChildProcessHostTest, MAYBE_Basic) { |
37 Context context; | 43 Context context; |
38 base::MessageLoop message_loop( | 44 base::MessageLoop message_loop( |
39 scoped_ptr<base::MessagePump>(new common::MessagePumpMojo())); | 45 scoped_ptr<base::MessagePump>(new common::MessagePumpMojo())); |
40 context.Init(); | 46 context.Init(); |
41 TestChildProcessHostDelegate child_process_host_delegate; | 47 TestChildProcessHostDelegate child_process_host_delegate; |
42 ChildProcessHost child_process_host(&context, &child_process_host_delegate, | 48 ChildProcessHost child_process_host(&context, &child_process_host_delegate, |
43 ChildProcess::TYPE_TEST); | 49 ChildProcess::TYPE_TEST); |
44 child_process_host.Start(); | 50 child_process_host.Start(); |
45 message_loop.Run(); | 51 message_loop.Run(); |
46 int exit_code = child_process_host.Join(); | 52 int exit_code = child_process_host.Join(); |
47 VLOG(2) << "Joined child: exit_code = " << exit_code; | 53 VLOG(2) << "Joined child: exit_code = " << exit_code; |
48 EXPECT_EQ(0, exit_code); | 54 EXPECT_EQ(0, exit_code); |
49 } | 55 } |
50 | 56 |
51 } // namespace | 57 } // namespace |
52 } // namespace test | 58 } // namespace test |
53 } // namespace shell | 59 } // namespace shell |
54 } // namespace mojo | 60 } // namespace mojo |
OLD | NEW |