summaryrefslogtreecommitdiff
path: root/chromium/ios/chrome/browser/policy/BUILD.gn
blob: d1a0ece4beb5dc2a4438dcbc9e55dbfb722f8076 (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
# Copyright 2020 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.

source_set("policy") {
  sources = [
    "browser_policy_connector_ios.h",
    "browser_policy_connector_ios.mm",
    "browser_state_policy_connector.h",
    "browser_state_policy_connector.mm",
    "browser_state_policy_connector_factory.h",
    "browser_state_policy_connector_factory.mm",
    "configuration_policy_handler_list_factory.h",
    "configuration_policy_handler_list_factory.mm",
    "policy_conversions_client_ios.h",
    "policy_conversions_client_ios.mm",
    "schema_registry_factory.h",
    "schema_registry_factory.mm",
  ]

  deps = [
    "//base",
    "//components/password_manager/core/common",
    "//components/policy:generated",
    "//components/policy/core/common",
    "//ios/chrome/browser",
    "//ios/chrome/browser:pref_names",
    "//ios/chrome/browser/browser_state",
    "//services/network/public/cpp",
  ]

  public_deps = [
    ":feature_flags",
    "//components/policy/core/browser",
  ]

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

source_set("feature_flags") {
  configs += [ "//build/config/compiler:enable_arc" ]
  sources = [
    "policy_features.cc",
    "policy_features.h",
  ]
  deps = [
    "//base",
    "//components/version_info",
    "//ios/chrome/browser:utils",
    "//ios/chrome/common",
  ]
}

source_set("test_support") {
  testonly = true
  sources = [
    "test_platform_policy_provider.cc",
    "test_platform_policy_provider.h",
  ]

  deps = [ "//base" ]

  public_deps = [
    "//components/policy/core/common:test_support",
    "//testing/gmock",
  ]

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

source_set("unit_tests") {
  configs += [ "//build/config/compiler:enable_arc" ]
  testonly = true
  sources = [ "policy_unittest.mm" ]
  deps = [
    ":policy",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/password_manager/core/common",
    "//components/pref_registry",
    "//components/prefs",
    "//components/sync_preferences",
    "//ios/chrome/browser:pref_names",
    "//ios/chrome/browser:utils",
    "//ios/chrome/browser/prefs",
    "//ios/chrome/browser/prefs:browser_prefs",
    "//testing/gtest",
  ]
}

source_set("eg2_tests") {
  defines = [ "CHROME_EARL_GREY_2" ]
  configs += [
    "//build/config/compiler:enable_arc",
    "//build/config/ios:xctest_config",
  ]
  testonly = true

  sources = [
    "policy_app_interface.h",
    "policy_app_interface_stub.mm",
    "policy_egtest.mm",
    "policy_platform_provider_egtest.mm",
  ]

  deps = [
    "//base",
    "//components/policy/core/common:common_constants",
    "//components/strings",
    "//ios/chrome/browser:pref_names",
    "//ios/chrome/browser:utils",
    "//ios/chrome/test/earl_grey:eg_test_support+eg2",
    "//ios/testing/earl_grey:eg_test_support+eg2",
    "//ios/third_party/earl_grey2:test_lib",
    "//ui/base",
  ]

  libs = [ "UIKit.framework" ]
}

source_set("eg_app_support+eg2") {
  defines = [ "CHROME_EARL_GREY_2" ]
  configs += [ "//build/config/compiler:enable_arc" ]
  testonly = true
  sources = [
    "policy_app_interface.h",
    "policy_app_interface.mm",
  ]
  deps = [
    ":policy",
    ":test_support",
    "//base",
    "//components/policy:generated",
    "//components/policy/core/browser",
    "//components/policy/core/common",
    "//ios/chrome/browser",
  ]
  libs = [ "Foundation.framework" ]
}