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

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

Issue 139153003: drive: Return NOT_FOUND from FakeDriveService after the entry gets deleted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc » ('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/logging.h" 10 #include "base/logging.h"
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1444 1444
1445 base::ListValue* entries = NULL; 1445 base::ListValue* entries = NULL;
1446 // Go through entries and return the one that matches |resource_id|. 1446 // Go through entries and return the one that matches |resource_id|.
1447 if (resource_list_value_->GetList("entry", &entries)) { 1447 if (resource_list_value_->GetList("entry", &entries)) {
1448 for (size_t i = 0; i < entries->GetSize(); ++i) { 1448 for (size_t i = 0; i < entries->GetSize(); ++i) {
1449 base::DictionaryValue* entry = NULL; 1449 base::DictionaryValue* entry = NULL;
1450 std::string current_resource_id; 1450 std::string current_resource_id;
1451 if (entries->GetDictionary(i, &entry) && 1451 if (entries->GetDictionary(i, &entry) &&
1452 entry->GetString("gd$resourceId.$t", &current_resource_id) && 1452 entry->GetString("gd$resourceId.$t", &current_resource_id) &&
1453 resource_id == current_resource_id) { 1453 resource_id == current_resource_id &&
1454 !entry->HasKey("docs$removed")) {
1454 return entry; 1455 return entry;
1455 } 1456 }
1456 } 1457 }
1457 } 1458 }
1458 1459
1459 return NULL; 1460 return NULL;
1460 } 1461 }
1461 1462
1462 base::DictionaryValue* FakeDriveService::FindEntryByContentUrl( 1463 base::DictionaryValue* FakeDriveService::FindEntryByContentUrl(
1463 const GURL& content_url) { 1464 const GURL& content_url) {
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 FROM_HERE, 1733 FROM_HERE,
1733 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list))); 1734 base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_list)));
1734 } 1735 }
1735 1736
1736 GURL FakeDriveService::GetNewUploadSessionUrl() { 1737 GURL FakeDriveService::GetNewUploadSessionUrl() {
1737 return GURL("https://upload_session_url/" + 1738 return GURL("https://upload_session_url/" +
1738 base::Int64ToString(next_upload_sequence_number_++)); 1739 base::Int64ToString(next_upload_sequence_number_++));
1739 } 1740 }
1740 1741
1741 } // namespace drive 1742 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698