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

Unified Diff: chrome/browser/sync/util/cryptographer_unittest.cc

Issue 7108067: [Sync] Ensure cryptographer ready before encrypting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
Index: chrome/browser/sync/util/cryptographer_unittest.cc
diff --git a/chrome/browser/sync/util/cryptographer_unittest.cc b/chrome/browser/sync/util/cryptographer_unittest.cc
index f6881f4b200c74227542c0ad720364e2204a69af..90e4765dcf7b3260cee553e9526dd1e3ed67499c 100644
--- a/chrome/browser/sync/util/cryptographer_unittest.cc
+++ b/chrome/browser/sync/util/cryptographer_unittest.cc
@@ -25,6 +25,15 @@ TEST(CryptographerTest, EmptyCantDecrypt) {
EXPECT_FALSE(cryptographer.CanDecrypt(encrypted));
}
+TEST(CryptographerTest, EmptyCantEncrypt) {
+ Cryptographer cryptographer;
+ EXPECT_FALSE(cryptographer.is_ready());
+
+ sync_pb::EncryptedData encrypted;
+ sync_pb::PasswordSpecificsData original;
+ EXPECT_FALSE(cryptographer.Encrypt(original, &encrypted));
+}
+
TEST(CryptographerTest, MissingCantDecrypt) {
Cryptographer cryptographer;

Powered by Google App Engine
This is Rietveld 408576698