Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 28 #elif defined(OS_WIN) | 28 #elif defined(OS_WIN) |
| 29 "clearkeycdmadapter.dll"; | 29 "clearkeycdmadapter.dll"; |
| 30 #elif defined(OS_POSIX) | 30 #elif defined(OS_POSIX) |
| 31 "libclearkeycdmadapter.so"; | 31 "libclearkeycdmadapter.so"; |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 const char kClearKeyCdmPluginMimeType[] = "application/x-ppapi-clearkey-cdm"; | 34 const char kClearKeyCdmPluginMimeType[] = "application/x-ppapi-clearkey-cdm"; |
| 35 #endif // defined(ENABLE_PEPPER_CDMS) | 35 #endif // defined(ENABLE_PEPPER_CDMS) |
| 36 | 36 |
| 37 // Available key systems. | 37 // Available key systems. |
| 38 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; | 38 const char kClearKeyKeySystem[] = "org.w3.clearkey"; |
| 39 const char kPrefixedClearKeyKeySystem[] = "webkit-org.w3.clearkey"; | |
| 39 const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"; | 40 const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"; |
| 40 const char kExternalClearKeyDecryptOnlyKeySystem[] = | 41 const char kExternalClearKeyDecryptOnlyKeySystem[] = |
| 41 "org.chromium.externalclearkey.decryptonly"; | 42 "org.chromium.externalclearkey.decryptonly"; |
| 42 const char kExternalClearKeyFileIOTestKeySystem[] = | 43 const char kExternalClearKeyFileIOTestKeySystem[] = |
| 43 "org.chromium.externalclearkey.fileiotest"; | 44 "org.chromium.externalclearkey.fileiotest"; |
| 44 const char kExternalClearKeyInitializeFailKeySystem[] = | 45 const char kExternalClearKeyInitializeFailKeySystem[] = |
| 45 "org.chromium.externalclearkey.initializefail"; | 46 "org.chromium.externalclearkey.initializefail"; |
| 46 const char kExternalClearKeyCrashKeySystem[] = | 47 const char kExternalClearKeyCrashKeySystem[] = |
| 47 "org.chromium.externalclearkey.crash"; | 48 "org.chromium.externalclearkey.crash"; |
| 48 | 49 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 64 const char kEmeKeyError[] = "KEYERROR"; | 65 const char kEmeKeyError[] = "KEYERROR"; |
| 65 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; | 66 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; |
| 66 const char kFileIOTestSuccess[] = "FILEIOTESTSUCCESS"; | 67 const char kFileIOTestSuccess[] = "FILEIOTESTSUCCESS"; |
| 67 | 68 |
| 68 // The type of video src used to load media. | 69 // The type of video src used to load media. |
| 69 enum SrcType { | 70 enum SrcType { |
| 70 SRC, | 71 SRC, |
| 71 MSE | 72 MSE |
| 72 }; | 73 }; |
| 73 | 74 |
| 75 // Whether to use prefixed EME or EME WD. | |
|
ddorwin
2014/03/04 21:18:48
Let's keep it simple: prefixed vs. unprefixed.
jrummell
2014/03/04 23:55:49
Done.
| |
| 76 enum EMEType { | |
|
ddorwin
2014/03/04 21:18:48
EmeVersion?
jrummell
2014/03/04 23:55:49
Done.
| |
| 77 Prefixed, | |
| 78 WD | |
| 79 }; | |
| 80 | |
| 74 // MSE is available on all desktop platforms and on Android 4.1 and later. | 81 // MSE is available on all desktop platforms and on Android 4.1 and later. |
| 75 static bool IsMSESupported() { | 82 static bool IsMSESupported() { |
| 76 #if defined(OS_ANDROID) | 83 #if defined(OS_ANDROID) |
| 77 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { | 84 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { |
| 78 VLOG(0) << "MSE is only supported in Android 4.1 and later."; | 85 VLOG(0) << "MSE is only supported in Android 4.1 and later."; |
| 79 return false; | 86 return false; |
| 80 } | 87 } |
| 81 #endif // defined(OS_ANDROID) | 88 #endif // defined(OS_ANDROID) |
| 82 return true; | 89 return true; |
| 83 } | 90 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 // and trying to update it with licenses. | 125 // and trying to update it with licenses. |
| 119 // When |force_invalid_response| is true, the test will provide invalid | 126 // When |force_invalid_response| is true, the test will provide invalid |
| 120 // responses, which should trigger errors. | 127 // responses, which should trigger errors. |
| 121 // TODO(xhwang): Find an easier way to pass multiple configuration test | 128 // TODO(xhwang): Find an easier way to pass multiple configuration test |
| 122 // options. | 129 // options. |
| 123 void RunEncryptedMediaTest(const std::string& html_page, | 130 void RunEncryptedMediaTest(const std::string& html_page, |
| 124 const std::string& media_file, | 131 const std::string& media_file, |
| 125 const std::string& media_type, | 132 const std::string& media_type, |
| 126 const std::string& key_system, | 133 const std::string& key_system, |
| 127 SrcType src_type, | 134 SrcType src_type, |
| 135 EMEType eme_type, | |
| 128 const std::string& session_to_load, | 136 const std::string& session_to_load, |
| 129 bool force_invalid_response, | 137 bool force_invalid_response, |
| 130 const std::string& expected_title) { | 138 const std::string& expected_title) { |
| 131 if (src_type == MSE && !IsMSESupported()) { | 139 if (src_type == MSE && !IsMSESupported()) { |
| 132 VLOG(0) << "Skipping test - MSE not supported."; | 140 VLOG(0) << "Skipping test - MSE not supported."; |
| 133 return; | 141 return; |
| 134 } | 142 } |
| 135 std::vector<StringPair> query_params; | 143 std::vector<StringPair> query_params; |
| 136 query_params.push_back(std::make_pair("mediaFile", media_file)); | 144 query_params.push_back(std::make_pair("mediaFile", media_file)); |
| 137 query_params.push_back(std::make_pair("mediaType", media_type)); | 145 query_params.push_back(std::make_pair("mediaType", media_type)); |
| 138 query_params.push_back(std::make_pair("keySystem", key_system)); | 146 query_params.push_back(std::make_pair("keySystem", key_system)); |
| 139 if (src_type == MSE) | 147 if (src_type == MSE) |
| 140 query_params.push_back(std::make_pair("useMSE", "1")); | 148 query_params.push_back(std::make_pair("useMSE", "1")); |
|
ddorwin
2014/03/04 21:18:48
Not sure about JS style, but these might be incorr
jrummell
2014/03/04 23:55:49
I just followed what the existing code did. I can'
| |
| 149 if (eme_type == Prefixed) | |
| 150 query_params.push_back(std::make_pair("usePrefixedEME", "1")); | |
| 141 if (force_invalid_response) | 151 if (force_invalid_response) |
| 142 query_params.push_back(std::make_pair("forceInvalidResponse", "1")); | 152 query_params.push_back(std::make_pair("forceInvalidResponse", "1")); |
| 143 if (!session_to_load.empty()) | 153 if (!session_to_load.empty()) |
| 144 query_params.push_back(std::make_pair("sessionToLoad", session_to_load)); | 154 query_params.push_back(std::make_pair("sessionToLoad", session_to_load)); |
| 145 RunEncryptedMediaTestPage(html_page, key_system, &query_params, | 155 RunEncryptedMediaTestPage(html_page, key_system, &query_params, |
| 146 expected_title); | 156 expected_title); |
| 147 } | 157 } |
| 148 | 158 |
| 149 void RunSimpleEncryptedMediaTest(const std::string& media_file, | 159 void RunSimpleEncryptedMediaTest(const std::string& media_file, |
| 150 const std::string& media_type, | 160 const std::string& media_type, |
| 151 const std::string& key_system, | 161 const std::string& key_system, |
| 152 SrcType src_type) { | 162 SrcType src_type, |
| 163 EMEType eme_type) { | |
| 153 std::string expected_title = kEnded; | 164 std::string expected_title = kEnded; |
| 154 if (!IsPlayBackPossible(key_system)) | 165 if (!IsPlayBackPossible(key_system)) |
| 155 expected_title = kEmeKeyError; | 166 expected_title = kEmeKeyError; |
| 156 | 167 |
| 157 RunEncryptedMediaTest("encrypted_media_player.html", media_file, media_type, | 168 RunEncryptedMediaTest("encrypted_media_player.html", |
| 158 key_system, src_type, kNoSessionToLoad, false, | 169 media_file, |
| 170 media_type, | |
| 171 key_system, | |
| 172 src_type, | |
| 173 eme_type, | |
| 174 kNoSessionToLoad, | |
| 175 false, | |
| 159 expected_title); | 176 expected_title); |
| 160 // Check KeyMessage received for all key systems. | 177 // Check KeyMessage received for all key systems. |
| 161 bool receivedKeyMessage = false; | 178 bool receivedKeyMessage = false; |
| 162 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 179 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
| 163 browser()->tab_strip_model()->GetActiveWebContents(), | 180 browser()->tab_strip_model()->GetActiveWebContents(), |
| 164 "window.domAutomationController.send(video.receivedKeyMessage);", | 181 "window.domAutomationController.send(video.receivedKeyMessage);", |
| 165 &receivedKeyMessage)); | 182 &receivedKeyMessage)); |
| 166 EXPECT_TRUE(receivedKeyMessage); | 183 EXPECT_TRUE(receivedKeyMessage); |
| 167 } | 184 } |
| 168 | 185 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 // kExternalClearKeyFileIOTestKeySystem is used to test file IO. | 304 // kExternalClearKeyFileIOTestKeySystem is used to test file IO. |
| 288 void TestNonPlaybackCases(const std::string& key_system, | 305 void TestNonPlaybackCases(const std::string& key_system, |
| 289 const std::string& expected_title) { | 306 const std::string& expected_title) { |
| 290 // Since we do not test playback, arbitrarily choose a test file and source | 307 // Since we do not test playback, arbitrarily choose a test file and source |
| 291 // type. | 308 // type. |
| 292 RunEncryptedMediaTest("encrypted_media_player.html", | 309 RunEncryptedMediaTest("encrypted_media_player.html", |
| 293 "bear-a-enc_a.webm", | 310 "bear-a-enc_a.webm", |
| 294 kWebMAudioOnly, | 311 kWebMAudioOnly, |
| 295 key_system, | 312 key_system, |
| 296 SRC, | 313 SRC, |
| 314 Prefixed, | |
| 297 kNoSessionToLoad, | 315 kNoSessionToLoad, |
| 298 false, | 316 false, |
| 299 expected_title); | 317 expected_title); |
| 300 } | 318 } |
| 301 | 319 |
| 302 protected: | 320 protected: |
| 303 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 321 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 304 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 322 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
| 305 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); | 323 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); |
| 306 } | 324 } |
| 307 }; | 325 }; |
| 308 | 326 |
| 309 #if defined(WIDEVINE_CDM_AVAILABLE) | 327 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 310 // Tests encrypted media playback using Widevine key system. | 328 // Tests encrypted media playback using Widevine key system. |
| 311 class WVEncryptedMediaTest : public EncryptedMediaTestBase { | 329 class WVEncryptedMediaTest : public EncryptedMediaTestBase { |
| 312 protected: | 330 protected: |
| 313 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 331 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 314 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 332 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
| 315 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); | 333 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); |
| 316 } | 334 } |
| 317 }; | 335 }; |
| 318 | 336 |
| 319 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 337 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 320 #endif // defined(ENABLE_PEPPER_CDMS) | 338 #endif // defined(ENABLE_PEPPER_CDMS) |
| 321 | 339 |
| 322 // Tests encrypted media playback with a combination of parameters: | 340 // Tests encrypted media playback with a combination of parameters: |
| 323 // - char*: Key system name. | 341 // - char*: Key system name. |
| 324 // - bool: True to load media using MSE, otherwise use src. | 342 // - bool: True to load media using MSE, otherwise use src. |
| 343 // - bool: True to use EME WD, otherwise use prefixed EME. | |
|
ddorwin
2014/03/04 21:18:48
ditto
jrummell
2014/03/04 23:55:49
Done.
| |
| 325 // | 344 // |
| 326 // Note: Only parameterized (*_P) tests can be used. Non-parameterized (*_F) | 345 // Note: Only parameterized (*_P) tests can be used. Non-parameterized (*_F) |
| 327 // tests will crash at GetParam(). To add non-parameterized tests, use | 346 // tests will crash at GetParam(). To add non-parameterized tests, use |
| 328 // EncryptedMediaTestBase or one of its subclasses (e.g. WVEncryptedMediaTest). | 347 // EncryptedMediaTestBase or one of its subclasses (e.g. WVEncryptedMediaTest). |
| 329 class EncryptedMediaTest : public EncryptedMediaTestBase, | 348 class EncryptedMediaTest |
| 330 public testing::WithParamInterface<std::tr1::tuple<const char*, SrcType> > { | 349 : public EncryptedMediaTestBase, |
| 350 public testing::WithParamInterface< | |
| 351 std::tr1::tuple<const char*, SrcType, EMEType> > { | |
| 331 public: | 352 public: |
| 332 std::string CurrentKeySystem() { | 353 std::string CurrentKeySystem() { |
| 333 return std::tr1::get<0>(GetParam()); | 354 return std::tr1::get<0>(GetParam()); |
| 334 } | 355 } |
| 335 | 356 |
| 336 SrcType CurrentSourceType() { | 357 SrcType CurrentSourceType() { |
| 337 return std::tr1::get<1>(GetParam()); | 358 return std::tr1::get<1>(GetParam()); |
| 338 } | 359 } |
| 339 | 360 |
| 361 EMEType CurrentEMEType() { | |
| 362 return std::tr1::get<2>(GetParam()); | |
| 363 } | |
| 364 | |
| 340 void TestSimplePlayback(const std::string& encrypted_media, | 365 void TestSimplePlayback(const std::string& encrypted_media, |
| 341 const std::string& media_type) { | 366 const std::string& media_type) { |
| 342 RunSimpleEncryptedMediaTest( | 367 RunSimpleEncryptedMediaTest(encrypted_media, |
| 343 encrypted_media, media_type, CurrentKeySystem(), CurrentSourceType()); | 368 media_type, |
| 369 CurrentKeySystem(), | |
| 370 CurrentSourceType(), | |
| 371 CurrentEMEType()); | |
| 344 } | 372 } |
| 345 | 373 |
| 346 void RunInvalidResponseTest() { | 374 void RunInvalidResponseTest() { |
| 347 RunEncryptedMediaTest("encrypted_media_player.html", | 375 RunEncryptedMediaTest("encrypted_media_player.html", |
| 348 "bear-320x240-av-enc_av.webm", | 376 "bear-320x240-av-enc_av.webm", |
| 349 kWebMAudioVideo, | 377 kWebMAudioVideo, |
| 350 CurrentKeySystem(), | 378 CurrentKeySystem(), |
| 351 CurrentSourceType(), | 379 CurrentSourceType(), |
| 380 CurrentEMEType(), | |
| 352 kNoSessionToLoad, | 381 kNoSessionToLoad, |
| 353 true, | 382 true, |
| 354 kEmeKeyError); | 383 kEmeKeyError); |
| 355 } | 384 } |
| 356 | 385 |
| 357 void TestFrameSizeChange() { | 386 void TestFrameSizeChange() { |
| 358 RunEncryptedMediaTest("encrypted_frame_size_change.html", | 387 RunEncryptedMediaTest("encrypted_frame_size_change.html", |
| 359 "frame_size_change-av-enc-v.webm", | 388 "frame_size_change-av-enc-v.webm", |
| 360 kWebMAudioVideo, | 389 kWebMAudioVideo, |
| 361 CurrentKeySystem(), | 390 CurrentKeySystem(), |
| 362 CurrentSourceType(), | 391 CurrentSourceType(), |
| 392 CurrentEMEType(), | |
| 363 kNoSessionToLoad, | 393 kNoSessionToLoad, |
| 364 false, | 394 false, |
| 365 kEnded); | 395 kEnded); |
| 366 } | 396 } |
| 367 | 397 |
| 368 void TestConfigChange() { | 398 void TestConfigChange() { |
| 369 DCHECK(IsMSESupported()); | 399 DCHECK(IsMSESupported()); |
| 370 std::vector<StringPair> query_params; | 400 std::vector<StringPair> query_params; |
| 371 query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); | 401 query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); |
| 372 query_params.push_back(std::make_pair("runEncrypted", "1")); | 402 query_params.push_back(std::make_pair("runEncrypted", "1")); |
| 403 if (CurrentEMEType() == Prefixed) | |
| 404 query_params.push_back(std::make_pair("usePrefixedEME", "1")); | |
| 373 RunEncryptedMediaTestPage("mse_config_change.html", | 405 RunEncryptedMediaTestPage("mse_config_change.html", |
| 374 CurrentKeySystem(), | 406 CurrentKeySystem(), |
| 375 &query_params, | 407 &query_params, |
| 376 kEnded); | 408 kEnded); |
| 377 } | 409 } |
| 378 | 410 |
| 379 protected: | 411 protected: |
| 380 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 412 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 381 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 413 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
| 382 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); | 414 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); |
| 415 | |
| 416 if (CurrentEMEType() == WD) | |
| 417 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | |
| 383 } | 418 } |
| 384 }; | 419 }; |
| 385 | 420 |
| 386 using ::testing::Combine; | 421 using ::testing::Combine; |
| 387 using ::testing::Values; | 422 using ::testing::Values; |
| 388 | 423 |
|
ddorwin
2014/03/04 21:18:48
This is a lot of tests, each of which takes severa
jrummell
2014/03/04 23:55:49
Done.
| |
| 389 #if !defined(OS_ANDROID) | 424 #if !defined(OS_ANDROID) |
| 390 INSTANTIATE_TEST_CASE_P(SRC_ClearKey, EncryptedMediaTest, | 425 INSTANTIATE_TEST_CASE_P(SRC_ClearKey, |
| 391 Combine(Values(kClearKeyKeySystem), Values(SRC))); | 426 EncryptedMediaTest, |
| 427 Combine(Values(kPrefixedClearKeyKeySystem), | |
| 428 Values(SRC), | |
| 429 Values(Prefixed))); | |
| 430 INSTANTIATE_TEST_CASE_P(SRC_ClearKey_WD, | |
|
ddorwin
2014/03/04 21:18:48
ditto here and below. Also, I would instead name t
jrummell
2014/03/04 23:55:49
Done. I didn't want to change the names of the exi
| |
| 431 EncryptedMediaTest, | |
| 432 Combine(Values(kClearKeyKeySystem), | |
| 433 Values(SRC), | |
| 434 Values(WD))); | |
| 392 #endif // !defined(OS_ANDROID) | 435 #endif // !defined(OS_ANDROID) |
| 393 | 436 |
| 394 INSTANTIATE_TEST_CASE_P(MSE_ClearKey, EncryptedMediaTest, | 437 INSTANTIATE_TEST_CASE_P(MSE_ClearKey, |
| 395 Combine(Values(kClearKeyKeySystem), Values(MSE))); | 438 EncryptedMediaTest, |
| 439 Combine(Values(kPrefixedClearKeyKeySystem), | |
| 440 Values(MSE), | |
| 441 Values(Prefixed))); | |
| 442 INSTANTIATE_TEST_CASE_P(MSE_ClearKey_WD, | |
| 443 EncryptedMediaTest, | |
| 444 Combine(Values(kClearKeyKeySystem), | |
| 445 Values(MSE), | |
| 446 Values(WD))); | |
| 396 | 447 |
| 397 // External Clear Key is currently only used on platforms that use Pepper CDMs. | 448 // External Clear Key is currently only used on platforms that use Pepper CDMs. |
| 398 #if defined(ENABLE_PEPPER_CDMS) | 449 #if defined(ENABLE_PEPPER_CDMS) |
| 399 INSTANTIATE_TEST_CASE_P(SRC_ExternalClearKey, EncryptedMediaTest, | 450 INSTANTIATE_TEST_CASE_P(SRC_ExternalClearKey, |
| 400 Combine(Values(kExternalClearKeyKeySystem), Values(SRC))); | 451 EncryptedMediaTest, |
| 401 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKey, EncryptedMediaTest, | 452 Combine(Values(kExternalClearKeyKeySystem), |
| 402 Combine(Values(kExternalClearKeyKeySystem), Values(MSE))); | 453 Values(SRC), |
| 454 Values(Prefixed))); | |
| 455 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKey, | |
| 456 EncryptedMediaTest, | |
| 457 Combine(Values(kExternalClearKeyKeySystem), | |
| 458 Values(MSE), | |
| 459 Values(Prefixed))); | |
| 403 // To reduce test time, only run ExternalClearKeyDecryptOnly with MSE. | 460 // To reduce test time, only run ExternalClearKeyDecryptOnly with MSE. |
| 404 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly, EncryptedMediaTest, | 461 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly, |
| 405 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem), Values(MSE))); | 462 EncryptedMediaTest, |
| 463 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem), | |
| 464 Values(MSE), | |
| 465 Values(Prefixed))); | |
| 406 #endif // defined(ENABLE_PEPPER_CDMS) | 466 #endif // defined(ENABLE_PEPPER_CDMS) |
| 407 | 467 |
| 408 #if defined(WIDEVINE_CDM_AVAILABLE) | 468 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 409 // This test doesn't fully test playback with Widevine. So we only run Widevine | 469 // This test doesn't fully test playback with Widevine. So we only run Widevine |
| 410 // test with MSE (no SRC) to reduce test time. Also, on Android EME only works | 470 // test with MSE (no SRC) to reduce test time. Also, on Android EME only works |
| 411 // with MSE and we cannot run this test with SRC. | 471 // with MSE and we cannot run this test with SRC. |
| 412 INSTANTIATE_TEST_CASE_P(MSE_Widevine, EncryptedMediaTest, | 472 INSTANTIATE_TEST_CASE_P(MSE_Widevine, |
| 413 Combine(Values(kWidevineKeySystem), Values(MSE))); | 473 EncryptedMediaTest, |
| 474 Combine(Values(kWidevineKeySystem), | |
| 475 Values(MSE), | |
| 476 Values(Prefixed))); | |
| 414 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 477 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 415 | 478 |
| 416 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { | 479 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { |
| 417 TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly); | 480 TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly); |
| 418 } | 481 } |
| 419 | 482 |
| 420 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { | 483 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { |
| 421 TestSimplePlayback("bear-320x240-av-enc_a.webm", kWebMAudioVideo); | 484 TestSimplePlayback("bear-320x240-av-enc_a.webm", kWebMAudioVideo); |
| 422 } | 485 } |
| 423 | 486 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 #endif // defined(USE_PROPRIETARY_CODECS) | 546 #endif // defined(USE_PROPRIETARY_CODECS) |
| 484 | 547 |
| 485 #if defined(WIDEVINE_CDM_AVAILABLE) | 548 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 486 // The parent key system cannot be used in generateKeyRequest. | 549 // The parent key system cannot be used in generateKeyRequest. |
| 487 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException) { | 550 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException) { |
| 488 RunEncryptedMediaTest("encrypted_media_player.html", | 551 RunEncryptedMediaTest("encrypted_media_player.html", |
| 489 "bear-a-enc_a.webm", | 552 "bear-a-enc_a.webm", |
| 490 kWebMAudioOnly, | 553 kWebMAudioOnly, |
| 491 "com.widevine", | 554 "com.widevine", |
| 492 MSE, | 555 MSE, |
| 556 Prefixed, | |
|
ddorwin
2014/03/04 21:18:48
We should be able to test this with unprefixed too
jrummell
2014/03/04 23:55:49
Added, but fails due to FATAL error. Opened http:/
| |
| 493 kNoSessionToLoad, | 557 kNoSessionToLoad, |
| 494 false, | 558 false, |
| 495 kEmeNotSupportedError); | 559 kEmeNotSupportedError); |
| 496 } | 560 } |
| 497 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 561 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 498 | 562 |
| 499 #if defined(ENABLE_PEPPER_CDMS) | 563 #if defined(ENABLE_PEPPER_CDMS) |
| 500 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, InitializeCDMFail) { | 564 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, InitializeCDMFail) { |
| 501 TestNonPlaybackCases(kExternalClearKeyInitializeFailKeySystem, kEmeKeyError); | 565 TestNonPlaybackCases(kExternalClearKeyInitializeFailKeySystem, kEmeKeyError); |
| 502 } | 566 } |
| 503 | 567 |
| 504 // When CDM crashes, we should still get a decode error. | 568 // When CDM crashes, we should still get a decode error. |
| 505 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, CDMCrashDuringDecode) { | 569 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, CDMCrashDuringDecode) { |
| 506 TestNonPlaybackCases(kExternalClearKeyCrashKeySystem, kError); | 570 TestNonPlaybackCases(kExternalClearKeyCrashKeySystem, kError); |
| 507 } | 571 } |
| 508 | 572 |
| 509 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { | 573 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { |
| 510 TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem, | 574 TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem, |
| 511 kFileIOTestSuccess); | 575 kFileIOTestSuccess); |
| 512 } | 576 } |
| 513 | 577 |
| 514 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { | 578 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { |
| 515 RunEncryptedMediaTest("encrypted_media_player.html", | 579 RunEncryptedMediaTest("encrypted_media_player.html", |
| 516 "bear-320x240-v-enc_v.webm", | 580 "bear-320x240-v-enc_v.webm", |
| 517 kWebMVideoOnly, | 581 kWebMVideoOnly, |
| 518 kExternalClearKeyKeySystem, | 582 kExternalClearKeyKeySystem, |
| 519 SRC, | 583 SRC, |
| 584 Prefixed, | |
| 520 kLoadableSession, | 585 kLoadableSession, |
| 521 false, | 586 false, |
| 522 kEnded); | 587 kEnded); |
| 523 } | 588 } |
| 524 | 589 |
| 525 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { | 590 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { |
| 526 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. | 591 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. |
| 527 RunEncryptedMediaTest("encrypted_media_player.html", | 592 RunEncryptedMediaTest("encrypted_media_player.html", |
| 528 "bear-320x240-v-enc_v.webm", | 593 "bear-320x240-v-enc_v.webm", |
| 529 kWebMVideoOnly, | 594 kWebMVideoOnly, |
| 530 kExternalClearKeyKeySystem, | 595 kExternalClearKeyKeySystem, |
| 531 SRC, | 596 SRC, |
| 597 Prefixed, | |
| 532 kUnknownSession, | 598 kUnknownSession, |
| 533 false, | 599 false, |
| 534 kEmeKeyError); | 600 kEmeKeyError); |
| 535 } | 601 } |
| 536 #endif // defined(ENABLE_PEPPER_CDMS) | 602 #endif // defined(ENABLE_PEPPER_CDMS) |
| OLD | NEW |