summaryrefslogtreecommitdiff
path: root/chromium/components/sync/BUILD.gn
blob: 60cf1de55a6eee24f0c4a05d251a6950ee40cda0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//testing/test.gni")

group("sync") {
  public_deps = [
    "//components/sync/driver",
    "//components/sync/engine",
    "//components/sync/model",
    "//components/sync/nigori",
  ]
  if (!is_android) {
    public_deps += [ "//components/sync/trusted_vault" ]
  }
  if (is_chromeos) {
    public_deps += [ "//components/sync/chromeos" ]
  }
}

group("test_support") {
  testonly = true

  public_deps = [
    ":sync",
    ":test_support_engine",
    ":test_support_model",
    "//components/sync/base:test_support",
    "//components/sync/driver:test_support",
  ]
  if (!is_android) {
    public_deps += [ "//components/sync/trusted_vault:test_support" ]
  }
}

static_library("test_support_engine") {
  testonly = true
  sources = [
    "engine/cycle/mock_debug_info_getter.cc",
    "engine/cycle/mock_debug_info_getter.h",
    "test/engine/fake_cryptographer.cc",
    "test/engine/fake_cryptographer.h",
    "test/engine/fake_model_type_connector.cc",
    "test/engine/fake_model_type_connector.h",
    "test/engine/fake_model_type_processor.cc",
    "test/engine/fake_model_type_processor.h",
    "test/engine/fake_sync_engine.cc",
    "test/engine/fake_sync_engine.h",
    "test/engine/fake_sync_manager.cc",
    "test/engine/fake_sync_manager.h",
    "test/engine/fake_sync_scheduler.cc",
    "test/engine/fake_sync_scheduler.h",
    "test/engine/mock_connection_manager.cc",
    "test/engine/mock_connection_manager.h",
    "test/engine/mock_model_type_processor.cc",
    "test/engine/mock_model_type_processor.h",
    "test/engine/mock_model_type_worker.cc",
    "test/engine/mock_model_type_worker.h",
    "test/engine/mock_nudge_handler.cc",
    "test/engine/mock_nudge_handler.h",
    "test/engine/mock_sync_engine.cc",
    "test/engine/mock_sync_engine.h",
    "test/engine/mock_update_handler.cc",
    "test/engine/mock_update_handler.h",
    "test/engine/single_type_mock_server.cc",
    "test/engine/single_type_mock_server.h",
    "test/engine/sync_engine_host_stub.cc",
    "test/engine/sync_engine_host_stub.h",
    "test/engine/test_engine_components_factory.cc",
    "test/engine/test_engine_components_factory.h",
    "test/fake_sync_encryption_handler.cc",
    "test/fake_sync_encryption_handler.h",
  ]

  public_deps = [ "//components/sync/base:test_support" ]

  deps = [
    ":sync",
    "//services/network:test_support",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]
}

static_library("test_support_model") {
  testonly = true
  sources = [
    "test/model/fake_model_type_controller_delegate.cc",
    "test/model/fake_model_type_controller_delegate.h",
    "test/model/fake_model_type_sync_bridge.cc",
    "test/model/fake_model_type_sync_bridge.h",
    "test/model/fake_sync_change_processor.cc",
    "test/model/fake_sync_change_processor.h",
    "test/model/mock_model_type_change_processor.cc",
    "test/model/mock_model_type_change_processor.h",
    "test/model/model_type_store_test_util.cc",
    "test/model/model_type_store_test_util.h",
    "test/model/stub_model_type_sync_bridge.cc",
    "test/model/stub_model_type_sync_bridge.h",
    "test/model/sync_change_processor_wrapper_for_test.cc",
    "test/model/sync_change_processor_wrapper_for_test.h",
    "test/model/sync_error_factory_mock.cc",
    "test/model/sync_error_factory_mock.h",
    "test/model/test_matchers.h",
    "test/model/test_model_type_store_service.cc",
    "test/model/test_model_type_store_service.h",
  ]

  public_deps = [ "//components/sync/base:test_support" ]

  deps = [ ":sync" ]
}

