#include "content/browser/devtools/devtools_http_handler.h"
#include <stdint.h>
#include <memory>
#include <utility>
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "content/browser/devtools/devtools_agent_host_impl.h"
#include "content/browser/devtools/devtools_manager.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/devtools_manager_delegate.h"
#include "content/public/browser/devtools_socket_factory.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_devtools_agent_host.h"
#include "content/public/test/test_utils.h"
#include "net/base/completion_once_callback.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/socket/server_socket.h"
#include "net/socket/tcp_server_socket.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
HasSubstr;
Not;
Return;
const uint16_t kDummyPort = …;
const base::FilePath::CharType kDevToolsActivePortFileName[] = …);
class DummyServerSocket : public net::ServerSocket { … };
class DummyServerSocketFactory : public DevToolsSocketFactory { … };
class FailingServerSocketFactory : public DummyServerSocketFactory { … };
class TCPServerSocketFactory : public DummyServerSocketFactory { … };
class MockDevToolsManagerDelegate : public DevToolsManagerDelegate { … };
MockDevToolsManagerDelegate* MockDevToolsManagerDelegate::last_instance = …;
class MockDevToolsAgentHostWithType : public MockDevToolsAgentHost { … };
class BrowserClient : public ContentBrowserClient { … };
}
class DevToolsHttpHandlerTest : public testing::Test { … };
TEST_F(DevToolsHttpHandlerTest, TestStartStop) { … }
TEST_F(DevToolsHttpHandlerTest, TestServerSocketFailed) { … }
TEST_F(DevToolsHttpHandlerTest, TestDevToolsActivePort) { … }
TEST_F(DevToolsHttpHandlerTest, MutatingActionsiRequireSafeVerb) { … }
TEST_F(DevToolsHttpHandlerTest, TestJsonNew) { … }
TEST_F(DevToolsHttpHandlerTest, TestJsonList) { … }
class DevToolsWebSocketHandlerTest : public DevToolsHttpHandlerTest { … };
TEST_F(DevToolsWebSocketHandlerTest,
TestRejectsWebSocketConnectionsWithOrigin) { … }
TEST_F(DevToolsWebSocketHandlerTest, TestAllowsCLIOverrideAllowsOriginsStar) { … }
TEST_F(DevToolsWebSocketHandlerTest, TestAllowsCLIOverrideAllowsOrigins) { … }
}