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