chromium/chrome/browser/enterprise/util/BUILD.gn

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

import("//build/config/android/rules.gni")
import("//third_party/jni_zero/jni_zero.gni")

_jni_sources = [
  "android/java/src/org/chromium/chrome/browser/enterprise/util/EnterpriseInfo.java",
  "android/java/src/org/chromium/chrome/browser/enterprise/util/ManagedBrowserUtils.java",
]

android_library("java") {
  srcjar_deps = [ ":jni_headers" ]
  sources = _jni_sources
  sources += [ "android/java/src/org/chromium/chrome/browser/enterprise/util/EnterpriseInfoImpl.java" ]

  deps = [
    "//base:base_java",
    "//build/android:build_java",
    "//chrome/browser/flags:java",
    "//chrome/browser/profiles/android:java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/jni_zero:jni_zero_java",
  ]
}

generate_jni("jni_headers") {
  sources = _jni_sources
}

robolectric_library("junit") {
  sources = [ "android/java/src/org/chromium/chrome/browser/enterprise/util/EnterpriseInfoImplTest.java" ]

  deps = [
    ":java",
    "//base:base_java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
  ]
}

android_library("test_support_java") {
  sources = [ "android/java/src/org/chromium/chrome/browser/enterprise/util/FakeEnterpriseInfo.java" ]
  deps = [
    ":java",
    "//base:base_java",
    "//content/public/android:content_main_dex_java",
  ]
}