| Index: chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
|
| diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
|
| index 041856779ac4e30986cd66b002e53cd188487142..5e1d3620403fac3b804961bed5942861d0c87eb2 100644
|
| --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
|
| +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
|
| @@ -23,6 +23,7 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/time/time.h"
|
| #include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
| +#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
|
| #include "chrome/browser/sync/glue/bookmark_change_processor.h"
|
| #include "chrome/browser/sync/glue/bookmark_model_associator.h"
|
| #include "chrome/common/chrome_switches.h"
|
| @@ -607,7 +608,9 @@ class ProfileSyncServiceBookmarkTest : public testing::Test {
|
| EXPECT_EQ(gnode.GetPredecessorId(), gprev.GetId());
|
| EXPECT_EQ(gnode.GetParentId(), gprev.GetParentId());
|
| }
|
| - if (browser_index == bnode->parent()->child_count() - 1) {
|
| + // Note: the managed node comes next to the mobile node but isn't synced.
|
| + if (browser_index == bnode->parent()->child_count() - 1 ||
|
| + bnode == model_->mobile_node()) {
|
| EXPECT_EQ(gnode.GetSuccessorId(), 0);
|
| } else {
|
| const BookmarkNode* bnext =
|
| @@ -632,6 +635,12 @@ class ProfileSyncServiceBookmarkTest : public testing::Test {
|
| const BookmarkNode* bnode =
|
| model_associator_->GetChromeNodeFromSyncId(sync_id);
|
| ASSERT_TRUE(bnode);
|
| +
|
| + ChromeBookmarkClient* client =
|
| + BookmarkModelFactory::GetChromeBookmarkClientForProfile(&profile_);
|
| + ASSERT_TRUE(client);
|
| + ASSERT_FALSE(client->IsAManagedNode(bnode));
|
| +
|
| int64 id = model_associator_->GetSyncIdFromChromeId(bnode->id());
|
| EXPECT_EQ(id, sync_id);
|
| ExpectSyncerNodeMatching(trans, bnode);
|
| @@ -1312,6 +1321,11 @@ class ProfileSyncServiceBookmarkTestWithData
|
| void ExpectBookmarkModelMatchesTestData();
|
| void WriteTestDataToBookmarkModel();
|
|
|
| + // Output transaction versions of |node| and nodes under it to
|
| + // |node_versions|.
|
| + void GetTransactionVersions(const BookmarkNode* root,
|
| + BookmarkNodeVersionMap* node_versions);
|
| +
|
| // Verify transaction versions of bookmark nodes and sync nodes are equal
|
| // recursively. If node is in |version_expected|, versions should match
|
| // there, too.
|
| @@ -2000,10 +2014,13 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateMetaInfoFromModel) {
|
| ExpectModelMatch();
|
| }
|
|
|
| -// Output transaction versions of |node| and nodes under it to |node_versions|.
|
| -void GetTransactionVersions(
|
| +void ProfileSyncServiceBookmarkTestWithData::GetTransactionVersions(
|
| const BookmarkNode* root,
|
| BookmarkNodeVersionMap* node_versions) {
|
| + ChromeBookmarkClient* client =
|
| + BookmarkModelFactory::GetChromeBookmarkClientForProfile(&profile_);
|
| + ASSERT_TRUE(client);
|
| +
|
| node_versions->clear();
|
| std::queue<const BookmarkNode*> nodes;
|
| nodes.push(root);
|
| @@ -2015,8 +2032,11 @@ void GetTransactionVersions(
|
| EXPECT_NE(BookmarkNode::kInvalidSyncTransactionVersion, version);
|
|
|
| (*node_versions)[n->id()] = version;
|
| - for (int i = 0; i < n->child_count(); ++i)
|
| + for (int i = 0; i < n->child_count(); ++i) {
|
| + if (client->IsAManagedNode(n->GetChild(i)))
|
| + continue;
|
| nodes.push(n->GetChild(i));
|
| + }
|
| }
|
| }
|
|
|
|
|