chromium/ios/testing/BUILD.gn

# Copyright 2015 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/ios/bundle_data_from_filelist.gni")
import("//ios/build/config.gni")
import("//testing/test.gni")

group("all_tests") {
  testonly = true
  deps = [ ":ios_testing_unittests" ]
}

source_set("verify_custom_webkit") {
  testonly = true
  sources = [
    "verify_custom_webkit.h",
    "verify_custom_webkit.mm",
  ]
  deps = [ "//base" ]
}

source_set("hardware_keyboard_support") {
  testonly = true
  sources = [
    "hardware_keyboard_util.h",
    "hardware_keyboard_util.mm",
  ]
  deps = [ "//base/test:test_support" ]
}

source_set("open_url_context") {
  testonly = true
  sources = [
    "open_url_context.h",
    "open_url_context.mm",
  ]
}

source_set("block_swizzler") {
  testonly = true
  sources = [
    "scoped_block_swizzler.h",
    "scoped_block_swizzler.mm",
  ]
  deps = [ "//base" ]
}

source_set("protocol_fake") {
  sources = [
    "protocol_fake.h",
    "protocol_fake.mm",
  ]
  deps = [ "//base" ]
}

source_set("nserror_support") {
  testonly = true
  sources = [
    "nserror_util.h",
    "nserror_util.mm",
  ]
}

source_set("embedded_test_server_support") {
  testonly = true

  deps = [ "//net:test_support" ]
  sources = [
    "embedded_test_server_handlers.cc",
    "embedded_test_server_handlers.h",
  ]
}

source_set("system_alert_handler") {
  configs += [ "//build/config/ios:xctest_config" ]
  testonly = true
  sources = [
    "system_alert_handler.h",
    "system_alert_handler.mm",
  ]
  deps = [ "//base/test:test_support" ]
}

source_set("ocmock_support") {
  testonly = true

  deps = [ "//base" ]

  public_deps = [ "//third_party/ocmock" ]

  sources = [
    "ocmock_complex_type_helper.h",
    "ocmock_complex_type_helper.mm",
  ]
}

test("ios_testing_unittests") {
  deps = [
    ":block_swizzler",
    ":ocmock_support",
    "//base/test:run_all_unittests",
    "//base/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/ocmock",
  ]

  sources = [
    "ocmock_complex_type_helper_unittest.mm",
    "scoped_block_swizzler_unittest.mm",
  ]

  assert_no_deps = ios_assert_no_deps
}

bundle_data_from_filelist("http_server_bundle_data") {
  testonly = true
  filelist_name = "http_server_bundle_data.filelist"
}