From 67d87a8e6a96ec2d5515128d1ed957de6937ba4b Mon Sep 17 00:00:00 2001 From: "nileshagrawal@chromium.org" Date: Thu, 26 Jul 2012 02:35:57 +0000 Subject: Run media_unittests on android test bots. BUG=137131 TEST= Review URL: https://chromiumcodereview.appspot.com/10808115 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148493 0039d316-1c4b-4281-b951-d872f2087c98 --- media/base/run_all_unittests.cc | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'media/base/run_all_unittests.cc') diff --git a/media/base/run_all_unittests.cc b/media/base/run_all_unittests.cc index 4dc4224..01616fb 100644 --- a/media/base/run_all_unittests.cc +++ b/media/base/run_all_unittests.cc @@ -2,33 +2,25 @@ // 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/logging.h" #include "base/test/test_suite.h" #include "media/base/media.h" class TestSuiteNoAtExit : public base::TestSuite { public: - TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv, false) {} + TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} virtual ~TestSuiteNoAtExit() {} + protected: + virtual void Initialize(); }; -int main(int argc, char** argv) { - // By default command-line parsing happens only in TestSuite::Run(), but - // that's too late to get VLOGs and so on from - // InitializeMediaLibraryForTesting() below. Instead initialize logging - // explicitly here (and have it get re-initialized by TestSuite::Run()). - CommandLine::Init(argc, argv); - CHECK(logging::InitLogging( - NULL, - logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, - logging::DONT_LOCK_LOG_FILE, - logging::APPEND_TO_OLD_LOG_FILE, - logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS)); - base::AtExitManager exit_manager; - +void TestSuiteNoAtExit::Initialize() { + // Run TestSuite::Initialize first so that logging is initialized. + base::TestSuite::Initialize(); + // Run this here instead of main() to ensure an AtExitManager is already + // present. media::InitializeMediaLibraryForTesting(); +} +int main(int argc, char** argv) { return TestSuiteNoAtExit(argc, argv).Run(); } -- cgit v1.1