OLD | NEW |
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 "sync/syncable/parent_child_index.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "sync/syncable/entry_kernel.h" | 11 #include "sync/syncable/entry_kernel.h" |
12 #include "sync/syncable/syncable_util.h" | 12 #include "sync/syncable/syncable_util.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace syncer { | 15 namespace syncer { |
16 namespace syncable { | 16 namespace syncable { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 static const std::string kCacheGuid = "8HhNIHlEOCGQbIAALr9QEg=="; | 20 static const std::string kCacheGuid = "8HhNIHlEOCGQbIAALr9QEg=="; |
21 | 21 |
22 class ParentChildIndexTest : public testing::Test { | 22 class ParentChildIndexTest : public testing::Test { |
23 public: | 23 public: |
24 void TearDown() { | 24 virtual void TearDown() { |
25 // To make memory management easier, we take ownership of all EntryKernels | 25 // To make memory management easier, we take ownership of all EntryKernels |
26 // returned by our factory methods and delete them here. | 26 // returned by our factory methods and delete them here. |
27 STLDeleteElements(&owned_entry_kernels_); | 27 STLDeleteElements(&owned_entry_kernels_); |
28 } | 28 } |
29 | 29 |
30 // Unfortunately, we can't use the regular Entry factory methods, because the | 30 // Unfortunately, we can't use the regular Entry factory methods, because the |
31 // ParentChildIndex deals in EntryKernels. | 31 // ParentChildIndex deals in EntryKernels. |
32 | 32 |
33 static syncable::Id GetBookmarkRootId() { | 33 static syncable::Id GetBookmarkRootId() { |
34 return syncable::Id::CreateFromServerId("bookmark_folder"); | 34 return syncable::Id::CreateFromServerId("bookmark_folder"); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 it++; | 335 it++; |
336 EXPECT_EQ(*it, u1); | 336 EXPECT_EQ(*it, u1); |
337 it++; | 337 it++; |
338 EXPECT_TRUE(it == children->end()); | 338 EXPECT_TRUE(it == children->end()); |
339 } | 339 } |
340 | 340 |
341 } // namespace | 341 } // namespace |
342 } // namespace syncable | 342 } // namespace syncable |
343 } // namespace syncer | 343 } // namespace syncer |
344 | 344 |
OLD | NEW |