Chromium Code Reviews| Index: chrome/test/perf/perf_test.cc |
| diff --git a/chrome/test/perf/perf_test.cc b/chrome/test/perf/perf_test.cc |
| index 0208df08fcf059f156396de437916a98001d83eb..7aceab1d5971c7b8ac42a923e643777cbeaf18ed 100644 |
| --- a/chrome/test/perf/perf_test.cc |
| +++ b/chrome/test/perf/perf_test.cc |
| @@ -6,13 +6,22 @@ |
| #include <stdio.h> |
| +#include "base/base_paths.h" |
| +#include "base/file_util.h" |
| +#include "base/lazy_instance.h" |
| #include "base/logging.h" |
| +#include "base/path_service.h" |
| #include "base/stringprintf.h" |
| #include "base/strings/string_number_conversions.h" |
| #include "chrome/test/base/chrome_process_util.h" |
| namespace { |
| +base::LazyInstance<base::FilePath> default_profile_dir_ = |
| + LAZY_INSTANCE_INITIALIZER; |
| +base::LazyInstance<base::FilePath> complex_profile_dir_ = |
| + LAZY_INSTANCE_INITIALIZER; |
| + |
| std::string ResultsToString(const std::string& measurement, |
| const std::string& modifier, |
| const std::string& trace, |
| @@ -580,4 +589,29 @@ std::string SystemCommitChargeToString(const std::string& test_name, |
| return output; |
| } |
| +void SetPathForProfileType(ProfileType profile_type, base::FilePath path) { |
|
Paweł Hajdan Jr.
2013/04/26 23:19:32
I don't really like this global state here.
The q
|
| + switch (profile_type) { |
| + case DEFAULT_THEME: |
| + default_profile_dir_.Get() = path; |
| + break; |
| + case COMPLEX_THEME: |
| + complex_profile_dir_.Get() = path; |
| + break; |
| + default: |
| + NOTREACHED(); |
| + } |
| +} |
| + |
| +base::FilePath GetPathForProfileType(ProfileType profile_type) { |
| + switch (profile_type) { |
| + case DEFAULT_THEME: |
| + return default_profile_dir_.Get(); |
| + case COMPLEX_THEME: |
| + return complex_profile_dir_.Get(); |
| + default: |
| + NOTREACHED(); |
| + return base::FilePath(); |
| + } |
| +} |
| + |
| } // namespace perf_test |