| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/public/common/content_client.h" | 8 #include "content/public/common/content_client.h" |
| 9 #include "content/public/common/eme_constants.h" | 9 #include "content/public/common/eme_constants.h" |
| 10 #include "content/public/renderer/content_renderer_client.h" | 10 #include "content/public/renderer/content_renderer_client.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 AddContainerMask("audio/foo", TEST_CODEC_FOO_AUDIO_ALL); | 86 AddContainerMask("audio/foo", TEST_CODEC_FOO_AUDIO_ALL); |
| 87 AddContainerMask("video/foo", TEST_CODEC_FOO_ALL); | 87 AddContainerMask("video/foo", TEST_CODEC_FOO_ALL); |
| 88 AddCodecMask("fooaudio", TEST_CODEC_FOO_AUDIO); | 88 AddCodecMask("fooaudio", TEST_CODEC_FOO_AUDIO); |
| 89 AddCodecMask("foovideo", TEST_CODEC_FOO_VIDEO); | 89 AddCodecMask("foovideo", TEST_CODEC_FOO_VIDEO); |
| 90 | 90 |
| 91 is_test_masks_added = true; | 91 is_test_masks_added = true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 class TestContentRendererClient : public ContentRendererClient { | 94 class TestContentRendererClient : public ContentRendererClient { |
| 95 virtual void AddKeySystems( | 95 virtual void AddKeySystems( |
| 96 std::vector<content::KeySystemInfo>* key_systems) OVERRIDE; | 96 std::vector<content::KeySystemInfo>* key_systems) override; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 void TestContentRendererClient::AddKeySystems( | 99 void TestContentRendererClient::AddKeySystems( |
| 100 std::vector<content::KeySystemInfo>* key_systems) { | 100 std::vector<content::KeySystemInfo>* key_systems) { |
| 101 KeySystemInfo aes(kUsesAes); | 101 KeySystemInfo aes(kUsesAes); |
| 102 aes.supported_codecs = EME_CODEC_WEBM_ALL; | 102 aes.supported_codecs = EME_CODEC_WEBM_ALL; |
| 103 aes.supported_codecs |= TEST_CODEC_FOO_ALL; | 103 aes.supported_codecs |= TEST_CODEC_FOO_ALL; |
| 104 aes.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; | 104 aes.supported_init_data_types = EME_INIT_DATA_TYPE_WEBM; |
| 105 aes.use_aes_decryptor = true; | 105 aes.use_aes_decryptor = true; |
| 106 key_systems->push_back(aes); | 106 key_systems->push_back(aes); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // The TestContentClient is not available inside Death Tests on some | 156 // The TestContentClient is not available inside Death Tests on some |
| 157 // platforms (see below). Therefore, always provide a TestContentClient. | 157 // platforms (see below). Therefore, always provide a TestContentClient. |
| 158 // Explanation: When Death Tests fork, there is a valid ContentClient. | 158 // Explanation: When Death Tests fork, there is a valid ContentClient. |
| 159 // However, when they launch a new process instead of forking, the global | 159 // However, when they launch a new process instead of forking, the global |
| 160 // variable is not copied and for some reason TestContentClientInitializer | 160 // variable is not copied and for some reason TestContentClientInitializer |
| 161 // does not get created to set the global variable in the new process. | 161 // does not get created to set the global variable in the new process. |
| 162 SetContentClient(&test_content_client_); | 162 SetContentClient(&test_content_client_); |
| 163 SetRendererClientForTesting(&content_renderer_client_); | 163 SetRendererClientForTesting(&content_renderer_client_); |
| 164 } | 164 } |
| 165 | 165 |
| 166 virtual void SetUp() OVERRIDE { | 166 virtual void SetUp() override { |
| 167 AddContainerAndCodecMasksForTest(); | 167 AddContainerAndCodecMasksForTest(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 virtual ~KeySystemsTest() { | 170 virtual ~KeySystemsTest() { |
| 171 // Clear the use of content_client_, which was set in SetUp(). | 171 // Clear the use of content_client_, which was set in SetUp(). |
| 172 SetContentClient(NULL); | 172 SetContentClient(NULL); |
| 173 } | 173 } |
| 174 | 174 |
| 175 typedef std::vector<std::string> CodecVector; | 175 typedef std::vector<std::string> CodecVector; |
| 176 | 176 |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 | 641 |
| 642 #if defined(WIDEVINE_CDM_AVAILABLE) | 642 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 643 const char* const kTestWidevineUmaName = "Widevine"; | 643 const char* const kTestWidevineUmaName = "Widevine"; |
| 644 #else | 644 #else |
| 645 const char* const kTestWidevineUmaName = "Unknown"; | 645 const char* const kTestWidevineUmaName = "Unknown"; |
| 646 #endif | 646 #endif |
| 647 EXPECT_EQ(kTestWidevineUmaName, KeySystemNameForUMA("com.widevine.alpha")); | 647 EXPECT_EQ(kTestWidevineUmaName, KeySystemNameForUMA("com.widevine.alpha")); |
| 648 } | 648 } |
| 649 | 649 |
| 650 } // namespace content | 650 } // namespace content |
| OLD | NEW |