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_backup_manager.h" | 5 #include "sync/internal_api/sync_backup_manager.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "sync/internal_api/public/read_node.h" | 9 #include "sync/internal_api/public/read_node.h" |
10 #include "sync/internal_api/public/read_transaction.h" | 10 #include "sync/internal_api/public/read_transaction.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); | 38 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); |
39 MOCK_METHOD1(OnActionableError, void(const SyncProtocolError&)); | 39 MOCK_METHOD1(OnActionableError, void(const SyncProtocolError&)); |
40 MOCK_METHOD1(OnMigrationRequested, void(ModelTypeSet));; | 40 MOCK_METHOD1(OnMigrationRequested, void(ModelTypeSet));; |
41 MOCK_METHOD1(OnProtocolEvent, void(const ProtocolEvent&)); | 41 MOCK_METHOD1(OnProtocolEvent, void(const ProtocolEvent&)); |
42 MOCK_METHOD4(OnInitializationComplete, | 42 MOCK_METHOD4(OnInitializationComplete, |
43 void(const WeakHandle<JsBackend>&, | 43 void(const WeakHandle<JsBackend>&, |
44 const WeakHandle<DataTypeDebugInfoListener>&, | 44 const WeakHandle<DataTypeDebugInfoListener>&, |
45 bool, ModelTypeSet)); | 45 bool, ModelTypeSet)); |
46 | 46 |
47 protected: | 47 protected: |
48 virtual void SetUp() override { | 48 void SetUp() override { |
49 CHECK(temp_dir_.CreateUniqueTempDir()); | 49 CHECK(temp_dir_.CreateUniqueTempDir()); |
50 } | 50 } |
51 | 51 |
52 void InitManager(SyncManager* manager, | 52 void InitManager(SyncManager* manager, |
53 InternalComponentsFactory::StorageOption storage_option) { | 53 InternalComponentsFactory::StorageOption storage_option) { |
54 manager_ = manager; | 54 manager_ = manager; |
55 EXPECT_CALL(*this, OnInitializationComplete(_, _, _, _)) | 55 EXPECT_CALL(*this, OnInitializationComplete(_, _, _, _)) |
56 .WillOnce(WithArgs<2>(Invoke(this, | 56 .WillOnce(WithArgs<2>(Invoke(this, |
57 &SyncBackupManagerTest::HandleInit))); | 57 &SyncBackupManagerTest::HandleInit))); |
58 | 58 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 TEST_F(SyncBackupManagerTest, FailToInitialize) { | 177 TEST_F(SyncBackupManagerTest, FailToInitialize) { |
178 // Test graceful shutdown on initialization failure. | 178 // Test graceful shutdown on initialization failure. |
179 scoped_ptr<SyncBackupManager> manager(new SyncBackupManager); | 179 scoped_ptr<SyncBackupManager> manager(new SyncBackupManager); |
180 InitManager(manager.get(), InternalComponentsFactory::STORAGE_INVALID); | 180 InitManager(manager.get(), InternalComponentsFactory::STORAGE_INVALID); |
181 } | 181 } |
182 | 182 |
183 } // anonymous namespace | 183 } // anonymous namespace |
184 | 184 |
185 } // namespace syncer | 185 } // namespace syncer |
OLD | NEW |