| 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/sync/glue/favicon_cache.h" | 5 #include "chrome/browser/sync/glue/favicon_cache.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "chrome/browser/history/history_notifications.h" | 9 #include "chrome/browser/history/history_notifications.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 void OnCustomFaviconDataAvailable(const TestFaviconData& test_data); | 288 void OnCustomFaviconDataAvailable(const TestFaviconData& test_data); |
| 289 | 289 |
| 290 // Helper method to run the message loop after invoking | 290 // Helper method to run the message loop after invoking |
| 291 // OnReceivedSyncFavicon, which posts an internal task. | 291 // OnReceivedSyncFavicon, which posts an internal task. |
| 292 void TriggerSyncFaviconReceived(const GURL& page_url, | 292 void TriggerSyncFaviconReceived(const GURL& page_url, |
| 293 const GURL& icon_url, | 293 const GURL& icon_url, |
| 294 const std::string& icon_bytes, | 294 const std::string& icon_bytes, |
| 295 int64 last_visit_time_ms); | 295 int64 last_visit_time_ms); |
| 296 | 296 |
| 297 private: | 297 private: |
| 298 MessageLoopForUI message_loop_; | 298 base::MessageLoopForUI message_loop_; |
| 299 FaviconCache cache_; | 299 FaviconCache cache_; |
| 300 | 300 |
| 301 // Our dummy ChangeProcessor used to inspect changes pushed to Sync. | 301 // Our dummy ChangeProcessor used to inspect changes pushed to Sync. |
| 302 scoped_ptr<TestChangeProcessor> sync_processor_; | 302 scoped_ptr<TestChangeProcessor> sync_processor_; |
| 303 scoped_ptr<SyncChangeProcessorDelegate> sync_processor_delegate_; | 303 scoped_ptr<SyncChangeProcessorDelegate> sync_processor_delegate_; |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 SyncFaviconCacheTest::SyncFaviconCacheTest() | 306 SyncFaviconCacheTest::SyncFaviconCacheTest() |
| 307 : cache_(NULL, kMaxSyncFavicons), | 307 : cache_(NULL, kMaxSyncFavicons), |
| 308 sync_processor_(new TestChangeProcessor), | 308 sync_processor_(new TestChangeProcessor), |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1556 EXPECT_NE(changes[1].sync_data().GetSpecifics().favicon_tracking(). | 1556 EXPECT_NE(changes[1].sync_data().GetSpecifics().favicon_tracking(). |
| 1557 last_visit_time_ms(), 0); | 1557 last_visit_time_ms(), 0); |
| 1558 } | 1558 } |
| 1559 } | 1559 } |
| 1560 | 1560 |
| 1561 EXPECT_EQ(0U, GetTaskCount()); | 1561 EXPECT_EQ(0U, GetTaskCount()); |
| 1562 EXPECT_EQ((unsigned long)kFaviconBatchSize, GetFaviconCount()); | 1562 EXPECT_EQ((unsigned long)kFaviconBatchSize, GetFaviconCount()); |
| 1563 } | 1563 } |
| 1564 | 1564 |
| 1565 } // namespace browser_sync | 1565 } // namespace browser_sync |
| OLD | NEW |