chromium/chrome/browser/ui/messages/android/BUILD.gn

# Copyright 2019 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")

android_resources("java_resources") {
  sources = [
    "java/res/drawable/snackbar_background_tablet.xml",
    "java/res/layout/snackbar.xml",
    "java/res/values-night/dimens.xml",
    "java/res/values/dimens.xml",
  ]

  deps = [
    "//chrome/browser/ui/android/strings:ui_strings_grd",
    "//components/browser_ui/strings/android:browser_ui_strings_grd",
    "//components/browser_ui/widget/android:java_resources",
    "//components/infobars/android:java_resources",
    "//ui/android:ui_java_resources",
  ]
}

android_library("java") {
  srcjar_deps = [ ":jni_headers" ]
  sources = [
    "java/src/org/chromium/chrome/browser/ui/messages/infobar/SimpleConfirmInfoBarBuilder.java",
    "java/src/org/chromium/chrome/browser/ui/messages/snackbar/Snackbar.java",
    "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarCollection.java",
    "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java",
    "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManagerProvider.java",
    "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarStateProvider.java",
    "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java",
  ]

  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//chrome/browser/ui/android/edge_to_edge:factory_java",
    "//chrome/browser/ui/android/edge_to_edge:java",
    "//chrome/browser/util:java",
    "//components/browser_ui/styles/android:java",
    "//components/browser_ui/styles/android:java_resources",
    "//components/browser_ui/widget/android:java",
    "//components/infobars/android:infobar_android_enums_java",
    "//components/infobars/android:java",
    "//components/infobars/core:infobar_enums_java",
    "//content/public/android:content_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_appcompat_appcompat_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/accessibility:ax_base_java",
    "//ui/android:ui_full_java",
    "//ui/android:ui_utils_java",
  ]

  resources_package = "org.chromium.chrome.ui.messages"
}

generate_jni("jni_headers") {
  sources = [ "java/src/org/chromium/chrome/browser/ui/messages/infobar/SimpleConfirmInfoBarBuilder.java" ]
}

robolectric_library("junit") {
  sources = [ "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarCollectionUnitTest.java" ]

  deps = [
    ":java",
    "//base:base_java_test_support",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
  ]
}

android_library("unit_device_javatests") {
  testonly = true
  resources_package = "org.chromium.chrome.browser.ui.messages.test"

  sources = [ "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarTest.java" ]

  deps = [
    ":java",
    ":test_java_resources",
    "//base:base_java",
    "//base:base_java_test_support",
    "//chrome/browser/util:java",
    "//chrome/test/android:chrome_java_integration_test_support",
    "//content/public/android:content_java",
    "//content/public/test/android:content_java_test_support",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/jni_zero:gendeps_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
    "//ui/accessibility:ax_base_java",
    "//ui/android:ui_java",
    "//ui/android:ui_java_test_support",
  ]
}

android_resources("test_java_resources") {
  testonly = true

  sources = [ "test/java/res/layout/test_snackbar_manager_activity_layout.xml" ]
}