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

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

Issue 2335193006: [Sync] Fix namespaces for the sync_bookmarks component. (Closed)
Patch Set: This is what I get for de-linting. 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
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_components_factory_impl.cc » ('j') | 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) 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 "chrome/browser/sync/test/integration/bookmarks_helper.h" 5 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory>
9 #include <set> 10 #include <set>
11 #include <stack>
10 #include <vector> 12 #include <vector>
11 13
12 #include "base/bind.h" 14 #include "base/bind.h"
13 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
14 #include "base/files/file_util.h" 16 #include "base/files/file_util.h"
15 #include "base/macros.h" 17 #include "base/macros.h"
16 #include "base/path_service.h" 18 #include "base/path_service.h"
17 #include "base/rand_util.h" 19 #include "base/rand_util.h"
18 #include "base/run_loop.h" 20 #include "base/run_loop.h"
19 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 FaviconChangeObserver observer(model, node); 262 FaviconChangeObserver observer(model, node);
261 favicon::FaviconService* favicon_service = 263 favicon::FaviconService* favicon_service =
262 FaviconServiceFactory::GetForProfile(profile, 264 FaviconServiceFactory::GetForProfile(profile,
263 ServiceAccessType::EXPLICIT_ACCESS); 265 ServiceAccessType::EXPLICIT_ACCESS);
264 if (favicon_source == bookmarks_helper::FROM_UI) { 266 if (favicon_source == bookmarks_helper::FROM_UI) {
265 favicon_service->SetFavicons(node->url(), icon_url, favicon_base::FAVICON, 267 favicon_service->SetFavicons(node->url(), icon_url, favicon_base::FAVICON,
266 image); 268 image);
267 } else { 269 } else {
268 ProfileSyncService* pss = 270 ProfileSyncService* pss =
269 ProfileSyncServiceFactory::GetForProfile(profile); 271 ProfileSyncServiceFactory::GetForProfile(profile);
270 browser_sync::BookmarkChangeProcessor::ApplyBookmarkFavicon( 272 sync_bookmarks::BookmarkChangeProcessor::ApplyBookmarkFavicon(
271 node, pss->GetSyncClient(), icon_url, image.As1xPNGBytes()); 273 node, pss->GetSyncClient(), icon_url, image.As1xPNGBytes());
272 } 274 }
273 275
274 // Wait for the favicon for |node| to be invalidated. 276 // Wait for the favicon for |node| to be invalidated.
275 observer.WaitForSetFavicon(); 277 observer.WaitForSetFavicon();
276 // Wait for the BookmarkModel to fetch the updated favicon and for the new 278 // Wait for the BookmarkModel to fetch the updated favicon and for the new
277 // favicon to be sent to BookmarkChangeProcessor. 279 // favicon to be sent to BookmarkChangeProcessor.
278 GetFaviconData(model, node); 280 GetFaviconData(model, node);
279 } 281 }
280 282
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 898
897 bool ContainsDuplicateBookmarks(int profile) { 899 bool ContainsDuplicateBookmarks(int profile) {
898 ui::TreeNodeIterator<const BookmarkNode> iterator( 900 ui::TreeNodeIterator<const BookmarkNode> iterator(
899 GetBookmarkModel(profile)->root_node()); 901 GetBookmarkModel(profile)->root_node());
900 while (iterator.has_next()) { 902 while (iterator.has_next()) {
901 const BookmarkNode* node = iterator.Next(); 903 const BookmarkNode* node = iterator.Next();
902 if (node->is_folder()) 904 if (node->is_folder())
903 continue; 905 continue;
904 std::vector<const BookmarkNode*> nodes; 906 std::vector<const BookmarkNode*> nodes;
905 GetBookmarkModel(profile)->GetNodesByURL(node->url(), &nodes); 907 GetBookmarkModel(profile)->GetNodesByURL(node->url(), &nodes);
906 EXPECT_TRUE(nodes.size() >= 1); 908 EXPECT_GE(nodes.size(), 1U);
907 for (std::vector<const BookmarkNode*>::const_iterator it = nodes.begin(); 909 for (std::vector<const BookmarkNode*>::const_iterator it = nodes.begin();
908 it != nodes.end(); ++it) { 910 it != nodes.end(); ++it) {
909 if (node->id() != (*it)->id() && 911 if (node->id() != (*it)->id() &&
910 node->parent() == (*it)->parent() && 912 node->parent() == (*it)->parent() &&
911 node->GetTitle() == (*it)->GetTitle()){ 913 node->GetTitle() == (*it)->GetTitle()) {
912 return true; 914 return true;
913 } 915 }
914 } 916 }
915 } 917 }
916 return false; 918 return false;
917 } 919 }
918 920
919 bool HasNodeWithURL(int profile, const GURL& url) { 921 bool HasNodeWithURL(int profile, const GURL& url) {
920 std::vector<const BookmarkNode*> nodes; 922 std::vector<const BookmarkNode*> nodes;
921 GetBookmarkModel(profile)->GetNodesByURL(url, &nodes); 923 GetBookmarkModel(profile)->GetNodesByURL(url, &nodes);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 1003
1002 std::string IndexedSubfolderName(int i) { 1004 std::string IndexedSubfolderName(int i) {
1003 return base::StringPrintf("Subfolder Name %d", i); 1005 return base::StringPrintf("Subfolder Name %d", i);
1004 } 1006 }
1005 1007
1006 std::string IndexedSubsubfolderName(int i) { 1008 std::string IndexedSubsubfolderName(int i) {
1007 return base::StringPrintf("Subsubfolder Name %d", i); 1009 return base::StringPrintf("Subsubfolder Name %d", i);
1008 } 1010 }
1009 1011
1010 } // namespace bookmarks_helper 1012 } // namespace bookmarks_helper
OLDNEW
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_components_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698