| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Unit tests for the SyncApi. Note that a lot of the underlying | 5 // Unit tests for the SyncApi. Note that a lot of the underlying |
| 6 // functionality is provided by the Syncable layer, which has its own | 6 // functionality is provided by the Syncable layer, which has its own |
| 7 // unit tests. We'll test SyncApi specific things in this harness. | 7 // unit tests. We'll test SyncApi specific things in this harness. |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 const sync_pb::EncryptedData&)); // NOLINT | 810 const sync_pb::EncryptedData&)); // NOLINT |
| 811 MOCK_METHOD0(OnPassphraseAccepted, void()); // NOLINT | 811 MOCK_METHOD0(OnPassphraseAccepted, void()); // NOLINT |
| 812 MOCK_METHOD2(OnBootstrapTokenUpdated, | 812 MOCK_METHOD2(OnBootstrapTokenUpdated, |
| 813 void(const std::string&, BootstrapTokenType type)); // NOLINT | 813 void(const std::string&, BootstrapTokenType type)); // NOLINT |
| 814 MOCK_METHOD2(OnEncryptedTypesChanged, | 814 MOCK_METHOD2(OnEncryptedTypesChanged, |
| 815 void(ModelTypeSet, bool)); // NOLINT | 815 void(ModelTypeSet, bool)); // NOLINT |
| 816 MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT | 816 MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT |
| 817 MOCK_METHOD1(OnCryptographerStateChanged, void(Cryptographer*)); // NOLINT | 817 MOCK_METHOD1(OnCryptographerStateChanged, void(Cryptographer*)); // NOLINT |
| 818 MOCK_METHOD2(OnPassphraseTypeChanged, void(PassphraseType, | 818 MOCK_METHOD2(OnPassphraseTypeChanged, void(PassphraseType, |
| 819 base::Time)); // NOLINT | 819 base::Time)); // NOLINT |
| 820 MOCK_METHOD1(OnLocalSetCustomPassphrase, |
| 821 void(const SyncEncryptionHandler::NigoriState&)); // NOLINT |
| 820 }; | 822 }; |
| 821 | 823 |
| 822 } // namespace | 824 } // namespace |
| 823 | 825 |
| 824 class SyncManagerTest : public testing::Test, | 826 class SyncManagerTest : public testing::Test, |
| 825 public SyncManager::ChangeDelegate { | 827 public SyncManager::ChangeDelegate { |
| 826 protected: | 828 protected: |
| 827 enum NigoriStatus { | 829 enum NigoriStatus { |
| 828 DONT_WRITE_NIGORI, | 830 DONT_WRITE_NIGORI, |
| 829 WRITE_TO_NIGORI | 831 WRITE_TO_NIGORI |
| (...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 // SyncManagerInitInvalidStorageTest::GetFactory will return | 3228 // SyncManagerInitInvalidStorageTest::GetFactory will return |
| 3227 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. | 3229 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. |
| 3228 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's | 3230 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's |
| 3229 // task is to ensure that SyncManagerImpl reported initialization failure in | 3231 // task is to ensure that SyncManagerImpl reported initialization failure in |
| 3230 // OnInitializationComplete callback. | 3232 // OnInitializationComplete callback. |
| 3231 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { | 3233 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { |
| 3232 EXPECT_FALSE(initialization_succeeded_); | 3234 EXPECT_FALSE(initialization_succeeded_); |
| 3233 } | 3235 } |
| 3234 | 3236 |
| 3235 } // namespace syncer | 3237 } // namespace syncer |
| OLD | NEW |