| 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 16 matching lines...) Expand all Loading... |
| 27 #include "sync/internal_api/public/base/model_type_test_util.h" | 27 #include "sync/internal_api/public/base/model_type_test_util.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/test/test_internal_components_factory.h" | 35 #include "sync/internal_api/public/test/test_internal_components_factory.h" |
| 36 #include "sync/internal_api/public/test/test_user_share.h" | 36 #include "sync/internal_api/public/test/test_user_share.h" |
| 37 #include "sync/internal_api/public/util/time.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/sync_encryption_handler_impl.h" | 40 #include "sync/internal_api/sync_encryption_handler_impl.h" |
| 40 #include "sync/internal_api/sync_manager_impl.h" | 41 #include "sync/internal_api/sync_manager_impl.h" |
| 41 #include "sync/internal_api/syncapi_internal.h" | 42 #include "sync/internal_api/syncapi_internal.h" |
| 42 #include "sync/js/js_arg_list.h" | 43 #include "sync/js/js_arg_list.h" |
| 43 #include "sync/js/js_backend.h" | 44 #include "sync/js/js_backend.h" |
| 44 #include "sync/js/js_event_handler.h" | 45 #include "sync/js/js_event_handler.h" |
| 45 #include "sync/js/js_reply_handler.h" | 46 #include "sync/js/js_reply_handler.h" |
| 46 #include "sync/js/js_test_util.h" | 47 #include "sync/js/js_test_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 62 #include "sync/syncable/nigori_util.h" | 63 #include "sync/syncable/nigori_util.h" |
| 63 #include "sync/syncable/syncable_id.h" | 64 #include "sync/syncable/syncable_id.h" |
| 64 #include "sync/syncable/write_transaction.h" | 65 #include "sync/syncable/write_transaction.h" |
| 65 #include "sync/test/callback_counter.h" | 66 #include "sync/test/callback_counter.h" |
| 66 #include "sync/test/engine/fake_sync_scheduler.h" | 67 #include "sync/test/engine/fake_sync_scheduler.h" |
| 67 #include "sync/test/fake_encryptor.h" | 68 #include "sync/test/fake_encryptor.h" |
| 68 #include "sync/test/fake_extensions_activity_monitor.h" | 69 #include "sync/test/fake_extensions_activity_monitor.h" |
| 69 #include "sync/util/cryptographer.h" | 70 #include "sync/util/cryptographer.h" |
| 70 #include "sync/util/extensions_activity_monitor.h" | 71 #include "sync/util/extensions_activity_monitor.h" |
| 71 #include "sync/util/test_unrecoverable_error_handler.h" | 72 #include "sync/util/test_unrecoverable_error_handler.h" |
| 72 #include "sync/util/time.h" | |
| 73 #include "testing/gmock/include/gmock/gmock.h" | 73 #include "testing/gmock/include/gmock/gmock.h" |
| 74 #include "testing/gtest/include/gtest/gtest.h" | 74 #include "testing/gtest/include/gtest/gtest.h" |
| 75 | 75 |
| 76 using base::ExpectDictStringValue; | 76 using base::ExpectDictStringValue; |
| 77 using testing::_; | 77 using testing::_; |
| 78 using testing::DoAll; | 78 using testing::DoAll; |
| 79 using testing::InSequence; | 79 using testing::InSequence; |
| 80 using testing::Return; | 80 using testing::Return; |
| 81 using testing::SaveArg; | 81 using testing::SaveArg; |
| 82 using testing::StrictMock; | 82 using testing::StrictMock; |
| (...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2884 | 2884 |
| 2885 // Verify only the non-disabled types remain after cleanup. | 2885 // Verify only the non-disabled types remain after cleanup. |
| 2886 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); | 2886 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); |
| 2887 EXPECT_TRUE(new_enabled_types.Equals( | 2887 EXPECT_TRUE(new_enabled_types.Equals( |
| 2888 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); | 2888 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); |
| 2889 EXPECT_TRUE(disabled_types.Equals( | 2889 EXPECT_TRUE(disabled_types.Equals( |
| 2890 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); | 2890 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); |
| 2891 } | 2891 } |
| 2892 | 2892 |
| 2893 } // namespace | 2893 } // namespace |
| OLD | NEW |