Commit 331c1b5a authored by Jordan Bayles's avatar Jordan Bayles Committed by Commit Bot

Add Open Screen unit tests

This patch adds additional dependencies on Open Screen to enable running
unit tests inside of Chrome.

This adds a new openscreen_unittests target
and adds it to the builders.

The following TODO is also added:
TODO(crbug.com/1025244): Move Open Screen unit tests from fieldtrial
to linux, mac bots once we have ensured the tests are stable.

Change-Id: Ia36d5af5136cbf39d5c1582238a0e5a1f69b7ddc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880544
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarAaron Gable <agable@chromium.org>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Reviewed-by: default avatarYuri Wiitala <miu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727180}
parent 9cd3bf9e
......@@ -13,6 +13,7 @@ import("//build/config/features.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//build/util/generate_wrapper.gni")
import("//chrome/browser/media/router/features.gni")
import("//components/nacl/features.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//extensions/buildflags/buildflags.gni")
......@@ -211,6 +212,10 @@ group("gn_all") {
]
}
if (enable_openscreen) {
deps += [ "//chrome/browser/media/router:openscreen_unittests" ]
}
if (!is_ios && !is_fuchsia) {
deps += [
"//chrome/test:telemetry_perf_unittests",
......
......@@ -161,28 +161,10 @@ static_library("router") {
"providers/openscreen/network_service_async_packet_sender.h",
"providers/openscreen/network_service_quic_packet_writer.cc",
"providers/openscreen/network_service_quic_packet_writer.h",
"providers/openscreen/platform/chrome_task_runner.cc",
"providers/openscreen/platform/chrome_task_runner.h",
"providers/openscreen/platform/chrome_tls_client_connection.cc",
"providers/openscreen/platform/chrome_tls_client_connection.h",
"providers/openscreen/platform/chrome_tls_connection_factory.cc",
"providers/openscreen/platform/chrome_tls_connection_factory.h",
"providers/openscreen/platform/chrome_udp_socket.cc",
"providers/openscreen/platform/chrome_udp_socket.h",
"providers/openscreen/platform/logging.cc",
"providers/openscreen/platform/mojo_data_pump.cc",
"providers/openscreen/platform/mojo_data_pump.h",
"providers/openscreen/platform/network_data_pump.h",
"providers/openscreen/platform/network_util.cc",
"providers/openscreen/platform/network_util.h",
"providers/openscreen/platform/time.cc",
"providers/openscreen/platform/trace_logging_platform.cc",
]
configs +=
[ "//third_party/openscreen/src/build:openscreen_include_dirs" ]
deps += [
":openscreen_platform_impl",
"//third_party/openscreen/src/osp/public",
"//third_party/openscreen/src/platform",
"//third_party/openscreen/src/util",
......@@ -191,6 +173,39 @@ static_library("router") {
}
}
if (enable_openscreen) {
source_set("openscreen_platform_impl") {
sources = [
"providers/openscreen/platform/chrome_task_runner.cc",
"providers/openscreen/platform/chrome_task_runner.h",
"providers/openscreen/platform/chrome_tls_client_connection.cc",
"providers/openscreen/platform/chrome_tls_client_connection.h",
"providers/openscreen/platform/chrome_tls_connection_factory.cc",
"providers/openscreen/platform/chrome_tls_connection_factory.h",
"providers/openscreen/platform/chrome_udp_socket.cc",
"providers/openscreen/platform/chrome_udp_socket.h",
"providers/openscreen/platform/logging.cc",
"providers/openscreen/platform/mojo_data_pump.cc",
"providers/openscreen/platform/mojo_data_pump.h",
"providers/openscreen/platform/network_data_pump.h",
"providers/openscreen/platform/network_util.cc",
"providers/openscreen/platform/network_util.h",
"providers/openscreen/platform/time.cc",
"providers/openscreen/platform/trace_logging_platform.cc",
]
public_configs =
[ "//third_party/openscreen/src/build:openscreen_include_dirs" ]
deps = [
"//base",
"//net/traffic_annotation",
"//services/network:network_service",
"//services/network/public/mojom",
]
}
}
static_library("test_support") {
testonly = true
deps = [
......@@ -319,6 +334,21 @@ source_set("unittests") {
]
}
if (enable_openscreen) {
test("openscreen_unittests") {
include_dirs = [ "//third_party/openscreen/src" ]
deps = [
":openscreen_platform_impl",
"//base/test:test_support",
"//chrome/browser",
"//chrome/test:test_support",
"//testing/gmock",
"//third_party/openscreen/src:openscreen_unittests_all",
]
}
}
fuzzer_test("dial_internal_message_fuzzer") {
sources = [
"providers/dial/dial_internal_message_fuzzer.cc",
......@@ -326,6 +356,9 @@ fuzzer_test("dial_internal_message_fuzzer") {
deps = [
":router",
"//base",
"//base/test:test_support",
"//chrome/browser",
"//chrome/test:test_support",
"//components/mirroring/mojom:service",
"//components/translate/content/common",
]
......
......@@ -22387,6 +22387,22 @@
},
"test": "browser_tests",
"test_target": "//chrome/test:browser_tests"
},
{
"merge": {
"args": [],
"script": "//testing/merge_scripts/standard_gtest_merge.py"
},
"swarming": {
"can_use_on_swarming_builders": true,
"dimension_sets": [
{
"os": "Ubuntu-16.04"
}
]
},
"test": "openscreen_unittests",
"test_target": "//chrome/browser/media/router:openscreen_unittests"
}
]
},
......
......@@ -1299,6 +1299,10 @@
"label": "//ios/testing:ios_testing_unittests",
"type": "raw",
},
"openscreen_unittests": {
"label": "//chrome/browser/media/router:openscreen_unittests",
"type": "console_test_launcher",
},
"ozone_gl_unittests": {
"label": "//ui/ozone/gl:ozone_gl_unittests",
"type": "console_test_launcher",
......
......@@ -1163,6 +1163,9 @@
},
'test': 'browser_tests',
},
# TODO(crbug.com/1025244): Move Open Screen unit tests from fieldtrial
# to linux, mac bots once we have ensured the tests are stable.
'openscreen_unittests': {}
},
'fuchsia_gtests': {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment