| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/unit/chrome_test_suite.h" | 5 #include "chrome/test/unit/chrome_test_suite.h" |
| 6 | 6 |
| 7 #include "app/app_paths.h" | 7 #include "app/app_paths.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/mac/scoped_nsautorelease_pool.h" |
| 10 #include "base/metrics/stats_table.h" | 11 #include "base/metrics/stats_table.h" |
| 11 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 12 #include "base/scoped_nsautorelease_pool.h" | |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 16 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
| 17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 19 #include "chrome/test/testing_browser_process.h" | 19 #include "chrome/test/testing_browser_process.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 | 21 |
| 22 #if defined(OS_MACOSX) | 22 #if defined(OS_MACOSX) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 ChromeTestSuite::ChromeTestSuite(int argc, char** argv) | 79 ChromeTestSuite::ChromeTestSuite(int argc, char** argv) |
| 80 : base::TestSuite(argc, argv), | 80 : base::TestSuite(argc, argv), |
| 81 stats_table_(NULL) { | 81 stats_table_(NULL) { |
| 82 } | 82 } |
| 83 | 83 |
| 84 ChromeTestSuite::~ChromeTestSuite() { | 84 ChromeTestSuite::~ChromeTestSuite() { |
| 85 } | 85 } |
| 86 | 86 |
| 87 void ChromeTestSuite::Initialize() { | 87 void ChromeTestSuite::Initialize() { |
| 88 base::ScopedNSAutoreleasePool autorelease_pool; | 88 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
| 89 | 89 |
| 90 base::TestSuite::Initialize(); | 90 base::TestSuite::Initialize(); |
| 91 | 91 |
| 92 chrome::RegisterChromeSchemes(); | 92 chrome::RegisterChromeSchemes(); |
| 93 host_resolver_proc_ = new LocalHostResolverProc(); | 93 host_resolver_proc_ = new LocalHostResolverProc(); |
| 94 scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); | 94 scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); |
| 95 | 95 |
| 96 chrome::RegisterPathProvider(); | 96 chrome::RegisterPathProvider(); |
| 97 app::RegisterPathProvider(); | 97 app::RegisterPathProvider(); |
| 98 g_browser_process = new TestingBrowserProcess; | 98 g_browser_process = new TestingBrowserProcess; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 delete g_browser_process; | 134 delete g_browser_process; |
| 135 g_browser_process = NULL; | 135 g_browser_process = NULL; |
| 136 | 136 |
| 137 // Tear down shared StatsTable; prevents unit_tests from leaking it. | 137 // Tear down shared StatsTable; prevents unit_tests from leaking it. |
| 138 base::StatsTable::set_current(NULL); | 138 base::StatsTable::set_current(NULL); |
| 139 delete stats_table_; | 139 delete stats_table_; |
| 140 RemoveSharedMemoryFile(stats_filename_); | 140 RemoveSharedMemoryFile(stats_filename_); |
| 141 | 141 |
| 142 base::TestSuite::Shutdown(); | 142 base::TestSuite::Shutdown(); |
| 143 } | 143 } |
| OLD | NEW |