chromium/components/url_matcher/url_matcher_unittest.cc

// Copyright 2013 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/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/url_matcher/url_matcher.h"

#include <stddef.h>

#include <memory>
#include <utility>

#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

MatcherStringPattern;

namespace url_matcher {

//
// URLMatcherCondition
//

TEST(URLMatcherConditionTest, Constructors) {}

TEST(URLMatcherSchemeFilter, TestMatching) {}

TEST(URLMatcherPortFilter, TestMatching) {}

namespace {
void CreateAndAddCidrBlock(
    const std::string& cidr_block,
    std::vector<URLMatcherCidrBlockFilter::CidrBlock>& blocks) {}
}  // namespace

TEST(URLMatcherCidrBlocksFilter, TestMatching_IPv4) {}

TEST(URLMatcherCidrBlocksFilter, TestMatching_IPv6) {}

TEST(URLMatcherConditionTest, IsFullURLCondition) {}

TEST(URLMatcherConditionTest, IsMatch) {}

TEST(URLMatcherConditionTest, Comparison) {}

//
// URLMatcherConditionFactory
//

namespace {

bool Matches(const URLMatcherCondition& condition, const std::string& text) {}

}  // namespace

TEST(URLMatcherConditionFactoryTest, GURLCharacterSet) {}

TEST(URLMatcherConditionFactoryTest, Criteria) {}

TEST(URLMatcherConditionFactoryTest, TestSingletonProperty) {}

TEST(URLMatcherConditionFactoryTest, TestComponentSearches) {}

TEST(URLMatcherConditionFactoryTest, TestFullSearches) {}

//
// URLMatcherConditionSet
//

TEST(URLMatcherConditionSetTest, Constructor) {}

TEST(URLMatcherConditionSetTest, Matching) {}

namespace {

bool IsQueryMatch(
    const std::string& url_query,
    const std::string& key,
    URLQueryElementMatcherCondition::QueryElementType query_element_type,
    const std::string& value,
    URLQueryElementMatcherCondition::QueryValueMatchType query_value_match_type,
    URLQueryElementMatcherCondition::Type match_type) {}

}  // namespace

TEST(URLMatcherConditionSetTest, QueryMatching) {}

//
// URLMatcher
//

TEST(URLMatcherTest, FullTest) {}

TEST(URLMatcherTest, TestComponentsImplyContains) {}

// Check that matches in everything but the query are found.
TEST(URLMatcherTest, TestOriginAndPathRegExPositive) {}

// Check that matches in the query are ignored.
TEST(URLMatcherTest, TestOriginAndPathRegExNegative) {}

}  // namespace url_matcher