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

Unified Diff: sync/internal_api/public/data_batch_impl_unittest.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/internal_api/public/data_batch_impl.cc ('k') | sync/internal_api/public/data_type_association_stats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/public/data_batch_impl_unittest.cc
diff --git a/sync/internal_api/public/data_batch_impl_unittest.cc b/sync/internal_api/public/data_batch_impl_unittest.cc
deleted file mode 100644
index 1dbb82b74ee570526d48136a09338484d09c1089..0000000000000000000000000000000000000000
--- a/sync/internal_api/public/data_batch_impl_unittest.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/internal_api/public/data_batch_impl.h"
-
-#include "base/memory/ptr_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer_v2 {
-
-TEST(DataBatchImplTest, PutAndNextWithReuse) {
- EntityData* entity1 = new EntityData();
- EntityData* entity2 = new EntityData();
-
- DataBatchImpl batch;
- EXPECT_FALSE(batch.HasNext());
-
- batch.Put("one", base::WrapUnique(entity1));
- EXPECT_TRUE(batch.HasNext());
-
- const TagAndData& pair1 = batch.Next();
- EXPECT_FALSE(batch.HasNext());
- EXPECT_EQ("one", pair1.first);
- EXPECT_EQ(entity1, pair1.second.get());
-
- batch.Put("two", base::WrapUnique(entity2));
- EXPECT_TRUE(batch.HasNext());
-
- const TagAndData& pair2 = batch.Next();
- EXPECT_FALSE(batch.HasNext());
- EXPECT_EQ("two", pair2.first);
- EXPECT_EQ(entity2, pair2.second.get());
-}
-
-TEST(DataBatchImplTest, PutAndNextInterleaved) {
- EntityData* entity1 = new EntityData();
- EntityData* entity2 = new EntityData();
- EntityData* entity3 = new EntityData();
-
- DataBatchImpl batch;
- EXPECT_FALSE(batch.HasNext());
-
- batch.Put("one", base::WrapUnique(entity1));
- EXPECT_TRUE(batch.HasNext());
- batch.Put("two", base::WrapUnique(entity2));
- EXPECT_TRUE(batch.HasNext());
-
- const TagAndData& pair1 = batch.Next();
- EXPECT_TRUE(batch.HasNext());
- EXPECT_EQ("one", pair1.first);
- EXPECT_EQ(entity1, pair1.second.get());
-
- batch.Put("three", base::WrapUnique(entity3));
- EXPECT_TRUE(batch.HasNext());
-
- const TagAndData& pair2 = batch.Next();
- EXPECT_TRUE(batch.HasNext());
- EXPECT_EQ("two", pair2.first);
- EXPECT_EQ(entity2, pair2.second.get());
-
- const TagAndData& pair3 = batch.Next();
- EXPECT_FALSE(batch.HasNext());
- EXPECT_EQ("three", pair3.first);
- EXPECT_EQ(entity3, pair3.second.get());
-}
-
-TEST(DataBatchImplTest, PutAndNextSharedTag) {
- EntityData* entity1 = new EntityData();
- EntityData* entity2 = new EntityData();
-
- DataBatchImpl batch;
- EXPECT_FALSE(batch.HasNext());
-
- batch.Put("same", base::WrapUnique(entity1));
- EXPECT_TRUE(batch.HasNext());
- batch.Put("same", base::WrapUnique(entity2));
- EXPECT_TRUE(batch.HasNext());
-
- const TagAndData& pair1 = batch.Next();
- EXPECT_TRUE(batch.HasNext());
- EXPECT_EQ("same", pair1.first);
- EXPECT_EQ(entity1, pair1.second.get());
-
- const TagAndData& pair2 = batch.Next();
- EXPECT_FALSE(batch.HasNext());
- EXPECT_EQ("same", pair2.first);
- EXPECT_EQ(entity2, pair2.second.get());
-}
-
-} // namespace syncer_v2
« no previous file with comments | « sync/internal_api/public/data_batch_impl.cc ('k') | sync/internal_api/public/data_type_association_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698