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/test/main_hook.h" | |
6 #include "base/test/test_suite.h" | 5 #include "base/test/test_suite.h" |
7 #include "media/base/media.h" | 6 #include "media/base/media.h" |
8 | 7 |
9 class TestSuiteNoAtExit : public base::TestSuite { | 8 class TestSuiteNoAtExit : public base::TestSuite { |
10 public: | 9 public: |
11 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} | 10 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} |
12 virtual ~TestSuiteNoAtExit() {} | 11 virtual ~TestSuiteNoAtExit() {} |
13 protected: | 12 protected: |
14 virtual void Initialize() OVERRIDE; | 13 virtual void Initialize() OVERRIDE; |
15 }; | 14 }; |
16 | 15 |
17 void TestSuiteNoAtExit::Initialize() { | 16 void TestSuiteNoAtExit::Initialize() { |
18 // Run TestSuite::Initialize first so that logging is initialized. | 17 // Run TestSuite::Initialize first so that logging is initialized. |
19 base::TestSuite::Initialize(); | 18 base::TestSuite::Initialize(); |
20 // Run this here instead of main() to ensure an AtExitManager is already | 19 // Run this here instead of main() to ensure an AtExitManager is already |
21 // present. | 20 // present. |
22 media::InitializeMediaLibraryForTesting(); | 21 media::InitializeMediaLibraryForTesting(); |
23 } | 22 } |
24 | 23 |
25 int main(int argc, char** argv) { | 24 int main(int argc, char** argv) { |
26 MainHook hook(main, argc, argv); | |
27 return TestSuiteNoAtExit(argc, argv).Run(); | 25 return TestSuiteNoAtExit(argc, argv).Run(); |
28 } | 26 } |
OLD | NEW |