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

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

Issue 11819046: drive: Replace local FakeDriveService with google_apis::FakeDriveService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/chromeos/drive/drive_scheduler_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 cd49c5ffd22943d0cdea4de6c74e516ffba50b6e..ee56fe3eb21ea3b218308e620292731d6a40d837 100644
--- a/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc
+++ b/chrome/browser/chromeos/drive/stale_cache_files_remover_unittest.cc
@@ -22,7 +22,7 @@
#include "chrome/browser/chromeos/drive/mock_drive_cache_observer.h"
#include "chrome/browser/chromeos/drive/stale_cache_files_remover.h"
#include "chrome/browser/google_apis/drive_api_parser.h"
-#include "chrome/browser/google_apis/dummy_drive_service.h"
+#include "chrome/browser/google_apis/fake_drive_service.h"
#include "chrome/browser/google_apis/time_util.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/browser_thread.h"
@@ -42,39 +42,6 @@ namespace {
const int64 kLotsOfSpace = kMinFreeSpace * 10;
-// Fake DriveService implementation that just returns an empty resource list,
-// and empty account metadata. This implementation is sufficient to simulate
-// an empty file system.
-class FakeDriveService : public google_apis::DummyDriveService {
- // DummyDriveService overrides.
- virtual void GetResourceList(
- const GURL& feed_url,
- int64 start_changestamp,
- const std::string& search_query,
- bool shared_with_me,
- const std::string& directory_resource_id,
- const google_apis::GetResourceListCallback& callback) OVERRIDE {
- scoped_ptr<google_apis::ResourceList> resource_list(
- new google_apis::ResourceList);
- MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(callback,
- google_apis::HTTP_SUCCESS,
- base::Passed(&resource_list)));
- }
-
- virtual void GetAccountMetadata(
- const google_apis::GetAccountMetadataCallback& callback) OVERRIDE {
- scoped_ptr<google_apis::AccountMetadataFeed> metadata(
- new google_apis::AccountMetadataFeed);
- MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(callback,
- google_apis::HTTP_SUCCESS,
- base::Passed(&metadata)));
- }
-};
-
} // namespace
class StaleCacheFilesRemoverTest : public testing::Test {
@@ -94,7 +61,12 @@ class StaleCacheFilesRemoverTest : public testing::Test {
profile_.reset(new TestingProfile);
- fake_drive_service_.reset(new FakeDriveService);
+ fake_drive_service_.reset(new google_apis::FakeDriveService);
+ fake_drive_service_->LoadResourceListForWapi(
+ "gdata/root_feed.json");
+ fake_drive_service_->LoadAccountMetadataForWapi(
+ "gdata/account_metadata.json");
+
fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter);
scoped_refptr<base::SequencedWorkerPool> pool =
@@ -154,7 +126,7 @@ class StaleCacheFilesRemoverTest : public testing::Test {
scoped_ptr<TestingProfile> profile_;
DriveCache* cache_;
DriveFileSystem* file_system_;
- scoped_ptr<FakeDriveService> fake_drive_service_;
+ scoped_ptr<google_apis::FakeDriveService> fake_drive_service_;
scoped_ptr<DriveWebAppsRegistry> drive_webapps_registry_;
scoped_ptr<FakeFreeDiskSpaceGetter> fake_free_disk_space_getter_;
scoped_ptr<StrictMock<MockDriveCacheObserver> > mock_cache_observer_;
« no previous file with comments | « chrome/browser/chromeos/drive/drive_scheduler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698