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

Side by Side Diff: components/sync/core/data_batch_impl_unittest.cc

Issue 2388163002: [Sync] Move //components/sync to the syncer namespace, take 2. (Closed)
Patch Set: Rebase. Created 4 years, 2 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/core/data_batch_impl.cc ('k') | components/sync/core/delete_journal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/core/data_batch_impl.h" 5 #include "components/sync/core/data_batch_impl.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace syncer_v2 { 10 namespace syncer {
11 11
12 TEST(DataBatchImplTest, PutAndNextWithReuse) { 12 TEST(DataBatchImplTest, PutAndNextWithReuse) {
13 EntityData* entity1 = new EntityData(); 13 EntityData* entity1 = new EntityData();
14 EntityData* entity2 = new EntityData(); 14 EntityData* entity2 = new EntityData();
15 15
16 DataBatchImpl batch; 16 DataBatchImpl batch;
17 EXPECT_FALSE(batch.HasNext()); 17 EXPECT_FALSE(batch.HasNext());
18 18
19 batch.Put("one", base::WrapUnique(entity1)); 19 batch.Put("one", base::WrapUnique(entity1));
20 EXPECT_TRUE(batch.HasNext()); 20 EXPECT_TRUE(batch.HasNext());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 EXPECT_TRUE(batch.HasNext()); 81 EXPECT_TRUE(batch.HasNext());
82 EXPECT_EQ("same", pair1.first); 82 EXPECT_EQ("same", pair1.first);
83 EXPECT_EQ(entity1, pair1.second.get()); 83 EXPECT_EQ(entity1, pair1.second.get());
84 84
85 const KeyAndData& pair2 = batch.Next(); 85 const KeyAndData& pair2 = batch.Next();
86 EXPECT_FALSE(batch.HasNext()); 86 EXPECT_FALSE(batch.HasNext());
87 EXPECT_EQ("same", pair2.first); 87 EXPECT_EQ("same", pair2.first);
88 EXPECT_EQ(entity2, pair2.second.get()); 88 EXPECT_EQ(entity2, pair2.second.get());
89 } 89 }
90 90
91 } // namespace syncer_v2 91 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/core/data_batch_impl.cc ('k') | components/sync/core/delete_journal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698