| Index: chrome/browser/sync/syncable/syncable_unittest.cc
|
| diff --git a/chrome/browser/sync/syncable/syncable_unittest.cc b/chrome/browser/sync/syncable/syncable_unittest.cc
|
| index c09b66bbd50f7f08b925006d43efd06f352d2b17..5068cff4d02bbf00563a87006fc049fd982117ce 100644
|
| --- a/chrome/browser/sync/syncable/syncable_unittest.cc
|
| +++ b/chrome/browser/sync/syncable/syncable_unittest.cc
|
| @@ -105,6 +105,14 @@ TEST_F(SyncableGeneralTest, General) {
|
| Directory dir;
|
| dir.Open(db_path_, "SimpleTest");
|
|
|
| + int64 root_metahandle;
|
| + {
|
| + ReadTransaction rtrans(&dir, __FILE__, __LINE__);
|
| + Entry e(&rtrans, GET_BY_ID, rtrans.root_id());
|
| + ASSERT_TRUE(e.good());
|
| + root_metahandle = e.Get(META_HANDLE);
|
| + }
|
| +
|
| int64 written_metahandle;
|
| const Id id = TestIdFactory::FromNumber(99);
|
| std::string name = "Jeff";
|
| @@ -115,7 +123,10 @@ TEST_F(SyncableGeneralTest, General) {
|
| ASSERT_FALSE(e.good()); // Hasn't been written yet.
|
|
|
| Directory::ChildHandles child_handles;
|
| - dir.GetChildHandles(&rtrans, rtrans.root_id(), &child_handles);
|
| + dir.GetChildHandlesById(&rtrans, rtrans.root_id(), &child_handles);
|
| + EXPECT_TRUE(child_handles.empty());
|
| +
|
| + dir.GetChildHandlesByHandle(&rtrans, root_metahandle, &child_handles);
|
| EXPECT_TRUE(child_handles.empty());
|
| }
|
|
|
| @@ -129,7 +140,7 @@ TEST_F(SyncableGeneralTest, General) {
|
| written_metahandle = me.Get(META_HANDLE);
|
| }
|
|
|
| - // Test GetChildHandles after something is now in the DB.
|
| + // Test GetChildHandles* after something is now in the DB.
|
| // Also check that GET_BY_ID works.
|
| {
|
| ReadTransaction rtrans(&dir, __FILE__, __LINE__);
|
| @@ -137,7 +148,15 @@ TEST_F(SyncableGeneralTest, General) {
|
| ASSERT_TRUE(e.good());
|
|
|
| Directory::ChildHandles child_handles;
|
| - dir.GetChildHandles(&rtrans, rtrans.root_id(), &child_handles);
|
| + dir.GetChildHandlesById(&rtrans, rtrans.root_id(), &child_handles);
|
| + EXPECT_EQ(1u, child_handles.size());
|
| +
|
| + for (Directory::ChildHandles::iterator i = child_handles.begin();
|
| + i != child_handles.end(); ++i) {
|
| + EXPECT_EQ(*i, written_metahandle);
|
| + }
|
| +
|
| + dir.GetChildHandlesByHandle(&rtrans, root_metahandle, &child_handles);
|
| EXPECT_EQ(1u, child_handles.size());
|
|
|
| for (Directory::ChildHandles::iterator i = child_handles.begin();
|
|
|