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 #include "third_party/WebKit/public/web/WebKit.h" | 10 #include "third_party/WebKit/public/web/WebKit.h" |
11 | 11 |
12 #if defined(OS_ANDROID) | 12 #if defined(OS_ANDROID) |
13 #include "base/android/jni_android.h" | 13 #include "base/android/jni_android.h" |
14 #include "media/base/android/media_jni_registrar.h" | 14 #include "media/base/android/media_jni_registrar.h" |
15 #include "ui/gl/android/gl_jni_registrar.h" | 15 #include "ui/gl/android/gl_jni_registrar.h" |
16 #endif | 16 #endif |
17 | 17 |
| 18 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 19 #include "gin/public/isolate_holder.h" |
| 20 #endif |
| 21 |
18 class TestBlinkPlatformSupport : NON_EXPORTED_BASE(public blink::Platform) { | 22 class TestBlinkPlatformSupport : NON_EXPORTED_BASE(public blink::Platform) { |
19 public: | 23 public: |
20 virtual ~TestBlinkPlatformSupport(); | 24 virtual ~TestBlinkPlatformSupport(); |
21 | 25 |
22 virtual void cryptographicallyRandomValues(unsigned char* buffer, | 26 virtual void cryptographicallyRandomValues(unsigned char* buffer, |
23 size_t length) override; | 27 size_t length) override; |
24 virtual const unsigned char* getTraceCategoryEnabledFlag( | 28 virtual const unsigned char* getTraceCategoryEnabledFlag( |
25 const char* categoryName) override; | 29 const char* categoryName) override; |
26 }; | 30 }; |
27 | 31 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 JNIEnv* env = base::android::AttachCurrentThread(); | 70 JNIEnv* env = base::android::AttachCurrentThread(); |
67 // Needed for surface texture support. | 71 // Needed for surface texture support. |
68 ui::gl::android::RegisterJni(env); | 72 ui::gl::android::RegisterJni(env); |
69 media::RegisterJni(env); | 73 media::RegisterJni(env); |
70 #endif | 74 #endif |
71 | 75 |
72 // Run this here instead of main() to ensure an AtExitManager is already | 76 // Run this here instead of main() to ensure an AtExitManager is already |
73 // present. | 77 // present. |
74 media::InitializeMediaLibraryForTesting(); | 78 media::InitializeMediaLibraryForTesting(); |
75 | 79 |
| 80 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 81 gin::IsolateHolder::LoadV8Snapshot(); |
| 82 #endif |
| 83 |
76 blink::initialize(blink_platform_support_.get()); | 84 blink::initialize(blink_platform_support_.get()); |
77 } | 85 } |
78 | 86 |
79 int main(int argc, char** argv) { | 87 int main(int argc, char** argv) { |
80 BlinkMediaTestSuite test_suite(argc, argv); | 88 BlinkMediaTestSuite test_suite(argc, argv); |
81 | 89 |
82 return base::LaunchUnitTests( | 90 return base::LaunchUnitTests( |
83 argc, argv, base::Bind(&BlinkMediaTestSuite::Run, | 91 argc, argv, base::Bind(&BlinkMediaTestSuite::Run, |
84 base::Unretained(&test_suite))); | 92 base::Unretained(&test_suite))); |
85 } | 93 } |
OLD | NEW |