From 5a4fb10deaa1bac0f3191fe76606d999ca76d66a Mon Sep 17 00:00:00 2001 From: AlexeyBarabash Date: Fri, 23 Nov 2018 14:46:59 +0200 Subject: [PATCH] Unit test for BraveSyncServiceObserver::OnSyncSetupError --- components/brave_sync/brave_sync_service_unittest.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/brave_sync/brave_sync_service_unittest.cc b/components/brave_sync/brave_sync_service_unittest.cc index 778e9da64039..19a01c09d57a 100644 --- a/components/brave_sync/brave_sync_service_unittest.cc +++ b/components/brave_sync/brave_sync_service_unittest.cc @@ -92,6 +92,7 @@ class MockBraveSyncServiceObserver : public BraveSyncServiceObserver { public: MockBraveSyncServiceObserver() {} + MOCK_METHOD2(OnSyncSetupError, void(BraveSyncService*, const std::string&)); MOCK_METHOD1(OnSyncStateChanged, void(BraveSyncService*)); MOCK_METHOD2(OnHaveSyncWords, void(BraveSyncService*, const std::string&)); }; @@ -296,6 +297,11 @@ TEST_F(BraveSyncServiceTest, GetSyncWords) { sync_service()->OnSyncWordsPrepared(words); } +TEST_F(BraveSyncServiceTest, SyncSetupError) { + EXPECT_CALL(*observer(), OnSyncSetupError(sync_service(), _)).Times(1); + sync_service()->OnSetupSyncHaveCode("", ""); +} + TEST_F(BraveSyncServiceTest, GetSeed) { EXPECT_CALL(*sync_client(), OnSyncEnabledChanged); EXPECT_CALL(*observer(), OnSyncStateChanged(sync_service())).Times(AtLeast(2));