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/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Dummy SyncChangeProcessor used to help review what SyncChanges are pushed | 36 // Dummy SyncChangeProcessor used to help review what SyncChanges are pushed |
37 // back up to Sync. | 37 // back up to Sync. |
38 class TestChangeProcessor : public syncer::SyncChangeProcessor { | 38 class TestChangeProcessor : public syncer::SyncChangeProcessor { |
39 public: | 39 public: |
40 TestChangeProcessor(); | 40 TestChangeProcessor(); |
41 virtual ~TestChangeProcessor(); | 41 virtual ~TestChangeProcessor(); |
42 | 42 |
43 // Store a copy of all the changes passed in so we can examine them later. | 43 // Store a copy of all the changes passed in so we can examine them later. |
44 virtual syncer::SyncError ProcessSyncChanges( | 44 virtual syncer::SyncError ProcessSyncChanges( |
45 const tracked_objects::Location& from_here, | 45 const tracked_objects::Location& from_here, |
46 const syncer::SyncChangeList& change_list) OVERRIDE; | 46 const syncer::SyncChangeList& change_list) override; |
47 | 47 |
48 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const | 48 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const |
49 OVERRIDE { | 49 override { |
50 return syncer::SyncDataList(); | 50 return syncer::SyncDataList(); |
51 } | 51 } |
52 | 52 |
53 bool contains_guid(const std::string& guid) const { | 53 bool contains_guid(const std::string& guid) const { |
54 return change_map_.count(guid) != 0; | 54 return change_map_.count(guid) != 0; |
55 } | 55 } |
56 | 56 |
57 syncer::SyncChange change_for_guid(const std::string& guid) const { | 57 syncer::SyncChange change_for_guid(const std::string& guid) const { |
58 DCHECK(contains_guid(guid)); | 58 DCHECK(contains_guid(guid)); |
59 return change_map_.find(guid)->second; | 59 return change_map_.find(guid)->second; |
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 EXPECT_EQ(changes[4].change_type(), syncer::SyncChange::ACTION_ADD); | 1932 EXPECT_EQ(changes[4].change_type(), syncer::SyncChange::ACTION_ADD); |
1933 EXPECT_EQ(changes[4].sync_data().GetDataType(), syncer::FAVICON_TRACKING); | 1933 EXPECT_EQ(changes[4].sync_data().GetDataType(), syncer::FAVICON_TRACKING); |
1934 EXPECT_EQ(kMaxSyncFavicons, GetFaviconId(changes[4])); | 1934 EXPECT_EQ(kMaxSyncFavicons, GetFaviconId(changes[4])); |
1935 // Expire tracking for favicon[0]. | 1935 // Expire tracking for favicon[0]. |
1936 EXPECT_EQ(changes[5].change_type(), syncer::SyncChange::ACTION_DELETE); | 1936 EXPECT_EQ(changes[5].change_type(), syncer::SyncChange::ACTION_DELETE); |
1937 EXPECT_EQ(changes[5].sync_data().GetDataType(), syncer::FAVICON_TRACKING); | 1937 EXPECT_EQ(changes[5].sync_data().GetDataType(), syncer::FAVICON_TRACKING); |
1938 EXPECT_EQ(0, GetFaviconId(changes[5])); | 1938 EXPECT_EQ(0, GetFaviconId(changes[5])); |
1939 } | 1939 } |
1940 | 1940 |
1941 } // namespace browser_sync | 1941 } // namespace browser_sync |
OLD | NEW |