drive: Return NOT_FOUND from FakeDriveService after the entry gets deleted

The real Drive server returns NOT_FOUND for deleted entries.

BUG=None
TEST=unit_tests

Review URL: https://codereview.chromium.org/139153003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245255 0039d316-1c4b-4281-b951-d872f2087c98
parent 9dca84a2
...@@ -1450,7 +1450,8 @@ base::DictionaryValue* FakeDriveService::FindEntryByResourceId( ...@@ -1450,7 +1450,8 @@ base::DictionaryValue* FakeDriveService::FindEntryByResourceId(
std::string current_resource_id; std::string current_resource_id;
if (entries->GetDictionary(i, &entry) && if (entries->GetDictionary(i, &entry) &&
entry->GetString("gd$resourceId.$t", &current_resource_id) && entry->GetString("gd$resourceId.$t", &current_resource_id) &&
resource_id == current_resource_id) { resource_id == current_resource_id &&
!entry->HasKey("docs$removed")) {
return entry; return entry;
} }
} }
......
...@@ -412,7 +412,7 @@ TEST_F(LocalToRemoteSyncerTest, Conflict_UpdateDeleteOnFile) { ...@@ -412,7 +412,7 @@ TEST_F(LocalToRemoteSyncerTest, Conflict_UpdateDeleteOnFile) {
DeleteResource(file_id); DeleteResource(file_id);
EXPECT_EQ(SYNC_STATUS_RETRY, RunLocalToRemoteSyncer( EXPECT_EQ(SYNC_STATUS_FILE_BUSY, RunLocalToRemoteSyncer(
FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE,
SYNC_FILE_TYPE_FILE), SYNC_FILE_TYPE_FILE),
URL(kOrigin, "foo"))); URL(kOrigin, "foo")));
......
...@@ -49,12 +49,10 @@ void DidGetResourceEntryForUploadExisting( ...@@ -49,12 +49,10 @@ void DidGetResourceEntryForUploadExisting(
const UploadCompletionCallback& callback, const UploadCompletionCallback& callback,
GDataErrorCode error, GDataErrorCode error,
scoped_ptr<ResourceEntry> entry) { scoped_ptr<ResourceEntry> entry) {
ASSERT_EQ(google_apis::HTTP_SUCCESS, error);
ASSERT_TRUE(entry);
base::MessageLoopProxy::current()->PostTask( base::MessageLoopProxy::current()->PostTask(
FROM_HERE, FROM_HERE,
base::Bind(callback, base::Bind(callback,
google_apis::HTTP_SUCCESS, error,
GURL(), GURL(),
base::Passed(&entry))); base::Passed(&entry)));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment