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

Unified Diff: chrome/test/perf/perf_test.cc

Issue 14273023: Rebuild test history databases when starting up performance_ui_tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Speed up profile generation Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698