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 <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/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/test/scoped_feature_list.h" | |
12 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "chrome/browser/media/media_browsertest.h" | 15 #include "chrome/browser/media/media_browsertest.h" |
15 #include "chrome/browser/media/test_license_server.h" | 16 #include "chrome/browser/media/test_license_server.h" |
16 #include "chrome/browser/media/wv_test_license_server_config.h" | 17 #include "chrome/browser/media/wv_test_license_server_config.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
20 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 // disable web-security to send license requests to the license server. | 285 // disable web-security to send license requests to the license server. |
285 // TODO(shadi): Add port forwarding to the test web server configuration. | 286 // TODO(shadi): Add port forwarding to the test web server configuration. |
286 command_line->AppendSwitch(switches::kDisableWebSecurity); | 287 command_line->AppendSwitch(switches::kDisableWebSecurity); |
287 | 288 |
288 #if BUILDFLAG(ENABLE_PEPPER_CDMS) | 289 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
289 if (IsExternalClearKey(key_system)) { | 290 if (IsExternalClearKey(key_system)) { |
290 RegisterPepperCdm(command_line, media::kClearKeyCdmBaseDirectory, | 291 RegisterPepperCdm(command_line, media::kClearKeyCdmBaseDirectory, |
291 media::kClearKeyCdmAdapterFileName, | 292 media::kClearKeyCdmAdapterFileName, |
292 media::kClearKeyCdmDisplayName, | 293 media::kClearKeyCdmDisplayName, |
293 media::kClearKeyCdmPepperMimeType); | 294 media::kClearKeyCdmPepperMimeType); |
294 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 295 scoped_feature_list_.InitAndEnableFeature( |
295 media::kExternalClearKeyForTesting.name); | 296 media::kExternalClearKeyForTesting); |
Ilya Sherman
2017/06/12 21:50:29
As in the other file, could this be done outside o
chaopeng
2017/06/28 19:21:22
Done.
| |
296 } | 297 } |
297 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) | 298 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
298 } | 299 } |
300 #if BUILDFLAG(ENABLE_PEPPER_CDMS) | |
301 private: | |
302 base::test::ScopedFeatureList scoped_feature_list_; | |
303 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) | |
Ilya Sherman
2017/06/12 21:50:29
Does anything go wrong if you omit this #if, and j
chaopeng
2017/06/28 19:21:22
Done.
| |
299 }; | 304 }; |
300 | 305 |
301 #if BUILDFLAG(ENABLE_PEPPER_CDMS) | 306 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
302 // Tests encrypted media playback using ExternalClearKey key system in | 307 // Tests encrypted media playback using ExternalClearKey key system in |
303 // decrypt-and-decode mode. | 308 // decrypt-and-decode mode. |
304 class ECKEncryptedMediaTest : public EncryptedMediaTestBase { | 309 class ECKEncryptedMediaTest : public EncryptedMediaTestBase { |
305 public: | 310 public: |
306 // We use special |key_system| names to do non-playback related tests, e.g. | 311 // We use special |key_system| names to do non-playback related tests, e.g. |
307 // kExternalClearKeyFileIOTestKeySystem is used to test file IO. | 312 // kExternalClearKeyFileIOTestKeySystem is used to test file IO. |
308 void TestNonPlaybackCases(const std::string& key_system, | 313 void TestNonPlaybackCases(const std::string& key_system, |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
718 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) | 723 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
719 | 724 |
720 #if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) | 725 #if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) |
721 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, VerifyCdmHostTest) { | 726 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, VerifyCdmHostTest) { |
722 TestNonPlaybackCases(kExternalClearKeyVerifyCdmHostTestKeySystem, | 727 TestNonPlaybackCases(kExternalClearKeyVerifyCdmHostTestKeySystem, |
723 kUnitTestSuccess); | 728 kUnitTestSuccess); |
724 } | 729 } |
725 #endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) | 730 #endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) |
726 | 731 |
727 } // namespace chrome | 732 } // namespace chrome |
OLD | NEW |