webrtc/api/task_queue/task_queue_test.h
Tommi 6e4b5cf129 Disable TQ coroutine experimental tests in chromium builds
No-Iwyu: false positive.
Bug: none
Change-Id: I698988e683551d0b1148db76240af0907660f634
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/425560
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46189}
2025-11-13 16:31:50 -08:00

52 lines
1.7 KiB
C++

/*
* Copyright 2019 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_TASK_QUEUE_TASK_QUEUE_TEST_H_
#define API_TASK_QUEUE_TASK_QUEUE_TEST_H_
#include <functional>
#include <memory>
#include "api/field_trials_view.h"
#include "api/task_queue/task_queue_factory.h"
#include "test/gtest.h"
#if !defined(WEBRTC_CHROMIUM_BUILD) && defined(__cpp_impl_coroutine) && \
(__cpp_impl_coroutine >= 201902L) && defined(__cpp_lib_coroutine) && \
(__cpp_lib_coroutine >= 201902L)
// Warning that this is still experimental code and that enabling
// `BUILD_EXPERIMENTAL_TASK_QUEUE_COROUTINE_TESTS` for chromium builds caused
// the link time of `components_unittests` in chromium to grow from ~12 min to
// ~30 min! It likely also caused OOM on some machines during the build process.
#define BUILD_EXPERIMENTAL_TASK_QUEUE_COROUTINE_TESTS 1
#endif // __cpp_impl_coroutine
namespace webrtc {
// Suite of tests to verify TaskQueue implementation with.
// Example usage:
//
// namespace {
//
// using ::testing::Values;
// using ::webrtc::TaskQueueTest;
//
// std::unique_ptr<TaskQueueFactory> CreateMyFactory();
//
// INSTANTIATE_TEST_SUITE_P(My, TaskQueueTest, Values(CreateMyFactory));
//
// } // namespace
class TaskQueueTest
: public ::testing::TestWithParam<std::function<
std::unique_ptr<TaskQueueFactory>(const FieldTrialsView*)>> {};
} // namespace webrtc
#endif // API_TASK_QUEUE_TASK_QUEUE_TEST_H_