| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/model_type_store_impl.h" | 5 #include "components/sync/core/model_type_store_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace syncer_v2 { | 15 namespace syncer { |
| 16 | 16 |
| 17 class ModelTypeStoreImplTest : public testing::Test { | 17 class ModelTypeStoreImplTest : public testing::Test { |
| 18 public: | 18 public: |
| 19 void TearDown() override { | 19 void TearDown() override { |
| 20 if (store_) { | 20 if (store_) { |
| 21 store_.reset(); | 21 store_.reset(); |
| 22 PumpLoop(); | 22 PumpLoop(); |
| 23 } | 23 } |
| 24 } | 24 } |
| 25 | 25 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 store()->ReadData(id_list, base::Bind(&CaptureResutRecordsAndIdList, &result, | 204 store()->ReadData(id_list, base::Bind(&CaptureResutRecordsAndIdList, &result, |
| 205 &records, &missing_id_list)); | 205 &records, &missing_id_list)); |
| 206 PumpLoop(); | 206 PumpLoop(); |
| 207 ASSERT_EQ(ModelTypeStore::Result::SUCCESS, result); | 207 ASSERT_EQ(ModelTypeStore::Result::SUCCESS, result); |
| 208 ASSERT_THAT(*records, | 208 ASSERT_THAT(*records, |
| 209 testing::UnorderedElementsAre(RecordMatches("id1", "data1"))); | 209 testing::UnorderedElementsAre(RecordMatches("id1", "data1"))); |
| 210 ASSERT_THAT(*missing_id_list, testing::UnorderedElementsAre("id3")); | 210 ASSERT_THAT(*missing_id_list, testing::UnorderedElementsAre("id3")); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace syncer_v2 | 213 } // namespace syncer |
| OLD | NEW |