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

Unified Diff: chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc

Issue 11414126: drive: Get rid of use of MockDriveUploader from c/b/c/drive (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 1 month 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/chromeos/drive/drive_file_system_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5e1b15b3f1744dd23c3c2f6ab737b156a7b952b3 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);
}
+// Dummy implementation of DriveUploaderInterface which does nothing.
+// Used to create a DriveFileSystem object.
+class DummyDriveUploader : public google_apis::DriveUploaderInterface {
+ public:
+ DummyDriveUploader() {}
+ virtual ~DummyDriveUploader() {}
+
+ // 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>);
+ dummy_uploader_.reset(new DummyDriveUploader);
mock_webapps_registry_.reset(new StrictMock<MockDriveWebAppsRegistry>);
ASSERT_FALSE(file_system_);
file_system_ = new DriveFileSystem(profile_.get(),
cache_,
mock_drive_service_,
- mock_uploader_.get(),
+ dummy_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<DummyDriveUploader> dummy_uploader_;
DriveFileSystem* file_system_;
StrictMock<google_apis::MockDriveService>* mock_drive_service_;
scoped_ptr<StrictMock<MockDriveWebAppsRegistry> > mock_webapps_registry_;
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698