fdoray | 879b2fc | 2017-05-01 21:34:11 | [diff] [blame] | 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"Multiple 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 arguments 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 arguments 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 arguments 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 for initialization of 'const base::TaskTraits'"] |
| 28 | constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, true}; |
| 29 | #endif |
| 30 | |
| 31 | } // namespace base |