#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/url_formatter/url_formatter.h"
#include <stddef.h>
#include <string.h>
#include <vector>
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace url_formatter {
namespace {
WideToUTF16;
ASCIIToUTF16;
const size_t kNpos = …;
struct AdjustOffsetCase { … };
struct UrlTestData { … };
void VerboseExpect(size_t expected,
size_t actual,
const std::string& original_url,
size_t position,
const std::u16string& formatted_url) { … }
void CheckAdjustedOffsets(const std::string& url_string,
FormatUrlTypes format_types,
base::UnescapeRule::Type unescape_rules,
const size_t* output_offsets) { … }
}
TEST(UrlFormatterTest, FormatUrl) { … }
TEST(UrlFormatterTest, FormatUrlParsed) { … }
TEST(UrlFormatterTest, FormatUrlRoundTripPathASCII) { … }
TEST(UrlFormatterTest, FormatUrlRoundTripPathEscaped) { … }
TEST(UrlFormatterTest, FormatUrlRoundTripQueryASCII) { … }
TEST(UrlFormatterTest, FormatUrlRoundTripQueryEscaped) { … }
TEST(UrlFormatterTest, StripWWWFromHostComponent) { … }
TEST(UrlFormatterTest, FormatUrlWithOffsets) { … }
}