OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/test/launcher/unit_test_launcher.h" | 6 #include "base/test/launcher/unit_test_launcher.h" |
7 #include "base/test/test_suite.h" | 7 #include "base/test/test_suite.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "media/base/media.h" | 9 #include "media/base/media.h" |
10 | 10 |
11 #if defined(OS_ANDROID) | 11 #if defined(OS_ANDROID) |
12 #error "CMA not supported on Android" | 12 #error "CMA not supported on Android" |
13 #endif | 13 #endif |
14 | 14 |
15 class CmaTestSuite : public base::TestSuite { | 15 class CmaTestSuite : public base::TestSuite { |
16 public: | 16 public: |
17 // Note: the base class constructor creates an AtExitManager. | 17 // Note: the base class constructor creates an AtExitManager. |
18 CmaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} | 18 CmaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} |
19 virtual ~CmaTestSuite() {} | 19 virtual ~CmaTestSuite() {} |
20 | 20 |
21 protected: | 21 protected: |
22 virtual void Initialize() OVERRIDE; | 22 virtual void Initialize() override; |
23 }; | 23 }; |
24 | 24 |
25 void CmaTestSuite::Initialize() { | 25 void CmaTestSuite::Initialize() { |
26 // Run TestSuite::Initialize first so that logging is initialized. | 26 // Run TestSuite::Initialize first so that logging is initialized. |
27 base::TestSuite::Initialize(); | 27 base::TestSuite::Initialize(); |
28 | 28 |
29 // Initialize the FFMpeg library. | 29 // Initialize the FFMpeg library. |
30 // Note: at this time, AtExitManager is already present. | 30 // Note: at this time, AtExitManager is already present. |
31 media::InitializeMediaLibraryForTesting(); | 31 media::InitializeMediaLibraryForTesting(); |
32 } | 32 } |
33 | 33 |
34 int main(int argc, char** argv) { | 34 int main(int argc, char** argv) { |
35 CmaTestSuite test_suite(argc, argv); | 35 CmaTestSuite test_suite(argc, argv); |
36 | 36 |
37 return base::LaunchUnitTests( | 37 return base::LaunchUnitTests( |
38 argc, argv, base::Bind(&CmaTestSuite::Run, | 38 argc, argv, base::Bind(&CmaTestSuite::Run, |
39 base::Unretained(&test_suite))); | 39 base::Unretained(&test_suite))); |
40 } | 40 } |
OLD | NEW |