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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" |
6 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
7 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
8 #include "build/build_config.h" | 9 #include "build/build_config.h" |
9 #include "media/base/media.h" | 10 #include "media/base/media.h" |
| 11 #include "media/base/media_switches.h" |
10 | 12 |
11 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
12 #include "base/android/jni_android.h" | 14 #include "base/android/jni_android.h" |
13 #include "media/base/android/media_jni_registrar.h" | 15 #include "media/base/android/media_jni_registrar.h" |
14 #include "ui/gl/android/gl_jni_registrar.h" | 16 #include "ui/gl/android/gl_jni_registrar.h" |
15 #endif | 17 #endif |
16 | 18 |
17 class TestSuiteNoAtExit : public base::TestSuite { | 19 class TestSuiteNoAtExit : public base::TestSuite { |
18 public: | 20 public: |
19 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} | 21 TestSuiteNoAtExit(int argc, char** argv) : TestSuite(argc, argv) {} |
20 virtual ~TestSuiteNoAtExit() {} | 22 virtual ~TestSuiteNoAtExit() {} |
21 protected: | 23 protected: |
22 virtual void Initialize() OVERRIDE; | 24 virtual void Initialize() OVERRIDE; |
23 }; | 25 }; |
24 | 26 |
25 void TestSuiteNoAtExit::Initialize() { | 27 void TestSuiteNoAtExit::Initialize() { |
26 // Run TestSuite::Initialize first so that logging is initialized. | 28 // Run TestSuite::Initialize first so that logging is initialized. |
27 base::TestSuite::Initialize(); | 29 base::TestSuite::Initialize(); |
28 | 30 |
| 31 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 32 command_line->AppendSwitch(switches::kEnableInbandTextTracks); |
| 33 |
29 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
30 // Register JNI bindings for android. | 35 // Register JNI bindings for android. |
31 JNIEnv* env = base::android::AttachCurrentThread(); | 36 JNIEnv* env = base::android::AttachCurrentThread(); |
32 // Needed for surface texture support. | 37 // Needed for surface texture support. |
33 ui::gl::android::RegisterJni(env); | 38 ui::gl::android::RegisterJni(env); |
34 media::RegisterJni(env); | 39 media::RegisterJni(env); |
35 #endif | 40 #endif |
36 | 41 |
37 // Run this here instead of main() to ensure an AtExitManager is already | 42 // Run this here instead of main() to ensure an AtExitManager is already |
38 // present. | 43 // present. |
39 media::InitializeMediaLibraryForTesting(); | 44 media::InitializeMediaLibraryForTesting(); |
40 } | 45 } |
41 | 46 |
42 int main(int argc, char** argv) { | 47 int main(int argc, char** argv) { |
43 TestSuiteNoAtExit test_suite(argc, argv); | 48 TestSuiteNoAtExit test_suite(argc, argv); |
44 | 49 |
45 return base::LaunchUnitTests( | 50 return base::LaunchUnitTests( |
46 argc, argv, base::Bind(&TestSuiteNoAtExit::Run, | 51 argc, argv, base::Bind(&TestSuiteNoAtExit::Run, |
47 base::Unretained(&test_suite))); | 52 base::Unretained(&test_suite))); |
48 } | 53 } |
OLD | NEW |