| 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 "ios/chrome/browser/reading_list/reading_list_store.h" | 5 #include "components/reading_list/reading_list_store.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #import "base/test/ios/wait_util.h" | 14 #import "base/test/ios/wait_util.h" |
| 15 #include "components/reading_list/reading_list_model_impl.h" |
| 15 #include "components/sync/model/fake_model_type_change_processor.h" | 16 #include "components/sync/model/fake_model_type_change_processor.h" |
| 16 #include "components/sync/model/model_type_store_test_util.h" | 17 #include "components/sync/model/model_type_store_test_util.h" |
| 17 #include "ios/chrome/browser/reading_list/reading_list_model_impl.h" | |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 class FakeModelTypeChangeProcessorObserver { | 20 class FakeModelTypeChangeProcessorObserver { |
| 21 public: | 21 public: |
| 22 virtual void Put(const std::string& client_tag, | 22 virtual void Put(const std::string& client_tag, |
| 23 std::unique_ptr<syncer::EntityData> entity_data, | 23 std::unique_ptr<syncer::EntityData> entity_data, |
| 24 syncer::MetadataChangeList* metadata_change_list) = 0; | 24 syncer::MetadataChangeList* metadata_change_list) = 0; |
| 25 | 25 |
| 26 virtual void Delete(const std::string& client_tag, | 26 virtual void Delete(const std::string& client_tag, |
| 27 syncer::MetadataChangeList* metadata_change_list) = 0; | 27 syncer::MetadataChangeList* metadata_change_list) = 0; |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 TEST_F(ReadingListStoreTest, ApplySyncChangesOneRemove) { | 278 TEST_F(ReadingListStoreTest, ApplySyncChangesOneRemove) { |
| 279 syncer::EntityChangeList delete_changes; | 279 syncer::EntityChangeList delete_changes; |
| 280 delete_changes.push_back( | 280 delete_changes.push_back( |
| 281 syncer::EntityChange::CreateDelete("http://read.example.com/")); | 281 syncer::EntityChange::CreateDelete("http://read.example.com/")); |
| 282 syncer::SyncError error = reading_list_store_->ApplySyncChanges( | 282 syncer::SyncError error = reading_list_store_->ApplySyncChanges( |
| 283 reading_list_store_->CreateMetadataChangeList(), delete_changes); | 283 reading_list_store_->CreateMetadataChangeList(), delete_changes); |
| 284 AssertCounts(0, 0, 0, 1, 0); | 284 AssertCounts(0, 0, 0, 1, 0); |
| 285 EXPECT_EQ(sync_removed_.size(), 1u); | 285 EXPECT_EQ(sync_removed_.size(), 1u); |
| 286 EXPECT_EQ(sync_removed_.count("http://read.example.com/"), 1u); | 286 EXPECT_EQ(sync_removed_.count("http://read.example.com/"), 1u); |
| 287 } | 287 } |
| OLD | NEW |