#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 { … };
class ConnectionTypeGetter { … };
}
class NetworkConnectionTrackerTest : public testing::Test { … };
TEST_F(NetworkConnectionTrackerTest, ObserverNotified) { … }
TEST_F(NetworkConnectionTrackerTest, UnregisteredObserverNotNotified) { … }
TEST_F(NetworkConnectionTrackerTest, LeakyObserversCanLeak) { … }
TEST_F(NetworkConnectionTrackerTest, GetConnectionType) { … }
TEST_F(NetworkConnectionTrackerTest, GetConnectionTypeUnavailable) { … }
class NetworkGetConnectionTest : public NetworkConnectionTrackerTest { … };
TEST_F(NetworkGetConnectionTest, GetConnectionTypeOnDifferentThread) { … }
}