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

Side by Side Diff: chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc

Issue 10833004: [Sync] Make P2PNotifier emit a notification only if some enabled types changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed MC_DeleteBookmarks Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/rand_util.h" 5 #include "base/rand_util.h"
6 #include "chrome/browser/profiles/profile.h" 6 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/sync/profile_sync_service_harness.h" 7 #include "chrome/browser/sync/profile_sync_service_harness.h"
8 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" 8 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
9 #include "chrome/browser/sync/test/integration/passwords_helper.h" 9 #include "chrome/browser/sync/test/integration/passwords_helper.h"
10 #include "chrome/browser/sync/test/integration/sync_test.h" 10 #include "chrome/browser/sync/test/integration/sync_test.h"
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, MC_DeleteBookmark) { 1565 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, MC_DeleteBookmark) {
1566 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1566 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1567 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS)); 1567 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS));
1568 1568
1569 const GURL bar_url("http://example.com/bar"); 1569 const GURL bar_url("http://example.com/bar");
1570 const GURL other_url("http://example.com/other"); 1570 const GURL other_url("http://example.com/other");
1571 1571
1572 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, L"bar", bar_url) != NULL); 1572 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, L"bar", bar_url) != NULL);
1573 ASSERT_TRUE(AddURL(0, GetOtherNode(0), 0, L"other", other_url) != NULL); 1573 ASSERT_TRUE(AddURL(0, GetOtherNode(0), 0, L"other", other_url) != NULL);
1574 1574
1575 ASSERT_TRUE(AwaitQuiescence()); 1575 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Added a bookmark."));
1576 1576
1577 ASSERT_TRUE(HasNodeWithURL(0, bar_url)); 1577 ASSERT_TRUE(HasNodeWithURL(0, bar_url));
1578 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1578 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1579 ASSERT_FALSE(HasNodeWithURL(1, bar_url)); 1579 ASSERT_FALSE(HasNodeWithURL(1, bar_url));
1580 ASSERT_FALSE(HasNodeWithURL(1, other_url)); 1580 ASSERT_FALSE(HasNodeWithURL(1, other_url));
1581 1581
1582 Remove(0, GetBookmarkBarNode(0), 0); 1582 Remove(0, GetBookmarkBarNode(0), 0);
1583 ASSERT_TRUE(AwaitQuiescence()); 1583 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Removed a bookmark."));
1584 1584
1585 ASSERT_FALSE(HasNodeWithURL(0, bar_url)); 1585 ASSERT_FALSE(HasNodeWithURL(0, bar_url));
1586 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1586 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1587 1587
1588 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS)); 1588 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS));
1589 ASSERT_TRUE(AwaitQuiescence()); 1589 ASSERT_TRUE(AwaitQuiescence());
1590 1590
1591 ASSERT_FALSE(HasNodeWithURL(0, bar_url)); 1591 ASSERT_FALSE(HasNodeWithURL(0, bar_url));
1592 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1592 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1593 ASSERT_FALSE(HasNodeWithURL(1, bar_url)); 1593 ASSERT_FALSE(HasNodeWithURL(1, bar_url));
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 1934
1935 // Now add a bookmark within the Synced Bookmarks folder and ensure it syncs 1935 // Now add a bookmark within the Synced Bookmarks folder and ensure it syncs
1936 // over. 1936 // over.
1937 const BookmarkNode* synced_bookmarks = GetSyncedBookmarksNode(0); 1937 const BookmarkNode* synced_bookmarks = GetSyncedBookmarksNode(0);
1938 ASSERT_TRUE(synced_bookmarks); 1938 ASSERT_TRUE(synced_bookmarks);
1939 ASSERT_TRUE(AddURL(0, synced_bookmarks, 0, L"Google2", 1939 ASSERT_TRUE(AddURL(0, synced_bookmarks, 0, L"Google2",
1940 GURL("http://www.google2.com"))); 1940 GURL("http://www.google2.com")));
1941 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 1941 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
1942 ASSERT_TRUE(AllModelsMatch()); 1942 ASSERT_TRUE(AllModelsMatch());
1943 } 1943 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698