chromium/net/proxy_resolution/proxy_config_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.

#include "net/proxy_resolution/proxy_config.h"

#include "base/json/json_writer.h"
#include "base/values.h"
#include "net/base/proxy_string_util.h"
#include "net/proxy_resolution/proxy_config_service_common_unittest.h"
#include "net/proxy_resolution/proxy_info.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace net {
namespace {

void ExpectProxyServerEquals(const char* expectation,
                             const ProxyList& proxy_list) {}

TEST(ProxyConfigTest, Equals) {}

struct ProxyConfigToValueTestCase {};

class ProxyConfigToValueTest
    : public ::testing::TestWithParam<ProxyConfigToValueTestCase> {};

TEST_P(ProxyConfigToValueTest, ToValueJSON) {}

ProxyConfigToValueTestCase GetTestCaseDirect() {}

ProxyConfigToValueTestCase GetTestCaseAutoDetect() {}

ProxyConfigToValueTestCase GetTestCasePacUrl() {}

ProxyConfigToValueTestCase GetTestCasePacUrlMandatory() {}

ProxyConfigToValueTestCase GetTestCasePacUrlAndAutoDetect() {}

ProxyConfigToValueTestCase GetTestCaseSingleProxy() {}

ProxyConfigToValueTestCase GetTestCaseSingleProxyWithBypass() {}

ProxyConfigToValueTestCase GetTestCaseSingleProxyWithReversedBypass() {}

ProxyConfigToValueTestCase GetTestCaseProxyPerScheme() {}

ProxyConfigToValueTestCase GetTestCaseSingleProxyList() {}

INSTANTIATE_TEST_SUITE_P();

TEST(ProxyConfigTest, ParseProxyRules) {}

TEST(ProxyConfigTest, ProxyRulesSetBypassFlag) {}

static const char kWsUrl[] =;
static const char kWssUrl[] =;

class ProxyConfigWebSocketTest : public ::testing::Test {};

// If a single proxy is set for all protocols, WebSocket uses it.
TEST_F(ProxyConfigWebSocketTest, UsesProxy) {}

// See RFC6455 Section 4.1. item 3, "_Proxy Usage_". Note that this favors a
// SOCKSv4 proxy (although technically the spec only notes SOCKSv5).
TEST_F(ProxyConfigWebSocketTest, PrefersSocksV4) {}

// See RFC6455 Section 4.1. item 3, "_Proxy Usage_".
TEST_F(ProxyConfigWebSocketTest, PrefersSocksV5) {}

TEST_F(ProxyConfigWebSocketTest, PrefersHttpsToHttp) {}

// Tests when a proxy-per-url-scheme configuration was used, and proxies are
// specified for http://, https://, and a fallback proxy (non-SOCKS).
// Even though the fallback proxy is not SOCKS, it is still favored over the
// proxy for http://* and https://*.
TEST_F(ProxyConfigWebSocketTest, PrefersNonSocksFallbackOverHttps) {}

// Tests when a proxy-per-url-scheme configuration was used, and the fallback
// proxy is a non-SOCKS proxy, and no proxy was given for https://* or
// http://*. The fallback proxy is used.
TEST_F(ProxyConfigWebSocketTest, UsesNonSocksFallbackProxy) {}

TEST_F(ProxyConfigWebSocketTest, PrefersHttpsEvenForWs) {}

TEST_F(ProxyConfigWebSocketTest, PrefersHttpToDirect) {}

TEST_F(ProxyConfigWebSocketTest, IgnoresFtpProxy) {}

TEST_F(ProxyConfigWebSocketTest, ObeysBypassRules) {}

TEST_F(ProxyConfigWebSocketTest, ObeysLocalBypass) {}

}  // namespace
}  // namespace net