src/net/base/scheme_host_port_matcher_unittest.cc
TEST(SchemeHostPortMatcherTest, DoesNotMimicProxyBypassRules) {
  // Should not parse <-loopback> as its own rule (will treat it as a hostname
  // rule).
  SchemeHostPortMatcher matcher =
      SchemeHostPortMatcher::FromRawString("<-loopback>");
  EXPECT_EQ(1u, matcher.rules().size());
  EXPECT_EQ("<-loopback>", matcher.rules().front()->ToString());

  // Should not parse <local> as its own rule (will treat it as a hostname
  // rule).
  matcher = SchemeHostPortMatcher::FromRawString("<local>");
  EXPECT_EQ(1u, matcher.rules().size());
  EXPECT_EQ("<local>", matcher.rules().front()->ToString());

  // Should not implicitly match localhost or link-local addresses.
  matcher = SchemeHostPortMatcher::FromRawString("www.example.com");
  EXPECT_EQ(SchemeHostPortMatcherResult::kNoMatch,
            matcher.Evaluate(GURL("http://localhost")));
  EXPECT_EQ(SchemeHostPortMatcherResult::kNoMatch,
            matcher.Evaluate(GURL("http://169.254.1.1")));
}
// Tests that URLMatcher does not include logic specific to ProxyBypassRules.
//  * Should not implicitly bypass localhost or link-local addresses
//  * Should not match proxy bypass specific rules like <-loopback> and <local>
//
// Historically, SchemeHostPortMatcher was refactored out of ProxyBypassRules.
// This test confirms that the layering separation is as expected.
Tests that URLMatcher does not include logic specific to ProxyBypassRules.
Should not implicitly bypass localhost or link-local addresses
Should not match proxy bypass specific rules like <-loopback> and 

Historically, SchemeHostPortMatcher was refactored out of ProxyBypassRules.
This test confirms that the layering separation is as expected.
Tests that URLMatcher does not include logic specific to ProxyBypassRules . Should not implicitly bypass localhost or link - local addresses Should not match proxy bypass specific rules like < - loopback > and Historically SchemeHostPortMatcher was refactored out of ProxyBypassRules . This test confirms that the layering separation is as expected .
TEST(SchemeHostPortMatcherTest, DoesNotMimicProxyBypassRules) {
  SchemeHostPortMatcher matcher =
      SchemeHostPortMatcher::FromRawString("<-loopback>");
  EXPECT_EQ(1u, matcher.rules().size());
  EXPECT_EQ("<-loopback>", matcher.rules().front()->ToString());
  matcher = SchemeHostPortMatcher::FromRawString("<local>");
  EXPECT_EQ(1u, matcher.rules().size());
  EXPECT_EQ("<local>", matcher.rules().front()->ToString());
  matcher = SchemeHostPortMatcher::FromRawString("www.example.com");
  EXPECT_EQ(SchemeHostPortMatcherResult::kNoMatch,
            matcher.Evaluate(GURL("http://localhost")));
  EXPECT_EQ(SchemeHostPortMatcherResult::kNoMatch,
            matcher.Evaluate(GURL("http://169.254.1.1")));
}
TEST ( SchemeHostPortMatcherTest , DoesNotMimicProxyBypassRules ) { SchemeHostPortMatcher matcher = SchemeHostPortMatcher :: FromRawString ( " " ) ; EXPECT_EQ ( 1u , matcher . rules ( ) . size ( ) ) ; EXPECT_EQ ( " " , matcher . rules ( ) . front ( ) -> ToString ( ) ) ; matcher = SchemeHostPortMatcher :: FromRawString ( " " ) ; EXPECT_EQ ( 1u , matcher . rules ( ) . size ( ) ) ; EXPECT_EQ ( " " , matcher . rules ( ) . front ( ) -> ToString ( ) ) ; matcher = SchemeHostPortMatcher :: FromRawString ( " " ) ; EXPECT_EQ ( SchemeHostPortMatcherResult :: kNoMatch , matcher . Evaluate ( GURL ( " " ) ) ) ; EXPECT_EQ ( SchemeHostPortMatcherResult :: kNoMatch , matcher . Evaluate ( GURL ( " " ) ) ) ; }
Tests that URLMatcher does not include logic specific to ProxyBypassRules.
Tests that URLMatcher does not include logic specific to ProxyBypassRules .
// Should not parse <-loopback> as its own rule (will treat it as a hostname // rule). // Should not parse <local> as its own rule (will treat it as a hostname // rule). // Should not implicitly match localhost or link-local addresses.