#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "components/services/quarantine/test_support.h"
#include "content/browser/file_system_access/file_system_access_manager_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/file_system_chooser_test_helpers.h"
#include "content/shell/browser/shell.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "ui/shell_dialogs/select_file_dialog.h"
#include "ui/shell_dialogs/select_file_dialog_factory.h"
#include "ui/shell_dialogs/select_file_policy.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
#endif
namespace content {
class FileSystemAccessFileWriterBrowserTest : public ContentBrowserTest { … };
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
ContentsWrittenToSwapFileFirst) { … }
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
KeepExistingDataHasPreviousContent) { … }
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
CreateWriterNoKeepExistingWithEmptyFile) { … }
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
EachWriterHasUniqueSwapFile) { … }
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
EachWriterHasUniqueSwapFileRacy) { … }
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
EachWriterHasUniqueSwapFileRacyKeepExistingData) { … }
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
WriteOffsetAndSeekInSameWritable) { … }
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
CannotCreateWritableToSwapFile) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_FileAnnotated …
#else
#define MAYBE_FileAnnotated …
#endif
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
MAYBE_FileAnnotated) { … }
#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_WIN)
IN_PROC_BROWSER_TEST_F(FileSystemAccessFileWriterBrowserTest,
RespectOSPermissions) { … }
#endif
}