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

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

Issue 2365763002: [Sync] Removed passphrase helper methods, removed ((n)) pattern, and fixed lint violations. (Closed)
Patch Set: Removed useless pass-through accessors. Created 4 years, 3 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/rand_util.h" 11 #include "base/rand_util.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "chrome/browser/policy/profile_policy_connector_factory.h" 16 #include "chrome/browser/policy/profile_policy_connector_factory.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" 18 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
19 #include "chrome/browser/sync/test/integration/passwords_helper.h"
20 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" 19 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
21 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" 20 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
22 #include "chrome/browser/sync/test/integration/sync_test.h" 21 #include "chrome/browser/sync/test/integration/sync_test.h"
23 #include "components/bookmarks/browser/bookmark_node.h" 22 #include "components/bookmarks/browser/bookmark_node.h"
23 #include "components/browser_sync/profile_sync_service.h"
24 #include "components/policy/core/common/mock_configuration_policy_provider.h" 24 #include "components/policy/core/common/mock_configuration_policy_provider.h"
25 #include "components/policy/core/common/policy_map.h" 25 #include "components/policy/core/common/policy_map.h"
26 #include "components/policy/core/common/policy_types.h" 26 #include "components/policy/core/common/policy_types.h"
27 #include "components/policy/policy_constants.h" 27 #include "components/policy/policy_constants.h"
28 #include "components/sync/driver/sync_service.h"
28 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" 29 #include "components/sync/engine/cycle/sync_cycle_snapshot.h"
29 #include "testing/gmock/include/gmock/gmock.h" 30 #include "testing/gmock/include/gmock/gmock.h"
30 #include "ui/base/layout.h" 31 #include "ui/base/layout.h"
31 32
32 using bookmarks::BookmarkNode; 33 using bookmarks::BookmarkNode;
33 using bookmarks_helper::AddFolder; 34 using bookmarks_helper::AddFolder;
34 using bookmarks_helper::AddURL; 35 using bookmarks_helper::AddURL;
35 using bookmarks_helper::AllModelsMatch; 36 using bookmarks_helper::AllModelsMatch;
36 using bookmarks_helper::AllModelsMatchVerifier; 37 using bookmarks_helper::AllModelsMatchVerifier;
37 using bookmarks_helper::AwaitAllModelsMatch; 38 using bookmarks_helper::AwaitAllModelsMatch;
(...skipping 17 matching lines...) Expand all
55 using bookmarks_helper::IndexedURL; 56 using bookmarks_helper::IndexedURL;
56 using bookmarks_helper::IndexedURLTitle; 57 using bookmarks_helper::IndexedURLTitle;
57 using bookmarks_helper::Move; 58 using bookmarks_helper::Move;
58 using bookmarks_helper::Remove; 59 using bookmarks_helper::Remove;
59 using bookmarks_helper::RemoveAll; 60 using bookmarks_helper::RemoveAll;
60 using bookmarks_helper::ReverseChildOrder; 61 using bookmarks_helper::ReverseChildOrder;
61 using bookmarks_helper::SetFavicon; 62 using bookmarks_helper::SetFavicon;
62 using bookmarks_helper::SetTitle; 63 using bookmarks_helper::SetTitle;
63 using bookmarks_helper::SetURL; 64 using bookmarks_helper::SetURL;
64 using bookmarks_helper::SortChildren; 65 using bookmarks_helper::SortChildren;
65 using passwords_helper::SetDecryptionPassphrase;
66 using passwords_helper::SetEncryptionPassphrase;
67 using sync_integration_test_util::AwaitCommitActivityCompletion; 66 using sync_integration_test_util::AwaitCommitActivityCompletion;
68 using sync_integration_test_util::AwaitPassphraseAccepted; 67 using sync_integration_test_util::AwaitPassphraseAccepted;
69 using sync_integration_test_util::AwaitPassphraseRequired; 68 using sync_integration_test_util::AwaitPassphraseRequired;
70 69
71 namespace { 70 namespace {
72 71
73 const char kGenericURL[] = "http://www.host.ext:1234/path/filename"; 72 const char kGenericURL[] = "http://www.host.ext:1234/path/filename";
74 const char kGenericURLTitle[] = "URL Title"; 73 const char kGenericURLTitle[] = "URL Title";
75 const char kGenericFolderName[] = "Folder Name"; 74 const char kGenericFolderName[] = "Folder Name";
76 const char kGenericSubfolderName[] = "Subfolder Name"; 75 const char kGenericSubfolderName[] = "Subfolder Name";
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 ASSERT_TRUE(AllModelsMatchVerifier()); 951 ASSERT_TRUE(AllModelsMatchVerifier());
953 952
954 ReverseChildOrder(0, GetBookmarkBarNode(0)); 953 ReverseChildOrder(0, GetBookmarkBarNode(0));
955 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 954 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
956 ASSERT_TRUE(AllModelsMatchVerifier()); 955 ASSERT_TRUE(AllModelsMatchVerifier());
957 } 956 }
958 957
959 // Test Scribe ID - 371954. 958 // Test Scribe ID - 371954.
960 // flaky on Windows: http://crbug.com/412169 959 // flaky on Windows: http://crbug.com/412169
961 #if defined(OS_WIN) || defined(OS_MACOSX) 960 #if defined(OS_WIN) || defined(OS_MACOSX)
962 #define MAYBE_SC_MovingBMsFromBMBarToBMFolder DISABLED_SC_MovingBMsFromBMBarToBM Folder 961 #define MAYBE_SC_MovingBMsFromBMBarToBMFolder \
962 DISABLED_SC_MovingBMsFromBMBarToBMFolder
963 #else 963 #else
964 #define MAYBE_SC_MovingBMsFromBMBarToBMFolder SC_MovingBMsFromBMBarToBMFolder 964 #define MAYBE_SC_MovingBMsFromBMBarToBMFolder SC_MovingBMsFromBMBarToBMFolder
965 #endif 965 #endif
966 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, 966 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest,
967 MAYBE_SC_MovingBMsFromBMBarToBMFolder) { 967 MAYBE_SC_MovingBMsFromBMBarToBMFolder) {
968 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 968 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
969 ASSERT_TRUE(AllModelsMatchVerifier()); 969 ASSERT_TRUE(AllModelsMatchVerifier());
970 970
971 ASSERT_TRUE(AddURL(0, kGenericURLTitle, GURL(kGenericURL)) != NULL); 971 ASSERT_TRUE(AddURL(0, kGenericURLTitle, GURL(kGenericURL)) != NULL);
972 const BookmarkNode* folder = AddFolder(0, 1, kGenericFolderName); 972 const BookmarkNode* folder = AddFolder(0, 1, kGenericFolderName);
(...skipping 12 matching lines...) Expand all
985 Move( 985 Move(
986 0, GetBookmarkBarNode(0)->GetChild(2), folder, i); 986 0, GetBookmarkBarNode(0)->GetChild(2), folder, i);
987 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 987 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
988 ASSERT_TRUE(AllModelsMatchVerifier()); 988 ASSERT_TRUE(AllModelsMatchVerifier());
989 } 989 }
990 } 990 }
991 991
992 // Test Scribe ID - 371957. 992 // Test Scribe ID - 371957.
993 // flaky on Windows and Mac: http://crbug.com/412169 993 // flaky on Windows and Mac: http://crbug.com/412169
994 #if defined(OS_WIN) || defined(OS_MACOSX) 994 #if defined(OS_WIN) || defined(OS_MACOSX)
995 #define MAYBE_SC_MovingBMsFromBMFoldToBMBar DISABLED_SC_MovingBMsFromBMFoldToBMB ar 995 #define MAYBE_SC_MovingBMsFromBMFoldToBMBar \
996 DISABLED_SC_MovingBMsFromBMFoldToBMBar
996 #else 997 #else
997 #define MAYBE_SC_MovingBMsFromBMFoldToBMBar SC_MovingBMsFromBMFoldToBMBar 998 #define MAYBE_SC_MovingBMsFromBMFoldToBMBar SC_MovingBMsFromBMFoldToBMBar
998 #endif 999 #endif
999 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, 1000 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest,
1000 MAYBE_SC_MovingBMsFromBMFoldToBMBar) { 1001 MAYBE_SC_MovingBMsFromBMFoldToBMBar) {
1001 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1002 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1002 ASSERT_TRUE(AllModelsMatchVerifier()); 1003 ASSERT_TRUE(AllModelsMatchVerifier());
1003 1004
1004 ASSERT_TRUE(AddURL(0, kGenericURLTitle, GURL(kGenericURL)) != NULL); 1005 ASSERT_TRUE(AddURL(0, kGenericURLTitle, GURL(kGenericURL)) != NULL);
1005 const BookmarkNode* folder = AddFolder(0, 1, kGenericFolderName); 1006 const BookmarkNode* folder = AddFolder(0, 1, kGenericFolderName);
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 ASSERT_TRUE(AllModelsMatch()); 1712 ASSERT_TRUE(AllModelsMatch());
1712 } 1713 }
1713 1714
1714 // TCM ID - 7343544. 1715 // TCM ID - 7343544.
1715 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, DisableSync) { 1716 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, DisableSync) {
1716 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1717 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1717 ASSERT_TRUE(AllModelsMatchVerifier()); 1718 ASSERT_TRUE(AllModelsMatchVerifier());
1718 1719
1719 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); 1720 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes());
1720 ASSERT_TRUE(AddFolder(0, IndexedFolderName(0)) != NULL); 1721 ASSERT_TRUE(AddFolder(0, IndexedFolderName(0)) != NULL);
1721 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); 1722 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0)));
1722 ASSERT_FALSE(AllModelsMatch()); 1723 ASSERT_FALSE(AllModelsMatch());
1723 1724
1724 ASSERT_TRUE(AddFolder(1, IndexedFolderName(1)) != NULL); 1725 ASSERT_TRUE(AddFolder(1, IndexedFolderName(1)) != NULL);
1725 ASSERT_FALSE(AllModelsMatch()); 1726 ASSERT_FALSE(AllModelsMatch());
1726 1727
1727 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); 1728 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes());
1728 ASSERT_TRUE(AwaitQuiescence()); 1729 ASSERT_TRUE(AwaitQuiescence());
1729 ASSERT_TRUE(AllModelsMatch()); 1730 ASSERT_TRUE(AllModelsMatch());
1730 } 1731 }
1731 1732
(...skipping 26 matching lines...) Expand all
1758 IN_PROC_BROWSER_TEST_F(LegacyTwoClientBookmarksSyncTest, MC_DeleteBookmark) { 1759 IN_PROC_BROWSER_TEST_F(LegacyTwoClientBookmarksSyncTest, MC_DeleteBookmark) {
1759 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1760 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1760 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS)); 1761 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS));
1761 1762
1762 const GURL bar_url("http://example.com/bar"); 1763 const GURL bar_url("http://example.com/bar");
1763 const GURL other_url("http://example.com/other"); 1764 const GURL other_url("http://example.com/other");
1764 1765
1765 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, "bar", bar_url) != NULL); 1766 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, "bar", bar_url) != NULL);
1766 ASSERT_TRUE(AddURL(0, GetOtherNode(0), 0, "other", other_url) != NULL); 1767 ASSERT_TRUE(AddURL(0, GetOtherNode(0), 0, "other", other_url) != NULL);
1767 1768
1768 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); 1769 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0)));
1769 1770
1770 ASSERT_TRUE(HasNodeWithURL(0, bar_url)); 1771 ASSERT_TRUE(HasNodeWithURL(0, bar_url));
1771 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1772 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1772 ASSERT_FALSE(HasNodeWithURL(1, bar_url)); 1773 ASSERT_FALSE(HasNodeWithURL(1, bar_url));
1773 ASSERT_FALSE(HasNodeWithURL(1, other_url)); 1774 ASSERT_FALSE(HasNodeWithURL(1, other_url));
1774 1775
1775 Remove(0, GetBookmarkBarNode(0), 0); 1776 Remove(0, GetBookmarkBarNode(0), 0);
1776 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); 1777 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0)));
1777 1778
1778 ASSERT_FALSE(HasNodeWithURL(0, bar_url)); 1779 ASSERT_FALSE(HasNodeWithURL(0, bar_url));
1779 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1780 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1780 1781
1781 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS)); 1782 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS));
1782 ASSERT_TRUE(AwaitQuiescence()); 1783 ASSERT_TRUE(AwaitQuiescence());
1783 1784
1784 ASSERT_FALSE(HasNodeWithURL(0, bar_url)); 1785 ASSERT_FALSE(HasNodeWithURL(0, bar_url));
1785 ASSERT_TRUE(HasNodeWithURL(0, other_url)); 1786 ASSERT_TRUE(HasNodeWithURL(0, other_url));
1786 ASSERT_FALSE(HasNodeWithURL(1, bar_url)); 1787 ASSERT_FALSE(HasNodeWithURL(1, bar_url));
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 1995
1995 // Add initial bookmarks. 1996 // Add initial bookmarks.
1996 ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); 1997 ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL);
1997 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL); 1998 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL);
1998 ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL); 1999 ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL);
1999 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2000 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2000 ASSERT_TRUE(AllModelsMatchVerifier()); 2001 ASSERT_TRUE(AllModelsMatchVerifier());
2001 2002
2002 // Set a passphrase and enable encryption on Client 0. Client 1 will not 2003 // Set a passphrase and enable encryption on Client 0. Client 1 will not
2003 // understand the bookmark updates. 2004 // understand the bookmark updates.
2004 SetEncryptionPassphrase(0, kValidPassphrase, 2005 GetSyncService(0)->SetEncryptionPassphrase(
2005 browser_sync::ProfileSyncService::EXPLICIT); 2006 kValidPassphrase, sync_driver::SyncService::EXPLICIT);
2006 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService((0)))); 2007 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(0)));
2007 ASSERT_TRUE(EnableEncryption(0)); 2008 ASSERT_TRUE(EnableEncryption(0));
2008 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2009 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2009 ASSERT_TRUE(IsEncryptionComplete(0)); 2010 ASSERT_TRUE(IsEncryptionComplete(0));
2010 ASSERT_TRUE(IsEncryptionComplete(1)); 2011 ASSERT_TRUE(IsEncryptionComplete(1));
2011 ASSERT_TRUE(GetSyncService((1))->IsPassphraseRequired()); 2012 ASSERT_TRUE(GetSyncService(1)->IsPassphraseRequired());
2012 2013
2013 // Client 1 adds bookmarks between the first two and between the second two. 2014 // Client 1 adds bookmarks between the first two and between the second two.
2014 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL); 2015 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL);
2015 ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL); 2016 ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL);
2016 EXPECT_FALSE(AllModelsMatchVerifier()); 2017 EXPECT_FALSE(AllModelsMatchVerifier());
2017 EXPECT_FALSE(AllModelsMatch()); 2018 EXPECT_FALSE(AllModelsMatch());
2018 2019
2019 // Set the passphrase. Everything should resolve. 2020 // Set the passphrase. Everything should resolve.
2020 ASSERT_TRUE(AwaitPassphraseRequired(GetSyncService((1)))); 2021 ASSERT_TRUE(AwaitPassphraseRequired(GetSyncService(1)));
2021 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); 2022 ASSERT_TRUE(GetSyncService(1)->SetDecryptionPassphrase(kValidPassphrase));
2022 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService((1)))); 2023 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(1)));
2023 ASSERT_TRUE(AwaitQuiescence()); 2024 ASSERT_TRUE(AwaitQuiescence());
2024 EXPECT_TRUE(AllModelsMatch()); 2025 EXPECT_TRUE(AllModelsMatch());
2025 ASSERT_EQ(0, GetClient(1)->GetLastCycleSnapshot().num_encryption_conflicts()); 2026 ASSERT_EQ(0, GetClient(1)->GetLastCycleSnapshot().num_encryption_conflicts());
2026 2027
2027 // Ensure everything is syncing normally by appending a final bookmark. 2028 // Ensure everything is syncing normally by appending a final bookmark.
2028 ASSERT_TRUE(AddURL(1, 5, IndexedURLTitle(5), GURL(IndexedURL(5))) != NULL); 2029 ASSERT_TRUE(AddURL(1, 5, IndexedURLTitle(5), GURL(IndexedURL(5))) != NULL);
2029 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); 2030 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0)));
2030 EXPECT_TRUE(AllModelsMatch()); 2031 EXPECT_TRUE(AllModelsMatch());
2031 ASSERT_EQ(0, GetClient(1)->GetLastCycleSnapshot().num_encryption_conflicts()); 2032 ASSERT_EQ(0, GetClient(1)->GetLastCycleSnapshot().num_encryption_conflicts());
2032 } 2033 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 const BookmarkNode* synced_bookmarks = GetSyncedBookmarksNode(0); 2114 const BookmarkNode* synced_bookmarks = GetSyncedBookmarksNode(0);
2114 ASSERT_TRUE(synced_bookmarks); 2115 ASSERT_TRUE(synced_bookmarks);
2115 ASSERT_TRUE(AddURL(0, synced_bookmarks, 0, "Google2", 2116 ASSERT_TRUE(AddURL(0, synced_bookmarks, 0, "Google2",
2116 GURL("http://www.google2.com"))); 2117 GURL("http://www.google2.com")));
2117 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2118 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2118 ASSERT_TRUE(AllModelsMatch()); 2119 ASSERT_TRUE(AllModelsMatch());
2119 } 2120 }
2120 2121
2121 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, 2122 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest,
2122 BookmarkAllNodesRemovedEvent) { 2123 BookmarkAllNodesRemovedEvent) {
2123
2124 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 2124 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
2125 ASSERT_TRUE(AllModelsMatchVerifier()); 2125 ASSERT_TRUE(AllModelsMatchVerifier());
2126 2126
2127 // Starting state: 2127 // Starting state:
2128 // other_node 2128 // other_node
2129 // -> folder0 2129 // -> folder0
2130 // -> tier1_a 2130 // -> tier1_a
2131 // -> http://mail.google.com 2131 // -> http://mail.google.com
2132 // -> http://www.google.com 2132 // -> http://www.google.com
2133 // -> http://news.google.com 2133 // -> http://news.google.com
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
2341 // second client. 2341 // second client.
2342 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS)); 2342 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS));
2343 const std::string url_title_2 = "another happy little url"; 2343 const std::string url_title_2 = "another happy little url";
2344 const GURL url_2("https://example.com/second"); 2344 const GURL url_2("https://example.com/second");
2345 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, url_title_2, url_2) != NULL); 2345 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, url_title_2, url_2) != NULL);
2346 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS)); 2346 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS));
2347 ASSERT_TRUE(AwaitAllModelsMatch()); 2347 ASSERT_TRUE(AwaitAllModelsMatch());
2348 ASSERT_EQ(initial_count + 2, CountAllBookmarks(0)); 2348 ASSERT_EQ(initial_count + 2, CountAllBookmarks(0));
2349 ASSERT_EQ(initial_count + 2, CountAllBookmarks(1)); 2349 ASSERT_EQ(initial_count + 2, CountAllBookmarks(1));
2350 } 2350 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698