#include "components/url_formatter/elide_url.h"
#include <stddef.h>
#include <algorithm>
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "components/url_formatter/url_formatter.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/font_list.h"
#include "ui/gfx/text_elider.h"
#include "ui/gfx/text_utils.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace {
struct Testcase { … };
struct ProgressiveTestcase { … };
struct UrlComponent { … };
struct ParsingTestcase { … };
#if !BUILDFLAG(IS_ANDROID)
float GetWidth(const std::string& utf8,
const gfx::FontList& font_list = gfx::FontList()) { … }
float GetWidth(const std::u16string& utf16,
const gfx::FontList& font_list = gfx::FontList()) { … }
void RunProgressiveElisionTest(
const std::vector<ProgressiveTestcase>& testcases) { … }
void RunElisionTest(const std::vector<Testcase>& testcases) { … }
TEST(TextEliderTest, TestGeneralEliding) { … }
TEST(TextEliderTest, TestTrailingEllipsisSlashEllipsisHack) { … }
TEST(TextEliderTest, TestElisionSpecialCases) { … }
TEST(TextEliderTest, TestFileURLEliding) { … }
TEST(TextEliderTest, TestHostEliding) { … }
#endif
struct OriginTestData { … };
const OriginTestData common_tests[] = …;
TEST(TextEliderTest, FormatUrlForSecurityDisplay) { … }
TEST(TextEliderTest, FormatOriginForSecurityDisplay) { … }
TEST(TextEliderTest, FormatUrlForDisplayOmitSchemePathAndTrivialSubdomains) { … }
TEST(TextEliderTest,
FormatUrlForDisplayOmitSchemePathTrivialSubdomainsAndMobilePrefix) { … }
}