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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 class MockDistillerObserver : public DomDistillerObserver { | 115 class MockDistillerObserver : public DomDistillerObserver { |
116 public: | 116 public: |
117 MOCK_METHOD1(ArticleEntriesUpdated, void(const std::vector<ArticleUpdate>&)); | 117 MOCK_METHOD1(ArticleEntriesUpdated, void(const std::vector<ArticleUpdate>&)); |
118 virtual ~MockDistillerObserver() {} | 118 virtual ~MockDistillerObserver() {} |
119 }; | 119 }; |
120 | 120 |
121 } // namespace | 121 } // namespace |
122 | 122 |
123 class DomDistillerStoreTest : public testing::Test { | 123 class DomDistillerStoreTest : public testing::Test { |
124 public: | 124 public: |
125 virtual void SetUp() { | 125 void SetUp() override { |
126 db_model_.clear(); | 126 db_model_.clear(); |
127 sync_model_.clear(); | 127 sync_model_.clear(); |
128 store_model_.clear(); | 128 store_model_.clear(); |
129 next_sync_id_ = 1; | 129 next_sync_id_ = 1; |
130 } | 130 } |
131 | 131 |
132 virtual void TearDown() { | 132 void TearDown() override { |
133 store_.reset(); | 133 store_.reset(); |
134 fake_db_ = NULL; | 134 fake_db_ = NULL; |
135 fake_sync_processor_ = NULL; | 135 fake_sync_processor_ = NULL; |
136 } | 136 } |
137 | 137 |
138 // Creates a simple DomDistillerStore initialized with |store_model_| and | 138 // Creates a simple DomDistillerStore initialized with |store_model_| and |
139 // with a FakeDB backed by |db_model_|. | 139 // with a FakeDB backed by |db_model_|. |
140 void CreateStore() { | 140 void CreateStore() { |
141 fake_db_ = new FakeDB<ArticleEntry>(&db_model_); | 141 fake_db_ = new FakeDB<ArticleEntry>(&db_model_); |
142 store_.reset(test::util::CreateStoreWithFakeDB(fake_db_, store_model_)); | 142 store_.reset(test::util::CreateStoreWithFakeDB(fake_db_, store_model_)); |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 EntryMap fake_model; | 497 EntryMap fake_model; |
498 FakeSyncChangeProcessor* fake_sync_change_processor = | 498 FakeSyncChangeProcessor* fake_sync_change_processor = |
499 new FakeSyncChangeProcessor(&fake_model); | 499 new FakeSyncChangeProcessor(&fake_model); |
500 store_->MergeDataAndStartSyncing( | 500 store_->MergeDataAndStartSyncing( |
501 kDomDistillerModelType, change_data, | 501 kDomDistillerModelType, change_data, |
502 make_scoped_ptr<SyncChangeProcessor>(fake_sync_change_processor), | 502 make_scoped_ptr<SyncChangeProcessor>(fake_sync_change_processor), |
503 make_scoped_ptr<SyncErrorFactory>(fake_error_factory)); | 503 make_scoped_ptr<SyncErrorFactory>(fake_error_factory)); |
504 } | 504 } |
505 | 505 |
506 } // namespace dom_distiller | 506 } // namespace dom_distiller |
OLD | NEW |