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

Unified Diff: chrome/browser/chromeos/gdata/drive_api_parser_unittest.cc

Issue 10855017: Add missing fields in Drive V2 API parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reorder fields, add missed "deleted" field parsing in ChangeResource. Created 8 years, 4 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 | « chrome/browser/chromeos/gdata/drive_api_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/drive_api_parser_unittest.cc
diff --git a/chrome/browser/chromeos/gdata/drive_api_parser_unittest.cc b/chrome/browser/chromeos/gdata/drive_api_parser_unittest.cc
index 56b58b71dd2f32d7b9771ba338b816e57b26690c..73450cb221d5c8aafc7b08675ca67a9e62186557 100644
--- a/chrome/browser/chromeos/gdata/drive_api_parser_unittest.cc
+++ b/chrome/browser/chromeos/gdata/drive_api_parser_unittest.cc
@@ -162,7 +162,7 @@ TEST_F(DriveAPIParserTest, FileListParser) {
"t10AAAAABC"), filelist->next_link());
ASSERT_EQ(3U, filelist->items().size());
- // Check file 1 (a file)
+ // Check file 1 (a regular file)
const FileResource& file1 = *filelist->items()[0];
EXPECT_EQ("0B4v7G8yEYAWHUmRrU2lMS2hLABC", file1.file_id());
EXPECT_EQ("\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/MTM0MzM2NzgwMDIXYZ\"",
@@ -170,6 +170,11 @@ TEST_F(DriveAPIParserTest, FileListParser) {
EXPECT_EQ("My first file data", file1.title());
EXPECT_EQ("application/octet-stream", file1.mime_type());
+ base::Time created_time;
+ ASSERT_TRUE(gdata::util::GetTimeFromString("2012-07-24T08:51:16.570Z",
+ &created_time));
+ EXPECT_EQ(created_time, file1.created_date());
+
base::Time modified_time;
ASSERT_TRUE(gdata::util::GetTimeFromString("2012-07-27T05:43:20.269Z",
&modified_time));
@@ -177,6 +182,9 @@ TEST_F(DriveAPIParserTest, FileListParser) {
ASSERT_EQ(1U, file1.parents().size());
EXPECT_EQ("0B4v7G8yEYAWHYW1OcExsUVZLABC", file1.parents()[0]->file_id());
+ EXPECT_EQ(GURL("https://www.googleapis.com/drive/v2/files/"
+ "0B4v7G8yEYAWHYW1OcExsUVZLABC"),
+ file1.parents()[0]->parent_link());
EXPECT_FALSE(file1.parents()[0]->is_root());
EXPECT_EQ(GURL("https://www.example.com/download"), file1.download_url());
@@ -184,6 +192,16 @@ TEST_F(DriveAPIParserTest, FileListParser) {
EXPECT_EQ("d41d8cd98f00b204e9800998ecf8427e", file1.md5_checksum());
EXPECT_EQ(1000U, file1.file_size());
+ EXPECT_EQ(GURL("https://www.googleapis.com/drive/v2/files/"
+ "0B4v7G8yEYAWHUmRrU2lMS2hLABC"),
+ file1.self_link());
+ EXPECT_EQ(GURL("https://docs.google.com/file/d/"
+ "0B4v7G8yEYAWHUmRrU2lMS2hLABC/edit"),
+ file1.alternate_link());
+ EXPECT_EQ(GURL("https://docs.google.com/uc?"
+ "id=0B4v7G8yEYAWHUmRrU2lMS2hLABC&export=download"),
+ file1.web_content_link());
+
// Check file 2 (a Google Document)
const FileResource& file2 = *filelist->items()[1];
EXPECT_EQ("Test Google Document", file2.title());
@@ -192,6 +210,14 @@ TEST_F(DriveAPIParserTest, FileListParser) {
ASSERT_EQ(0U, file2.parents().size());
+ EXPECT_EQ(GURL("https://docs.google.com/a/chromium.org/document/d/"
+ "1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC/preview"),
+ file2.embed_link());
+ EXPECT_EQ(GURL("https://docs.google.com/feeds/vt?gd=true&"
+ "id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&"
+ "v=3&s=AMedNnoAAAAAUBJyB0g8HbxZaLRnlztxefZPS24LiXYZ&sz=s220"),
+ file2.thumbnail_link());
+
// Check file 3 (a folder)
const FileResource& file3 = *filelist->items()[2];
EXPECT_EQ(0U, file3.file_size());
« no previous file with comments | « chrome/browser/chromeos/gdata/drive_api_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698