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

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

Issue 148723002: [sync] Eliminate Await*SyncCompletion methods in integration tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback Created 6 years, 10 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/test/integration/bookmarks_helper.h" 7 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
8 #include "chrome/browser/sync/test/integration/passwords_helper.h" 8 #include "chrome/browser/sync/test/integration/passwords_helper.h"
9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" 9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
10 #include "chrome/browser/sync/test/integration/sync_test.h" 10 #include "chrome/browser/sync/test/integration/sync_test.h"
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 ASSERT_TRUE(AllModelsMatch()); 1560 ASSERT_TRUE(AllModelsMatch());
1561 } 1561 }
1562 1562
1563 // TCM ID - 7343544. 1563 // TCM ID - 7343544.
1564 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, DisableSync) { 1564 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, DisableSync) {
1565 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1565 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1566 ASSERT_TRUE(AllModelsMatchVerifier()); 1566 ASSERT_TRUE(AllModelsMatchVerifier());
1567 1567
1568 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); 1568 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes());
1569 ASSERT_TRUE(AddFolder(0, IndexedFolderName(0)) != NULL); 1569 ASSERT_TRUE(AddFolder(0, IndexedFolderName(0)) != NULL);
1570 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); 1570 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion());
1571 ASSERT_FALSE(AllModelsMatch()); 1571 ASSERT_FALSE(AllModelsMatch());
1572 1572
1573 ASSERT_TRUE(AddFolder(1, IndexedFolderName(1)) != NULL); 1573 ASSERT_TRUE(AddFolder(1, IndexedFolderName(1)) != NULL);
1574 ASSERT_FALSE(AllModelsMatch()); 1574 ASSERT_FALSE(AllModelsMatch());
1575 1575
1576 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); 1576 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes());
1577 ASSERT_TRUE(AwaitQuiescence()); 1577 ASSERT_TRUE(AwaitQuiescence());
1578 ASSERT_TRUE(AllModelsMatch()); 1578 ASSERT_TRUE(AllModelsMatch());
1579 } 1579 }
1580 1580
(...skipping 25 matching lines...) Expand all
1606 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, MC_DeleteBookmark) { 1606 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, MC_DeleteBookmark) {
1607 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1607 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1608 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS)); 1608 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS));
1609 1609
1610 const GURL bar_url("http://example.com/bar"); 1610 const GURL bar_url("http://example.com/bar");
1611 const GURL other_url("http://example.com/other"); 1611 const GURL other_url("http://example.com/other");
1612 1612
1613 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, L"bar", bar_url) != NULL); 1613 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, L"bar", bar_url) != NULL);
1614 ASSERT_TRUE(AddURL(0, GetOtherNode(0), 0, L"other", other_url) != NULL); 1614 ASSERT_TRUE(AddURL(0, GetOtherNode(0), 0, L"other", other_url) != NULL);
1615 1615
1616 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); 1616 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion());
1617 1617
1618 ASSERT_TRUE(HasNodeWithURL(0, bar_url)); 1618 ASSERT_TRUE(HasNodeWithURL(0, bar_url));
1619 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1619 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1620 ASSERT_FALSE(HasNodeWithURL(1, bar_url)); 1620 ASSERT_FALSE(HasNodeWithURL(1, bar_url));
1621 ASSERT_FALSE(HasNodeWithURL(1, other_url)); 1621 ASSERT_FALSE(HasNodeWithURL(1, other_url));
1622 1622
1623 Remove(0, GetBookmarkBarNode(0), 0); 1623 Remove(0, GetBookmarkBarNode(0), 0);
1624 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); 1624 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion());
1625 1625
1626 ASSERT_FALSE(HasNodeWithURL(0, bar_url)); 1626 ASSERT_FALSE(HasNodeWithURL(0, bar_url));
1627 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1627 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1628 1628
1629 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS)); 1629 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS));
1630 ASSERT_TRUE(AwaitQuiescence()); 1630 ASSERT_TRUE(AwaitQuiescence());
1631 1631
1632 ASSERT_FALSE(HasNodeWithURL(0, bar_url)); 1632 ASSERT_FALSE(HasNodeWithURL(0, bar_url));
1633 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1633 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1634 ASSERT_FALSE(HasNodeWithURL(1, bar_url)); 1634 ASSERT_FALSE(HasNodeWithURL(1, bar_url));
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 2008
2009 // Remove all 2009 // Remove all
2010 RemoveAll(0); 2010 RemoveAll(0);
2011 2011
2012 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2012 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2013 // Verify other node has no children now. 2013 // Verify other node has no children now.
2014 EXPECT_EQ(0, GetOtherNode(0)->child_count()); 2014 EXPECT_EQ(0, GetOtherNode(0)->child_count());
2015 EXPECT_EQ(0, GetBookmarkBarNode(0)->child_count()); 2015 EXPECT_EQ(0, GetBookmarkBarNode(0)->child_count());
2016 ASSERT_TRUE(AllModelsMatch()); 2016 ASSERT_TRUE(AllModelsMatch());
2017 } 2017 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698