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

Side by Side Diff: components/sync/syncable/parent_child_index_unittest.cc

Issue 2156693002: [Sync] //components/sync internal changes [DO NOT SUBMIT] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "sync/syncable/parent_child_index.h" 5 #include "components/sync/syncable/parent_child_index.h"
6 6
7 #include <list> 7 #include <list>
8 #include <string> 8 #include <string>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "sync/syncable/entry_kernel.h" 12 #include "components/sync/syncable/entry_kernel.h"
13 #include "sync/syncable/syncable_util.h" 13 #include "components/sync/syncable/syncable_util.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace syncer { 16 namespace syncer {
17 namespace syncable { 17 namespace syncable {
18 18
19 namespace { 19 namespace {
20 20
21 static const std::string kCacheGuid = "8HhNIHlEOCGQbIAALr9QEg=="; 21 static const std::string kCacheGuid = "8HhNIHlEOCGQbIAALr9QEg==";
22 22
23 } // namespace 23 } // namespace
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 EntryKernel* MakeBookmark(int n, int pos, bool is_dir) { 86 EntryKernel* MakeBookmark(int n, int pos, bool is_dir) {
87 // Mimics a regular bookmark or folder. 87 // Mimics a regular bookmark or folder.
88 EntryKernel* bm = new EntryKernel(); 88 EntryKernel* bm = new EntryKernel();
89 bm->put(META_HANDLE, n); 89 bm->put(META_HANDLE, n);
90 bm->put(BASE_VERSION, 10); 90 bm->put(BASE_VERSION, 10);
91 bm->put(SERVER_VERSION, 10); 91 bm->put(SERVER_VERSION, 10);
92 bm->put(IS_DIR, is_dir); 92 bm->put(IS_DIR, is_dir);
93 bm->put(ID, GetBookmarkId(n)); 93 bm->put(ID, GetBookmarkId(n));
94 bm->put(PARENT_ID, GetBookmarkRootId()); 94 bm->put(PARENT_ID, GetBookmarkRootId());
95 95
96 bm->put(UNIQUE_BOOKMARK_TAG, 96 bm->put(UNIQUE_BOOKMARK_TAG, syncable::GenerateSyncableBookmarkHash(
97 syncable::GenerateSyncableBookmarkHash(kCacheGuid, 97 kCacheGuid, bm->ref(ID).GetServerId()));
98 bm->ref(ID).GetServerId()));
99 98
100 UniquePosition unique_pos = 99 UniquePosition unique_pos =
101 UniquePosition::FromInt64(pos, bm->ref(UNIQUE_BOOKMARK_TAG)); 100 UniquePosition::FromInt64(pos, bm->ref(UNIQUE_BOOKMARK_TAG));
102 bm->put(UNIQUE_POSITION, unique_pos); 101 bm->put(UNIQUE_POSITION, unique_pos);
103 bm->put(SERVER_UNIQUE_POSITION, unique_pos); 102 bm->put(SERVER_UNIQUE_POSITION, unique_pos);
104 103
105 owned_entry_kernels_.push_back(bm); 104 owned_entry_kernels_.push_back(bm);
106 return bm; 105 return bm;
107 } 106 }
108 107
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 464
466 // The index should still be able to associate Preferences entries 465 // The index should still be able to associate Preferences entries
467 // with the root. 466 // with the root.
468 const OrderedChildSet* children = index_.GetChildren(type_root_id); 467 const OrderedChildSet* children = index_.GetChildren(type_root_id);
469 ASSERT_TRUE(children); 468 ASSERT_TRUE(children);
470 EXPECT_EQ(2UL, children->size()); 469 EXPECT_EQ(2UL, children->size());
471 } 470 }
472 471
473 } // namespace syncable 472 } // namespace syncable
474 } // namespace syncer 473 } // namespace syncer
475
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698