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
5import("//testing/test.gni")
6
7assert(is_chromeos, "ProximityAuth is Chrome OS only")
8
9static_library("proximity_auth") {
10  sources = [
11    "messenger.h",
12    "messenger_impl.cc",
13    "messenger_impl.h",
14    "messenger_observer.h",
15    "metrics.cc",
16    "metrics.h",
17    "proximity_auth_client.h",
18    "proximity_auth_local_state_pref_manager.cc",
19    "proximity_auth_local_state_pref_manager.h",
20    "proximity_auth_pref_manager.h",
21    "proximity_auth_pref_names.cc",
22    "proximity_auth_pref_names.h",
23    "proximity_auth_profile_pref_manager.cc",
24    "proximity_auth_profile_pref_manager.h",
25    "proximity_auth_system.cc",
26    "proximity_auth_system.h",
27    "proximity_monitor.cc",
28    "proximity_monitor.h",
29    "proximity_monitor_impl.cc",
30    "proximity_monitor_impl.h",
31    "proximity_monitor_observer.h",
32    "remote_device_life_cycle.cc",
33    "remote_device_life_cycle.h",
34    "remote_device_life_cycle_impl.cc",
35    "remote_device_life_cycle_impl.h",
36    "remote_status_update.cc",
37    "remote_status_update.h",
38    "screenlock_bridge.cc",
39    "screenlock_bridge.h",
40    "screenlock_state.cc",
41    "screenlock_state.h",
42    "smart_lock_metrics_recorder.cc",
43    "smart_lock_metrics_recorder.h",
44    "unlock_manager.h",
45    "unlock_manager_impl.cc",
46    "unlock_manager_impl.h",
47  ]
48
49  deps = [
50    "//base",
51    "//chromeos/components/multidevice",
52    "//chromeos/components/multidevice/logging",
53    "//chromeos/components/proximity_auth/public/mojom",
54    "//chromeos/constants",
55    "//chromeos/dbus/power",
56    "//chromeos/dbus/session_manager",
57    "//chromeos/services/multidevice_setup/public/cpp",
58    "//chromeos/services/multidevice_setup/public/cpp:prefs",
59    "//chromeos/services/secure_channel/public/cpp/client",
60    "//chromeos/services/secure_channel/public/mojom",
61    "//components/account_id",
62    "//components/pref_registry:pref_registry",
63    "//components/prefs",
64    "//device/bluetooth",
65    "//net",
66  ]
67}
68
69static_library("test_support") {
70  testonly = true
71
72  sources = [
73    "fake_lock_handler.cc",
74    "fake_lock_handler.h",
75    "fake_remote_device_life_cycle.cc",
76    "fake_remote_device_life_cycle.h",
77    "mock_proximity_auth_client.cc",
78    "mock_proximity_auth_client.h",
79  ]
80
81  public_deps = [ ":proximity_auth" ]
82
83  deps = [
84    "//base",
85    "//chromeos/components/multidevice",
86    "//chromeos/components/multidevice:test_support",
87    "//chromeos/components/multidevice/logging",
88    "//chromeos/services/device_sync/proto",
89    "//chromeos/services/secure_channel:test_support",
90    "//chromeos/services/secure_channel/public/cpp/client",
91    "//testing/gmock",
92  ]
93}
94
95source_set("unit_tests") {
96  testonly = true
97  sources = [
98    "messenger_impl_unittest.cc",
99    "proximity_auth_local_state_pref_manager_unittest.cc",
100    "proximity_auth_profile_pref_manager_unittest.cc",
101    "proximity_auth_system_unittest.cc",
102    "proximity_monitor_impl_unittest.cc",
103    "remote_device_life_cycle_impl_unittest.cc",
104    "remote_status_update_unittest.cc",
105    "unlock_manager_impl_unittest.cc",
106  ]
107
108  configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
109
110  deps = [
111    ":proximity_auth",
112    ":test_support",
113    "//base",
114    "//base/test:test_support",
115    "//chromeos/components/multidevice",
116    "//chromeos/components/multidevice:test_support",
117    "//chromeos/components/multidevice/logging",
118    "//chromeos/constants",
119    "//chromeos/dbus/power",
120    "//chromeos/dbus/power:power_manager_proto",
121    "//chromeos/services/multidevice_setup/public/cpp:prefs",
122    "//chromeos/services/multidevice_setup/public/cpp:test_support",
123    "//chromeos/services/secure_channel:test_support",
124    "//chromeos/services/secure_channel/public/cpp/client:test_support",
125    "//components/prefs:test_support",
126    "//components/sync_preferences:test_support",
127    "//device/bluetooth:mocks",
128    "//testing/gmock",
129    "//testing/gtest",
130  ]
131}
132
133# Note: This is a convenience target for ease of rapid iteration during
134# development. It is not executed on any try or build bots.
135test("proximity_auth_unittests") {
136  sources = [ "run_all_unittests.cc" ]
137  deps = [
138    ":unit_tests",
139    "//base",
140    "//base/test:test_support",
141  ]
142}
143