| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "sync/internal_api/sync_rollback_manager_base.h" | 5 #include "sync/internal_api/sync_rollback_manager_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "sync/internal_api/public/read_node.h" | 8 #include "sync/internal_api/public/read_node.h" |
| 9 #include "sync/internal_api/public/read_transaction.h" | 9 #include "sync/internal_api/public/read_transaction.h" |
| 10 #include "sync/internal_api/public/test/test_internal_components_factory.h" | 10 #include "sync/internal_api/public/test/test_internal_components_factory.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 ChangeDelegate* change_delegate, | 31 ChangeDelegate* change_delegate, |
| 32 const SyncCredentials& credentials, | 32 const SyncCredentials& credentials, |
| 33 const std::string& invalidator_client_id, | 33 const std::string& invalidator_client_id, |
| 34 const std::string& restored_key_for_bootstrapping, | 34 const std::string& restored_key_for_bootstrapping, |
| 35 const std::string& restored_keystore_key_for_bootstrapping, | 35 const std::string& restored_keystore_key_for_bootstrapping, |
| 36 InternalComponentsFactory* internal_components_factory, | 36 InternalComponentsFactory* internal_components_factory, |
| 37 Encryptor* encryptor, | 37 Encryptor* encryptor, |
| 38 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, | 38 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, |
| 39 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, | 39 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, |
| 40 CancelationSignal* cancelation_signal) OVERRIDE { | 40 CancelationSignal* cancelation_signal) OVERRIDE { |
| 41 SyncRollbackManagerBase::InitInternal(database_location, | 41 SyncRollbackManagerBase::InitInternal( |
| 42 internal_components_factory, | 42 database_location, |
| 43 unrecoverable_error_handler.Pass(), | 43 internal_components_factory, |
| 44 report_unrecoverable_error_function); | 44 InternalComponentsFactory::STORAGE_IN_MEMORY, |
| 45 unrecoverable_error_handler.Pass(), |
| 46 report_unrecoverable_error_function); |
| 45 } | 47 } |
| 46 }; | 48 }; |
| 47 | 49 |
| 48 class SyncRollbackManagerBaseTest : public testing::Test { | 50 class SyncRollbackManagerBaseTest : public testing::Test { |
| 49 protected: | 51 protected: |
| 50 virtual void SetUp() OVERRIDE { | 52 virtual void SetUp() OVERRIDE { |
| 51 TestInternalComponentsFactory factory(InternalComponentsFactory::Switches(), | 53 TestInternalComponentsFactory factory( |
| 52 STORAGE_IN_MEMORY); | 54 InternalComponentsFactory::Switches(), |
| 55 InternalComponentsFactory::STORAGE_IN_MEMORY, |
| 56 InternalComponentsFactory::STORAGE_IN_MEMORY); |
| 53 manager_.Init(base::FilePath(base::FilePath::kCurrentDirectory), | 57 manager_.Init(base::FilePath(base::FilePath::kCurrentDirectory), |
| 54 MakeWeakHandle(base::WeakPtr<JsEventHandler>()), | 58 MakeWeakHandle(base::WeakPtr<JsEventHandler>()), |
| 55 GURL("https://example.com/"), | 59 GURL("https://example.com/"), |
| 56 scoped_ptr<HttpPostProviderFactory>().Pass(), | 60 scoped_ptr<HttpPostProviderFactory>().Pass(), |
| 57 std::vector<scoped_refptr<ModelSafeWorker> >(), | 61 std::vector<scoped_refptr<ModelSafeWorker> >(), |
| 58 NULL, | 62 NULL, |
| 59 NULL, | 63 NULL, |
| 60 SyncCredentials(), | 64 SyncCredentials(), |
| 61 "", | 65 "", |
| 62 "", | 66 "", |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_NOT_GOOD, | 101 EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_NOT_GOOD, |
| 98 bookmark_mobile.InitByTagLookupForBookmarks("synced_bookmarks")); | 102 bookmark_mobile.InitByTagLookupForBookmarks("synced_bookmarks")); |
| 99 ReadNode bookmark_other(&trans); | 103 ReadNode bookmark_other(&trans); |
| 100 EXPECT_EQ(BaseNode::INIT_OK, | 104 EXPECT_EQ(BaseNode::INIT_OK, |
| 101 bookmark_other.InitByTagLookupForBookmarks("other_bookmarks")); | 105 bookmark_other.InitByTagLookupForBookmarks("other_bookmarks")); |
| 102 } | 106 } |
| 103 | 107 |
| 104 } // anonymous namespace | 108 } // anonymous namespace |
| 105 | 109 |
| 106 } // namespace syncer | 110 } // namespace syncer |
| OLD | NEW |