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

Unified Diff: base/task_scheduler/task_unittest.cc

Issue 2859053006: Use constexpr TaskTraits constructor in base (part 2). (Closed)
Patch Set: self-review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/task_scheduler/task_tracker_unittest.cc ('k') | base/test/scoped_task_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_unittest.cc
diff --git a/base/task_scheduler/task_unittest.cc b/base/task_scheduler/task_unittest.cc
index fb076d761bea261f68d378bc428aa373c7290bc8..0da27000c07a5eef4d98ca2a1c9c5ab3722a06db 100644
--- a/base/task_scheduler/task_unittest.cc
+++ b/base/task_scheduler/task_unittest.cc
@@ -18,23 +18,20 @@ namespace internal {
// should not change.
TEST(TaskSchedulerTaskTest, ShutdownBehaviorChangeWithDelay) {
Task continue_on_shutdown(FROM_HERE, BindOnce(&DoNothing),
- TaskTraits().WithShutdownBehavior(
- TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ {TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
TimeDelta::FromSeconds(1));
EXPECT_EQ(TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN,
continue_on_shutdown.traits.shutdown_behavior());
- Task skip_on_shutdown(
- FROM_HERE, BindOnce(&DoNothing),
- TaskTraits().WithShutdownBehavior(TaskShutdownBehavior::SKIP_ON_SHUTDOWN),
- TimeDelta::FromSeconds(1));
+ Task skip_on_shutdown(FROM_HERE, BindOnce(&DoNothing),
+ {TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
+ TimeDelta::FromSeconds(1));
EXPECT_EQ(TaskShutdownBehavior::SKIP_ON_SHUTDOWN,
skip_on_shutdown.traits.shutdown_behavior());
- Task block_shutdown(
- FROM_HERE, BindOnce(&DoNothing),
- TaskTraits().WithShutdownBehavior(TaskShutdownBehavior::BLOCK_SHUTDOWN),
- TimeDelta::FromSeconds(1));
+ Task block_shutdown(FROM_HERE, BindOnce(&DoNothing),
+ {TaskShutdownBehavior::BLOCK_SHUTDOWN},
+ TimeDelta::FromSeconds(1));
EXPECT_EQ(TaskShutdownBehavior::SKIP_ON_SHUTDOWN,
block_shutdown.traits.shutdown_behavior());
}
@@ -42,23 +39,18 @@ TEST(TaskSchedulerTaskTest, ShutdownBehaviorChangeWithDelay) {
// Verify that the shutdown behavior of undelayed tasks is not adjusted.
TEST(TaskSchedulerTaskTest, NoShutdownBehaviorChangeNoDelay) {
Task continue_on_shutdown(FROM_HERE, BindOnce(&DoNothing),
- TaskTraits().WithShutdownBehavior(
- TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ {TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
TimeDelta());
EXPECT_EQ(TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN,
continue_on_shutdown.traits.shutdown_behavior());
- Task skip_on_shutdown(
- FROM_HERE, BindOnce(&DoNothing),
- TaskTraits().WithShutdownBehavior(TaskShutdownBehavior::SKIP_ON_SHUTDOWN),
- TimeDelta());
+ Task skip_on_shutdown(FROM_HERE, BindOnce(&DoNothing),
+ {TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, TimeDelta());
EXPECT_EQ(TaskShutdownBehavior::SKIP_ON_SHUTDOWN,
skip_on_shutdown.traits.shutdown_behavior());
- Task block_shutdown(
- FROM_HERE, BindOnce(&DoNothing),
- TaskTraits().WithShutdownBehavior(TaskShutdownBehavior::BLOCK_SHUTDOWN),
- TimeDelta());
+ Task block_shutdown(FROM_HERE, BindOnce(&DoNothing),
+ {TaskShutdownBehavior::BLOCK_SHUTDOWN}, TimeDelta());
EXPECT_EQ(TaskShutdownBehavior::BLOCK_SHUTDOWN,
block_shutdown.traits.shutdown_behavior());
}
« no previous file with comments | « base/task_scheduler/task_tracker_unittest.cc ('k') | base/test/scoped_task_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698