chromium/components/test/BUILD.gn

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

import("//printing/buildflags/buildflags.gni")
import("//ui/base/ui_features.gni")

if (is_ios) {
  import("//build/config/ios/bundle_data_from_filelist.gni")
}

source_set("test_support") {
  testonly = true

  sources = [
    "components_test_suite.cc",
    "components_test_suite.h",
    "test_switches.cc",
    "test_switches.h",
  ]

  deps = [
    "//components/breadcrumbs/core",
    "//components/content_settings/core/common",
    "//components/gcm_driver:gcm_driver",
    "//mojo/core/embedder",
    "//net",
    "//testing/gtest",
    "//ui/base",
    "//ui/resources:ui_test_pak",
  ]

  public_deps = [ "//base/test:test_support" ]

  if (is_ios) {
    sources += [
      "ios_components_test_initializer.cc",
      "ios_components_test_initializer.h",
    ]

    deps += [ "//services/network:test_support" ]
  }

  if (use_blink) {
    deps += [
      "//components/invalidation/impl",
      "//components/policy/core/browser",
      "//ui/gl:test_support",
    ]

    public_deps += [ "//content/test:test_support" ]
  }
}

# Defines a main() function that uses components_test_suite.h
source_set("run_all_unittests") {
  testonly = true

  sources = [ "run_all_unittests.cc" ]

  deps = [ ":test_support" ]
}

# Keep in sync with /components/test/PRESUBMIT.py
if (is_ios) {
  bundle_data_from_filelist("custom_handlers_test_bundle_data") {
    testonly = true
    filelist_name = "data/custom_handlers/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("dom_distiller_test_bundle_data") {
    testonly = true
    filelist_name = "data/dom_distiller/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("feed_test_bundle_data") {
    testonly = true
    filelist_name = "data/feed/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("fenced_frames_test_bundle_data") {
    testonly = true
    filelist_name = "data/fenced_frames/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("history_test_bundle_data") {
    testonly = true
    filelist_name = "data/history/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("history_embeddings_test_bundle_data") {
    testonly = true
    filelist_name = "data/history_embeddings/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("language_test_bundle_data") {
    testonly = true
    filelist_name = "data/language/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("offline_pages_test_bundle_data") {
    testonly = true
    filelist_name = "data/offline_pages/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("paint_preview_test_bundle_data") {
    testonly = true
    filelist_name = "data/paint_preview/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("password_manager_test_bundle_data") {
    testonly = true
    filelist_name = "data/password_manager/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("performance_manager_test_bundle_data") {
    testonly = true
    filelist_name = "data/performance_manager/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("safe_browsing_test_bundle_data") {
    testonly = true
    filelist_name = "data/safe_browsing/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("service_worker_test_bundle_data") {
    testonly = true
    filelist_name = "data/service_worker/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("subresource_filter_test_bundle_data") {
    testonly = true
    filelist_name = "data/subresource_filter/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("url_rewrite_test_bundle_data") {
    testonly = true
    filelist_name = "data/url_rewrite/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("value_store_test_bundle_data") {
    testonly = true
    filelist_name = "data/value_store/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("viz_test_bundle_data") {
    testonly = true
    filelist_name = "data/viz/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("webapps_test_bundle_data") {
    testonly = true
    filelist_name = "data/webapps/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("web_database_test_bundle_data") {
    testonly = true
    filelist_name = "data/web_database/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("webcrypto_test_bundle_data") {
    testonly = true
    filelist_name = "data/webcrypto/unit_tests_bundle_data.filelist"
  }
  bundle_data_from_filelist("web_package_test_bundle_data") {
    testonly = true
    filelist_name = "data/web_package/unit_tests_bundle_data.filelist"
  }
}