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

Unified Diff: ui/snapshot/test/run_all_unittests.cc

Issue 23442019: Convert most run_all_unittests.cc files to use new unit test launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 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
« no previous file with comments | « ui/message_center/test/run_all_unittests.cc ('k') | ui/test/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/snapshot/test/run_all_unittests.cc
diff --git a/ui/snapshot/test/run_all_unittests.cc b/ui/snapshot/test/run_all_unittests.cc
index 5bf3d5fda55f7892d387e4c8af35abf636a02c48..395f0f6db9bf2fa4496df6a7f0991e12dc52d39e 100644
--- a/ui/snapshot/test/run_all_unittests.cc
+++ b/ui/snapshot/test/run_all_unittests.cc
@@ -2,13 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/bind.h"
#include "base/test/test_suite.h"
+#include "base/test/unit_test_launcher.h"
#include "ui/compositor/test/test_suite.h"
+namespace {
+
+class NoAtExitBaseTestSuite : public base::TestSuite {
+ public:
+ NoAtExitBaseTestSuite(int argc, char** argv)
+ : base::TestSuite(argc, argv, false) {
+ }
+};
+
+int RunTestSuite(int argc, char** argv) {
+ return NoAtExitBaseTestSuite(argc, argv).Run();
+}
+
+} // namespace
+
int main(int argc, char** argv) {
#if defined(USE_AURA)
- return ui::test::CompositorTestSuite(argc, argv).Run();
+ ui::test::CompositorTestSuite test_suite(argc, argv);
+
+ return base::LaunchUnitTests(
+ argc, argv, base::Bind(&ui::test::CompositorTestSuite::Run,
+ base::Unretained(&test_suite)));
#else
- return base::TestSuite(argc, argv).Run();
+#if !defined(OS_ANDROID)
+ base::AtExitManager at_exit;
+#endif
+ return base::LaunchUnitTests(argc,
+ argv,
+ base::Bind(&RunTestSuite, argc, argv));
#endif
}
« no previous file with comments | « ui/message_center/test/run_all_unittests.cc ('k') | ui/test/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698