Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: chrome/test/unit/chrome_test_suite.cc

Issue 7004007: iwyu: Include stringprintf.h where appropriate, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix 2. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/ui/ui_layout_test.cc ('k') | chrome/tools/convert_dict/aff_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/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 "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/mac/scoped_nsautorelease_pool.h" 9 #include "base/mac/scoped_nsautorelease_pool.h"
10 #include "base/metrics/stats_table.h" 10 #include "base/metrics/stats_table.h"
11 #include "base/process_util.h" 11 #include "base/process_util.h"
12 #include "base/string_util.h" 12 #include "base/stringprintf.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_content_client.h" 16 #include "chrome/common/chrome_content_client.h"
17 #include "chrome/common/chrome_paths.h" 17 #include "chrome/common/chrome_paths.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 "content/common/content_paths.h" 20 #include "content/common/content_paths.h"
21 #include "net/base/net_errors.h" 21 #include "net/base/net_errors.h"
22 #include "ui/base/resource/resource_bundle.h" 22 #include "ui/base/resource/resource_bundle.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ResourceBundle::InitSharedInstance("en-US"); 129 ResourceBundle::InitSharedInstance("en-US");
130 FilePath resources_pack_path; 130 FilePath resources_pack_path;
131 PathService::Get(base::DIR_MODULE, &resources_pack_path); 131 PathService::Get(base::DIR_MODULE, &resources_pack_path);
132 resources_pack_path = 132 resources_pack_path =
133 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); 133 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak"));
134 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); 134 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path);
135 135
136 // initialize the global StatsTable for unit_tests (make sure the file 136 // initialize the global StatsTable for unit_tests (make sure the file
137 // doesn't exist before opening it so the test gets a clean slate) 137 // doesn't exist before opening it so the test gets a clean slate)
138 stats_filename_ = "unit_tests"; 138 stats_filename_ = "unit_tests";
139 std::string pid_string = StringPrintf("-%d", base::GetCurrentProcId()); 139 std::string pid_string = base::StringPrintf("-%d", base::GetCurrentProcId());
140 stats_filename_ += pid_string; 140 stats_filename_ += pid_string;
141 RemoveSharedMemoryFile(stats_filename_); 141 RemoveSharedMemoryFile(stats_filename_);
142 stats_table_ = new base::StatsTable(stats_filename_, 20, 200); 142 stats_table_ = new base::StatsTable(stats_filename_, 20, 200);
143 base::StatsTable::set_current(stats_table_); 143 base::StatsTable::set_current(stats_table_);
144 } 144 }
145 145
146 void ChromeTestSuite::Shutdown() { 146 void ChromeTestSuite::Shutdown() {
147 ResourceBundle::CleanupSharedInstance(); 147 ResourceBundle::CleanupSharedInstance();
148 148
149 #if defined(OS_MACOSX) 149 #if defined(OS_MACOSX)
150 base::mac::SetOverrideAppBundle(NULL); 150 base::mac::SetOverrideAppBundle(NULL);
151 #endif 151 #endif
152 152
153 delete g_browser_process; 153 delete g_browser_process;
154 g_browser_process = NULL; 154 g_browser_process = NULL;
155 155
156 // Tear down shared StatsTable; prevents unit_tests from leaking it. 156 // Tear down shared StatsTable; prevents unit_tests from leaking it.
157 base::StatsTable::set_current(NULL); 157 base::StatsTable::set_current(NULL);
158 delete stats_table_; 158 delete stats_table_;
159 RemoveSharedMemoryFile(stats_filename_); 159 RemoveSharedMemoryFile(stats_filename_);
160 160
161 base::TestSuite::Shutdown(); 161 base::TestSuite::Shutdown();
162 } 162 }
OLDNEW
« no previous file with comments | « chrome/test/ui/ui_layout_test.cc ('k') | chrome/tools/convert_dict/aff_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698