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

Unified Diff: chrome/browser/google_apis/fake_drive_service.cc

Issue 13896006: filemanager: Add a browsertest for the sidebar item "Shared with Me". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a merge failure and restore a test case. Created 7 years, 8 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
Index: chrome/browser/google_apis/fake_drive_service.cc
diff --git a/chrome/browser/google_apis/fake_drive_service.cc b/chrome/browser/google_apis/fake_drive_service.cc
index 0c04f0a8245327f153482065644f8d34e360fd56..515601d461eb5e18c192f2775e2bfe263054db54 100644
--- a/chrome/browser/google_apis/fake_drive_service.cc
+++ b/chrome/browser/google_apis/fake_drive_service.cc
@@ -765,6 +765,7 @@ void FakeDriveService::AddNewDirectory(
0, // content_length
parent_resource_id,
directory_name,
+ false, // shared_with_me
"folder");
if (!new_entry) {
scoped_ptr<ResourceEntry> null;
@@ -803,6 +804,7 @@ void FakeDriveService::InitiateUploadNewFile(
0, // content_length
parent_resource_id,
title,
+ false, // shared_with_me
"file");
if (!new_entry) {
MessageLoop::current()->PostTask(
@@ -981,6 +983,7 @@ void FakeDriveService::AddNewFile(const std::string& content_type,
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
+ bool shared_with_me,
const GetResourceEntryCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -1006,6 +1009,7 @@ void FakeDriveService::AddNewFile(const std::string& content_type,
content_length,
parent_resource_id,
title,
+ shared_with_me,
entry_kind);
if (!new_entry) {
scoped_ptr<ResourceEntry> null;
@@ -1157,6 +1161,7 @@ const base::DictionaryValue* FakeDriveService::AddNewEntry(
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
+ bool shared_with_me,
const std::string& entry_kind) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -1193,6 +1198,15 @@ const base::DictionaryValue* FakeDriveService::AddNewEntry(
entry_kind);
categories->Append(category);
new_entry->Set("category", categories);
+ if (shared_with_me) {
+ base::DictionaryValue* shared_with_me_label = new base::DictionaryValue;
+ shared_with_me_label->SetString("label", "shared-with-me");
+ shared_with_me_label->SetString("scheme",
+ "http://schemas.google.com/g/2005/labels");
+ shared_with_me_label->SetString(
+ "term", "http://schemas.google.com/g/2005/labels#shared");
+ categories->Append(shared_with_me_label);
+ }
// Add "content" which sets the content URL.
base::DictionaryValue* content = new base::DictionaryValue;
« no previous file with comments | « chrome/browser/google_apis/fake_drive_service.h ('k') | chrome/browser/google_apis/fake_drive_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698