chromium/services/network/public/cpp/network_connection_tracker_unittest.cc

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

#include "services/network/public/cpp/network_connection_tracker.h"

#include <memory>
#include <tuple>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "base/threading/thread_checker.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/mock_network_change_notifier.h"
#include "services/network/network_service.h"
#include "services/network/public/mojom/network_change_manager.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace network {

namespace {

class TestNetworkConnectionObserver
    : public NetworkConnectionTracker::NetworkConnectionObserver {};

class TestLeakyNetworkConnectionObserver
    : public NetworkConnectionTracker::NetworkConnectionObserver {};

// A helper class to call NetworkConnectionTracker::GetConnectionType().
class ConnectionTypeGetter {};

}  // namespace

class NetworkConnectionTrackerTest : public testing::Test {};

TEST_F(NetworkConnectionTrackerTest, ObserverNotified) {}

TEST_F(NetworkConnectionTrackerTest, UnregisteredObserverNotNotified) {}

TEST_F(NetworkConnectionTrackerTest, LeakyObserversCanLeak) {}

TEST_F(NetworkConnectionTrackerTest, GetConnectionType) {}

// Tests that GetConnectionType returns false and doesn't modify its |type|
// parameter when the connection type is unavailable.
TEST_F(NetworkConnectionTrackerTest, GetConnectionTypeUnavailable) {}

// Tests GetConnectionType() on a different thread.
class NetworkGetConnectionTest : public NetworkConnectionTrackerTest {};

TEST_F(NetworkGetConnectionTest, GetConnectionTypeOnDifferentThread) {}

}  // namespace network