blob: cfc116c3fb0546440cde7d7a30bc3483e56ffa35 [file] [log] [blame]
minyue939df962017-04-19 01:58:38 -07001# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../webrtc.gni")
10import("//third_party/protobuf/proto_library.gni")
11
12if (rtc_enable_protobuf) {
13 proto_library("network_tester_config_proto") {
14 sources = [
15 "network_tester_config.proto",
16 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017 proto_out_dir = "rtc_tools/network_tester"
minyue939df962017-04-19 01:58:38 -070018 }
19
20 proto_library("network_tester_packet_proto") {
21 sources = [
22 "network_tester_packet.proto",
23 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020024 proto_out_dir = "rtc_tools/network_tester"
minyue939df962017-04-19 01:58:38 -070025 }
26
27 rtc_static_library("network_tester") {
28 sources = [
29 "config_reader.cc",
30 "config_reader.h",
michaeltfcea39d2017-04-20 05:39:30 -070031 "packet_logger.cc",
32 "packet_logger.h",
minyue939df962017-04-19 01:58:38 -070033 "packet_sender.cc",
34 "packet_sender.h",
35 "test_controller.cc",
36 "test_controller.h",
37 ]
38
39 defines = [ "WEBRTC_NETWORK_TESTER_PROTO" ]
40
41 deps = [
42 ":network_tester_config_proto",
43 ":network_tester_packet_proto",
kwiberg84f6a3f2017-09-05 08:43:13 -070044 "../../api:optional",
minyue939df962017-04-19 01:58:38 -070045 "../../p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -070046 "../../rtc_base:protobuf_utils",
mbonadei95c8f652017-08-27 23:40:10 -070047 "../../rtc_base:rtc_base_approved",
ehmaldonadof6a861a2017-07-19 10:40:47 -070048 "../../rtc_base:rtc_task_queue",
49 "../../rtc_base:sequenced_task_checker",
minyue939df962017-04-19 01:58:38 -070050 ]
51
52 if (!build_with_chromium && is_clang) {
53 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
54 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
55 }
56 }
57
58 network_tester_unittests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020059 "../../resources/network_tester/client_config.dat",
60 "../../resources/network_tester/server_config.dat",
minyue939df962017-04-19 01:58:38 -070061 ]
62
63 if (is_ios) {
64 bundle_data("network_tester_unittests_bundle_data") {
65 testonly = true
66 sources = network_tester_unittests_resources
67 outputs = [
68 "{{bundle_resources_dir}}/{{source_file_part}}",
69 ]
70 }
71 }
72
73 rtc_source_set("network_tester_unittests") {
kjellandere0629c02017-04-25 04:04:50 -070074 testonly = true
75
minyue939df962017-04-19 01:58:38 -070076 sources = [
77 "network_tester_unittest.cc",
78 ]
79
minyue939df962017-04-19 01:58:38 -070080 deps = [
81 ":network_tester",
ehmaldonadof6a861a2017-07-19 10:40:47 -070082 "../../rtc_base:rtc_base_tests_utils",
jianjun.zhuc0247402017-07-11 06:20:45 -070083 "../../test:test_support",
minyue939df962017-04-19 01:58:38 -070084 "//testing/gtest",
minyue939df962017-04-19 01:58:38 -070085 ]
86
87 if (is_ios) {
88 deps += [ ":network_tester_unittests_bundle_data" ]
89 }
90
91 defines = [
92 "GTEST_RELATIVE_PATH",
93 "WEBRTC_NETWORK_TESTER_TEST_ENABLED",
94 ]
95
96 data = network_tester_unittests_resources
97
98 if (!build_with_chromium && is_clang) {
99 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
100 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
101 }
102 }
michaeltfcea39d2017-04-20 05:39:30 -0700103
104 rtc_executable("network_tester_server") {
105 sources = [
106 "server.cc",
107 ]
108
109 deps = [
110 ":network_tester",
111 ]
112
113 if (!build_with_chromium && is_clang) {
114 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
115 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
116 }
117 }
minyue939df962017-04-19 01:58:38 -0700118}
michaelt2fe9ac32017-04-20 06:56:27 -0700119
120if (is_android) {
121 android_apk("NetworkTesterMobile") {
122 testonly = true
123 apk_name = "NetworkTesterMobile"
124 android_manifest = "androidapp/AndroidManifest.xml"
125
126 deps = [
127 ":NetworkTesterMobile_javalib",
128 ":NetworkTesterMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700129 "../../rtc_base:base_java",
michaelt2fe9ac32017-04-20 06:56:27 -0700130 "//base:base_java",
michaelt2fe9ac32017-04-20 06:56:27 -0700131 ]
132
jianjun.zhuc0247402017-07-11 06:20:45 -0700133 shared_libraries = [ "../../rtc_tools/network_tester:network_tester_so" ]
michaelt2fe9ac32017-04-20 06:56:27 -0700134 }
135
136 android_library("NetworkTesterMobile_javalib") {
137 testonly = true
138 android_manifest = "androidapp/AndroidManifest.xml"
139
140 java_files = [
141 "androidapp/src/com/google/media/networktester/MainActivity.java",
142 "androidapp/src/com/google/media/networktester/NetworkTester.java",
143 ]
144
145 deps = [
146 ":NetworkTesterMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -0700147 "../../rtc_base:base_java",
michaelt2fe9ac32017-04-20 06:56:27 -0700148 ]
149 }
150
151 android_resources("NetworkTesterMobile_resources") {
152 testonly = true
153 resource_dirs = [ "androidapp/res" ]
154 custom_package = "com.google.media.networktester"
155 }
156
157 rtc_shared_library("network_tester_so") {
158 sources = [
159 "jni.cpp",
160 ]
161
162 deps = [
163 ":network_tester",
164 "../../system_wrappers:field_trial_default",
165 ]
166
167 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
168 configs += [ "//build/config/android:hide_all_but_jni" ]
169
170 output_extension = "so"
171 }
172}