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

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

Issue 321753002: drive: Stop returning ResourceEntry from JobScheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/job_scheduler_unittest.cc
diff --git a/chrome/browser/chromeos/drive/job_scheduler_unittest.cc b/chrome/browser/chromeos/drive/job_scheduler_unittest.cc
index 924a6bf2274724df14edb5c1eb45e4f3e4647152..6419dc52699e0ee594ad131b59dcdfd3f18cbf80 100644
--- a/chrome/browser/chromeos/drive/job_scheduler_unittest.cc
+++ b/chrome/browser/chromeos/drive/job_scheduler_unittest.cc
@@ -20,7 +20,6 @@
#include "chrome/common/pref_names.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "google_apis/drive/drive_api_parser.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
#include "google_apis/drive/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,11 +30,11 @@ namespace {
// Dummy value passed for the |expected_file_size| parameter of DownloadFile().
const int64 kDummyDownloadFileSize = 0;
-void CopyTitleFromGetResourceEntryCallback(
+void CopyTitleFromFileResourceCallback(
std::vector<std::string>* title_list_out,
google_apis::GDataErrorCode error_in,
- scoped_ptr<google_apis::ResourceEntry> resource_entry_in) {
- title_list_out->push_back(resource_entry_in->title());
+ scoped_ptr<google_apis::FileResource> entry_in) {
+ title_list_out->push_back(entry_in->title());
}
class JobListLogger : public JobListObserver {
@@ -353,13 +352,13 @@ TEST_F(JobSchedulerTest, GetRemainingFileList) {
ASSERT_TRUE(file_list);
}
-TEST_F(JobSchedulerTest, GetResourceEntry) {
+TEST_F(JobSchedulerTest, GetFileResource) {
ConnectToWifi();
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
- scheduler_->GetResourceEntry(
+ scheduler_->GetFileResource(
"file:2_file_resource_id", // resource ID
ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error, &entry));
@@ -404,7 +403,7 @@ TEST_F(JobSchedulerTest, CopyResource) {
ConnectToWifi();
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
scheduler_->CopyResource(
"file:2_file_resource_id", // resource ID
@@ -422,7 +421,7 @@ TEST_F(JobSchedulerTest, UpdateResource) {
ConnectToWifi();
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
scheduler_->UpdateResource(
"file:2_file_resource_id", // resource ID
@@ -485,7 +484,7 @@ TEST_F(JobSchedulerTest, AddNewDirectory) {
ConnectToWifi();
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
scheduler_->AddNewDirectory(
fake_drive_service_->GetRootResourceId(), // Root directory.
@@ -503,10 +502,10 @@ TEST_F(JobSchedulerTest, PriorityHandling) {
// Saturate the metadata job queue with uninteresting jobs to prevent
// following jobs from starting.
google_apis::GDataErrorCode error_dontcare = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry_dontcare;
+ scoped_ptr<google_apis::FileResource> entry_dontcare;
for (int i = 0; i < GetMetadataQueueMaxJobCount(); ++i) {
std::string resource_id("file:2_file_resource_id");
- scheduler_->GetResourceEntry(
+ scheduler_->GetFileResource(
resource_id,
ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error_dontcare,
@@ -525,25 +524,25 @@ TEST_F(JobSchedulerTest, PriorityHandling) {
title_1,
DriveServiceInterface::AddNewDirectoryOptions(),
ClientContext(USER_INITIATED),
- base::Bind(&CopyTitleFromGetResourceEntryCallback, &titles));
+ base::Bind(&CopyTitleFromFileResourceCallback, &titles));
scheduler_->AddNewDirectory(
fake_drive_service_->GetRootResourceId(),
title_2,
DriveServiceInterface::AddNewDirectoryOptions(),
ClientContext(BACKGROUND),
- base::Bind(&CopyTitleFromGetResourceEntryCallback, &titles));
+ base::Bind(&CopyTitleFromFileResourceCallback, &titles));
scheduler_->AddNewDirectory(
fake_drive_service_->GetRootResourceId(),
title_3,
DriveServiceInterface::AddNewDirectoryOptions(),
ClientContext(BACKGROUND),
- base::Bind(&CopyTitleFromGetResourceEntryCallback, &titles));
+ base::Bind(&CopyTitleFromFileResourceCallback, &titles));
scheduler_->AddNewDirectory(
fake_drive_service_->GetRootResourceId(),
title_4,
DriveServiceInterface::AddNewDirectoryOptions(),
ClientContext(USER_INITIATED),
- base::Bind(&CopyTitleFromGetResourceEntryCallback, &titles));
+ base::Bind(&CopyTitleFromFileResourceCallback, &titles));
base::RunLoop().RunUntilIdle();
@@ -560,8 +559,8 @@ TEST_F(JobSchedulerTest, NoConnectionUserInitiated) {
std::string resource_id("file:2_file_resource_id");
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
- scheduler_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> entry;
+ scheduler_->GetFileResource(
resource_id,
ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error, &entry));
@@ -576,8 +575,8 @@ TEST_F(JobSchedulerTest, NoConnectionBackground) {
std::string resource_id("file:2_file_resource_id");
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
- scheduler_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> entry;
+ scheduler_->GetFileResource(
resource_id,
ClientContext(BACKGROUND),
google_apis::test_util::CreateCopyResultCallback(&error, &entry));
@@ -802,7 +801,7 @@ TEST_F(JobSchedulerTest, JobInfo) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
scoped_ptr<google_apis::AboutResource> about_resource;
base::FilePath path;
@@ -945,7 +944,7 @@ TEST_F(JobSchedulerTest, JobInfoProgress) {
ASSERT_TRUE(google_apis::test_util::WriteStringToFile(path, "Hello"));
google_apis::GDataErrorCode upload_error =
google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
scheduler_->UploadNewFile(
fake_drive_service_->GetRootResourceId(),
@@ -979,7 +978,7 @@ TEST_F(JobSchedulerTest, CancelPendingJob) {
// Start the first job and record its job ID.
google_apis::GDataErrorCode error1 = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
scheduler_->UploadNewFile(
fake_drive_service_->GetRootResourceId(),
base::FilePath::FromUTF8Unsafe("dummy/path"),
@@ -1029,7 +1028,7 @@ TEST_F(JobSchedulerTest, CancelRunningJob) {
// Run as a cancelable task.
fake_drive_service_->set_upload_new_file_cancelable(true);
google_apis::GDataErrorCode error1 = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
scheduler_->UploadNewFile(
fake_drive_service_->GetRootResourceId(),
base::FilePath::FromUTF8Unsafe("dummy/path"),
« no previous file with comments | « chrome/browser/chromeos/drive/job_scheduler.cc ('k') | chrome/browser/chromeos/drive/sync/entry_revert_performer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698