chromium/base/threading/thread_restrictions_unittest.cc

// Copyright 2017 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/thread_restrictions.h"

#include <utility>

#include "base/compiler_specific.h"
#include "base/dcheck_is_on.h"
#include "base/debug/stack_trace.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/test/gtest_util.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {

namespace {

class ThreadRestrictionsTest : public testing::Test {};

}  // namespace

TEST_F(ThreadRestrictionsTest, BlockingAllowedByDefault) {}

TEST_F(ThreadRestrictionsTest, ScopedDisallowBlocking) {}

TEST_F(ThreadRestrictionsTest, ScopedAllowBlocking) {}

TEST_F(ThreadRestrictionsTest, ScopedAllowBlockingForTesting) {}

TEST_F(ThreadRestrictionsTest, BaseSyncPrimitivesAllowedByDefault) {}

TEST_F(ThreadRestrictionsTest, DisallowBaseSyncPrimitives) {}

TEST_F(ThreadRestrictionsTest, ScopedAllowBaseSyncPrimitives) {}

TEST_F(ThreadRestrictionsTest, ScopedAllowBaseSyncPrimitivesResetsState) {}

TEST_F(ThreadRestrictionsTest,
       ScopedAllowBaseSyncPrimitivesWithBlockingDisallowed) {}

TEST_F(ThreadRestrictionsTest,
       ScopedAllowBaseSyncPrimitivesOutsideBlockingScope) {}

TEST_F(ThreadRestrictionsTest,
       ScopedAllowBaseSyncPrimitivesOutsideBlockingScopeResetsState) {}

TEST_F(ThreadRestrictionsTest, ScopedAllowBaseSyncPrimitivesForTesting) {}

TEST_F(ThreadRestrictionsTest,
       ScopedAllowBaseSyncPrimitivesForTestingResetsState) {}

TEST_F(ThreadRestrictionsTest,
       ScopedAllowBaseSyncPrimitivesForTestingWithBlockingDisallowed) {}

TEST_F(ThreadRestrictionsTest, ScopedDisallowBaseSyncPrimitives) {}

TEST_F(ThreadRestrictionsTest, SingletonAllowedByDefault) {}

TEST_F(ThreadRestrictionsTest, DisallowSingleton) {}

TEST_F(ThreadRestrictionsTest, ScopedDisallowSingleton) {}

TEST_F(ThreadRestrictionsTest, LongCPUWorkAllowedByDefault) {}

TEST_F(ThreadRestrictionsTest, DisallowUnresponsiveTasks) {}

// thread_restriction_checks_and_has_death_tests
#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_ANDROID) && DCHECK_IS_ON() && \
    defined(GTEST_HAS_DEATH_TEST)

TEST_F(ThreadRestrictionsTest, BlockingCheckEmitsStack) {}

class TestCustomDisallow {};

TEST_F(ThreadRestrictionsTest, NestedAllowRestoresPreviousStack) {}

#endif  // thread_restriction_checks_and_has_death_tests

}  // namespace base