blob: 1e290f60cfa8e8058a8b65d64e551b9fad406eef [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 ]
17 proto_out_dir = "webrtc/tools/network_tester"
18 }
19
20 proto_library("network_tester_packet_proto") {
21 sources = [
22 "network_tester_packet.proto",
23 ]
24 proto_out_dir = "webrtc/tools/network_tester"
25 }
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",
michaeltfcea39d2017-04-20 05:39:30 -070044 "../../base:protobuf_utils",
minyue939df962017-04-19 01:58:38 -070045 "../../base:rtc_task_queue",
46 "../../p2p",
47 ]
48
49 if (!build_with_chromium && is_clang) {
50 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
51 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
52 }
53 }
54
55 network_tester_unittests_resources = [
56 "//resources/network_tester/client_config.dat",
57 "//resources/network_tester/server_config.dat",
58 ]
59
60 if (is_ios) {
61 bundle_data("network_tester_unittests_bundle_data") {
62 testonly = true
63 sources = network_tester_unittests_resources
64 outputs = [
65 "{{bundle_resources_dir}}/{{source_file_part}}",
66 ]
67 }
68 }
69
70 rtc_source_set("network_tester_unittests") {
71 sources = [
72 "network_tester_unittest.cc",
73 ]
74
75 testonly = true
76 deps = [
77 ":network_tester",
78 "//testing/gtest",
79 "//webrtc/base:rtc_base_tests_utils",
80 "//webrtc/test:test_support",
81 ]
82
83 if (is_ios) {
84 deps += [ ":network_tester_unittests_bundle_data" ]
85 }
86
87 defines = [
88 "GTEST_RELATIVE_PATH",
89 "WEBRTC_NETWORK_TESTER_TEST_ENABLED",
90 ]
91
92 data = network_tester_unittests_resources
93
94 if (!build_with_chromium && is_clang) {
95 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
96 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
97 }
98 }
michaeltfcea39d2017-04-20 05:39:30 -070099
100 rtc_executable("network_tester_server") {
101 sources = [
102 "server.cc",
103 ]
104
105 deps = [
106 ":network_tester",
107 ]
108
109 if (!build_with_chromium && is_clang) {
110 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
111 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
112 }
113 }
minyue939df962017-04-19 01:58:38 -0700114}
michaelt2fe9ac32017-04-20 06:56:27 -0700115
116if (is_android) {
117 android_apk("NetworkTesterMobile") {
118 testonly = true
119 apk_name = "NetworkTesterMobile"
120 android_manifest = "androidapp/AndroidManifest.xml"
121
122 deps = [
123 ":NetworkTesterMobile_javalib",
124 ":NetworkTesterMobile_resources",
125 "//base:base_java",
126 "//webrtc/base:base_java",
127 ]
128
129 shared_libraries = [ "//webrtc/tools/network_tester:network_tester_so" ]
130 }
131
132 android_library("NetworkTesterMobile_javalib") {
133 testonly = true
134 android_manifest = "androidapp/AndroidManifest.xml"
135
136 java_files = [
137 "androidapp/src/com/google/media/networktester/MainActivity.java",
138 "androidapp/src/com/google/media/networktester/NetworkTester.java",
139 ]
140
141 deps = [
142 ":NetworkTesterMobile_resources",
143 "//webrtc/base:base_java",
144 ]
145 }
146
147 android_resources("NetworkTesterMobile_resources") {
148 testonly = true
149 resource_dirs = [ "androidapp/res" ]
150 custom_package = "com.google.media.networktester"
151 }
152
153 rtc_shared_library("network_tester_so") {
154 sources = [
155 "jni.cpp",
156 ]
157
158 deps = [
159 ":network_tester",
160 "../../system_wrappers:field_trial_default",
161 ]
162
163 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
164 configs += [ "//build/config/android:hide_all_but_jni" ]
165
166 output_extension = "so"
167 }
168}