#include "base/task/lazy_thread_pool_task_runner.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/sequence_checker_impl.h"
#include "base/task/scoped_set_task_priority_for_current_thread.h"
#include "base/test/task_environment.h"
#include "base/threading/thread_checker_impl.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_WIN)
#include "base/win/com_init_util.h"
#endif
namespace base {
namespace …
TEST_F(LazyThreadPoolTaskRunnerEnvironmentTest,
LazyThreadPoolSequencedTaskRunnerUserVisible) { … }
TEST_F(LazyThreadPoolTaskRunnerEnvironmentTest,
LazyThreadPoolSequencedTaskRunnerUserBlocking) { … }
TEST_F(LazyThreadPoolTaskRunnerEnvironmentTest,
LazyThreadPoolSingleThreadTaskRunnerUserVisible) { … }
TEST_F(LazyThreadPoolTaskRunnerEnvironmentTest,
LazyThreadPoolSingleThreadTaskRunnerUserBlocking) { … }
#if BUILDFLAG(IS_WIN)
TEST_F(LazyThreadPoolTaskRunnerEnvironmentTest,
LazyThreadPoolCOMSTATaskRunnerUserVisible) {
TestTaskRunnerEnvironment(g_com_sta_task_runner_user_visible.Get(), true,
TaskPriority::USER_VISIBLE, true);
}
TEST_F(LazyThreadPoolTaskRunnerEnvironmentTest,
LazyThreadPoolCOMSTATaskRunnerUserBlocking) {
TestTaskRunnerEnvironment(g_com_sta_task_runner_user_blocking.Get(), true,
TaskPriority::USER_BLOCKING, true);
}
#endif
TEST(LazyThreadPoolTaskRunnerTest, LazyThreadPoolSequencedTaskRunnerReset) { … }
TEST(LazyThreadPoolTaskRunnerTest, LazyThreadPoolSingleThreadTaskRunnerReset) { … }
#if BUILDFLAG(IS_WIN)
TEST(LazyThreadPoolTaskRunnerTest, LazyThreadPoolCOMSTATaskRunnerReset) {
for (int i = 0; i < 2; ++i) {
test::TaskEnvironment task_environment;
g_com_sta_task_runner_user_visible.Get()->PostTask(FROM_HERE, DoNothing());
}
}
#endif
}