OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 BrowserProcessImplTest() | 23 BrowserProcessImplTest() |
24 : stashed_browser_process_(g_browser_process), | 24 : stashed_browser_process_(g_browser_process), |
25 loop_(base::MessageLoop::TYPE_UI), | 25 loop_(base::MessageLoop::TYPE_UI), |
26 ui_thread_(content::BrowserThread::UI, &loop_), | 26 ui_thread_(content::BrowserThread::UI, &loop_), |
27 file_thread_( | 27 file_thread_( |
28 new content::TestBrowserThread(content::BrowserThread::FILE)), | 28 new content::TestBrowserThread(content::BrowserThread::FILE)), |
29 io_thread_(new content::TestBrowserThread(content::BrowserThread::IO)), | 29 io_thread_(new content::TestBrowserThread(content::BrowserThread::IO)), |
30 command_line_(base::CommandLine::NO_PROGRAM), | 30 command_line_(base::CommandLine::NO_PROGRAM), |
31 browser_process_impl_( | 31 browser_process_impl_( |
32 new BrowserProcessImpl(base::ThreadTaskRunnerHandle::Get().get(), | 32 new BrowserProcessImpl(base::ThreadTaskRunnerHandle::Get().get(), |
33 command_line_)) { | 33 command_line_, |
| 34 false)) { |
34 base::SetRecordActionTaskRunner(loop_.task_runner()); | 35 base::SetRecordActionTaskRunner(loop_.task_runner()); |
35 browser_process_impl_->SetApplicationLocale("en"); | 36 browser_process_impl_->SetApplicationLocale("en"); |
36 } | 37 } |
37 | 38 |
38 ~BrowserProcessImplTest() override { | 39 ~BrowserProcessImplTest() override { |
39 g_browser_process = nullptr; | 40 g_browser_process = nullptr; |
40 browser_process_impl_.reset(); | 41 browser_process_impl_.reset(); |
41 // Restore the original browser process. | 42 // Restore the original browser process. |
42 g_browser_process = stashed_browser_process_; | 43 g_browser_process = stashed_browser_process_; |
43 } | 44 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Pass ownership to the ProfileManager so that it manages the destruction. | 96 // Pass ownership to the ProfileManager so that it manages the destruction. |
96 browser_process_impl()->profile_manager()->RegisterTestingProfile( | 97 browser_process_impl()->profile_manager()->RegisterTestingProfile( |
97 profile.release(), false, false); | 98 profile.release(), false, false); |
98 | 99 |
99 // Tear down the BrowserProcessImpl and the threads. | 100 // Tear down the BrowserProcessImpl and the threads. |
100 browser_process_impl()->StartTearDown(); | 101 browser_process_impl()->StartTearDown(); |
101 DestroySecondaryThreads(); | 102 DestroySecondaryThreads(); |
102 browser_process_impl()->PostDestroyThreads(); | 103 browser_process_impl()->PostDestroyThreads(); |
103 } | 104 } |
104 #endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 105 #endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
OLD | NEW |