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

Unified Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc

Issue 298003006: [fsp] Fix error codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc
diff --git a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc
index 145758dddbbebeb810f0854335c9ebd4ec09d60a..46c0e92af7a6ca5b1144d866790cf7cd1aff7383 100644
--- a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc
+++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc
@@ -146,12 +146,19 @@ void FakeProvidedFileSystem::OpenFile(const base::FilePath& file_path,
OpenFileMode mode,
bool create,
const OpenFileCallback& callback) {
- if (file_path.AsUTF8Unsafe() != "/hello.txt" ||
- mode == OPEN_FILE_MODE_WRITE || create) {
+ if (mode == OPEN_FILE_MODE_WRITE || create) {
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback,
+ 0 /* file_handle */,
+ base::File::FILE_ERROR_ACCESS_DENIED));
+ }
+
+ if (file_path.AsUTF8Unsafe() != "/hello.txt") {
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
base::Bind(
- callback, 0 /* file_handle */, base::File::FILE_ERROR_SECURITY));
+ callback, 0 /* file_handle */, base::File::FILE_ERROR_NOT_FOUND));
return;
}
@@ -192,7 +199,7 @@ void FakeProvidedFileSystem::ReadFile(
base::Bind(callback,
0 /* chunk_length */,
false /* has_next */,
- base::File::FILE_ERROR_SECURITY));
+ base::File::FILE_ERROR_INVALID_OPERATION));
return;
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698