diff options
Diffstat (limited to 'chromium/components/suggestions/suggestions_service_impl_unittest.cc')
-rw-r--r-- | chromium/components/suggestions/suggestions_service_impl_unittest.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/chromium/components/suggestions/suggestions_service_impl_unittest.cc b/chromium/components/suggestions/suggestions_service_impl_unittest.cc index 2c906e3285a..a89a3ff4bb1 100644 --- a/chromium/components/suggestions/suggestions_service_impl_unittest.cc +++ b/chromium/components/suggestions/suggestions_service_impl_unittest.cc @@ -85,8 +85,9 @@ class MockSyncService : public syncer::FakeSyncService { public: MockSyncService() {} ~MockSyncService() override {} - MOCK_CONST_METHOD0(CanSyncStart, bool()); - MOCK_CONST_METHOD0(IsSyncActive, bool()); + MOCK_CONST_METHOD0(GetDisableReasons, int()); + MOCK_CONST_METHOD0(IsEngineInitialized, bool()); + MOCK_CONST_METHOD0(IsFirstSetupComplete, bool()); MOCK_CONST_METHOD0(ConfigurationDone, bool()); MOCK_CONST_METHOD0(IsLocalSyncEnabled, bool()); MOCK_CONST_METHOD0(IsUsingSecondaryPassphrase, bool()); @@ -153,10 +154,13 @@ class SuggestionsServiceTest : public testing::Test { ~SuggestionsServiceTest() override {} void SetUp() override { - EXPECT_CALL(*sync_service(), CanSyncStart()) + EXPECT_CALL(*sync_service(), GetDisableReasons()) + .Times(AnyNumber()) + .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_NONE)); + EXPECT_CALL(*sync_service(), IsEngineInitialized()) .Times(AnyNumber()) .WillRepeatedly(Return(true)); - EXPECT_CALL(*sync_service(), IsSyncActive()) + EXPECT_CALL(*sync_service(), IsFirstSetupComplete()) .Times(AnyNumber()) .WillRepeatedly(Return(true)); EXPECT_CALL(*sync_service(), ConfigurationDone()) @@ -344,7 +348,8 @@ TEST_F(SuggestionsServiceTest, IgnoresUninterestingSyncChange) { // This should *not* result in an automatic fetch. TEST_F(SuggestionsServiceTest, DoesNotFetchOnStartup) { // The sync service starts out inactive. - EXPECT_CALL(*sync_service(), IsSyncActive()).WillRepeatedly(Return(false)); + EXPECT_CALL(*sync_service(), IsEngineInitialized()) + .WillRepeatedly(Return(false)); static_cast<SyncServiceObserver*>(suggestions_service()) ->OnStateChanged(sync_service()); @@ -352,7 +357,8 @@ TEST_F(SuggestionsServiceTest, DoesNotFetchOnStartup) { ASSERT_FALSE(suggestions_service()->HasPendingRequestForTesting()); // Sync getting enabled should not result in a fetch. - EXPECT_CALL(*sync_service(), IsSyncActive()).WillRepeatedly(Return(true)); + EXPECT_CALL(*sync_service(), IsEngineInitialized()) + .WillRepeatedly(Return(true)); static_cast<SyncServiceObserver*>(suggestions_service()) ->OnStateChanged(sync_service()); @@ -385,7 +391,8 @@ TEST_F(SuggestionsServiceTest, BuildUrlWithDefaultMinZeroParamForFewFeature) { } TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncNotInitializedEnabled) { - EXPECT_CALL(*sync_service(), IsSyncActive()).WillRepeatedly(Return(false)); + EXPECT_CALL(*sync_service(), IsEngineInitialized()) + .WillRepeatedly(Return(false)); static_cast<SyncServiceObserver*>(suggestions_service()) ->OnStateChanged(sync_service()); @@ -408,7 +415,9 @@ TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncNotInitializedEnabled) { } TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncDisabled) { - EXPECT_CALL(*sync_service(), CanSyncStart()).WillRepeatedly(Return(false)); + EXPECT_CALL(*sync_service(), GetDisableReasons()) + .Times(AnyNumber()) + .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_USER_CHOICE)); base::MockCallback<SuggestionsService::ResponseCallback> callback; auto subscription = suggestions_service()->AddCallback(callback.Get()); |