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

Unified Diff: components/test/run_all_perftests.cc

Issue 2358063002: Preparing components_perftests (Closed)
Patch Set: Attempt to guess how generate_perf_json.py works Created 4 years, 3 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: components/test/run_all_perftests.cc
diff --git a/components/test/run_all_perftests.cc b/components/test/run_all_perftests.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7cafbbe7621762c23296144935989db9d5c937d1
--- /dev/null
+++ b/components/test/run_all_perftests.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2016 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.
+
+#include <memory>
+
+#include "base/memory/ptr_util.h"
+#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/perf_log.h"
+#include "components/test/components_test_suit.h"
+
+class ComponentsPerfTestSuite : public ComponentsTestSuite {
+ public:
+ ComponentsPerfTestSuite(int argc, char** argv)
+ : ComponentsTestSuite(argc, argv) {}
+
+ void Initialize() final {
+ ComponentsTestSuite::Initialize();
+ CHECK(base::InitPerfLog());
+ }
+
+ void Shutdown() final {
+ base::FinalizePerfLog();
+ ComponentsTestSuite::Shutdown();
+ }
+};
+
+int main(int argc, char** argv) {
+ auto test_suite = base::MakeUnique<ComponentsPerfTestSuite>(argc, argv);
+ // 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 (!base::debug::BeingDebugged())
+ base::RaiseProcessToHighPriority();
+ return base::LaunchUnitTestsSerially(
+ argc, argv, CreateCallbackForLaunch(std::move(test_suite)));
+}

Powered by Google App Engine
This is Rietveld 408576698