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

Unified Diff: base/perf_test_suite.h

Issue 18003: Call logging::InitLogging. The lack of this was causing some hangs (and poss... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
« no previous file with comments | « base/build/base_unittests.vcproj ('k') | base/perftimer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/perf_test_suite.h
===================================================================
--- base/perf_test_suite.h (revision 0)
+++ base/perf_test_suite.h (revision 0)
@@ -0,0 +1,50 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_PERF_TEST_SUITE_H_
+#define BASE_PERF_TEST_SUITE_H_
+
+#include "base/command_line.h"
+#include "base/debug_util.h"
+#include "base/file_path.h"
+#include "base/perftimer.h"
+#include "base/process_util.h"
+#include "base/string_util.h"
+#include "base/test_suite.h"
+
+class PerfTestSuite : public TestSuite {
+ public:
+ PerfTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
+ }
+
+ virtual void Initialize() {
+ // Initialize the perf timer log
+ FilePath log_path;
+ std::wstring log_file = CommandLine().GetSwitchValue(L"log-file");
+ if (log_file.empty()) {
+ FilePath exe;
+ PathService::Get(base::FILE_EXE, &exe);
+ log_path = exe.ReplaceExtension(FILE_PATH_LITERAL("log"));
+ log_path = log_path.InsertBeforeExtension(FILE_PATH_LITERAL("_perf"));
+ } else {
+ log_path = FilePath::FromWStringHack(log_file);
+ }
+ ASSERT_TRUE(InitPerfLog(log_path));
+
+ // Raise to high priority to have more precise measurements. Since we don't
+ // aim at 1% precision, it is not necessary to run at realtime level.
+ if (!DebugUtil::BeingDebugged())
+ base::RaiseProcessToHighPriority();
+
+ TestSuite::Initialize();
+ }
+
+ virtual void Shutdown() {
+ TestSuite::Shutdown();
+
+ FinalizePerfLog();
+ }
+};
+
+#endif // BASE_PERF_TEST_SUITE_H_
Property changes on: base\perf_test_suite.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « base/build/base_unittests.vcproj ('k') | base/perftimer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698