summaryrefslogtreecommitdiffstats
path: root/components/gcm_driver/BUILD.gn
blob: e4ecdc86e44d58d842b2eb53ef608c3902729224 (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
# 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.

# GYP version: components/gcm_driver.gypi:gcm_driver_common
component("common") {
  sources = [
    "common/gcm_driver_export.h",
    "common/gcm_messages.cc",
    "common/gcm_messages.h",
  ]

  defines = [ "GCM_DRIVER_IMPLEMENTATION" ]
}

# GYP version: components/gcm_driver.gypi:gcm_driver
static_library("gcm_driver") {
  sources = [
    "android/component_jni_registrar.cc",
    "android/component_jni_registrar.h",
    "default_gcm_app_handler.cc",
    "default_gcm_app_handler.h",
    "gcm_account_mapper.cc",
    "gcm_account_mapper.h",
    "gcm_activity.cc",
    "gcm_activity.h",
    "gcm_app_handler.cc",
    "gcm_app_handler.h",
    "gcm_backoff_policy.cc",
    "gcm_backoff_policy.h",
    "gcm_channel_status_request.cc",
    "gcm_channel_status_request.h",
    "gcm_channel_status_syncer.cc",
    "gcm_channel_status_syncer.h",
    "gcm_client.cc",
    "gcm_client.h",
    "gcm_client_factory.cc",
    "gcm_client_factory.h",
    "gcm_client_impl.cc",
    "gcm_client_impl.h",
    "gcm_connection_observer.cc",
    "gcm_connection_observer.h",
    "gcm_delayed_task_controller.cc",
    "gcm_delayed_task_controller.h",
    "gcm_driver.cc",
    "gcm_driver.h",
    "gcm_driver_android.cc",
    "gcm_driver_android.h",
    "gcm_driver_desktop.cc",
    "gcm_driver_desktop.h",
    "gcm_stats_recorder_impl.cc",
    "gcm_stats_recorder_impl.h",
    "registration_info.cc",
    "registration_info.h",
    "system_encryptor.cc",
    "system_encryptor.h",
  ]

  deps = [
    "//base",
    "//components/os_crypt",
    "//google_apis/gcm",
    "//net",
    "//sync/protocol",
    ":common",
  ]

  if (is_chromeos) {
    deps += [ "//components/timers" ]
  }

  if (is_android) {
    sources -= [
      "gcm_account_mapper.cc",
      "gcm_account_mapper.h",
      "gcm_channel_status_request.cc",
      "gcm_channel_status_request.h",
      "gcm_channel_status_syncer.cc",
      "gcm_channel_status_syncer.h",
      "gcm_client_factory.cc",
      "gcm_client_factory.h",
      "gcm_client_impl.cc",
      "gcm_client_impl.h",
      "gcm_delayed_task_controller.cc",
      "gcm_delayed_task_controller.h",
      "gcm_driver_desktop.cc",
      "gcm_driver_desktop.h",
      "gcm_stats_recorder_impl.cc",
      "gcm_stats_recorder_impl.h",
    ]
    deps -= [ "//google_apis/gcm" ]
    deps += [ "android:jni_headers" ]
  }
}

# GYP version: components/gcm_driver.gypi:gcm_driver_test_support
static_library("test_support") {
  testonly = true
  sources = [
    "fake_gcm_app_handler.cc",
    "fake_gcm_app_handler.h",
    "fake_gcm_client.cc",
    "fake_gcm_client.h",
    "fake_gcm_client_factory.cc",
    "fake_gcm_client_factory.h",
    "fake_gcm_driver.cc",
    "fake_gcm_driver.h",
  ]

  deps = [
    ":gcm_driver",
    "//base",
    "//google_apis/gcm:test_support",
    "//testing/gtest",
  ]

  if (is_android) {
    sources -= [
      "fake_gcm_client.cc",
      "fake_gcm_client.h",
      "fake_gcm_client_factory.cc",
      "fake_gcm_client_factory.h",
    ]
    deps -= [ "//google_apis/gcm:test_support" ]
  }
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "gcm_account_mapper_unittest.cc",
    "gcm_channel_status_request_unittest.cc",
    "gcm_client_impl_unittest.cc",
    "gcm_delayed_task_controller_unittest.cc",
    "gcm_driver_desktop_unittest.cc",
    "gcm_stats_recorder_impl_unittest.cc",
  ]

  deps = [
    ":gcm_driver",
    ":test_support",
    "//testing/gtest",
    "//third_party/protobuf:protobuf_lite",
  ]
}