Skip to content

Commit

Permalink
Unit test for BraveSyncServiceObserver::OnSyncSetupError
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash committed Nov 26, 2018
1 parent 9435290 commit 5a4fb10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/brave_sync/brave_sync_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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&));
};
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 5a4fb10

Please sign in to comment.