1// Copyright 2017 The Chromium Authors 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/task_traits.h" 9 10namespace base { 11 12#if defined(NCTEST_TASK_TRAITS_MULTIPLE_MAY_BLOCK) // [r"The traits bag contains multiple traits of the same type."] 13constexpr TaskTraits traits = {MayBlock(), MayBlock()}; 14#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_WITH_BASE_SYNC_PRIMITIVES) // [r"The traits bag contains multiple traits of the same type."] 15constexpr TaskTraits traits = {WithBaseSyncPrimitives(), 16 WithBaseSyncPrimitives()}; 17#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_TASK_PRIORITY) // [r"The traits bag contains multiple traits of the same type."] 18constexpr TaskTraits traits = {TaskPriority::BEST_EFFORT, 19 TaskPriority::USER_BLOCKING}; 20#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_SHUTDOWN_BEHAVIOR) // [r"The traits bag contains multiple traits of the same type."] 21constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, 22 TaskShutdownBehavior::BLOCK_SHUTDOWN}; 23#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_SAME_TYPE_MIX) // [r"The traits bag contains multiple traits of the same type."] 24constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, 25 MayBlock(), 26 TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}; 27#elif defined(NCTEST_TASK_TRAITS_INVALID_TYPE) // [r"no matching constructor for initialization of 'const TaskTraits'"] 28constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, true}; 29#endif 30 31} // namespace base 32