#include "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h"
#include <algorithm>
#include <utility>
#include "base/command_line.h"
#include "base/containers/span.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/current_thread.h"
#include "base/test/values_test_util.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "net/base/address_list.h"
#include "net/base/hash_value.h"
#include "net/base/net_errors.h"
#include "net/base/network_isolation_key.h"
#include "net/dns/mock_host_resolver.h"
#include "net/dns/public/host_resolver_source.h"
#include "net/dns/public/resolve_error_info.h"
#include "net/http/transport_security_state.h"
#include "services/network/public/cpp/request_destination.h"
#include "services/network/test/test_network_context.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
WebUIMessageHandler;
namespace {
base::Time ToTime(const char* time_string) { … }
std::vector<network::mojom::RequestDestination> ToRequestDestinationList(
const base::Value::List* list) { … }
class DnsLookupClient : public network::mojom::ResolveHostClient { … };
class NetworkContextForTesting : public network::TestNetworkContext { … };
}
class NetInternalsTest::MessageHandler : public content::WebUIMessageHandler { … };
NetInternalsTest::MessageHandler::MessageHandler(
NetInternalsTest* net_internals_test)
: … { … }
void NetInternalsTest::MessageHandler::RegisterMessages() { … }
void NetInternalsTest::MessageHandler::RegisterMessage(
const std::string& message,
const content::WebUI::MessageCallback& handler) { … }
void NetInternalsTest::MessageHandler::HandleMessage(
const content::WebUI::MessageCallback& handler,
const base::Value::List& data) { … }
void NetInternalsTest::MessageHandler::DnsLookupFinished(
std::string callback_id,
base::Value* result) { … }
void NetInternalsTest::MessageHandler::DnsLookup(
const base::Value::List& list) { … }
void NetInternalsTest::MessageHandler::SetNetworkContextForTesting(
const base::Value::List& list) { … }
void NetInternalsTest::MessageHandler::ResetNetworkContextForTesting(
const base::Value::List& list) { … }
void NetInternalsTest::MessageHandler::RgisterTestSharedDictionary(
const base::Value::List& list) { … }
NetInternalsTest::NetInternalsTest() = default;
NetInternalsTest::~NetInternalsTest() = default;
void NetInternalsTest::SetUpOnMainThread() { … }
void NetInternalsTest::OnWebContentsAvailable(
content::WebContents* web_contents) { … }