1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
base / task / scoped_set_task_priority_for_current_thread_unittest.cc [blame]
// 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/task/scoped_set_task_priority_for_current_thread.h"
#include "base/task/task_traits.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace internal {
TEST(ScopedSetTaskPriorityForCurrentThreadTest,
ScopedSetTaskPriorityForCurrentThread) {
EXPECT_EQ(TaskPriority::USER_BLOCKING, GetTaskPriorityForCurrentThread());
{
ScopedSetTaskPriorityForCurrentThread
scoped_set_task_priority_for_current_thread(TaskPriority::BEST_EFFORT);
EXPECT_EQ(TaskPriority::BEST_EFFORT, GetTaskPriorityForCurrentThread());
}
EXPECT_EQ(TaskPriority::USER_BLOCKING, GetTaskPriorityForCurrentThread());
}
} // namespace internal
} // namespace base