chromium/third_party/blink/renderer/platform/p2p/ipc_network_manager_test.cc

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

#include "third_party/blink/renderer/platform/p2p/ipc_network_manager.h"

#include <memory>

#include "base/ranges/algorithm.h"
#include "net/base/ip_address.h"
#include "net/base/network_change_notifier.h"
#include "net/base/network_interfaces.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/p2p/network_list_manager.h"
#include "third_party/webrtc/rtc_base/mdns_responder_interface.h"

namespace blink {

namespace {

class MockP2PSocketDispatcher
    : public GarbageCollected<MockP2PSocketDispatcher>,
      public NetworkListManager {};

class EmptyMdnsResponder : public webrtc::MdnsResponderInterface {};

}  // namespace

// 2 IPv6 addresses with only last digit different.
static const char kIPv6PublicAddrString1[] =;
static const char kIPv6PublicAddrString2[] =;
static const char kIPv4MappedAddrString[] =;

class IpcNetworkManagerTest : public testing::Test {};

// Test overall logic of IpcNetworkManager on OnNetworkListChanged
// that it should group addresses with the same network key under
// single Network class. This also tests the logic inside
// IpcNetworkManager in addition to MergeNetworkList.
// TODO(guoweis): disable this test case for now until fix for webrtc
// issue 19249005 integrated into chromium
TEST_F(IpcNetworkManagerTest, TestMergeNetworkList) {}

// Test that IpcNetworkManager will guess a network type from the interface
// name when not otherwise available.
TEST_F(IpcNetworkManagerTest, DeterminesNetworkTypeFromNameIfUnknown) {}

// Test that IpcNetworkManager will detect hardcoded VPN interfaces.
TEST_F(IpcNetworkManagerTest, DeterminesVPNFromMacAddress) {}

// Test that IpcNetworkManager doesn't classify this mac as VPN.
TEST_F(IpcNetworkManagerTest, DeterminesNotVPN) {}

// Test that IpcNetworkManager will act as the mDNS responder provider for
// all networks that it returns.
TEST_F(IpcNetworkManagerTest,
       ServeAsMdnsResponderProviderForNetworksEnumerated) {}

}  // namespace blink