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

Side by Side Diff: chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc

Issue 5149001: Merge 65840 - Provide sync integration tests with a way to set a favicon for ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/552d/src/
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « chrome/test/live_sync/live_bookmarks_sync_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" 7 #include "chrome/test/live_sync/live_bookmarks_sync_test.h"
8 8
9 const std::string kGenericURL = "http://www.host.ext:1234/path/filename"; 9 const std::string kGenericURL = "http://www.host.ext:1234/path/filename";
10 const std::wstring kGenericURLTitle = L"URL Title"; 10 const std::wstring kGenericURLTitle = L"URL Title";
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 static std::wstring IndexedSubfolderName(int i) { 27 static std::wstring IndexedSubfolderName(int i) {
28 return StringPrintf(L"Subfolder Name %d", i); 28 return StringPrintf(L"Subfolder Name %d", i);
29 } 29 }
30 30
31 static std::wstring IndexedSubsubfolderName(int i) { 31 static std::wstring IndexedSubsubfolderName(int i) {
32 return StringPrintf(L"Subsubfolder Name %d", i); 32 return StringPrintf(L"Subsubfolder Name %d", i);
33 } 33 }
34 34
35 const std::vector<unsigned char> GenericFavicon() {
36 return LiveBookmarksSyncTest::CreateFavicon(254);
37 }
38
39 const std::vector<unsigned char> IndexedFavicon(int i) {
40 return LiveBookmarksSyncTest::CreateFavicon(i);
41 }
42
35 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, Sanity) { 43 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, Sanity) {
36 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 44 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
37 ASSERT_TRUE(AllModelsMatchVerifier()); 45 ASSERT_TRUE(AllModelsMatchVerifier());
38 46
39 GURL google_url("http://www.google.com"); 47 GURL google_url("http://www.google.com");
40 ASSERT_TRUE(AddURL(0, L"Google", google_url) != NULL); 48 ASSERT_TRUE(AddURL(0, L"Google", google_url) != NULL);
41 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 49 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
42 ASSERT_TRUE(AddURL(1, L"Yahoo", GURL("http://www.yahoo.com")) != NULL); 50 ASSERT_TRUE(AddURL(1, L"Yahoo", GURL("http://www.yahoo.com")) != NULL);
43 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); 51 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0)));
44 ASSERT_TRUE(AllModelsMatchVerifier()); 52 ASSERT_TRUE(AllModelsMatchVerifier());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, 113 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest,
106 SC_AddFirstBMWithoutFavicon) { 114 SC_AddFirstBMWithoutFavicon) {
107 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 115 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
108 ASSERT_TRUE(AllModelsMatchVerifier()); 116 ASSERT_TRUE(AllModelsMatchVerifier());
109 117
110 ASSERT_TRUE(AddURL(0, kGenericURLTitle, GURL(kGenericURL)) != NULL); 118 ASSERT_TRUE(AddURL(0, kGenericURLTitle, GURL(kGenericURL)) != NULL);
111 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 119 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
112 ASSERT_TRUE(AllModelsMatchVerifier()); 120 ASSERT_TRUE(AllModelsMatchVerifier());
113 } 121 }
114 122
123 // Test Scribe ID - 370489.
124 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest,
125 SC_AddFirstBMWithFavicon) {
126 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
127 ASSERT_TRUE(AllModelsMatchVerifier());
128
129 const BookmarkNode* bookmark = AddURL(0, kGenericURLTitle, GURL(kGenericURL));
130 ASSERT_TRUE(bookmark != NULL);
131 SetFavicon(0, bookmark, GenericFavicon());
132 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
133 ASSERT_TRUE(AllModelsMatchVerifier());
134 }
135
115 // Test Scribe ID - 370560. 136 // Test Scribe ID - 370560.
116 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, SC_AddNonHTTPBMs) { 137 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, SC_AddNonHTTPBMs) {
117 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 138 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
118 ASSERT_TRUE(AllModelsMatchVerifier()); 139 ASSERT_TRUE(AllModelsMatchVerifier());
119 140
120 ASSERT_TRUE(AddURL( 141 ASSERT_TRUE(AddURL(
121 0, L"FTP URL", GURL("ftp://user:password@host:1234/path")) != NULL); 142 0, L"FTP URL", GURL("ftp://user:password@host:1234/path")) != NULL);
122 ASSERT_TRUE(AddURL(0, L"File URL", GURL("file://host/path")) != NULL); 143 ASSERT_TRUE(AddURL(0, L"File URL", GURL("file://host/path")) != NULL);
123 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 144 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
124 ASSERT_TRUE(AllModelsMatchVerifier()); 145 ASSERT_TRUE(AllModelsMatchVerifier());
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 std::wstring title = IndexedFolderName(j); 1319 std::wstring title = IndexedFolderName(j);
1299 ASSERT_TRUE(AddGroup(i, folder, j, title) != NULL); 1320 ASSERT_TRUE(AddGroup(i, folder, j, title) != NULL);
1300 } 1321 }
1301 } 1322 }
1302 } 1323 }
1303 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1324 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1304 ASSERT_TRUE(AwaitQuiescence()); 1325 ASSERT_TRUE(AwaitQuiescence());
1305 ASSERT_TRUE(AllModelsMatch()); 1326 ASSERT_TRUE(AllModelsMatch());
1306 ASSERT_FALSE(ContainsDuplicateBookmarks(0)); 1327 ASSERT_FALSE(ContainsDuplicateBookmarks(0));
1307 } 1328 }
OLDNEW
« no previous file with comments | « chrome/test/live_sync/live_bookmarks_sync_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698