#include "extensions/browser/api/file_handlers/mime_util.h"
#include <memory>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "content/public/browser/browser_context.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/extensions_test.h"
#include "storage/browser/quota/quota_manager_proxy.h"
#include "storage/browser/test/test_file_system_context.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace extensions {
namespace app_file_handler_util {
namespace {
const char kOrigin[] = …;
const char kJPEGExtensionFilePath[] = …;
const char kJPEGExtensionUpperCaseFilePath[] = …;
void OnMimeTypeResult(std::string* output, const std::string& mime_type) { … }
void OnMimeTypesCollected(
std::vector<std::string>* output,
std::unique_ptr<std::vector<std::string>> mime_types) { … }
storage::FileSystemURL CreateNativeLocalFileSystemURL(
storage::FileSystemContext* context,
const base::FilePath local_path) { … }
}
class FileHandlersMimeUtilTest : public ExtensionsTest { … };
TEST_F(FileHandlersMimeUtilTest, GetMimeTypeForLocalPath) { … }
TEST_F(FileHandlersMimeUtilTest, MimeTypeCollector_ForURLs) { … }
TEST_F(FileHandlersMimeUtilTest, MimeTypeCollector_ForLocalPaths) { … }
}
}