#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/filename_generation/filename_generation.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace filename_generation {
#define FPL …
#define HTML_EXTENSION …
#if BUILDFLAG(IS_WIN)
#define FPL_HTML_EXTENSION …
#else
#define FPL_HTML_EXTENSION …
#endif
namespace {
base::FilePath GetLongNamePathInDirectory(
int max_length,
const base::FilePath::CharType* suffix,
const base::FilePath& dir) { … }
}
static const struct { … } kExtensionTestCases[] = …;
#if BUILDFLAG(IS_WIN)
#define MAYBE_TestEnsureHtmlExtension …
#else
#define MAYBE_TestEnsureHtmlExtension …
#endif
TEST(FilenameGenerationTest, MAYBE_TestEnsureHtmlExtension) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_TestEnsureMimeExtension …
#else
#define MAYBE_TestEnsureMimeExtension …
#endif
TEST(FilenameGenerationTest, MAYBE_TestEnsureMimeExtension) { … }
static const struct GenerateFilenameTestCase { … } kGenerateFilenameCases[] = …;
#if BUILDFLAG(IS_WIN)
#define MAYBE_TestGenerateFilename …
#else
#define MAYBE_TestGenerateFilename …
#endif
TEST(FilenameGenerationTest, MAYBE_TestGenerateFilename) { … }
TEST(FilenameGenerationTest, TestBasicTruncation) { … }
TEST(FilenameGenerationTest, TestTruncationFail) { … }
}