Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
| 9 #include "media/base/media.h" | 9 #include "media/base/media.h" |
| 10 | 10 |
| 11 class TestSuiteNoAtExit : public base::TestSuite { | 11 class TestSuiteNoAtExit : public base::TestSuite { |
| 12 public: | 12 public: |
| 13 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv, false) {} | 13 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv, true) {} |
|
Ami GONE FROM CHROMIUM
2012/07/25 23:06:01
s/, true// instead?
nilesh
2012/07/26 00:54:02
Done.
| |
| 14 virtual ~TestSuiteNoAtExit() {} | 14 virtual ~TestSuiteNoAtExit() {} |
| 15 protected: | |
| 16 virtual void Initialize(); | |
| 15 }; | 17 }; |
| 16 | 18 |
| 19 void TestSuiteNoAtExit::Initialize() { | |
| 20 // Run TestSuite::Initialize first so that logging in initialized. | |
|
Ami GONE FROM CHROMIUM
2012/07/25 23:06:01
s/in/is/
nilesh
2012/07/26 00:54:02
Done.
| |
| 21 base::TestSuite::Initialize(); | |
| 22 media::InitializeMediaLibraryForTesting(); | |
|
Ami GONE FROM CHROMIUM
2012/07/25 23:06:01
It's strange-looking that this will be called mult
nilesh
2012/07/26 00:54:02
Maybe I am missing something, but Initialize is ca
Ami GONE FROM CHROMIUM
2012/07/26 04:01:11
I was thinking of gtest's SetUp method, which is c
| |
| 23 } | |
| 24 | |
| 17 int main(int argc, char** argv) { | 25 int main(int argc, char** argv) { |
| 18 // By default command-line parsing happens only in TestSuite::Run(), but | |
|
nilesh
2012/07/25 21:56:32
I think this can be removed now.
TestSuite ctor ca
| |
| 19 // that's too late to get VLOGs and so on from | |
| 20 // InitializeMediaLibraryForTesting() below. Instead initialize logging | |
| 21 // explicitly here (and have it get re-initialized by TestSuite::Run()). | |
| 22 CommandLine::Init(argc, argv); | |
| 23 CHECK(logging::InitLogging( | |
| 24 NULL, | |
| 25 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | |
| 26 logging::DONT_LOCK_LOG_FILE, | |
| 27 logging::APPEND_TO_OLD_LOG_FILE, | |
| 28 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS)); | |
| 29 base::AtExitManager exit_manager; | |
| 30 | |
| 31 media::InitializeMediaLibraryForTesting(); | |
| 32 | |
| 33 return TestSuiteNoAtExit(argc, argv).Run(); | 26 return TestSuiteNoAtExit(argc, argv).Run(); |
| 34 } | 27 } |
| OLD | NEW |