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

Side by Side Diff: components/sync/user_events/user_event_sync_bridge_unittest.cc

Issue 2916133002: [Sync] Support commit only types. (Closed)
Patch Set: Rebase again. Created 3 years, 6 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
« no previous file with comments | « components/sync/user_events/user_event_sync_bridge.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "components/sync/user_events/user_event_sync_bridge.h" 5 #include "components/sync/user_events/user_event_sync_bridge.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 EXPECT_EQ(4u, processor().put_multimap().size()); 122 EXPECT_EQ(4u, processor().put_multimap().size());
123 std::set<std::string> unique_storage_keys; 123 std::set<std::string> unique_storage_keys;
124 for (const auto& kv : processor().put_multimap()) { 124 for (const auto& kv : processor().put_multimap()) {
125 unique_storage_keys.insert(kv.first); 125 unique_storage_keys.insert(kv.first);
126 } 126 }
127 EXPECT_EQ(2u, unique_storage_keys.size()); 127 EXPECT_EQ(2u, unique_storage_keys.size());
128 bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 4)); 128 bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 4));
129 } 129 }
130 130
131 TEST_F(UserEventSyncBridgeTest, ApplySyncChanges) {
132 bridge()->RecordUserEvent(SpecificsUniquePtr(1u, 1u, 1u));
133 bridge()->RecordUserEvent(SpecificsUniquePtr(2u, 2u, 2u));
134 bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 2));
135
136 const std::string storage_key = processor().put_multimap().begin()->first;
137 auto error_on_delete =
138 bridge()->ApplySyncChanges(bridge()->CreateMetadataChangeList(),
139 {EntityChange::CreateDelete(storage_key)});
140 EXPECT_FALSE(error_on_delete);
141 bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 1));
142 }
143
131 } // namespace 144 } // namespace
132 145
133 } // namespace syncer 146 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/user_events/user_event_sync_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698