#include "net/base/mime_sniffer.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/url_constants.h"
namespace net {
namespace {
Range;
Values;
SniffMimeType;
template <size_t N>
std::string MakeConstantString(const char (&str)[N]) { … }
static std::string SniffMimeType(std::string_view content,
const std::string& url,
const std::string& mime_type_hint) { … }
TEST(MimeSnifferTest, SniffableSchemes) { … }
TEST(MimeSnifferTest, BoundaryConditionsTest) { … }
TEST(MimeSnifferTest, BasicSniffingTest) { … }
TEST(MimeSnifferTest, ChromeExtensionsTest) { … }
TEST(MimeSnifferTest, MozillaCompatibleTest) { … }
TEST(MimeSnifferTest, DontAllowPrivilegeEscalationTest) { … }
TEST(MimeSnifferTest, SniffFilesAsHtml) { … }
TEST(MimeSnifferTest, UnicodeTest) { … }
TEST(MimeSnifferTest, FlashTest) { … }
TEST(MimeSnifferTest, XMLTest) { … }
TEST(MimeSnifferTest, XMLTestLargeNoAngledBracket) { … }
TEST(MimeSnifferTest, LooksBinary) { … }
TEST(MimeSnifferTest, OfficeTest) { … }
TEST(MimeSnifferTest, AudioVideoTest) { … }
TEST(MimeSnifferTest, ImageTest) { … }
class MimeSnifferBinaryTest : public ::testing::TestWithParam<int> { … };
TEST_P(MimeSnifferBinaryTest, IsBinaryControlCode) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class MimeSnifferPlainTextTest : public ::testing::TestWithParam<int> { … };
TEST_P(MimeSnifferPlainTextTest, NotBinaryControlCode) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class MimeSnifferControlCodesEdgeCaseTest
: public ::testing::TestWithParam<const char*> { … };
TEST_P(MimeSnifferControlCodesEdgeCaseTest, EdgeCase) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}