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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 return new TestHttpPostProviderInterface(); | 669 return new TestHttpPostProviderInterface(); |
670 } | 670 } |
671 virtual void Destroy(HttpPostProviderInterface* http) OVERRIDE { | 671 virtual void Destroy(HttpPostProviderInterface* http) OVERRIDE { |
672 delete http; | 672 delete http; |
673 } | 673 } |
674 }; | 674 }; |
675 | 675 |
676 class SyncManagerObserverMock : public SyncManager::Observer { | 676 class SyncManagerObserverMock : public SyncManager::Observer { |
677 public: | 677 public: |
678 MOCK_METHOD1(OnSyncCycleCompleted, | 678 MOCK_METHOD1(OnSyncCycleCompleted, |
679 void(const SyncSessionSnapshot*)); // NOLINT | 679 void(const SyncSessionSnapshot&)); // NOLINT |
680 MOCK_METHOD2(OnInitializationComplete, | 680 MOCK_METHOD2(OnInitializationComplete, |
681 void(const WeakHandle<JsBackend>&, bool)); // NOLINT | 681 void(const WeakHandle<JsBackend>&, bool)); // NOLINT |
682 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); // NOLINT | 682 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); // NOLINT |
683 MOCK_METHOD2(OnPassphraseRequired, | 683 MOCK_METHOD2(OnPassphraseRequired, |
684 void(sync_api::PassphraseRequiredReason, | 684 void(sync_api::PassphraseRequiredReason, |
685 const sync_pb::EncryptedData&)); // NOLINT | 685 const sync_pb::EncryptedData&)); // NOLINT |
686 MOCK_METHOD0(OnPassphraseAccepted, void()); // NOLINT | 686 MOCK_METHOD0(OnPassphraseAccepted, void()); // NOLINT |
687 MOCK_METHOD1(OnBootstrapTokenUpdated, void(const std::string&)); // NOLINT | 687 MOCK_METHOD1(OnBootstrapTokenUpdated, void(const std::string&)); // NOLINT |
688 MOCK_METHOD0(OnStopSyncingPermanently, void()); // NOLINT | 688 MOCK_METHOD0(OnStopSyncingPermanently, void()); // NOLINT |
689 MOCK_METHOD1(OnUpdatedToken, void(const std::string&)); // NOLINT | 689 MOCK_METHOD1(OnUpdatedToken, void(const std::string&)); // NOLINT |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 EXPECT_EQ(title, node.GetTitle()); | 2510 EXPECT_EQ(title, node.GetTitle()); |
2511 EXPECT_EQ(GURL(url2), node.GetURL()); | 2511 EXPECT_EQ(GURL(url2), node.GetURL()); |
2512 const syncable::Entry* node_entry = node.GetEntry(); | 2512 const syncable::Entry* node_entry = node.GetEntry(); |
2513 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); | 2513 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); |
2514 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); | 2514 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); |
2515 EXPECT_TRUE(specifics.has_encrypted()); | 2515 EXPECT_TRUE(specifics.has_encrypted()); |
2516 } | 2516 } |
2517 } | 2517 } |
2518 | 2518 |
2519 } // namespace browser_sync | 2519 } // namespace browser_sync |
OLD | NEW |