| 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 class TestBlinkPlatformSupport : NON_EXPORTED_BASE(public blink::Platform) { | 18 class TestBlinkPlatformSupport : NON_EXPORTED_BASE(public blink::Platform) { |
| 19 public: | 19 public: |
| 20 virtual ~TestBlinkPlatformSupport(); | 20 virtual ~TestBlinkPlatformSupport(); |
| 21 | 21 |
| 22 virtual void cryptographicallyRandomValues(unsigned char* buffer, | 22 virtual void cryptographicallyRandomValues(unsigned char* buffer, |
| 23 size_t length) OVERRIDE; | 23 size_t length) override; |
| 24 virtual const unsigned char* getTraceCategoryEnabledFlag( | 24 virtual const unsigned char* getTraceCategoryEnabledFlag( |
| 25 const char* categoryName) OVERRIDE; | 25 const char* categoryName) override; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 TestBlinkPlatformSupport::~TestBlinkPlatformSupport() {} | 28 TestBlinkPlatformSupport::~TestBlinkPlatformSupport() {} |
| 29 | 29 |
| 30 void TestBlinkPlatformSupport::cryptographicallyRandomValues( | 30 void TestBlinkPlatformSupport::cryptographicallyRandomValues( |
| 31 unsigned char* buffer, | 31 unsigned char* buffer, |
| 32 size_t length) { | 32 size_t length) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 const unsigned char* TestBlinkPlatformSupport::getTraceCategoryEnabledFlag( | 35 const unsigned char* TestBlinkPlatformSupport::getTraceCategoryEnabledFlag( |
| 36 const char* categoryName) { | 36 const char* categoryName) { |
| 37 static const unsigned char tracingIsDisabled = 0; | 37 static const unsigned char tracingIsDisabled = 0; |
| 38 return &tracingIsDisabled; | 38 return &tracingIsDisabled; |
| 39 } | 39 } |
| 40 | 40 |
| 41 class BlinkMediaTestSuite : public base::TestSuite { | 41 class BlinkMediaTestSuite : public base::TestSuite { |
| 42 public: | 42 public: |
| 43 BlinkMediaTestSuite(int argc, char** argv); | 43 BlinkMediaTestSuite(int argc, char** argv); |
| 44 virtual ~BlinkMediaTestSuite(); | 44 virtual ~BlinkMediaTestSuite(); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 virtual void Initialize() OVERRIDE; | 47 virtual void Initialize() override; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 scoped_ptr<TestBlinkPlatformSupport> blink_platform_support_; | 50 scoped_ptr<TestBlinkPlatformSupport> blink_platform_support_; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 BlinkMediaTestSuite::BlinkMediaTestSuite(int argc, char** argv) | 53 BlinkMediaTestSuite::BlinkMediaTestSuite(int argc, char** argv) |
| 54 : TestSuite(argc, argv), | 54 : TestSuite(argc, argv), |
| 55 blink_platform_support_(new TestBlinkPlatformSupport()) { | 55 blink_platform_support_(new TestBlinkPlatformSupport()) { |
| 56 } | 56 } |
| 57 | 57 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 76 blink::initialize(blink_platform_support_.get()); | 76 blink::initialize(blink_platform_support_.get()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 int main(int argc, char** argv) { | 79 int main(int argc, char** argv) { |
| 80 BlinkMediaTestSuite test_suite(argc, argv); | 80 BlinkMediaTestSuite test_suite(argc, argv); |
| 81 | 81 |
| 82 return base::LaunchUnitTests( | 82 return base::LaunchUnitTests( |
| 83 argc, argv, base::Bind(&BlinkMediaTestSuite::Run, | 83 argc, argv, base::Bind(&BlinkMediaTestSuite::Run, |
| 84 base::Unretained(&test_suite))); | 84 base::Unretained(&test_suite))); |
| 85 } | 85 } |
| OLD | NEW |