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" | |
29 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
30 | 29 |
31 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
32 #include "content/browser/android/browser_jni_registrar.h" | 31 #include "content/browser/android/browser_jni_registrar.h" |
33 #endif | 32 #endif |
34 | 33 |
35 namespace content { | 34 namespace content { |
36 | 35 |
37 namespace { | 36 namespace { |
38 | 37 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 303 |
305 seen_ = true; | 304 seen_ = true; |
306 if (!running_) | 305 if (!running_) |
307 return; | 306 return; |
308 | 307 |
309 message_loop_runner_->Quit(); | 308 message_loop_runner_->Quit(); |
310 running_ = false; | 309 running_ = false; |
311 } | 310 } |
312 | 311 |
313 InProcessUtilityThreadHelper::InProcessUtilityThreadHelper() | 312 InProcessUtilityThreadHelper::InProcessUtilityThreadHelper() |
314 : child_thread_count_(0), shell_context_(new TestMojoShellContext) { | 313 : child_thread_count_(0) { |
315 RenderProcessHost::SetRunRendererInProcess(true); | 314 RenderProcessHost::SetRunRendererInProcess(true); |
316 BrowserChildProcessObserver::Add(this); | 315 BrowserChildProcessObserver::Add(this); |
317 } | 316 } |
318 | 317 |
319 InProcessUtilityThreadHelper::~InProcessUtilityThreadHelper() { | 318 InProcessUtilityThreadHelper::~InProcessUtilityThreadHelper() { |
320 if (child_thread_count_) { | 319 if (child_thread_count_) { |
321 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::UI)); | 320 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::UI)); |
322 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::IO)); | 321 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::IO)); |
323 runner_ = new MessageLoopRunner; | 322 runner_ = new MessageLoopRunner; |
324 runner_->Run(); | 323 runner_->Run(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 383 |
385 void WebContentsDestroyedWatcher::Wait() { | 384 void WebContentsDestroyedWatcher::Wait() { |
386 message_loop_runner_->Run(); | 385 message_loop_runner_->Run(); |
387 } | 386 } |
388 | 387 |
389 void WebContentsDestroyedWatcher::WebContentsDestroyed() { | 388 void WebContentsDestroyedWatcher::WebContentsDestroyed() { |
390 message_loop_runner_->Quit(); | 389 message_loop_runner_->Quit(); |
391 } | 390 } |
392 | 391 |
393 } // namespace content | 392 } // namespace content |
OLD | NEW |