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

Unified Diff: components/gcm_driver/crypto/gcm_key_store_unittest.cc

Issue 2642173002: Migrate GCMKeyStore and InkDropImpl tests to use EXPECT_DCHECK_DEATH. (Closed)
Patch Set: Remove static_assert()s Created 3 years, 11 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 | ui/views/animation/ink_drop_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/crypto/gcm_key_store_unittest.cc
diff --git a/components/gcm_driver/crypto/gcm_key_store_unittest.cc b/components/gcm_driver/crypto/gcm_key_store_unittest.cc
index c9ec31e9b5e16c30a13476c9695872cc6b0b9ea6..37b12fda81beff0ed48e031c6ba4bcf42bb0029d 100644
--- a/components/gcm_driver/crypto/gcm_key_store_unittest.cc
+++ b/components/gcm_driver/crypto/gcm_key_store_unittest.cc
@@ -12,10 +12,10 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/gtest_util.h"
#include "base/test/histogram_tester.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/gcm_driver/crypto/p256_key_util.h"
-#include "net/test/gtest_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gcm {
@@ -514,8 +514,6 @@ TEST_F(GCMKeyStoreTest, SuccessiveCallsBeforeInitialization) {
EXPECT_TRUE(pair.IsInitialized());
}
-#if !defined(NDEBUG) && DCHECK_IS_ON()
-
TEST_F(GCMKeyStoreTest, CannotShareAppIdFromGCMToInstanceID) {
KeyPair pair_unused;
std::string auth_secret_unused;
@@ -526,9 +524,7 @@ TEST_F(GCMKeyStoreTest, CannotShareAppIdFromGCMToInstanceID) {
base::RunLoop().RunUntilIdle();
- static_assert(logging::LOG_DCHECK == logging::LOG_DFATAL,
- "Unless these are equal, EXPECT_DFATAL will miss the DCHECK");
- EXPECT_DFATAL(
+ EXPECT_DCHECK_DEATH(
{
gcm_key_store()->CreateKeys(
kFakeAppId, kFakeAuthorizedEntity,
@@ -536,9 +532,7 @@ TEST_F(GCMKeyStoreTest, CannotShareAppIdFromGCMToInstanceID) {
&pair_unused, &auth_secret_unused));
base::RunLoop().RunUntilIdle();
- },
- "Instance ID tokens cannot share an app_id with a non-InstanceID GCM "
- "registration");
+ });
}
TEST_F(GCMKeyStoreTest, CannotShareAppIdFromInstanceIDToGCM) {
@@ -558,9 +552,7 @@ TEST_F(GCMKeyStoreTest, CannotShareAppIdFromInstanceIDToGCM) {
base::RunLoop().RunUntilIdle();
- static_assert(logging::LOG_DCHECK == logging::LOG_DFATAL,
- "Unless these are equal, EXPECT_DFATAL will miss the DCHECK");
- EXPECT_DFATAL(
+ EXPECT_DCHECK_DEATH(
{
gcm_key_store()->CreateKeys(
kFakeAppId, "" /* empty authorized entity for non-InstanceID */,
@@ -568,13 +560,9 @@ TEST_F(GCMKeyStoreTest, CannotShareAppIdFromInstanceIDToGCM) {
&pair_unused, &auth_secret_unused));
base::RunLoop().RunUntilIdle();
- },
- "Instance ID tokens cannot share an app_id with a non-InstanceID GCM "
- "registration");
+ });
}
-#endif // !defined(NDEBUG) && DCHECK_IS_ON()
-
} // namespace
} // namespace gcm
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698