| 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/command_line.h" |
| 7 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
| 8 #include "base/test/test_discardable_memory_allocator.h" | 8 #include "base/test/test_discardable_memory_allocator.h" |
| 9 #include "base/test/test_suite.h" | 9 #include "base/test/test_suite.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 base::TestSuite::Initialize(); | 36 base::TestSuite::Initialize(); |
| 37 | 37 |
| 38 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 38 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 39 command_line->AppendSwitch(switches::kEnableInbandTextTracks); | 39 command_line->AppendSwitch(switches::kEnableInbandTextTracks); |
| 40 | 40 |
| 41 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
| 42 // Register JNI bindings for android. | 42 // Register JNI bindings for android. |
| 43 JNIEnv* env = base::android::AttachCurrentThread(); | 43 JNIEnv* env = base::android::AttachCurrentThread(); |
| 44 // Needed for surface texture support. | 44 // Needed for surface texture support. |
| 45 ui::gl::android::RegisterJni(env); | 45 ui::gl::android::RegisterJni(env); |
| 46 |
| 46 media::RegisterJni(env); | 47 media::RegisterJni(env); |
| 47 | 48 |
| 48 if (media::MediaCodecUtil::IsMediaCodecAvailable()) | 49 if (media::MediaCodecUtil::IsMediaCodecAvailable()) |
| 49 media::EnablePlatformDecoderSupport(); | 50 media::EnablePlatformDecoderSupport(); |
| 50 #endif | 51 #endif |
| 51 | 52 |
| 52 // Run this here instead of main() to ensure an AtExitManager is already | 53 // Run this here instead of main() to ensure an AtExitManager is already |
| 53 // present. | 54 // present. |
| 54 media::InitializeMediaLibrary(); | 55 media::InitializeMediaLibrary(); |
| 55 media::SetUpFakeMediaResources(); | 56 media::SetUpFakeMediaResources(); |
| 56 | 57 |
| 57 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); | 58 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); |
| 58 } | 59 } |
| 59 | 60 |
| 60 int main(int argc, char** argv) { | 61 int main(int argc, char** argv) { |
| 61 TestSuiteNoAtExit test_suite(argc, argv); | 62 TestSuiteNoAtExit test_suite(argc, argv); |
| 62 | 63 |
| 63 return base::LaunchUnitTests( | 64 return base::LaunchUnitTests( |
| 64 argc, argv, base::Bind(&TestSuiteNoAtExit::Run, | 65 argc, argv, |
| 65 base::Unretained(&test_suite))); | 66 base::Bind(&TestSuiteNoAtExit::Run, base::Unretained(&test_suite))); |
| 66 } | 67 } |
| OLD | NEW |