# Copyright 2026 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

source_set("performance_monitor") {
  public = [ "chrome_browser_main_extra_parts_performance_monitor.h" ]

  sources = [
    "chrome_browser_main_extra_parts_performance_monitor.cc",
    "system_monitor.cc",
    "system_monitor.h",
  ]

  if (is_win) {
    sources += [
      "metric_evaluator_helper_win.cc",
      "metric_evaluator_helper_win.h",
    ]
  } else if (is_posix) {
    sources += [
      "metric_evaluator_helper_posix.cc",
      "metric_evaluator_helper_posix.h",
    ]
  }

  public_deps = [ "//chrome/browser:main_extra_parts" ]

  deps = [ "//base" ]

  friend = [ ":unit_tests" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "system_monitor_unittest.cc" ]

  if (is_win) {
    sources += [ "metric_evaluator_helper_win_unittest.cc" ]
  }

  deps = [
    ":performance_monitor",
    "//base/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}
