chromium/components/supervised_user/core/common/BUILD.gn

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

if (is_android) {
  import("//build/config/android/rules.gni")
}

import("//build/buildflag_header.gni")
import("//components/supervised_user/buildflags.gni")

buildflag_header("buildflags") {
  header = "buildflags.h"
  flags = [ "ENABLE_SUPERVISED_USERS=$enable_supervised_users" ]
}

static_library("common") {
  sources = [
    "pref_names.h",
    "supervised_user_constants.cc",
    "supervised_user_constants.h",
    "supervised_users.h",
  ]

  deps = [
    ":buildflags",
    "//base",
    "//components/prefs",
    "//components/signin/public/identity_manager",
    "//components/url_matcher:url_matcher",
    "//extensions/buildflags",
    "//ui/base",
  ]

  public_deps = [ ":features" ]
}

source_set("features") {
  sources = [
    "features.cc",
    "features.h",
  ]

  deps = [
    "//base",
    "//build:branding_buildflags",
    "//extensions/buildflags",
  ]
}

source_set("test_utils") {
  testonly = true

  sources = [
    "features_testutils.cc",
    "features_testutils.h",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//components/supervised_user/core/common:features",
    "//testing/gtest",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "features_unittest.cc" ]
  deps = [
    ":common",
    "//base",
    "//base/test:test_support",
    "//build:branding_buildflags",
    "//testing/gtest",
  ]
}