Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: chrome/browser/media/encrypted_media_browsertest.cc

Issue 2341883002: media: Add Feature to control External Clear Key key system support (Closed)
Patch Set: comments addressed Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/media/encrypted_media_supported_types_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "base/win/windows_version.h" 11 #include "base/win/windows_version.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "chrome/browser/media/media_browsertest.h" 13 #include "chrome/browser/media/media_browsertest.h"
14 #include "chrome/browser/media/test_license_server.h" 14 #include "chrome/browser/media/test_license_server.h"
15 #include "chrome/browser/media/wv_test_license_server_config.h" 15 #include "chrome/browser/media/wv_test_license_server_config.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
18 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
19 #include "chrome/test/base/test_launcher_utils.h" 19 #include "chrome/test/base/test_launcher_utils.h"
20 #include "content/public/common/content_switches.h" 20 #include "content/public/common/content_switches.h"
21 #include "content/public/test/browser_test_utils.h" 21 #include "content/public/test/browser_test_utils.h"
22 #include "testing/gtest/include/gtest/gtest-spi.h" 22 #include "testing/gtest/include/gtest/gtest-spi.h"
23 #if defined(OS_ANDROID) 23 #if defined(OS_ANDROID)
24 #include "base/android/build_info.h" 24 #include "base/android/build_info.h"
25 #endif 25 #endif
26 26
27 #if defined(ENABLE_PEPPER_CDMS) 27 #if defined(ENABLE_PEPPER_CDMS)
28 #include "chrome/browser/media/pepper_cdm_test_constants.h" 28 #include "chrome/browser/media/pepper_cdm_test_constants.h"
29 #include "chrome/browser/media/pepper_cdm_test_helper.h" 29 #include "chrome/browser/media/pepper_cdm_test_helper.h"
30 #include "media/base/media_switches.h"
30 #endif 31 #endif
31 32
32 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 33 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
33 34
34 // Available key systems. 35 // Available key systems.
35 const char kClearKeyKeySystem[] = "org.w3.clearkey"; 36 const char kClearKeyKeySystem[] = "org.w3.clearkey";
36 const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"; 37 const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey";
37 38
38 // Variants of External Clear Key key system to test different scenarios. 39 // Variants of External Clear Key key system to test different scenarios.
39 // To add a new variant, make sure you also update: 40 // To add a new variant, make sure you also update:
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Since the web and license servers listen on different ports, we need to 265 // Since the web and license servers listen on different ports, we need to
265 // disable web-security to send license requests to the license server. 266 // disable web-security to send license requests to the license server.
266 // TODO(shadi): Add port forwarding to the test web server configuration. 267 // TODO(shadi): Add port forwarding to the test web server configuration.
267 command_line->AppendSwitch(switches::kDisableWebSecurity); 268 command_line->AppendSwitch(switches::kDisableWebSecurity);
268 269
269 #if defined(ENABLE_PEPPER_CDMS) 270 #if defined(ENABLE_PEPPER_CDMS)
270 if (IsExternalClearKey(key_system)) { 271 if (IsExternalClearKey(key_system)) {
271 RegisterPepperCdm(command_line, kClearKeyCdmBaseDirectory, 272 RegisterPepperCdm(command_line, kClearKeyCdmBaseDirectory,
272 kClearKeyCdmAdapterFileName, kClearKeyCdmDisplayName, 273 kClearKeyCdmAdapterFileName, kClearKeyCdmDisplayName,
273 kClearKeyCdmPepperMimeType); 274 kClearKeyCdmPepperMimeType);
275 command_line->AppendSwitchASCII(switches::kEnableFeatures,
276 media::kExternalClearKeyForTesting.name);
274 } 277 }
275 #endif // defined(ENABLE_PEPPER_CDMS) 278 #endif // defined(ENABLE_PEPPER_CDMS)
276 } 279 }
277 }; 280 };
278 281
279 #if defined(ENABLE_PEPPER_CDMS) 282 #if defined(ENABLE_PEPPER_CDMS)
280 // Tests encrypted media playback using ExternalClearKey key system in 283 // Tests encrypted media playback using ExternalClearKey key system in
281 // decrypt-and-decode mode. 284 // decrypt-and-decode mode.
282 class ECKEncryptedMediaTest : public EncryptedMediaTestBase { 285 class ECKEncryptedMediaTest : public EncryptedMediaTestBase {
283 public: 286 public:
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 648
646 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { 649 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) {
647 TestPlaybackCase(kLoadableSession, kEnded); 650 TestPlaybackCase(kLoadableSession, kEnded);
648 } 651 }
649 652
650 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { 653 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) {
651 TestPlaybackCase(kUnknownSession, kEmeSessionNotFound); 654 TestPlaybackCase(kUnknownSession, kEmeSessionNotFound);
652 } 655 }
653 656
654 #endif // defined(ENABLE_PEPPER_CDMS) 657 #endif // defined(ENABLE_PEPPER_CDMS)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/encrypted_media_supported_types_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698