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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc

Issue 14322009: Sync FileSystem: Add default mock expectation for MockDriveService::GetChangeList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/StrictMock/NiceMock/ Created 7 years, 8 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
« no previous file with comments | « chrome/browser/google_apis/mock_drive_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
index 6afd83dce39a54b64c0431a43212425d3f25d4fc..3cb88895e47a61f14459debf5993def37171864d 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
@@ -41,6 +41,7 @@ using ::testing::AtLeast;
using ::testing::AtMost;
using ::testing::InSequence;
using ::testing::Return;
+using ::testing::NiceMock;
using ::testing::Sequence;
using ::testing::StrictMock;
using ::testing::_;
@@ -204,14 +205,6 @@ ACTION(InvokeDidApplyRemoteChange) {
FROM_HERE, base::Bind(arg3, SYNC_STATUS_OK));
}
-ACTION(InvokeGetChangeListWithEmptyChange) {
- scoped_ptr<google_apis::ResourceList> resource_list(
- new google_apis::ResourceList());
- base::MessageLoopProxy::current()->PostTask(
- FROM_HERE, base::Bind(arg1, google_apis::HTTP_SUCCESS,
- base::Passed(&resource_list)));
-}
-
} // namespace
class MockRemoteServiceObserver : public RemoteFileSyncService::Observer {
@@ -264,7 +257,7 @@ class DriveFileSyncServiceMockTest : public testing::Test {
ASSERT_TRUE(RegisterSyncableFileSystem(kServiceName));
- mock_drive_service_ = new StrictMock<google_apis::MockDriveService>;
+ mock_drive_service_ = new NiceMock<google_apis::MockDriveService>;
EXPECT_CALL(*mock_drive_service(), Initialize(profile_.get()));
EXPECT_CALL(*mock_drive_service(), AddObserver(_));
@@ -437,7 +430,7 @@ class DriveFileSyncServiceMockTest : public testing::Test {
return sync_service_->metadata_store_.get();
}
- StrictMock<google_apis::MockDriveService>* mock_drive_service() {
+ NiceMock<google_apis::MockDriveService>* mock_drive_service() {
return mock_drive_service_;
}
@@ -634,13 +627,6 @@ class DriveFileSyncServiceMockTest : public testing::Test {
.RetiresOnSaturation();
}
- void SetUpDriveServiceExpectCallsForEmptyRemoteChange() {
- EXPECT_CALL(*mock_drive_service(),
- GetChangeList(_, _))
- .WillOnce(InvokeGetChangeListWithEmptyChange())
- .RetiresOnSaturation();
- }
-
// End of mock setup helpers -----------------------------------------------
private:
@@ -657,7 +643,7 @@ class DriveFileSyncServiceMockTest : public testing::Test {
ExtensionService* extension_service_;
// Owned by |sync_client_|.
- StrictMock<google_apis::MockDriveService>* mock_drive_service_;
+ NiceMock<google_apis::MockDriveService>* mock_drive_service_;
StrictMock<MockRemoteServiceObserver> mock_remote_observer_;
StrictMock<MockFileStatusObserver> mock_file_status_observer_;
@@ -761,8 +747,6 @@ TEST_F(DriveFileSyncServiceMockTest, RegisterNewOrigin) {
"chromeos/sync_file_system/listing_files_in_empty_directory.json",
kDirectoryResourceId);
- SetUpDriveServiceExpectCallsForEmptyRemoteChange();
-
SetUpDriveSyncService(true);
bool done = false;
sync_service()->RegisterOriginForTrackingChanges(
« no previous file with comments | « chrome/browser/google_apis/mock_drive_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698