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

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

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 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 // 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 374
375 // Inserts a folder directly to the share. 375 // Inserts a folder directly to the share.
376 // Do not use this after model association is complete. 376 // Do not use this after model association is complete.
377 // 377 //
378 // This function differs from the AddFolder() function declared elsewhere in 378 // This function differs from the AddFolder() function declared elsewhere in
379 // this file in that it only affects the sync model. It would be invalid to 379 // this file in that it only affects the sync model. It would be invalid to
380 // change the sync model directly after ModelAssociation. This function can 380 // change the sync model directly after ModelAssociation. This function can
381 // be invoked prior to model association to set up first-time sync model 381 // be invoked prior to model association to set up first-time sync model
382 // association scenarios. 382 // association scenarios.
383 int64 AddFolderToShare(syncer::WriteTransaction* trans, std::string title) { 383 int64 AddFolderToShare(syncer::WriteTransaction* trans,
384 const std::string& title) {
384 EXPECT_FALSE(model_associator_); 385 EXPECT_FALSE(model_associator_);
385 386
386 // Be sure to call CreatePermanentBookmarkNodes(), otherwise this will fail. 387 // Be sure to call CreatePermanentBookmarkNodes(), otherwise this will fail.
387 syncer::ReadNode bookmark_bar(trans); 388 syncer::ReadNode bookmark_bar(trans);
388 EXPECT_EQ(BaseNode::INIT_OK, 389 EXPECT_EQ(BaseNode::INIT_OK,
389 bookmark_bar.InitByTagLookupForBookmarks("bookmark_bar")); 390 bookmark_bar.InitByTagLookupForBookmarks("bookmark_bar"));
390 391
391 syncer::WriteNode node(trans); 392 syncer::WriteNode node(trans);
392 EXPECT_TRUE(node.InitBookmarkByCreation(bookmark_bar, NULL)); 393 EXPECT_TRUE(node.InitBookmarkByCreation(bookmark_bar, NULL));
393 node.SetIsFolder(true); 394 node.SetIsFolder(true);
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 EXPECT_EQ(syncer::kInvalidId, sync_id); 2601 EXPECT_EQ(syncer::kInvalidId, sync_id);
2601 2602
2602 // Verify that Sync ignores deleting this node. 2603 // Verify that Sync ignores deleting this node.
2603 model_->Remove(node); 2604 model_->Remove(node);
2604 EXPECT_EQ(sync_bookmark_count, GetSyncBookmarkCount()); 2605 EXPECT_EQ(sync_bookmark_count, GetSyncBookmarkCount());
2605 } 2606 }
2606 2607
2607 } // namespace 2608 } // namespace
2608 2609
2609 } // namespace browser_sync 2610 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698