Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Side by Side Diff: base/task_scheduler/task_traits_unittest.cc

Issue 2831883003: Do not inherit TaskPriority in TaskTraits. (Closed)
Patch Set: CR-gab-34 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/task_scheduler/task_traits.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « base/task_scheduler/task_traits.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698