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

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

Issue 1701973003: Remove associated keying material when unregistering from GCM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 9bf1e074e49a2d7da186ada09e2957352c0bdb8a..f2cd35da3baaa6fb7c4eb7ab6078d610ee5b74d8 100644
--- a/components/gcm_driver/crypto/gcm_key_store_unittest.cc
+++ b/components/gcm_driver/crypto/gcm_key_store_unittest.cc
@@ -5,6 +5,7 @@
#include "components/gcm_driver/crypto/gcm_key_store.h"
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
@@ -51,13 +52,6 @@ class GCMKeyStoreTest : public ::testing::Test {
*auth_secret_out = auth_secret;
}
- // Callback to use with GCMKeyStore::DeleteKeys calls.
- void DeletedKeys(bool* success_out, bool success) {
- DCHECK(success_out);
-
- *success_out = success;
- }
-
protected:
GCMKeyStore* gcm_key_store() { return gcm_key_store_.get(); }
@@ -149,7 +143,7 @@ TEST_F(GCMKeyStoreTest, KeysPersistenceBetweenInstances) {
EXPECT_GT(read_auth_secret.size(), 0u);
}
-TEST_F(GCMKeyStoreTest, CreateAndDeleteKeys) {
+TEST_F(GCMKeyStoreTest, CreateAndRemoveKeys) {
KeyPair pair;
std::string auth_secret;
gcm_key_store()->CreateKeys(kFakeAppId,
@@ -173,15 +167,10 @@ TEST_F(GCMKeyStoreTest, CreateAndDeleteKeys) {
ASSERT_TRUE(read_pair.IsInitialized());
EXPECT_TRUE(read_pair.has_type());
- bool success = false;
- gcm_key_store()->DeleteKeys(kFakeAppId,
- base::Bind(&GCMKeyStoreTest::DeletedKeys,
- base::Unretained(this), &success));
+ gcm_key_store()->RemoveKeys(kFakeAppId, base::Bind(&base::DoNothing));
base::RunLoop().RunUntilIdle();
- ASSERT_TRUE(success);
-
gcm_key_store()->GetKeys(kFakeAppId,
base::Bind(&GCMKeyStoreTest::GotKeys,
base::Unretained(this), &read_pair,

Powered by Google App Engine
This is Rietveld 408576698