| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/sync/core/test/model_type_store_test_util.h" | 5 #include "components/sync/core/test/model_type_store_test_util.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace syncer_v2 { | 13 namespace syncer { |
| 14 | 14 |
| 15 using Result = ModelTypeStore::Result; | 15 using Result = ModelTypeStore::Result; |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 void MoveStoreToScopedPtr(std::unique_ptr<ModelTypeStore>* out_store, | 19 void MoveStoreToScopedPtr(std::unique_ptr<ModelTypeStore>* out_store, |
| 20 Result result, | 20 Result result, |
| 21 std::unique_ptr<ModelTypeStore> in_store) { | 21 std::unique_ptr<ModelTypeStore> in_store) { |
| 22 ASSERT_EQ(Result::SUCCESS, result); | 22 ASSERT_EQ(Result::SUCCESS, result); |
| 23 std::swap(*out_store, in_store); | 23 std::swap(*out_store, in_store); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 void ModelTypeStoreTestUtil::MoveStoreToCallback( | 43 void ModelTypeStoreTestUtil::MoveStoreToCallback( |
| 44 std::unique_ptr<ModelTypeStore> store, | 44 std::unique_ptr<ModelTypeStore> store, |
| 45 const ModelTypeStore::InitCallback& callback) { | 45 const ModelTypeStore::InitCallback& callback) { |
| 46 ASSERT_TRUE(store); | 46 ASSERT_TRUE(store); |
| 47 callback.Run(Result::SUCCESS, std::move(store)); | 47 callback.Run(Result::SUCCESS, std::move(store)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace syncer_v2 | 50 } // namespace syncer |
| OLD | NEW |