chromium/base/threading/post_task_and_reply_impl_unittest.cc

// Copyright 2016 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/threading/post_task_and_reply_impl.h"

#include <utility>

#include "base/auto_reset.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/test_mock_time_task_runner.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;

namespace base::internal {

namespace {

class ObjectToDelete : public RefCounted<ObjectToDelete> {};

class MockObject {};

class MockRunsTasksInCurrentSequenceTaskRunner : public TestMockTimeTaskRunner {};

class PostTaskAndReplyImplTest : public testing::Test {};

}  // namespace

TEST_F(PostTaskAndReplyImplTest, PostTaskAndReply) {}

TEST_F(PostTaskAndReplyImplTest, TaskDoesNotRun) {}

TEST_F(PostTaskAndReplyImplTest, ReplyDoesNotRun) {}

// This is a regression test for crbug.com/922938.
TEST_F(PostTaskAndReplyImplTest,
       PostTaskToStoppedTaskRunnerWithoutSequencedContext) {}

// Demonstrate that even if a task is not run because a weak pointer is
// invalidated, the reply still runs.
TEST_F(PostTaskAndReplyImplTest, ReplyStilRunsAfterInvalidatedWeakPtrTask) {}

}  // namespace base::internal