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

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

Issue 10686005: Add methods to add DataPack from open files (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_ui_browsertest.cc ('k') | chrome/tools/mac_helpers/infoplist_strings_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698