OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/dom_distiller/core/dom_distiller_store.h" | 5 #include "components/dom_distiller/core/dom_distiller_store.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 using testing::AssertionSuccess; | 40 using testing::AssertionSuccess; |
41 using testing::SaveArgPointee; | 41 using testing::SaveArgPointee; |
42 using testing::_; | 42 using testing::_; |
43 | 43 |
44 namespace dom_distiller { | 44 namespace dom_distiller { |
45 | 45 |
46 namespace { | 46 namespace { |
47 | 47 |
48 const ModelType kDomDistillerModelType = syncer::ARTICLES; | 48 const ModelType kDomDistillerModelType = syncer::ARTICLES; |
49 | 49 |
50 typedef base::hash_map<std::string, ArticleEntry> EntryMap; | 50 typedef std::map<std::string, ArticleEntry> EntryMap; |
51 | 51 |
52 void AddEntry(const ArticleEntry& e, EntryMap* map) { | 52 void AddEntry(const ArticleEntry& e, EntryMap* map) { |
53 (*map)[e.entry_id()] = e; | 53 (*map)[e.entry_id()] = e; |
54 } | 54 } |
55 | 55 |
56 class FakeSyncErrorFactory : public syncer::SyncErrorFactory { | 56 class FakeSyncErrorFactory : public syncer::SyncErrorFactory { |
57 public: | 57 public: |
58 syncer::SyncError CreateAndUploadError( | 58 syncer::SyncError CreateAndUploadError( |
59 const tracked_objects::Location& location, | 59 const tracked_objects::Location& location, |
60 const std::string& message) override { | 60 const std::string& message) override { |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 EntryMap fake_model; | 586 EntryMap fake_model; |
587 FakeSyncChangeProcessor* fake_sync_change_processor = | 587 FakeSyncChangeProcessor* fake_sync_change_processor = |
588 new FakeSyncChangeProcessor(&fake_model); | 588 new FakeSyncChangeProcessor(&fake_model); |
589 store_->MergeDataAndStartSyncing( | 589 store_->MergeDataAndStartSyncing( |
590 kDomDistillerModelType, change_data, | 590 kDomDistillerModelType, change_data, |
591 base::WrapUnique<SyncChangeProcessor>(fake_sync_change_processor), | 591 base::WrapUnique<SyncChangeProcessor>(fake_sync_change_processor), |
592 base::WrapUnique<SyncErrorFactory>(fake_error_factory)); | 592 base::WrapUnique<SyncErrorFactory>(fake_error_factory)); |
593 } | 593 } |
594 | 594 |
595 } // namespace dom_distiller | 595 } // namespace dom_distiller |
OLD | NEW |