OLD | NEW |
| (Empty) |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 import("//mojo/public/mojo_application.gni") | |
6 import("//mojo/public/mojo_application_manifest.gni") | |
7 import("//testing/test.gni") | |
8 | |
9 if (is_android) { | |
10 import("//build/config/android/rules.gni") | |
11 | |
12 java_library_path = "$target_out_dir/java_library.dex.jar" | |
13 | |
14 mojo_android_application("network") { | |
15 output_name = "network_service" | |
16 input_so = "$root_shlib_dir/${shlib_prefix}network_service$shlib_extension" | |
17 input_dex_jar = java_library_path | |
18 deps = [ | |
19 ":java_library", | |
20 ":native_library", | |
21 ] | |
22 } | |
23 | |
24 shared_library("native_library") { | |
25 output_name = "network_service" | |
26 | |
27 sources = [ | |
28 "android_hooks.cc", | |
29 ] | |
30 | |
31 deps = [ | |
32 ":sources", | |
33 "//base", | |
34 "//build/config/sanitizers:deps", | |
35 "//net", | |
36 ] | |
37 } | |
38 | |
39 android_standalone_library("java_library") { | |
40 dex_path = java_library_path | |
41 | |
42 deps = [ | |
43 "//net/android:net_java", | |
44 ] | |
45 } | |
46 } else { | |
47 mojo_native_application("network") { | |
48 output_name = "network_service" | |
49 | |
50 deps = [ | |
51 ":sources", | |
52 ] | |
53 } | |
54 } | |
55 | |
56 source_set("lib") { | |
57 sources = [ | |
58 "cookie_store_impl.cc", | |
59 "cookie_store_impl.h", | |
60 "http_connection_impl.cc", | |
61 "http_connection_impl.h", | |
62 "http_server_impl.cc", | |
63 "http_server_impl.h", | |
64 "net_adapters.cc", | |
65 "net_adapters.h", | |
66 "net_address_type_converters.cc", | |
67 "net_address_type_converters.h", | |
68 "network_context.cc", | |
69 "network_context.h", | |
70 "network_service_delegate.cc", | |
71 "network_service_delegate.h", | |
72 "network_service_delegate_observer.h", | |
73 "network_service_impl.cc", | |
74 "network_service_impl.h", | |
75 "tcp_bound_socket_impl.cc", | |
76 "tcp_bound_socket_impl.h", | |
77 "tcp_connected_socket_impl.cc", | |
78 "tcp_connected_socket_impl.h", | |
79 "tcp_server_socket_impl.cc", | |
80 "tcp_server_socket_impl.h", | |
81 "udp_socket_impl.cc", | |
82 "udp_socket_impl.h", | |
83 "url_loader_factory_impl.cc", | |
84 "url_loader_factory_impl.h", | |
85 "url_loader_impl.cc", | |
86 "url_loader_impl.h", | |
87 "web_socket_factory_impl.cc", | |
88 "web_socket_factory_impl.h", | |
89 "web_socket_impl.cc", | |
90 "web_socket_impl.h", | |
91 ] | |
92 | |
93 deps = [ | |
94 "//base", | |
95 "//mojo/common:common_base", | |
96 "//mojo/common:url_type_converters", | |
97 "//mojo/message_pump", | |
98 "//mojo/public/cpp/system:system", | |
99 "//mojo/services/network/public/cpp", | |
100 "//mojo/services/network/public/interfaces", | |
101 "//mojo/services/tracing/public/cpp", | |
102 "//mojo/shell/public/cpp", | |
103 "//net", | |
104 "//net:extras", | |
105 "//net:http_server", | |
106 "//url", | |
107 ] | |
108 } | |
109 | |
110 source_set("sources") { | |
111 visibility = [ ":*" ] | |
112 | |
113 sources = [ | |
114 "main.cc", | |
115 ] | |
116 | |
117 deps = [ | |
118 ":lib", | |
119 "//base", | |
120 "//mojo/public/c/system:for_shared_library", | |
121 "//mojo/public/cpp/bindings:bindings", | |
122 "//mojo/services/network/public/cpp", | |
123 "//mojo/services/network/public/interfaces", | |
124 "//mojo/shell/public/cpp", | |
125 ] | |
126 } | |
127 | |
128 group("network_service_unittests") { | |
129 testonly = true | |
130 deps = [ | |
131 ":unittests", | |
132 ] | |
133 } | |
134 | |
135 test("unittests") { | |
136 output_name = "network_service_unittests" | |
137 | |
138 sources = [ | |
139 "http_server_unittest.cc", | |
140 "udp_socket_unittest.cc", | |
141 "url_loader_impl_unittest.cc", | |
142 ] | |
143 | |
144 deps = [ | |
145 ":lib", | |
146 ":network", | |
147 "//base", | |
148 "//mojo/common:common_base", | |
149 "//mojo/message_pump", | |
150 "//mojo/public/cpp/bindings:callback", | |
151 "//mojo/services/network/public/cpp", | |
152 "//mojo/services/network/public/interfaces", | |
153 "//mojo/shell/public/cpp:shell_test_support", | |
154 "//mojo/shell/public/cpp:sources", | |
155 "//mojo/shell/public/cpp/test:run_all_shelltests", | |
156 "//net", | |
157 "//net:test_support", | |
158 "//testing/gtest", | |
159 ] | |
160 | |
161 data_deps = [ | |
162 ":test_manifest", | |
163 ] | |
164 } | |
165 | |
166 mojo_application_manifest("test_manifest") { | |
167 type = "exe" | |
168 application_name = "network_service_unittests" | |
169 source = "test_manifest.json" | |
170 } | |
OLD | NEW |