Chromium Code Reviews| 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_systems_info->push_back(key_system_info); | |
| 28 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 31 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
| 29 if (is_extra_key_system_enabled_) | 32 if (is_extra_key_system_enabled_) { |
| 30 key_systems_info->push_back(media::KeySystemInfo(kWidevineKeySystem)); | 33 media::KeySystemInfo wv_key_system_info; |
| 34 wv_key_system_info.key_system = kWidevineKeySystem; | |
| 35 key_systems_info->push_back(wv_key_system_info); | |
|
ddorwin
2015/02/19 01:41:33
The lack of valid enum values doesn't cause DCHECK
sandersd (OOO until July 31)
2015/02/19 21:08:34
Done.
| |
| 36 } | |
| 31 #endif | 37 #endif |
| 32 } | 38 } |
| 33 | 39 |
| 34 void EnableExtraKeySystem() { is_extra_key_system_enabled_ = true; } | 40 void EnableExtraKeySystem() { is_extra_key_system_enabled_ = true; } |
| 35 | 41 |
| 36 private: | 42 private: |
| 37 // Whether a platform-specific extra key system is "supported" by |this|. | 43 // Whether a platform-specific extra key system is "supported" by |this|. |
| 38 bool is_extra_key_system_enabled_; | 44 bool is_extra_key_system_enabled_; |
| 39 }; | 45 }; |
| 40 | 46 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 | 137 |
| 132 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); | 138 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); |
| 133 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); | 139 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); |
| 134 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); | 140 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); |
| 135 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); | 141 tick_clock->Advance(base::TimeDelta::FromMilliseconds(1000)); |
| 136 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); | 142 EXPECT_FALSE(render_media_client_->IsKeySystemsUpdateNeeded()); |
| 137 #endif | 143 #endif |
| 138 } | 144 } |
| 139 | 145 |
| 140 } // namespace content | 146 } // namespace content |
| OLD | NEW |