chromium/net/socket/unix_domain_client_socket_posix_unittest.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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "net/socket/unix_domain_client_socket_posix.h"

#include <unistd.h>

#include <memory>
#include <utility>

#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/sockaddr_storage.h"
#include "net/base/sockaddr_util_posix.h"
#include "net/base/test_completion_callback.h"
#include "net/socket/socket_posix.h"
#include "net/socket/unix_domain_server_socket_posix.h"
#include "net/test/gtest_util.h"
#include "net/test/test_with_task_environment.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

IsError;
IsOk;

namespace net {
namespace {

const char kSocketFilename[] =;

bool UserCanConnectCallback(
    bool allow_user, const UnixDomainServerSocket::Credentials& credentials) {}

UnixDomainServerSocket::AuthCallback CreateAuthCallback(bool allow_user) {}

// Connects socket synchronously.
int ConnectSynchronously(StreamSocket* socket) {}

// Reads data from |socket| until it fills |buf| at least up to |min_data_len|.
// Returns length of data read, or a net error.
int ReadSynchronously(StreamSocket* socket,
                      IOBuffer* buf,
                      int buf_len,
                      int min_data_len) {}

// Writes data to |socket| until it completes writing |buf| up to |buf_len|.
// Returns length of data written, or a net error.
int WriteSynchronously(StreamSocket* socket,
                       IOBuffer* buf,
                       int buf_len) {}

class UnixDomainClientSocketTest : public TestWithTaskEnvironment {};

TEST_F(UnixDomainClientSocketTest, Connect) {}

TEST_F(UnixDomainClientSocketTest, ConnectWithSocketDescriptor) {}

TEST_F(UnixDomainClientSocketTest, ConnectWithAbstractNamespace) {}

TEST_F(UnixDomainClientSocketTest, ConnectToNonExistentSocket) {}

TEST_F(UnixDomainClientSocketTest,
       ConnectToNonExistentSocketWithAbstractNamespace) {}

TEST_F(UnixDomainClientSocketTest, DisconnectFromClient) {}

TEST_F(UnixDomainClientSocketTest, DisconnectFromServer) {}

TEST_F(UnixDomainClientSocketTest, ReadAfterWrite) {}

TEST_F(UnixDomainClientSocketTest, ReadBeforeWrite) {}

}  // namespace
}  // namespace net