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.h" | 5 #include "sync/internal_api/sync_rollback_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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 EXPECT_TRUE(expected_deletes_ == deleted); | 62 EXPECT_TRUE(expected_deletes_ == deleted); |
63 } | 63 } |
64 | 64 |
65 std::set<int64> expected_deletes_; | 65 std::set<int64> expected_deletes_; |
66 }; | 66 }; |
67 | 67 |
68 class SyncRollbackManagerTest : public testing::Test, | 68 class SyncRollbackManagerTest : public testing::Test, |
69 public SyncManager::Observer { | 69 public SyncManager::Observer { |
70 protected: | 70 protected: |
71 virtual void SetUp() override { | 71 void SetUp() override { |
72 CHECK(temp_dir_.CreateUniqueTempDir()); | 72 CHECK(temp_dir_.CreateUniqueTempDir()); |
73 | 73 |
74 worker_ = new FakeModelWorker(GROUP_UI); | 74 worker_ = new FakeModelWorker(GROUP_UI); |
75 } | 75 } |
76 | 76 |
77 MOCK_METHOD1(OnSyncCycleCompleted, | 77 MOCK_METHOD1(OnSyncCycleCompleted, |
78 void(const sessions::SyncSessionSnapshot&)); | 78 void(const sessions::SyncSessionSnapshot&)); |
79 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); | 79 MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); |
80 MOCK_METHOD4(OnInitializationComplete, | 80 MOCK_METHOD4(OnInitializationComplete, |
81 void(const WeakHandle<JsBackend>&, | 81 void(const WeakHandle<JsBackend>&, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // Test graceful shutdown on initialization failure. | 259 // Test graceful shutdown on initialization failure. |
260 scoped_ptr<SyncRollbackManager> rollback_manager( | 260 scoped_ptr<SyncRollbackManager> rollback_manager( |
261 new SyncRollbackManager); | 261 new SyncRollbackManager); |
262 InitManager(rollback_manager.get(), ModelTypeSet(PREFERENCES), NULL, | 262 InitManager(rollback_manager.get(), ModelTypeSet(PREFERENCES), NULL, |
263 InternalComponentsFactory::STORAGE_ON_DISK); | 263 InternalComponentsFactory::STORAGE_ON_DISK); |
264 } | 264 } |
265 | 265 |
266 } // anonymous namespace | 266 } // anonymous namespace |
267 | 267 |
268 } // namespace syncer | 268 } // namespace syncer |
OLD | NEW |