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

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

Issue 2829083002: Add constexpr TaskTraits constructor. (Closed)
Patch Set: CR gab 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // This is a "No Compile Test" suite.
6 // http://dev.chromium.org/developers/testing/no-compile-tests
7
8 #include "base/task_scheduler/task_traits.h"
9
10 namespace base {
11
12 #if defined(NCTEST_TASK_TRAITS_MULTIPLE_MAY_BLOCK) // [r"Multiple arguments of the same type were provided to the constructor of TaskTraits."]
13 constexpr TaskTraits traits = {MayBlock(), MayBlock()};
14 #elif defined(NCTEST_TASK_TRAITS_MULTIPLE_WITH_BASE_SYNC_PRIMITIVES) // [r"Mult iple arguments of the same type were provided to the constructor of TaskTraits." ]
15 constexpr TaskTraits traits = {WithBaseSyncPrimitives(),
16 WithBaseSyncPrimitives()};
17 #elif defined(NCTEST_TASK_TRAITS_MULTIPLE_TASK_PRIORITY) // [r"Multiple argumen ts of the same type were provided to the constructor of TaskTraits."]
18 constexpr TaskTraits traits = {TaskPriority::BACKGROUND,
19 TaskPriority::USER_BLOCKING};
20 #elif defined(NCTEST_TASK_TRAITS_MULTIPLE_SHUTDOWN_BEHAVIOR) // [r"Multiple arg uments of the same type were provided to the constructor of TaskTraits."]
21 constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN,
22 TaskShutdownBehavior::BLOCK_SHUTDOWN};
23 #elif defined(NCTEST_TASK_TRAITS_MULTIPLE_SAME_TYPE_MIX) // [r"Multiple argumen ts of the same type were provided to the constructor of TaskTraits."]
24 constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN,
25 MayBlock(),
26 TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN};
27 #elif defined(NCTEST_TASK_TRAITS_INVALID_TYPE) // [r"no matching constructor fo r initialization of 'const base::TaskTraits'"]
28 constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, true};
29 #endif
30
31 } // namespace base
OLDNEW
« base/task_scheduler/task_traits_details.h ('K') | « base/task_scheduler/task_traits_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698