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

Unified Diff: components/browser_sync/profile_sync_service_typed_url_unittest.cc

Issue 1302233003: Replace gmock's deprecated SetArgumentPointee with SetArgPointee. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2017 Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/browser_sync/profile_sync_service_typed_url_unittest.cc
diff --git a/components/browser_sync/profile_sync_service_typed_url_unittest.cc b/components/browser_sync/profile_sync_service_typed_url_unittest.cc
index db7db211a5e03d8ab285151e43fe24e783687bd4..c408d6c21799f390c190b06fac3b2344eba67220 100644
--- a/components/browser_sync/profile_sync_service_typed_url_unittest.cc
+++ b/components/browser_sync/profile_sync_service_typed_url_unittest.cc
@@ -48,7 +48,7 @@ using history::HistoryBackendNotifier;
using history::TypedUrlSyncableService;
using testing::DoAll;
using testing::Return;
-using testing::SetArgumentPointee;
+using testing::SetArgPointee;
using testing::_;
namespace browser_sync {
@@ -419,9 +419,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeEmptySync) {
MakeTypedUrlEntry("http://foo.com", "bar", 2, 15, false, &visits));
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<2>(visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(visits), Return(true)));
SetIdleChangeProcessorExpectations();
CreateRootHelper create_root(this, syncer::TYPED_URLS);
TypedUrlSyncableService* syncable_service =
@@ -443,7 +443,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeErrorReadingVisits) {
entries.push_back(native_entry1);
entries.push_back(native_entry2);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(entries), Return(true)));
// Return an error from GetMostRecentVisitsForURL() for the second URL.
EXPECT_CALL((history_backend()),
GetMostRecentVisitsForURL(native_entry1.id(), _, _))
@@ -468,9 +468,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeWithBlankEmptySync) {
entries.push_back(
MakeTypedUrlEntry("http://foo.com", "bar", 2, 15, false, &visits));
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<2>(visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(visits), Return(true)));
SetIdleChangeProcessorExpectations();
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
@@ -492,10 +492,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeHasSyncNoMerge) {
history::URLRows native_entries;
native_entries.push_back(native_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(native_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(native_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(native_visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(native_visits), Return(true)));
EXPECT_CALL((history_backend()), AddVisits(_, _, history::SOURCE_SYNCED))
.WillRepeatedly(Return(true));
@@ -553,10 +552,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeHasSyncMerge) {
history::URLRows native_entries;
native_entries.push_back(native_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(native_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(native_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(native_visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(native_visits), Return(true)));
EXPECT_CALL((history_backend()), AddVisits(_, _, history::SOURCE_SYNCED))
.WillRepeatedly(Return(true));
@@ -585,12 +583,12 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeWithErrorHasSyncMerge) {
history::URLRows native_entries;
native_entries.push_back(native_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(native_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(native_entries), Return(true)));
// Return an error getting the visits for the native URL.
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
.WillRepeatedly(Return(false));
EXPECT_CALL((history_backend()), GetURL(_, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<1>(native_entry), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<1>(native_entry), Return(true)));
EXPECT_CALL((history_backend()), AddVisits(_, _, history::SOURCE_SYNCED))
.WillRepeatedly(Return(true));
@@ -615,7 +613,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAdd) {
EXPECT_CALL((history_backend()), GetAllTypedURLs(_)).WillOnce(Return(true));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillOnce(DoAll(SetArgumentPointee<2>(added_visits), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<2>(added_visits), Return(true)));
SetIdleChangeProcessorExpectations();
CreateRootHelper create_root(this, syncer::TYPED_URLS);
@@ -640,7 +638,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAddWithBlank) {
EXPECT_CALL((history_backend()), GetAllTypedURLs(_)).WillOnce(Return(true));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<2>(added_visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(added_visits), Return(true)));
SetIdleChangeProcessorExpectations();
CreateRootHelper create_root(this, syncer::TYPED_URLS);
@@ -665,9 +663,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdate) {
original_entries.push_back(original_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillOnce(DoAll(SetArgumentPointee<2>(original_visits), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<2>(original_visits), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
@@ -675,7 +673,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdate) {
history::URLRow updated_entry(MakeTypedUrlEntry("http://mine.com", "entry", 7,
17, false, &updated_visits));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillOnce(DoAll(SetArgumentPointee<2>(updated_visits), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<2>(updated_visits), Return(true)));
history::URLRows changed_urls;
changed_urls.push_back(updated_entry);
@@ -694,7 +692,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAddFromVisit) {
EXPECT_CALL((history_backend()), GetAllTypedURLs(_)).WillOnce(Return(true));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillOnce(DoAll(SetArgumentPointee<2>(added_visits), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<2>(added_visits), Return(true)));
SetIdleChangeProcessorExpectations();
CreateRootHelper create_root(this, syncer::TYPED_URLS);
@@ -716,9 +714,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdateFromVisit) {
original_entries.push_back(original_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillOnce(DoAll(SetArgumentPointee<2>(original_visits), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<2>(original_visits), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
@@ -726,7 +724,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdateFromVisit) {
history::URLRow updated_entry(MakeTypedUrlEntry("http://mine.com", "entry", 7,
17, false, &updated_visits));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillOnce(DoAll(SetArgumentPointee<2>(updated_visits), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<2>(updated_visits), Return(true)));
SendNotificationURLVisited(ui::PAGE_TRANSITION_TYPED, updated_entry);
@@ -744,10 +742,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) {
original_entries.push_back(original_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(original_visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(original_visits), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
history::URLRows new_sync_entries;
@@ -801,10 +798,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemove) {
original_entries.push_back(original_entry2);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(original_visits1), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(original_visits1), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
@@ -829,10 +825,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemoveExpired) {
original_entries.push_back(original_entry2);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(original_visits1), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(original_visits1), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
@@ -858,10 +853,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemoveAll) {
original_entries.push_back(original_entry2);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(original_visits1), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(original_visits1), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
@@ -887,12 +881,11 @@ TEST_F(ProfileSyncServiceTypedUrlTest, FailWriteToHistoryBackend) {
history::URLRows native_entries;
native_entries.push_back(native_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(native_entries), Return(true)));
+ .WillOnce(DoAll(SetArgPointee<0>(native_entries), Return(true)));
EXPECT_CALL((history_backend()), GetURL(_, _))
- .WillOnce(DoAll(SetArgumentPointee<1>(native_entry), Return(false)));
+ .WillOnce(DoAll(SetArgPointee<1>(native_entry), Return(false)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(native_visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(native_visits), Return(true)));
EXPECT_CALL((history_backend()), AddVisits(_, _, history::SOURCE_SYNCED))
.WillRepeatedly(Return(false));
@@ -924,7 +917,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, FailToGetTypedURLs) {
history::URLRows native_entries;
native_entries.push_back(native_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillOnce(DoAll(SetArgumentPointee<0>(native_entries), Return(false)));
+ .WillOnce(DoAll(SetArgPointee<0>(native_entries), Return(false)));
history::URLRows sync_entries;
sync_entries.push_back(sync_entry);
@@ -953,11 +946,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, IgnoreLocalFileURL) {
original_entries.push_back(file_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(original_visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(original_visits), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());
@@ -998,11 +989,9 @@ TEST_F(ProfileSyncServiceTypedUrlTest, IgnoreLocalhostURL) {
original_entries.push_back(localhost_entry);
EXPECT_CALL((history_backend()), GetAllTypedURLs(_))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<0>(original_entries), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<0>(original_entries), Return(true)));
EXPECT_CALL((history_backend()), GetMostRecentVisitsForURL(_, _, _))
- .WillRepeatedly(
- DoAll(SetArgumentPointee<2>(original_visits), Return(true)));
+ .WillRepeatedly(DoAll(SetArgPointee<2>(original_visits), Return(true)));
CreateRootHelper create_root(this, syncer::TYPED_URLS);
StartSyncService(create_root.callback());

Powered by Google App Engine
This is Rietveld 408576698