| 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 28925512a544976d3bea563ab2194c963a74b424..168d02f8ec591c07a9ca78d97b621fe4043ee19a 100644
|
| --- a/chrome/browser/google_apis/fake_drive_service.cc
|
| +++ b/chrome/browser/google_apis/fake_drive_service.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "chrome/browser/google_apis/fake_drive_service.h"
|
|
|
| +#include "base/file_util.h"
|
| #include "base/logging.h"
|
| #include "base/message_loop.h"
|
| #include "base/stringprintf.h"
|
| @@ -224,6 +225,29 @@ void FakeDriveService::DownloadFile(
|
| const GetContentCallback& get_content_callback) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| DCHECK(!download_action_callback.is_null());
|
| +
|
| + base::DictionaryValue* entry = FindEntryByContentUrl(content_url);
|
| + if (!entry) {
|
| + base::MessageLoopProxy::current()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(download_action_callback, HTTP_NOT_FOUND, FilePath()));
|
| + return;
|
| + }
|
| +
|
| + // Write the content URL as the content of the file.
|
| + if (static_cast<int>(content_url.spec().size()) !=
|
| + file_util::WriteFile(local_cache_path,
|
| + content_url.spec().data(),
|
| + content_url.spec().size())) {
|
| + base::MessageLoopProxy::current()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(download_action_callback, GDATA_FILE_ERROR, FilePath()));
|
| + return;
|
| + }
|
| +
|
| + base::MessageLoopProxy::current()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(download_action_callback, HTTP_SUCCESS, local_cache_path));
|
| }
|
|
|
| void FakeDriveService::CopyHostedDocument(
|
|
|