summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorhirono <hirono@chromium.org>2015-07-23 11:44:28 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-23 18:45:41 +0000
commit8cdfc496335a58cfb8bdd672c7dce0c23456384b (patch)
tree898aaef5b48ecca6bede92414da8898ca032d4d4 /google_apis
parentb85fa766158f049703c75289efe62d8781c53039 (diff)
downloadchromium_src-8cdfc496335a58cfb8bdd672c7dce0c23456384b.zip
chromium_src-8cdfc496335a58cfb8bdd672c7dce0c23456384b.tar.gz
chromium_src-8cdfc496335a58cfb8bdd672c7dce0c23456384b.tar.bz2
Stop to refer chrome/test/data from google_apis_unittests.
The CL moves test data so that google_apis_unittests does not need to refer chrome/test/data. BUG=512284 TEST=None Review URL: https://codereview.chromium.org/1249623002 Cr-Commit-Position: refs/heads/master@{#340124}
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/drive/base_requests_unittest.cc2
-rw-r--r--google_apis/drive/test_util.cc2
-rw-r--r--google_apis/google_apis_unittests.isolate2
-rw-r--r--google_apis/test/data/drive/about.json251
-rw-r--r--google_apis/test/data/drive/applist.json100
-rw-r--r--google_apis/test/data/drive/applist_app_template.json36
-rw-r--r--google_apis/test/data/drive/applist_empty.json6
-rw-r--r--google_apis/test/data/drive/changelist.json190
-rw-r--r--google_apis/test/data/drive/directory_entry.json46
-rw-r--r--google_apis/test/data/drive/error.json16
-rw-r--r--google_apis/test/data/drive/file_entry.json49
-rw-r--r--google_apis/test/data/drive/filelist.json155
-rw-r--r--google_apis/test/data/drive/testfile.txt1
-rw-r--r--google_apis/test/data/drive/text.txt1
14 files changed, 853 insertions, 4 deletions
diff --git a/google_apis/drive/base_requests_unittest.cc b/google_apis/drive/base_requests_unittest.cc
index 2bd0e03..42fa640 100644
--- a/google_apis/drive/base_requests_unittest.cc
+++ b/google_apis/drive/base_requests_unittest.cc
@@ -193,7 +193,7 @@ TEST_F(MultipartUploadRequestBaseTest, Basic) {
DriveApiErrorCode error = DRIVE_OTHER_ERROR;
base::RunLoop run_loop;
const base::FilePath source_path =
- google_apis::test_util::GetTestFilePath("chromeos/file_manager/text.txt");
+ google_apis::test_util::GetTestFilePath("drive/text.txt");
std::string upload_content_type;
std::string upload_content_data;
FakeMultipartUploadRequest* const multipart_request =
diff --git a/google_apis/drive/test_util.cc b/google_apis/drive/test_util.cc
index aa2d9eb..ae96409 100644
--- a/google_apis/drive/test_util.cc
+++ b/google_apis/drive/test_util.cc
@@ -37,7 +37,7 @@ base::FilePath GetTestFilePath(const std::string& relative_path) {
base::FilePath path;
if (!PathService::Get(base::DIR_SOURCE_ROOT, &path))
return base::FilePath();
- path = path.AppendASCII("chrome")
+ path = path.AppendASCII("google_apis")
.AppendASCII("test")
.AppendASCII("data")
.Append(base::FilePath::FromUTF8Unsafe(relative_path));
diff --git a/google_apis/google_apis_unittests.isolate b/google_apis/google_apis_unittests.isolate
index f622185..26a84d2 100644
--- a/google_apis/google_apis_unittests.isolate
+++ b/google_apis/google_apis_unittests.isolate
@@ -15,8 +15,6 @@
'--test-launcher-bot-mode',
],
'files': [
- '../chrome/test/data/drive/',
- '../chrome/test/data/chromeos/file_manager/text.txt',
'../testing/test_env.py',
'<(PRODUCT_DIR)/google_apis_unittests<(EXECUTABLE_SUFFIX)',
'test/',
diff --git a/google_apis/test/data/drive/about.json b/google_apis/test/data/drive/about.json
new file mode 100644
index 0000000..4a4eb9b
--- /dev/null
+++ b/google_apis/test/data/drive/about.json
@@ -0,0 +1,251 @@
+{
+ "kind": "drive#about",
+ "etag": "\"ia2FSHMEjvcFQvtI43H5NSXKABC/2QujpLrTbaz3UJ2wpt1HSuAZXYZ\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/about",
+ "name": "Test User",
+ "quotaBytesTotal": "5368709120",
+ "quotaBytesUsedAggregate": "1073741824",
+ "quotaBytesUsedInTrash": "0",
+ "largestChangeId": "8177",
+ "rootFolderId": "0AIv7G8yEYAWHUk9123",
+ "domainSharingPolicy": "allowedWithWarning",
+ "permissionId": "12141426201712069789",
+ "importFormats": [
+ {
+ "source": "application/msword",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "text/plain",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "text/tab-separated-values",
+ "targets": [
+ "application/vnd.google-apps.spreadsheet"
+ ]
+ },
+ {
+ "source": "application/vnd.ms-excel",
+ "targets": [
+ "application/vnd.google-apps.spreadsheet"
+ ]
+ },
+ {
+ "source": "application/vnd.sun.xml.writer",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "image/bmp",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "application/rtf",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "image/gif",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "text/csv",
+ "targets": [
+ "application/vnd.google-apps.spreadsheet"
+ ]
+ },
+ {
+ "source": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
+ "targets": [
+ "application/vnd.google-apps.presentation"
+ ]
+ },
+ {
+ "source": "application/x-msmetafile",
+ "targets": [
+ "application/vnd.google-apps.drawing"
+ ]
+ },
+ {
+ "source": "application/vnd.oasis.opendocument.text",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ "targets": [
+ "application/vnd.google-apps.spreadsheet"
+ ]
+ },
+ {
+ "source": "application/vnd.ms-powerpoint",
+ "targets": [
+ "application/vnd.google-apps.presentation"
+ ]
+ },
+ {
+ "source": "application/x-vnd.oasis.opendocument.spreadsheet",
+ "targets": [
+ "application/vnd.google-apps.spreadsheet"
+ ]
+ },
+ {
+ "source": "application/pdf",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "image/jpeg",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "image/png",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ },
+ {
+ "source": "text/html",
+ "targets": [
+ "application/vnd.google-apps.document"
+ ]
+ }
+ ],
+ "exportFormats": [
+ {
+ "source": "application/vnd.google-apps.form",
+ "targets": [
+ "application/pdf",
+ "application/x-vnd.oasis.opendocument.spreadsheet",
+ "application/vnd.ms-excel"
+ ]
+ },
+ {
+ "source": "application/vnd.google-apps.presentation",
+ "targets": [
+ "application/pdf",
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation"
+ ]
+ },
+ {
+ "source": "application/vnd.google-apps.spreadsheet",
+ "targets": [
+ "application/pdf",
+ "application/x-vnd.oasis.opendocument.spreadsheet",
+ "application/vnd.ms-excel"
+ ]
+ },
+ {
+ "source": "application/vnd.google-apps.document",
+ "targets": [
+ "application/vnd.oasis.opendocument.text",
+ "application/msword",
+ "text/html",
+ "application/rtf",
+ "text/plain",
+ "application/pdf"
+ ]
+ },
+ {
+ "source": "application/vnd.google-apps.drawing",
+ "targets": [
+ "image/svg+xml",
+ "image/jpeg",
+ "image/png",
+ "application/pdf"
+ ]
+ }
+ ],
+ "additionalRoleInfo": [
+ {
+ "type": "application/vnd.google-apps.document",
+ "roleSets": [
+ {
+ "primaryRole": "reader",
+ "additionalRoles": [
+ "commenter"
+ ]
+ }
+ ]
+ },
+ {
+ "type": "application/vnd.google-apps.drawing",
+ "roleSets": [
+ {
+ "primaryRole": "reader",
+ "additionalRoles": [
+ "commenter"
+ ]
+ }
+ ]
+ },
+ {
+ "type": "application/vnd.google-apps.presentation",
+ "roleSets": [
+ {
+ "primaryRole": "reader",
+ "additionalRoles": [
+ "commenter"
+ ]
+ }
+ ]
+ }
+ ],
+ "features": [
+ {
+ "featureName": "ocr"
+ },
+ {
+ "featureName": "translation",
+ "featureRate": 2.0
+ }
+ ],
+ "maxUploadSizes": [
+ {
+ "type": "application/vnd.google-apps.drawing",
+ "size": "2097152"
+ },
+ {
+ "type": "*",
+ "size": "10737418240"
+ },
+ {
+ "type": "application/vnd.google-apps.presentation",
+ "size": "52428800"
+ },
+ {
+ "type": "application/vnd.google-apps.document",
+ "size": "2097152"
+ },
+ {
+ "type": "application/vnd.google-apps.spreadsheet",
+ "size": "20971520"
+ },
+ {
+ "type": "application/pdf",
+ "size": "10737418240"
+ }
+ ],
+ "isCurrentAppInstalled": false
+}
diff --git a/google_apis/test/data/drive/applist.json b/google_apis/test/data/drive/applist.json
new file mode 100644
index 0000000..01bb52b
--- /dev/null
+++ b/google_apis/test/data/drive/applist.json
@@ -0,0 +1,100 @@
+{
+ "kind": "drive#appList",
+ "etag": "\"Jm4BaSnCWNND-noZsHINRqj4ABC/tuqRBw0lvjUdPtc_2msA1tN4XYZ\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/apps",
+ "items": [
+ {
+ "kind": "drive#app",
+ "id": "123456788192",
+ "name": "Drive app 1",
+ "objectType": "",
+ "supportsCreate": true,
+ "supportsImport": true,
+ "installed": true,
+ "authorized": false,
+ "removable": true,
+ "productUrl": "https://chrome.google.com/webstore/detail/abcdefghabcdefghabcdefghabcdefgh",
+ "productId": "abcdefghabcdefghabcdefghabcdefgh",
+ "createUrl": "https://www.example.com/createForApp1",
+ "primaryMimeTypes": [
+ "application/vnd.google-apps.drive-sdk.123456788192"
+ ],
+ "secondaryMimeTypes": [
+ "text/html",
+ "text/plain"
+ ],
+ "primaryFileExtensions": [
+ "exe",
+ "com"
+ ],
+ "icons": [
+ {
+ "category": "application",
+ "size": 10,
+ "iconUrl": "http://www.example.com/10.png"
+ },
+ {
+ "category": "application",
+ "size": 16,
+ "iconUrl": "http://www.example.com/16.png"
+ },
+ {
+ "category": "document",
+ "size": 10,
+ "iconUrl": "http://www.example.com/d10.png"
+ },
+ {
+ "category": "document",
+ "size": 16,
+ "iconUrl": "http://www.example.com/d16.png"
+ },
+ {
+ "category": "documentShared",
+ "size": 10,
+ "iconUrl": "http://www.example.com/ds10.png"
+ },
+ {
+ "category": "documentShared",
+ "size": 16,
+ "iconUrl": "http://www.example.com/ds16.png"
+ }
+ ]
+ },
+ {
+ "kind": "drive#app",
+ "id": "876543210000",
+ "name": "Drive app 2",
+ "objectType": "",
+ "supportsCreate": false,
+ "supportsImport": false,
+ "installed": true,
+ "authorized": false,
+ "removable": false,
+ "productUrl": "https://chrome.google.com/webstore/detail/hgfedcbahgfedcbahgfedcbahgfedcba",
+ "productId": "hgfedcbahgfedcbahgfedcbahgfedcba",
+ "createUrl": "https://www.example.com/createForApp2",
+ "primaryMimeTypes": [
+ "image/jpeg",
+ "image/png",
+ "application/vnd.google-apps.drive-sdk.876543210000"
+ ],
+ "icons": [
+ {
+ "category": "application",
+ "size": 10,
+ "iconUrl": "http://www.example.com/10.png"
+ },
+ {
+ "category": "document",
+ "size": 10,
+ "iconUrl": "http://www.example.com/d10.png"
+ },
+ {
+ "category": "documentShared",
+ "size": 10,
+ "iconUrl": "http://www.example.com/ds10.png"
+ }
+ ]
+ }
+ ]
+}
diff --git a/google_apis/test/data/drive/applist_app_template.json b/google_apis/test/data/drive/applist_app_template.json
new file mode 100644
index 0000000..daa5a4d
--- /dev/null
+++ b/google_apis/test/data/drive/applist_app_template.json
@@ -0,0 +1,36 @@
+{
+ "kind": "drive#app",
+ "id": "$AppId",
+ "name": "$AppName",
+ "objectType": "",
+ "supportsCreate": false,
+ "supportsImport": false,
+ "installed": true,
+ "authorized": false,
+ "removable": $Removable,
+ "productUrl": "https://chrome.google.com/webstore/detail/$ProductId",
+ "productId": "$ProductId",
+ "createUrl": "$CreateUrl",
+ "primaryMimeTypes": [
+ "image/jpeg",
+ "image/png",
+ "application/vnd.google-apps.drive-sdk.876543210000"
+ ],
+ "icons": [
+ {
+ "category": "application",
+ "size": 10,
+ "iconUrl": "http://www.example.com/10.png"
+ },
+ {
+ "category": "document",
+ "size": 10,
+ "iconUrl": "http://www.example.com/d10.png"
+ },
+ {
+ "category": "documentShared",
+ "size": 10,
+ "iconUrl": "http://www.example.com/ds10.png"
+ }
+ ]
+}
diff --git a/google_apis/test/data/drive/applist_empty.json b/google_apis/test/data/drive/applist_empty.json
new file mode 100644
index 0000000..2dcd51b
--- /dev/null
+++ b/google_apis/test/data/drive/applist_empty.json
@@ -0,0 +1,6 @@
+{
+ "kind": "drive#appList",
+ "etag": "\"Jm4BaSnCWNND-noZsHINRqj4ABC/tuqRBw0lvjUdPtc_2msA1tN4XYZ\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/apps",
+ "items": []
+}
diff --git a/google_apis/test/data/drive/changelist.json b/google_apis/test/data/drive/changelist.json
new file mode 100644
index 0000000..1f17785
--- /dev/null
+++ b/google_apis/test/data/drive/changelist.json
@@ -0,0 +1,190 @@
+{
+ "kind": "drive#changeList",
+ "etag": "\"Lp2bjAtLP341hvGmYHhxjYyBPJ8/BWbu_eylt5f_aGtCN6mGRv9hABC\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/changes",
+ "nextPageToken": "8929",
+ "nextLink": "https://www.googleapis.com/drive/v2/changes?pageToken=8929",
+ "largestChangeId": "13664",
+ "items": [
+ {
+ "kind": "drive#change",
+ "id": "8421",
+ "fileId": "1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/changes/8421",
+ "deleted": false,
+ "file": {
+ "kind": "drive#file",
+ "id": "1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC",
+ "etag": "\"Lp2bjAtLP341hvGmYHhxjYyBPJ8/MTM0MzM2NDg1MTAABC\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC",
+ "alternateLink": "https://docs.google.com/a/chromium.org/document/d/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC/edit",
+ "embedLink": "https://docs.google.com/a/chromium.org/document/d/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC/preview",
+ "thumbnailLink": "https://docs.google.com/feeds/vt?gd=true&id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&v=3&s=AMedNnoAAAAAUBo617fje6DQnYkylcdbcGp8aXpFiXYZ&sz=s220",
+ "title": "Test Google Document",
+ "mimeType": "application/vnd.google-apps.document",
+ "labels": {
+ "starred": false,
+ "hidden": false,
+ "trashed": false,
+ "restricted": false,
+ "viewed": true
+ },
+ "createdDate": "2012-07-27T04:54:09.686Z",
+ "modifiedDate": "2012-07-27T04:54:11.030Z",
+ "modifiedByMeDate": "2012-07-27T04:54:11.030Z",
+ "lastViewedByMeDate": "2012-07-27T04:54:11.030Z",
+ "parents": [
+ {
+ "kind": "drive#parentReference",
+ "id": "0AIv7G8yEYAWHUk9ABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC/parents/0AIv7G8yEYAWHUk9ABC",
+ "parentLink": "https://www.googleapis.com/drive/v2/files/0AIv7G8yEYAWHUk9ABC",
+ "isRoot": true
+ }
+ ],
+ "exportLinks": {
+ "application/msword": "https://docs.google.com/feeds/download/documents/export/Export?id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&exportFormat=doc",
+ "text/html": "https://docs.google.com/feeds/download/documents/export/Export?id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&exportFormat=html",
+ "application/pdf": "https://docs.google.com/feeds/download/documents/export/Export?id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&exportFormat=pdf"
+ },
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"Lp2bjAtLP341hvGmYHhxjYyBPJ8/ufh4Gu_RoDI23a1Nr8tDm1yJXYZ\"",
+ "id": "me",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC/permissions/me",
+ "role": "owner",
+ "type": "user"
+ },
+ "quotaBytesUsed": "0",
+ "ownerNames": [
+ "Test User"
+ ],
+ "lastModifyingUserName": "Test User",
+ "editable": true,
+ "shared": false,
+ "writersCanShare": true
+ },
+ "modificationDate": "2012-07-27T04:54:11.030Z"
+ },
+ {
+ "kind": "drive#change",
+ "id": "8424",
+ "fileId": "0B4v7G8yEYAWHUmRrU2lMS2hLABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/changes/8424",
+ "deleted": false,
+ "file": {
+ "kind": "drive#file",
+ "id": "0B4v7G8yEYAWHUmRrU2lMS2hLABC",
+ "etag": "\"Lp2bjAtLP341hvGmYHhxjYyBPJ8/MTM0MzM2NzgwMDIABC\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHUmRrU2lMS2hLABC",
+ "webContentLink": "https://docs.google.com/a/chromium.org/uc?id=0B4v7G8yEYAWHUmRrU2lMS2hLABC&export=download",
+ "alternateLink": "https://docs.google.com/a/chromium.org/file/d/0B4v7G8yEYAWHUmRrU2lMS2hLABC/edit",
+ "title": "My first file data",
+ "mimeType": "application/octet-stream",
+ "labels": {
+ "starred": false,
+ "hidden": false,
+ "trashed": false,
+ "restricted": false,
+ "viewed": true
+ },
+ "createdDate": "2012-07-24T08:51:16.570Z",
+ "modifiedDate": "2012-07-27T05:43:20.269Z",
+ "modifiedByMeDate": "2012-07-27T05:43:20.269Z",
+ "lastViewedByMeDate": "2012-07-27T05:43:20.269Z",
+ "parents": [
+ {
+ "kind": "drive#parentReference",
+ "id": "0AIv7G8yEYAWHUk9ABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHUmRrU2lMS2hLABC/parents/0AIv7G8yEYAWHUk9ABC",
+ "parentLink": "https://www.googleapis.com/drive/v2/files/0AIv7G8yEYAWHUk9ABC",
+ "isRoot": true
+ }
+ ],
+ "downloadUrl": "https://www.example.com/download",
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"Lp2bjAtLP341hvGmYHhxjYyBPJ8/TZY6eNr9QBUIWHY-czo93820XYZ\"",
+ "id": "me",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHUmRrU2lMS2hLABC/permissions/me",
+ "role": "owner",
+ "type": "user"
+ },
+ "originalFilename": "Untitled Document.ext",
+ "fileExtension": "ext",
+ "md5Checksum": "d41d8cd98f00b204e9800998ecf8427e",
+ "fileSize": "1000",
+ "quotaBytesUsed": "1000",
+ "ownerNames": [
+ "Test User"
+ ],
+ "lastModifyingUserName": "Takayoshi Kochi",
+ "editable": true,
+ "shared": true,
+ "writersCanShare": true
+ },
+ "modificationDate": "2012-07-27T05:43:20.269Z"
+ },
+ {
+ "kind": "drive#change",
+ "id": "8429",
+ "fileId": "0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/changes/8429",
+ "deleted": false,
+ "file": {
+ "kind": "drive#file",
+ "id": "0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "etag": "\"Lp2bjAtLP341hvGmYHhxjYyBPJ8/MTM0MzM2NDE5ODUABC\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "alternateLink": "https://docs.google.com/a/chromium.org/folder/d/0B4v7G8yEYAWHYW1OcExsUVZLABC/edit",
+ "title": "TestFolder",
+ "mimeType": "application/vnd.google-apps.folder",
+ "labels": {
+ "starred": false,
+ "hidden": false,
+ "trashed": false,
+ "restricted": false,
+ "viewed": true
+ },
+ "createdDate": "2012-07-02T09:53:18.422Z",
+ "modifiedDate": "2012-07-27T04:43:18.507Z",
+ "modifiedByMeDate": "2012-07-27T04:43:18.507Z",
+ "lastViewedByMeDate": "2012-07-27T04:40:52.371Z",
+ "parents": [
+ {
+ "kind": "drive#parentReference",
+ "id": "0AIv7G8yEYAWHUk9ABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHYW1OcExsUVZLABC/parents/0AIv7G8yEYAWHUk9ABC",
+ "parentLink": "https://www.googleapis.com/drive/v2/files/0AIv7G8yEYAWHUk9ABC",
+ "isRoot": true
+ }
+ ],
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"Lp2bjAtLP341hvGmYHhxjYyBPJ8/ID_i9phaKU8rzxPcIL8yOWlMABC\"",
+ "id": "me",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHYW1OcExsUVZLABC/permissions/me",
+ "role": "owner",
+ "type": "user"
+ },
+ "quotaBytesUsed": "0",
+ "ownerNames": [
+ "Test User"
+ ],
+ "lastModifyingUserName": "Test User",
+ "editable": true,
+ "shared": false,
+ "writersCanShare": true
+ },
+ "modificationDate": "2012-07-27T04:43:18.507Z"
+ },
+ {
+ "kind": "drive#change",
+ "id": "8430",
+ "fileId": "ABCv7G8yEYAWHc3Y5X0hMSkJYXYZ",
+ "selfLink": "https://www.googleapis.com/drive/v2/changes/16429",
+ "deleted": true,
+ "modificationDate": "2012-07-27T12:34:56.789Z"
+ }
+ ]
+}
diff --git a/google_apis/test/data/drive/directory_entry.json b/google_apis/test/data/drive/directory_entry.json
new file mode 100644
index 0000000..a6564ae
--- /dev/null
+++ b/google_apis/test/data/drive/directory_entry.json
@@ -0,0 +1,46 @@
+{
+ "kind": "drive#file",
+ "id": "directory_resource_id",
+ "etag": "\"directory_etag/files_etag\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/directory_resource_id",
+ "alternateLink": "https://docs.google.com/folder/d/directory_resource_id/edit",
+ "iconLink": "https://ssl.gstatic.com/docs/doclist/images/icon_11_collection_list.png",
+ "title": "new directory",
+ "mimeType": "application/vnd.google-apps.folder",
+ "labels": {
+ "starred": false,
+ "hidden": false,
+ "trashed": false,
+ "restricted": false,
+ "viewed": true
+ },
+ "createdDate": "2013-01-28T05:54:08.286Z",
+ "modifiedDate": "2013-01-28T05:54:08.281Z",
+ "modifiedByMeDate": "2013-01-28T05:54:08.281Z",
+ "lastViewedByMeDate": "2013-01-28T05:54:08.281Z",
+ "parents": [
+ {
+ "kind": "drive#parentReference",
+ "id": "root_directory_id",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/directory_resource_id/parents/root_directory_id",
+ "parentLink": "https://www.googleapis.com/drive/v2/files/root_directory_id",
+ "isRoot": true
+ }
+ ],
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"directory_etag/permission_etag\"",
+ "id": "me",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/directory_resource_id/permissions/me",
+ "role": "owner",
+ "type": "user"
+ },
+ "quotaBytesUsed": "0",
+ "ownerNames": [
+ "tester"
+ ],
+ "lastModifyingUserName": "tester",
+ "editable": true,
+ "writersCanShare": true,
+ "shared": false
+}
diff --git a/google_apis/test/data/drive/error.json b/google_apis/test/data/drive/error.json
new file mode 100644
index 0000000..23b2d90
--- /dev/null
+++ b/google_apis/test/data/drive/error.json
@@ -0,0 +1,16 @@
+{
+ "error": {
+ "errors": [
+ {
+ "domain": "global",
+ "reason": "conditionNotMet",
+ "message": "Precondition Failed",
+ "locationType": "header",
+ "location": "If-Match",
+ "debugInfo": "code: CONDITION_NOT_MET\nhttp status: 412\ncause: ...",
+ }
+ ],
+ "code": 412,
+ "message": "Precondition Failed"
+ }
+}
diff --git a/google_apis/test/data/drive/file_entry.json b/google_apis/test/data/drive/file_entry.json
new file mode 100644
index 0000000..3a1f71a
--- /dev/null
+++ b/google_apis/test/data/drive/file_entry.json
@@ -0,0 +1,49 @@
+{
+ "kind": "drive#file",
+ "id": "0B4v7G8yEYAWHUmRrU2lMS2hLABC",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/MTM0MzM2NzgwMDIXYZ\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHUmRrU2lMS2hLABC",
+ "webContentLink": "https://docs.google.com/uc?id=0B4v7G8yEYAWHUmRrU2lMS2hLABC&export=download",
+ "alternateLink": "https://docs.google.com/file/d/0B4v7G8yEYAWHUmRrU2lMS2hLABC/edit",
+ "title": "My first file data",
+ "mimeType": "application/octet-stream",
+ "labels": {
+ "starred": false,
+ "hidden": false,
+ "trashed": false,
+ "restricted": false,
+ "viewed": true
+ },
+ "createdDate": "2012-07-24T08:51:16.570Z",
+ "modifiedDate": "2012-07-27T05:43:20.269Z",
+ "modifiedByMeDate": "2012-07-27T05:43:20.269Z",
+ "lastViewedByMeDate": "2012-07-27T05:43:20.269Z",
+ "parents": [
+ {
+ "kind": "drive#parentReference",
+ "id": "0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHNGpYVHJINEFFABC/parents/0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "parentLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "isRoot": false
+ }
+ ],
+ "downloadUrl": "https://www.example.com/download",
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/LKOJhhwatz2OKj-OblM3EvO8XYZ\"",
+ "id": "me",
+ "role": "owner",
+ "type": "user"
+ },
+ "originalFilename": "Untitled Document.ext",
+ "fileExtension": "ext",
+ "md5Checksum": "d41d8cd98f00b204e9800998ecf8427e",
+ "fileSize": "1000",
+ "quotaBytesUsed": "1000",
+ "ownerNames": [
+ "Test User"
+ ],
+ "lastModifyingUserName": "Test User",
+ "editable": true,
+ "writersCanShare": true
+}
diff --git a/google_apis/test/data/drive/filelist.json b/google_apis/test/data/drive/filelist.json
new file mode 100644
index 0000000..b1712f1
--- /dev/null
+++ b/google_apis/test/data/drive/filelist.json
@@ -0,0 +1,155 @@
+{
+ "kind": "drive#fileList",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/zyHTfoHpnRHovyi8bWpwK0DXABC\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files",
+ "nextPageToken": "EAIaggELEgA6egpi96It9mH_____f_8AAP__AAD_okhU-cHLz83KzszMxsjMzs_RyNGJnridyrbHs7u9tv8AAP__AP7__n__AP8AokhU-cHLz83KzszMxsjMzs_RyNGJnridyrbHs7u9tv8A__4QZCEiXPTi_wtIgTkAAAAAngnSXUgCDEAAIgsJPgart10AAAAABC",
+ "nextLink": "https://www.googleapis.com/drive/v2/files?pageToken=EAIaggELEgA6egpi96It9mH_____f_8AAP__AAD_okhU-cHLz83KzszMxsjMzs_RyNGJnridyrbHs7u9tv8AAP__AP7__n__AP8AokhU-cHLz83KzszMxsjMzs_RyNGJnridyrbHs7u9tv8A__4QZCEiXPTi_wtIgTkAAAAAngnSXUgCDEAAIgsJPgart10AAAAABC",
+ "items": [
+ {
+ "kind": "drive#file",
+ "id": "0B4v7G8yEYAWHUmRrU2lMS2hLABC",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/MTM0MzM2NzgwMDIXYZ\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHUmRrU2lMS2hLABC",
+ "webContentLink": "https://docs.google.com/uc?id=0B4v7G8yEYAWHUmRrU2lMS2hLABC&export=download",
+ "alternateLink": "https://docs.google.com/file/d/0B4v7G8yEYAWHUmRrU2lMS2hLABC/edit",
+ "title": "My first file data",
+ "mimeType": "application/octet-stream",
+ "openWithLinks": {
+ "1234567890": "http://open_with_link/url"
+ },
+ "labels": {
+ "starred": false,
+ "hidden": false,
+ "trashed": false,
+ "restricted": false,
+ "viewed": true
+ },
+ "imageMediaMetadata": {
+ "width": 640,
+ "height": 480,
+ "rotation": 90
+ },
+ "createdDate": "2012-07-24T08:51:16.570Z",
+ "modifiedDate": "2012-07-27T05:43:20.269Z",
+ "modifiedByMeDate": "2012-07-27T05:43:20.269Z",
+ "lastViewedByMeDate": "2012-07-27T05:43:20.269Z",
+ "parents": [
+ {
+ "kind": "drive#parentReference",
+ "id": "0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHNGpYVHJINEFFABC/parents/0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "parentLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "isRoot": false
+ }
+ ],
+ "downloadUrl": "https://www.example.com/download",
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/LKOJhhwatz2OKj-OblM3EvO8XYZ\"",
+ "id": "me",
+ "role": "owner",
+ "type": "user"
+ },
+ "originalFilename": "Untitled Document.ext",
+ "fileExtension": "ext",
+ "md5Checksum": "d41d8cd98f00b204e9800998ecf8427e",
+ "fileSize": "1000",
+ "quotaBytesUsed": "1000",
+ "ownerNames": [
+ "Test User"
+ ],
+ "lastModifyingUserName": "Test User",
+ "editable": true,
+ "shared": false,
+ "writersCanShare": true
+ },
+ {
+ "kind": "drive#file",
+ "id": "1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/MTM0MzM2NDg1MTAXYZ\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC",
+ "alternateLink": "https://docs.google.com/a/chromium.org/document/d/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC/edit",
+ "embedLink": "https://docs.google.com/a/chromium.org/document/d/1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC/preview",
+ "shareLink": "https://drive.google.com/share?id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&embedOrigin=chrome-extension://test&hl=ja",
+ "thumbnailLink": "https://docs.google.com/feeds/vt?gd=true&id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&v=3&s=AMedNnoAAAAAUBJyB0g8HbxZaLRnlztxefZPS24LiXYZ&sz=s220",
+ "title": "Test Google Document",
+ "mimeType": "application/vnd.google-apps.document",
+ "labels": {
+ "starred": true,
+ "hidden": true,
+ "trashed": true,
+ "restricted": true,
+ "viewed": true
+ },
+ "createdDate": "2012-07-27T04:54:09.686Z",
+ "modifiedDate": "2012-07-27T04:54:11.030Z",
+ "modifiedByMeDate": "2012-07-27T04:54:11.030Z",
+ "lastViewedByMeDate": "2012-07-27T04:54:11.030Z",
+ "sharedWithMeDate": "2012-07-27T04:54:11.030Z",
+ "exportLinks": {
+ "application/msword": "https://docs.google.com/feeds/download/documents/export/Export?id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&exportFormat=doc",
+ "text/html": "https://docs.google.com/feeds/download/documents/export/Export?id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&exportFormat=html",
+ "application/pdf": "https://docs.google.com/feeds/download/documents/export/Export?id=1Pc8jzfU1ErbN_eucMMqdqzY3eBm0v8sxXm_1CtLxABC&exportFormat=pdf"
+ },
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/LKOJhhwatz2OKj-OblM3EvO8XYZ\"",
+ "id": "me",
+ "role": "owner",
+ "type": "user"
+ },
+ "quotaBytesUsed": "0",
+ "ownerNames": [
+ "Test User"
+ ],
+ "lastModifyingUserName": "Test User",
+ "editable": true,
+ "shared": true,
+ "writersCanShare": true
+ },
+ {
+ "kind": "drive#file",
+ "id": "0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/MTM0MzM2NDE5ODUXYZ\"",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHYW1OcExsUVZLABC",
+ "alternateLink": "https://docs.google.com/a/chromium.org/folder/d/0B4v7G8yEYAWHYW1OcExsUVZLABC/edit",
+ "title": "TestFolder",
+ "mimeType": "application/vnd.google-apps.folder",
+ "labels": {
+ "starred": false,
+ "hidden": false,
+ "trashed": false,
+ "restricted": false,
+ "viewed": true
+ },
+ "createdDate": "2012-07-02T09:53:18.422Z",
+ "modifiedDate": "2012-07-27T04:43:18.507Z",
+ "modifiedByMeDate": "2012-07-27T04:43:18.507Z",
+ "lastViewedByMeDate": "2012-07-27T04:40:52.371Z",
+ "parents": [
+ {
+ "kind": "drive#parentReference",
+ "id": "0AIv7G8yEYAWHUk9ABC",
+ "selfLink": "https://www.googleapis.com/drive/v2/files/0B4v7G8yEYAWHYW1OcExsUVZLABC/parents/0AIv7G8yEYAWHUk9ABC",
+ "parentLink": "https://www.googleapis.com/drive/v2/files/0AIv7G8yEYAWHUk9ABC",
+ "isRoot": true
+ }
+ ],
+ "userPermission": {
+ "kind": "drive#permission",
+ "etag": "\"WtRjAPZWbDA7_fkFjc5ojsEvDEF/LKOJhhwatz2OKj-OblM3EvO8XYZ\"",
+ "id": "me",
+ "role": "owner",
+ "type": "user"
+ },
+ "quotaBytesUsed": "0",
+ "ownerNames": [
+ "Test User"
+ ],
+ "lastModifyingUserName": "Test User",
+ "editable": true,
+ "shared": false,
+ "writersCanShare": true
+ }
+ ]
+}
diff --git a/google_apis/test/data/drive/testfile.txt b/google_apis/test/data/drive/testfile.txt
new file mode 100644
index 0000000..16b14f5
--- /dev/null
+++ b/google_apis/test/data/drive/testfile.txt
@@ -0,0 +1 @@
+test file
diff --git a/google_apis/test/data/drive/text.txt b/google_apis/test/data/drive/text.txt
new file mode 100644
index 0000000..cbb4352
--- /dev/null
+++ b/google_apis/test/data/drive/text.txt
@@ -0,0 +1 @@
+This is a sample file. I like chocolate and chips.