| 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/android/build_info.h" | 5 #include "base/android/build_info.h" |
| 6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "media/base/android/media_drm_bridge.h" | 9 #include "media/base/android/media_drm_bridge.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Invalid key system is NOT supported regardless whether MediaDrm is available. | 85 // Invalid key system is NOT supported regardless whether MediaDrm is available. |
| 86 TEST(MediaDrmBridgeTest, CreateWithoutSessionSupport_InvalidKeySystem) { | 86 TEST(MediaDrmBridgeTest, CreateWithoutSessionSupport_InvalidKeySystem) { |
| 87 base::MessageLoop message_loop_; | 87 base::MessageLoop message_loop_; |
| 88 EXPECT_FALSE(MediaDrmBridge::CreateWithoutSessionSupport(kInvalidKeySystem)); | 88 EXPECT_FALSE(MediaDrmBridge::CreateWithoutSessionSupport(kInvalidKeySystem)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 TEST(MediaDrmBridgeTest, SetSecurityLevel_Widevine) { | 91 TEST(MediaDrmBridgeTest, SetSecurityLevel_Widevine) { |
| 92 base::MessageLoop message_loop_; | 92 base::MessageLoop message_loop_; |
| 93 scoped_ptr<MediaDrmBridge, BrowserCdmDeleter> media_drm_bridge = | 93 scoped_refptr<MediaDrmBridge> media_drm_bridge = |
| 94 MediaDrmBridge::CreateWithoutSessionSupport(kWidevineKeySystem); | 94 MediaDrmBridge::CreateWithoutSessionSupport(kWidevineKeySystem); |
| 95 EXPECT_TRUE_IF_WIDEVINE_AVAILABLE(media_drm_bridge); | 95 EXPECT_TRUE_IF_WIDEVINE_AVAILABLE(media_drm_bridge); |
| 96 if (!media_drm_bridge) | 96 if (!media_drm_bridge) |
| 97 return; | 97 return; |
| 98 | 98 |
| 99 EXPECT_FALSE(media_drm_bridge->SetSecurityLevel(kLNone)); | 99 EXPECT_FALSE(media_drm_bridge->SetSecurityLevel(kLNone)); |
| 100 // We test "L3" fully. But for "L1" we don't check the result as it depends on | 100 // We test "L3" fully. But for "L1" we don't check the result as it depends on |
| 101 // whether the test device supports "L1". | 101 // whether the test device supports "L1". |
| 102 EXPECT_TRUE(media_drm_bridge->SetSecurityLevel(kL3)); | 102 EXPECT_TRUE(media_drm_bridge->SetSecurityLevel(kL3)); |
| 103 media_drm_bridge->SetSecurityLevel(kL1); | 103 media_drm_bridge->SetSecurityLevel(kL1); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace media | 106 } // namespace media |
| OLD | NEW |