Chromium Code Reviews| 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/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 8 #include "chrome/browser/history/history_notifications.h" | 9 #include "chrome/browser/history/history_notifications.h" |
| 9 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| 10 #include "content/public/browser/notification_service.h" | 11 #include "content/public/browser/notification_service.h" |
| 11 #include "sync/api/sync_error_factory_mock.h" | 12 #include "sync/api/sync_error_factory_mock.h" |
| 12 #include "sync/protocol/favicon_image_specifics.pb.h" | 13 #include "sync/protocol/favicon_image_specifics.pb.h" |
| 13 #include "sync/protocol/favicon_tracking_specifics.pb.h" | 14 #include "sync/protocol/favicon_tracking_specifics.pb.h" |
| 14 #include "sync/protocol/sync.pb.h" | 15 #include "sync/protocol/sync.pb.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 scoped_ptr<syncer::SyncChangeProcessor> CreateAndPassProcessor(); | 281 scoped_ptr<syncer::SyncChangeProcessor> CreateAndPassProcessor(); |
| 281 scoped_ptr<syncer::SyncErrorFactory> CreateAndPassSyncErrorFactory(); | 282 scoped_ptr<syncer::SyncErrorFactory> CreateAndPassSyncErrorFactory(); |
| 282 | 283 |
| 283 FaviconCache* cache() { return &cache_; } | 284 FaviconCache* cache() { return &cache_; } |
| 284 TestChangeProcessor* processor() { return sync_processor_.get(); } | 285 TestChangeProcessor* processor() { return sync_processor_.get(); } |
| 285 | 286 |
| 286 // Finish an outstanding favicon load for the icon described in |test_data|. | 287 // Finish an outstanding favicon load for the icon described in |test_data|. |
| 287 void OnCustomFaviconDataAvailable(const TestFaviconData& test_data); | 288 void OnCustomFaviconDataAvailable(const TestFaviconData& test_data); |
| 288 | 289 |
| 289 private: | 290 private: |
| 291 MessageLoopForUI message_loop_; | |
|
rlarocque
2013/03/25 21:30:57
Is this used anywhere?
Nicolas Zea
2013/03/25 21:37:30
It's necessary so that MessageLoop::current() does
| |
| 290 FaviconCache cache_; | 292 FaviconCache cache_; |
| 291 | 293 |
| 292 // Our dummy ChangeProcessor used to inspect changes pushed to Sync. | 294 // Our dummy ChangeProcessor used to inspect changes pushed to Sync. |
| 293 scoped_ptr<TestChangeProcessor> sync_processor_; | 295 scoped_ptr<TestChangeProcessor> sync_processor_; |
| 294 scoped_ptr<SyncChangeProcessorDelegate> sync_processor_delegate_; | 296 scoped_ptr<SyncChangeProcessorDelegate> sync_processor_delegate_; |
| 295 }; | 297 }; |
| 296 | 298 |
| 297 SyncFaviconCacheTest::SyncFaviconCacheTest() | 299 SyncFaviconCacheTest::SyncFaviconCacheTest() |
| 298 : cache_(NULL, kMaxSyncFavicons), | 300 : cache_(NULL, kMaxSyncFavicons), |
| 299 sync_processor_(new TestChangeProcessor), | 301 sync_processor_(new TestChangeProcessor), |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1389 expected_deletions, | 1391 expected_deletions, |
| 1390 expected_icons, | 1392 expected_icons, |
| 1391 changes_1); | 1393 changes_1); |
| 1392 VerifyChanges(syncer::FAVICON_TRACKING, | 1394 VerifyChanges(syncer::FAVICON_TRACKING, |
| 1393 expected_deletions, | 1395 expected_deletions, |
| 1394 expected_icons, | 1396 expected_icons, |
| 1395 changes_2); | 1397 changes_2); |
| 1396 } | 1398 } |
| 1397 | 1399 |
| 1398 } // namespace browser_sync | 1400 } // namespace browser_sync |
| OLD | NEW |