summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/drive/change_list_loader_unittest.cc10
-rw-r--r--chrome/browser/chromeos/drive/directory_loader_unittest.cc4
-rw-r--r--chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc4
-rw-r--r--chrome/browser/chromeos/drive/fake_file_system.cc17
-rw-r--r--chrome/browser/chromeos/drive/fake_file_system.h6
-rw-r--r--chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc10
-rw-r--r--chrome/browser/chromeos/drive/file_system/search_operation_unittest.cc11
-rw-r--r--chrome/browser/chromeos/drive/file_system_unittest.cc94
-rw-r--r--chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc6
-rw-r--r--chrome/browser/chromeos/drive/job_scheduler.cc21
-rw-r--r--chrome/browser/chromeos/drive/job_scheduler.h6
-rw-r--r--chrome/browser/chromeos/drive/job_scheduler_unittest.cc4
-rw-r--r--chrome/browser/chromeos/drive/sync/entry_update_performer_unittest.cc52
-rw-r--r--chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc18
-rw-r--r--chrome/browser/chromeos/drive/sync_client_unittest.cc25
-rw-r--r--chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc45
-rw-r--r--chrome/browser/chromeos/file_manager/file_manager_browsertest.cc30
17 files changed, 173 insertions, 190 deletions
diff --git a/chrome/browser/chromeos/drive/change_list_loader_unittest.cc b/chrome/browser/chromeos/drive/change_list_loader_unittest.cc
index 51ea898..ee4152a 100644
--- a/chrome/browser/chromeos/drive/change_list_loader_unittest.cc
+++ b/chrome/browser/chromeos/drive/change_list_loader_unittest.cc
@@ -115,9 +115,9 @@ class ChangeListLoaderTest : public testing::Test {
}
// Adds a new file to the root directory of the service.
- scoped_ptr<google_apis::ResourceEntry> AddNewFile(const std::string& title) {
+ scoped_ptr<google_apis::FileResource> AddNewFile(const std::string& title) {
google_apis::GDataErrorCode error = google_apis::GDATA_FILE_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
drive_service_->AddNewFile(
"text/plain",
"content text",
@@ -195,7 +195,7 @@ TEST_F(ChangeListLoaderTest, Load_LocalMetadataAvailable) {
loader_controller_.get()));
// Add a file to the service.
- scoped_ptr<google_apis::ResourceEntry> gdata_entry = AddNewFile("New File");
+ scoped_ptr<google_apis::FileResource> gdata_entry = AddNewFile("New File");
ASSERT_TRUE(gdata_entry);
// Start loading. Because local metadata is available, the load results in
@@ -278,7 +278,7 @@ TEST_F(ChangeListLoaderTest, CheckForUpdates) {
EXPECT_EQ(previous_changestamp, changestamp);
// Add a file to the service.
- scoped_ptr<google_apis::ResourceEntry> gdata_entry = AddNewFile("New File");
+ scoped_ptr<google_apis::FileResource> gdata_entry = AddNewFile("New File");
ASSERT_TRUE(gdata_entry);
// CheckForUpdates() results in update.
@@ -311,7 +311,7 @@ TEST_F(ChangeListLoaderTest, Lock) {
EXPECT_EQ(FILE_ERROR_OK, error);
// Add a new file.
- scoped_ptr<google_apis::ResourceEntry> file = AddNewFile("New File");
+ scoped_ptr<google_apis::FileResource> file = AddNewFile("New File");
ASSERT_TRUE(file);
// Lock the loader.
diff --git a/chrome/browser/chromeos/drive/directory_loader_unittest.cc b/chrome/browser/chromeos/drive/directory_loader_unittest.cc
index d4e5802..1de5266 100644
--- a/chrome/browser/chromeos/drive/directory_loader_unittest.cc
+++ b/chrome/browser/chromeos/drive/directory_loader_unittest.cc
@@ -109,9 +109,9 @@ class DirectoryLoaderTest : public testing::Test {
}
// Adds a new file to the root directory of the service.
- scoped_ptr<google_apis::ResourceEntry> AddNewFile(const std::string& title) {
+ scoped_ptr<google_apis::FileResource> AddNewFile(const std::string& title) {
google_apis::GDataErrorCode error = google_apis::GDATA_FILE_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
drive_service_->AddNewFile(
"text/plain",
"content text",
diff --git a/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc b/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc
index eaac7d8..4a702f1 100644
--- a/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/drive/fake_drive_service.h"
#include "chrome/browser/drive/test_util.h"
#include "content/public/test/test_browser_thread_bundle.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -493,7 +493,7 @@ TEST_F(DriveFileStreamReaderTest, ZeroByteFileRead) {
// Prepare an empty file
{
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
fake_drive_service_->AddNewFile(
"text/plain",
"", // empty
diff --git a/chrome/browser/chromeos/drive/fake_file_system.cc b/chrome/browser/chromeos/drive/fake_file_system.cc
index 07dfafa..87a3a35 100644
--- a/chrome/browser/chromeos/drive/fake_file_system.cc
+++ b/chrome/browser/chromeos/drive/fake_file_system.cc
@@ -255,23 +255,23 @@ void FakeFileSystem::GetFileContentAfterGetResourceEntry(
return;
}
- // Fetch google_apis::ResourceEntry for its |download_url|.
- drive_service_->GetResourceEntry(
+ // Fetch google_apis::FileResource for its |download_url|.
+ drive_service_->GetFileResource(
entry->resource_id(),
base::Bind(
- &FakeFileSystem::GetFileContentAfterGetWapiResourceEntry,
+ &FakeFileSystem::GetFileContentAfterGetFileResource,
weak_ptr_factory_.GetWeakPtr(),
initialized_callback,
get_content_callback,
completion_callback));
}
-void FakeFileSystem::GetFileContentAfterGetWapiResourceEntry(
+void FakeFileSystem::GetFileContentAfterGetFileResource(
const GetFileContentInitializedCallback& initialized_callback,
const google_apis::GetContentCallback& get_content_callback,
const FileOperationCallback& completion_callback,
google_apis::GDataErrorCode gdata_error,
- scoped_ptr<google_apis::ResourceEntry> gdata_entry) {
+ scoped_ptr<google_apis::FileResource> gdata_entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
FileError error = GDataToFileError(gdata_error);
@@ -283,8 +283,9 @@ void FakeFileSystem::GetFileContentAfterGetWapiResourceEntry(
scoped_ptr<ResourceEntry> entry(new ResourceEntry);
std::string parent_resource_id;
- bool converted =
- ConvertToResourceEntry(*gdata_entry, entry.get(), &parent_resource_id);
+ bool converted = ConvertToResourceEntry(
+ *util::ConvertFileResourceToResourceEntry(*gdata_entry),
+ entry.get(), &parent_resource_id);
DCHECK(converted);
entry->set_parent_local_id(parent_resource_id);
@@ -300,7 +301,7 @@ void FakeFileSystem::GetFileContentAfterGetWapiResourceEntry(
initialized_callback.Run(FILE_ERROR_OK, base::FilePath(), entry.Pass());
drive_service_->DownloadFile(
cache_path,
- gdata_entry->resource_id(),
+ gdata_entry->file_id(),
base::Bind(&FakeFileSystem::GetFileContentAfterDownloadFile,
weak_ptr_factory_.GetWeakPtr(),
completion_callback),
diff --git a/chrome/browser/chromeos/drive/fake_file_system.h b/chrome/browser/chromeos/drive/fake_file_system.h
index 8abb723..5625cca 100644
--- a/chrome/browser/chromeos/drive/fake_file_system.h
+++ b/chrome/browser/chromeos/drive/fake_file_system.h
@@ -18,7 +18,7 @@
namespace google_apis {
class AboutResource;
-class ResourceEntry;
+class FileResource;
} // namespace google_apis
@@ -141,12 +141,12 @@ class FakeFileSystem : public FileSystemInterface {
const FileOperationCallback& completion_callback,
FileError error,
scoped_ptr<ResourceEntry> entry);
- void GetFileContentAfterGetWapiResourceEntry(
+ void GetFileContentAfterGetFileResource(
const GetFileContentInitializedCallback& initialized_callback,
const google_apis::GetContentCallback& get_content_callback,
const FileOperationCallback& completion_callback,
google_apis::GDataErrorCode gdata_error,
- scoped_ptr<google_apis::ResourceEntry> gdata_entry);
+ scoped_ptr<google_apis::FileResource> gdata_entry);
void GetFileContentAfterDownloadFile(
const FileOperationCallback& completion_callback,
google_apis::GDataErrorCode gdata_error,
diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
index 7722301..47dd9b3 100644
--- a/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/drive/drive_api_util.h"
#include "chrome/browser/drive/fake_drive_service.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -179,7 +179,7 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_NewHostedDocument) {
// Create a hosted document on the server that is not synced to local yet.
google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> new_gdoc_entry;
+ scoped_ptr<google_apis::FileResource> new_gdoc_entry;
fake_service()->AddNewFile(
"application/vnd.google-apps.document", "", "", "title", true,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
@@ -190,8 +190,8 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_NewHostedDocument) {
// Prepare a local file, which is a json file of the added hosted document.
ASSERT_TRUE(util::CreateGDocFile(
local_src_path,
- GURL("https://3_document_self_link/" + new_gdoc_entry->resource_id()),
- new_gdoc_entry->resource_id()));
+ GURL("https://3_document_self_link/" + new_gdoc_entry->file_id()),
+ new_gdoc_entry->file_id()));
ResourceEntry entry;
ASSERT_EQ(FILE_ERROR_NOT_FOUND,
@@ -212,7 +212,7 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_NewHostedDocument) {
EXPECT_TRUE(
observer()->get_changed_paths().count(remote_dest_path.DirName()));
// The original document got new parent.
- EXPECT_EQ(new_gdoc_entry->resource_id(), entry.resource_id());
+ EXPECT_EQ(new_gdoc_entry->file_id(), entry.resource_id());
}
TEST_F(CopyOperationTest, CopyNotExistingFile) {
diff --git a/chrome/browser/chromeos/drive/file_system/search_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/search_operation_unittest.cc
index 9e4f944..72918dd 100644
--- a/chrome/browser/chromeos/drive/file_system/search_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/search_operation_unittest.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/chromeos/drive/change_list_loader.h"
#include "chrome/browser/chromeos/drive/file_system/operation_test_base.h"
#include "chrome/browser/drive/fake_drive_service.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -52,16 +52,15 @@ TEST_F(SearchOperationTest, ContentSearchWithNewEntry) {
loader_controller());
// Create a new directory in the drive service.
- google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
+ google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
+ scoped_ptr<google_apis::FileResource> server_entry;
fake_service()->AddNewDirectory(
fake_service()->GetRootResourceId(),
"New Directory 1!",
DriveServiceInterface::AddNewDirectoryOptions(),
- google_apis::test_util::CreateCopyResultCallback(
- &gdata_error, &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
- ASSERT_EQ(google_apis::HTTP_CREATED, gdata_error);
+ ASSERT_EQ(google_apis::HTTP_CREATED, status);
// As the result of the first Search(), only entries in the current file
// system snapshot are expected to be returned in the "right" path. New
diff --git a/chrome/browser/chromeos/drive/file_system_unittest.cc b/chrome/browser/chromeos/drive/file_system_unittest.cc
index b0f8aa8..74e26b5 100644
--- a/chrome/browser/chromeos/drive/file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system_unittest.cc
@@ -329,16 +329,15 @@ TEST_F(FileSystemTest, Copy) {
ASSERT_TRUE(entry);
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_drive_service_->GetFileResource(
entry->resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_EQ(entry->title(), resource_entry->title());
- EXPECT_TRUE(resource_entry->is_file());
+ ASSERT_TRUE(server_entry);
+ EXPECT_EQ(entry->title(), server_entry->title());
+ EXPECT_FALSE(server_entry->IsDirectory());
}
TEST_F(FileSystemTest, Move) {
@@ -363,21 +362,17 @@ TEST_F(FileSystemTest, Move) {
ASSERT_TRUE(entry);
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_drive_service_->GetFileResource(
entry->resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_EQ(entry->title(), resource_entry->title());
-
- const google_apis::Link* parent_link =
- resource_entry->GetLinkByType(google_apis::Link::LINK_PARENT);
- ASSERT_TRUE(parent_link);
- EXPECT_EQ(parent->resource_id(),
- util::ExtractResourceIdFromUrl(parent_link->href()));
+ ASSERT_TRUE(server_entry);
+ EXPECT_EQ(entry->title(), server_entry->title());
+
+ ASSERT_FALSE(server_entry->parents().empty());
+ EXPECT_EQ(parent->resource_id(), server_entry->parents()[0].file_id());
}
TEST_F(FileSystemTest, Remove) {
@@ -395,15 +390,14 @@ TEST_F(FileSystemTest, Remove) {
// Entry is removed on the server.
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_drive_service_->GetFileResource(
entry->resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_TRUE(resource_entry->deleted());
+ ASSERT_TRUE(server_entry);
+ EXPECT_TRUE(server_entry->labels().is_trashed());
}
TEST_F(FileSystemTest, CreateDirectory) {
@@ -424,16 +418,15 @@ TEST_F(FileSystemTest, CreateDirectory) {
ASSERT_TRUE(entry);
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_drive_service_->GetFileResource(
entry->resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_EQ(entry->title(), resource_entry->title());
- EXPECT_TRUE(resource_entry->is_folder());
+ ASSERT_TRUE(server_entry);
+ EXPECT_EQ(entry->title(), server_entry->title());
+ EXPECT_TRUE(server_entry->IsDirectory());
}
TEST_F(FileSystemTest, CreateFile) {
@@ -454,16 +447,15 @@ TEST_F(FileSystemTest, CreateFile) {
ASSERT_TRUE(entry);
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_drive_service_->GetFileResource(
entry->resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_EQ(entry->title(), resource_entry->title());
- EXPECT_TRUE(resource_entry->is_file());
+ ASSERT_TRUE(server_entry);
+ EXPECT_EQ(entry->title(), server_entry->title());
+ EXPECT_FALSE(server_entry->IsDirectory());
}
TEST_F(FileSystemTest, TouchFile) {
@@ -489,16 +481,15 @@ TEST_F(FileSystemTest, TouchFile) {
// File is touched on the server.
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_drive_service_->GetFileResource(
entry->resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_EQ(last_accessed, resource_entry->last_viewed_time());
- EXPECT_EQ(last_modified, resource_entry->updated_time());
+ ASSERT_TRUE(server_entry);
+ EXPECT_EQ(last_accessed, server_entry->last_viewed_by_me_date());
+ EXPECT_EQ(last_modified, server_entry->modified_date());
}
TEST_F(FileSystemTest, TruncateFile) {
@@ -518,15 +509,14 @@ TEST_F(FileSystemTest, TruncateFile) {
// File is touched on the server.
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_drive_service_->GetFileResource(
entry->resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_EQ(kLength, resource_entry->file_size());
+ ASSERT_TRUE(server_entry);
+ EXPECT_EQ(kLength, server_entry->file_size());
}
TEST_F(FileSystemTest, DuplicatedAsyncInitialization) {
diff --git a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc
index 403ad62..8fb9881 100644
--- a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc
+++ b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/drive/fake_drive_service.h"
#include "chrome/browser/drive/test_util.h"
#include "content/public/test/test_browser_thread_bundle.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/time_util.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -182,7 +182,7 @@ TEST_F(WebkitFileStreamReaderImplTest, LastModification) {
ASSERT_TRUE(entry);
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
+ scoped_ptr<google_apis::FileResource> server_entry;
fake_drive_service_->UpdateResource(
entry->resource_id(),
std::string(), // parent_resource_id
@@ -190,7 +190,7 @@ TEST_F(WebkitFileStreamReaderImplTest, LastModification) {
expected_modification_time,
base::Time(),
google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ &server_entry));
base::RunLoop().RunUntilIdle();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
diff --git a/chrome/browser/chromeos/drive/job_scheduler.cc b/chrome/browser/chromeos/drive/job_scheduler.cc
index 6bbfda8..f7e8927 100644
--- a/chrome/browser/chromeos/drive/job_scheduler.cc
+++ b/chrome/browser/chromeos/drive/job_scheduler.cc
@@ -391,10 +391,10 @@ void JobScheduler::GetResourceEntry(
JobEntry* new_job = CreateNewJob(TYPE_GET_RESOURCE_ENTRY);
new_job->context = context;
new_job->task = base::Bind(
- &DriveServiceInterface::GetResourceEntry,
+ &DriveServiceInterface::GetFileResource,
base::Unretained(drive_service_),
resource_id,
- base::Bind(&JobScheduler::OnGetResourceEntryJobDone,
+ base::Bind(&JobScheduler::OnGetFileResourceJobDone,
weak_ptr_factory_.GetWeakPtr(),
new_job->job_info.job_id,
callback));
@@ -463,7 +463,7 @@ void JobScheduler::CopyResource(
parent_resource_id,
new_title,
last_modified,
- base::Bind(&JobScheduler::OnGetResourceEntryJobDone,
+ base::Bind(&JobScheduler::OnGetFileResourceJobDone,
weak_ptr_factory_.GetWeakPtr(),
new_job->job_info.job_id,
callback));
@@ -492,7 +492,7 @@ void JobScheduler::UpdateResource(
new_title,
last_modified,
last_viewed_by_me,
- base::Bind(&JobScheduler::OnGetResourceEntryJobDone,
+ base::Bind(&JobScheduler::OnGetFileResourceJobDone,
weak_ptr_factory_.GetWeakPtr(),
new_job->job_info.job_id,
callback));
@@ -580,7 +580,7 @@ void JobScheduler::AddNewDirectory(
parent_resource_id,
directory_title,
options,
- base::Bind(&JobScheduler::OnGetResourceEntryJobDone,
+ base::Bind(&JobScheduler::OnGetFileResourceJobDone,
weak_ptr_factory_.GetWeakPtr(),
new_job->job_info.job_id,
callback));
@@ -930,16 +930,19 @@ void JobScheduler::OnGetChangeListJobDone(
}
}
-void JobScheduler::OnGetResourceEntryJobDone(
+void JobScheduler::OnGetFileResourceJobDone(
JobID job_id,
const google_apis::GetResourceEntryCallback& callback,
google_apis::GDataErrorCode error,
- scoped_ptr<google_apis::ResourceEntry> entry) {
+ scoped_ptr<google_apis::FileResource> entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- if (OnJobDone(job_id, error))
- callback.Run(error, entry.Pass());
+ if (OnJobDone(job_id, error)) {
+ callback.Run(error, entry ?
+ util::ConvertFileResourceToResourceEntry(*entry) :
+ scoped_ptr<google_apis::ResourceEntry>());
+ }
}
void JobScheduler::OnGetAboutResourceJobDone(
diff --git a/chrome/browser/chromeos/drive/job_scheduler.h b/chrome/browser/chromeos/drive/job_scheduler.h
index 27bedf5..f28741c 100644
--- a/chrome/browser/chromeos/drive/job_scheduler.h
+++ b/chrome/browser/chromeos/drive/job_scheduler.h
@@ -289,12 +289,12 @@ class JobScheduler
google_apis::GDataErrorCode error,
scoped_ptr<google_apis::ChangeList> change_list);
- // Callback for job finishing with a GetResourceEntryCallback.
- void OnGetResourceEntryJobDone(
+ // Callback for job finishing with a FileResourceCallback.
+ void OnGetFileResourceJobDone(
JobID job_id,
const google_apis::GetResourceEntryCallback& callback,
google_apis::GDataErrorCode error,
- scoped_ptr<google_apis::ResourceEntry> entry);
+ scoped_ptr<google_apis::FileResource> entry);
// Callback for job finishing with a AboutResourceCallback.
void OnGetAboutResourceJobDone(
diff --git a/chrome/browser/chromeos/drive/job_scheduler_unittest.cc b/chrome/browser/chromeos/drive/job_scheduler_unittest.cc
index 40ed5a2..3cfd4fa 100644
--- a/chrome/browser/chromeos/drive/job_scheduler_unittest.cc
+++ b/chrome/browser/chromeos/drive/job_scheduler_unittest.cc
@@ -274,13 +274,13 @@ TEST_F(JobSchedulerTest, GetChangeList) {
// Create a new directory.
{
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
+ scoped_ptr<google_apis::FileResource> entry;
fake_drive_service_->AddNewDirectory(
fake_drive_service_->GetRootResourceId(),
"new directory",
DriveServiceInterface::AddNewDirectoryOptions(),
google_apis::test_util::CreateCopyResultCallback(
- &error, &resource_entry));
+ &error, &entry));
base::RunLoop().RunUntilIdle();
ASSERT_EQ(google_apis::HTTP_CREATED, error);
}
diff --git a/chrome/browser/chromeos/drive/sync/entry_update_performer_unittest.cc b/chrome/browser/chromeos/drive/sync/entry_update_performer_unittest.cc
index 6481cb3..678e7ce 100644
--- a/chrome/browser/chromeos/drive/sync/entry_update_performer_unittest.cc
+++ b/chrome/browser/chromeos/drive/sync/entry_update_performer_unittest.cc
@@ -16,7 +16,6 @@
#include "chrome/browser/drive/drive_api_util.h"
#include "chrome/browser/drive/fake_drive_service.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"
@@ -106,8 +105,8 @@ TEST_F(EntryUpdatePerformerTest, UpdateEntry) {
// Verify the file is updated on the server.
google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> gdata_entry;
- fake_service()->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> gdata_entry;
+ fake_service()->GetFileResource(
src_entry.resource_id(),
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&gdata_entry));
@@ -116,14 +115,11 @@ TEST_F(EntryUpdatePerformerTest, UpdateEntry) {
ASSERT_TRUE(gdata_entry);
EXPECT_EQ(src_entry.title(), gdata_entry->title());
- EXPECT_EQ(new_last_modified, gdata_entry->updated_time());
- EXPECT_EQ(new_last_accessed, gdata_entry->last_viewed_time());
-
- const google_apis::Link* parent_link =
- gdata_entry->GetLinkByType(google_apis::Link::LINK_PARENT);
- ASSERT_TRUE(parent_link);
- EXPECT_EQ(dest_entry.resource_id(),
- util::ExtractResourceIdFromUrl(parent_link->href()));
+ EXPECT_EQ(new_last_modified, gdata_entry->modified_date());
+ EXPECT_EQ(new_last_accessed, gdata_entry->last_viewed_by_me_date());
+
+ ASSERT_FALSE(gdata_entry->parents().empty());
+ EXPECT_EQ(dest_entry.resource_id(), gdata_entry->parents()[0].file_id());
}
// Tests updating metadata of a file with a non-dirty cache file.
@@ -175,8 +171,8 @@ TEST_F(EntryUpdatePerformerTest, UpdateEntry_WithNonDirtyCache) {
// Verify the file is updated on the server.
google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> gdata_entry;
- fake_service()->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> gdata_entry;
+ fake_service()->GetFileResource(
src_entry->resource_id(),
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&gdata_entry));
@@ -224,8 +220,8 @@ TEST_F(EntryUpdatePerformerTest, UpdateEntry_ContentUpdate) {
// Check that the file size is updated to that of the updated content.
google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> server_entry;
- fake_service()->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_service()->GetFileResource(
kResourceId,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&server_entry));
@@ -268,8 +264,8 @@ TEST_F(EntryUpdatePerformerTest, UpdateEntry_ContentUpdateMd5Check) {
// Check that the file size is updated to that of the updated content.
google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> server_entry;
- fake_service()->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_service()->GetFileResource(
kResourceId,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&server_entry));
@@ -418,15 +414,14 @@ TEST_F(EntryUpdatePerformerTest, UpdateEntry_UploadNewFile) {
// Make sure that we really created a file.
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_service()->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_service()->GetFileResource(
entry.resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_FALSE(resource_entry->is_folder());
+ ASSERT_TRUE(server_entry);
+ EXPECT_FALSE(server_entry->IsDirectory());
}
TEST_F(EntryUpdatePerformerTest, UpdateEntry_NewFileOpendForWrite) {
@@ -545,15 +540,14 @@ TEST_F(EntryUpdatePerformerTest, UpdateEntry_CreateDirectory) {
// Make sure that we really created a directory.
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- fake_service()->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ fake_service()->GetFileResource(
entry.resource_id(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
test_util::RunBlockingPoolTask();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_TRUE(resource_entry->is_folder());
+ ASSERT_TRUE(server_entry);
+ EXPECT_TRUE(server_entry->IsDirectory());
}
} // namespace internal
diff --git a/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc b/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
index 043bfda..daec210 100644
--- a/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
+++ b/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/chromeos/drive/job_scheduler.h"
#include "chrome/browser/chromeos/drive/resource_metadata.h"
#include "chrome/browser/drive/fake_drive_service.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
namespace drive {
@@ -49,14 +49,14 @@ TEST_F(RemovePerformerTest, RemoveFile) {
// Verify the file is indeed removed in the server.
google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> gdata_entry;
- fake_service()->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> gdata_entry;
+ fake_service()->GetFileResource(
resource_id,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&gdata_entry));
test_util::RunBlockingPoolTask();
ASSERT_EQ(google_apis::HTTP_SUCCESS, gdata_error);
- EXPECT_TRUE(gdata_entry->deleted());
+ EXPECT_TRUE(gdata_entry->labels().is_trashed());
// Try removing non-existing file.
error = FILE_ERROR_FAILED;
@@ -78,7 +78,7 @@ TEST_F(RemovePerformerTest, RemoveShared) {
// Prepare a shared file to the root folder.
google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> gdata_entry;
+ scoped_ptr<google_apis::FileResource> gdata_entry;
fake_service()->AddNewFile(
"text/plain",
"dummy content",
@@ -106,15 +106,15 @@ TEST_F(RemovePerformerTest, RemoveShared) {
// Remotely, the entry should have lost its parent.
gdata_error = google_apis::GDATA_OTHER_ERROR;
- const std::string resource_id = gdata_entry->resource_id();
- fake_service()->GetResourceEntry(
+ const std::string resource_id = gdata_entry->file_id();
+ fake_service()->GetFileResource(
resource_id,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&gdata_entry));
test_util::RunBlockingPoolTask();
ASSERT_EQ(google_apis::HTTP_SUCCESS, gdata_error);
- EXPECT_FALSE(gdata_entry->deleted()); // It's not deleted.
- EXPECT_FALSE(gdata_entry->GetLinkByType(google_apis::Link::LINK_PARENT));
+ EXPECT_FALSE(gdata_entry->labels().is_trashed()); // It's not deleted.
+ EXPECT_TRUE(gdata_entry->parents().empty());
}
TEST_F(RemovePerformerTest, RemoveLocallyCreatedFile) {
diff --git a/chrome/browser/chromeos/drive/sync_client_unittest.cc b/chrome/browser/chromeos/drive/sync_client_unittest.cc
index a99b368..8f247bf 100644
--- a/chrome/browser/chromeos/drive/sync_client_unittest.cc
+++ b/chrome/browser/chromeos/drive/sync_client_unittest.cc
@@ -26,6 +26,7 @@
#include "chrome/browser/drive/event_logger.h"
#include "chrome/browser/drive/fake_drive_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -163,7 +164,7 @@ class SyncClientTest : public testing::Test {
// Adds a file to the service root and |resource_ids_|.
void AddFileEntry(const std::string& title) {
google_apis::GDataErrorCode error = google_apis::GDATA_FILE_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
drive_service_->AddNewFile(
"text/plain",
kRemoteContent,
@@ -174,7 +175,7 @@ class SyncClientTest : public testing::Test {
base::RunLoop().RunUntilIdle();
ASSERT_EQ(google_apis::HTTP_CREATED, error);
ASSERT_TRUE(entry);
- resource_ids_[title] = entry->resource_id();
+ resource_ids_[title] = entry->file_id();
}
// Sets up data for tests.
@@ -296,26 +297,24 @@ TEST_F(SyncClientTest, StartProcessingBacklog) {
// Removed entry is not found.
google_apis::GDataErrorCode status = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
- drive_service_->GetResourceEntry(
+ scoped_ptr<google_apis::FileResource> server_entry;
+ drive_service_->GetFileResource(
resource_ids_["removed"],
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
base::RunLoop().RunUntilIdle();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_TRUE(resource_entry->deleted());
+ ASSERT_TRUE(server_entry);
+ EXPECT_TRUE(server_entry->labels().is_trashed());
// Moved entry was moved.
status = google_apis::GDATA_OTHER_ERROR;
- drive_service_->GetResourceEntry(
+ drive_service_->GetFileResource(
resource_ids_["moved"],
- google_apis::test_util::CreateCopyResultCallback(&status,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
base::RunLoop().RunUntilIdle();
EXPECT_EQ(google_apis::HTTP_SUCCESS, status);
- ASSERT_TRUE(resource_entry);
- EXPECT_EQ("moved_new_title", resource_entry->title());
+ ASSERT_TRUE(server_entry);
+ EXPECT_EQ("moved_new_title", server_entry->title());
}
TEST_F(SyncClientTest, AddFetchTask) {
diff --git a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
index 70e67f2a..77eccc2 100644
--- a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
+++ b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
@@ -25,6 +25,7 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
#include "google_apis/drive/time_util.h"
#include "webkit/browser/fileapi/external_mount_points.h"
@@ -123,7 +124,7 @@ bool InitializeLocalFileSystem(std::string mount_point_name,
return true;
}
-scoped_ptr<google_apis::ResourceEntry> UpdateDriveEntryTime(
+scoped_ptr<google_apis::FileResource> UpdateDriveEntryTime(
drive::FakeDriveService* fake_drive_service,
const std::string& resource_id,
const std::string& last_modified,
@@ -133,10 +134,10 @@ scoped_ptr<google_apis::ResourceEntry> UpdateDriveEntryTime(
&last_modified_time) ||
!google_apis::util::GetTimeFromString(last_viewed_by_me,
&last_viewed_by_me_time))
- return scoped_ptr<google_apis::ResourceEntry>();
+ return scoped_ptr<google_apis::FileResource>();
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
fake_drive_service->UpdateResource(
resource_id,
std::string(), // parent_resource_id
@@ -146,12 +147,12 @@ scoped_ptr<google_apis::ResourceEntry> UpdateDriveEntryTime(
google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
if (error != google_apis::HTTP_SUCCESS)
- return scoped_ptr<google_apis::ResourceEntry>();
+ return scoped_ptr<google_apis::FileResource>();
return entry.Pass();
}
-scoped_ptr<google_apis::ResourceEntry> AddFileToDriveService(
+scoped_ptr<google_apis::FileResource> AddFileToDriveService(
drive::FakeDriveService* fake_drive_service,
const std::string& mime_type,
const std::string& content,
@@ -160,7 +161,7 @@ scoped_ptr<google_apis::ResourceEntry> AddFileToDriveService(
const std::string& last_modified,
const std::string& last_viewed_by_me) {
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
fake_drive_service->AddNewFile(
mime_type,
content,
@@ -170,20 +171,20 @@ scoped_ptr<google_apis::ResourceEntry> AddFileToDriveService(
google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
if (error != google_apis::HTTP_CREATED)
- return scoped_ptr<google_apis::ResourceEntry>();
+ return scoped_ptr<google_apis::FileResource>();
- return UpdateDriveEntryTime(fake_drive_service, entry->resource_id(),
+ return UpdateDriveEntryTime(fake_drive_service, entry->file_id(),
last_modified, last_viewed_by_me);
}
-scoped_ptr<google_apis::ResourceEntry> AddDirectoryToDriveService(
+scoped_ptr<google_apis::FileResource> AddDirectoryToDriveService(
drive::FakeDriveService* fake_drive_service,
const std::string& parent_resource_id,
const std::string& title,
const std::string& last_modified,
const std::string& last_viewed_by_me) {
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
fake_drive_service->AddNewDirectory(
parent_resource_id,
title,
@@ -191,9 +192,9 @@ scoped_ptr<google_apis::ResourceEntry> AddDirectoryToDriveService(
google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
if (error != google_apis::HTTP_CREATED)
- return scoped_ptr<google_apis::ResourceEntry>();
+ return scoped_ptr<google_apis::FileResource>();
- return UpdateDriveEntryTime(fake_drive_service, entry->resource_id(),
+ return UpdateDriveEntryTime(fake_drive_service, entry->file_id(),
last_modified, last_viewed_by_me);
}
@@ -202,7 +203,7 @@ scoped_ptr<google_apis::ResourceEntry> AddDirectoryToDriveService(
bool InitializeDriveService(
drive::FakeDriveService* fake_drive_service,
std::map<std::string, std::string>* out_resource_ids) {
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
entry = AddDirectoryToDriveService(fake_drive_service,
fake_drive_service->GetRootResourceId(),
@@ -211,7 +212,7 @@ bool InitializeDriveService(
"2012-01-02T00:00:01.000Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
entry = AddDirectoryToDriveService(fake_drive_service,
(*out_resource_ids)["test_dir"],
@@ -220,7 +221,7 @@ bool InitializeDriveService(
"2011-11-02T04:00:00.000Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
entry = AddDirectoryToDriveService(fake_drive_service,
(*out_resource_ids)["test_dir"],
@@ -229,7 +230,7 @@ bool InitializeDriveService(
"2012-01-02T00:00:01.000Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
entry = AddFileToDriveService(fake_drive_service,
"application/vnd.mozilla.xul+xml",
@@ -240,7 +241,7 @@ bool InitializeDriveService(
"2012-01-02T00:00:00.000Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
entry = AddFileToDriveService(fake_drive_service,
"test/ro",
@@ -251,7 +252,7 @@ bool InitializeDriveService(
"2012-01-01T00:00:00.000Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
entry = AddFileToDriveService(fake_drive_service,
"image/tiff",
@@ -262,7 +263,7 @@ bool InitializeDriveService(
"2012-01-02T00:00:00.000Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
entry = AddFileToDriveService(fake_drive_service,
"test/rw",
@@ -273,7 +274,7 @@ bool InitializeDriveService(
"2010-01-02T00:00:00.000Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
entry = AddFileToDriveService(fake_drive_service,
"test/rw",
@@ -284,7 +285,7 @@ bool InitializeDriveService(
"2011-12-14T00:40:47.330Z");
if (!entry)
return false;
- (*out_resource_ids)[entry->title()] = entry->resource_id();
+ (*out_resource_ids)[entry->title()] = entry->file_id();
return true;
}
@@ -568,7 +569,7 @@ class MultiProfileDriveFileSystemExtensionApiTest :
drive::util::GetDriveServiceByProfile(second_profile));
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> entry;
+ scoped_ptr<google_apis::FileResource> entry;
// Place a hosted document under root/test_dir of the sub profile.
sub_service->AddNewFileWithResourceId(
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
index 5fbb381..3db922d 100644
--- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
+++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
@@ -54,7 +54,7 @@
#include "content/public/test/test_utils.h"
#include "extensions/browser/api/test/test_api.h"
#include "extensions/common/extension.h"
-#include "google_apis/drive/gdata_wapi_parser.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "webkit/browser/fileapi/external_mount_points.h"
@@ -388,25 +388,23 @@ class DriveTestVolume : public TestVolume {
const std::string& target_name,
const base::Time& modification_time) {
google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
+ scoped_ptr<google_apis::FileResource> entry;
fake_drive_service_->AddNewDirectory(
parent_id,
target_name,
drive::DriveServiceInterface::AddNewDirectoryOptions(),
- google_apis::test_util::CreateCopyResultCallback(&error,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(google_apis::HTTP_CREATED, error);
- ASSERT_TRUE(resource_entry);
+ ASSERT_TRUE(entry);
fake_drive_service_->SetLastModifiedTime(
- resource_entry->resource_id(),
+ entry->file_id(),
modification_time,
- google_apis::test_util::CreateCopyResultCallback(&error,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::MessageLoop::current()->RunUntilIdle();
ASSERT_TRUE(error == google_apis::HTTP_SUCCESS);
- ASSERT_TRUE(resource_entry);
+ ASSERT_TRUE(entry);
CheckForUpdates();
}
@@ -428,27 +426,25 @@ class DriveTestVolume : public TestVolume {
ASSERT_TRUE(base::ReadFileToString(source_file_path, &content_data));
}
- scoped_ptr<google_apis::ResourceEntry> resource_entry;
+ scoped_ptr<google_apis::FileResource> entry;
fake_drive_service_->AddNewFile(
mime_type,
content_data,
parent_id,
target_name,
shared_with_me,
- google_apis::test_util::CreateCopyResultCallback(&error,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(google_apis::HTTP_CREATED, error);
- ASSERT_TRUE(resource_entry);
+ ASSERT_TRUE(entry);
fake_drive_service_->SetLastModifiedTime(
- resource_entry->resource_id(),
+ entry->file_id(),
modification_time,
- google_apis::test_util::CreateCopyResultCallback(&error,
- &resource_entry));
+ google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(google_apis::HTTP_SUCCESS, error);
- ASSERT_TRUE(resource_entry);
+ ASSERT_TRUE(entry);
CheckForUpdates();
}