chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers_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/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

// Unit tests for helper functions for the Chrome Extensions Proxy Settings API.

#include "chrome/browser/extensions/api/proxy/proxy_api_helpers.h"

#include <memory>
#include <utility>

#include "base/values.h"
#include "chrome/browser/extensions/api/proxy/proxy_api_constants.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/proxy_config/proxy_prefs.h"
#include "net/base/proxy_server.h"
#include "net/base/proxy_string_util.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace extensions {

keys;

namespace {

const char kSamplePacScript[] =;
const char kSamplePacScriptAsDataUrl[] =;
const char kSamplePacScriptAsDataUrl2[] =;
const char kSamplePacScriptUrl[] =;

// Helper function to create a ProxyServer dictionary as defined in the
// extension API.
base::Value::Dict CreateTestProxyServerDict(const std::string& host) {}

// Helper function to create a ProxyServer dictionary as defined in the
// extension API.
base::Value::Dict CreateTestProxyServerDict(const std::string& schema,
                                            const std::string& host,
                                            int port) {}

}  // namespace

namespace proxy_api_helpers {

TEST(ExtensionProxyApiHelpers, CreateDataURLFromPACScript) {}

TEST(ExtensionProxyApiHelpers, CreatePACScriptFromDataURL) {}

TEST(ExtensionProxyApiHelpers, GetProxyModeFromExtensionPref) {}

TEST(ExtensionProxyApiHelpers, GetPacUrlFromExtensionPref) {}

TEST(ExtensionProxyApiHelpers, GetPacDataFromExtensionPref) {}

TEST(ExtensionProxyApiHelpers, GetProxyRulesStringFromExtensionPref) {}

TEST(ExtensionProxyApiHelpers, GetProxyRulesStringFromExtensionPrefInvalid) {}

TEST(ExtensionProxyApiHelpers, GetBypassListFromExtensionPref) {}

TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) {}

TEST(ExtensionProxyApiHelpers, GetProxyServer) {}

TEST(ExtensionProxyApiHelpers, JoinUrlList) {}

// This tests CreateProxyServerDict as well.
TEST(ExtensionProxyApiHelpers, CreateProxyRulesDict) {}

// Test multiple proxies per scheme -- expect that only the first is returned.
TEST(ExtensionProxyApiHelpers, CreateProxyRulesDictMultipleProxies) {}

// Test if a PAC script URL is specified.
TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWithUrl) {}

// Test if a PAC script is encoded in a data URL.
TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWidthData) {}

TEST(ExtensionProxyApiHelpers, TokenizeToStringList) {}

}  // namespace proxy_api_helpers
}  // namespace extensions