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

Unified Diff: google_apis/drive/drive_api_requests_unittest.cc

Issue 140513008: drive: Allow setting modified/accessed date with AddNewDirectory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « google_apis/drive/drive_api_requests.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_requests_unittest.cc
diff --git a/google_apis/drive/drive_api_requests_unittest.cc b/google_apis/drive/drive_api_requests_unittest.cc
index cbbba29eb755fba043c9153f058708361d6c3daa..7787fa461f17600a790c08cbaf4be4b837f62205 100644
--- a/google_apis/drive/drive_api_requests_unittest.cc
+++ b/google_apis/drive/drive_api_requests_unittest.cc
@@ -418,6 +418,10 @@ TEST_F(DriveApiRequestsTest, DriveApiDataRequest_Fields) {
}
TEST_F(DriveApiRequestsTest, FilesInsertRequest) {
+ const base::Time::Exploded kModifiedDate = {2012, 7, 0, 19, 15, 59, 13, 123};
+ const base::Time::Exploded kLastViewedByMeDate =
+ {2013, 7, 0, 19, 15, 59, 13, 123};
+
// Set an expected data file containing the directory's entry data.
expected_data_file_path_ =
test_util::GetTestFilePath("drive/directory_entry.json");
@@ -434,7 +438,10 @@ TEST_F(DriveApiRequestsTest, FilesInsertRequest) {
test_util::CreateQuitCallback(
&run_loop,
test_util::CreateCopyResultCallback(&error, &file_resource)));
+ request->set_last_viewed_by_me_date(
+ base::Time::FromUTCExploded(kLastViewedByMeDate));
request->set_mime_type("application/vnd.google-apps.folder");
+ request->set_modified_date(base::Time::FromUTCExploded(kModifiedDate));
request->add_parent("root");
request->set_title("new directory");
request_sender_->StartRequestWithRetry(request);
@@ -447,6 +454,12 @@ TEST_F(DriveApiRequestsTest, FilesInsertRequest) {
EXPECT_EQ("application/json", http_request_.headers["Content-Type"]);
EXPECT_TRUE(http_request_.has_content);
+ EXPECT_EQ("{\"lastViewedByMeDate\":\"2013-07-19T15:59:13.123Z\","
+ "\"mimeType\":\"application/vnd.google-apps.folder\","
+ "\"modifiedDate\":\"2012-07-19T15:59:13.123Z\","
+ "\"parents\":[{\"id\":\"root\"}],"
+ "\"title\":\"new directory\"}",
+ http_request_.content);
scoped_ptr<FileResource> expected(
FileResource::CreateFrom(
« no previous file with comments | « google_apis/drive/drive_api_requests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698