Chromium Code Reviews| Index: base/task_scheduler/task_traits_unittest.nc |
| diff --git a/base/task_scheduler/task_traits_unittest.nc b/base/task_scheduler/task_traits_unittest.nc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8d2acfa9067c987b26ac94a41e34f9e0ebde0411 |
| --- /dev/null |
| +++ b/base/task_scheduler/task_traits_unittest.nc |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// This is a "No Compile Test" suite. |
| +// http://dev.chromium.org/developers/testing/no-compile-tests |
| + |
| +#include "base/task_scheduler/task_traits.h" |
| + |
| +namespace base { |
| + |
| +#if defined(NCTEST_TASK_TRAITS_MULTIPLE_MAY_BLOCK) // [r"Multiple arguments of the same type were provided to the constructor of TaskTraits."] |
| +constexpr TaskTraits traits = {MayBlock(), MayBlock()}; |
| +#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_WITH_BASE_SYNC_PRIMITIVES) // [r"Multiple arguments of the same type were provided to the constructor of TaskTraits."] |
| +constexpr TaskTraits traits = {WithBaseSyncPrimitives(), |
| + WithBaseSyncPrimitives()}; |
| +#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_TASK_PRIORITY) // [r"Multiple arguments of the same type were provided to the constructor of TaskTraits."] |
| +constexpr TaskTraits traits = {TaskPriority::BACKGROUND, |
| + TaskPriority::USER_BLOCKING}; |
| +#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_SHUTDOWN_BEHAVIOR) // [r"Multiple arguments of the same type were provided to the constructor of TaskTraits."] |
| +constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, |
| + TaskShutdownBehavior::BLOCK_SHUTDOWN}; |
| +#elif defined(NCTEST_TASK_TRAITS_MULTIPLE_SAME_TYPE_MIX) // [r"Multiple arguments of the same type were provided to the constructor of TaskTraits."] |
| +constexpr TaskTraits traits = {TaskShutdownBehavior::BLOCK_SHUTDOWN, |
| + MayBlock(), |
| + TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}; |
| +#endif |
|
gab
2017/04/25 17:48:15
Also test unknown types (e.g. bool "false" or int
fdoray
2017/04/26 17:20:33
Done.
|
| + |
| +} // namespace base |