Adds shutdown when FrameTreeServer goes away
[chromium-blink-merge.git] / google_apis / gcm / BUILD.gn
blob30ab4a6b738ac8e6d0ed42f72faa356d7df08d1a
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.
5 import("//testing/test.gni")
6 import("//third_party/protobuf/proto_library.gni")
8 component("gcm") {
9   sources = [
10     "base/gcm_util.cc",
11     "base/gcm_util.h",
12     "base/mcs_message.cc",
13     "base/mcs_message.h",
14     "base/mcs_util.cc",
15     "base/mcs_util.h",
16     "base/socket_stream.cc",
17     "base/socket_stream.h",
18     "engine/account_mapping.cc",
19     "engine/account_mapping.h",
20     "engine/checkin_request.cc",
21     "engine/checkin_request.h",
22     "engine/connection_factory.cc",
23     "engine/connection_factory.h",
24     "engine/connection_factory_impl.cc",
25     "engine/connection_factory_impl.h",
26     "engine/connection_handler.cc",
27     "engine/connection_handler.h",
28     "engine/connection_handler_impl.cc",
29     "engine/connection_handler_impl.h",
30     "engine/gcm_registration_request_handler.cc",
31     "engine/gcm_registration_request_handler.h",
32     "engine/gcm_store.cc",
33     "engine/gcm_store.h",
34     "engine/gcm_store_impl.cc",
35     "engine/gcm_store_impl.h",
36     "engine/gcm_unregistration_request_handler.cc",
37     "engine/gcm_unregistration_request_handler.h",
38     "engine/gservices_settings.cc",
39     "engine/gservices_settings.h",
40     "engine/gservices_switches.cc",
41     "engine/gservices_switches.h",
42     "engine/heartbeat_manager.cc",
43     "engine/heartbeat_manager.h",
44     "engine/instance_id_delete_token_request_handler.cc",
45     "engine/instance_id_delete_token_request_handler.h",
46     "engine/instance_id_get_token_request_handler.cc",
47     "engine/instance_id_get_token_request_handler.h",
48     "engine/mcs_client.cc",
49     "engine/mcs_client.h",
50     "engine/registration_request.cc",
51     "engine/registration_request.h",
52     "engine/unregistration_request.cc",
53     "engine/unregistration_request.h",
54     "monitoring/gcm_stats_recorder.h",
55   ]
57   defines = [ "GCM_IMPLEMENTATION" ]
59   public_deps = [
60     ":proto",
61   ]
62   deps = [
63     "//base",
64     "//base/third_party/dynamic_annotations",
65     "//net",
66     "//third_party/leveldatabase",
67     "//url",
68   ]
71 proto_library("proto") {
72   # This is part of the gcm component.
73   visibility = [ ":gcm" ]
74   sources = [
75     "protocol/android_checkin.proto",
76     "protocol/checkin.proto",
77     "protocol/mcs.proto",
78   ]
80   cc_generator_options = "dllexport_decl=GCM_EXPORT:"
81   cc_include = "google_apis/gcm/base/gcm_export.h"
82   defines = [ "GCM_IMPLEMENTATION" ]
85 source_set("test_support") {
86   testonly = true
87   sources = [
88     "base/fake_encryptor.cc",
89     "base/fake_encryptor.h",
90     "engine/fake_connection_factory.cc",
91     "engine/fake_connection_factory.h",
92     "engine/fake_connection_handler.cc",
93     "engine/fake_connection_handler.h",
94     "monitoring/fake_gcm_stats_recorder.cc",
95     "monitoring/fake_gcm_stats_recorder.h",
96   ]
98   public_deps = [
99     ":gcm",
100   ]
101   deps = [
102     "//base",
103     "//net",
104     "//testing/gtest",
105   ]
108 # A standalone MCS (mobile connection server) client.
109 executable("mcs_probe") {
110   testonly = true
111   sources = [
112     "tools/mcs_probe.cc",
113   ]
115   deps = [
116     ":gcm",
117     ":test_support",
118     "//base",
119     "//build/config/sanitizers:deps",
120     "//net",
121     "//net:test_support",
122     "//third_party/protobuf:protobuf_lite",
123   ]
126 # TODO(GYP): Delete this after we've converted everything to GN.
127 # The _run targets exist only for compatibility w/ GYP.
128 group("gcm_unit_tests_run") {
129   testonly = true
130   deps = [
131     ":gcm_unit_tests",
132   ]
135 test("gcm_unit_tests") {
136   sources = [
137     "base/mcs_message_unittest.cc",
138     "base/mcs_util_unittest.cc",
139     "base/socket_stream_unittest.cc",
140     "engine/account_mapping_unittest.cc",
141     "engine/checkin_request_unittest.cc",
142     "engine/connection_factory_impl_unittest.cc",
143     "engine/connection_handler_impl_unittest.cc",
144     "engine/gcm_request_test_base.cc",
145     "engine/gcm_request_test_base.h",
146     "engine/gcm_store_impl_unittest.cc",
147     "engine/gservices_settings_unittest.cc",
148     "engine/heartbeat_manager_unittest.cc",
149     "engine/mcs_client_unittest.cc",
150     "engine/registration_request_unittest.cc",
151     "engine/unregistration_request_unittest.cc",
152   ]
154   deps = [
155     ":gcm",
156     ":test_support",
157     "//base",
158     "//base/test:run_all_unittests",
159     "//net",
160     "//net:test_support",
161     "//testing/gtest",
162     "//third_party/protobuf:protobuf_lite",
163   ]