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