chromium/chrome/browser/extensions/api/socket/socket_apitest.cc

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

#include "base/memory/ref_counted.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test.h"
#include "extensions/browser/api/socket/socket_api.h"
#include "extensions/browser/api/sockets_udp/test_udp_echo_server.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "net/dns/mock_host_resolver.h"

Extension;
ResultCatcher;

namespace {

const char kHostname[] =;
const int kPort =;

class SocketApiTest : public extensions::ExtensionApiTest {};

}  // namespace

IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketUDPExtension) {}

// Flaky on Windows. https://crbug.com/1319604.
#if BUILDFLAG(IS_WIN)
#define MAYBE_SocketTCPExtension
#else
#define MAYBE_SocketTCPExtension
#endif
IN_PROC_BROWSER_TEST_F(SocketApiTest, MAYBE_SocketTCPExtension) {}

IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketTCPServerExtension) {}

IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketTCPServerUnbindOnUnload) {}

// Fails on MacOS 11, crbug.com/1211141 .
#if BUILDFLAG(IS_MAC)
#define MAYBE_SocketMulticast
#else
#define MAYBE_SocketMulticast
#endif
IN_PROC_BROWSER_TEST_F(SocketApiTest, MAYBE_SocketMulticast) {}