Commit ea68c563 authored by lucas.parsy's avatar lucas.parsy

modified gdrivestorage's allDocs to return only the documents ids.

modified gdrivestorage test file to fit the above changes.
refactored an URI template in gdrivestorage.
parent 14831f19
......@@ -14,15 +14,14 @@
"use strict";
var UPLOAD_URL = "https://www.googleapis.com{/upload}/drive/v2/files{/id}" +
"{?uploadType}{&access_token}",
"{?uploadType,access_token}",
upload_template = UriTemplate.parse(UPLOAD_URL),
REMOVE_URL = "https://www.googleapis.com/drive/v2/" +
"files{/id,trash}{?access_token}",
remove_template = UriTemplate.parse(REMOVE_URL),
LIST_URL = "https://www.googleapis.com/drive/v2/files" +
"?prettyPrint=false{&pageToken}&q=trashed=false" +
"&fields=nextPageToken,items(id,mimeType,title,parents(id,isRoot))" +
"{&access_token}",
"&fields=nextPageToken,items(id){&access_token}",
list_template = UriTemplate.parse(LIST_URL),
GET_URL = "https://www.googleapis.com/drive/v2/files{/id}{?alt}",
get_template = UriTemplate.parse(GET_URL);
......
......@@ -16,18 +16,14 @@
boundary = "---------314159265358979323846",
list_url = domain + "/drive/v2/files" +
"?prettyPrint=false&pageToken=&q=trashed=false" +
"&fields=nextPageToken,items(id,mimeType,title,parents(id,isRoot))" +
"&fields=nextPageToken,items(id)" +
"&access_token=" + token,
sample_list = '{"items":[' +
'{"id":"0B4kh3jbjOf5LamRlX21MZlVCYXM"}]}',
part_sample1 = '{"nextPageToken": "nptkn01",' +
'"items":[{"id":"0B4kh3jbjOf5Lb2theE8xWHhvWXM","title":"' +
'attach1","mimeType":"text/plain","parents":[{"id":"0B4kh3jbjOf5LN' +
'0Y2V0ZJS0VxS00","isRoot":false}]}]}',
part_sample2 = '{"items":[{"id":"0B4kh3jbjOf5LamRlX21MZ' +
'lVCYXM","title":"file2","mimeType":"text/plain","parents":[{"id":' +
'"0AIkh3jbjOf5LUk9PVA","isRoot":true}]}]}';
'"items":[{"id":"0B4kh3jbjOf5Lb2theE8xWHhvWXM"}]}',
part_sample2 = '{"items":[{"id":"0B4kh3jbjOf5LamRlX21MZ"}]}';
function error404Tester(fun, encl, blob) {
stop();
......@@ -361,19 +357,14 @@
server = this.server,
token_url = domain + "/drive/v2/files" +
"?prettyPrint=false&pageToken=nptkn01&q=trashed=false" +
"&fields=nextPageToken,items(id,mimeType,title,parents(id,isRoot))" +
"&fields=nextPageToken,items(id)" +
"&access_token=" + token;
object_result.data.rows.push(
{"id": "0B4kh3jbjOf5Lb2theE8xWHhvWXM", "title": "attach1",
"mimeType": "text/plain",
"parents": [{"id": "0B4kh3jbjOf5LN0Y2V0ZJS0VxS00", "isRoot": false}],
"value": {}}
{"id": "0B4kh3jbjOf5Lb2theE8xWHhvWXM", "value": {}}
);
object_result.data.rows.push(
{"id": "0B4kh3jbjOf5LamRlX21MZlVCYXM", "title": "file2",
"mimeType": "text/plain",
"parents": [{"id": "0AIkh3jbjOf5LUk9PVA", "isRoot": true}], "value": {}}
{"id": "0B4kh3jbjOf5LamRlX21MZ", "value": {}}
);
this.server.respondWith("GET", list_url, [200, {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment