chromium/chrome/android/junit/BUILD.gn

# Copyright 2023 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/config.gni")
import("//third_party/jni_zero/jni_zero.gni")

# Broken out into a separate BUILD.gn (from //chrome/android) in order to avoid
# defining other targets in the robolectric_toolchain.
shared_library_with_jni("libchrome_junit_tests") {
  testonly = true
  enable_target = is_robolectric
  java_targets = [
    "//chrome/android:chrome_junit_tests",
    "//chrome/browser/touch_to_fill/password_manager/android:touch_to_fill_junit_tests",
  ]

  # Ensure all users of this library include themselves in java_targets.
  visibility = []
  foreach(t, java_targets) {
    visibility += [ get_label_info(t, "dir") + ":*" ]
  }
  if (defined(extra_libchrome_junit_tests_visibility)) {
    visibility += extra_libchrome_junit_tests_visibility
  }

  deps = [
    "//components/url_formatter($robolectric_toolchain)",
    "//url:robolectric_jni_onload($robolectric_toolchain)",
  ]
}