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

Unified Diff: components/browser_sync/profile_sync_service_unittest.cc

Issue 2663783002: [Sync] Split encryption state and logic out of PSS and SBHI. (Closed)
Patch Set: Tweak comment. Created 3 years, 11 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/browser_sync/profile_sync_service.cc ('k') | components/sync/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/profile_sync_service_unittest.cc
diff --git a/components/browser_sync/profile_sync_service_unittest.cc b/components/browser_sync/profile_sync_service_unittest.cc
index 24d5b41fc94e78cc0b8ac41f0702356743717d70..97ed5848feadac8cea819e4f6e4894033c30fcab 100644
--- a/components/browser_sync/profile_sync_service_unittest.cc
+++ b/components/browser_sync/profile_sync_service_unittest.cc
@@ -73,6 +73,7 @@ class FakeDataTypeManager : public syncer::DataTypeManager {
syncer::ConfigureReason reason) override {}
void Stop() override{};
ModelTypeSet GetActiveDataTypes() const override { return ModelTypeSet(); }
+ bool IsNigoriEnabled() const override { return true; }
State state() const override { return syncer::DataTypeManager::CONFIGURED; }
private:
@@ -250,8 +251,8 @@ class ProfileSyncServiceTest : public ::testing::Test {
void InitializeForFirstSync() { service_->Initialize(); }
void TriggerPassphraseRequired() {
- service_->OnPassphraseRequired(syncer::REASON_DECRYPTION,
- sync_pb::EncryptedData());
+ service_->GetEncryptionObserverForTest()->OnPassphraseRequired(
+ syncer::REASON_DECRYPTION, sync_pb::EncryptedData());
}
void TriggerDataTypeStartRequest() {
@@ -733,7 +734,8 @@ TEST_F(ProfileSyncServiceTest, OnLocalSetPassphraseEncryption) {
// configure cycle is started (DTM::Configure is called with
// CONFIGURE_REASON_CATCH_UP).
const syncer::SyncEncryptionHandler::NigoriState nigori_state;
- service()->OnLocalSetPassphraseEncryption(nigori_state);
+ service()->GetEncryptionObserverForTest()->OnLocalSetPassphraseEncryption(
+ nigori_state);
EXPECT_EQ(syncer::CONFIGURE_REASON_CATCH_UP, configure_reason);
EXPECT_TRUE(captured_callback.is_null());
@@ -778,7 +780,8 @@ TEST_F(ProfileSyncServiceTest,
// Simulate user entering encryption passphrase. Ensure Configure was called
// but don't let it continue.
const syncer::SyncEncryptionHandler::NigoriState nigori_state;
- service()->OnLocalSetPassphraseEncryption(nigori_state);
+ service()->GetEncryptionObserverForTest()->OnLocalSetPassphraseEncryption(
+ nigori_state);
EXPECT_EQ(syncer::CONFIGURE_REASON_CATCH_UP, configure_reason);
// Simulate browser restart. First configuration is a regular one.
@@ -830,7 +833,8 @@ TEST_F(ProfileSyncServiceTest,
// Simulate user entering encryption passphrase.
const syncer::SyncEncryptionHandler::NigoriState nigori_state;
- service()->OnLocalSetPassphraseEncryption(nigori_state);
+ service()->GetEncryptionObserverForTest()->OnLocalSetPassphraseEncryption(
+ nigori_state);
EXPECT_FALSE(captured_callback.is_null());
captured_callback.Reset();
« no previous file with comments | « components/browser_sync/profile_sync_service.cc ('k') | components/sync/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698