chromium/dbus/end_to_end_async_unittest.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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <stddef.h>

#include <algorithm>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "dbus/test_service.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace dbus {

namespace {

// See comments in ObjectProxy::RunResponseCallback() for why the number was
// chosen.
const int kHugePayloadSize =;  // 64 MB

}  // namespace

// The end-to-end test exercises the asynchronous APIs in ObjectProxy and
// ExportedObject.
class EndToEndAsyncTest : public testing::Test {};

TEST_F(EndToEndAsyncTest, Echo) {}

TEST_F(EndToEndAsyncTest, EchoWithErrorCallback) {}

// Call Echo method three times.
TEST_F(EndToEndAsyncTest, EchoThreeTimes) {}

TEST_F(EndToEndAsyncTest, Echo_HugePayload) {}

TEST_F(EndToEndAsyncTest, BrokenBus) {}

TEST_F(EndToEndAsyncTest, BrokenBusWithErrorCallback) {}

TEST_F(EndToEndAsyncTest, Timeout) {}

TEST_F(EndToEndAsyncTest, TimeoutWithErrorCallback) {}

TEST_F(EndToEndAsyncTest, CancelPendingCalls) {}

// Tests calling a method that sends its reply asynchronously.
TEST_F(EndToEndAsyncTest, AsyncEcho) {}

TEST_F(EndToEndAsyncTest, NonexistentMethod) {}

TEST_F(EndToEndAsyncTest, NonexistentMethodWithErrorCallback) {}

TEST_F(EndToEndAsyncTest, BrokenMethod) {}

TEST_F(EndToEndAsyncTest, BrokenMethodWithErrorCallback) {}

TEST_F(EndToEndAsyncTest, InvalidServiceName) {}

TEST_F(EndToEndAsyncTest, EmptyResponseCallback) {}

TEST_F(EndToEndAsyncTest, TestSignal) {}

TEST_F(EndToEndAsyncTest, TestSignalFromRoot) {}

TEST_F(EndToEndAsyncTest, TestHugeSignal) {}

class SignalMultipleHandlerTest : public EndToEndAsyncTest {};

TEST_F(SignalMultipleHandlerTest, TestMultipleHandlers) {}

}  // namespace dbus