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

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

Issue 13866037: Ports XMPP Invalidation code from drive_file_sync_service in /sync_file_system to /google_apis/driv… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated tests 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/sync_file_system/drive_file_sync_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 c91de8f769c5648be1e964b7a1157822af756df0..9de4058b2a0cc684d2d1ca5b9d548807060f3893 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
@@ -198,6 +198,14 @@ 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 {
@@ -587,6 +595,13 @@ class DriveFileSyncServiceMockTest : public testing::Test {
.RetiresOnSaturation();
}
+ void SetUpDriveServiceExpectCallsForEmptyRemoteChange() {
+ EXPECT_CALL(*mock_drive_service(),
+ GetChangeList(_, _))
+ .WillOnce(InvokeGetChangeListWithEmptyChange())
+ .RetiresOnSaturation();
+ }
+
// End of mock setup helpers -----------------------------------------------
private:
@@ -705,6 +720,8 @@ 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/sync_file_system/drive_file_sync_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698