| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 5 |
| 6 #include "chrome/browser/sync/invalidations/invalidator_storage.h" | 6 #include "chrome/browser/sync/invalidations/invalidator_storage.h" |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 TestingPrefServiceSyncable pref_service_; | 55 TestingPrefServiceSyncable pref_service_; |
| 56 | 56 |
| 57 const invalidation::ObjectId kBookmarksId_; | 57 const invalidation::ObjectId kBookmarksId_; |
| 58 const invalidation::ObjectId kPreferencesId_; | 58 const invalidation::ObjectId kPreferencesId_; |
| 59 const invalidation::ObjectId kAppNotificationsId_; | 59 const invalidation::ObjectId kAppNotificationsId_; |
| 60 const invalidation::ObjectId kAutofillId_; | 60 const invalidation::ObjectId kAutofillId_; |
| 61 | 61 |
| 62 MessageLoop loop_; | 62 base::MessageLoop loop_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // Set invalidation states for various keys and verify that they are written and | 65 // Set invalidation states for various keys and verify that they are written and |
| 66 // read back correctly. | 66 // read back correctly. |
| 67 TEST_F(InvalidatorStorageTest, SetMaxVersionAndPayload) { | 67 TEST_F(InvalidatorStorageTest, SetMaxVersionAndPayload) { |
| 68 InvalidatorStorage storage(&pref_service_); | 68 InvalidatorStorage storage(&pref_service_); |
| 69 | 69 |
| 70 InvalidationStateMap expected_states; | 70 InvalidationStateMap expected_states; |
| 71 EXPECT_EQ(expected_states, storage.GetAllInvalidationStates()); | 71 EXPECT_EQ(expected_states, storage.GetAllInvalidationStates()); |
| 72 | 72 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 EXPECT_TRUE(it->second.IsValid()); | 498 EXPECT_TRUE(it->second.IsValid()); |
| 499 state_map[kBookmarksId_].expected = it->second; | 499 state_map[kBookmarksId_].expected = it->second; |
| 500 EXPECT_EQ(state_map, storage.GetAllInvalidationStates()); | 500 EXPECT_EQ(state_map, storage.GetAllInvalidationStates()); |
| 501 | 501 |
| 502 storage.Acknowledge(kBookmarksId_, it->second); | 502 storage.Acknowledge(kBookmarksId_, it->second); |
| 503 state_map[kBookmarksId_].current = it->second; | 503 state_map[kBookmarksId_].current = it->second; |
| 504 EXPECT_EQ(state_map, storage.GetAllInvalidationStates()); | 504 EXPECT_EQ(state_map, storage.GetAllInvalidationStates()); |
| 505 } | 505 } |
| 506 | 506 |
| 507 } // namespace browser_sync | 507 } // namespace browser_sync |
| OLD | NEW |