Chromium Code Reviews| Index: chrome/browser/chromeos/gdata/mock_gdata_documents_service.cc |
| diff --git a/chrome/browser/chromeos/gdata/mock_gdata_documents_service.cc b/chrome/browser/chromeos/gdata/mock_gdata_documents_service.cc |
| index e34d7f1d5381183998fe265432d94acf222a16c3..3185bfc752410d667b4843fd3062d75330318a89 100644 |
| --- a/chrome/browser/chromeos/gdata/mock_gdata_documents_service.cc |
| +++ b/chrome/browser/chromeos/gdata/mock_gdata_documents_service.cc |
| @@ -44,7 +44,7 @@ static Value* LoadJSONFile(const std::string& filename) { |
| MockDocumentsService::MockDocumentsService() { |
| ON_CALL(*this, Authenticate(_)) |
| .WillByDefault(Invoke(this, &MockDocumentsService::AuthenticateStub)); |
| - ON_CALL(*this, GetDocuments(_, _, _)) |
| + ON_CALL(*this, GetDocuments(_, _, _, _)) |
| .WillByDefault(Invoke(this, &MockDocumentsService::GetDocumentsStub)); |
| ON_CALL(*this, GetAccountMetadata(_)) |
| .WillByDefault(Invoke(this, |
| @@ -71,7 +71,10 @@ MockDocumentsService::MockDocumentsService() { |
| // Fill in the default values for mock feeds. |
| account_metadata_.reset(LoadJSONFile("account_metadata.json")); |
| feed_data_.reset(LoadJSONFile("basic_feed.json")); |
| - directory_data_.reset(LoadJSONFile("subdir_feed.json")); |
| + // TODO(tbarzic): rename the json file. |
|
satorux1
2012/05/03 17:58:34
Any reason why cannot we do this now?
tbarzic
2012/05/03 23:56:17
Well, I guess not..
|
| + directory_data_.reset(LoadJSONFile( |
| + "remote_file_system_apitest_folder_entry.json")); |
| + search_result_.reset(LoadJSONFile("search_result_feed.json")); |
| } |
| MockDocumentsService::~MockDocumentsService() {} |
| @@ -86,10 +89,17 @@ void MockDocumentsService::AuthenticateStub( |
| void MockDocumentsService::GetDocumentsStub( |
| const GURL& feed_url, |
| int start_changestamp, |
| + const std::string& search_string, |
| const GetDataCallback& callback) { |
| - base::MessageLoopProxy::current()->PostTask( |
| - FROM_HERE, |
| - base::Bind(callback, HTTP_SUCCESS, base::Passed(&feed_data_))); |
| + if (search_string.empty()) { |
| + base::MessageLoopProxy::current()->PostTask( |
| + FROM_HERE, |
| + base::Bind(callback, HTTP_SUCCESS, base::Passed(&feed_data_))); |
| + } else { |
| + base::MessageLoopProxy::current()->PostTask( |
| + FROM_HERE, |
| + base::Bind(callback, HTTP_SUCCESS, base::Passed(&search_result_))); |
| + } |
| } |
| void MockDocumentsService::GetAccountMetadataStub( |