#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "extensions/common/url_pattern.h"
#include <stddef.h>
#include <memory>
#include "base/strings/stringprintf.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/constants.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace {
static const int kAllSchemes = …;
TEST(ExtensionURLPatternTest, ParseInvalid) { … }
TEST(ExtensionURLPatternTest, Ports) { … }
TEST(ExtensionURLPatternTest, IPv6Patterns) { … }
TEST(ExtensionURLPatternTest, PercentEncodedAscii) { … }
TEST(ExtensionURLPatternTest, PercentEncodedNonAscii) { … }
TEST(ExtensionURLPatternTest, Match1) { … }
TEST(ExtensionURLPatternTest, Match2) { … }
TEST(URLPatternTest, Match3) { … }
TEST(ExtensionURLPatternTest, Match5) { … }
TEST(ExtensionURLPatternTest, Match6) { … }
TEST(ExtensionURLPatternTest, Match7) { … }
TEST(ExtensionURLPatternTest, Match8) { … }
TEST(ExtensionURLPatternTest, Match9) { … }
TEST(ExtensionURLPatternTest, Match10) { … }
TEST(ExtensionURLPatternTest, Match11) { … }
TEST(ExtensionURLPatternTest, Match12) { … }
TEST(ExtensionURLPatternTest, DoesntMatchInvalid) { … }
TEST(ExtensionURLPatternTest, WildcardMatchesPathlessUrl) { … }
TEST(ExtensionURLPatternTest, NonwildcardDoesntMatchPathlessUrl) { … }
static const struct MatchPatterns { … } kMatch13UrlPatternTestCases[] = …;
TEST(ExtensionURLPatternTest, Match13) { … }
TEST(ExtensionURLPatternTest, Match14) { … }
TEST(ExtensionURLPatternTest, Match15) { … }
TEST(ExtensionURLPatternTest, Match16) { … }
TEST(ExtensionURLPatternTest, Match17) { … }
TEST(ExtensionURLPatternTest, Match18) { … }
TEST(ExtensionURLPatternTest, Match19) { … }
static const struct GetAsStringPatterns { … } kGetAsStringTestCases[] = …;
TEST(ExtensionURLPatternTest, GetAsString) { … }
testing::AssertionResult Overlaps(const URLPattern& pattern1,
const URLPattern& pattern2) { … }
TEST(ExtensionURLPatternTest, Overlaps) { … }
TEST(ExtensionURLPatternTest, ConvertToExplicitSchemes) { … }
TEST(ExtensionURLPatternTest, IgnorePorts) { … }
TEST(ExtensionURLPatternTest, IgnoreMissingBackslashes) { … }
TEST(ExtensionURLPatternTest, Equals) { … }
TEST(ExtensionURLPatternTest, CanReusePatternWithParse) { … }
testing::AssertionResult NeitherContains(const URLPattern& a,
const URLPattern& b) { … }
testing::AssertionResult StrictlyContains(const URLPattern& a,
const URLPattern& b) { … }
TEST(ExtensionURLPatternTest, Subset) { … }
TEST(ExtensionURLPatternTest, MatchesSingleOrigin) { … }
TEST(ExtensionURLPatternTest, TrailingDotDomain) { … }
TEST(ExtensionURLPatternTest, MatchesEffectiveTLD) { … }
TEST(ExtensionURLPatternTest, UncanonicalizedUrl) { … }
TEST(ExtensionURLPatternTest, Intersection) { … }
TEST(ExtensionURLPatternTest, ValidSchemeIntersection) { … }
TEST(ExtensionURLPatternTest, ContainsSchemes) { … }
TEST(ExtensionURLPatternTest, WhitespaceHostParsing) { … }
}