chromium/base/task/bind_post_task_unittest.cc

// Copyright 2020 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/task/bind_post_task.h"

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ref.h"
#include "base/sequence_checker_impl.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace {

void SetBool(bool* variable, bool value) {}

void SetInt(int* variable, int value) {}

void SetIntFromUniquePtr(int* variable, std::unique_ptr<int> value) {}

int Multiply(int value) {}

void ClearReference(OnceClosure callback) {}

class SequenceRestrictionChecker {};

}  // namespace

class BindPostTaskTest : public testing::Test {};

TEST_F(BindPostTaskTest, OnceClosure) {}

TEST_F(BindPostTaskTest, OnceCallback) {}

TEST_F(BindPostTaskTest, OnceWithBoundMoveOnlyArg) {}

TEST_F(BindPostTaskTest, OnceWithUnboundMoveOnlyArg) {}

TEST_F(BindPostTaskTest, OnceWithIgnoreResult) {}

TEST_F(BindPostTaskTest, OnceThen) {}

// Ensure that the input callback is run/destroyed on the correct thread even if
// the callback returned from BindPostTask() is run on a different thread.
TEST_F(BindPostTaskTest, OnceRunDestroyedOnBound) {}

// Ensure that the input callback is destroyed on the correct thread even if the
// callback returned from BindPostTask() is destroyed without being run on a
// different thread.
TEST_F(BindPostTaskTest, OnceNotRunDestroyedOnBound) {}

TEST_F(BindPostTaskTest, RepeatingClosure) {}

TEST_F(BindPostTaskTest, RepeatingCallback) {}

TEST_F(BindPostTaskTest, RepeatingWithUnboundMoveOnlyArg) {}

TEST_F(BindPostTaskTest, RepeatingWithIgnoreResult) {}

TEST_F(BindPostTaskTest, RepeatingThen) {}

// Ensure that the input callback is run/destroyed on the correct thread even if
// the callback returned from BindPostTask() is run on a different thread.
TEST_F(BindPostTaskTest, RepeatingRunDestroyedOnBound) {}

// Ensure that the input callback is destroyed on the correct thread even if the
// callback returned from BindPostTask() is destroyed without being run on a
// different thread.
TEST_F(BindPostTaskTest, RepeatingNotRunDestroyedOnBound) {}

}  // namespace base