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
3 // found in the LICENSE file.
5 #include "base/command_line.h"
6 #include "base/test/test_suite.h"
7 #include "build/build_config.h"
8 #include "media/base/media.h"
9 #include "media/base/media_switches.h"
11 #if defined(OS_ANDROID)
12 #include "base/android/jni_android.h"
13 #include "media/base/android/media_jni_registrar.h"
14 #include "ui/gl/android/gl_jni_registrar.h"
17 class TestSuiteNoAtExit
: public base::TestSuite
{
19 TestSuiteNoAtExit(int argc
, char** argv
) : TestSuite(argc
, argv
) {}
20 virtual ~TestSuiteNoAtExit() {}
22 virtual void Initialize() OVERRIDE
;
25 void TestSuiteNoAtExit::Initialize() {
26 // Run TestSuite::Initialize first so that logging is initialized.
27 base::TestSuite::Initialize();
29 #if defined(OS_ANDROID)
30 // Register JNI bindings for android.
31 JNIEnv
* env
= base::android::AttachCurrentThread();
32 // Needed for surface texture support.
33 ui::gl::android::RegisterJni(env
);
34 media::RegisterJni(env
);
37 // Run this here instead of main() to ensure an AtExitManager is already
39 media::InitializeMediaLibraryForTesting();
40 // Enable VP8 alpha support for all media tests.
41 // TODO(tomfinegan): Remove this once the VP8 alpha flag is removed or
43 CommandLine
* cmd_line
= CommandLine::ForCurrentProcess();
44 cmd_line
->AppendSwitch(switches::kEnableVp8AlphaPlayback
);
47 int main(int argc
, char** argv
) {
48 return TestSuiteNoAtExit(argc
, argv
).Run();