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 // TODO(sandersd): Refactor to remove recomputed codec arrays, and generally | 5 // TODO(sandersd): Refactor to remove recomputed codec arrays, and generally |
6 // shorten and improve coverage. | 6 // shorten and improve coverage. |
7 // - http://crbug.com/417444 | 7 // - http://crbug.com/417444 |
8 // - http://crbug.com/457438 | 8 // - http://crbug.com/457438 |
9 // TODO(sandersd): Add tests to cover codec vectors with empty items. | 9 // TODO(sandersd): Add tests to cover codec vectors with empty items. |
10 // http://crbug.com/417461 | 10 // http://crbug.com/417461 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 TEST_F(KeySystemsTest, Basic_UnrecognizedKeySystem) { | 394 TEST_F(KeySystemsTest, Basic_UnrecognizedKeySystem) { |
395 static const char* const kUnrecognized = "x-org.example.unrecognized"; | 395 static const char* const kUnrecognized = "x-org.example.unrecognized"; |
396 | 396 |
397 EXPECT_FALSE(IsSupportedKeySystem(kUnrecognized)); | 397 EXPECT_FALSE(IsSupportedKeySystem(kUnrecognized)); |
398 | 398 |
399 EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kUnrecognized)); | 399 EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kUnrecognized)); |
400 EXPECT_FALSE(CanUseAesDecryptor(kUnrecognized)); | 400 EXPECT_FALSE(CanUseAesDecryptor(kUnrecognized)); |
401 | 401 |
402 #if defined(ENABLE_PEPPER_CDMS) | 402 #if defined(ENABLE_PEPPER_CDMS) |
403 std::string type; | 403 std::string type; |
404 EXPECT_DEBUG_DEATH(type = GetPepperType(kUnrecognized), | 404 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
405 "x-org.example.unrecognized is not a known system"); | 405 EXPECT_DEATH(type = GetPepperType(kUnrecognized), |
| 406 "x-org.example.unrecognized is not a known system"); |
| 407 #endif |
406 EXPECT_TRUE(type.empty()); | 408 EXPECT_TRUE(type.empty()); |
407 #endif | 409 #endif |
408 } | 410 } |
409 | 411 |
410 TEST_F(KeySystemsTest, Basic_UsesAesDecryptor) { | 412 TEST_F(KeySystemsTest, Basic_UsesAesDecryptor) { |
411 EXPECT_TRUE(IsSupportedKeySystem(kUsesAes)); | 413 EXPECT_TRUE(IsSupportedKeySystem(kUsesAes)); |
412 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( | 414 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( |
413 kVideoWebM, no_codecs(), kUsesAes)); | 415 kVideoWebM, no_codecs(), kUsesAes)); |
414 | 416 |
415 // No UMA value for this test key system. | 417 // No UMA value for this test key system. |
416 EXPECT_EQ("UseAes", GetKeySystemNameForUMA(kUsesAes)); | 418 EXPECT_EQ("UseAes", GetKeySystemNameForUMA(kUsesAes)); |
417 | 419 |
418 EXPECT_TRUE(CanUseAesDecryptor(kUsesAes)); | 420 EXPECT_TRUE(CanUseAesDecryptor(kUsesAes)); |
419 #if defined(ENABLE_PEPPER_CDMS) | 421 #if defined(ENABLE_PEPPER_CDMS) |
420 std::string type; | 422 std::string type; |
421 EXPECT_DEBUG_DEATH(type = GetPepperType(kUsesAes), | 423 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
422 "x-org.example.clear is not Pepper-based"); | 424 EXPECT_DEATH(type = GetPepperType(kUsesAes), |
| 425 "x-org.example.clear is not Pepper-based"); |
| 426 #endif |
423 EXPECT_TRUE(type.empty()); | 427 EXPECT_TRUE(type.empty()); |
424 #endif | 428 #endif |
425 } | 429 } |
426 | 430 |
427 TEST_F(KeySystemsTest, | 431 TEST_F(KeySystemsTest, |
428 IsSupportedKeySystemWithMediaMimeType_UsesAesDecryptor_TypesContainer1) { | 432 IsSupportedKeySystemWithMediaMimeType_UsesAesDecryptor_TypesContainer1) { |
429 // Valid video types. | 433 // Valid video types. |
430 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( | 434 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( |
431 kVideoWebM, vp8_codec(), kUsesAes)); | 435 kVideoWebM, vp8_codec(), kUsesAes)); |
432 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( | 436 EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType( |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); | 748 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); |
745 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); | 749 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); |
746 | 750 |
747 EXPECT_FALSE(IsSupportedKeySystem("x-")); | 751 EXPECT_FALSE(IsSupportedKeySystem("x-")); |
748 EXPECT_TRUE(IsSupportedKeySystem("x-something")); | 752 EXPECT_TRUE(IsSupportedKeySystem("x-something")); |
749 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); | 753 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); |
750 EXPECT_FALSE(IsSupportedKeySystem("x-other")); | 754 EXPECT_FALSE(IsSupportedKeySystem("x-other")); |
751 } | 755 } |
752 | 756 |
753 } // namespace media | 757 } // namespace media |
OLD | NEW |