• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
10namespace 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."]
13constexpr 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."]
15constexpr 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."]
18constexpr 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."]
21constexpr 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."]
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 base::TaskTraits'"]
28constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, true};
29#endif
30
31}  // namespace base
32