| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/sync/core_impl/sync_manager_impl.h" | 9 #include "components/sync/core_impl/sync_manager_impl.h" |
| 10 | 10 |
| 11 #include <stdint.h> | |
| 12 | |
| 13 #include <cstddef> | 11 #include <cstddef> |
| 14 #include <map> | |
| 15 #include <memory> | 12 #include <memory> |
| 16 #include <utility> | 13 #include <utility> |
| 17 | 14 |
| 18 #include "base/callback.h" | 15 #include "base/callback.h" |
| 19 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 20 #include "base/files/scoped_temp_dir.h" | 17 #include "base/files/scoped_temp_dir.h" |
| 21 #include "base/format_macros.h" | 18 #include "base/format_macros.h" |
| 22 #include "base/location.h" | 19 #include "base/location.h" |
| 23 #include "base/run_loop.h" | 20 #include "base/run_loop.h" |
| 24 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| 26 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 27 #include "base/test/values_test_util.h" | 24 #include "base/test/values_test_util.h" |
| 28 #include "base/values.h" | 25 #include "base/values.h" |
| 29 #include "components/sync/base/attachment_id_proto.h" | 26 #include "components/sync/base/attachment_id_proto.h" |
| 30 #include "components/sync/base/cancelation_signal.h" | 27 #include "components/sync/base/cancelation_signal.h" |
| 31 #include "components/sync/base/cryptographer.h" | |
| 32 #include "components/sync/base/extensions_activity.h" | 28 #include "components/sync/base/extensions_activity.h" |
| 33 #include "components/sync/base/fake_encryptor.h" | 29 #include "components/sync/base/fake_encryptor.h" |
| 34 #include "components/sync/base/mock_unrecoverable_error_handler.h" | 30 #include "components/sync/base/mock_unrecoverable_error_handler.h" |
| 35 #include "components/sync/base/model_type_test_util.h" | 31 #include "components/sync/base/model_type_test_util.h" |
| 36 #include "components/sync/base/time.h" | |
| 37 #include "components/sync/core/change_record.h" | 32 #include "components/sync/core/change_record.h" |
| 38 #include "components/sync/core/http_post_provider_factory.h" | 33 #include "components/sync/core/http_post_provider_factory.h" |
| 39 #include "components/sync/core/http_post_provider_interface.h" | 34 #include "components/sync/core/http_post_provider_interface.h" |
| 40 #include "components/sync/core/read_node.h" | 35 #include "components/sync/core/read_node.h" |
| 41 #include "components/sync/core/read_transaction.h" | 36 #include "components/sync/core/read_transaction.h" |
| 42 #include "components/sync/core/test/test_entry_factory.h" | 37 #include "components/sync/core/test/test_entry_factory.h" |
| 43 #include "components/sync/core/test/test_internal_components_factory.h" | 38 #include "components/sync/core/test/test_internal_components_factory.h" |
| 44 #include "components/sync/core/test/test_user_share.h" | 39 #include "components/sync/core/test/test_user_share.h" |
| 45 #include "components/sync/core/write_node.h" | 40 #include "components/sync/core/write_node.h" |
| 46 #include "components/sync/core/write_transaction.h" | 41 #include "components/sync/core/write_transaction.h" |
| 47 #include "components/sync/core_impl/sync_encryption_handler_impl.h" | |
| 48 #include "components/sync/core_impl/syncapi_internal.h" | 42 #include "components/sync/core_impl/syncapi_internal.h" |
| 49 #include "components/sync/engine/events/protocol_event.h" | 43 #include "components/sync/engine/events/protocol_event.h" |
| 50 #include "components/sync/engine/model_safe_worker.h" | 44 #include "components/sync/engine/model_safe_worker.h" |
| 51 #include "components/sync/engine/polling_constants.h" | 45 #include "components/sync/engine/polling_constants.h" |
| 52 #include "components/sync/engine_impl/cycle/sync_cycle.h" | 46 #include "components/sync/engine_impl/cycle/sync_cycle.h" |
| 53 #include "components/sync/engine_impl/sync_scheduler.h" | 47 #include "components/sync/engine_impl/sync_scheduler.h" |
| 54 #include "components/sync/js/js_backend.h" | |
| 55 #include "components/sync/js/js_event_handler.h" | 48 #include "components/sync/js/js_event_handler.h" |
| 56 #include "components/sync/js/js_test_util.h" | 49 #include "components/sync/js/js_test_util.h" |
| 57 #include "components/sync/protocol/bookmark_specifics.pb.h" | 50 #include "components/sync/protocol/bookmark_specifics.pb.h" |
| 58 #include "components/sync/protocol/encryption.pb.h" | 51 #include "components/sync/protocol/encryption.pb.h" |
| 59 #include "components/sync/protocol/extension_specifics.pb.h" | 52 #include "components/sync/protocol/extension_specifics.pb.h" |
| 60 #include "components/sync/protocol/password_specifics.pb.h" | 53 #include "components/sync/protocol/password_specifics.pb.h" |
| 61 #include "components/sync/protocol/preference_specifics.pb.h" | 54 #include "components/sync/protocol/preference_specifics.pb.h" |
| 62 #include "components/sync/protocol/proto_value_conversions.h" | 55 #include "components/sync/protocol/proto_value_conversions.h" |
| 63 #include "components/sync/protocol/sync.pb.h" | 56 #include "components/sync/protocol/sync.pb.h" |
| 64 #include "components/sync/syncable/directory.h" | 57 #include "components/sync/syncable/directory.h" |
| (...skipping 3294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3359 // SyncManagerInitInvalidStorageTest::GetFactory will return | 3352 // SyncManagerInitInvalidStorageTest::GetFactory will return |
| 3360 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. | 3353 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. |
| 3361 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's | 3354 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's |
| 3362 // task is to ensure that SyncManagerImpl reported initialization failure in | 3355 // task is to ensure that SyncManagerImpl reported initialization failure in |
| 3363 // OnInitializationComplete callback. | 3356 // OnInitializationComplete callback. |
| 3364 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { | 3357 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { |
| 3365 EXPECT_FALSE(initialization_succeeded_); | 3358 EXPECT_FALSE(initialization_succeeded_); |
| 3366 } | 3359 } |
| 3367 | 3360 |
| 3368 } // namespace syncer | 3361 } // namespace syncer |
| OLD | NEW |