#include "base/task/common/operations_controller.h"
#include <atomic>
#include <cstdint>
#include <utility>
#include "base/memory/raw_ref.h"
#include "base/ranges/algorithm.h"
#include "base/threading/platform_thread.h"
#include "base/threading/simple_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace internal {
namespace {
class ScopedShutdown { … };
TEST(OperationsControllerTest, CanBeDestroyedWithoutWaiting) { … }
TEST(OperationsControllerTest, CanShutdownIfNotStarted) { … }
TEST(OperationsControllerTest, FailsToBeginWhenNotStarted) { … }
TEST(OperationsControllerTest, CanShutdownAfterTryCallsIfNotStarted) { … }
TEST(OperationsControllerTest,
StartAcceptingOperationsReturnsFalseIfNoRejectedBeginAttempts) { … }
TEST(OperationsControllerTest,
StartAcceptingOperationsReturnsTrueIfFailedBeginAttempts) { … }
TEST(OperationsControllerTest, SuccesfulBeginReturnsValidScopedObject) { … }
TEST(OperationsControllerTest, BeginFailsAfterShutdown) { … }
TEST(OperationsControllerTest, ScopedOperationsControllerIsMoveConstructible) { … }
class TestThread : public SimpleThread { … };
TEST(OperationsControllerTest, BeginsFromMultipleThreads) { … }
}
}
}