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

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

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 | « chrome/installer/util/run_all_unittests.cc ('k') | chrome/test/reliability/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/perf/perftests.cc
===================================================================
--- chrome/test/perf/perftests.cc (revision 7931)
+++ chrome/test/perf/perftests.cc (working copy)
@@ -2,59 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/at_exit.h"
-#include "base/command_line.h"
-#include "base/debug_util.h"
#include "base/message_loop.h"
-#include "base/perftimer.h"
-#include "base/process_util.h"
+#include "base/perf_test_suite.h"
#include "chrome/common/chrome_paths.cc"
-#include "testing/gtest/include/gtest/gtest.h"
-// TODO(darin): share code with base/run_all_perftests.cc
-
int main(int argc, char **argv) {
- base::AtExitManager exit_manager;
- base::EnableTerminationOnHeapCorruption();
- CommandLine::SetArgcArgv(argc, argv);
chrome::RegisterPathProvider();
MessageLoop main_message_loop;
- testing::InitGoogleTest(&argc, argv);
-
- const char log_file_switch[] = "-o";
- const char* log_filename = NULL;
- for (int i = 1; i < argc; i++) {
- if (strcmp(argv[i], log_file_switch) == 0) {
- // found the switch for the log file, use the next arg
- if (i >= argc - 1) {
- fprintf(stderr, "Log file not specified");
- return 1;
- }
- log_filename = argv[i + 1];
- }
- }
- if (!log_filename) {
- // use the default filename
- log_filename = "perf_test.log";
- }
- printf("Using output file \"%s\" (change with %s <filename>)\n",
- log_filename, log_file_switch);
-
- if (!InitPerfLog(log_filename)) {
- fprintf(stderr, "Unable to open log file\n");
- return 1;
- }
-
- // 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();
- }
-
- int result = RUN_ALL_TESTS();
-
- FinalizePerfLog();
- return result;
+ return PerfTestSuite(argc, argv).Run();
}
« no previous file with comments | « chrome/installer/util/run_all_unittests.cc ('k') | chrome/test/reliability/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698