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

Unified Diff: chrome/browser/google_apis/fake_drive_service.cc

Issue 13436003: Fix FakeDriveService's behavior to be more correct. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/fake_drive_service.cc
diff --git a/chrome/browser/google_apis/fake_drive_service.cc b/chrome/browser/google_apis/fake_drive_service.cc
index ee021776ae2f614afdc44085dc61948ad721d04e..35bc57870e12a2c56cfd3a62060656b0cc5f52dd 100644
--- a/chrome/browser/google_apis/fake_drive_service.cc
+++ b/chrome/browser/google_apis/fake_drive_service.cc
@@ -810,8 +810,8 @@ void FakeDriveService::InitiateUploadNewFile(
return;
}
- DictionaryValue* entry = FindEntryByResourceId(parent_resource_id);
- if (!entry) {
+ if (parent_resource_id != GetRootResourceId() &&
+ !FindEntryByResourceId(parent_resource_id)) {
MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(callback, HTTP_NOT_FOUND, GURL()));
@@ -918,7 +918,7 @@ void FakeDriveService::InitiateUploadExistingFile(
std::string entry_etag;
entry->GetString("gd$etag", &entry_etag);
- if (etag != entry_etag) {
+ if (!etag.empty() && etag != entry_etag) {
MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(callback, HTTP_PRECONDITION, GURL()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698