chromium/ios/web/download/BUILD.gn

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

import("//ios/build/config.gni")

source_set("download") {
  deps = [
    ":download_cookies",
    "//base",
    "//ios/net",
    "//ios/web/common:user_agent",
    "//ios/web/net/cookies",
    "//ios/web/public",
    "//ios/web/public/download",
    "//ios/web/web_view:util",
    "//ui/base",
  ]

  sources = [
    "crw_web_view_download.h",
    "crw_web_view_download.mm",
    "download_controller_impl.h",
    "download_controller_impl.mm",
    "download_native_task_bridge.h",
    "download_native_task_bridge.mm",
    "download_native_task_impl.h",
    "download_native_task_impl.mm",
    "download_result.h",
    "download_result.mm",
    "download_task_impl.h",
    "download_task_impl.mm",
    "download_task_observer.mm",
    "download_task_observer_bridge.mm",
    "web_state_content_download_task.h",
    "web_state_content_download_task.mm",
  ]

  frameworks = [ "UIKit.framework" ]
}

source_set("download_cookies") {
  visibility = [ ":*" ]

  deps = [
    "//base",
    "//ios/net",
    "//net",
  ]

  sources = [
    "download_session_cookie_storage.h",
    "download_session_cookie_storage.mm",
  ]

  frameworks = [ "Foundation.framework" ]
}

source_set("download_unittests") {
  testonly = true
  deps = [
    ":download_cookies",
    "//base",
    "//base/test:test_support",
    "//ios/testing:ocmock_support",
    "//ios/web/download",
    "//ios/web/net/cookies",
    "//ios/web/public/download",
    "//ios/web/public/test",
    "//ios/web/public/test:download_test_utils",
    "//ios/web/public/test:test_fixture",
    "//ios/web/public/test/fakes",
    "//ios/web/test/fakes",
    "//net",
    "//testing/gmock",
    "//testing/gtest",
  ]

  sources = [
    "crw_web_view_download_unittest.mm",
    "download_controller_impl_unittest.mm",
    "download_native_task_impl_unittest.mm",
    "download_session_cookie_storage_unittest.mm",
    "download_task_impl_unittest.mm",
    "web_state_content_download_task_unittest.mm",
  ]
}

source_set("download_inttests") {
  testonly = true
  deps = [
    "//base/test:test_support",
    "//ios/web/public",
    "//ios/web/public/download",
    "//ios/web/public/test",
    "//ios/web/public/test:download_test_utils",
    "//ios/web/public/test:test_fixture",
    "//ios/web/public/test/fakes",
    "//net:test_support",
  ]

  sources = [ "download_inttest.mm" ]
}