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

Unified Diff: components/drive/service/fake_drive_service.cc

Issue 2748053005: Parse TeamDrive resource inside ChangeList. (Closed)
Patch Set: Default the type field to UNKNOWN as it's not causing new test failures. Created 3 years, 9 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 | « components/drive/service/drive_api_service.cc ('k') | google_apis/drive/drive_api_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/drive/service/fake_drive_service.cc
diff --git a/components/drive/service/fake_drive_service.cc b/components/drive/service/fake_drive_service.cc
index c7ae70dded42b372c7137ccbbcb05a56a490d8b2..b127a94d0b770d1121abd6c2efb30868e992a4ca 100644
--- a/components/drive/service/fake_drive_service.cc
+++ b/components/drive/service/fake_drive_service.cc
@@ -63,6 +63,7 @@ using google_apis::HTTP_SUCCESS;
using google_apis::InitiateUploadCallback;
using google_apis::ParentReference;
using google_apis::ProgressCallback;
+using google_apis::TeamDriveResource;
using google_apis::UploadRangeResponse;
using google_apis::drive::UploadRangeCallback;
namespace test_util = google_apis::test_util;
@@ -837,6 +838,7 @@ CancelCallback FakeDriveService::CopyResource(
std::unique_ptr<EntryInfo> copied_entry(new EntryInfo);
copied_entry->content_data = entry->content_data;
copied_entry->share_url = entry->share_url;
+ copied_entry->change_resource.set_type(ChangeResource::FILE);
copied_entry->change_resource.set_file(
base::MakeUnique<FileResource>(*entry->change_resource.file()));
@@ -1596,6 +1598,7 @@ const FakeDriveService::EntryInfo* FakeDriveService::AddNewEntry(
std::unique_ptr<EntryInfo> new_entry(new EntryInfo);
ChangeResource* new_change = &new_entry->change_resource;
FileResource* new_file = new FileResource;
+ new_change->set_type(ChangeResource::FILE);
new_change->set_file(base::WrapUnique(new_file));
// Set the resource ID and the title
@@ -1716,12 +1719,17 @@ void FakeDriveService::GetChangeListInternal(
if (!should_exclude) {
std::unique_ptr<ChangeResource> entry_copied(new ChangeResource);
+ entry_copied->set_type(entry.type());
entry_copied->set_change_id(entry.change_id());
entry_copied->set_file_id(entry.file_id());
entry_copied->set_deleted(entry.is_deleted());
- if (entry.file()) {
+ if (entry.type() == ChangeResource::FILE && entry.file()) {
entry_copied->set_file(base::MakeUnique<FileResource>(*entry.file()));
}
+ if (entry.type() == ChangeResource::TEAM_DRIVE && entry.team_drive()) {
+ entry_copied->set_team_drive(
+ base::MakeUnique<TeamDriveResource>(*entry.team_drive()));
+ }
entry_copied->set_modification_date(entry.modification_date());
entries.push_back(std::move(entry_copied));
}
« no previous file with comments | « components/drive/service/drive_api_service.cc ('k') | google_apis/drive/drive_api_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698