OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/process_util.h" | 6 #include "base/process_util.h" |
7 #include "base/test/multiprocess_test.h" | 7 #include "base/test/multiprocess_test.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/main_function_params.h" | 9 #include "chrome/common/main_function_params.h" |
10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 TEST_F(RendererMainTest, CreateDestroy) { | 87 TEST_F(RendererMainTest, CreateDestroy) { |
88 SuicidalListener listener; | 88 SuicidalListener listener; |
89 IPC::Channel control_channel(kRendererTestChannelName, | 89 IPC::Channel control_channel(kRendererTestChannelName, |
90 IPC::Channel::MODE_SERVER, | 90 IPC::Channel::MODE_SERVER, |
91 &listener); | 91 &listener); |
92 base::ProcessHandle renderer_pid = SpawnChild("SimpleRenderer", | 92 base::ProcessHandle renderer_pid = SpawnChild("SimpleRenderer", |
93 &control_channel); | 93 &control_channel); |
94 | 94 |
95 control_channel.Connect(); | 95 ASSERT_TRUE(control_channel.Connect()); |
96 MessageLoop::current()->Run(); | 96 MessageLoop::current()->Run(); |
97 | 97 |
98 // The renderer should exit when we close the channel. | 98 // The renderer should exit when we close the channel. |
99 control_channel.Close(); | 99 control_channel.Close(); |
100 | 100 |
101 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid, 5000)); | 101 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid, 5000)); |
102 } | 102 } |
103 #endif // defined(OS_POSIX) | 103 #endif // defined(OS_POSIX) |
OLD | NEW |