OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/test_utils.h" | 5 #include "content/public/test/test_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "content/common/site_isolation_policy.h" | 19 #include "content/common/site_isolation_policy.h" |
20 #include "content/public/browser/browser_child_process_host_iterator.h" | 20 #include "content/public/browser/browser_child_process_host_iterator.h" |
21 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
22 #include "content/public/browser/render_frame_host.h" | 22 #include "content/public/browser/render_frame_host.h" |
23 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
26 #include "content/public/common/process_type.h" | 26 #include "content/public/common/process_type.h" |
27 #include "content/public/test/test_launcher.h" | 27 #include "content/public/test/test_launcher.h" |
28 #include "content/public/test/test_mojo_shell_context.h" | 28 #include "content/public/test/test_service_manager_context.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
30 | 30 |
31 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
32 #include "content/browser/android/browser_jni_registrar.h" | 32 #include "content/browser/android/browser_jni_registrar.h" |
33 #endif | 33 #endif |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 seen_ = true; | 305 seen_ = true; |
306 if (!running_) | 306 if (!running_) |
307 return; | 307 return; |
308 | 308 |
309 message_loop_runner_->Quit(); | 309 message_loop_runner_->Quit(); |
310 running_ = false; | 310 running_ = false; |
311 } | 311 } |
312 | 312 |
313 InProcessUtilityThreadHelper::InProcessUtilityThreadHelper() | 313 InProcessUtilityThreadHelper::InProcessUtilityThreadHelper() |
314 : child_thread_count_(0), shell_context_(new TestMojoShellContext) { | 314 : child_thread_count_(0), shell_context_(new TestServiceManagerContext) { |
315 RenderProcessHost::SetRunRendererInProcess(true); | 315 RenderProcessHost::SetRunRendererInProcess(true); |
316 BrowserChildProcessObserver::Add(this); | 316 BrowserChildProcessObserver::Add(this); |
317 } | 317 } |
318 | 318 |
319 InProcessUtilityThreadHelper::~InProcessUtilityThreadHelper() { | 319 InProcessUtilityThreadHelper::~InProcessUtilityThreadHelper() { |
320 if (child_thread_count_) { | 320 if (child_thread_count_) { |
321 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::UI)); | 321 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::UI)); |
322 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::IO)); | 322 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::IO)); |
323 runner_ = new MessageLoopRunner; | 323 runner_ = new MessageLoopRunner; |
324 runner_->Run(); | 324 runner_->Run(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 void WebContentsDestroyedWatcher::Wait() { | 385 void WebContentsDestroyedWatcher::Wait() { |
386 message_loop_runner_->Run(); | 386 message_loop_runner_->Run(); |
387 } | 387 } |
388 | 388 |
389 void WebContentsDestroyedWatcher::WebContentsDestroyed() { | 389 void WebContentsDestroyedWatcher::WebContentsDestroyed() { |
390 message_loop_runner_->Quit(); | 390 message_loop_runner_->Quit(); |
391 } | 391 } |
392 | 392 |
393 } // namespace content | 393 } // namespace content |
OLD | NEW |