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 #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/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/stats_table.h" | 10 #include "base/metrics/stats_table.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 base::mac::SetOverrideFrameworkBundlePath(path); | 183 base::mac::SetOverrideFrameworkBundlePath(path); |
184 #endif | 184 #endif |
185 | 185 |
186 // Force unittests to run using en-US so if we test against string | 186 // Force unittests to run using en-US so if we test against string |
187 // output, it'll pass regardless of the system language. | 187 // output, it'll pass regardless of the system language. |
188 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 188 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
189 FilePath resources_pack_path; | 189 FilePath resources_pack_path; |
190 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 190 PathService::Get(base::DIR_MODULE, &resources_pack_path); |
191 resources_pack_path = | 191 resources_pack_path = |
192 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); | 192 resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak")); |
193 ResourceBundle::GetSharedInstance().AddDataPack( | 193 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
194 resources_pack_path, ui::SCALE_FACTOR_100P); | 194 resources_pack_path, ui::SCALE_FACTOR_100P); |
195 | 195 |
196 stats_filename_ = base::StringPrintf("unit_tests-%d", | 196 stats_filename_ = base::StringPrintf("unit_tests-%d", |
197 base::GetCurrentProcId()); | 197 base::GetCurrentProcId()); |
198 RemoveSharedMemoryFile(stats_filename_); | 198 RemoveSharedMemoryFile(stats_filename_); |
199 stats_table_.reset(new base::StatsTable(stats_filename_, 20, 200)); | 199 stats_table_.reset(new base::StatsTable(stats_filename_, 20, 200)); |
200 base::StatsTable::set_current(stats_table_.get()); | 200 base::StatsTable::set_current(stats_table_.get()); |
201 | 201 |
202 testing::TestEventListeners& listeners = | 202 testing::TestEventListeners& listeners = |
203 testing::UnitTest::GetInstance()->listeners(); | 203 testing::UnitTest::GetInstance()->listeners(); |
(...skipping 10 matching lines...) Expand all Loading... |
214 #if defined(OS_MACOSX) | 214 #if defined(OS_MACOSX) |
215 base::mac::SetOverrideFrameworkBundle(NULL); | 215 base::mac::SetOverrideFrameworkBundle(NULL); |
216 #endif | 216 #endif |
217 | 217 |
218 base::StatsTable::set_current(NULL); | 218 base::StatsTable::set_current(NULL); |
219 stats_table_.reset(); | 219 stats_table_.reset(); |
220 RemoveSharedMemoryFile(stats_filename_); | 220 RemoveSharedMemoryFile(stats_filename_); |
221 | 221 |
222 base::TestSuite::Shutdown(); | 222 base::TestSuite::Shutdown(); |
223 } | 223 } |
OLD | NEW |