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

Side by Side Diff: chrome/browser/sync/profile_sync_service_bookmark_unittest.cc

Issue 1358783002: Cleanup: Pass std::string as const reference from chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against ToT Created 5 years, 2 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 // TODO(akalin): This file is basically just a unit test for 5 // TODO(akalin): This file is basically just a unit test for
6 // BookmarkChangeProcessor. Write unit tests for 6 // BookmarkChangeProcessor. Write unit tests for
7 // BookmarkModelAssociator separately. 7 // BookmarkModelAssociator separately.
8 8
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 372 }
373 373
374 // Inserts a folder directly to the share. 374 // Inserts a folder directly to the share.
375 // Do not use this after model association is complete. 375 // Do not use this after model association is complete.
376 // 376 //
377 // This function differs from the AddFolder() function declared elsewhere in 377 // This function differs from the AddFolder() function declared elsewhere in
378 // this file in that it only affects the sync model. It would be invalid to 378 // this file in that it only affects the sync model. It would be invalid to
379 // change the sync model directly after ModelAssociation. This function can 379 // change the sync model directly after ModelAssociation. This function can
380 // be invoked prior to model association to set up first-time sync model 380 // be invoked prior to model association to set up first-time sync model
381 // association scenarios. 381 // association scenarios.
382 int64 AddFolderToShare(syncer::WriteTransaction* trans, std::string title) { 382 int64 AddFolderToShare(syncer::WriteTransaction* trans,
383 const std::string& title) {
383 EXPECT_FALSE(model_associator_); 384 EXPECT_FALSE(model_associator_);
384 385
385 // Be sure to call CreatePermanentBookmarkNodes(), otherwise this will fail. 386 // Be sure to call CreatePermanentBookmarkNodes(), otherwise this will fail.
386 syncer::ReadNode bookmark_bar(trans); 387 syncer::ReadNode bookmark_bar(trans);
387 EXPECT_EQ(BaseNode::INIT_OK, 388 EXPECT_EQ(BaseNode::INIT_OK,
388 bookmark_bar.InitByTagLookupForBookmarks("bookmark_bar")); 389 bookmark_bar.InitByTagLookupForBookmarks("bookmark_bar"));
389 390
390 syncer::WriteNode node(trans); 391 syncer::WriteNode node(trans);
391 EXPECT_TRUE(node.InitBookmarkByCreation(bookmark_bar, NULL)); 392 EXPECT_TRUE(node.InitBookmarkByCreation(bookmark_bar, NULL));
392 node.SetIsFolder(true); 393 node.SetIsFolder(true);
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 EXPECT_EQ(syncer::kInvalidId, sync_id); 2600 EXPECT_EQ(syncer::kInvalidId, sync_id);
2600 2601
2601 // Verify that Sync ignores deleting this node. 2602 // Verify that Sync ignores deleting this node.
2602 model_->Remove(node); 2603 model_->Remove(node);
2603 EXPECT_EQ(sync_bookmark_count, GetSyncBookmarkCount()); 2604 EXPECT_EQ(sync_bookmark_count, GetSyncBookmarkCount());
2604 } 2605 }
2605 2606
2606 } // namespace 2607 } // namespace
2607 2608
2608 } // namespace browser_sync 2609 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_service.cc ('k') | chrome/browser/sync_file_system/logger_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698