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 // Create a service process that uses a Mock to respond to the browser in order | 5 // Create a service process that uses a Mock to respond to the browser in order |
6 // to test launching the browser using the cloud print policy check command | 6 // to test launching the browser using the cloud print policy check command |
7 // line switch. | 7 // line switch. |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/process/kill.h" | 17 #include "base/process/kill.h" |
18 #include "base/process/process.h" | 18 #include "base/process/process.h" |
19 #include "base/rand_util.h" | 19 #include "base/rand_util.h" |
20 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
21 #include "base/synchronization/waitable_event.h" | 21 #include "base/synchronization/waitable_event.h" |
22 #include "base/test/multiprocess_test.h" | 22 #include "base/test/multiprocess_test.h" |
23 #include "base/test/test_timeouts.h" | 23 #include "base/test/test_timeouts.h" |
24 #include "base/thread_task_runner_handle.h" | 24 #include "base/threading/thread_task_runner_handle.h" |
25 #include "base/time/default_tick_clock.h" | 25 #include "base/time/default_tick_clock.h" |
26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
27 #include "build/build_config.h" | 27 #include "build/build_config.h" |
28 #include "chrome/browser/chrome_content_browser_client.h" | 28 #include "chrome/browser/chrome_content_browser_client.h" |
29 #include "chrome/browser/prefs/browser_prefs.h" | 29 #include "chrome/browser/prefs/browser_prefs.h" |
30 #include "chrome/browser/service_process/service_process_control.h" | 30 #include "chrome/browser/service_process/service_process_control.h" |
31 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 31 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
32 #include "chrome/common/chrome_content_client.h" | 32 #include "chrome/common/chrome_content_client.h" |
33 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 // LocalState for the BrowserProcess. Must be created before profiles are | 515 // LocalState for the BrowserProcess. Must be created before profiles are |
516 // constructed. | 516 // constructed. |
517 chrome::TestingIOThreadState testing_io_thread_state; | 517 chrome::TestingIOThreadState testing_io_thread_state; |
518 | 518 |
519 base::Process process = | 519 base::Process process = |
520 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); | 520 Launch("CloudPrintMockService_StartEnabledWaitForQuit"); |
521 WaitForConnect(); | 521 WaitForConnect(); |
522 ShutdownAndWaitForExitWithTimeout(std::move(process)); | 522 ShutdownAndWaitForExitWithTimeout(std::move(process)); |
523 content::RunAllPendingInMessageLoop(); | 523 content::RunAllPendingInMessageLoop(); |
524 } | 524 } |
OLD | NEW |