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

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

Issue 1948133003: Fix GCMKeyStore interleaved request handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid5default
Patch Set: Address review comments Created 4 years, 7 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 | « components/gcm_driver/crypto/gcm_key_store.cc ('k') | no next file » | 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 067bad47c87a87a512f57d84480194bc02b5cc8c..114f7f30a56702f4cca7703c4b0e6d6915147f97 100644
--- a/components/gcm_driver/crypto/gcm_key_store_unittest.cc
+++ b/components/gcm_driver/crypto/gcm_key_store_unittest.cc
@@ -211,6 +211,37 @@ TEST_F(GCMKeyStoreTest, CreateAndRemoveKeys) {
ASSERT_FALSE(read_pair.IsInitialized());
}
+TEST_F(GCMKeyStoreTest, CreateAndRemoveKeysSynchronously) {
+ KeyPair pair;
+ std::string auth_secret;
+ gcm_key_store()->CreateKeys(kFakeAppId,
+ base::Bind(&GCMKeyStoreTest::GotKeys,
+ base::Unretained(this), &pair,
+ &auth_secret));
+
+ // Continue synchronously, without running RunUntilIdle first.
+ gcm_key_store()->RemoveKeys(kFakeAppId, base::Bind(&base::DoNothing));
+
+ base::RunLoop().RunUntilIdle();
+
+ ASSERT_TRUE(pair.IsInitialized());
+ EXPECT_TRUE(pair.has_type());
+
+ histogram_tester()->ExpectBucketCount(
+ "GCM.Crypto.RemoveKeySuccessRate", 1, 1); // success
+
+ KeyPair read_pair;
+ std::string read_auth_secret;
+ gcm_key_store()->GetKeys(kFakeAppId,
+ base::Bind(&GCMKeyStoreTest::GotKeys,
+ base::Unretained(this), &read_pair,
+ &read_auth_secret));
+
+ base::RunLoop().RunUntilIdle();
+
+ ASSERT_FALSE(read_pair.IsInitialized());
+}
+
TEST_F(GCMKeyStoreTest, GetKeysMultipleAppIds) {
KeyPair pair;
std::string auth_secret;
« no previous file with comments | « components/gcm_driver/crypto/gcm_key_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698