blob: 8314643e9d8a844be39c712ee17063024274f1d0 [file] [log] [blame]
Ryan Powell30287d42019-08-15 15:48:321# Copyright 2019 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
Sylvain Defresne13c9a332019-10-30 18:25:125# Reset sources_assignment_filter for the BUILD.gn file to prevent
6# regression during the migration of Chromium away from the feature.
7# See build/no_sources_assignment_filter.md for more information.
8# TODO(crbug.com/1018739): remove this when migration is done.
9set_sources_assignment_filter([])
10
Ryan Powell30287d42019-08-15 15:48:3211source_set("memory_pressure") {
12 sources = [
13 "memory_pressure_voter.cc",
14 "memory_pressure_voter.h",
15 "multi_source_memory_pressure_monitor.cc",
16 "multi_source_memory_pressure_monitor.h",
Ryan Powella68d66fc2019-08-19 21:32:3917 "system_memory_pressure_evaluator.cc",
18 "system_memory_pressure_evaluator.h",
Ryan Powell30287d42019-08-15 15:48:3219 ]
20
Sylvain Defresne13c9a332019-10-30 18:25:1221 if (is_win) {
22 sources += [
23 "system_memory_pressure_evaluator_win.cc",
24 "system_memory_pressure_evaluator_win.h",
25 ]
26 }
27
28 if (is_mac) {
29 sources += [
30 "system_memory_pressure_evaluator_mac.cc",
31 "system_memory_pressure_evaluator_mac.h",
32 ]
33 }
34
35 if (is_chromeos) {
36 sources += [
37 "system_memory_pressure_evaluator_chromeos.cc",
38 "system_memory_pressure_evaluator_chromeos.h",
39 ]
40 }
41
Ryan Powell30287d42019-08-15 15:48:3242 deps = [
43 "//base",
44 ]
45}
46
47source_set("unittests") {
48 testonly = true
49 sources = [
50 "memory_pressure_voter_unittest.cc",
51 "multi_source_memory_pressure_monitor_unittest.cc",
Ryan Powell30287d42019-08-15 15:48:3252 ]
53
Sylvain Defresne13c9a332019-10-30 18:25:1254 if (is_win) {
55 sources += [ "system_memory_pressure_evaluator_win_unittest.cc" ]
56 }
57
58 if (is_mac) {
59 sources += [ "system_memory_pressure_evaluator_mac_unittest.cc" ]
60 }
61
62 if (is_chromeos) {
63 sources += [ "system_memory_pressure_evaluator_chromeos_unittest.cc" ]
64 }
65
Ryan Powell30287d42019-08-15 15:48:3266 deps = [
67 ":memory_pressure",
68 "//base",
69 "//base/test:test_support",
Ryan Powella68d66fc2019-08-19 21:32:3970 "//testing/gmock",
Ryan Powell30287d42019-08-15 15:48:3271 "//testing/gtest",
72 ]
73}
Sebastien Marchand1e9276e2019-10-08 00:03:5074
75static_library("test_support") {
76 testonly = true
77 sources = [
78 "fake_memory_pressure_monitor.cc",
79 "fake_memory_pressure_monitor.h",
80 ]
81
82 public_deps = [
83 ":memory_pressure",
84 "//base",
85 ]
86}