Index: components/arc/test/fake_file_system_instance.cc |
diff --git a/components/arc/test/fake_file_system_instance.cc b/components/arc/test/fake_file_system_instance.cc |
index f522024e2c1f847d018479fc0045790146709617..88eabd93ff0401a16b230b8e2b7ecaa60aacd444 100644 |
--- a/components/arc/test/fake_file_system_instance.cc |
+++ b/components/arc/test/fake_file_system_instance.cc |
@@ -64,8 +64,9 @@ FakeFileSystemInstance::File::File(const File& that) = default; |
FakeFileSystemInstance::File::File(const std::string& url, |
const std::string& content, |
+ const std::string& mime_type, |
Seekable seekable) |
- : url(url), content(content), seekable(seekable) {} |
+ : url(url), content(content), mime_type(mime_type), seekable(seekable) {} |
FakeFileSystemInstance::File::~File() = default; |
@@ -170,6 +171,20 @@ void FakeFileSystemInstance::GetFileSize(const std::string& url, |
FROM_HERE, base::Bind(callback, file.content.size())); |
} |
+void FakeFileSystemInstance::GetMimeType(const std::string& url, |
+ const GetMimeTypeCallback& callback) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ auto iter = files_.find(url); |
+ if (iter == files_.end()) { |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
+ FROM_HERE, base::BindOnce(callback, base::nullopt)); |
+ return; |
+ } |
+ const File& file = iter->second; |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
+ FROM_HERE, base::BindOnce(callback, file.mime_type)); |
+} |
+ |
void FakeFileSystemInstance::OpenFileToRead( |
const std::string& url, |
const OpenFileToReadCallback& callback) { |