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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
9 #include "content/public/renderer/content_renderer_client.h" | 9 #include "content/public/renderer/content_renderer_client.h" |
10 #include "content/renderer/media/render_media_client.h" | 10 #include "content/renderer/media/render_media_client.h" |
11 #include "content/test/test_content_client.h" | 11 #include "content/test/test_content_client.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 14 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class TestContentRendererClient : public ContentRendererClient { | 20 class TestContentRendererClient : public ContentRendererClient { |
21 public: | 21 public: |
22 TestContentRendererClient() : is_extra_key_system_enabled_(false) {} | 22 TestContentRendererClient() : is_extra_key_system_enabled_(false) {} |
23 | 23 |
24 // ContentRendererClient implementation. | 24 // ContentRendererClient implementation. |
25 void AddKeySystems( | 25 void AddKeySystems( |
26 std::vector<media::KeySystemInfo>* key_systems_info) override { | 26 std::vector<media::KeySystemInfo>* key_systems_info) override { |
27 media::KeySystemInfo key_system_info("test.keysystem"); | 27 // TODO(sandersd): Was this supposed to be added to the list? |
| 28 media::KeySystemInfo key_system_info; |
| 29 key_system_info.key_system = "test.keysystem"; |
| 30 key_system_info.persistent_license_support = |
| 31 media::EME_SESSION_TYPE_NOT_SUPPORTED; |
| 32 key_system_info.persistent_release_message_support = |
| 33 media::EME_SESSION_TYPE_NOT_SUPPORTED; |
| 34 key_system_info.persistent_state_support = |
| 35 media::EME_FEATURE_NOT_SUPPORTED; |
| 36 key_system_info.distinctive_identifier_support = |
| 37 media::EME_FEATURE_NOT_SUPPORTED; |
| 38 key_systems_info->push_back(key_system_info); |
28 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 39 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
29 if (is_extra_key_system_enabled_) | 40 if (is_extra_key_system_enabled_) { |
30 key_systems_info->push_back(media::KeySystemInfo(kWidevineKeySystem)); | 41 media::KeySystemInfo wv_key_system_info; |
| 42 wv_key_system_info.key_system = kWidevineKeySystem; |
| 43 wv_key_system_info.persistent_license_support = |
| 44 media::EME_SESSION_TYPE_NOT_SUPPORTED; |
| 45 wv_key_system_info.persistent_release_message_support = |
| 46 media::EME_SESSION_TYPE_NOT_SUPPORTED; |
| 47 wv_key_system_info.persistent_state_support = |
| 48 media::EME_FEATURE_NOT_SUPPORTED; |
| 49 wv_key_system_info.distinctive_identifier_support = |
| 50 media::EME_FEATURE_NOT_SUPPORTED; |
| 51 key_systems_info->push_back(wv_key_system_info); |
| 52 } |
31 #endif | 53 #endif |
32 } | 54 } |
33 | 55 |
34 void EnableExtraKeySystem() { is_extra_key_system_enabled_ = true; } | 56 void EnableExtraKeySystem() { is_extra_key_system_enabled_ = true; } |
35 | 57 |
36 private: | 58 private: |
37 // Whether a platform-specific extra key system is "supported" by |this|. | 59 // Whether a platform-specific extra key system is "supported" by |this|. |
38 bool is_extra_key_system_enabled_; | 60 bool is_extra_key_system_enabled_; |
39 }; | 61 }; |
40 | 62 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 153 |
132 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); | 154 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); |
133 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); | 155 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); |
134 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); | 156 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); |
135 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); | 157 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); |
136 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); | 158 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); |
137 #endif | 159 #endif |
138 } | 160 } |
139 | 161 |
140 } // namespace content | 162 } // namespace content |
OLD | NEW |