Chromium Code Reviews| Index: chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc |
| diff --git a/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc b/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc |
| index 48554ba5ce5734c9dac34ab394b5cd2549b4d35f..91cc03252cbde9ca5af97b2e54990a757f58ddb3 100644 |
| --- a/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc |
| +++ b/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc |
| @@ -25,7 +25,6 @@ |
| #include "chrome/browser/google_apis/drive_api_parser.h" |
| #include "chrome/browser/google_apis/drive_uploader.h" |
| #include "chrome/browser/google_apis/mock_drive_service.h" |
| -#include "chrome/browser/google_apis/mock_drive_uploader.h" |
| #include "chrome/browser/google_apis/time_util.h" |
| #include "chrome/test/base/testing_profile.h" |
| #include "content/public/browser/browser_thread.h" |
| @@ -53,6 +52,64 @@ void VerifyCacheFileState(DriveFileError error, |
| EXPECT_EQ(DRIVE_FILE_OK, error); |
| } |
| +// Stub implementation of DriveUploaderInterface which does nothing. |
|
kinaba
2012/11/22 06:12:13
After looking the code below, I've changed my mind
satorux1
2012/11/22 06:16:13
Agreed... It's hard to distinguish those friends.
|
| +// Used to create a DriveFileSystem object. |
| +class StubDriveUploader : public google_apis::DriveUploaderInterface { |
| + public: |
| + StubDriveUploader() {}; |
|
kinaba
2012/11/22 06:12:13
Semicolon not needed.
satorux1
2012/11/22 06:16:13
Done.
|
| + virtual ~StubDriveUploader() {}; |
|
kinaba
2012/11/22 06:12:13
ditto.
satorux1
2012/11/22 06:16:13
Done.
|
| + |
| + // DriveUploaderInterface overrides. |
| + virtual int UploadNewFile( |
| + const GURL& upload_location, |
| + const FilePath& drive_file_path, |
| + const FilePath& local_file_path, |
| + const std::string& title, |
| + const std::string& content_type, |
| + int64 content_length, |
| + int64 file_size, |
| + const google_apis::UploadCompletionCallback& completion_callback, |
| + const google_apis::UploaderReadyCallback& ready_callback) OVERRIDE { |
| + NOTREACHED(); |
| + return 0; |
| + } |
| + |
| + virtual int StreamExistingFile( |
| + const GURL& upload_location, |
| + const FilePath& drive_file_path, |
| + const FilePath& local_file_path, |
| + const std::string& content_type, |
| + int64 content_length, |
| + int64 file_size, |
| + const google_apis::UploadCompletionCallback& completion_callback, |
| + const google_apis::UploaderReadyCallback& ready_callback) OVERRIDE { |
| + NOTREACHED(); |
| + return 0; |
| + } |
| + |
| + virtual int UploadExistingFile( |
| + const GURL& upload_location, |
| + const FilePath& drive_file_path, |
| + const FilePath& local_file_path, |
| + const std::string& content_type, |
| + int64 file_size, |
| + const google_apis::UploadCompletionCallback& completion_callback, |
| + const google_apis::UploaderReadyCallback& ready_callback) { |
| + NOTREACHED(); |
| + return 0; |
| + } |
| + |
| + virtual void UpdateUpload(int upload_id, |
| + content::DownloadItem* download) OVERRIDE { |
| + NOTREACHED(); |
| + } |
| + |
| + virtual int64 GetUploadedBytes(int upload_id) const OVERRIDE { |
| + NOTREACHED(); |
| + return 0; |
| + } |
| +}; |
| + |
| } // namespace |
| class StaleCacheFilesRemoverTest : public testing::Test { |
| @@ -90,14 +147,14 @@ class StaleCacheFilesRemoverTest : public testing::Test { |
| cache_ = DriveCache::CreateDriveCache( |
| DriveCache::GetCacheRootPath(profile_.get()), blocking_task_runner_); |
| - mock_uploader_.reset(new StrictMock<google_apis::MockDriveUploader>); |
| + stub_uploader_.reset(new StubDriveUploader); |
| mock_webapps_registry_.reset(new StrictMock<MockDriveWebAppsRegistry>); |
| ASSERT_FALSE(file_system_); |
| file_system_ = new DriveFileSystem(profile_.get(), |
| cache_, |
| mock_drive_service_, |
| - mock_uploader_.get(), |
| + stub_uploader_.get(), |
| mock_webapps_registry_.get(), |
| blocking_task_runner_); |
| @@ -140,7 +197,7 @@ class StaleCacheFilesRemoverTest : public testing::Test { |
| scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| scoped_ptr<TestingProfile> profile_; |
| DriveCache* cache_; |
| - scoped_ptr<StrictMock<google_apis::MockDriveUploader> > mock_uploader_; |
| + scoped_ptr<StubDriveUploader> stub_uploader_; |
| DriveFileSystem* file_system_; |
| StrictMock<google_apis::MockDriveService>* mock_drive_service_; |
| scoped_ptr<StrictMock<MockDriveWebAppsRegistry> > mock_webapps_registry_; |