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

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

Issue 7583032: Merge 95693 - [Sync] Fix encryption/passphrase handling. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src/
Patch Set: Created 9 years, 4 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 | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi_unittest.cc
===================================================================
--- chrome/browser/sync/engine/syncapi_unittest.cc (revision 95790)
+++ chrome/browser/sync/engine/syncapi_unittest.cc (working copy)
@@ -1361,7 +1361,7 @@
// 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 @@
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);
}
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698