static_library("test_support_nigori") {
  testonly = true
  sources = [
    "nigori/nigori_test_utils.cc",
    "nigori/nigori_test_utils.h",
  ]

  deps = [
    ":sync",
    "//testing/gtest",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "base/client_tag_hash_unittest.cc",
    "base/model_type_unittest.cc",
    "base/protobuf_unittest.cc",
    "base/sync_prefs_unittest.cc",
    "base/sync_util_unittest.cc",
    "base/unique_position_unittest.cc",
    "base/weak_handle_unittest.cc",
    "driver/backend_migrator_unittest.cc",
    "driver/data_type_manager_impl_unittest.cc",
    "driver/glue/sync_engine_impl_unittest.cc",
    "driver/glue/sync_transport_data_prefs_unittest.cc",
    "driver/model_load_manager_unittest.cc",
    "driver/model_type_controller_unittest.cc",
    "driver/passphrase_type_metrics_provider_unittest.cc",
    "driver/startup_controller_unittest.cc",
    "driver/sync_auth_manager_unittest.cc",
    "driver/sync_internals_util_unittest.cc",
    "driver/sync_service_crypto_unittest.cc",
    "driver/sync_service_impl_startup_unittest.cc",
    "driver/sync_service_impl_unittest.cc",
    "driver/sync_service_utils_unittest.cc",
    "driver/sync_session_durations_metrics_recorder_unittest.cc",
    "driver/sync_stopped_reporter_unittest.cc",
    "driver/sync_user_settings_impl_unittest.cc",
    "engine/backoff_delay_provider_unittest.cc",
    "engine/bookmark_update_preprocessing_unittest.cc",
    "engine/cancelation_signal_unittest.cc",
    "engine/commit_contribution_impl_unittest.cc",
    "engine/commit_processor_unittest.cc",
    "engine/cycle/commit_quota_unittest.cc",
    "engine/cycle/nudge_tracker_unittest.cc",
    "engine/cycle/status_controller_unittest.cc",
    "engine/cycle/sync_cycle_snapshot_unittest.cc",
    "engine/debug_info_event_listener_unittest.cc",
    "engine/events/protocol_event_buffer_unittest.cc",
    "engine/get_updates_processor_unittest.cc",
    "engine/loopback_server/loopback_server_unittest.cc",
    "engine/loopback_server/persistent_bookmark_entity_unittest.cc",
    "engine/loopback_server/persistent_permanent_entity_unittest.cc",
    "engine/loopback_server/persistent_tombstone_entity_unittest.cc",
    "engine/loopback_server/persistent_unique_client_entity_unittest.cc",
    "engine/model_type_registry_unittest.cc",
    "engine/model_type_worker_unittest.cc",
    "engine/net/http_bridge_unittest.cc",
    "engine/net/sync_server_connection_manager_unittest.cc",
    "engine/nigori/nigori_unittest.cc",
    "engine/sync_manager_impl_unittest.cc",
    "engine/sync_scheduler_impl_unittest.cc",
    "engine/syncer_proto_util_unittest.cc",
    "engine/syncer_unittest.cc",
    "invalidations/fcm_handler_unittest.cc",
    "invalidations/interested_data_types_manager_unittest.cc",
    "model/client_tag_based_model_type_processor_unittest.cc",
    "model/client_tag_based_remote_update_handler_unittest.cc",
    "model/in_memory_metadata_change_list_unittest.cc",
    "model/model_type_store_backend_unittest.cc",
    "model/model_type_store_impl_unittest.cc",
    "model/model_type_store_service_impl_unittest.cc",
    "model/model_type_sync_bridge_unittest.cc",
    "model/mutable_data_batch_unittest.cc",
    "model/processor_entity_tracker_unittest.cc",
    "model/processor_entity_unittest.cc",
    "model/string_ordinal_unittest.cc",
    "model/sync_change_unittest.cc",
    "model/sync_data_unittest.cc",
    "model/sync_error_unittest.cc",
    "model/syncable_service_based_bridge_unittest.cc",
    "nigori/cryptographer_impl_unittest.cc",
    "nigori/keystore_keys_cryptographer_unittest.cc",
    "nigori/nigori_key_bag_unittest.cc",
    "nigori/nigori_model_type_processor_unittest.cc",
    "nigori/nigori_state_unittest.cc",
    "nigori/nigori_storage_impl_unittest.cc",
    "nigori/nigori_sync_bridge_impl_unittest.cc",
    "protocol/entity_data_unittest.cc",
    "protocol/proto_enum_conversions_unittest.cc",
    "protocol/proto_value_conversions_unittest.cc",
  ]

  if (!is_android) {
    sources += [
      "trusted_vault/download_keys_response_handler_unittest.cc",
      "trusted_vault/proto_string_bytes_conversion_unittest.cc",
      "trusted_vault/securebox_unittest.cc",
      "trusted_vault/standalone_trusted_vault_backend_unittest.cc",
      "trusted_vault/trusted_vault_access_token_fetcher_frontend_unittest.cc",
      "trusted_vault/trusted_vault_connection_impl_unittest.cc",
      "trusted_vault/trusted_vault_crypto_unittest.cc",
      "trusted_vault/trusted_vault_request_unittest.cc",
    ]
  }

  if (is_chromeos) {
    sources += [ "chromeos/explicit_passphrase_mojo_utils_unittest.cc" ]
  }

  configs += [ "//build/config:precompiled_headers" ]

  data = [
    "//chrome/test/data/sync/",
    "//net/tools/testserver/",
  ]

  deps = [
    ":sync",
    ":test_support_engine",
    ":test_support_model",
    ":test_support_nigori",
    "//base",
    "//base/test:test_support",
    "//build:chromeos_buildflags",
    "//components/gcm_driver:test_support",
    "//components/invalidation/impl",
    "//components/os_crypt",
    "//components/os_crypt:test_support",
    "//components/policy/core/common:test_support",
    "//components/prefs:test_support",
    "//components/signin/public/base:test_support",
    "//components/signin/public/identity_manager:test_support",
    "//components/sync/base:test_support",
    "//components/sync/driver:test_support",
    "//components/sync/invalidations:test_support",
    "//components/variations:test_support",
    "//components/version_info",
    "//components/version_info:generate_version_info",
    "//components/version_info:version_string",
    "//google_apis:test_support",
    "//google_apis/gcm:gcm",
    "//net",
    "//net:test_support",
    "//services/network:test_support",
    "//services/network/public/cpp",
    "//sql",
    "//sql:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/crc32c",
    "//third_party/leveldatabase",
    "//third_party/protobuf:protobuf_lite",
    "//third_party/zlib/google:compression_utils",
    "//url",
  ]

  if (is_ios) {
    sources -= [ "engine/net/http_bridge_unittest.cc" ]
  }

  if (!is_ios) {
    sources += [ "driver/sync_policy_handler_unittest.cc" ]
    deps += [
      "//components/policy:generated",
      "//components/policy/core/browser",
    ]
  }

  if (is_chromeos_ash) {
    deps += [ "//ash/constants" ]
  }
}