chromium/chrome/browser/recent_tabs/internal/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/rules.gni")
import("//build/config/locales.gni")
import("//chrome/common/features.gni")
import("//tools/grit/grit_rule.gni")

android_library("java") {
  visibility = [
    ":*",
    "//chrome/android:chrome_all_java",
    "//chrome/browser/recent_tabs:helper_java",
  ]

  sources = [
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDeviceListCoordinator.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDeviceListMediator.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDeviceListProperties.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDeviceListViewBinder.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneFactory.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneImpl.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsControllerFactory.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsControllerImpl.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsCoordinator.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsMediator.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsMetricsHelper.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsPromoSheetContent.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsProperties.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/CrossDevicePaneView.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/ForeignSessionItemProperties.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/ForeignSessionItemViewBinder.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsDetailItemDecoration.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsDetailScreenCoordinator.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsDetailScreenViewBinder.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsPromoScreenCoordinator.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsPromoScreenViewBinder.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsViewBinderHelper.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/TabItemProperties.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/TabItemViewBinder.java",
  ]

  deps = [
    ":java_resources",
    "//base:base_java",
    "//chrome/browser/feature_engagement:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/hub:factory_java",
    "//chrome/browser/hub:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/recent_tabs:java",
    "//chrome/browser/tab:java",
    "//chrome/browser/tabmodel:java",
    "//chrome/browser/ui/android/favicon:java",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/feature_engagement/public:public_java",
    "//components/sync_device_info:sync_device_info_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//ui/android:ui_java",
    "//url:gurl_java",
  ]
  resources_package = "org.chromium.chrome.browser.recent_tabs"
}

android_resources("java_resources") {
  deps = [
    ":java_strings_grd",
    "//chrome/android:chrome_app_java_resources",
    "//components/browser_ui/widget/android:java_resources",
    "//ui/android:ui_java_resources",
  ]
  sources = [
    "android/java/res/anim/restore_tabs_view_flipper_fade_in.xml",
    "android/java/res/anim/restore_tabs_view_flipper_fade_out.xml",
    "android/java/res/drawable/restore_tabs_detail_item_background_bottom.xml",
    "android/java/res/drawable/restore_tabs_detail_item_background_middle.xml",
    "android/java/res/drawable/restore_tabs_detail_item_background_top.xml",
    "android/java/res/drawable/restore_tabs_expand_more.xml",
    "android/java/res/drawable/restore_tabs_fre_logo.xml",
    "android/java/res/drawable/restore_tabs_phone_icon.xml",
    "android/java/res/drawable/restore_tabs_single_item_background.xml",
    "android/java/res/drawable/restore_tabs_tablet_icon.xml",
    "android/java/res/layout/cross_device_pane.xml",
    "android/java/res/layout/restore_tabs_bottom_sheet.xml",
    "android/java/res/layout/restore_tabs_detail_screen_sheet.xml",
    "android/java/res/layout/restore_tabs_foreign_session_item.xml",
    "android/java/res/layout/restore_tabs_promo_screen_sheet.xml",
    "android/java/res/layout/restore_tabs_tab_item.xml",
    "android/java/res/values-night/colors.xml",
    "android/java/res/values/colors.xml",
    "android/java/res/values/dimens.xml",
  ]
}

java_strings_grd("java_strings_grd") {
  defines = chrome_grit_defines
  grd_file = "android/java/strings/android_restore_tabs_strings.grd"
  outputs =
      [ "values/android_restore_tabs_strings.xml" ] +
      process_file_template(
          android_bundle_locales_as_resources,
          [ "values-{{source_name_part}}/android_restore_tabs_strings.xml" ])
}

robolectric_library("junit") {
  bypass_platform_checks = true
  testonly = true

  sources = [
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDeviceListCoordinatorUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDeviceListMediatorUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDeviceListViewBinderUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsCoordinatorUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsMediatorUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsPromoSheetContentUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/ForeignSessionItemPropertiesUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/ForeignSessionItemViewBinderUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsDetailScreenViewBinderUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/RestoreTabsPromoScreenViewBinderUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/TabItemPropertiesUnitTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/ui/TabItemViewBinderUnitTest.java",
  ]

  deps = [
    ":java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//base/test:test_support_java",
    "//chrome/browser/feature_engagement:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/hub:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/recent_tabs:helper_java",
    "//chrome/browser/recent_tabs:java",
    "//chrome/browser/tabmodel:java",
    "//chrome/browser/ui/android/favicon:java",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/feature_engagement/public:public_java",
    "//components/sync_device_info:sync_device_info_java",
    "//third_party/android_deps:espresso_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//third_party/androidx:androidx_test_core_java",
    "//third_party/androidx:androidx_test_ext_junit_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/hamcrest:hamcrest_library_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit:junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_java",
    "//ui/android:ui_java_test_support",
    "//url:gurl_java",
    "//url:gurl_junit_test_support",
  ]
}

android_library("recent_tabs_javatests") {
  testonly = true
  sources = [ "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsTest.java" ]

  deps = [
    ":java",
    "//base:base_java_test_support",
    "//chrome/android:chrome_java",
    "//chrome/android:chrome_test_java",
    "//chrome/android/features/tab_ui:test_support_javalib",
    "//chrome/browser/feature_engagement:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/recent_tabs:helper_java",
    "//chrome/browser/recent_tabs:java",
    "//chrome/test/android:chrome_java_integration_test_support",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/browser_ui/bottomsheet/android:manager_java",
    "//components/feature_engagement/public:public_java",
    "//components/sync_device_info:sync_device_info_java",
    "//third_party/android_deps:espresso_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/hamcrest:hamcrest_library_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit:junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_java_test_support",
    "//url:gurl_java",
    "//url:gurl_junit_test_support",
  ]
}

android_library("unit_device_javatests") {
  testonly = true

  sources = [
    "android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneRenderTest.java",
    "android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsUiRenderTest.java",
  ]

  deps = [
    ":java",
    "//base:base_java_test_support",
    "//base:tasks_java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/recent_tabs:java",
    "//chrome/browser/tabmodel:java",
    "//chrome/browser/ui/android/favicon:java",
    "//chrome/test/android:chrome_java_test_support_common",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/sync_device_info:sync_device_info_java",
    "//content/public/test/android:content_java_test_support",
    "//third_party/android_deps:espresso_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit:junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_full_java",
    "//ui/android:ui_java_test_support",
    "//url:gurl_java",
    "//url:gurl_junit_test_support",
  ]
}