chromium/chrome/browser/net/stub_resolver_config_reader_unittest.cc

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

#include "chrome/browser/net/stub_resolver_config_reader.h"

#include <memory>

#include "base/test/task_environment.h"
#include "base/values.h"
#include "chrome/browser/net/default_dns_over_https_config_source.h"
#include "chrome/browser/net/dns_over_https_config_source.h"
#include "chrome/browser/net/secure_dns_config.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/testing_pref_service.h"
#include "content/public/test/browser_task_environment.h"
#include "net/dns/public/dns_over_https_config.h"
#include "net/dns/public/secure_dns_mode.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

constexpr char kDohConfigString[] =;

#if BUILDFLAG(IS_CHROMEOS_LACROS)
const std::string kDnsOverHttpsTemplatesPrefName =
    prefs::kDnsOverHttpsEffectiveTemplatesChromeOS;
#else
const std::string kDnsOverHttpsTemplatesPrefName =;
#endif

// Override the reader to mock out the ShouldDisableDohFor...() methods.
class MockedStubResolverConfigReader : public StubResolverConfigReader {};

class StubResolverConfigReaderTest : public testing::Test {};

TEST_F(StubResolverConfigReaderTest, GetSecureDnsConfiguration) {}

TEST_F(StubResolverConfigReaderTest, DohEnabled) {}

TEST_F(StubResolverConfigReaderTest, DohEnabled_Secure) {}

TEST_F(StubResolverConfigReaderTest, DisabledForManaged) {}

TEST_F(StubResolverConfigReaderTest, DisabledForManaged_Secure) {}

TEST_F(StubResolverConfigReaderTest, DisabledForParentalControls) {}

TEST_F(StubResolverConfigReaderTest, DisabledForParentalControls_Secure) {}

TEST_F(StubResolverConfigReaderTest, DeferredParentalControlsCheck) {}

TEST_F(StubResolverConfigReaderTest, DeferredParentalControlsCheck_Managed) {}

const char kMockDohTemplateForAlternativeSource[] =;

class MockDnsOverHttpsSource : public DnsOverHttpsConfigSource {};

TEST_F(StubResolverConfigReaderTest, DohWithOverrideConfigSource) {}

}  // namespace