Component Build support for api/task_queue:task_queue_test.
Chromium tests depend on api/task_queue:task_queue_test but it
cannot be added to the WebRTC component in Chromium (which is not
testonly).
A possible solution is to make api/task_queue:task_queue_test
depend on the WebRTC component which lives in Chromium only
when `build_with_chromium=true`.
Bug: webrtc:9419
Change-Id: I1cbe1fb97f21ef7a201d09d2f0f729104d01ed90
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157427
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29578}
diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn
index d3e7b24..5c1a1dc 100644
--- a/api/task_queue/BUILD.gn
+++ b/api/task_queue/BUILD.gn
@@ -35,16 +35,29 @@
"task_queue_test.cc",
"task_queue_test.h",
]
- deps = [
- ":task_queue",
- "../../rtc_base:refcount",
- "../../rtc_base:rtc_event",
- "../../rtc_base:timeutils",
- "../../rtc_base/task_utils:to_queued_task",
- "../../test:test_support",
- "//third_party/abseil-cpp/absl/memory",
- "//third_party/abseil-cpp/absl/strings",
- ]
+
+ check_includes = false # no-presubmit-check TODO(bugs.webrtc.org/9419)
+ if (build_with_chromium) {
+ # Don't depend on WebRTC code outside of webrtc_overrides:webrtc_component
+ # because this will break the WebRTC component build in Chromium.
+ deps = [
+ "../../../webrtc_overrides:webrtc_component",
+ "../../test:test_support",
+ "//third_party/abseil-cpp/absl/memory",
+ "//third_party/abseil-cpp/absl/strings",
+ ]
+ } else {
+ deps = [
+ ":task_queue",
+ "../../rtc_base:refcount",
+ "../../rtc_base:rtc_event",
+ "../../rtc_base:timeutils",
+ "../../rtc_base/task_utils:to_queued_task",
+ "../../test:test_support",
+ "//third_party/abseil-cpp/absl/memory",
+ "//third_party/abseil-cpp/absl/strings",
+ ]
+ }
}
rtc_library("default_task_queue_factory") {