OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/base/chrome_test_suite.h" | 5 #include "chrome/test/base/chrome_test_suite.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
9 #include "base/metrics/stats_table.h" | 9 #include "base/metrics/stats_table.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 content::SetContentClient(&chrome_content_client_); | 103 content::SetContentClient(&chrome_content_client_); |
104 content::GetContentClient()->set_browser(&chrome_browser_content_client_); | 104 content::GetContentClient()->set_browser(&chrome_browser_content_client_); |
105 | 105 |
106 chrome::RegisterChromeSchemes(); | 106 chrome::RegisterChromeSchemes(); |
107 host_resolver_proc_ = new LocalHostResolverProc(); | 107 host_resolver_proc_ = new LocalHostResolverProc(); |
108 scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); | 108 scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); |
109 | 109 |
110 chrome::RegisterPathProvider(); | 110 chrome::RegisterPathProvider(); |
111 content::RegisterPathProvider(); | 111 content::RegisterPathProvider(); |
112 ui::RegisterPathProvider(); | 112 ui::RegisterPathProvider(); |
| 113 |
| 114 #if !defined(OS_WIN) |
| 115 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
113 g_browser_process = new TestingBrowserProcess; | 116 g_browser_process = new TestingBrowserProcess; |
| 117 #endif |
114 | 118 |
115 if (!browser_dir_.empty()) { | 119 if (!browser_dir_.empty()) { |
116 PathService::Override(base::DIR_EXE, browser_dir_); | 120 PathService::Override(base::DIR_EXE, browser_dir_); |
117 PathService::Override(base::DIR_MODULE, browser_dir_); | 121 PathService::Override(base::DIR_MODULE, browser_dir_); |
118 } | 122 } |
119 | 123 |
120 #if defined(OS_MACOSX) | 124 #if defined(OS_MACOSX) |
121 // Look in the framework bundle for resources. | 125 // Look in the framework bundle for resources. |
122 FilePath path; | 126 FilePath path; |
123 PathService::Get(base::DIR_EXE, &path); | 127 PathService::Get(base::DIR_EXE, &path); |
(...skipping 25 matching lines...) Expand all Loading... |
149 #endif | 153 #endif |
150 } | 154 } |
151 | 155 |
152 void ChromeTestSuite::Shutdown() { | 156 void ChromeTestSuite::Shutdown() { |
153 ResourceBundle::CleanupSharedInstance(); | 157 ResourceBundle::CleanupSharedInstance(); |
154 | 158 |
155 #if defined(OS_MACOSX) | 159 #if defined(OS_MACOSX) |
156 base::mac::SetOverrideAppBundle(NULL); | 160 base::mac::SetOverrideAppBundle(NULL); |
157 #endif | 161 #endif |
158 | 162 |
| 163 #if !defined(OS_WIN) |
| 164 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. |
159 delete g_browser_process; | 165 delete g_browser_process; |
160 g_browser_process = NULL; | 166 g_browser_process = NULL; |
| 167 #endif |
161 | 168 |
162 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 169 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
163 base::StatsTable::set_current(NULL); | 170 base::StatsTable::set_current(NULL); |
164 delete stats_table_; | 171 delete stats_table_; |
165 RemoveSharedMemoryFile(stats_filename_); | 172 RemoveSharedMemoryFile(stats_filename_); |
166 | 173 |
167 base::TestSuite::Shutdown(); | 174 base::TestSuite::Shutdown(); |
168 } | 175 } |
OLD | NEW |