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 29 matching lines...) Expand all Loading... |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 class InvalidatorStorageTest : public testing::Test { | 42 class InvalidatorStorageTest : public testing::Test { |
43 public: | 43 public: |
44 InvalidatorStorageTest() | 44 InvalidatorStorageTest() |
45 : kBookmarksId_(kChromeSyncSourceId, "BOOKMARK"), | 45 : kBookmarksId_(kChromeSyncSourceId, "BOOKMARK"), |
46 kPreferencesId_(kChromeSyncSourceId, "PREFERENCE"), | 46 kPreferencesId_(kChromeSyncSourceId, "PREFERENCE"), |
47 kAppNotificationsId_(kChromeSyncSourceId, "APP_NOTIFICATION"), | 47 kAppNotificationsId_(kChromeSyncSourceId, "APP_NOTIFICATION"), |
48 kAutofillId_(kChromeSyncSourceId, "AUTOFILL") {} | 48 kAutofillId_(kChromeSyncSourceId, "AUTOFILL") {} |
49 | 49 |
50 void SetUp() { | 50 virtual void SetUp() { |
51 InvalidatorStorage::RegisterUserPrefs(pref_service_.registry()); | 51 InvalidatorStorage::RegisterUserPrefs(pref_service_.registry()); |
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_; |
(...skipping 437 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 |