| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 class SyncNotifierMock : public sync_notifier::SyncNotifier { | 713 class SyncNotifierMock : public sync_notifier::SyncNotifier { |
| 714 public: | 714 public: |
| 715 MOCK_METHOD1(AddObserver, void(sync_notifier::SyncNotifierObserver*)); | 715 MOCK_METHOD1(AddObserver, void(sync_notifier::SyncNotifierObserver*)); |
| 716 MOCK_METHOD1(RemoveObserver, void(sync_notifier::SyncNotifierObserver*)); | 716 MOCK_METHOD1(RemoveObserver, void(sync_notifier::SyncNotifierObserver*)); |
| 717 MOCK_METHOD1(SetUniqueId, void(const std::string&)); | 717 MOCK_METHOD1(SetUniqueId, void(const std::string&)); |
| 718 MOCK_METHOD1(SetState, void(const std::string&)); | 718 MOCK_METHOD1(SetState, void(const std::string&)); |
| 719 MOCK_METHOD2(UpdateCredentials, | 719 MOCK_METHOD2(UpdateCredentials, |
| 720 void(const std::string&, const std::string&)); | 720 void(const std::string&, const std::string&)); |
| 721 MOCK_METHOD1(UpdateEnabledTypes, | 721 MOCK_METHOD1(UpdateEnabledTypes, |
| 722 void(const syncable::ModelTypeSet&)); | 722 void(const syncable::ModelTypeSet&)); |
| 723 MOCK_METHOD0(SendNotification, void()); | 723 MOCK_METHOD1(SendNotification, void(const syncable::ModelTypeSet&)); |
| 724 }; | 724 }; |
| 725 | 725 |
| 726 class SyncManagerTest : public testing::Test, | 726 class SyncManagerTest : public testing::Test, |
| 727 public ModelSafeWorkerRegistrar { | 727 public ModelSafeWorkerRegistrar { |
| 728 protected: | 728 protected: |
| 729 SyncManagerTest() | 729 SyncManagerTest() |
| 730 : ui_thread_(BrowserThread::UI, &ui_loop_), | 730 : ui_thread_(BrowserThread::UI, &ui_loop_), |
| 731 sync_notifier_mock_(NULL), | 731 sync_notifier_mock_(NULL), |
| 732 sync_manager_("Test sync manager"), | 732 sync_manager_("Test sync manager"), |
| 733 sync_notifier_observer_(NULL), | 733 sync_notifier_observer_(NULL), |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 ReadNode node(&trans); | 1492 ReadNode node(&trans); |
| 1493 EXPECT_TRUE(node.InitByIdLookup(node1)); | 1493 EXPECT_TRUE(node.InitByIdLookup(node1)); |
| 1494 EXPECT_EQ(syncable::BOOKMARKS, node.GetModelType()); | 1494 EXPECT_EQ(syncable::BOOKMARKS, node.GetModelType()); |
| 1495 EXPECT_EQ(title, node.GetTitle()); | 1495 EXPECT_EQ(title, node.GetTitle()); |
| 1496 EXPECT_EQ(title, node.GetBookmarkSpecifics().title()); | 1496 EXPECT_EQ(title, node.GetBookmarkSpecifics().title()); |
| 1497 EXPECT_EQ(url, node.GetBookmarkSpecifics().url()); | 1497 EXPECT_EQ(url, node.GetBookmarkSpecifics().url()); |
| 1498 } | 1498 } |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 } // namespace browser_sync | 1501 } // namespace browser_sync |
| OLD | NEW |