OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bind.h" |
5 #include "base/command_line.h" | 6 #include "base/command_line.h" |
6 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
7 #include "build/build_config.h" | 8 #include "build/build_config.h" |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 9 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 #include "content/common/child_process_messages.h" | 10 #include "content/common/child_process_messages.h" |
10 #include "content/public/browser/render_process_host.h" | 11 #include "content/public/browser/render_process_host.h" |
11 #include "content/public/browser/render_process_host_observer.h" | 12 #include "content/public/browser/render_process_host_observer.h" |
12 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 process_exits_ = 0; | 221 process_exits_ = 0; |
221 rph->AddObserver(this); | 222 rph->AddObserver(this); |
222 | 223 |
223 mojom::TestMojoServicePtr service; | 224 mojom::TestMojoServicePtr service; |
224 rph->GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&service)); | 225 rph->GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&service)); |
225 | 226 |
226 base::RunLoop run_loop; | 227 base::RunLoop run_loop; |
227 set_process_exit_callback(run_loop.QuitClosure()); | 228 set_process_exit_callback(run_loop.QuitClosure()); |
228 | 229 |
229 // Should reply with a bad message and cause process death. | 230 // Should reply with a bad message and cause process death. |
230 service->DoSomething([]{}); | 231 service->DoSomething(base::Bind(&base::DoNothing)); |
231 | 232 |
232 run_loop.Run(); | 233 run_loop.Run(); |
233 | 234 |
234 EXPECT_EQ(1, process_exits_); | 235 EXPECT_EQ(1, process_exits_); |
235 EXPECT_EQ(0, host_destructions_); | 236 EXPECT_EQ(0, host_destructions_); |
236 if (!host_destructions_) | 237 if (!host_destructions_) |
237 rph->RemoveObserver(this); | 238 rph->RemoveObserver(this); |
238 } | 239 } |
239 | 240 |
240 } // namespace | 241 } // namespace |
241 } // namespace content | 242 } // namespace content |
OLD | NEW |