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

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

Issue 2847113002: TaskTraits and tuple. (Closed)
Patch Set: used 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 | « no previous file | 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/task_scheduler/task_traits.h" 5 #include "base/task_scheduler/task_traits.h"
6 6
7 #include <tuple>
8
7 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
8 10
9 namespace base { 11 namespace base {
10 12
13 TEST(TaskSchedulerTaskTraitsTest, Tuple) {
14 std::tuple<TaskTraits> tuple;
15 std::tuple<TaskTraits> other_tuple = tuple;
16 EXPECT_FALSE(std::get<0>(other_tuple).priority_set_explicitly());
17 }
18
11 TEST(TaskSchedulerTaskTraitsTest, Default) { 19 TEST(TaskSchedulerTaskTraitsTest, Default) {
12 constexpr TaskTraits traits = {}; 20 constexpr TaskTraits traits = {};
13 EXPECT_FALSE(traits.priority_set_explicitly()); 21 EXPECT_FALSE(traits.priority_set_explicitly());
14 EXPECT_EQ(TaskPriority::USER_VISIBLE, traits.priority()); 22 EXPECT_EQ(TaskPriority::USER_VISIBLE, traits.priority());
15 EXPECT_EQ(TaskShutdownBehavior::SKIP_ON_SHUTDOWN, traits.shutdown_behavior()); 23 EXPECT_EQ(TaskShutdownBehavior::SKIP_ON_SHUTDOWN, traits.shutdown_behavior());
16 EXPECT_FALSE(traits.may_block()); 24 EXPECT_FALSE(traits.may_block());
17 EXPECT_FALSE(traits.with_base_sync_primitives()); 25 EXPECT_FALSE(traits.with_base_sync_primitives());
18 } 26 }
19 27
20 TEST(TaskSchedulerTaskTraitsTest, TaskPriority) { 28 TEST(TaskSchedulerTaskTraitsTest, TaskPriority) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 EXPECT_EQ(traits.priority_set_explicitly(), 80 EXPECT_EQ(traits.priority_set_explicitly(),
73 traits_copy.priority_set_explicitly()); 81 traits_copy.priority_set_explicitly());
74 EXPECT_EQ(traits.priority(), traits_copy.priority()); 82 EXPECT_EQ(traits.priority(), traits_copy.priority());
75 EXPECT_EQ(traits.shutdown_behavior(), traits_copy.shutdown_behavior()); 83 EXPECT_EQ(traits.shutdown_behavior(), traits_copy.shutdown_behavior());
76 EXPECT_EQ(traits.may_block(), traits_copy.may_block()); 84 EXPECT_EQ(traits.may_block(), traits_copy.may_block());
77 EXPECT_EQ(traits.with_base_sync_primitives(), 85 EXPECT_EQ(traits.with_base_sync_primitives(),
78 traits_copy.with_base_sync_primitives()); 86 traits_copy.with_base_sync_primitives());
79 } 87 }
80 88
81 } // namespace base 89 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698