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

Side by Side Diff: chrome/browser/drive/fake_drive_service.cc

Issue 394103003: Add unit tests for drive::FileTaskExecutor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to Review #2 Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/drive/fake_drive_service.h ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/drive/fake_drive_service.h" 5 #include "chrome/browser/drive/fake_drive_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 new FileResource(*file))); 1161 new FileResource(*file)));
1162 return CancelCallback(); 1162 return CancelCallback();
1163 } 1163 }
1164 1164
1165 CancelCallback FakeDriveService::AuthorizeApp( 1165 CancelCallback FakeDriveService::AuthorizeApp(
1166 const std::string& resource_id, 1166 const std::string& resource_id,
1167 const std::string& app_id, 1167 const std::string& app_id,
1168 const AuthorizeAppCallback& callback) { 1168 const AuthorizeAppCallback& callback) {
1169 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1169 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1170 DCHECK(!callback.is_null()); 1170 DCHECK(!callback.is_null());
1171
1172 if (entries_.count(resource_id) == 0) {
1173 callback.Run(google_apis::HTTP_NOT_FOUND, GURL());
1174 return CancelCallback();
1175 }
1176
1177 callback.Run(HTTP_SUCCESS,
1178 GURL(base::StringPrintf(open_url_format_.c_str(),
1179 resource_id.c_str(),
1180 app_id.c_str())));
1171 return CancelCallback(); 1181 return CancelCallback();
1172 } 1182 }
1173 1183
1174 CancelCallback FakeDriveService::UninstallApp( 1184 CancelCallback FakeDriveService::UninstallApp(
1175 const std::string& app_id, 1185 const std::string& app_id,
1176 const google_apis::EntryActionCallback& callback) { 1186 const google_apis::EntryActionCallback& callback) {
1177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1187 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1178 DCHECK(!callback.is_null()); 1188 DCHECK(!callback.is_null());
1179 1189
1180 // Find app_id from app_info_value_ and delete. 1190 // Find app_id from app_info_value_ and delete.
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 google_apis::drive::PermissionRole role, 1578 google_apis::drive::PermissionRole role,
1569 const google_apis::EntryActionCallback& callback) { 1579 const google_apis::EntryActionCallback& callback) {
1570 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1580 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1571 DCHECK(!callback.is_null()); 1581 DCHECK(!callback.is_null());
1572 1582
1573 NOTREACHED(); 1583 NOTREACHED();
1574 return CancelCallback(); 1584 return CancelCallback();
1575 } 1585 }
1576 1586
1577 } // namespace drive 1587 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/drive/fake_drive_service.h ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698