# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("model") {
sources = [
"ios_chrome_hints_manager.h",
"ios_chrome_hints_manager.mm",
"ios_chrome_prediction_model_store.h",
"ios_chrome_prediction_model_store.mm",
"optimization_guide_service.h",
"optimization_guide_service.mm",
"optimization_guide_service_factory.h",
"optimization_guide_service_factory.mm",
"optimization_guide_tab_helper.h",
"optimization_guide_tab_helper.mm",
"optimization_guide_validation_tab_helper.h",
"optimization_guide_validation_tab_helper.mm",
"prediction_model_download_client.mm",
"tab_url_provider_impl.h",
"tab_url_provider_impl.mm",
]
deps = [
"//base",
"//components/component_updater",
"//components/download/public/background_service:public",
"//components/keyed_service/core",
"//components/keyed_service/ios",
"//components/leveldb_proto",
"//components/optimization_guide/core",
"//components/optimization_guide/core:prediction",
"//components/optimization_guide/proto:optimization_guide_proto",
"//components/prefs",
"//components/signin/public/identity_manager:identity_manager",
"//components/variations",
"//ios/chrome/browser/download/model/background_service",
"//ios/chrome/browser/metrics/model:accessor",
"//ios/chrome/browser/shared/model/application_context",
"//ios/chrome/browser/shared/model/browser",
"//ios/chrome/browser/shared/model/browser_state",
"//ios/chrome/browser/shared/model/paths",
"//ios/chrome/browser/shared/model/profile",
"//ios/chrome/browser/shared/model/web_state_list",
"//ios/chrome/browser/signin/model",
"//ios/web",
]
frameworks = [ "UIKit.framework" ]
public_deps = [
":download_client_header",
"//components/optimization_guide/proto:optimization_guide_proto",
]
}
source_set("download_client_header") {
sources = [ "prediction_model_download_client.h" ]
deps = [
"//base",
"//components/download/public/background_service:public",
"//ios/chrome/browser/shared/model/profile",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"optimization_guide_service_factory_unittest.mm",
"optimization_guide_service_unittest.mm",
"optimization_guide_tab_helper_unittest.mm",
"optimization_guide_test_utils.h",
"optimization_guide_test_utils.mm",
"optimization_guide_validation_tab_helper_unittest.mm",
"prediction_manager_browsertest.mm",
"tab_url_provider_impl_unittest.mm",
]
deps = [
":model",
":resources_unit_tests",
"//base/test:test_support",
"//components/component_updater",
"//components/download/internal/background_service/ios:background_service",
"//components/optimization_guide/core",
"//components/optimization_guide/core:prediction",
"//components/optimization_guide/core:test_support",
"//components/optimization_guide/proto:optimization_guide_proto",
"//components/sync_preferences",
"//components/sync_preferences:test_support",
"//components/ukm:test_support",
"//components/unified_consent",
"//components/variations",
"//components/variations:test_support",
"//ios/chrome/browser/push_notification/model:push_notification_client",
"//ios/chrome/browser/shared/model/application_context",
"//ios/chrome/browser/shared/model/browser",
"//ios/chrome/browser/shared/model/browser/test:test_support",
"//ios/chrome/browser/shared/model/prefs:browser_prefs",
"//ios/chrome/browser/shared/model/profile",
"//ios/chrome/browser/shared/model/profile/test",
"//ios/chrome/browser/shared/model/web_state_list",
"//ios/chrome/test:test_support",
"//ios/web/public/test",
"//ios/web/public/test/fakes",
"//net:test_support",
"//services/metrics/public/cpp:ukm_builders",
"//testing/gtest",
]
}
source_set("eg_app_support+eg2") {
configs += [ "//build/config/ios:xctest_config" ]
testonly = true
sources = [
"optimization_guide_test_app_interface.h",
"optimization_guide_test_app_interface.mm",
]
deps = [
"//base",
"//base/test:test_support",
"//components/optimization_guide/core",
"//components/optimization_guide/core:test_support",
"//components/optimization_guide/proto:optimization_guide_proto",
"//ios/chrome/browser/optimization_guide/model",
"//ios/chrome/test/app:test_support",
]
}
source_set("eg_test_support+eg2") {
configs += [ "//build/config/ios:xctest_config" ]
testonly = true
sources = [
"optimization_guide_test_app_interface.h",
"optimization_guide_test_app_interface_stub.mm",
]
deps = [
"//components/optimization_guide/proto:optimization_guide_proto",
"//ios/testing/earl_grey:eg_test_support+eg2",
]
}
source_set("eg2_tests") {
configs += [ "//build/config/ios:xctest_config" ]
testonly = true
sources = [ "hints_fetcher_egtest.mm" ]
deps = [
":eg_test_support+eg2",
"//base/test:test_support",
"//components/optimization_guide/core:eg_test_support+eg2",
"//ios/chrome/browser/metrics/model:eg_test_support+eg2",
"//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/testing/earl_grey:eg_test_support+eg2",
"//net:test_support",
]
frameworks = [ "UIKit.framework" ]
}
bundle_data("resources_unit_tests") {
visibility = [ ":unit_tests" ]
testonly = true
sources = [
"//ios/chrome/test/data/optimization_guide/additional_file_doesnt_exist.crx3",
"//ios/chrome/test/data/optimization_guide/additional_file_exists.crx3",
"//ios/chrome/test/data/optimization_guide/amp.html",
"//ios/chrome/test/data/optimization_guide/empty.html",
"//ios/chrome/test/data/optimization_guide/english_page.html",
"//ios/chrome/test/data/optimization_guide/hello.html",
"//ios/chrome/test/data/optimization_guide/hello_world.html",
"//ios/chrome/test/data/optimization_guide/signed_valid_model.crx3",
]
outputs = [ "{{bundle_resources_dir}}/ios/chrome/test/data/optimization_guide/{{source_file_part}}" ]
}