• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/task/scoped_set_task_priority_for_current_thread.h"
6 
7 #include "base/task/task_traits.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 
10 namespace base {
11 namespace internal {
12 
TEST(ScopedSetTaskPriorityForCurrentThreadTest,ScopedSetTaskPriorityForCurrentThread)13 TEST(ScopedSetTaskPriorityForCurrentThreadTest,
14      ScopedSetTaskPriorityForCurrentThread) {
15   EXPECT_EQ(TaskPriority::USER_BLOCKING, GetTaskPriorityForCurrentThread());
16   {
17     ScopedSetTaskPriorityForCurrentThread
18         scoped_set_task_priority_for_current_thread(TaskPriority::BEST_EFFORT);
19     EXPECT_EQ(TaskPriority::BEST_EFFORT, GetTaskPriorityForCurrentThread());
20   }
21   EXPECT_EQ(TaskPriority::USER_BLOCKING, GetTaskPriorityForCurrentThread());
22 }
23 
24 }  // namespace internal
25 }  // namespace base
26