OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/history/typed_url_syncable_service.h" | 5 #include "chrome/browser/history/typed_url_syncable_service.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 const std::vector<const char*>& urls, | 151 const std::vector<const char*>& urls, |
152 syncer::SyncChangeList* change_list); | 152 syncer::SyncChangeList* change_list); |
153 | 153 |
154 protected: | 154 protected: |
155 TypedUrlSyncableServiceTest() {} | 155 TypedUrlSyncableServiceTest() {} |
156 | 156 |
157 virtual ~TypedUrlSyncableServiceTest() {} | 157 virtual ~TypedUrlSyncableServiceTest() {} |
158 | 158 |
159 virtual void SetUp() OVERRIDE { | 159 virtual void SetUp() OVERRIDE { |
160 fake_history_backend_ = new TestHistoryBackend(); | 160 fake_history_backend_ = new TestHistoryBackend(); |
161 typed_url_sync_service_.reset(new TypedUrlSyncableService( | 161 typed_url_sync_service_.reset( |
162 fake_history_backend_)); | 162 new TypedUrlSyncableService(fake_history_backend_.get())); |
163 fake_change_processor_.reset(new TestChangeProcessor); | 163 fake_change_processor_.reset(new TestChangeProcessor); |
164 } | 164 } |
165 | 165 |
166 scoped_refptr<HistoryBackend> fake_history_backend_; | 166 scoped_refptr<HistoryBackend> fake_history_backend_; |
167 scoped_ptr<TypedUrlSyncableService> typed_url_sync_service_; | 167 scoped_ptr<TypedUrlSyncableService> typed_url_sync_service_; |
168 scoped_ptr<syncer::SyncChangeProcessor> fake_change_processor_; | 168 scoped_ptr<syncer::SyncChangeProcessor> fake_change_processor_; |
169 }; | 169 }; |
170 | 170 |
171 URLRow TypedUrlSyncableServiceTest::MakeTypedUrlRow( | 171 URLRow TypedUrlSyncableServiceTest::MakeTypedUrlRow( |
172 const char* url, | 172 const char* url, |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 typed_url_sync_service_->OnUrlVisited(transition, &url_row); | 648 typed_url_sync_service_->OnUrlVisited(transition, &url_row); |
649 | 649 |
650 // Should throttle, so sync and local cache should not update. | 650 // Should throttle, so sync and local cache should not update. |
651 ASSERT_EQ(0u, change_list.size()); | 651 ASSERT_EQ(0u, change_list.size()); |
652 std::set<GURL> sync_state; | 652 std::set<GURL> sync_state; |
653 typed_url_sync_service_.get()->GetSyncedUrls(&sync_state); | 653 typed_url_sync_service_.get()->GetSyncedUrls(&sync_state); |
654 EXPECT_TRUE(sync_state.empty()); | 654 EXPECT_TRUE(sync_state.empty()); |
655 } | 655 } |
656 | 656 |
657 } // namespace history | 657 } // namespace history |
OLD | NEW |