Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Unified Diff: media/base/key_systems_unittest.cc

Issue 1219143002: media: Fix KeySystemsTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/key_systems_unittest.cc
diff --git a/media/base/key_systems_unittest.cc b/media/base/key_systems_unittest.cc
index a1e95e06c7812b646d301ec26167d53892e935dd..b97852d132f87e41a0de773221ce720b15a858d8 100644
--- a/media/base/key_systems_unittest.cc
+++ b/media/base/key_systems_unittest.cc
@@ -19,24 +19,6 @@
#include "media/base/media_client.h"
#include "testing/gtest/include/gtest/gtest.h"
-// Death tests are not always available, including on Android.
-// EXPECT_DEBUG_DEATH_PORTABLE executes tests correctly except in the case that
-// death tests are not available and NDEBUG is not defined.
-#if defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
-#define EXPECT_DEBUG_DEATH_PORTABLE(statement, regex) \
- EXPECT_DEBUG_DEATH(statement, regex)
-#else
-#if defined(NDEBUG)
-#define EXPECT_DEBUG_DEATH_PORTABLE(statement, regex) \
- do { statement; } while (false)
-#else
-#include "base/logging.h"
-#define EXPECT_DEBUG_DEATH_PORTABLE(statement, regex) \
- LOG(WARNING) << "Death tests are not supported on this platform.\n" \
- << "Statement '" #statement "' cannot be verified.";
-#endif // defined(NDEBUG)
-#endif // defined(GTEST_HAS_DEATH_TEST) && !defined(OS_ANDROID)
-
namespace media {
// These are the (fake) key systems that are registered for these tests.
@@ -406,12 +388,7 @@ TEST_F(KeySystemsTest, Basic_UnrecognizedKeySystem) {
EXPECT_FALSE(IsSupportedKeySystem(kUnrecognized));
EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kUnrecognized));
-
- bool can_use = false;
- EXPECT_DEBUG_DEATH_PORTABLE(
- can_use = CanUseAesDecryptor(kUnrecognized),
- "x-org.example.unrecognized is not a known concrete system");
- EXPECT_FALSE(can_use);
+ EXPECT_FALSE(CanUseAesDecryptor(kUnrecognized));
#if defined(ENABLE_PEPPER_CDMS)
std::string type;
@@ -494,10 +471,8 @@ TEST_F(KeySystemsTest, Parent_NoParentRegistered) {
// The parent is not supported for most things.
EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kUsesAesParent));
- bool result = false;
- EXPECT_DEBUG_DEATH_PORTABLE(result = CanUseAesDecryptor(kUsesAesParent),
- "x-org.example is not a known concrete system");
- EXPECT_FALSE(result);
+ EXPECT_FALSE(CanUseAesDecryptor(kUsesAesParent));
+
#if defined(ENABLE_PEPPER_CDMS)
std::string type;
EXPECT_DEBUG_DEATH(type = GetPepperType(kUsesAesParent),
@@ -613,10 +588,8 @@ TEST_F(KeySystemsTest, Parent_ParentRegistered) {
// The parent is not supported for most things.
EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kExternalParent));
- bool result = false;
- EXPECT_DEBUG_DEATH_PORTABLE(result = CanUseAesDecryptor(kExternalParent),
- "x-com.example is not a known concrete system");
- EXPECT_FALSE(result);
+ EXPECT_FALSE(CanUseAesDecryptor(kExternalParent));
+
#if defined(ENABLE_PEPPER_CDMS)
std::string type;
EXPECT_DEBUG_DEATH(type = GetPepperType(kExternalParent),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698