| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 MOCK_METHOD2(OnInitializationComplete, | 691 MOCK_METHOD2(OnInitializationComplete, |
| 692 void(const WeakHandle<JsBackend>&, bool)); // NOLINT | 692 void(const WeakHandle<JsBackend>&, bool)); // NOLINT |
| 693 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); // NOLINT | 693 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); // NOLINT |
| 694 MOCK_METHOD2(OnPassphraseRequired, | 694 MOCK_METHOD2(OnPassphraseRequired, |
| 695 void(sync_api::PassphraseRequiredReason, | 695 void(sync_api::PassphraseRequiredReason, |
| 696 const sync_pb::EncryptedData&)); // NOLINT | 696 const sync_pb::EncryptedData&)); // NOLINT |
| 697 MOCK_METHOD0(OnPassphraseAccepted, void()); // NOLINT | 697 MOCK_METHOD0(OnPassphraseAccepted, void()); // NOLINT |
| 698 MOCK_METHOD1(OnBootstrapTokenUpdated, void(const std::string&)); // NOLINT | 698 MOCK_METHOD1(OnBootstrapTokenUpdated, void(const std::string&)); // NOLINT |
| 699 MOCK_METHOD0(OnStopSyncingPermanently, void()); // NOLINT | 699 MOCK_METHOD0(OnStopSyncingPermanently, void()); // NOLINT |
| 700 MOCK_METHOD1(OnUpdatedToken, void(const std::string&)); // NOLINT | 700 MOCK_METHOD1(OnUpdatedToken, void(const std::string&)); // NOLINT |
| 701 MOCK_METHOD0(OnClearServerDataFailed, void()); // NOLINT | |
| 702 MOCK_METHOD0(OnClearServerDataSucceeded, void()); // NOLINT | |
| 703 MOCK_METHOD2(OnEncryptedTypesChanged, | 701 MOCK_METHOD2(OnEncryptedTypesChanged, |
| 704 void(ModelTypeSet, bool)); // NOLINT | 702 void(ModelTypeSet, bool)); // NOLINT |
| 705 MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT | 703 MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT |
| 706 MOCK_METHOD1(OnActionableError, | 704 MOCK_METHOD1(OnActionableError, |
| 707 void(const browser_sync::SyncProtocolError&)); // NOLINT | 705 void(const browser_sync::SyncProtocolError&)); // NOLINT |
| 708 }; | 706 }; |
| 709 | 707 |
| 710 class SyncNotifierMock : public sync_notifier::SyncNotifier { | 708 class SyncNotifierMock : public sync_notifier::SyncNotifier { |
| 711 public: | 709 public: |
| 712 MOCK_METHOD1(AddObserver, void(sync_notifier::SyncNotifierObserver*)); | 710 MOCK_METHOD1(AddObserver, void(sync_notifier::SyncNotifierObserver*)); |
| (...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2504 EXPECT_EQ(title, node.GetTitle()); | 2502 EXPECT_EQ(title, node.GetTitle()); |
| 2505 EXPECT_EQ(GURL(url2), node.GetURL()); | 2503 EXPECT_EQ(GURL(url2), node.GetURL()); |
| 2506 const syncable::Entry* node_entry = node.GetEntry(); | 2504 const syncable::Entry* node_entry = node.GetEntry(); |
| 2507 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); | 2505 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); |
| 2508 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); | 2506 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); |
| 2509 EXPECT_TRUE(specifics.has_encrypted()); | 2507 EXPECT_TRUE(specifics.has_encrypted()); |
| 2510 } | 2508 } |
| 2511 } | 2509 } |
| 2512 | 2510 |
| 2513 } // namespace browser_sync | 2511 } // namespace browser_sync |
| OLD | NEW |