Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: components/invalidation/impl/sync_invalidation_listener_unittest.cc

Issue 2231753002: components: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more call site Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 772
773 // Make sure that state is correctly purged from the local invalidation state 773 // Make sure that state is correctly purged from the local invalidation state
774 // map cache when an ID is unregistered. 774 // map cache when an ID is unregistered.
775 TEST_F(SyncInvalidationListenerTest, UnregisterCleansUpStateMapCache) { 775 TEST_F(SyncInvalidationListenerTest, UnregisterCleansUpStateMapCache) {
776 const ObjectId& id = kBookmarksId_; 776 const ObjectId& id = kBookmarksId_;
777 listener_.Ready(fake_invalidation_client_); 777 listener_.Ready(fake_invalidation_client_);
778 778
779 EXPECT_TRUE(GetSavedInvalidations().empty()); 779 EXPECT_TRUE(GetSavedInvalidations().empty());
780 FireInvalidate(id, 1, "hello"); 780 FireInvalidate(id, 1, "hello");
781 EXPECT_EQ(1U, GetSavedInvalidations().size()); 781 EXPECT_EQ(1U, GetSavedInvalidations().size());
782 EXPECT_TRUE(ContainsKey(GetSavedInvalidations(), id)); 782 EXPECT_TRUE(base::ContainsKey(GetSavedInvalidations(), id));
783 FireInvalidate(kPreferencesId_, 2, "world"); 783 FireInvalidate(kPreferencesId_, 2, "world");
784 EXPECT_EQ(2U, GetSavedInvalidations().size()); 784 EXPECT_EQ(2U, GetSavedInvalidations().size());
785 785
786 EXPECT_TRUE(ContainsKey(GetSavedInvalidations(), id)); 786 EXPECT_TRUE(base::ContainsKey(GetSavedInvalidations(), id));
787 EXPECT_TRUE(ContainsKey(GetSavedInvalidations(), kPreferencesId_)); 787 EXPECT_TRUE(base::ContainsKey(GetSavedInvalidations(), kPreferencesId_));
788 788
789 ObjectIdSet ids; 789 ObjectIdSet ids;
790 ids.insert(id); 790 ids.insert(id);
791 listener_.UpdateRegisteredIds(ids); 791 listener_.UpdateRegisteredIds(ids);
792 EXPECT_EQ(1U, GetSavedInvalidations().size()); 792 EXPECT_EQ(1U, GetSavedInvalidations().size());
793 EXPECT_TRUE(ContainsKey(GetSavedInvalidations(), id)); 793 EXPECT_TRUE(base::ContainsKey(GetSavedInvalidations(), id));
794 } 794 }
795 795
796 TEST_F(SyncInvalidationListenerTest, DuplicateInvaldiations_Simple) { 796 TEST_F(SyncInvalidationListenerTest, DuplicateInvaldiations_Simple) {
797 const ObjectId& id = kBookmarksId_; 797 const ObjectId& id = kBookmarksId_;
798 listener_.Ready(fake_invalidation_client_); 798 listener_.Ready(fake_invalidation_client_);
799 799
800 // Send a stream of invalidations, including two copies of the second. 800 // Send a stream of invalidations, including two copies of the second.
801 FireInvalidate(id, 1, "one"); 801 FireInvalidate(id, 1, "one");
802 FireInvalidate(id, 2, "two"); 802 FireInvalidate(id, 2, "two");
803 FireInvalidate(id, 3, "three"); 803 FireInvalidate(id, 3, "three");
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 ids.insert(kExtensionsId_); 1106 ids.insert(kExtensionsId_);
1107 listener_.UpdateRegisteredIds(ids); 1107 listener_.UpdateRegisteredIds(ids);
1108 1108
1109 ASSERT_EQ(3U, GetInvalidationCount(kExtensionsId_)); 1109 ASSERT_EQ(3U, GetInvalidationCount(kExtensionsId_));
1110 EXPECT_EQ(30, GetVersion(kExtensionsId_)); 1110 EXPECT_EQ(30, GetVersion(kExtensionsId_));
1111 } 1111 }
1112 1112
1113 } // namespace 1113 } // namespace
1114 1114
1115 } // namespace syncer 1115 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/impl/registration_manager_unittest.cc ('k') | components/invalidation/impl/sync_system_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698