minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 1 | # 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 | |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 9 | import("//third_party/protobuf/proto_library.gni") |
Mirko Bonadei | e3abb81 | 2018-11-23 13:15:08 +0100 | [diff] [blame] | 10 | import("../../webrtc.gni") |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 11 | |
| 12 | if (rtc_enable_protobuf) { |
| 13 | proto_library("network_tester_config_proto") { |
| 14 | sources = [ |
| 15 | "network_tester_config.proto", |
| 16 | ] |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | proto_out_dir = "rtc_tools/network_tester" |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | proto_library("network_tester_packet_proto") { |
| 21 | sources = [ |
| 22 | "network_tester_packet.proto", |
| 23 | ] |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 24 | proto_out_dir = "rtc_tools/network_tester" |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | rtc_static_library("network_tester") { |
| 28 | sources = [ |
| 29 | "config_reader.cc", |
| 30 | "config_reader.h", |
michaelt | fcea39d | 2017-04-20 05:39:30 -0700 | [diff] [blame] | 31 | "packet_logger.cc", |
| 32 | "packet_logger.h", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 33 | "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", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 44 | "../../p2p", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 45 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 46 | "../../rtc_base:protobuf_utils", |
Jonas Olsson | cfe3b6a | 2018-11-12 10:12:47 +0100 | [diff] [blame] | 47 | "../../rtc_base:rtc_base", |
mbonadei | 95c8f65 | 2017-08-27 23:40:10 -0700 | [diff] [blame] | 48 | "../../rtc_base:rtc_base_approved", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 49 | "../../rtc_base:rtc_task_queue", |
| 50 | "../../rtc_base:sequenced_task_checker", |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame^] | 51 | "../../rtc_base/third_party/sigslot:sigslot", |
Danil Chapovalov | 431abd9 | 2018-06-18 12:54:17 +0200 | [diff] [blame] | 52 | "//third_party/abseil-cpp/absl/types:optional", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 53 | ] |
| 54 | |
| 55 | if (!build_with_chromium && is_clang) { |
| 56 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 57 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | network_tester_unittests_resources = [ |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 62 | "../../resources/network_tester/client_config.dat", |
| 63 | "../../resources/network_tester/server_config.dat", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 64 | ] |
| 65 | |
| 66 | if (is_ios) { |
| 67 | bundle_data("network_tester_unittests_bundle_data") { |
| 68 | testonly = true |
| 69 | sources = network_tester_unittests_resources |
| 70 | outputs = [ |
| 71 | "{{bundle_resources_dir}}/{{source_file_part}}", |
| 72 | ] |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | rtc_source_set("network_tester_unittests") { |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 77 | testonly = true |
| 78 | |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 79 | sources = [ |
| 80 | "network_tester_unittest.cc", |
| 81 | ] |
| 82 | |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 83 | deps = [ |
| 84 | ":network_tester", |
Mirko Bonadei | e3abb81 | 2018-11-23 13:15:08 +0100 | [diff] [blame] | 85 | "../../rtc_base:gunit_helpers", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 86 | "../../test:fileutils", |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 87 | "../../test:test_support", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 88 | "//testing/gtest", |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 89 | ] |
| 90 | |
| 91 | if (is_ios) { |
| 92 | deps += [ ":network_tester_unittests_bundle_data" ] |
| 93 | } |
| 94 | |
Mirko Bonadei | 8e5014a | 2018-08-02 13:36:10 +0200 | [diff] [blame] | 95 | defines = [ "WEBRTC_NETWORK_TESTER_TEST_ENABLED" ] |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 96 | |
| 97 | data = network_tester_unittests_resources |
| 98 | |
| 99 | if (!build_with_chromium && is_clang) { |
| 100 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 101 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 102 | } |
| 103 | } |
michaelt | fcea39d | 2017-04-20 05:39:30 -0700 | [diff] [blame] | 104 | |
| 105 | rtc_executable("network_tester_server") { |
| 106 | sources = [ |
| 107 | "server.cc", |
| 108 | ] |
| 109 | |
| 110 | deps = [ |
| 111 | ":network_tester", |
| 112 | ] |
| 113 | |
| 114 | if (!build_with_chromium && is_clang) { |
| 115 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 116 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 117 | } |
| 118 | } |
minyue | 939df96 | 2017-04-19 01:58:38 -0700 | [diff] [blame] | 119 | } |
michaelt | 2fe9ac3 | 2017-04-20 06:56:27 -0700 | [diff] [blame] | 120 | |
| 121 | if (is_android) { |
| 122 | android_apk("NetworkTesterMobile") { |
| 123 | testonly = true |
| 124 | apk_name = "NetworkTesterMobile" |
| 125 | android_manifest = "androidapp/AndroidManifest.xml" |
| 126 | |
| 127 | deps = [ |
| 128 | ":NetworkTesterMobile_javalib", |
| 129 | ":NetworkTesterMobile_resources", |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 130 | "../../rtc_base:base_java", |
michaelt | 2fe9ac3 | 2017-04-20 06:56:27 -0700 | [diff] [blame] | 131 | ] |
| 132 | |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 133 | shared_libraries = [ "../../rtc_tools/network_tester:network_tester_so" ] |
michaelt | 2fe9ac3 | 2017-04-20 06:56:27 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | android_library("NetworkTesterMobile_javalib") { |
| 137 | testonly = true |
Mirko Bonadei | 4f024ef | 2018-01-04 13:12:03 +0100 | [diff] [blame] | 138 | android_manifest_for_lint = "androidapp/AndroidManifest.xml" |
michaelt | 2fe9ac3 | 2017-04-20 06:56:27 -0700 | [diff] [blame] | 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.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 147 | "../../rtc_base:base_java", |
michaelt | 2fe9ac3 | 2017-04-20 06:56:27 -0700 | [diff] [blame] | 148 | ] |
| 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", |
michaelt | 2fe9ac3 | 2017-04-20 06:56:27 -0700 | [diff] [blame] | 164 | ] |
| 165 | |
| 166 | suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ] |
| 167 | configs += [ "//build/config/android:hide_all_but_jni" ] |
| 168 | |
| 169 | output_extension = "so" |
| 170 | } |
| 171 | } |