summaryrefslogtreecommitdiffstats
path: root/remoting/BUILD.gn
blob: f0037d64ca601d34e224361cb1f727cd12c1e881 (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
# Copyright 2015 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/features.gni")
import("//build/config/ui.gni")
import("//remoting/remoting_version.gni")
import("//testing/test.gni")

enable_remoting_host = is_win || is_mac || is_chromeos || use_x11

# Various remoting targets need this version definition.
config("version") {
  defines = [ "VERSION=$version_full" ]
}

# GYP version: remoting/remoting_test.gypi:remoting_test_common
source_set("test_support") {
  testonly = true

  sources = [
    # Files from remoting_test_common not in separate test_support targets.
    "signaling/fake_signal_strategy.cc",
    "signaling/fake_signal_strategy.h",
    "signaling/mock_signal_strategy.cc",
    "signaling/mock_signal_strategy.h",
    "test/access_token_fetcher.cc",
    "test/app_remoting_test_driver_environment.cc",
    "test/fake_access_token_fetcher.cc",
    "test/fake_network_dispatcher.cc",
    "test/fake_network_dispatcher.h",
    "test/fake_network_manager.cc",
    "test/fake_network_manager.h",
    "test/fake_port_allocator.cc",
    "test/fake_port_allocator.h",
    "test/fake_socket_factory.cc",
    "test/fake_socket_factory.h",
    "test/leaky_bucket.cc",
    "test/leaky_bucket.h",
    "test/mock_access_token_fetcher.cc",
    "test/refresh_token_store.cc",
  ]

  deps = [
    "//base",
    "//components/policy:test_support",
    "//net",
    "//remoting/base",
    "//remoting/client",
    "//remoting/codec",
    "//remoting/protocol:test_support",
    "//remoting/resources",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (enable_remoting_host) {
    deps += [ "//remoting/host:test_support" ]
  }
}

# TODO(GYP) remoting_unittests on Windows. Currently this fails with a
# duplicate resource error on linking.
if (!is_win) {
  test("remoting_unittests") {
    # Sources not included in one of the more specific unit_tests deps.
    sources = [
      "signaling/iq_sender_unittest.cc",
      "signaling/log_to_server_unittest.cc",
      "signaling/server_log_entry_unittest.cc",
      "signaling/server_log_entry_unittest.h",
      "test/access_token_fetcher_unittest.cc",
      "test/app_remoting_test_driver_environment_unittest.cc",
    ]

    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
    configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

    deps = [
      ":test_support",
      "//base/allocator",
      "//google_apis",
      "//remoting/base:unit_tests",
      "//remoting/client:unit_tests",
      "//remoting/protocol:unit_tests",
      "//testing/gmock",
      "//testing/gtest",
      "//third_party/webrtc",
    ]

    if (is_android) {
      deps += [ "//testing/android:native_test_native_code" ]
    } else {
      deps += [ "//remoting/client/plugin" ]
    }

    if (enable_remoting_host) {
      deps += [
        "//remoting/codec:unit_tests",
        "//remoting/host:unit_tests",
      ]
    }

    if (enable_webrtc) {
      deps += [
        "//third_party/libjingle:libjingle_webrtc",
        "//third_party/libjingle:libpeerconnection",
      ]
    }
  }
} else {
  group("remoting_unittests") {
  }
}