| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "chrome/browser/media/media_browsertest.h" | 10 #include "chrome/browser/media/media_browsertest.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 return key_system == kExternalClearKeyKeySystem || | 108 return key_system == kExternalClearKeyKeySystem || |
| 109 IsParentKeySystemOf(kExternalClearKeyKeySystem, key_system); | 109 IsParentKeySystemOf(kExternalClearKeyKeySystem, key_system); |
| 110 } | 110 } |
| 111 | 111 |
| 112 #if defined(WIDEVINE_CDM_AVAILABLE) | 112 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 113 bool IsWidevine(const std::string& key_system) { | 113 bool IsWidevine(const std::string& key_system) { |
| 114 return key_system == kWidevineKeySystem; | 114 return key_system == kWidevineKeySystem; |
| 115 } | 115 } |
| 116 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 116 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 117 | 117 |
| 118 void RunEncryptedMediaTestPage( | 118 void RunEncryptedMediaTestPage(const std::string& html_page, |
| 119 const std::string& html_page, | 119 const std::string& key_system, |
| 120 const std::string& key_system, | 120 std::vector<StringPair>* query_params, |
| 121 const media::QueryParams& query_params, | 121 const std::string& expected_title) { |
| 122 const std::string& expected_title) { | 122 StartLicenseServerIfNeeded(key_system, query_params); |
| 123 media::QueryParams new_query_params = query_params; | 123 RunMediaTestPage(html_page, query_params, expected_title, true); |
| 124 StartLicenseServerIfNeeded(key_system, &new_query_params); | |
| 125 RunMediaTestPage(html_page, new_query_params, expected_title, true); | |
| 126 } | 124 } |
| 127 | 125 |
| 128 // Tests |html_page| using |media_file| (with |media_type|) and |key_system|. | 126 // Tests |html_page| using |media_file| (with |media_type|) and |key_system|. |
| 129 // When |session_to_load| is not empty, the test will try to load | 127 // When |session_to_load| is not empty, the test will try to load |
| 130 // |session_to_load| with stored keys, instead of creating a new session | 128 // |session_to_load| with stored keys, instead of creating a new session |
| 131 // and trying to update it with licenses. | 129 // and trying to update it with licenses. |
| 132 // When |force_invalid_response| is true, the test will provide invalid | 130 // When |force_invalid_response| is true, the test will provide invalid |
| 133 // responses, which should trigger errors. | 131 // responses, which should trigger errors. |
| 134 // TODO(xhwang): Find an easier way to pass multiple configuration test | 132 // TODO(xhwang): Find an easier way to pass multiple configuration test |
| 135 // options. | 133 // options. |
| 136 void RunEncryptedMediaTest(const std::string& html_page, | 134 void RunEncryptedMediaTest(const std::string& html_page, |
| 137 const std::string& media_file, | 135 const std::string& media_file, |
| 138 const std::string& media_type, | 136 const std::string& media_type, |
| 139 const std::string& key_system, | 137 const std::string& key_system, |
| 140 SrcType src_type, | 138 SrcType src_type, |
| 141 EmeVersion eme_version, | 139 EmeVersion eme_version, |
| 142 const std::string& session_to_load, | 140 const std::string& session_to_load, |
| 143 bool force_invalid_response, | 141 bool force_invalid_response, |
| 144 const std::string& expected_title) { | 142 const std::string& expected_title) { |
| 145 if (src_type == MSE && !IsMSESupported()) { | 143 if (src_type == MSE && !IsMSESupported()) { |
| 146 VLOG(0) << "Skipping test - MSE not supported."; | 144 VLOG(0) << "Skipping test - MSE not supported."; |
| 147 return; | 145 return; |
| 148 } | 146 } |
| 149 media::QueryParams query_params; | 147 std::vector<StringPair> query_params; |
| 150 query_params.push_back(std::make_pair("mediaFile", media_file)); | 148 query_params.push_back(std::make_pair("mediaFile", media_file)); |
| 151 query_params.push_back(std::make_pair("mediaType", media_type)); | 149 query_params.push_back(std::make_pair("mediaType", media_type)); |
| 152 query_params.push_back(std::make_pair("keySystem", key_system)); | 150 query_params.push_back(std::make_pair("keySystem", key_system)); |
| 153 if (src_type == MSE) | 151 if (src_type == MSE) |
| 154 query_params.push_back(std::make_pair("useMSE", "1")); | 152 query_params.push_back(std::make_pair("useMSE", "1")); |
| 155 if (eme_version == PREFIXED) | 153 if (eme_version == PREFIXED) |
| 156 query_params.push_back(std::make_pair("usePrefixedEME", "1")); | 154 query_params.push_back(std::make_pair("usePrefixedEME", "1")); |
| 157 if (force_invalid_response) | 155 if (force_invalid_response) |
| 158 query_params.push_back(std::make_pair("forceInvalidResponse", "1")); | 156 query_params.push_back(std::make_pair("forceInvalidResponse", "1")); |
| 159 if (!session_to_load.empty()) | 157 if (!session_to_load.empty()) |
| 160 query_params.push_back(std::make_pair("sessionToLoad", session_to_load)); | 158 query_params.push_back(std::make_pair("sessionToLoad", session_to_load)); |
| 161 RunEncryptedMediaTestPage(html_page, key_system, query_params, | 159 RunEncryptedMediaTestPage(html_page, key_system, &query_params, |
| 162 expected_title); | 160 expected_title); |
| 163 } | 161 } |
| 164 | 162 |
| 165 void RunSimpleEncryptedMediaTest(const std::string& media_file, | 163 void RunSimpleEncryptedMediaTest(const std::string& media_file, |
| 166 const std::string& media_type, | 164 const std::string& media_type, |
| 167 const std::string& key_system, | 165 const std::string& key_system, |
| 168 SrcType src_type, | 166 SrcType src_type, |
| 169 EmeVersion eme_version) { | 167 EmeVersion eme_version) { |
| 170 std::string expected_title = kEnded; | 168 std::string expected_title = kEnded; |
| 171 if (!IsPlayBackPossible(key_system)) | 169 if (!IsPlayBackPossible(key_system)) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 183 // Check KeyMessage received for all key systems. | 181 // Check KeyMessage received for all key systems. |
| 184 bool receivedKeyMessage = false; | 182 bool receivedKeyMessage = false; |
| 185 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 183 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
| 186 browser()->tab_strip_model()->GetActiveWebContents(), | 184 browser()->tab_strip_model()->GetActiveWebContents(), |
| 187 "window.domAutomationController.send(" | 185 "window.domAutomationController.send(" |
| 188 "document.querySelector('video').receivedKeyMessage);", | 186 "document.querySelector('video').receivedKeyMessage);", |
| 189 &receivedKeyMessage)); | 187 &receivedKeyMessage)); |
| 190 EXPECT_TRUE(receivedKeyMessage); | 188 EXPECT_TRUE(receivedKeyMessage); |
| 191 } | 189 } |
| 192 | 190 |
| 193 // Starts a license server if available for the |key_system| and adds a | 191 |
| 194 // 'licenseServerURL' query parameter to |query_params|. | |
| 195 void StartLicenseServerIfNeeded(const std::string& key_system, | 192 void StartLicenseServerIfNeeded(const std::string& key_system, |
| 196 media::QueryParams* query_params) { | 193 std::vector<StringPair>* query_params) { |
| 197 scoped_ptr<TestLicenseServerConfig> config = GetServerConfig(key_system); | 194 scoped_ptr<TestLicenseServerConfig> config = GetServerConfig(key_system); |
| 198 if (!config) | 195 if (!config) |
| 199 return; | 196 return; |
| 200 license_server_.reset(new TestLicenseServer(config.Pass())); | 197 license_server_.reset(new TestLicenseServer(config.Pass())); |
| 201 EXPECT_TRUE(license_server_->Start()); | 198 EXPECT_TRUE(license_server_->Start()); |
| 202 query_params->push_back( | 199 query_params->push_back(std::make_pair("licenseServerURL", |
| 203 std::make_pair("licenseServerURL", license_server_->GetServerURL())); | 200 license_server_->GetServerURL())); |
| 204 } | 201 } |
| 205 | 202 |
| 206 bool IsPlayBackPossible(const std::string& key_system) { | 203 bool IsPlayBackPossible(const std::string& key_system) { |
| 207 #if defined(WIDEVINE_CDM_AVAILABLE) | 204 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 208 if (IsWidevine(key_system) && !GetServerConfig(key_system)) | 205 if (IsWidevine(key_system) && !GetServerConfig(key_system)) |
| 209 return false; | 206 return false; |
| 210 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 207 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 211 return true; | 208 return true; |
| 212 } | 209 } |
| 213 | 210 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // decrypt-and-decode mode. | 305 // decrypt-and-decode mode. |
| 309 class ECKEncryptedMediaTest : public EncryptedMediaTestBase { | 306 class ECKEncryptedMediaTest : public EncryptedMediaTestBase { |
| 310 public: | 307 public: |
| 311 // We use special |key_system| names to do non-playback related tests, e.g. | 308 // We use special |key_system| names to do non-playback related tests, e.g. |
| 312 // kExternalClearKeyFileIOTestKeySystem is used to test file IO. | 309 // kExternalClearKeyFileIOTestKeySystem is used to test file IO. |
| 313 void TestNonPlaybackCases(const std::string& key_system, | 310 void TestNonPlaybackCases(const std::string& key_system, |
| 314 const std::string& expected_title) { | 311 const std::string& expected_title) { |
| 315 // Since we do not test playback, arbitrarily choose a test file and source | 312 // Since we do not test playback, arbitrarily choose a test file and source |
| 316 // type. | 313 // type. |
| 317 RunEncryptedMediaTest(kDefaultEmePlayer, | 314 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 318 "bear-a_enc-a.webm", | 315 "bear-a-enc_a.webm", |
| 319 kWebMAudioOnly, | 316 kWebMAudioOnly, |
| 320 key_system, | 317 key_system, |
| 321 SRC, | 318 SRC, |
| 322 PREFIXED, | 319 PREFIXED, |
| 323 kNoSessionToLoad, | 320 kNoSessionToLoad, |
| 324 false, | 321 false, |
| 325 expected_title); | 322 expected_title); |
| 326 } | 323 } |
| 327 | 324 |
| 328 protected: | 325 protected: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 const std::string& media_type) { | 372 const std::string& media_type) { |
| 376 RunSimpleEncryptedMediaTest(encrypted_media, | 373 RunSimpleEncryptedMediaTest(encrypted_media, |
| 377 media_type, | 374 media_type, |
| 378 CurrentKeySystem(), | 375 CurrentKeySystem(), |
| 379 CurrentSourceType(), | 376 CurrentSourceType(), |
| 380 CurrentEmeVersion()); | 377 CurrentEmeVersion()); |
| 381 } | 378 } |
| 382 | 379 |
| 383 void RunInvalidResponseTest() { | 380 void RunInvalidResponseTest() { |
| 384 RunEncryptedMediaTest(kDefaultEmePlayer, | 381 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 385 "bear-320x240-av_enc-av.webm", | 382 "bear-320x240-av-enc_av.webm", |
| 386 kWebMAudioVideo, | 383 kWebMAudioVideo, |
| 387 CurrentKeySystem(), | 384 CurrentKeySystem(), |
| 388 CurrentSourceType(), | 385 CurrentSourceType(), |
| 389 CurrentEmeVersion(), | 386 CurrentEmeVersion(), |
| 390 kNoSessionToLoad, | 387 kNoSessionToLoad, |
| 391 true, | 388 true, |
| 392 kEmeKeyError); | 389 kEmeKeyError); |
| 393 } | 390 } |
| 394 | 391 |
| 395 void TestFrameSizeChange() { | 392 void TestFrameSizeChange() { |
| 396 RunEncryptedMediaTest("encrypted_frame_size_change.html", | 393 RunEncryptedMediaTest("encrypted_frame_size_change.html", |
| 397 "frame_size_change-av_enc-v.webm", | 394 "frame_size_change-av-enc-v.webm", |
| 398 kWebMAudioVideo, | 395 kWebMAudioVideo, |
| 399 CurrentKeySystem(), | 396 CurrentKeySystem(), |
| 400 CurrentSourceType(), | 397 CurrentSourceType(), |
| 401 CurrentEmeVersion(), | 398 CurrentEmeVersion(), |
| 402 kNoSessionToLoad, | 399 kNoSessionToLoad, |
| 403 false, | 400 false, |
| 404 kEnded); | 401 kEnded); |
| 405 } | 402 } |
| 406 | 403 |
| 407 void TestConfigChange() { | 404 void TestConfigChange() { |
| 408 DCHECK(IsMSESupported()); | 405 DCHECK(IsMSESupported()); |
| 409 media::QueryParams query_params; | 406 std::vector<StringPair> query_params; |
| 410 query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); | 407 query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); |
| 411 query_params.push_back(std::make_pair("runEncrypted", "1")); | 408 query_params.push_back(std::make_pair("runEncrypted", "1")); |
| 412 if (CurrentEmeVersion() == PREFIXED) | 409 if (CurrentEmeVersion() == PREFIXED) |
| 413 query_params.push_back(std::make_pair("usePrefixedEME", "1")); | 410 query_params.push_back(std::make_pair("usePrefixedEME", "1")); |
| 414 RunEncryptedMediaTestPage("mse_config_change.html", | 411 RunEncryptedMediaTestPage("mse_config_change.html", |
| 415 CurrentKeySystem(), | 412 CurrentKeySystem(), |
| 416 query_params, | 413 &query_params, |
| 417 kEnded); | 414 kEnded); |
| 418 } | 415 } |
| 419 | 416 |
| 420 protected: | 417 protected: |
| 421 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 418 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 422 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 419 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
| 423 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); | 420 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); |
| 424 | 421 |
| 425 if (CurrentEmeVersion() == UNPREFIXED) | 422 if (CurrentEmeVersion() == UNPREFIXED) |
| 426 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | 423 command_line->AppendSwitch(switches::kEnableEncryptedMedia); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly_Prefixed, | 481 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly_Prefixed, |
| 485 EncryptedMediaTest, | 482 EncryptedMediaTest, |
| 486 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem), | 483 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem), |
| 487 Values(MSE), | 484 Values(MSE), |
| 488 Values(PREFIXED))); | 485 Values(PREFIXED))); |
| 489 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly, | 486 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly, |
| 490 EncryptedMediaTest, | 487 EncryptedMediaTest, |
| 491 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem), | 488 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem), |
| 492 Values(MSE), | 489 Values(MSE), |
| 493 Values(UNPREFIXED))); | 490 Values(UNPREFIXED))); |
| 494 #endif // defined(ENABLE_PEPPER_CDMS) | 491 #endif // defined(ENABLE_PEPPER_CDMS) |
| 495 | 492 |
| 496 #if defined(WIDEVINE_CDM_AVAILABLE) | 493 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 497 // This test doesn't fully test playback with Widevine. So we only run Widevine | 494 // This test doesn't fully test playback with Widevine. So we only run Widevine |
| 498 // test with MSE (no SRC) to reduce test time. Also, on Android EME only works | 495 // test with MSE (no SRC) to reduce test time. Also, on Android EME only works |
| 499 // with MSE and we cannot run this test with SRC. | 496 // with MSE and we cannot run this test with SRC. |
| 500 INSTANTIATE_TEST_CASE_P(MSE_Widevine_Prefixed, | 497 INSTANTIATE_TEST_CASE_P(MSE_Widevine_Prefixed, |
| 501 EncryptedMediaTest, | 498 EncryptedMediaTest, |
| 502 Combine(Values(kWidevineKeySystem), | 499 Combine(Values(kWidevineKeySystem), |
| 503 Values(MSE), | 500 Values(MSE), |
| 504 Values(PREFIXED))); | 501 Values(PREFIXED))); |
| 505 | 502 |
| 506 // Following tests fail if Widevine is loaded as a component, crbug.com/356833. | 503 // Following tests fail if Widevine is loaded as a component, crbug.com/356833. |
| 507 #if !defined(WIDEVINE_CDM_IS_COMPONENT) | 504 #if !defined(WIDEVINE_CDM_IS_COMPONENT) |
| 508 INSTANTIATE_TEST_CASE_P(MSE_Widevine, | 505 INSTANTIATE_TEST_CASE_P(MSE_Widevine, |
| 509 EncryptedMediaTest, | 506 EncryptedMediaTest, |
| 510 Combine(Values(kWidevineKeySystem), | 507 Combine(Values(kWidevineKeySystem), |
| 511 Values(MSE), | 508 Values(MSE), |
| 512 Values(UNPREFIXED))); | 509 Values(UNPREFIXED))); |
| 513 #endif // !defined(WIDEVINE_CDM_IS_COMPONENT) | 510 #endif // !defined(WIDEVINE_CDM_IS_COMPONENT) |
| 514 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 511 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 515 | 512 |
| 516 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { | 513 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { |
| 517 TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly); | 514 TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly); |
| 518 } | 515 } |
| 519 | 516 |
| 520 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { | 517 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { |
| 521 TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo); | 518 TestSimplePlayback("bear-320x240-av-enc_a.webm", kWebMAudioVideo); |
| 522 } | 519 } |
| 523 | 520 |
| 524 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { | 521 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { |
| 525 TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMAudioVideo); | 522 TestSimplePlayback("bear-320x240-av-enc_av.webm", kWebMAudioVideo); |
| 526 } | 523 } |
| 527 | 524 |
| 528 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { | 525 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { |
| 529 TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVideoOnly); | 526 TestSimplePlayback("bear-320x240-v-enc_v.webm", kWebMVideoOnly); |
| 530 } | 527 } |
| 531 | 528 |
| 532 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { | 529 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { |
| 533 TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMAudioVideo); | 530 TestSimplePlayback("bear-320x240-av-enc_v.webm", kWebMAudioVideo); |
| 534 } | 531 } |
| 535 | 532 |
| 536 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VP9Video_WebM) { | 533 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VP9Video_WebM) { |
| 537 TestSimplePlayback("bear-320x240-v-vp9_enc-v.webm", kWebMVP9VideoOnly); | 534 TestSimplePlayback("bear-320x240-v-vp9-enc_v.webm", kWebMVP9VideoOnly); |
| 538 } | 535 } |
| 539 | 536 |
| 540 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) { | 537 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) { |
| 541 RunInvalidResponseTest(); | 538 RunInvalidResponseTest(); |
| 542 } | 539 } |
| 543 | 540 |
| 544 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) { | 541 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) { |
| 545 if (CurrentSourceType() != MSE || !IsMSESupported()) { | 542 if (CurrentSourceType() != MSE || !IsMSESupported()) { |
| 546 VLOG(0) << "Skipping test - ConfigChange test requires MSE."; | 543 VLOG(0) << "Skipping test - ConfigChange test requires MSE."; |
| 547 return; | 544 return; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 return; | 580 return; |
| 584 } | 581 } |
| 585 TestSimplePlayback("bear-640x360-a_frag-cenc.mp4", kMP4AudioOnly); | 582 TestSimplePlayback("bear-640x360-a_frag-cenc.mp4", kMP4AudioOnly); |
| 586 } | 583 } |
| 587 #endif // defined(USE_PROPRIETARY_CODECS) | 584 #endif // defined(USE_PROPRIETARY_CODECS) |
| 588 | 585 |
| 589 #if defined(WIDEVINE_CDM_AVAILABLE) | 586 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 590 // The parent key system cannot be used in generateKeyRequest. | 587 // The parent key system cannot be used in generateKeyRequest. |
| 591 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException_Prefixed) { | 588 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException_Prefixed) { |
| 592 RunEncryptedMediaTest(kDefaultEmePlayer, | 589 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 593 "bear-a_enc-a.webm", | 590 "bear-a-enc_a.webm", |
| 594 kWebMAudioOnly, | 591 kWebMAudioOnly, |
| 595 "com.widevine", | 592 "com.widevine", |
| 596 MSE, | 593 MSE, |
| 597 PREFIXED, | 594 PREFIXED, |
| 598 kNoSessionToLoad, | 595 kNoSessionToLoad, |
| 599 false, | 596 false, |
| 600 kEmeNotSupportedError); | 597 kEmeNotSupportedError); |
| 601 } | 598 } |
| 602 | 599 |
| 603 // TODO(jrummell): http://crbug.com/349181 | 600 // TODO(jrummell): http://crbug.com/349181 |
| 604 // The parent key system cannot be used when creating MediaKeys. | 601 // The parent key system cannot be used when creating MediaKeys. |
| 605 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException) { | 602 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException) { |
| 606 RunEncryptedMediaTest(kDefaultEmePlayer, | 603 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 607 "bear-a_enc-a.webm", | 604 "bear-a-enc_a.webm", |
| 608 kWebMAudioOnly, | 605 kWebMAudioOnly, |
| 609 "com.widevine", | 606 "com.widevine", |
| 610 MSE, | 607 MSE, |
| 611 UNPREFIXED, | 608 UNPREFIXED, |
| 612 kNoSessionToLoad, | 609 kNoSessionToLoad, |
| 613 false, | 610 false, |
| 614 kEmeNotSupportedError); | 611 kEmeNotSupportedError); |
| 615 } | 612 } |
| 616 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 613 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 617 | 614 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 636 "plugin crash"); | 633 "plugin crash"); |
| 637 } | 634 } |
| 638 | 635 |
| 639 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { | 636 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { |
| 640 TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem, | 637 TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem, |
| 641 kFileIOTestSuccess); | 638 kFileIOTestSuccess); |
| 642 } | 639 } |
| 643 | 640 |
| 644 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { | 641 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { |
| 645 RunEncryptedMediaTest(kDefaultEmePlayer, | 642 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 646 "bear-320x240-v_enc-v.webm", | 643 "bear-320x240-v-enc_v.webm", |
| 647 kWebMVideoOnly, | 644 kWebMVideoOnly, |
| 648 kExternalClearKeyKeySystem, | 645 kExternalClearKeyKeySystem, |
| 649 SRC, | 646 SRC, |
| 650 PREFIXED, | 647 PREFIXED, |
| 651 kLoadableSession, | 648 kLoadableSession, |
| 652 false, | 649 false, |
| 653 kEnded); | 650 kEnded); |
| 654 } | 651 } |
| 655 | 652 |
| 656 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { | 653 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { |
| 657 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. | 654 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. |
| 658 RunEncryptedMediaTest(kDefaultEmePlayer, | 655 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 659 "bear-320x240-v_enc-v.webm", | 656 "bear-320x240-v-enc_v.webm", |
| 660 kWebMVideoOnly, | 657 kWebMVideoOnly, |
| 661 kExternalClearKeyKeySystem, | 658 kExternalClearKeyKeySystem, |
| 662 SRC, | 659 SRC, |
| 663 PREFIXED, | 660 PREFIXED, |
| 664 kUnknownSession, | 661 kUnknownSession, |
| 665 false, | 662 false, |
| 666 kEmeKeyError); | 663 kEmeKeyError); |
| 667 } | 664 } |
| 668 #endif // defined(ENABLE_PEPPER_CDMS) | 665 #endif // defined(ENABLE_PEPPER_CDMS) |
| OLD | NEW |