| 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 15 matching lines...) Expand all Loading... |
| 26 #include "sync/internal_api/public/base/model_type_test_util.h" | 26 #include "sync/internal_api/public/base/model_type_test_util.h" |
| 27 #include "sync/engine/sync_scheduler.h" | 27 #include "sync/engine/sync_scheduler.h" |
| 28 #include "sync/internal_api/public/change_record.h" | 28 #include "sync/internal_api/public/change_record.h" |
| 29 #include "sync/internal_api/public/engine/model_safe_worker.h" | 29 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 30 #include "sync/internal_api/public/engine/polling_constants.h" | 30 #include "sync/internal_api/public/engine/polling_constants.h" |
| 31 #include "sync/internal_api/public/http_post_provider_factory.h" | 31 #include "sync/internal_api/public/http_post_provider_factory.h" |
| 32 #include "sync/internal_api/public/http_post_provider_interface.h" | 32 #include "sync/internal_api/public/http_post_provider_interface.h" |
| 33 #include "sync/internal_api/public/read_node.h" | 33 #include "sync/internal_api/public/read_node.h" |
| 34 #include "sync/internal_api/public/read_transaction.h" | 34 #include "sync/internal_api/public/read_transaction.h" |
| 35 #include "sync/internal_api/public/sync_manager.h" | 35 #include "sync/internal_api/public/sync_manager.h" |
| 36 #include "sync/internal_api/public/test/test_internal_components_factory.h" |
| 36 #include "sync/internal_api/public/test/test_user_share.h" | 37 #include "sync/internal_api/public/test/test_user_share.h" |
| 37 #include "sync/internal_api/public/write_node.h" | 38 #include "sync/internal_api/public/write_node.h" |
| 38 #include "sync/internal_api/public/write_transaction.h" | 39 #include "sync/internal_api/public/write_transaction.h" |
| 39 #include "sync/internal_api/syncapi_internal.h" | 40 #include "sync/internal_api/syncapi_internal.h" |
| 40 #include "sync/js/js_arg_list.h" | 41 #include "sync/js/js_arg_list.h" |
| 41 #include "sync/js/js_backend.h" | 42 #include "sync/js/js_backend.h" |
| 42 #include "sync/js/js_event_handler.h" | 43 #include "sync/js/js_event_handler.h" |
| 43 #include "sync/js/js_reply_handler.h" | 44 #include "sync/js/js_reply_handler.h" |
| 44 #include "sync/js/js_test_util.h" | 45 #include "sync/js/js_test_util.h" |
| 45 #include "sync/notifier/sync_notifier.h" | 46 #include "sync/notifier/sync_notifier.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 | 766 |
| 766 // Takes ownership of |sync_notifier_mock_|. | 767 // Takes ownership of |sync_notifier_mock_|. |
| 767 sync_manager_.Init(temp_dir_.path(), | 768 sync_manager_.Init(temp_dir_.path(), |
| 768 WeakHandle<JsEventHandler>(), | 769 WeakHandle<JsEventHandler>(), |
| 769 "bogus", 0, false, | 770 "bogus", 0, false, |
| 770 base::MessageLoopProxy::current(), | 771 base::MessageLoopProxy::current(), |
| 771 new TestHttpPostProviderFactory(), routing_info, workers, | 772 new TestHttpPostProviderFactory(), routing_info, workers, |
| 772 &extensions_activity_monitor_, this, | 773 &extensions_activity_monitor_, this, |
| 773 credentials, | 774 credentials, |
| 774 sync_notifier_mock_, "", | 775 sync_notifier_mock_, "", |
| 775 syncer::SyncManager::TEST_IN_MEMORY, | 776 scoped_ptr<InternalComponentsFactory>( |
| 777 new TestInternalComponentsFactory( |
| 778 TestInternalComponentsFactory::IN_MEMORY)), |
| 776 &encryptor_, | 779 &encryptor_, |
| 777 &handler_, | 780 &handler_, |
| 778 NULL); | 781 NULL); |
| 779 | 782 |
| 780 EXPECT_TRUE(sync_notifier_observer_); | 783 EXPECT_TRUE(sync_notifier_observer_); |
| 781 EXPECT_TRUE(js_backend_.IsInitialized()); | 784 EXPECT_TRUE(js_backend_.IsInitialized()); |
| 782 | 785 |
| 783 EXPECT_EQ(0, update_enabled_types_call_count_); | 786 EXPECT_EQ(0, update_enabled_types_call_count_); |
| 784 | 787 |
| 785 for (ModelSafeRoutingInfo::iterator i = routing_info.begin(); | 788 for (ModelSafeRoutingInfo::iterator i = routing_info.begin(); |
| (...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2603 // Ensure only bookmarks and nigori lost their progress marker. Preferences | 2606 // Ensure only bookmarks and nigori lost their progress marker. Preferences |
| 2604 // should still have it. | 2607 // should still have it. |
| 2605 partial_types = | 2608 partial_types = |
| 2606 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()); | 2609 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()); |
| 2607 EXPECT_TRUE(partial_types.Has(NIGORI)); | 2610 EXPECT_TRUE(partial_types.Has(NIGORI)); |
| 2608 EXPECT_TRUE(partial_types.Has(BOOKMARKS)); | 2611 EXPECT_TRUE(partial_types.Has(BOOKMARKS)); |
| 2609 EXPECT_FALSE(partial_types.Has(PREFERENCES)); | 2612 EXPECT_FALSE(partial_types.Has(PREFERENCES)); |
| 2610 } | 2613 } |
| 2611 | 2614 |
| 2612 } // namespace | 2615 } // namespace |
| OLD | NEW |