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

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

Issue 23441049: drive: Enable recursive fast-fetch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made the test to surely use fast-fetch. Created 7 years, 3 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
Index: chrome/browser/chromeos/drive/change_list_loader_unittest.cc
diff --git a/chrome/browser/chromeos/drive/change_list_loader_unittest.cc b/chrome/browser/chromeos/drive/change_list_loader_unittest.cc
index 516f5fe72b3d971a094ccafd1fe20ae2e691ce86..380afea6aa1fe846e255a42b9607c8320b460f05 100644
--- a/chrome/browser/chromeos/drive/change_list_loader_unittest.cc
+++ b/chrome/browser/chromeos/drive/change_list_loader_unittest.cc
@@ -69,35 +69,6 @@ class TestChangeListLoaderObserver : public ChangeListLoaderObserver {
DISALLOW_COPY_AND_ASSIGN(TestChangeListLoaderObserver);
};
-class TestDriveService : public FakeDriveService {
- public:
- TestDriveService() : never_return_all_resource_list_(false),
- blocked_call_count_(0) {}
-
- void set_never_return_all_resource_list(bool value) {
- never_return_all_resource_list_ = value;
- }
-
- int blocked_call_count() const { return blocked_call_count_; }
-
- // FakeDriveService override.
- virtual google_apis::CancelCallback GetAllResourceList(
- const google_apis::GetResourceListCallback& callback) OVERRIDE {
- if (never_return_all_resource_list_) {
- ++blocked_call_count_;
- return google_apis::CancelCallback();
- }
- return FakeDriveService::GetAllResourceList(callback);
- }
-
- private:
- // GetAllResourceList never returns result when this is set to true.
- // Used to emulate the real server's slowness.
- bool never_return_all_resource_list_;
-
- int blocked_call_count_; // Number of blocked method calls.
-};
-
class ChangeListLoaderTest : public testing::Test {
protected:
virtual void SetUp() OVERRIDE {
@@ -105,7 +76,7 @@ class ChangeListLoaderTest : public testing::Test {
pref_service_.reset(new TestingPrefServiceSimple);
test_util::RegisterDrivePrefs(pref_service_->registry());
- drive_service_.reset(new TestDriveService);
+ drive_service_.reset(new FakeDriveService);
ASSERT_TRUE(drive_service_->LoadResourceListForWapi(
"gdata/root_feed.json"));
ASSERT_TRUE(drive_service_->LoadAccountMetadataForWapi(
@@ -154,7 +125,7 @@ class ChangeListLoaderTest : public testing::Test {
content::TestBrowserThreadBundle thread_bundle_;
base::ScopedTempDir temp_dir_;
scoped_ptr<TestingPrefServiceSimple> pref_service_;
- scoped_ptr<TestDriveService> drive_service_;
+ scoped_ptr<FakeDriveService> drive_service_;
scoped_ptr<JobScheduler> scheduler_;
scoped_ptr<ResourceMetadataStorage,
test_util::DestroyHelperForTests> metadata_storage_;
@@ -276,7 +247,7 @@ TEST_F(ChangeListLoaderTest, LoadIfNeeded_MyDrive) {
observer.clear_changed_directories();
// GetAllResourceList() was called.
- EXPECT_EQ(1, drive_service_->blocked_call_count());
+ EXPECT_EQ(1, drive_service_->blocked_resource_list_load_count());
// My Drive is present in the local metadata, but its child is not.
ResourceEntry entry;
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system.cc » ('j') | chrome/browser/chromeos/drive/file_system_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698