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

Unified Diff: chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc

Issue 9570055: [Sync] Add support for associating a new Synced Bookmarks node. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add python test Created 8 years, 9 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
Index: chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc
index c4187aad0e4c547dcc95489167b9f60ee59bdc21..77bfd15a9cd25341dcbffec6762da0adfd7838aa 100644
--- a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc
@@ -18,6 +18,7 @@ using bookmarks_helper::CountBookmarksWithTitlesMatching;
using bookmarks_helper::CreateFavicon;
using bookmarks_helper::GetBookmarkBarNode;
using bookmarks_helper::GetOtherNode;
+using bookmarks_helper::GetSyncedBookmarksNode;
using bookmarks_helper::GetUniqueNodeByURL;
using bookmarks_helper::HasNodeWithURL;
using bookmarks_helper::IndexedFolderName;
@@ -1921,3 +1922,28 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, RestartSyncService) {
GetClient(0)->GetStatus().summary);
ASSERT_EQ(0, GetClient(0)->GetStatus().unsynced_count);
}
+
+// Trigger the server side creation of Synced Bookmarks. Ensure both clients
+// remain syncing afterwards. Add bookmarks to the synced bookmarks folder
+// and ensure both clients receive the boomkmark.
+IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, CreateSyncedBookmarks) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(AllModelsMatchVerifier());
+
+ TriggerCreateSyncedBookmarks();
+
+ // Add a bookmark on Client 0 and ensure it syncs over. This will also trigger
+ // both clients downloading the new Synced Bookmarks folder.
+ ASSERT_TRUE(AddURL(0, L"Google", GURL("http://www.google.com")));
+ ASSERT_TRUE(AwaitQuiescence());
+ ASSERT_TRUE(AllModelsMatch());
+
+ // Now add a bookmark within the Synced Bookmarks folder and ensure it syncs
+ // over.
+ const BookmarkNode* synced_bookmarks = GetSyncedBookmarksNode(0);
+ ASSERT_TRUE(synced_bookmarks);
+ ASSERT_TRUE(AddURL(0, synced_bookmarks, 0, L"Google2",
+ GURL("http://www.google2.com")));
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ ASSERT_TRUE(AllModelsMatch());
+}

Powered by Google App Engine
This is Rietveld 408576698