From 5ccf985d5e5b53f9196b85e147e9c290a648d7da Mon Sep 17 00:00:00 2001 From: jam Date: Thu, 10 Dec 2015 18:23:27 -0800 Subject: Remove the NoAtExitBaseTestSuite anti-pattern. A bunch of unit tests were deriving from base::TestSuite and telling it to not create an AtExitManager, while at the same time they were creating an AtExitManager. Just use the base::TestSuite directly which creates the AtExitManager. This follows similar cleanup I did in r362157. Review URL: https://codereview.chromium.org/1512053002 Cr-Commit-Position: refs/heads/master@{#364590} --- dbus/run_all_unittests.cc | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'dbus') diff --git a/dbus/run_all_unittests.cc b/dbus/run_all_unittests.cc index e90849c..dac4a3c 100644 --- a/dbus/run_all_unittests.cc +++ b/dbus/run_all_unittests.cc @@ -2,29 +2,13 @@ // 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/bind.h" #include "base/test/launcher/unit_test_launcher.h" #include "base/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) { - base::AtExitManager at_exit; - return base::LaunchUnitTestsSerially(argc, - argv, - base::Bind(&RunTestSuite, argc, argv)); + base::TestSuite test_suite(argc, argv); + return base::LaunchUnitTests( + argc, argv, + base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); } -- cgit v1.1