summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtomasz <mtomasz@chromium.org>2015-02-20 01:49:56 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-20 09:50:19 +0000
commitfe3e27bcf3a3458865075bcab72807bc70a96d09 (patch)
tree37b78939e347f230dbc192b65fadc1cb74abbeae
parent0206f4d63cd34010b16eb87992d9ea4ab4d12ee5 (diff)
downloadchromium_src-fe3e27bcf3a3458865075bcab72807bc70a96d09.zip
chromium_src-fe3e27bcf3a3458865075bcab72807bc70a96d09.tar.gz
chromium_src-fe3e27bcf3a3458865075bcab72807bc70a96d09.tar.bz2
Add support for adding properties to files on Drive.
Adding properties is done via a patch http request, which merges arrays. Note, that we do not fetch properties via Drive API, as they are never used in Chromium code. The new method is not wired to chrome.fileManagerPrivate yet. It will be done in a separate CL. TEST=googleapi_unittests: *FilesPatchRequest* BUG=451113 Review URL: https://codereview.chromium.org/928803003 Cr-Commit-Position: refs/heads/master@{#317276}
-rw-r--r--chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl_unittest.cc7
-rw-r--r--chrome/browser/chromeos/drive/job_scheduler.cc13
-rw-r--r--chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc4
-rw-r--r--chrome/browser/drive/drive_api_service.cc2
-rw-r--r--chrome/browser/drive/drive_api_service.h1
-rw-r--r--chrome/browser/drive/drive_service_interface.h7
-rw-r--r--chrome/browser/drive/dummy_drive_service.cc1
-rw-r--r--chrome/browser/drive/dummy_drive_service.h3
-rw-r--r--chrome/browser/drive/fake_drive_service.cc1
-rw-r--r--chrome/browser/drive/fake_drive_service.h3
-rw-r--r--chrome/browser/drive/fake_drive_service_unittest.cc33
-rw-r--r--chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc1
-rw-r--r--chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h1
-rw-r--r--chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.cc6
-rw-r--r--google_apis/drive/drive_api_parser.h1
-rw-r--r--google_apis/drive/drive_api_requests.cc27
-rw-r--r--google_apis/drive/drive_api_requests.h39
-rw-r--r--google_apis/drive/drive_api_requests_unittest.cc28
18 files changed, 126 insertions, 52 deletions
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 86ef586..bb1d5c0 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
@@ -187,10 +187,9 @@ TEST_F(WebkitFileStreamReaderImplTest, LastModification) {
entry->resource_id(),
std::string(), // parent_resource_id
std::string(), // title
- expected_modification_time,
- base::Time(),
- google_apis::test_util::CreateCopyResultCallback(&status,
- &server_entry));
+ expected_modification_time, base::Time(),
+ google_apis::drive::Properties(),
+ google_apis::test_util::CreateCopyResultCallback(&status, &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 bef6295..d5735e0 100644
--- a/chrome/browser/chromeos/drive/job_scheduler.cc
+++ b/chrome/browser/chromeos/drive/job_scheduler.cc
@@ -521,16 +521,11 @@ void JobScheduler::UpdateResource(
JobEntry* new_job = CreateNewJob(TYPE_UPDATE_RESOURCE);
new_job->context = context;
new_job->task = base::Bind(
- &DriveServiceInterface::UpdateResource,
- base::Unretained(drive_service_),
- resource_id,
- parent_resource_id,
- new_title,
- last_modified,
- last_viewed_by_me,
+ &DriveServiceInterface::UpdateResource, base::Unretained(drive_service_),
+ resource_id, parent_resource_id, new_title, last_modified,
+ last_viewed_by_me, google_apis::drive::Properties(),
base::Bind(&JobScheduler::OnGetFileResourceJobDone,
- weak_ptr_factory_.GetWeakPtr(),
- new_job->job_info.job_id,
+ weak_ptr_factory_.GetWeakPtr(), new_job->job_info.job_id,
callback));
new_job->abort_callback = CreateErrorRunCallback(callback);
StartJob(new_job);
diff --git a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
index 600cd58..c93c6d7 100644
--- a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
+++ b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
@@ -180,8 +180,8 @@ scoped_ptr<google_apis::FileResource> UpdateDriveEntryTime(
resource_id,
std::string(), // parent_resource_id
std::string(), // title
- last_modified_time,
- last_viewed_by_me_time,
+ last_modified_time, last_viewed_by_me_time,
+ google_apis::drive::Properties(),
google_apis::test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
if (error != google_apis::HTTP_SUCCESS)
diff --git a/chrome/browser/drive/drive_api_service.cc b/chrome/browser/drive/drive_api_service.cc
index 48f2cb0..d22811f 100644
--- a/chrome/browser/drive/drive_api_service.cc
+++ b/chrome/browser/drive/drive_api_service.cc
@@ -489,6 +489,7 @@ CancelCallback DriveAPIService::UpdateResource(
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const FileResourceCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!callback.is_null());
@@ -511,6 +512,7 @@ CancelCallback DriveAPIService::UpdateResource(
request->set_last_viewed_by_me_date(last_viewed_by_me);
}
request->set_fields(kFileResourceFields);
+ request->set_properties(properties);
return sender_->StartRequestWithRetry(request);
}
diff --git a/chrome/browser/drive/drive_api_service.h b/chrome/browser/drive/drive_api_service.h
index ffe26bc..c0d1502 100644
--- a/chrome/browser/drive/drive_api_service.h
+++ b/chrome/browser/drive/drive_api_service.h
@@ -126,6 +126,7 @@ class DriveAPIService : public DriveServiceInterface,
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) override;
google_apis::CancelCallback AddResourceToDirectory(
const std::string& parent_resource_id,
diff --git a/chrome/browser/drive/drive_service_interface.h b/chrome/browser/drive/drive_service_interface.h
index 016a99ac..1f789a8 100644
--- a/chrome/browser/drive/drive_service_interface.h
+++ b/chrome/browser/drive/drive_service_interface.h
@@ -265,8 +265,6 @@ class DriveServiceInterface {
// and it'll be named |new_title|.
// If |last_modified| is not null, the modified date of the resource on the
// server will be set to the date.
- // This request is supported only on DriveAPIService, because GData WAPI
- // doesn't support the function unfortunately.
// Upon completion, invokes |callback| with results on the calling thread.
// |callback| must not be null.
virtual google_apis::CancelCallback CopyResource(
@@ -280,8 +278,7 @@ class DriveServiceInterface {
// |parent_resource_id| with renaming to |new_title|.
// If |last_modified| or |last_accessed| is not null, the modified/accessed
// date of the resource on the server will be set to the date.
- // This request is supported only on DriveAPIService, because GData WAPI
- // doesn't support the function unfortunately.
+ // If |properties| are specified, then they will be set on |resource_id|.
// Upon completion, invokes |callback| with results on the calling thread.
// |callback| must not be null.
virtual google_apis::CancelCallback UpdateResource(
@@ -290,6 +287,7 @@ class DriveServiceInterface {
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) = 0;
// Adds a resource (document, file, or collection) identified by its
@@ -427,7 +425,6 @@ class DriveServiceInterface {
const google_apis::EntryActionCallback& callback) = 0;
// Authorizes the account |email| to access |resource_id| as a |role|.
- //
// |callback| must not be null.
virtual google_apis::CancelCallback AddPermission(
const std::string& resource_id,
diff --git a/chrome/browser/drive/dummy_drive_service.cc b/chrome/browser/drive/dummy_drive_service.cc
index 7207ac6..2e8fafc 100644
--- a/chrome/browser/drive/dummy_drive_service.cc
+++ b/chrome/browser/drive/dummy_drive_service.cc
@@ -124,6 +124,7 @@ CancelCallback DummyDriveService::UpdateResource(
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) {
return CancelCallback();
}
diff --git a/chrome/browser/drive/dummy_drive_service.h b/chrome/browser/drive/dummy_drive_service.h
index c2b4aae..44772ee 100644
--- a/chrome/browser/drive/dummy_drive_service.h
+++ b/chrome/browser/drive/dummy_drive_service.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_
#define CHROME_BROWSER_DRIVE_DUMMY_DRIVE_SERVICE_H_
+#include <string>
+
#include "chrome/browser/drive/drive_service_interface.h"
#include "google_apis/drive/auth_service_interface.h"
@@ -86,6 +88,7 @@ class DummyDriveService : public DriveServiceInterface {
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) override;
google_apis::CancelCallback AddResourceToDirectory(
const std::string& parent_resource_id,
diff --git a/chrome/browser/drive/fake_drive_service.cc b/chrome/browser/drive/fake_drive_service.cc
index 52d790a..f34c0d6 100644
--- a/chrome/browser/drive/fake_drive_service.cc
+++ b/chrome/browser/drive/fake_drive_service.cc
@@ -880,6 +880,7 @@ CancelCallback FakeDriveService::UpdateResource(
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!callback.is_null());
diff --git a/chrome/browser/drive/fake_drive_service.h b/chrome/browser/drive/fake_drive_service.h
index 6d52b67..ebb1658 100644
--- a/chrome/browser/drive/fake_drive_service.h
+++ b/chrome/browser/drive/fake_drive_service.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_DRIVE_FAKE_DRIVE_SERVICE_H_
#define CHROME_BROWSER_DRIVE_FAKE_DRIVE_SERVICE_H_
+#include <string>
+
#include "base/files/file_path.h"
#include "base/threading/thread_checker.h"
#include "chrome/browser/drive/drive_service_interface.h"
@@ -199,6 +201,7 @@ class FakeDriveService : public DriveServiceInterface {
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) override;
google_apis::CancelCallback AddResourceToDirectory(
const std::string& parent_resource_id,
diff --git a/chrome/browser/drive/fake_drive_service_unittest.cc b/chrome/browser/drive/fake_drive_service_unittest.cc
index 0341048..1d1f5c9 100644
--- a/chrome/browser/drive/fake_drive_service_unittest.cc
+++ b/chrome/browser/drive/fake_drive_service_unittest.cc
@@ -1163,11 +1163,10 @@ TEST_F(FakeDriveServiceTest, UpdateResource) {
DriveApiErrorCode error = DRIVE_OTHER_ERROR;
scoped_ptr<FileResource> entry;
fake_service_.UpdateResource(
- kResourceId,
- kParentResourceId,
- "new title",
+ kResourceId, kParentResourceId, "new title",
base::Time::FromUTCExploded(kModifiedDate),
base::Time::FromUTCExploded(kViewedDate),
+ google_apis::drive::Properties(),
test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
@@ -1194,11 +1193,8 @@ TEST_F(FakeDriveServiceTest, UpdateResource_NonExisting) {
DriveApiErrorCode error = DRIVE_OTHER_ERROR;
scoped_ptr<FileResource> entry;
fake_service_.UpdateResource(
- kResourceId,
- "1_folder_resource_id",
- "new title",
- base::Time(),
- base::Time(),
+ kResourceId, "1_folder_resource_id", "new title", base::Time(),
+ base::Time(), google_apis::drive::Properties(),
test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
@@ -1218,11 +1214,8 @@ TEST_F(FakeDriveServiceTest, UpdateResource_EmptyParentResourceId) {
DriveApiErrorCode error = DRIVE_OTHER_ERROR;
scoped_ptr<FileResource> entry;
fake_service_.UpdateResource(
- kResourceId,
- std::string(),
- "new title",
- base::Time(),
- base::Time(),
+ kResourceId, std::string(), "new title", base::Time(), base::Time(),
+ google_apis::drive::Properties(),
test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
@@ -1246,11 +1239,8 @@ TEST_F(FakeDriveServiceTest, UpdateResource_Offline) {
DriveApiErrorCode error = DRIVE_OTHER_ERROR;
scoped_ptr<FileResource> entry;
fake_service_.UpdateResource(
- kResourceId,
- std::string(),
- "new title",
- base::Time(),
- base::Time(),
+ kResourceId, std::string(), "new title", base::Time(), base::Time(),
+ google_apis::drive::Properties(),
test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
@@ -1268,11 +1258,8 @@ TEST_F(FakeDriveServiceTest, UpdateResource_Forbidden) {
DriveApiErrorCode error = DRIVE_OTHER_ERROR;
scoped_ptr<FileResource> entry;
fake_service_.UpdateResource(
- kResourceId,
- std::string(),
- "new title",
- base::Time(),
- base::Time(),
+ kResourceId, std::string(), "new title", base::Time(), base::Time(),
+ google_apis::drive::Properties(),
test_util::CreateCopyResultCallback(&error, &entry));
base::RunLoop().RunUntilIdle();
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc
index 3939898..33694dd 100644
--- a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc
+++ b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc
@@ -319,6 +319,7 @@ google_apis::CancelCallback DriveServiceOnWorker::UpdateResource(
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) {
NOTREACHED();
return google_apis::CancelCallback();
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h
index 7567d73..0aa5ff4 100644
--- a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h
+++ b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h
@@ -123,6 +123,7 @@ class DriveServiceOnWorker : public drive::DriveServiceInterface {
const std::string& new_title,
const base::Time& last_modified,
const base::Time& last_viewed_by_me,
+ const google_apis::drive::Properties& properties,
const google_apis::FileResourceCallback& callback) override;
google_apis::CancelCallback AddResourceToDirectory(
const std::string& parent_resource_id,
diff --git a/chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.cc b/chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.cc
index 20b890b..9e1b1b0 100644
--- a/chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.cc
+++ b/chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.cc
@@ -165,8 +165,8 @@ DriveApiErrorCode FakeDriveServiceHelper::UpdateModificationTime(
return error;
fake_drive_service_->UpdateResource(
- file_id, std::string(), entry->title(),
- modification_time, entry->last_viewed_by_me_date(),
+ file_id, std::string(), entry->title(), modification_time,
+ entry->last_viewed_by_me_date(), google_apis::drive::Properties(),
CreateResultReceiver(&error, &entry));
base::RunLoop().RunUntilIdle();
return error;
@@ -179,7 +179,7 @@ DriveApiErrorCode FakeDriveServiceHelper::RenameResource(
scoped_ptr<FileResource> entry;
fake_drive_service_->UpdateResource(
file_id, std::string(), new_title, base::Time(), base::Time(),
- CreateResultReceiver(&error, &entry));
+ google_apis::drive::Properties(), CreateResultReceiver(&error, &entry));
base::RunLoop().RunUntilIdle();
return error;
}
diff --git a/google_apis/drive/drive_api_parser.h b/google_apis/drive/drive_api_parser.h
index 450aa36..482d749 100644
--- a/google_apis/drive/drive_api_parser.h
+++ b/google_apis/drive/drive_api_parser.h
@@ -419,7 +419,6 @@ class ImageMediaMetadata {
int rotation_;
};
-
// FileResource represents a file or folder metadata in Drive.
// https://developers.google.com/drive/v2/reference/files
class FileResource {
diff --git a/google_apis/drive/drive_api_requests.cc b/google_apis/drive/drive_api_requests.cc
index 3691a9e..8e32915 100644
--- a/google_apis/drive/drive_api_requests.cc
+++ b/google_apis/drive/drive_api_requests.cc
@@ -49,6 +49,12 @@ void ParseFileResourceWithUploadRangeAndRun(
namespace drive {
+Property::Property() : visibility_(VISIBILITY_PRIVATE) {
+}
+
+Property::~Property() {
+}
+
//============================ DriveApiPartialFieldRequest ====================
DriveApiPartialFieldRequest::DriveApiPartialFieldRequest(
@@ -226,6 +232,27 @@ bool FilesPatchRequest::GetContentData(std::string* upload_content_type,
root.Set("parents", parents_value);
}
+ if (!properties_.empty()) {
+ base::ListValue* properties_value = new base::ListValue;
+ for (const auto& property : properties_) {
+ base::DictionaryValue* const property_value = new base::DictionaryValue;
+ std::string visibility_as_string;
+ switch (property.visibility()) {
+ case Property::VISIBILITY_PRIVATE:
+ visibility_as_string = "PRIVATE";
+ break;
+ case Property::VISIBILITY_PUBLIC:
+ visibility_as_string = "PUBLIC";
+ break;
+ }
+ property_value->SetString("visibility", visibility_as_string);
+ property_value->SetString("key", property.key());
+ property_value->SetString("value", property.value());
+ properties_value->Append(property_value);
+ }
+ root.Set("properties", properties_value);
+ }
+
base::JSONWriter::Write(&root, upload_content);
DVLOG(1) << "FilesPatch data: " << *upload_content_type << ", ["
<< *upload_content << "]";
diff --git a/google_apis/drive/drive_api_requests.h b/google_apis/drive/drive_api_requests.h
index 4fa6eaf..33f74a8 100644
--- a/google_apis/drive/drive_api_requests.h
+++ b/google_apis/drive/drive_api_requests.h
@@ -6,6 +6,7 @@
#define GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_
#include <string>
+#include <vector>
#include "base/callback_forward.h"
#include "base/location.h"
@@ -32,6 +33,38 @@ typedef base::Callback<void(DriveApiErrorCode error,
namespace drive {
+// Represents a property for a file or a directory.
+// https://developers.google.com/drive/v2/reference/properties
+class Property {
+ public:
+ Property();
+ ~Property();
+
+ // Visibility of the property. Either limited to the same client, or to any.
+ enum Visibility { VISIBILITY_PRIVATE, VISIBILITY_PUBLIC };
+
+ // Whether the property is public or private.
+ Visibility visibility() const { return visibility_; }
+
+ // Name of the property.
+ const std::string& key() const { return key_; }
+
+ // Value of the property.
+ const std::string& value() const { return value_; }
+
+ void set_visibility(Visibility visibility) { visibility_ = visibility; }
+ void set_key(const std::string& key) { key_ = key; }
+ void set_value(const std::string& value) { value_ = value; }
+
+ private:
+ Visibility visibility_;
+ std::string key_;
+ std::string value_;
+};
+
+// List of properties for a single file or a directory.
+typedef std::vector<Property> Properties;
+
//============================ DriveApiPartialFieldRequest ====================
// This is base class of the Drive API related requests. All Drive API requests
@@ -306,6 +339,11 @@ class FilesPatchRequest : public DriveApiDataRequest<FileResource> {
const std::vector<std::string>& parents() const { return parents_; }
void add_parent(const std::string& parent) { parents_.push_back(parent); }
+ const Properties& properties() const { return properties_; }
+ void set_properties(const Properties& properties) {
+ properties_ = properties;
+ }
+
protected:
// Overridden from URLFetchRequestBase.
net::URLFetcher::RequestType GetRequestType() const override;
@@ -327,6 +365,7 @@ class FilesPatchRequest : public DriveApiDataRequest<FileResource> {
base::Time modified_date_;
base::Time last_viewed_by_me_date_;
std::vector<std::string> parents_;
+ Properties properties_;
DISALLOW_COPY_AND_ASSIGN(FilesPatchRequest);
};
diff --git a/google_apis/drive/drive_api_requests_unittest.cc b/google_apis/drive/drive_api_requests_unittest.cc
index c4cab5b..deb2845 100644
--- a/google_apis/drive/drive_api_requests_unittest.cc
+++ b/google_apis/drive/drive_api_requests_unittest.cc
@@ -511,6 +511,20 @@ TEST_F(DriveApiRequestsTest, FilesPatchRequest) {
base::Time::FromUTCExploded(kLastViewedByMeDate));
request->add_parent("parent_resource_id");
+ drive::Property private_property;
+ private_property.set_key("key1");
+ private_property.set_value("value1");
+
+ drive::Property public_property;
+ public_property.set_visibility(drive::Property::VISIBILITY_PUBLIC);
+ public_property.set_key("key2");
+ public_property.set_value("value2");
+
+ drive::Properties properties;
+ properties.push_back(private_property);
+ properties.push_back(public_property);
+ request->set_properties(properties);
+
request_sender_->StartRequestWithRetry(request);
run_loop.Run();
}
@@ -523,11 +537,15 @@ TEST_F(DriveApiRequestsTest, FilesPatchRequest) {
EXPECT_EQ("application/json", http_request_.headers["Content-Type"]);
EXPECT_TRUE(http_request_.has_content);
- EXPECT_EQ("{\"lastViewedByMeDate\":\"2013-07-19T15:59:13.123Z\","
- "\"modifiedDate\":\"2012-07-19T15:59:13.123Z\","
- "\"parents\":[{\"id\":\"parent_resource_id\"}],"
- "\"title\":\"new title\"}",
- http_request_.content);
+ EXPECT_EQ(
+ "{\"lastViewedByMeDate\":\"2013-07-19T15:59:13.123Z\","
+ "\"modifiedDate\":\"2012-07-19T15:59:13.123Z\","
+ "\"parents\":[{\"id\":\"parent_resource_id\"}],"
+ "\"properties\":["
+ "{\"key\":\"key1\",\"value\":\"value1\",\"visibility\":\"PRIVATE\"},"
+ "{\"key\":\"key2\",\"value\":\"value2\",\"visibility\":\"PUBLIC\"}],"
+ "\"title\":\"new title\"}",
+ http_request_.content);
EXPECT_TRUE(file_resource);
}