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

Unified Diff: media/base/run_all_unittests.cc

Issue 10808115: Run media_unittests on android test bots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed nits, removed some unused header inclusion. Created 8 years, 5 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 | « build/android/run_tests.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/run_all_unittests.cc
diff --git a/media/base/run_all_unittests.cc b/media/base/run_all_unittests.cc
index 4dc422450c8634f3fd164e28bd3dcb172c81d2d4..01616fb6f95fc88940e6c487443ddcc17aecc9e3 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();
}
« no previous file with comments | « build/android/run_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698