OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
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_scheduler/task_traits.h" | |
6 | |
7 #include "base/task_scheduler/scoped_set_task_priority_for_current_thread.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | |
9 | |
10 namespace base { | |
11 | |
12 // Verify that TaskTraits is initialized with the priority of the task running | |
13 // on the current thread. | |
14 TEST(TaskSchedulerTaskTraitsTest, DefaultPriority) { | |
15 { | |
16 internal::ScopedSetTaskPriorityForCurrentThread scope( | |
17 TaskPriority::BACKGROUND); | |
18 EXPECT_EQ(TaskPriority::BACKGROUND, TaskTraits().priority()); | |
19 } | |
20 { | |
21 internal::ScopedSetTaskPriorityForCurrentThread scope( | |
22 TaskPriority::USER_VISIBLE); | |
23 EXPECT_EQ(TaskPriority::USER_VISIBLE, TaskTraits().priority()); | |
24 } | |
25 { | |
26 internal::ScopedSetTaskPriorityForCurrentThread scope( | |
27 TaskPriority::USER_BLOCKING); | |
28 EXPECT_EQ(TaskPriority::USER_BLOCKING, TaskTraits().priority()); | |
29 } | |
30 } | |
31 | |
32 } // namespace base | |
OLD | NEW |