chromium/base/test/test_future_unittest.cc

// Copyright 2021 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/test/test_future.h"

#include <tuple>

#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/mock_callback.h"
#include "base/test/scoped_run_loop_timeout.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest-spi.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base::test {

namespace {

AnyType;
constexpr int kAnyValue =;
constexpr int kOtherValue =;

struct MoveOnlyValue {};

}  // namespace

class TestFutureTest : public ::testing::Test {};

TestFutureDeathTest;

TEST_F(TestFutureTest, WaitShouldBlockUntilValueArrives) {}

TEST_F(TestFutureTest, WaitShouldBlockUntilValueArrivesOnOtherSequence) {}

TEST_F(TestFutureTest, WaitShouldReturnTrueWhenValueArrives) {}

TEST_F(TestFutureTest, WaitShouldReturnTrueWhenValueArrivesOnOtherSequence) {}

TEST_F(TestFutureTest, WaitShouldReturnFalseIfTimeoutHappens) {}

TEST_F(TestFutureTest, GetShouldBlockUntilValueArrives) {}

TEST_F(TestFutureTest, GetShouldBlockUntilValueArrivesOnOtherSequence) {}

TEST_F(TestFutureDeathTest, GetShouldCheckIfTimeoutHappens) {}

TEST_F(TestFutureTest, TakeShouldWorkWithMoveOnlyValue) {}

TEST_F(TestFutureTest, TakeShouldWorkWithMoveOnlyValueOnOtherSequence) {}

TEST_F(TestFutureDeathTest, TakeShouldCheckIfTimeoutHappens) {}

TEST_F(TestFutureTest, IsReadyShouldBeTrueWhenValueIsSet) {}

TEST_F(TestFutureTest, ClearShouldRemoveStoredValue) {}

TEST_F(TestFutureTest, ShouldNotAllowOverwritingStoredValue) {}

TEST_F(TestFutureTest, ShouldAllowReuseIfPreviousValueIsFirstConsumed) {}

TEST_F(TestFutureTest, ShouldAllowReusingCallback) {}

TEST_F(TestFutureTest, WaitShouldWorkAfterTake) {}

TEST_F(TestFutureTest, ShouldSignalWhenSetValueIsInvoked) {}

TEST_F(TestFutureTest, ShouldAllowReferenceArgumentsForCallback) {}

TEST_F(TestFutureTest,
       ShouldAllowReferenceArgumentsForCallbackOnOtherSequence) {}

TEST_F(TestFutureTest, ShouldAllowInvokingCallbackAfterFutureIsDestroyed) {}

TEST_F(TestFutureTest,
       ShouldAllowInvokingCallbackOnOtherSequenceAfterFutureIsDestroyed) {}

TEST_F(TestFutureTest, ShouldReturnTupleValue) {}

TEST_F(TestFutureTest, ShouldReturnTupleValueOnOtherSequence) {}

TEST_F(TestFutureTest, ShouldAllowAccessingTupleValueUsingGetWithIndex) {}

TEST_F(TestFutureTest, ShouldAllowAccessingTupleValueUsingGetWithType) {}

TEST_F(TestFutureTest, ShouldAllowReferenceArgumentsForMultiArgumentCallback) {}

TEST_F(TestFutureTest,
       ShouldAllowReferenceArgumentsForMultiArgumentCallbackOnOtherSequence) {}

TEST_F(TestFutureTest, SetValueShouldAllowMultipleArguments) {}

TEST_F(TestFutureTest, ShouldSupportCvRefType) {}

TEST_F(TestFutureTest, ShouldSupportMultipleCvRefTypes) {}

TEST_F(TestFutureTest, ShouldAllowReuseIfPreviousTupleValueIsFirstConsumed) {}

TEST_F(TestFutureTest, ShouldPrintCurrentValueIfItIsOverwritten) {}

TEST_F(TestFutureTest, ShouldPrintNewValueIfItOverwritesOldValue) {}

TEST_F(TestFutureTest, InvokeFutureSingleValue) {}

TEST_F(TestFutureTest, InvokeFutureMoveOnlyValue) {}

TEST_F(TestFutureTest, InvokeFutureMultipleValues) {}

TEST_F(TestFutureTest, InvokeFutureMultipleTimes) {}

TEST_F(TestFutureTest, InvokeFutureDestroyedFuture) {}

TEST_F(TestFutureDeathTest, CallbackShouldDcheckOnOtherSequence) {}

TestFutureWithoutValuesTest;

TEST_F(TestFutureWithoutValuesTest, IsReadyShouldBeTrueWhenSetValueIsInvoked) {}

TEST_F(TestFutureWithoutValuesTest, WaitShouldUnblockWhenSetValueIsInvoked) {}

TEST_F(TestFutureWithoutValuesTest, WaitShouldUnblockWhenCallbackIsInvoked) {}

TEST_F(TestFutureWithoutValuesTest,
       WaitShouldUnblockWhenCallbackIsInvokedOnOtherSequence) {}

TEST_F(TestFutureWithoutValuesTest, WaitAndClearShouldAllowFutureReusing) {}

TEST_F(TestFutureWithoutValuesTest, GetShouldUnblockWhenCallbackIsInvoked) {}

TEST_F(TestFutureWithoutValuesTest,
       GetShouldUnblockWhenCallbackIsInvokedOnOtherSequence) {}

TEST(TestFutureWithoutTaskEnvironmentTest,
     CanCreateTestFutureBeforeTaskEnvironment) {}

TEST(TestFutureWithoutTaskEnvironmentDeathTest,
     WaitShouldDcheckWithoutTaskEnvironment) {}

TEST_F(TestFutureWithoutValuesTest, InvokeFuture) {}

}  // namespace base::test