summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google_apis
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 08:21:19 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 08:21:19 +0000
commit2a16e19aae85a0514961e79257c93d3df43c32d5 (patch)
tree36197fa2f5b7c3a746fc5949e908617bc8ddd061 /chrome/browser/google_apis
parent788fcc0ac1b3a7ca9435481ed8d1d46265d549df (diff)
downloadchromium_src-2a16e19aae85a0514961e79257c93d3df43c32d5.zip
chromium_src-2a16e19aae85a0514961e79257c93d3df43c32d5.tar.gz
chromium_src-2a16e19aae85a0514961e79257c93d3df43c32d5.tar.bz2
drive: Include "include-shared=true" for including shared resources in feeds.
There's no visible change yet, because we are currently ignoring resources that do not belong to the hierarchy rooted at "My Drive". This is for preparation of the coming feature to support "shared-with-me" tab in the Chrome OS Files.app. BUG=189087 Review URL: https://codereview.chromium.org/12412020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google_apis')
-rw-r--r--chrome/browser/google_apis/gdata_wapi_operations_unittest.cc9
-rw-r--r--chrome/browser/google_apis/gdata_wapi_url_generator.cc1
-rw-r--r--chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc29
3 files changed, 23 insertions, 16 deletions
diff --git a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
index 11a8e3e..7cf60c6 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
+++ b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
@@ -338,7 +338,8 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_DefaultFeed) {
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(test_server::METHOD_GET, http_request_.method);
EXPECT_EQ("/feeds/default/private/full?v=3&alt=json&showroot=true&"
- "showfolders=true&max-results=500&include-installed-apps=true",
+ "showfolders=true&include-shared=true&max-results=500&"
+ "include-installed-apps=true",
http_request_.relative_url);
EXPECT_TRUE(test_util::VerifyJsonData(
test_util::GetTestFilePath("chromeos/gdata/root_feed.json"),
@@ -368,7 +369,8 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_ValidFeed) {
EXPECT_EQ(HTTP_SUCCESS, result_code);
EXPECT_EQ(test_server::METHOD_GET, http_request_.method);
EXPECT_EQ("/files/chromeos/gdata/root_feed.json?v=3&alt=json&showroot=true&"
- "showfolders=true&max-results=500&include-installed-apps=true",
+ "showfolders=true&include-shared=true&max-results=500"
+ "&include-installed-apps=true",
http_request_.relative_url);
EXPECT_TRUE(test_util::VerifyJsonData(
test_util::GetTestFilePath("chromeos/gdata/root_feed.json"),
@@ -400,7 +402,8 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_InvalidFeed) {
EXPECT_EQ(GDATA_PARSE_ERROR, result_code);
EXPECT_EQ(test_server::METHOD_GET, http_request_.method);
EXPECT_EQ("/files/chromeos/gdata/testfile.txt?v=3&alt=json&showroot=true&"
- "showfolders=true&max-results=500&include-installed-apps=true",
+ "showfolders=true&include-shared=true&max-results=500&"
+ "include-installed-apps=true",
http_request_.relative_url);
EXPECT_FALSE(result_data);
}
diff --git a/chrome/browser/google_apis/gdata_wapi_url_generator.cc b/chrome/browser/google_apis/gdata_wapi_url_generator.cc
index a585633..eb230d8 100644
--- a/chrome/browser/google_apis/gdata_wapi_url_generator.cc
+++ b/chrome/browser/google_apis/gdata_wapi_url_generator.cc
@@ -82,6 +82,7 @@ GURL GDataWapiUrlGenerator::AddFeedUrlParams(
const std::string& search_string) {
GURL result = AddStandardUrlParams(url);
result = net::AppendOrReplaceQueryParameter(result, "showfolders", "true");
+ result = net::AppendOrReplaceQueryParameter(result, "include-shared", "true");
result = net::AppendOrReplaceQueryParameter(
result,
"max-results",
diff --git a/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc b/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc
index bdd8b20..1fc0c1e 100644
--- a/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc
+++ b/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc
@@ -34,6 +34,7 @@ TEST_F(GDataWapiUrlGeneratorTest, AddInitiateUploadUrlParams) {
TEST_F(GDataWapiUrlGeneratorTest, AddFeedUrlParams) {
EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&"
"showfolders=true"
+ "&include-shared=true"
"&max-results=100"
"&include-installed-apps=true",
GDataWapiUrlGenerator::AddFeedUrlParams(
@@ -44,6 +45,7 @@ TEST_F(GDataWapiUrlGeneratorTest, AddFeedUrlParams) {
).spec());
EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&"
"showfolders=true"
+ "&include-shared=true"
"&max-results=100"
"&include-installed-apps=true"
"&start-index=123",
@@ -55,6 +57,7 @@ TEST_F(GDataWapiUrlGeneratorTest, AddFeedUrlParams) {
).spec());
EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&"
"showfolders=true"
+ "&include-shared=true"
"&max-results=100"
"&include-installed-apps=true"
"&start-index=123"
@@ -71,8 +74,8 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
// This is the very basic URL for the GetResourceList operation.
EXPECT_EQ(
"https://docs.google.com/feeds/default/private/full"
- "?v=3&alt=json&showroot=true&showfolders=true&max-results=500"
- "&include-installed-apps=true",
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true",
url_generator_.GenerateResourceListUrl(GURL(), // override_url,
0, // start_changestamp,
"", // search_string,
@@ -84,8 +87,8 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
// parameters remain as-is.
EXPECT_EQ(
"http://localhost/"
- "?v=3&alt=json&showroot=true&showfolders=true&max-results=500"
- "&include-installed-apps=true",
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true",
url_generator_.GenerateResourceListUrl(
GURL("http://localhost/"), // override_url,
0, // start_changestamp,
@@ -98,8 +101,8 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
// "full" to "changes", and "start-index" parameter is added.
EXPECT_EQ(
"https://docs.google.com/feeds/default/private/changes"
- "?v=3&alt=json&showroot=true&showfolders=true&max-results=500"
- "&include-installed-apps=true"
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true"
"&start-index=100",
url_generator_.GenerateResourceListUrl(GURL(), // override_url,
100, // start_changestamp,
@@ -112,8 +115,8 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
// and "q" parameter is added.
EXPECT_EQ(
"https://docs.google.com/feeds/default/private/full"
- "?v=3&alt=json&showroot=true&showfolders=true&max-results=50"
- "&include-installed-apps=true&q=foo",
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=50&include-installed-apps=true&q=foo",
url_generator_.GenerateResourceListUrl(GURL(), // override_url,
0, // start_changestamp,
"foo", // search_string,
@@ -125,8 +128,8 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
// the default parameters remain.
EXPECT_EQ(
"https://docs.google.com/feeds/default/private/full/-/shared-with-me"
- "?v=3&alt=json&showroot=true&showfolders=true&max-results=500"
- "&include-installed-apps=true",
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true",
url_generator_.GenerateResourceListUrl(GURL(), // override_url,
0, // start_changestamp,
"", // search_string,
@@ -138,8 +141,8 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
// changed, but the default parameters remain.
EXPECT_EQ(
"https://docs.google.com/feeds/default/private/full/XXX/contents"
- "?v=3&alt=json&showroot=true&showfolders=true&max-results=500"
- "&include-installed-apps=true",
+ "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true"
+ "&max-results=500&include-installed-apps=true",
url_generator_.GenerateResourceListUrl(GURL(), // override_url,
0, // start_changestamp,
"", // search_string,
@@ -153,7 +156,7 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) {
EXPECT_EQ(
"http://example.com/"
"?start-index=123&v=3&alt=json&showroot=true&showfolders=true"
- "&max-results=500&include-installed-apps=true",
+ "&include-shared=true&max-results=500&include-installed-apps=true",
url_generator_.GenerateResourceListUrl(
GURL("http://example.com/?start-index=123"), // override_url,
100, // start_changestamp,