chromium/extensions/common/url_pattern_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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 {

// See url_pattern.h for examples of valid and invalid patterns.

static const int kAllSchemes =;

TEST(ExtensionURLPatternTest, ParseInvalid) {}

TEST(ExtensionURLPatternTest, Ports) {}

TEST(ExtensionURLPatternTest, IPv6Patterns) {}

// Verify percent encoding behavior.
TEST(ExtensionURLPatternTest, PercentEncodedAscii) {}

// Verify percent encoding behavior.
TEST(ExtensionURLPatternTest, PercentEncodedNonAscii) {}

// all pages for a given scheme
TEST(ExtensionURLPatternTest, Match1) {}

// all domains
TEST(ExtensionURLPatternTest, Match2) {}

// subdomains
TEST(URLPatternTest, Match3) {}

// glob escaping
TEST(ExtensionURLPatternTest, Match5) {}

// ip addresses
TEST(ExtensionURLPatternTest, Match6) {}

// subdomain matching with ip addresses
TEST(ExtensionURLPatternTest, Match7) {}

// unicode
TEST(ExtensionURLPatternTest, Match8) {}

// chrome://
TEST(ExtensionURLPatternTest, Match9) {}

// *://
TEST(ExtensionURLPatternTest, Match10) {}

// <all_urls>
TEST(ExtensionURLPatternTest, Match11) {}

// SCHEME_ALL matches all schemes.
TEST(ExtensionURLPatternTest, Match12) {}

TEST(ExtensionURLPatternTest, DoesntMatchInvalid) {}

TEST(ExtensionURLPatternTest, WildcardMatchesPathlessUrl) {}

TEST(ExtensionURLPatternTest, NonwildcardDoesntMatchPathlessUrl) {}

static const struct MatchPatterns {} kMatch13UrlPatternTestCases[] =;

// SCHEME_ALL and specific schemes.
TEST(ExtensionURLPatternTest, Match13) {}

// file scheme with empty hostname
TEST(ExtensionURLPatternTest, Match14) {}

// file scheme without hostname part
TEST(ExtensionURLPatternTest, Match15) {}

// file scheme with hostname
TEST(ExtensionURLPatternTest, Match16) {}

// Specific port
TEST(ExtensionURLPatternTest, Match17) {}

// Explicit port wildcard
TEST(ExtensionURLPatternTest, Match18) {}

// chrome-extension://
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) {}

// Returns success if neither |a| nor |b| encompasses the other.
testing::AssertionResult NeitherContains(const URLPattern& a,
                                         const URLPattern& b) {}

// Returns success if |a| encompasses |b| but not the other way around.
testing::AssertionResult StrictlyContains(const URLPattern& a,
                                          const URLPattern& b) {}

TEST(ExtensionURLPatternTest, Subset) {}

TEST(ExtensionURLPatternTest, MatchesSingleOrigin) {}

TEST(ExtensionURLPatternTest, TrailingDotDomain) {}

TEST(ExtensionURLPatternTest, MatchesEffectiveTLD) {}

// Test that URLPattern properly canonicalizes uncanonicalized hosts.
TEST(ExtensionURLPatternTest, UncanonicalizedUrl) {}

// Tests URLPattern::CreateIntersection().
TEST(ExtensionURLPatternTest, Intersection) {}

// Tests the special case of URLPattern::CreateIntersection() with different
// valid schemes.
TEST(ExtensionURLPatternTest, ValidSchemeIntersection) {}

// Tests that <all_urls> patterns correctly check schemes when testing if one
// contains the other.
TEST(ExtensionURLPatternTest, ContainsSchemes) {}

// Tests the handling of whitespace, along with various "."s.
TEST(ExtensionURLPatternTest, WhitespaceHostParsing) {}

}  // namespace