chromium/net/dns/system_dns_config_change_notifier_unittest.cc

// Copyright 2019 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/dns/system_dns_config_change_notifier.h"

#include <optional>
#include <utility>
#include <vector>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/dns/dns_hosts.h"
#include "net/dns/test_dns_config_service.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace net {

namespace {
const std::vector<IPEndPoint> kNameservers =;
const std::vector<IPEndPoint> kNameservers2 =;
const DnsConfig kConfig(kNameservers);
const DnsConfig kConfig2(kNameservers2);
}  // namespace

class SystemDnsConfigChangeNotifierTest : public TestWithTaskEnvironment {};

TEST_F(SystemDnsConfigChangeNotifierTest, ReceiveNotification) {}

TEST_F(SystemDnsConfigChangeNotifierTest, ReceiveNotification_Multiple) {}

// If the notifier already has a config loaded, a new observer should receive an
// initial notification for that config.
TEST_F(SystemDnsConfigChangeNotifierTest, ReceiveInitialNotification) {}

// If multiple configs have been read before adding an Observer, should notify
// it only of the most recent.
TEST_F(SystemDnsConfigChangeNotifierTest, ReceiveInitialNotification_Multiple) {}

TEST_F(SystemDnsConfigChangeNotifierTest, NotificationsStopAfterRemoval) {}

TEST_F(SystemDnsConfigChangeNotifierTest, UnchangedConfigs) {}

TEST_F(SystemDnsConfigChangeNotifierTest, UnloadedConfig) {}

// All invalid configs are considered the same for notifications, so only expect
// a single notification on multiple config invalidations.
TEST_F(SystemDnsConfigChangeNotifierTest, UnloadedConfig_Multiple) {}

TEST_F(SystemDnsConfigChangeNotifierTest, InitialConfigInvalid) {}

TEST_F(SystemDnsConfigChangeNotifierTest, RefreshConfig) {}

}  // namespace net