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

Unified Diff: chrome/browser/sync/engine/syncapi_unittest.cc

Issue 7551024: [Sync] Fix encryption/passphrase handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix integration tests Created 9 years, 5 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/engine/syncapi_unittest.cc
diff --git a/chrome/browser/sync/engine/syncapi_unittest.cc b/chrome/browser/sync/engine/syncapi_unittest.cc
index 4af502ee03150436f4d64b129bc4c2fe978bb25d..22da65ef6ec8a830bea6d57bd55cbf9e4356f028 100644
--- a/chrome/browser/sync/engine/syncapi_unittest.cc
+++ b/chrome/browser/sync/engine/syncapi_unittest.cc
@@ -1361,7 +1361,7 @@ TEST_F(SyncManagerTest, EncryptDataTypesWithData) {
// Trigger's a ReEncryptEverything with new passphrase.
testing::Mock::VerifyAndClearExpectations(&observer_);
EXPECT_CALL(observer_, OnPassphraseAccepted(_)).Times(1);
- EXPECT_CALL(observer_, OnEncryptionComplete(_)).Times(1);
+ EXPECT_CALL(observer_, OnEncryptionComplete(encrypted_types)).Times(1);
sync_manager_.SetPassphrase("new_passphrase", true);
{
ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());
@@ -1379,11 +1379,12 @@ TEST_F(SyncManagerTest, EncryptDataTypesWithData) {
syncable::THEMES,
false /* not encrypted */));
}
- // Calling EncryptDataTypes with the same encrypted types should not trigger
- // a re-encryption.
+ // Calling EncryptDataTypes with an empty encrypted types should not trigger
+ // a reencryption and should just notify immediately.
+ // TODO(zea): add logic to ensure nothing was written.
testing::Mock::VerifyAndClearExpectations(&observer_);
EXPECT_CALL(observer_, OnPassphraseAccepted(_)).Times(0);
- EXPECT_CALL(observer_, OnEncryptionComplete(_)).Times(0);
+ EXPECT_CALL(observer_, OnEncryptionComplete(encrypted_types)).Times(1);
sync_manager_.EncryptDataTypes(encrypted_types);
}

Powered by Google App Engine
This is Rietveld 408576698