chromium/base/sync_socket_unittest.cc

// Copyright 2013 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/sync_socket.h"

#include "base/containers/span.h"
#include "base/memory/raw_ptr.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h"
#include "base/threading/simple_thread.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {

namespace {

constexpr TimeDelta kReceiveTimeout =;

class HangingReceiveThread : public DelegateSimpleThread::Delegate {};

// Tests sending data between two SyncSockets. Uses ASSERT() and thus will exit
// early upon failure.  Callers should use ASSERT_NO_FATAL_FAILURE() if testing
// continues after return.
void SendReceivePeek(SyncSocket* socket_a, SyncSocket* socket_b) {}

}  // namespace

class SyncSocketTest : public testing::Test {};

TEST_F(SyncSocketTest, NormalSendReceivePeek) {}

TEST_F(SyncSocketTest, ClonedSendReceivePeek) {}

class CancelableSyncSocketTest : public testing::Test {};

TEST_F(CancelableSyncSocketTest, NormalSendReceivePeek) {}

TEST_F(CancelableSyncSocketTest, ClonedSendReceivePeek) {}

// TODO(https://crbug.com/361250560): Flaky on mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_ShutdownCancelsReceive
#else
#define MAYBE_ShutdownCancelsReceive
#endif
TEST_F(CancelableSyncSocketTest, MAYBE_ShutdownCancelsReceive) {}

TEST_F(CancelableSyncSocketTest, ShutdownCancelsReceiveWithTimeout) {}

TEST_F(CancelableSyncSocketTest, ReceiveAfterShutdown) {}

TEST_F(CancelableSyncSocketTest, ReceiveWithTimeoutAfterShutdown) {}

}  // namespace base