diff options
Diffstat (limited to 'chromium')
464 files changed, 51901 insertions, 0 deletions
diff --git a/chromium/android_webview/BUILD.gn b/chromium/android_webview/BUILD.gn new file mode 100644 index 00000000000..3b8b1f99c12 --- /dev/null +++ b/chromium/android_webview/BUILD.gn @@ -0,0 +1,757 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") +import("//build/config/locales.gni") +import("//tools/grit/repack.gni") +import("system_webview_apk_tmpl.gni") +import("webview_repack_locales.gni") + +declare_args() { + # Package name of the system_webview_apk target. + system_webview_package_name = "com.android.webview" +} + +if (!defined(use_webview_internal_framework)) { + use_webview_internal_framework = false +} + +group("android_webview") { + if (!use_webview_internal_framework) { + deps = [ + ":system_webview_apk", + ] + } +} + +jinja_template("system_webview_manifest") { + input = "apk/java/AndroidManifest.xml" + output = "$target_gen_dir/system_webview_manifest/AndroidManifest.xml" + variables = [ "package=$system_webview_package_name" ] +} + +webview_repack_locales("repack_locales") { + input_locales = locales + output_locales = locales +} + +locale_pak_resources("locale_paks") { + sources = [ + "$root_out_dir/android_webview/locales/am.pak", + "$root_out_dir/android_webview/locales/ar.pak", + "$root_out_dir/android_webview/locales/bg.pak", + "$root_out_dir/android_webview/locales/bn.pak", + "$root_out_dir/android_webview/locales/ca.pak", + "$root_out_dir/android_webview/locales/cs.pak", + "$root_out_dir/android_webview/locales/da.pak", + "$root_out_dir/android_webview/locales/de.pak", + "$root_out_dir/android_webview/locales/el.pak", + "$root_out_dir/android_webview/locales/en-GB.pak", + "$root_out_dir/android_webview/locales/en-US.pak", + "$root_out_dir/android_webview/locales/es-419.pak", + "$root_out_dir/android_webview/locales/es.pak", + "$root_out_dir/android_webview/locales/et.pak", + "$root_out_dir/android_webview/locales/fa.pak", + "$root_out_dir/android_webview/locales/fi.pak", + "$root_out_dir/android_webview/locales/fil.pak", + "$root_out_dir/android_webview/locales/fr.pak", + "$root_out_dir/android_webview/locales/gu.pak", + "$root_out_dir/android_webview/locales/he.pak", + "$root_out_dir/android_webview/locales/hi.pak", + "$root_out_dir/android_webview/locales/hr.pak", + "$root_out_dir/android_webview/locales/hu.pak", + "$root_out_dir/android_webview/locales/id.pak", + "$root_out_dir/android_webview/locales/it.pak", + "$root_out_dir/android_webview/locales/ja.pak", + "$root_out_dir/android_webview/locales/kn.pak", + "$root_out_dir/android_webview/locales/ko.pak", + "$root_out_dir/android_webview/locales/lt.pak", + "$root_out_dir/android_webview/locales/lv.pak", + "$root_out_dir/android_webview/locales/ml.pak", + "$root_out_dir/android_webview/locales/mr.pak", + "$root_out_dir/android_webview/locales/ms.pak", + "$root_out_dir/android_webview/locales/nb.pak", + "$root_out_dir/android_webview/locales/nl.pak", + "$root_out_dir/android_webview/locales/pl.pak", + "$root_out_dir/android_webview/locales/pt-BR.pak", + "$root_out_dir/android_webview/locales/pt-PT.pak", + "$root_out_dir/android_webview/locales/ro.pak", + "$root_out_dir/android_webview/locales/ru.pak", + "$root_out_dir/android_webview/locales/sk.pak", + "$root_out_dir/android_webview/locales/sl.pak", + "$root_out_dir/android_webview/locales/sr.pak", + "$root_out_dir/android_webview/locales/sv.pak", + "$root_out_dir/android_webview/locales/sw.pak", + "$root_out_dir/android_webview/locales/ta.pak", + "$root_out_dir/android_webview/locales/te.pak", + "$root_out_dir/android_webview/locales/th.pak", + "$root_out_dir/android_webview/locales/tr.pak", + "$root_out_dir/android_webview/locales/uk.pak", + "$root_out_dir/android_webview/locales/vi.pak", + "$root_out_dir/android_webview/locales/zh-CN.pak", + "$root_out_dir/android_webview/locales/zh-TW.pak", + ] + deps = [ + ":repack_locales", + ] +} + +repack("repack_pack") { + sources = [ + "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak", + "$root_gen_dir/blink/public/resources/blink_resources.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/net/net_resources.pak", + "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", + "$target_gen_dir/aw_resources.pak", + ] + deps = [ + ":generate_aw_resources", + "//content:resources", + "//content/app/resources", + "//net:net_resources", + "//third_party/WebKit/public:image_resources", + "//third_party/WebKit/public:resources", + "//ui/resources", + ] + output = "$target_gen_dir/webviewchromium.pak" +} + +webview_license_path = "$target_gen_dir/webview_licenses.notice" + +android_assets("pak_file_assets") { + sources = [ + "$target_gen_dir/webviewchromium.pak", + ] + deps = [ + ":repack_pack", + ] + disable_compression = true +} + +android_assets("assets") { + sources = [ + webview_license_path, + ] + deps = [ + ":generate_webview_license_notice", + ":pak_file_assets", + "//third_party/icu:icu_assets", + "//v8:v8_external_startup_data_assets", + ] +} + +action("generate_webview_license_notice") { + script = "tools/webview_licenses.py" + inputs = exec_script("//android_webview/tools/webview_licenses.py", + [ "gn_notice_deps" ], + "value") + inputs += [ "tools/licenses_notice.tmpl" ] + outputs = [ + webview_license_path, + ] + args = [ + "notice", + rebase_path(webview_license_path), + ] +} + +android_resources("system_webview_resources") { + resource_dirs = [ "apk/java/res" ] + custom_package = system_webview_package_name +} + +android_resources("resources") { + resource_dirs = [ "java/res" ] + custom_package = "org.chromium.android_webview" + deps = [ + ":locale_paks", + ":strings_grd", + ] +} + +grit("generate_aw_resources") { + source = "ui/aw_resources.grd" + outputs = [ + "grit/aw_resources.h", + "aw_resources.pak", + ] +} + +grit("generate_aw_strings") { + source = "ui/aw_strings.grd" + outputs = [ + "grit/aw_strings.h", + "aw_strings_am.pak", + "aw_strings_ar.pak", + "aw_strings_bg.pak", + "aw_strings_bn.pak", + "aw_strings_ca.pak", + "aw_strings_cs.pak", + "aw_strings_da.pak", + "aw_strings_de.pak", + "aw_strings_el.pak", + "aw_strings_en-US.pak", + "aw_strings_en-GB.pak", + "aw_strings_es.pak", + "aw_strings_es-419.pak", + "aw_strings_et.pak", + "aw_strings_fa.pak", + "aw_strings_fi.pak", + "aw_strings_fil.pak", + "aw_strings_fr.pak", + "aw_strings_gu.pak", + "aw_strings_he.pak", + "aw_strings_hi.pak", + "aw_strings_hr.pak", + "aw_strings_hu.pak", + "aw_strings_id.pak", + "aw_strings_it.pak", + "aw_strings_ja.pak", + "aw_strings_kn.pak", + "aw_strings_ko.pak", + "aw_strings_lt.pak", + "aw_strings_lv.pak", + "aw_strings_ml.pak", + "aw_strings_mr.pak", + "aw_strings_ms.pak", + "aw_strings_nl.pak", + "aw_strings_nb.pak", + "aw_strings_pl.pak", + "aw_strings_pt-BR.pak", + "aw_strings_pt-PT.pak", + "aw_strings_ro.pak", + "aw_strings_ru.pak", + "aw_strings_sk.pak", + "aw_strings_sl.pak", + "aw_strings_sr.pak", + "aw_strings_sv.pak", + "aw_strings_sw.pak", + "aw_strings_ta.pak", + "aw_strings_te.pak", + "aw_strings_th.pak", + "aw_strings_tr.pak", + "aw_strings_uk.pak", + "aw_strings_vi.pak", + "aw_strings_zh-CN.pak", + "aw_strings_zh-TW.pak", + ] +} + +grit("generate_components_strings") { + source = "../components/components_strings.grd" + + # components_strings contains strings from all components. WebView + # will never display most of them, so we try to limit the included + # strings + whitelist = rebase_path("ui/grit_components_whitelist.txt") + inputs = [ + whitelist, + ] + grit_flags = [ + "-w", + whitelist, + ] + outputs = [ + "grit/components_strings.h", + "components_strings_am.pak", + "components_strings_ar.pak", + "components_strings_bg.pak", + "components_strings_bn.pak", + "components_strings_ca.pak", + "components_strings_cs.pak", + "components_strings_da.pak", + "components_strings_de.pak", + "components_strings_el.pak", + "components_strings_en-GB.pak", + "components_strings_en-US.pak", + "components_strings_es.pak", + "components_strings_es-419.pak", + "components_strings_et.pak", + "components_strings_fa.pak", + "components_strings_fake-bidi.pak", + "components_strings_fi.pak", + "components_strings_fil.pak", + "components_strings_fr.pak", + "components_strings_gu.pak", + "components_strings_he.pak", + "components_strings_hi.pak", + "components_strings_hr.pak", + "components_strings_hu.pak", + "components_strings_id.pak", + "components_strings_it.pak", + "components_strings_ja.pak", + "components_strings_kn.pak", + "components_strings_ko.pak", + "components_strings_lt.pak", + "components_strings_lv.pak", + "components_strings_ml.pak", + "components_strings_mr.pak", + "components_strings_ms.pak", + "components_strings_nl.pak", + "components_strings_nb.pak", + "components_strings_pl.pak", + "components_strings_pt-BR.pak", + "components_strings_pt-PT.pak", + "components_strings_ro.pak", + "components_strings_ru.pak", + "components_strings_sk.pak", + "components_strings_sl.pak", + "components_strings_sr.pak", + "components_strings_sv.pak", + "components_strings_sw.pak", + "components_strings_ta.pak", + "components_strings_te.pak", + "components_strings_th.pak", + "components_strings_tr.pak", + "components_strings_uk.pak", + "components_strings_vi.pak", + "components_strings_zh-CN.pak", + "components_strings_zh-TW.pak", + "java/res/values-am/components_strings.xml", + "java/res/values-ar/components_strings.xml", + "java/res/values-bg/components_strings.xml", + "java/res/values-ca/components_strings.xml", + "java/res/values-cs/components_strings.xml", + "java/res/values-da/components_strings.xml", + "java/res/values-de/components_strings.xml", + "java/res/values-el/components_strings.xml", + "java/res/values-en-rGB/components_strings.xml", + "java/res/values-es-rUS/components_strings.xml", + "java/res/values-es/components_strings.xml", + "java/res/values-fa/components_strings.xml", + "java/res/values-fi/components_strings.xml", + "java/res/values-fr/components_strings.xml", + "java/res/values-hi/components_strings.xml", + "java/res/values-hr/components_strings.xml", + "java/res/values-hu/components_strings.xml", + "java/res/values-in/components_strings.xml", + "java/res/values-it/components_strings.xml", + "java/res/values-iw/components_strings.xml", + "java/res/values-ja/components_strings.xml", + "java/res/values-ko/components_strings.xml", + "java/res/values-lt/components_strings.xml", + "java/res/values-lv/components_strings.xml", + "java/res/values-nb/components_strings.xml", + "java/res/values-nl/components_strings.xml", + "java/res/values-pl/components_strings.xml", + "java/res/values-pt-rBR/components_strings.xml", + "java/res/values-pt-rPT/components_strings.xml", + "java/res/values-ro/components_strings.xml", + "java/res/values-ru/components_strings.xml", + "java/res/values-sk/components_strings.xml", + "java/res/values-sl/components_strings.xml", + "java/res/values-sr/components_strings.xml", + "java/res/values-sv/components_strings.xml", + "java/res/values-sw/components_strings.xml", + "java/res/values-th/components_strings.xml", + "java/res/values-tl/components_strings.xml", + "java/res/values-tr/components_strings.xml", + "java/res/values-uk/components_strings.xml", + "java/res/values-vi/components_strings.xml", + "java/res/values-zh-rCN/components_strings.xml", + "java/res/values-zh-rTW/components_strings.xml", + "java/res/values/components_strings.xml", + ] +} + +source_set("webview_entry_point") { + deps = [ + ":common", + ] + sources = [ + "lib/main/webview_entry_point.cc", + ] +} + +shared_library("libwebviewchromium") { + deps = [ + ":webview_entry_point", + ] + configs -= [ "//build/config/android:hide_native_jni_exports" ] +} + +if (defined(webview_only_libmonochrome) && webview_only_libmonochrome) { + shared_library("monochrome") { + deps = [ + ":webview_entry_point", + ] + configs -= [ "//build/config/android:hide_native_jni_exports" ] + } +} + +source_set("common") { + sources = [ + "browser/aw_browser_context.cc", + "browser/aw_browser_context.h", + "browser/aw_browser_main_parts.cc", + "browser/aw_browser_main_parts.h", + "browser/aw_browser_permission_request_delegate.h", + "browser/aw_browser_policy_connector.cc", + "browser/aw_browser_policy_connector.h", + "browser/aw_content_browser_client.cc", + "browser/aw_content_browser_client.h", + "browser/aw_contents_client_bridge_base.cc", + "browser/aw_contents_client_bridge_base.h", + "browser/aw_contents_io_thread_client.h", + "browser/aw_cookie_access_policy.cc", + "browser/aw_cookie_access_policy.h", + "browser/aw_dev_tools_discovery_provider.cc", + "browser/aw_dev_tools_discovery_provider.h", + "browser/aw_download_manager_delegate.cc", + "browser/aw_download_manager_delegate.h", + "browser/aw_form_database_service.cc", + "browser/aw_form_database_service.h", + "browser/aw_gl_surface.cc", + "browser/aw_gl_surface.h", + "browser/aw_http_auth_handler_base.cc", + "browser/aw_http_auth_handler_base.h", + "browser/aw_javascript_dialog_manager.cc", + "browser/aw_javascript_dialog_manager.h", + "browser/aw_locale_manager.h", + "browser/aw_login_delegate.cc", + "browser/aw_login_delegate.h", + "browser/aw_message_port_message_filter.cc", + "browser/aw_message_port_message_filter.h", + "browser/aw_message_port_service.h", + "browser/aw_metrics_service_client.cc", + "browser/aw_metrics_service_client.h", + "browser/aw_permission_manager.cc", + "browser/aw_permission_manager.h", + "browser/aw_print_manager.cc", + "browser/aw_print_manager.h", + "browser/aw_printing_message_filter.cc", + "browser/aw_printing_message_filter.h", + "browser/aw_quota_manager_bridge.cc", + "browser/aw_quota_manager_bridge.h", + "browser/aw_quota_permission_context.cc", + "browser/aw_quota_permission_context.h", + "browser/aw_render_thread_context_provider.cc", + "browser/aw_render_thread_context_provider.h", + "browser/aw_resource_context.cc", + "browser/aw_resource_context.h", + "browser/aw_result_codes.h", + "browser/aw_ssl_host_state_delegate.cc", + "browser/aw_ssl_host_state_delegate.h", + "browser/aw_web_preferences_populater.cc", + "browser/aw_web_preferences_populater.h", + "browser/browser_view_renderer.cc", + "browser/browser_view_renderer.h", + "browser/browser_view_renderer_client.h", + "browser/child_frame.cc", + "browser/child_frame.h", + "browser/compositor_id.cc", + "browser/compositor_id.h", + "browser/deferred_gpu_command_service.cc", + "browser/deferred_gpu_command_service.h", + "browser/find_helper.cc", + "browser/find_helper.h", + "browser/gl_view_renderer_manager.cc", + "browser/gl_view_renderer_manager.h", + "browser/hardware_renderer.cc", + "browser/hardware_renderer.h", + "browser/icon_helper.cc", + "browser/icon_helper.h", + "browser/input_stream.h", + "browser/jni_dependency_factory.h", + "browser/net/android_stream_reader_url_request_job.cc", + "browser/net/android_stream_reader_url_request_job.h", + "browser/net/aw_cookie_store_wrapper.cc", + "browser/net/aw_cookie_store_wrapper.h", + "browser/net/aw_http_user_agent_settings.cc", + "browser/net/aw_http_user_agent_settings.h", + "browser/net/aw_network_change_notifier.cc", + "browser/net/aw_network_change_notifier.h", + "browser/net/aw_network_change_notifier_factory.cc", + "browser/net/aw_network_change_notifier_factory.h", + "browser/net/aw_network_delegate.cc", + "browser/net/aw_network_delegate.h", + "browser/net/aw_request_interceptor.cc", + "browser/net/aw_request_interceptor.h", + "browser/net/aw_url_request_context_getter.cc", + "browser/net/aw_url_request_context_getter.h", + "browser/net/aw_url_request_job_factory.cc", + "browser/net/aw_url_request_job_factory.h", + "browser/net/aw_web_resource_response.h", + "browser/net/init_native_callback.h", + "browser/net/input_stream_reader.cc", + "browser/net/input_stream_reader.h", + "browser/net/token_binding_manager.cc", + "browser/net/token_binding_manager.h", + "browser/net_disk_cache_remover.cc", + "browser/net_disk_cache_remover.h", + "browser/parent_compositor_draw_constraints.cc", + "browser/parent_compositor_draw_constraints.h", + "browser/parent_output_surface.cc", + "browser/parent_output_surface.h", + "browser/render_thread_manager.cc", + "browser/render_thread_manager.h", + "browser/renderer_host/aw_render_view_host_ext.cc", + "browser/renderer_host/aw_render_view_host_ext.h", + "browser/renderer_host/aw_resource_dispatcher_host_delegate.cc", + "browser/renderer_host/aw_resource_dispatcher_host_delegate.h", + "browser/scoped_allow_wait_for_legacy_web_view_api.h", + "browser/scoped_app_gl_state_restore.cc", + "browser/scoped_app_gl_state_restore.h", + "browser/surfaces_instance.cc", + "browser/surfaces_instance.h", + "common/android_webview_message_generator.cc", + "common/android_webview_message_generator.h", + "common/aw_content_client.cc", + "common/aw_content_client.h", + "common/aw_descriptors.h", + "common/aw_hit_test_data.cc", + "common/aw_hit_test_data.h", + "common/aw_media_client_android.cc", + "common/aw_media_client_android.h", + "common/aw_message_port_messages.h", + "common/aw_resource.h", + "common/aw_switches.cc", + "common/aw_switches.h", + "common/devtools_instrumentation.h", + "common/render_view_messages.cc", + "common/render_view_messages.h", + "common/url_constants.cc", + "common/url_constants.h", + "crash_reporter/aw_microdump_crash_reporter.cc", + "crash_reporter/aw_microdump_crash_reporter.h", + "gpu/aw_content_gpu_client.cc", + "gpu/aw_content_gpu_client.h", + "lib/aw_browser_dependency_factory_impl.cc", + "lib/aw_browser_dependency_factory_impl.h", + "lib/main/aw_main_delegate.cc", + "lib/main/aw_main_delegate.h", + "lib/main/webview_jni_onload.cc", + "lib/main/webview_jni_onload.h", + "public/browser/draw_gl.h", + "renderer/aw_content_renderer_client.cc", + "renderer/aw_content_renderer_client.h", + "renderer/aw_content_settings_client.cc", + "renderer/aw_content_settings_client.h", + "renderer/aw_key_systems.cc", + "renderer/aw_key_systems.h", + "renderer/aw_message_port_client.cc", + "renderer/aw_message_port_client.h", + "renderer/aw_print_web_view_helper_delegate.cc", + "renderer/aw_print_web_view_helper_delegate.h", + "renderer/aw_render_frame_ext.cc", + "renderer/aw_render_frame_ext.h", + "renderer/aw_render_thread_observer.cc", + "renderer/aw_render_thread_observer.h", + "renderer/aw_render_view_ext.cc", + "renderer/aw_render_view_ext.h", + "renderer/print_render_frame_observer.cc", + "renderer/print_render_frame_observer.h", + ] + + deps = [ + ":generate_aw_resources", + ":generate_aw_strings", + ":generate_components_strings", + "//android_webview/common:version", + "//android_webview/native:native", + "//cc/surfaces", + "//components/auto_login_parser:auto_login_parser", + "//components/autofill/content/renderer", + "//components/cdm/browser", + "//components/cdm/renderer", + "//components/crash/content/app", + "//components/crash/content/browser", + "//components/devtools_discovery", + "//components/metrics", + "//components/metrics:gpu", + "//components/metrics:net", + "//components/metrics:profiler", + "//components/metrics:ui", + "//components/navigation_interception", + "//components/network_session_configurator:switches", + "//components/prefs", + "//components/printing/browser", + "//components/printing/common", + "//components/printing/renderer", + "//components/visitedlink/browser", + "//components/visitedlink/renderer", + "//components/web_contents_delegate_android:web_contents_delegate_android", + "//content", + "//content/public/app:both", + "//content/public/browser", + "//gin", + "//gpu/command_buffer/client:gl_in_process_context", + "//gpu/command_buffer/client:gles2_c_lib", + "//gpu/command_buffer/client:gles2_implementation", + "//gpu/command_buffer/common:gles2_utils", + "//gpu/command_buffer/service", + "//gpu/skia_bindings", + "//media", + "//media/midi", + "//net:extras", + "//printing", + "//skia", + "//third_party/WebKit/public:blink", + "//ui/events:gesture_detection", + "//ui/gl", + "//ui/gl/init", + "//ui/shell_dialogs", + "//v8", + ] + + if (enable_configuration_policy) { + deps += [ + "//components/policy", + "//components/policy:policy_component", + ] + } + + configs += [ "//v8:external_startup_data" ] +} + +android_library("android_webview_java") { + java_files = [ + "java/src/org/chromium/android_webview/AndroidProtocolHandler.java", + "java/src/org/chromium/android_webview/AwAutofillClient.java", + "java/src/org/chromium/android_webview/AwBrowserContext.java", + "java/src/org/chromium/android_webview/AwBrowserProcess.java", + "java/src/org/chromium/android_webview/AwContentViewClient.java", + "java/src/org/chromium/android_webview/AwContents.java", + "java/src/org/chromium/android_webview/AwContentsBackgroundThreadClient.java", + "java/src/org/chromium/android_webview/AwContentsClient.java", + "java/src/org/chromium/android_webview/AwContentsClientBridge.java", + "java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java", + "java/src/org/chromium/android_webview/AwContentsIoThreadClient.java", + "java/src/org/chromium/android_webview/AwContentsLifecycleNotifier.java", + "java/src/org/chromium/android_webview/AwContentsStatics.java", + "java/src/org/chromium/android_webview/AwCookieManager.java", + "java/src/org/chromium/android_webview/AwDebug.java", + "java/src/org/chromium/android_webview/AwDevToolsServer.java", + "java/src/org/chromium/android_webview/AwFormDatabase.java", + "java/src/org/chromium/android_webview/AwGeolocationPermissions.java", + "java/src/org/chromium/android_webview/AwGLFunctor.java", + "java/src/org/chromium/android_webview/AwHttpAuthHandler.java", + "java/src/org/chromium/android_webview/AwLayoutSizer.java", + "java/src/org/chromium/android_webview/AwMessagePort.java", + "java/src/org/chromium/android_webview/AwMessagePortService.java", + "java/src/org/chromium/android_webview/AwMetricsServiceClient.java", + "java/src/org/chromium/android_webview/AwNetworkChangeNotifierRegistrationPolicy.java", + "java/src/org/chromium/android_webview/AwPdfExporter.java", + "java/src/org/chromium/android_webview/AwPicture.java", + "java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java", + "java/src/org/chromium/android_webview/AwQuotaManagerBridge.java", + "java/src/org/chromium/android_webview/AwResource.java", + "java/src/org/chromium/android_webview/AwScrollOffsetManager.java", + "java/src/org/chromium/android_webview/AwServiceWorkerClient.java", + "java/src/org/chromium/android_webview/AwServiceWorkerController.java", + "java/src/org/chromium/android_webview/AwServiceWorkerSettings.java", + "java/src/org/chromium/android_webview/AwSettings.java", + "java/src/org/chromium/android_webview/AwSwitches.java", + "java/src/org/chromium/android_webview/AwTokenBindingManager.java", + "java/src/org/chromium/android_webview/AwViewMethods.java", + "java/src/org/chromium/android_webview/AwWebContentsDelegate.java", + "java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java", + "java/src/org/chromium/android_webview/AwWebContentsObserver.java", + "java/src/org/chromium/android_webview/AwWebResourceResponse.java", + "java/src/org/chromium/android_webview/AwZoomControls.java", + "java/src/org/chromium/android_webview/ClientCertLookupTable.java", + "java/src/org/chromium/android_webview/DefaultVideoPosterRequestHandler.java", + "java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java", + "java/src/org/chromium/android_webview/FullScreenView.java", + "java/src/org/chromium/android_webview/HttpAuthDatabase.java", + "java/src/org/chromium/android_webview/InputStreamUtil.java", + "java/src/org/chromium/android_webview/JavaBrowserViewRendererHelper.java", + "java/src/org/chromium/android_webview/JsPromptResultReceiver.java", + "java/src/org/chromium/android_webview/JsResultHandler.java", + "java/src/org/chromium/android_webview/JsResultReceiver.java", + "java/src/org/chromium/android_webview/NullAwViewMethods.java", + "java/src/org/chromium/android_webview/OverScrollGlow.java", + "java/src/org/chromium/android_webview/PlatformServiceBridge.java", + "java/src/org/chromium/android_webview/PostMessageSender.java", + "java/src/org/chromium/android_webview/ResourcesContextWrapperFactory.java", + "java/src/org/chromium/android_webview/ScrollAccessibilityHelper.java", + "java/src/org/chromium/android_webview/SslUtil.java", + "java/src/org/chromium/android_webview/permission/AwGeolocationCallback.java", + "java/src/org/chromium/android_webview/permission/AwPermissionRequest.java", + "java/src/org/chromium/android_webview/policy/AwPolicyProvider.java", + ] + deps = [ + ":resources", + ":strings_grd", + "//base:base_java", + "//components/external_video_surface:java", + "//components/navigation_interception/android:navigation_interception_java", + "//components/web_contents_delegate_android:web_contents_delegate_android_java", + "//content/public/android:content_java", + "//net/android:net_java", + "//ui/android:ui_java", + ] + + if (enable_configuration_policy) { + deps += [ "//components/policy/android:policy_java" ] + } + + srcjar_deps = [ "//android_webview/native:aw_permission_request_resource" ] +} + +java_strings_grd("strings_grd") { + grd_file = "java/strings/android_webview_strings.grd" + outputs = [ + "values-am/android_webview_strings.xml", + "values-ar/android_webview_strings.xml", + "values-bg/android_webview_strings.xml", + "values-ca/android_webview_strings.xml", + "values-cs/android_webview_strings.xml", + "values-da/android_webview_strings.xml", + "values-de/android_webview_strings.xml", + "values-el/android_webview_strings.xml", + "values-en-rGB/android_webview_strings.xml", + "values-es-rUS/android_webview_strings.xml", + "values-es/android_webview_strings.xml", + "values-fa/android_webview_strings.xml", + "values-fi/android_webview_strings.xml", + "values-fr/android_webview_strings.xml", + "values-hi/android_webview_strings.xml", + "values-hr/android_webview_strings.xml", + "values-hu/android_webview_strings.xml", + "values-in/android_webview_strings.xml", + "values-it/android_webview_strings.xml", + "values-iw/android_webview_strings.xml", + "values-ja/android_webview_strings.xml", + "values-ko/android_webview_strings.xml", + "values-lt/android_webview_strings.xml", + "values-lv/android_webview_strings.xml", + "values-nb/android_webview_strings.xml", + "values-nl/android_webview_strings.xml", + "values-pl/android_webview_strings.xml", + "values-pt-rBR/android_webview_strings.xml", + "values-pt-rPT/android_webview_strings.xml", + "values-ro/android_webview_strings.xml", + "values-ru/android_webview_strings.xml", + "values-sk/android_webview_strings.xml", + "values-sl/android_webview_strings.xml", + "values-sr/android_webview_strings.xml", + "values-sv/android_webview_strings.xml", + "values-sw/android_webview_strings.xml", + "values-th/android_webview_strings.xml", + "values-tl/android_webview_strings.xml", + "values-tr/android_webview_strings.xml", + "values-uk/android_webview_strings.xml", + "values-vi/android_webview_strings.xml", + "values-zh-rCN/android_webview_strings.xml", + "values-zh-rTW/android_webview_strings.xml", + "values/android_webview_strings.xml", + ] +} + +if (!use_webview_internal_framework) { + system_webview_apk_tmpl("system_webview_apk") { + android_manifest = get_target_outputs(":system_webview_manifest") + android_manifest = android_manifest[1] + android_manifest_dep = ":system_webview_manifest" + deps = [ + ":system_webview_resources", + "//android_webview/glue", + ] + apk_name = "SystemWebView" + } +} diff --git a/chromium/android_webview/common/BUILD.gn b/chromium/android_webview/common/BUILD.gn new file mode 100644 index 00000000000..4be51790174 --- /dev/null +++ b/chromium/android_webview/common/BUILD.gn @@ -0,0 +1,10 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//chrome/version.gni") + +process_version("version") { + template_file = "aw_version_info_values.h.version" + output = "$root_gen_dir/android_webview/common/aw_version_info_values.h" +} diff --git a/chromium/android_webview/glue/BUILD.gn b/chromium/android_webview/glue/BUILD.gn new file mode 100644 index 00000000000..65646186d4c --- /dev/null +++ b/chromium/android_webview/glue/BUILD.gn @@ -0,0 +1,77 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") +import("generate_resource_rewriter.gni") +import("glue.gni") + +# There are two copies of this file: one upstream and one downstream, +# all targets defined in this file will finally generate two targets. +# is_upstream could be used to differentiate those two targets, see +# 'glue' target for details. +is_upstream = rebase_path(".", "//android_webview/glue") == "." + +webview_framework_ijar = "frameworks.interface.jar" +webview_public_framework_ijar = "frameworks.public.interface.jar" + +# Mark webview_framework_ijar is used, otherwise it isn't used if there +# is no internal code. +assert(webview_framework_ijar != "") + +if (defined(webview_internal_framework_jar)) { + generate_interface_jar("framework_ijar") { + input_jar = webview_internal_framework_jar + output_jar = "$target_out_dir/$webview_framework_ijar" + } +} + +generate_interface_jar("public_framework_ijar") { + input_jar = webview_public_framework_jar + output_jar = "$target_out_dir/$webview_public_framework_ijar" +} + +generate_resource_rewriter("glue_resource_rewriter") { + # Change deps? please modify glue_library_deps variable. + deps = glue_library_deps + package_name = "com.android.webview.chromium" +} + +android_library("glue") { + # Change deps? please modify glue_library_deps variable. + deps = glue_library_deps + srcjar_deps = [ ":glue_resource_rewriter" ] + + # Always build upstream or downstream target with public or internal + # framework jar respectively. + if (is_upstream) { + alternative_android_sdk_ijar_dep = ":public_framework_ijar" + _ijar = webview_public_framework_ijar + } else { + assert(defined(webview_internal_framework_jar)) + alternative_android_sdk_ijar_dep = ":framework_ijar" + _ijar = webview_framework_ijar + } + _ijar_dir = get_label_info(alternative_android_sdk_ijar_dep, "target_out_dir") + alternative_android_sdk_ijar = "$_ijar_dir/$_ijar" + java_files = [ + "java/src/com/android/webview/chromium/ContentSettingsAdapter.java", + "java/src/com/android/webview/chromium/CookieManagerAdapter.java", + "java/src/com/android/webview/chromium/DrawGLFunctor.java", + "java/src/com/android/webview/chromium/GeolocationPermissionsAdapter.java", + "java/src/com/android/webview/chromium/GraphicsUtils.java", + "java/src/com/android/webview/chromium/LicenseActivity.java", + "java/src/com/android/webview/chromium/LicenseContentProvider.java", + "java/src/com/android/webview/chromium/WebBackForwardListChromium.java", + "java/src/com/android/webview/chromium/WebHistoryItemChromium.java", + "java/src/com/android/webview/chromium/WebIconDatabaseAdapter.java", + "java/src/com/android/webview/chromium/WebMessagePortAdapter.java", + "java/src/com/android/webview/chromium/WebStorageAdapter.java", + "java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java", + "java/src/com/android/webview/chromium/WebViewChromium.java", + "java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java", + "java/src/com/android/webview/chromium/WebViewDatabaseAdapter.java", + "java/src/com/android/webview/chromium/WebViewDelegateFactory.java", + ] +} diff --git a/chromium/android_webview/glue/generate_resource_rewriter.gni b/chromium/android_webview/glue/generate_resource_rewriter.gni new file mode 100644 index 00000000000..59581df2e52 --- /dev/null +++ b/chromium/android_webview/glue/generate_resource_rewriter.gni @@ -0,0 +1,55 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +# Generate ResourceRewriter.java from Android Libraries according the dep +# graph. +# Argument: +# deps +# The same deps of target that uses the generated ResourceRewriter. +# package_name +# The package name of ResourceRewriter.java. +# +# This target generates a single srcjar containing generated +# ResourceRewrite.java which will list the R classes generated by all the +# Android libraries reachabled from the target specified in deps. Add this +# target to srcjar_deps of android_library will call ResourceRewriter. +# +template("generate_resource_rewriter") { + set_sources_assignment_filter([]) + assert(defined(invoker.package_name)) + + _final_target_name = target_name + _build_config = "$target_gen_dir/${target_name}.build_config" + _build_config_target_name = "${target_name}__build_config" + _srcjar = "$target_gen_dir/${target_name}.srcjar" + write_build_config(_build_config_target_name) { + possible_config_deps = invoker.deps + type = "resource_rewriter" + build_config = _build_config + } + + action(_final_target_name) { + forward_variables_from(invoker, [ "visibility" ]) + inputs = [ + _build_config, + ] + deps = invoker.deps + [ ":${_build_config_target_name}" ] + script = "//build/android/gyp/generate_resource_rewriter.py" + + _rebased_build_config = rebase_path(_build_config) + args = [ + "--package-name", + invoker.package_name, + "--dep-packages", + "@FileArg($_rebased_build_config:resources:extra_package_names)", + "--srcjar", + rebase_path(_srcjar), + ] + outputs = [ + _srcjar, + ] + } +} diff --git a/chromium/android_webview/glue/glue.gni b/chromium/android_webview/glue/glue.gni new file mode 100644 index 00000000000..e3f044c4725 --- /dev/null +++ b/chromium/android_webview/glue/glue.gni @@ -0,0 +1,13 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This variable shared between 'glue' and 'glue_resource_rewriter' because +# ResourceRewrite.java need to be generated according 'glue' deps. +glue_library_deps = [ + "//android_webview:android_webview_java", + "//base:base_java", + "//content/public/android:content_java", + "//net/android:net_java", + "//ui/android:ui_java", +] diff --git a/chromium/android_webview/native/BUILD.gn b/chromium/android_webview/native/BUILD.gn new file mode 100644 index 00000000000..be0570407c5 --- /dev/null +++ b/chromium/android_webview/native/BUILD.gn @@ -0,0 +1,171 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +source_set("native") { + deps = [ + ":native_jni", + "//android_webview/common:version", + "//base", + "//base/third_party/dynamic_annotations:dynamic_annotations", + "//cc:cc", + "//components/autofill/content/browser:browser", + "//components/devtools_http_handler:devtools_http_handler", + "//components/strings", + "//components/web_contents_delegate_android:web_contents_delegate_android", + "//content/public/common", + "//device/battery:mojo_bindings", + "//media/base/android:android", + "//net", + "//skia", + "//storage/browser", + "//storage/common", + "//third_party/boringssl", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry:geometry", + ] + + include_dirs = [ + "//skia/config", + "//third_party/protobuf", + ] + + sources = [ + "android_protocol_handler.cc", + "android_protocol_handler.h", + "android_webview_jni_registrar.cc", + "android_webview_jni_registrar.h", + "aw_autofill_client.cc", + "aw_autofill_client.h", + "aw_browser_dependency_factory.cc", + "aw_browser_dependency_factory.h", + "aw_contents.cc", + "aw_contents.h", + "aw_contents_background_thread_client.cc", + "aw_contents_background_thread_client.h", + "aw_contents_client_bridge.cc", + "aw_contents_client_bridge.h", + "aw_contents_io_thread_client_impl.cc", + "aw_contents_io_thread_client_impl.h", + "aw_contents_lifecycle_notifier.cc", + "aw_contents_lifecycle_notifier.h", + "aw_contents_statics.cc", + "aw_contents_statics.h", + "aw_debug.cc", + "aw_debug.h", + "aw_dev_tools_server.cc", + "aw_dev_tools_server.h", + "aw_form_database.cc", + "aw_form_database.h", + "aw_gl_functor.cc", + "aw_gl_functor.h", + "aw_http_auth_handler.cc", + "aw_http_auth_handler.h", + "aw_locale_manager_impl.cc", + "aw_locale_manager_impl.h", + "aw_media_url_interceptor.cc", + "aw_media_url_interceptor.h", + "aw_message_port_service_impl.cc", + "aw_message_port_service_impl.h", + "aw_metrics_switch.cc", + "aw_metrics_switch.h", + "aw_pdf_exporter.cc", + "aw_pdf_exporter.h", + "aw_picture.cc", + "aw_picture.h", + "aw_quota_manager_bridge_impl.cc", + "aw_quota_manager_bridge_impl.h", + "aw_resource.cc", + "aw_resource.h", + "aw_settings.cc", + "aw_settings.h", + "aw_web_contents_delegate.cc", + "aw_web_contents_delegate.h", + "aw_web_contents_view_delegate.cc", + "aw_web_contents_view_delegate.h", + "aw_web_preferences_populater_impl.cc", + "aw_web_preferences_populater_impl.h", + "aw_web_resource_response_impl.cc", + "aw_web_resource_response_impl.h", + "cookie_manager.cc", + "cookie_manager.h", + "input_stream_impl.cc", + "input_stream_impl.h", + "java_browser_view_renderer_helper.cc", + "java_browser_view_renderer_helper.h", + "net_init_native_callback.cc", + "permission/aw_permission_request.cc", + "permission/aw_permission_request.h", + "permission/aw_permission_request_delegate.cc", + "permission/aw_permission_request_delegate.h", + "permission/media_access_permission_request.cc", + "permission/media_access_permission_request.h", + "permission/permission_request_handler.cc", + "permission/permission_request_handler.h", + "permission/permission_request_handler_client.cc", + "permission/permission_request_handler_client.h", + "permission/simple_permission_request.cc", + "permission/simple_permission_request.h", + "state_serializer.cc", + "state_serializer.h", + "token_binding_manager_bridge.cc", + "token_binding_manager_bridge.h", + ] + if (enable_video_hole) { + deps += [ "//components/external_video_surface:external_video_surface" ] + } + + libs = [ "jnigraphics" ] +} + +generate_jni("native_jni") { + sources = [ + "../java/src/org/chromium/android_webview/AndroidProtocolHandler.java", + "../java/src/org/chromium/android_webview/AwAutofillClient.java", + "../java/src/org/chromium/android_webview/AwContents.java", + "../java/src/org/chromium/android_webview/AwContentsBackgroundThreadClient.java", + "../java/src/org/chromium/android_webview/AwContentsClientBridge.java", + "../java/src/org/chromium/android_webview/AwContentsIoThreadClient.java", + "../java/src/org/chromium/android_webview/AwContentsLifecycleNotifier.java", + "../java/src/org/chromium/android_webview/AwContentsStatics.java", + "../java/src/org/chromium/android_webview/AwCookieManager.java", + "../java/src/org/chromium/android_webview/AwDebug.java", + "../java/src/org/chromium/android_webview/AwDevToolsServer.java", + "../java/src/org/chromium/android_webview/AwFormDatabase.java", + "../java/src/org/chromium/android_webview/AwGLFunctor.java", + "../java/src/org/chromium/android_webview/AwHttpAuthHandler.java", + "../java/src/org/chromium/android_webview/AwMessagePortService.java", + "../java/src/org/chromium/android_webview/AwMetricsServiceClient.java", + "../java/src/org/chromium/android_webview/AwPdfExporter.java", + "../java/src/org/chromium/android_webview/AwPicture.java", + "../java/src/org/chromium/android_webview/AwQuotaManagerBridge.java", + "../java/src/org/chromium/android_webview/AwResource.java", + "../java/src/org/chromium/android_webview/AwSettings.java", + "../java/src/org/chromium/android_webview/AwTokenBindingManager.java", + "../java/src/org/chromium/android_webview/AwWebContentsDelegate.java", + "../java/src/org/chromium/android_webview/AwWebResourceResponse.java", + "../java/src/org/chromium/android_webview/InputStreamUtil.java", + "../java/src/org/chromium/android_webview/JavaBrowserViewRendererHelper.java", + "../java/src/org/chromium/android_webview/permission/AwPermissionRequest.java", + ] + jni_package = "android_webview" + + deps = [ + ":cancellation_signal_android_jar_jni_headers", + ] +} + +generate_jar_jni("cancellation_signal_android_jar_jni_headers") { + classes = [ "android/os/CancellationSignal.class" ] + jni_package = "android_webview" +} + +java_cpp_enum("aw_permission_request_resource") { + sources = [ + "permission/aw_permission_request.h", + ] +} diff --git a/chromium/android_webview/system_webview_apk_tmpl.gni b/chromium/android_webview/system_webview_apk_tmpl.gni new file mode 100644 index 00000000000..b3d5d84e649 --- /dev/null +++ b/chromium/android_webview/system_webview_apk_tmpl.gni @@ -0,0 +1,34 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +template("system_webview_apk_tmpl") { + android_apk(target_name) { + forward_variables_from(invoker, "*") + + deps += [ + "//android_webview:assets", + "//base:base_java", + ] + + if (!defined(alternative_android_sdk_jar)) { + alternative_android_sdk_jar = webview_framework_jar + } + + shared_resources = true + shared_libraries = [ "//android_webview:libwebviewchromium" ] + native_lib_version_rule = "//build/util:chrome_version_json" + _native_lib_file = + rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir) + native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)" + extensions_to_not_compress = ".lpak,.pak,.bin,.dat" + + if (!is_java_debug) { + proguard_enabled = true + proguard_configs = [ "//android_webview/apk/java/proguard.flags" ] + } + } +} diff --git a/chromium/android_webview/test/BUILD.gn b/chromium/android_webview/test/BUILD.gn new file mode 100644 index 00000000000..0744657a860 --- /dev/null +++ b/chromium/android_webview/test/BUILD.gn @@ -0,0 +1,284 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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("//testing/test.gni") + +# Mark all targets as test only. +testonly = true + +group("test") { + deps = [ + ":android_webview_test_apk", + ":android_webview_unittests", + ] +} + +# GYP: //android_webview/android_webview_tests.gypi:android_webview_apk +android_apk("android_webview_apk") { + deps = [ + ":android_webview_apk_assets", + ":android_webview_apk_resources", + "//android_webview:android_webview_java", + "//base:base_java", + "//base:base_java_test_support", + "//components/policy/android:policy_java_test_support", + "//content/public/android:content_java", + "//ui/android:ui_java", + ] + + apk_name = "AndroidWebView" + android_manifest = "shell/AndroidManifest.xml" + java_files = [ + "shell/src/org/chromium/android_webview/shell/AwShellActivity.java", + "shell/src/org/chromium/android_webview/shell/AwShellApplication.java", + "shell/src/org/chromium/android_webview/shell/AwShellResourceProvider.java", + "shell/src/org/chromium/android_webview/shell/AwShellSwitches.java", + "shell/src/org/chromium/android_webview/shell/DrawGL.java", + "shell/src/org/chromium/android_webview/test/AwInstrumentationTestRunner.java", + "shell/src/org/chromium/android_webview/test/AwTestContainerView.java", + "shell/src/org/chromium/android_webview/test/AwTestRunnerActivity.java", + "shell/src/org/chromium/android_webview/test/NullContentsClient.java", + "shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java", + "shell/src/org/chromium/android_webview/test/TestContentProvider.java", + ] + shared_libraries = [ + ":libdrawgl", + ":libstandalonelibwebviewchromium", + ] + + native_lib_version_rule = "//build/util:chrome_version_json" + _native_lib_file = + rebase_path("$root_gen_dir/CHROME_VERSION.json", root_build_dir) + native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)" + + extensions_to_not_compress = ".dat,.bin,.pak,.lpak" +} + +android_resources("android_webview_apk_resources") { + resource_dirs = [ "shell/res" ] + custom_package = "org.chromium.android_webview.shell" +} + +android_assets("android_webview_apk_assets") { + deps = [ + "//android_webview:pak_file_assets", + "//third_party/icu:icu_assets", + "//v8:v8_external_startup_data_assets", + ] + sources = [ + "shell/assets/asset_file.html", + "shell/assets/asset_icon.png", + "shell/assets/cookie_test.html", + "shell/assets/full_screen_video.js", + "shell/assets/full_screen_video_inside_div_test.html", + "shell/assets/full_screen_video_test.html", + "shell/assets/multiple_videos_test.html", + "shell/assets/platform-media-codec-test.html", + "shell/assets/video.3gp", + "shell/assets/video.webm", + "shell/assets/visual_state_during_fullscreen_test.html", + "shell/assets/visual_state_on_page_commit_visible_test.html", + "shell/assets/visual_state_waits_for_js_detached_test.html", + "shell/assets/visual_state_waits_for_js_test.html", + ] +} + +# GYP: //android_webview/android_webview_tests.gypi:libstandalonelibwebviewchromium +shared_library("libstandalonelibwebviewchromium") { + sources = [ + "../lib/main/webview_entry_point.cc", + ] + ldflags = [ "-Wl,-shared,-Bsymbolic" ] + deps = [ + "//android_webview:common", + ] + configs -= [ "//build/config/android:hide_native_jni_exports" ] +} + +# GYP: //android_webview/android_webview_tests.gypi:android_webview_test_apk +instrumentation_test_apk("android_webview_test_apk") { + apk_name = "AndroidWebViewTest" + apk_under_test = ":android_webview_apk" + android_manifest = "../javatests/AndroidManifest.xml" + deps = [ + "//android_webview:android_webview_java", + "//base:base_java", + "//base:base_java_test_support", + "//components/external_video_surface:java", + "//components/policy/android:policy_java", + "//components/policy/android:policy_java_test_support", + "//components/web_contents_delegate_android:web_contents_delegate_android_java", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//net/android:net_java", + "//net/android:net_java_test_support", + "//third_party/android_tools:legacy_http_javalib", + "//ui/android:ui_java", + ] + java_files = [ + "../javatests/src/org/chromium/android_webview/test/AcceptLanguageTest.java", + "../javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java", + "../javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java", + "../javatests/src/org/chromium/android_webview/test/ArchiveTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientCallbackHelperTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientFaviconTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientGetDefaultVideoPosterTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientGetVideoLoadingProgressViewTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientOnFormResubmissionTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientOnScaleChangedTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsLifecycleNotifierTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsStaticsTest.java", + "../javatests/src/org/chromium/android_webview/test/AwContentsTest.java", + "../javatests/src/org/chromium/android_webview/test/AwDebugTest.java", + "../javatests/src/org/chromium/android_webview/test/AwImeTest.java", + "../javatests/src/org/chromium/android_webview/test/AwJavaBridgeTest.java", + "../javatests/src/org/chromium/android_webview/test/AwLayoutSizerTest.java", + "../javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java", + "../javatests/src/org/chromium/android_webview/test/AwPermissionManagerTest.java", + "../javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java", + "../javatests/src/org/chromium/android_webview/test/AwScrollOffsetManagerTest.java", + "../javatests/src/org/chromium/android_webview/test/AwSecondBrowserProcessTest.java", + "../javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java", + "../javatests/src/org/chromium/android_webview/test/AwSettingsTest.java", + "../javatests/src/org/chromium/android_webview/test/AwTestBase.java", + "../javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java", + "../javatests/src/org/chromium/android_webview/test/AwZoomTest.java", + "../javatests/src/org/chromium/android_webview/test/ClearHistoryTest.java", + "../javatests/src/org/chromium/android_webview/test/ClientAddMessageToConsoleTest.java", + "../javatests/src/org/chromium/android_webview/test/ClientOnPageFinishedTest.java", + "../javatests/src/org/chromium/android_webview/test/ClientOnPageStartedTest.java", + "../javatests/src/org/chromium/android_webview/test/ClientOnReceivedError2Test.java", + "../javatests/src/org/chromium/android_webview/test/ClientOnReceivedErrorTest.java", + "../javatests/src/org/chromium/android_webview/test/ClientOnReceivedHttpErrorTest.java", + "../javatests/src/org/chromium/android_webview/test/ConsoleMessagesForBlockedLoadsTest.java", + "../javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java", + "../javatests/src/org/chromium/android_webview/test/CookieManagerStartupTest.java", + "../javatests/src/org/chromium/android_webview/test/CookieManagerTest.java", + "../javatests/src/org/chromium/android_webview/test/DisableHardwareAccelerationForTest.java", + "../javatests/src/org/chromium/android_webview/test/ExternalVideoSurfaceContainerTest.java", + "../javatests/src/org/chromium/android_webview/test/FullScreenVideoTestAwContentsClient.java", + "../javatests/src/org/chromium/android_webview/test/GeolocationTest.java", + "../javatests/src/org/chromium/android_webview/test/GetTitleTest.java", + "../javatests/src/org/chromium/android_webview/test/HttpAuthDatabaseTest.java", + "../javatests/src/org/chromium/android_webview/test/HttpCacheTest.java", + "../javatests/src/org/chromium/android_webview/test/KeySystemTest.java", + "../javatests/src/org/chromium/android_webview/test/LoadDataWithBaseUrlTest.java", + "../javatests/src/org/chromium/android_webview/test/LoadUrlTest.java", + "../javatests/src/org/chromium/android_webview/test/MediaAccessPermissionRequestTest.java", + "../javatests/src/org/chromium/android_webview/test/MultipleVideosTest.java", + "../javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java", + "../javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java", + "../javatests/src/org/chromium/android_webview/test/PolicyUrlFilteringTest.java", + "../javatests/src/org/chromium/android_webview/test/PopupWindowTest.java", + "../javatests/src/org/chromium/android_webview/test/PostMessageTest.java", + "../javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java", + "../javatests/src/org/chromium/android_webview/test/StandaloneAwQuotaManagerBridgeTest.java", + "../javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java", + "../javatests/src/org/chromium/android_webview/test/TestAwServiceWorkerClient.java", + "../javatests/src/org/chromium/android_webview/test/UserAgentTest.java", + "../javatests/src/org/chromium/android_webview/test/VisualStateTest.java", + "../javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java", + "../javatests/src/org/chromium/android_webview/test/WebViewAsynchronousFindApisTest.java", + "../javatests/src/org/chromium/android_webview/test/WebViewFindApisTestBase.java", + "../javatests/src/org/chromium/android_webview/test/WebViewModalDialogOverrideTest.java", + "../javatests/src/org/chromium/android_webview/test/util/AwQuotaManagerBridgeTestUtil.java", + "../javatests/src/org/chromium/android_webview/test/util/AwTestTouchUtils.java", + "../javatests/src/org/chromium/android_webview/test/util/CommonResources.java", + "../javatests/src/org/chromium/android_webview/test/util/CookieUtils.java", + "../javatests/src/org/chromium/android_webview/test/util/GraphicsTestUtils.java", + "../javatests/src/org/chromium/android_webview/test/util/ImagePageGenerator.java", + "../javatests/src/org/chromium/android_webview/test/util/JSUtils.java", + "../javatests/src/org/chromium/android_webview/test/util/JavascriptEventObserver.java", + "../javatests/src/org/chromium/android_webview/test/util/VideoSurfaceViewUtils.java", + "../javatests/src/org/chromium/android_webview/test/util/VideoTestUtil.java", + "../javatests/src/org/chromium/android_webview/test/util/VideoTestWebServer.java", + ] + isolate_file = "../android_webview_test_data.isolate" + additional_apks = [ "//net/android:net_test_support_apk" ] +} + +# GYP: //android_webview/android_webview_tests.gypi:android_webview_unittests +test("android_webview_unittests") { + # Tests do not require any data, but our dependencies pull a lot in. + ignore_all_data_deps = true + + deps = [ + ":android_webview_unittests_assets", + ":android_webview_unittests_java", + ":android_webview_unittests_jni", + "//android_webview:common", + "//base/test:test_support", + "//content/test:test_support", + "//net:test_support", + "//ui/base:ui_base_jni_headers", + "//ui/gl", + "//ui/gl:test_support", + ] + + sources = [ + "../browser/aw_form_database_service_unittest.cc", + "../browser/aw_static_cookie_policy_unittest.cc", + "../browser/browser_view_renderer_unittest.cc", + "../browser/net/android_stream_reader_url_request_job_unittest.cc", + "../browser/net/aw_cookie_store_wrapper_unittest.cc", + "../browser/net/input_stream_reader_unittest.cc", + "../browser/test/fake_window.cc", + "../browser/test/fake_window.h", + "../browser/test/rendering_test.cc", + "../browser/test/rendering_test.h", + "../lib/main/webview_tests.cc", + "../native/aw_contents_client_bridge_unittest.cc", + "../native/aw_media_url_interceptor_unittest.cc", + "../native/input_stream_unittest.cc", + "../native/permission/media_access_permission_request_unittest.cc", + "../native/permission/permission_request_handler_unittest.cc", + "../native/state_serializer_unittest.cc", + ] +} + +android_assets("android_webview_unittests_assets") { + sources = [ + "unittest/assets/asset_file.ogg", + ] +} + +# GYP: //android_webview/android_webview_tests.gypi:android_webview_unittests_java +android_library("android_webview_unittests_java") { + testonly = true + deps = [ + "//android_webview:android_webview_java", + "//base:base_java", + "//base:base_java_test_support", + "//content/public/test/android:content_java_test_support", + ] + java_files = [ + "../unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java", + "../unittestjava/src/org/chromium/android_webview/unittest/MockAwContentsClientBridge.java", + ] +} + +# GYP: //android_webview/android_webview_tests.gypi:android_webview_unittests_jni +generate_jni("android_webview_unittests_jni") { + jni_package = "android_webview_unittests" + sources = [ + "../unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java", + "../unittestjava/src/org/chromium/android_webview/unittest/MockAwContentsClientBridge.java", + ] +} + +# GYP: //android_webview/android_webview_tests.gypi:libdrawgl +shared_library("libdrawgl") { + sources = [ + "shell/src/draw_gl/draw_gl.cc", + ] + configs -= [ "//build/config/android:hide_native_jni_exports" ] +} diff --git a/chromium/android_webview/tools/system_webview_shell/BUILD.gn b/chromium/android_webview/tools/system_webview_shell/BUILD.gn new file mode 100644 index 00000000000..16ecb86a164 --- /dev/null +++ b/chromium/android_webview/tools/system_webview_shell/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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("//testing/test.gni") + +# Mark all targets as test only. +testonly = true + +group("system_webview_shell") { + deps = [ + ":system_webview_shell_apk", + ":system_webview_shell_layout_test_apk", + ":system_webview_shell_page_cycler_apk", + ] +} + +# GYP: //android_webview/android_webview_shell.gypi:system_webview_shell_apk +android_apk("system_webview_shell_apk") { + apk_name = "SystemWebViewShell" + java_files = [ + "apk/src/org/chromium/webview_shell/JankActivity.java", + "apk/src/org/chromium/webview_shell/PageCyclerTestActivity.java", + "apk/src/org/chromium/webview_shell/StartupTimeActivity.java", + "apk/src/org/chromium/webview_shell/TelemetryActivity.java", + "apk/src/org/chromium/webview_shell/TelemetryMemoryPressureActivity.java", + "apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java", + "apk/src/org/chromium/webview_shell/WebViewLayoutTestActivity.java", + "apk/src/org/chromium/webview_shell/WebViewThreadTestActivity.java", + ] + android_manifest = "apk/AndroidManifest.xml" + deps = [ + ":system_webview_shell_apk_resources", + "//base:base_java", + ] +} + +android_resources("system_webview_shell_apk_resources") { + resource_dirs = [ "apk/res" ] + custom_package = "org.chromium.webview_shell" +} + +# GYP: //android_webview/android_webview_shell.gypi:system_webview_shell_page_cycler_apk +instrumentation_test_apk("system_webview_shell_page_cycler_apk") { + apk_name = "SystemWebViewShellPageCycler" + apk_under_test = ":system_webview_shell_apk" + android_manifest = "page_cycler/AndroidManifest.xml" + java_files = [ + "page_cycler/src/org/chromium/webview_shell/page_cycler/PageCyclerTest.java", + "page_cycler/src/org/chromium/webview_shell/page_cycler/WebViewPageCyclerTestRunner.java", + ] + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//testing/android/reporter:reporter_java", + ] +} + +# GYP: //android_webview/android_webview_shell.gypi:system_webview_shell_layout_test_apk +instrumentation_test_apk("system_webview_shell_layout_test_apk") { + apk_name = "SystemWebViewShellLayoutTest" + apk_under_test = ":system_webview_shell_apk" + android_manifest = "layout_tests/AndroidManifest.xml" + java_files = [ + "layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java", + "layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTestRunner.java", + "layout_tests/src/org/chromium/webview_shell/test/WebViewThreadTest.java", + ] + isolate_file = "../../system_webview_shell_test_apk.isolate" + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//testing/android/reporter:reporter_java", + ] +} diff --git a/chromium/android_webview/webview_repack_locales.gni b/chromium/android_webview/webview_repack_locales.gni new file mode 100644 index 00000000000..c739c122b07 --- /dev/null +++ b/chromium/android_webview/webview_repack_locales.gni @@ -0,0 +1,102 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# This is a copy of src/chrome/chrome_repack_locales.gni with the necessary +# modifications to meet WebView's requirement. + +import("//build/config/chrome_build.gni") +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//tools/grit/repack.gni") + +# Arguments: +# +# locale +# Internal name of locale. e.g. "pt-BR" +# +# output +# Output file name. +# +# visibility +# Normal meaning. +template("_repack_one_locale") { + locale = invoker.locale + + repack(target_name) { + visibility = invoker.visibility + + # Each input pak file should also have a deps line for completeness. + sources = [ + "${root_gen_dir}/android_webview/aw_strings_${locale}.pak", + "${root_gen_dir}/android_webview/components_strings_${locale}.pak", + "${root_gen_dir}/content/app/strings/content_strings_${locale}.pak", + ] + deps = [ + "//android_webview:generate_aw_strings", + "//android_webview:generate_components_strings", + "//content/app/strings", + ] + output = invoker.output + } +} + +# Creates an action to call the repack_locales script. +# +# The GYP version generates the locales in the "gen" directory and then copies +# it to the root build directory. This isn't easy to express in a GN copy +# rule since the files on Mac have a complex structure. So we generate the +# files into the final place and skip the "gen" directory. +# +# This template uses GN's looping constructs to avoid the complex call to +# chrome/tools/build/repack_locales.py which wraps the repack commands in the +# GYP build. +# +# Arguments +# +# input_locales +# List of locale names to use as inputs. +# +# output_locales +# A list containing the corresponding output names for each of the +# input names. +# +# visibility +template("webview_repack_locales") { + # This is the name of the group below that will collect all the invidual + # locale targets. External targets will depend on this. + group_target_name = target_name + + # GN's subscript is too stupid to do invoker.output_locales[foo] so we need + # to make a copy and do output_locales[foo]. + output_locales = invoker.output_locales + + # Collects all targets the loop generates. + locale_targets = [] + + # This loop iterates over the input locales and also keeps a counter so it + # can simultaneously iterate over the output locales (using GN's very + # limited looping capabilities). + current_index = 0 + foreach(input_locale, invoker.input_locales) { + output_locale = output_locales[current_index] + + # Compute the name of the target for the current file. Save it for the deps. + current_name = "${target_name}_${input_locale}" + locale_targets += [ ":$current_name" ] + + _repack_one_locale(current_name) { + visibility = [ ":$group_target_name" ] + locale = input_locale + output = "${root_out_dir}/android_webview/locales/${output_locale}.pak" + } + + current_index = current_index + 1 + } + + # The group that external targets depend on which collects all deps. + group(group_target_name) { + forward_variables_from(invoker, [ "visibility" ]) + public_deps = locale_targets + } +} diff --git a/chromium/apps/BUILD.gn b/chromium/apps/BUILD.gn new file mode 100644 index 00000000000..a024fc15d2a --- /dev/null +++ b/chromium/apps/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") + +assert(!is_android && !is_ios) + +static_library("apps") { + sources = [ + "app_lifetime_monitor.cc", + "app_lifetime_monitor.h", + "app_lifetime_monitor_factory.cc", + "app_lifetime_monitor_factory.h", + "app_load_service.cc", + "app_load_service.h", + "app_load_service_factory.cc", + "app_load_service_factory.h", + "app_restore_service.cc", + "app_restore_service.h", + "app_restore_service_factory.cc", + "app_restore_service_factory.h", + "browser_context_keyed_service_factories.cc", + "browser_context_keyed_service_factories.h", + "custom_launcher_page_contents.cc", + "custom_launcher_page_contents.h", + "launcher.cc", + "launcher.h", + "metrics_names.h", + "saved_files_service.cc", + "saved_files_service.h", + "saved_files_service_factory.cc", + "saved_files_service_factory.h", + "switches.cc", + "switches.h", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//chrome/app/theme:theme_resources", + "//chrome/browser/extensions", + "//chrome/common/extensions/api:api", + "//components/web_modal", + "//skia", + ] + + if (is_chromeos) { + #deps += [ "browser_chromeos" ] TODO(GYP) + } + + if (!enable_extensions) { + # When extensions are disabled, only the sizer file below is included. + deps -= [ + "//chrome/browser/extensions", + "//chrome/common/extensions/api:api", + ] + sources = [] + } + + if (toolkit_views) { + sources += [ + "ui/views/app_window_frame_view.cc", + "ui/views/app_window_frame_view.h", + ] + deps += [ + "//ui/strings", + "//ui/views", + ] + if (enable_extensions) { + deps += [ "//extensions/browser" ] + } + } + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] +} diff --git a/chromium/ash/BUILD.gn b/chromium/ash/BUILD.gn new file mode 100644 index 00000000000..06507f24c5c --- /dev/null +++ b/chromium/ash/BUILD.gn @@ -0,0 +1,490 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//testing/test.gni") +import("//ui/base/ui_features.gni") + +assert(use_aura) +assert(enable_hidpi) + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("ash.gyp") ], + "scope", + [ "ash.gyp" ]) + +component("ash") { + sources = gypi_values.ash_sources + + configs += [ "//build/config:precompiled_headers" ] + defines = [ "ASH_IMPLEMENTATION" ] + + public_deps = [ + "//ash/resources", + "//ash/strings", + ] + deps = [ + "//base", + "//base:i18n", + "//base/third_party/dynamic_annotations", + "//cc", + "//components/device_event_log", + "//components/onc", + "//components/signin/core/account_id", + "//components/user_manager", + "//components/wallpaper", + "//media", + "//net", + "//skia", + "//third_party/icu", + "//ui/accessibility", + "//ui/app_list/presenter", + "//ui/aura", + "//ui/base", + "//ui/base:ui_data_pack", + "//ui/base/ime", + "//ui/compositor", + "//ui/display", + "//ui/display/types", + "//ui/events", + "//ui/events:events_base", + "//ui/events:gesture_detection", + "//ui/events/devices", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/keyboard", + "//ui/message_center", + "//ui/native_theme", + "//ui/platform_window", + "//ui/platform_window/stub", + "//ui/resources", + "//ui/strings", + "//ui/views", + "//ui/wm", + "//url", + ] + + if (is_win) { + sources -= [ + "sticky_keys/sticky_keys_controller.cc", + "sticky_keys/sticky_keys_controller.h", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + } + + if (use_x11) { + configs += [ + "//build/config/linux:x11", + "//build/config/linux:xfixes", + ] + deps += [ + "//ui/events/devices/x11", + "//ui/events/platform", + "//ui/gfx/x", + ] + } else { + sources -= [ + "host/ash_window_tree_host_x11.cc", + "host/ash_window_tree_host_x11.h", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h", + ] + } + + if (use_ozone) { + deps += [ + "//ui/events:dom_keycode_converter", + "//ui/events/ozone:events_ozone", + "//ui/ozone", + ] + } + + if (is_chromeos) { + deps += [ + "//chromeos", + "//chromeos:power_manager_proto", + "//components/quirks", + "//device/bluetooth", + + # TODO(msw): Remove this; only ash_with_content should depend on webkit. + "//third_party/WebKit/public:blink_headers", + "//third_party/qcms", + "//ui/chromeos:ui_chromeos", + "//ui/chromeos/resources", + "//ui/chromeos/strings", + "//ui/display/util", + ] + + data = [ + "display/test_data/", + ] + } else { + sources -= [ + "accelerators/key_hold_detector.cc", + "accelerators/key_hold_detector.h", + "accelerators/magnifier_key_scroller.cc", + "accelerators/magnifier_key_scroller.h", + "accelerators/spoken_feedback_toggler.cc", + "accelerators/spoken_feedback_toggler.h", + "display/resolution_notification_controller.cc", + "display/resolution_notification_controller.h", + "touch/touch_transformer_controller.cc", + "touch/touch_transformer_controller.h", + "touch/touchscreen_util.cc", + "touch/touchscreen_util.h", + "virtual_keyboard_controller.cc", + "virtual_keyboard_controller.h", + ] + } + + if (!use_ozone) { + sources -= [ + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc", + "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h", + ] + } +} + +component("ash_with_content") { + sources = gypi_values.ash_with_content_sources + + defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ] + + public_deps = [ + ":ash", + ] + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//content/public/browser", + "//gpu/config", + "//ipc", + "//skia", + "//ui/aura", + "//ui/base", + "//ui/compositor", + "//ui/events", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/keyboard:keyboard_with_content", + "//ui/resources", + "//ui/strings", + "//ui/views", + "//ui/views/controls/webview", + "//ui/web_dialogs", + "//url", + ] +} + +# TODO(msw): Move support code with content deps to test_support_with_content. +source_set("test_support") { + testonly = true + sources = gypi_values.ash_test_support_sources + configs += [ "//build/config:precompiled_headers" ] + + public_deps = [ + ":ash", + ] + deps = [ + ":test_support_with_content", # TODO(beng): reverse this direction. + "//ash/resources", + "//base:i18n", + "//base/test:test_support", + "//components/signin/core/account_id", + "//components/user_manager:user_manager", + "//content/public/browser", + "//content/test:test_support", + "//device/bluetooth", + "//skia", + "//testing/gtest", + "//ui/accessibility", + "//ui/app_list:test_support", + "//ui/app_list/presenter", + "//ui/aura", + "//ui/aura:test_support", + "//ui/base:test_support", + "//ui/compositor:test_support", + "//ui/display/types", + "//ui/events:events_base", + "//ui/events:test_support", + "//ui/events/devices", + "//ui/gl", + "//ui/gl:test_support", + "//ui/keyboard", + "//ui/message_center", + "//ui/views", + "//ui/views:test_support", + "//ui/wm", + ] + + if (is_win) { + deps += [ "//ui/platform_window/win" ] + } + + if (use_x11) { + deps += [ "//ui/gfx/x" ] + } + + if (is_chromeos) { + deps += [ + "//chromeos", + "//ui/display", + ] + } +} + +source_set("test_support_with_content") { + testonly = true + sources = gypi_values.ash_test_support_with_content_sources + configs += [ "//build/config:precompiled_headers" ] + + deps = [ + ":ash_with_content", + "//content/test:test_support", + "//skia", + ] +} + +source_set("interactive_ui_test_support") { + testonly = true + configs += [ "//build/config:precompiled_headers" ] + public_deps = [ + ":ash", + ":test_support", + ] + sources = [ + "test/ash_interactive_ui_test_base.cc", + "test/ash_interactive_ui_test_base.h", + ] + deps = [ + ":ash", + ":test_support", + "//base", + "//skia", + "//testing/gtest", + "//ui/aura", + "//ui/base", + "//ui/gl:test_support", + ] +} + +static_library("ash_shell_lib") { + testonly = true + sources = gypi_values.ash_shell_lib_sources + + deps = [ + ":ash", + ":ash_with_content", + ":test_support", + "//ash/resources", + "//ash/strings", + "//base", + "//base:i18n", + "//components/user_manager", + "//net", + "//skia", + "//third_party/icu", + "//ui/app_list/presenter", + "//ui/aura", + "//ui/base", + "//ui/base/ime", + "//ui/compositor", + "//ui/events", + "//ui/events:events_base", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/keyboard", + "//ui/keyboard:keyboard_with_content", + "//ui/message_center", + "//ui/resources", + "//ui/views", + "//ui/views:test_support", + "//ui/views/examples:views_examples_lib", + "//ui/views/examples:views_examples_with_content_lib", + "//ui/wm", + ] +} + +static_library("ash_shell_lib_with_content") { + testonly = true + sources = gypi_values.ash_shell_with_content_lib_sources + + deps = [ + ":ash_shell_lib", + ":ash_with_content", + "//base:i18n", + "//chrome:packed_resources", + "//content", + "//content/shell:content_shell_lib", + "//device/bluetooth", + "//net", + "//skia", + "//ui/aura", + "//ui/base", + "//ui/compositor", + "//ui/display", + "//ui/events/devices", + "//ui/message_center", + "//ui/views:test_support", + "//ui/wm", + ] + + if (is_chromeos) { + deps += [ "//chromeos" ] + } +} + +test("ash_unittests") { + sources = gypi_values.ash_unittests_sources + configs += [ "//build/config:precompiled_headers" ] + + deps = [ + ":ash", + ":ash_with_content", + ":test_support", + ":test_support_with_content", + "//ash/resources", + "//ash/strings", + "//base", + "//base/test:test_support", + "//components/signin/core/account_id", + "//components/user_manager", + "//content/public/browser", + "//content/test:test_support", + "//mojo/edk/system", + "//skia", + "//testing/gtest", + "//third_party/icu", + "//ui/accessibility", + "//ui/app_list/presenter", + "//ui/aura", + "//ui/aura:test_support", + "//ui/base", + "//ui/base:test_support", + "//ui/base/ime", + "//ui/compositor", + "//ui/compositor:test_support", + "//ui/display/types", + "//ui/events", + "//ui/events:gesture_detection", + "//ui/events:test_support", + "//ui/events/devices", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/keyboard", + "//ui/keyboard:keyboard_with_content", + "//ui/message_center", + "//ui/message_center:test_support", + "//ui/resources", + "//ui/strings", + "//ui/views", + "//ui/views:test_support", + "//ui/views/controls/webview:test_support", + "//ui/web_dialogs:test_support", + "//ui/wm", + "//ui/wm:test_support", + "//url", + ] + + data_deps = [ + "//ash/strings:ash_test_strings", + "//ash/resources:ash_test_resources_100_percent", + "//ash/resources:ash_test_resources_200_percent", + ] + + if (!is_chromeos) { + sources -= [ + # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906 + "focus_cycler_unittest.cc", + + # All tests for multiple displays: not supported on Windows Ash. + "wm/drag_window_resizer_unittest.cc", + + # Maximize mode is only available on Chrome OS. + "wm/maximize_mode/maximize_mode_controller_unittest.cc", + "wm/maximize_mode/maximize_mode_window_manager_unittest.cc", + + # Can't resize on Windows Ash. http://crbug.com/165962 + "autoclick/autoclick_unittest.cc", + "magnifier/magnification_controller_unittest.cc", + "sticky_keys/sticky_keys_overlay_unittest.cc", + "virtual_keyboard_controller_unittest.cc", + "wm/workspace/workspace_window_resizer_unittest.cc", + ] + } + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + if (!use_x11) { + sources -= [ "host/ash_window_tree_host_x11_unittest.cc" ] + } + if (is_chromeos) { + sources += [ "first_run/first_run_helper_unittest.cc" ] + deps += [ + "//chromeos", + "//chromeos:power_manager_proto", + "//chromeos:test_support_without_gmock", + "//components/quirks", + "//device/bluetooth", + "//net:net", + "//ui/chromeos:ui_chromeos", + "//ui/display", + "//ui/display:test_support", + "//ui/display:test_util", + ] + } else { + sources -= [ + "accelerators/magnifier_key_scroller_unittest.cc", + "accelerators/spoken_feedback_toggler_unittest.cc", + "display/resolution_notification_controller_unittest.cc", + "touch/touchscreen_util_unittest.cc", + ] + } + + if (!use_x11 || !is_chromeos) { + sources -= [ "touch/touch_transformer_controller_unittest.cc" ] + } + + if (!is_chromeos) { + sources -= [ "sticky_keys/sticky_keys_unittest.cc" ] + } +} + +executable("ash_shell_with_content") { + testonly = true + sources = [ + "shell/content/shell_with_content_main.cc", + ] + + deps = [ + ":ash_shell_lib_with_content", + "//base", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//components/user_manager", + "//content", + "//content/public/app:both", + ] + + data_deps = [ + "//ash/strings:ash_test_strings", + "//ash/resources:ash_test_resources_100_percent", + "//ash/resources:ash_test_resources_200_percent", + ] + + if (is_win) { + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + deps += [ "//sandbox" ] + } + + if (is_chromeos) { + deps += [ "//device/bluetooth" ] + } +} +# When adding support for isolates, please have a look at run-time dependencies +# in the ash_unittests_run target in ash.gyp. diff --git a/chromium/ash/mus/BUILD.gn b/chromium/ash/mus/BUILD.gn new file mode 100644 index 00000000000..97ff79b14f2 --- /dev/null +++ b/chromium/ash/mus/BUILD.gn @@ -0,0 +1,205 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//tools/grit/repack.gni") + +source_set("lib") { + sources = [ + "accelerator_registrar_impl.cc", + "accelerator_registrar_impl.h", + "bridge/mus_layout_manager_adapter.cc", + "bridge/mus_layout_manager_adapter.h", + "bridge/wm_lookup_mus.cc", + "bridge/wm_lookup_mus.h", + "bridge/wm_root_window_controller_mus.cc", + "bridge/wm_root_window_controller_mus.h", + "bridge/wm_shelf_mus.cc", + "bridge/wm_shelf_mus.h", + "bridge/wm_shell_mus.cc", + "bridge/wm_shell_mus.h", + "bridge/wm_window_mus.cc", + "bridge/wm_window_mus.h", + "container_ids.cc", + "container_ids.h", + "disconnected_app_handler.cc", + "disconnected_app_handler.h", + "drag_window_resizer.cc", + "drag_window_resizer.h", + "frame/caption_buttons/caption_button_types.h", + "frame/caption_buttons/frame_caption_button.cc", + "frame/caption_buttons/frame_caption_button.h", + "frame/caption_buttons/frame_caption_button_container_view.cc", + "frame/caption_buttons/frame_caption_button_container_view.h", + "frame/default_header_painter.cc", + "frame/default_header_painter.h", + "frame/frame_border_hit_test_controller.cc", + "frame/frame_border_hit_test_controller.h", + "frame/header_painter.h", + "frame/header_painter_util.cc", + "frame/header_painter_util.h", + "frame/move_event_handler.cc", + "frame/move_event_handler.h", + "frame/non_client_frame_view_mash.cc", + "frame/non_client_frame_view_mash.h", + "layout_manager.cc", + "layout_manager.h", + "non_client_frame_controller.cc", + "non_client_frame_controller.h", + "property_util.cc", + "property_util.h", + "root_window_controller.cc", + "root_window_controller.h", + "screenlock_layout.cc", + "screenlock_layout.h", + "shadow.cc", + "shadow.h", + "shadow_controller.cc", + "shadow_controller.h", + "shelf_layout_impl.cc", + "shelf_layout_impl.h", + "shelf_layout_manager.cc", + "shelf_layout_manager.h", + "shelf_layout_manager_delegate.h", + "status_layout_manager.cc", + "status_layout_manager.h", + "user_window_controller_impl.cc", + "user_window_controller_impl.h", + "window_manager.cc", + "window_manager.h", + "window_manager_application.cc", + "window_manager_application.h", + "window_manager_observer.h", + ] + + deps = [ + "//components/user_manager", + ] + + public_deps = [ + "//ash", + "//ash/mus/resources", + "//ash/public/interfaces", + "//base", + "//components/mus/common:mus_common", + "//components/mus/public/cpp", + "//components/mus/public/interfaces", + "//mash/session/public/interfaces", + "//mojo/common:common_base", + "//services/shell/public/cpp", + "//services/tracing/public/cpp", + "//skia", + "//ui/aura", + "//ui/display/mojo", + "//ui/events", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gfx/geometry/mojo", + "//ui/resources", + "//ui/strings", + "//ui/views", + "//ui/views/mus:for_mojo_application", + ] +} + +mojo_native_application("mus") { + output_name = "ash" + + sources = [ + "main.cc", + ] + + deps = [ + ":lib", + ":resources", + "//services/shell/public/cpp", + ] + + # TODO(beng): This target relies on //mash/session, but there is a cycle so we + # can't state that dependency here. + data_deps = [ + ":manifest", + "//components/mus", + ] + + resources = [ "$root_out_dir/ash_mus_resources.pak" ] +} + +mojo_application_manifest("manifest") { + application_name = "ash" + source = "manifest.json" +} + +repack("resources") { + sources = [ + "$root_gen_dir/ash/mus/resources/ash_mus_resources_100_percent.pak", + "$root_gen_dir/ash/resources/ash_resources_100_percent.pak", + "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", + "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", + "$root_gen_dir/ui/strings/ui_strings_en-US.pak", + "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak", + ] + output = "$root_out_dir/ash_mus_resources.pak" + deps = [ + "//ash/mus/resources", + "//ash/resources", + "//ui/resources", + "//ui/strings", + "//ui/views/mus:resources", + "//ui/views/resources", + ] +} + +source_set("unittests") { + testonly = true + + sources = [ + "accelerator_registrar_unittest.cc", + "app_launch_unittest.cc", + "layout_manager_unittest.cc", + "test/wm_test_base.cc", + "test/wm_test_base.h", + "test/wm_test_helper.cc", + "test/wm_test_helper.h", + "test/wm_test_screen.cc", + "test/wm_test_screen.h", + "window_manager_unittest.cc", + "wm/mru_window_tracker_unittest.cc", + "workspace/workspace_layout_manager_unittest.cc", + ] + + deps = [ + ":lib", + ":resources", + "//ash", + "//ash/public/interfaces", + "//base", + "//base/test:test_config", + "//components/mus/common:mus_common", + "//components/mus/public/cpp", + "//components/mus/public/cpp/tests:test_support", + "//components/mus/public/cpp/tests:unittest_support", + "//components/mus/public/interfaces", + "//mojo/public/cpp/system", + "//services/shell/public/cpp:shell_test_support", + "//skia", + "//testing/gtest", + "//ui/aura", + "//ui/base", + "//ui/display", + "//ui/events", + "//ui/gfx:test_support", + "//ui/gfx/geometry", + "//ui/gfx/geometry/mojo", + "//ui/views/mus", + ] + + data_deps = [ + ":mus", + "//mash/quick_launch", + ] +} diff --git a/chromium/ash/mus/resources/BUILD.gn b/chromium/ash/mus/resources/BUILD.gn new file mode 100644 index 00000000000..9ae798b5694 --- /dev/null +++ b/chromium/ash/mus/resources/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +grit("resources") { + source = "ash_mus_resources.grd" + outputs = [ + "grit/ash_mus_resources.h", + "ash_mus_resources_100_percent.pak", + "ash_mus_resources_200_percent.pak", + ] +} diff --git a/chromium/ash/public/interfaces/BUILD.gn b/chromium/ash/public/interfaces/BUILD.gn new file mode 100644 index 00000000000..2c60c4caef2 --- /dev/null +++ b/chromium/ash/public/interfaces/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("interfaces") { + sources = [ + "ash_window_type.mojom", + "container.mojom", + "shelf_layout.mojom", + "user_window_controller.mojom", + ] + + public_deps = [ + "//mash/shelf/public/interfaces", + ] +} diff --git a/chromium/ash/public/interfaces/ash_window_type.mojom b/chromium/ash/public/interfaces/ash_window_type.mojom new file mode 100644 index 00000000000..61f2c4d6435 --- /dev/null +++ b/chromium/ash/public/interfaces/ash_window_type.mojom @@ -0,0 +1,13 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module ash.mojom; + +enum AshWindowType { + SHELF = 0, + STATUS_AREA, + COUNT +}; + +const string kAshWindowType_Property = "ash:window-type"; diff --git a/chromium/ash/public/interfaces/container.mojom b/chromium/ash/public/interfaces/container.mojom new file mode 100644 index 00000000000..e0269a118d6 --- /dev/null +++ b/chromium/ash/public/interfaces/container.mojom @@ -0,0 +1,25 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module ash.mojom; + +// Containers windows may be parented to. +// NOTE: this is not the complete list of containers created by ash. See +// ash/common/shell_window_ids.h for the complete this. This is only a subset +// that other apps may need to parent windows to. +enum Container { + // TODO: remove everything but LOGIN_WINDOWS, http://crbug.com/616859. + USER_BACKGROUND, + USER_PRIVATE_SHELF, + LOGIN_WINDOWS, + // Status area widget and message center notification popups. + STATUS, + // Bubble windows, for example the sysui system tray bubble and the screen + // brightness bubble. + BUBBLES, + MENUS, + DRAG_AND_TOOLTIPS, +}; + +const string kWindowContainer_Property = "ash:window-container"; diff --git a/chromium/ash/public/interfaces/shelf_layout.mojom b/chromium/ash/public/interfaces/shelf_layout.mojom new file mode 100644 index 00000000000..529f92f804e --- /dev/null +++ b/chromium/ash/public/interfaces/shelf_layout.mojom @@ -0,0 +1,14 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module ash.mojom; + +import "mash/shelf/public/interfaces/shelf_constants.mojom"; + +// Used by mojo:ash_sysui to push the current shelf state to its layout manager. +interface ShelfLayout { + // TODO: Update preferred sizes with alignment to avoid flicker during layout. + SetAlignment(mash.shelf.mojom.Alignment alignment); + SetAutoHideBehavior(mash.shelf.mojom.AutoHideBehavior auto_hide); +}; diff --git a/chromium/ash/public/interfaces/user_window_controller.mojom b/chromium/ash/public/interfaces/user_window_controller.mojom new file mode 100644 index 00000000000..2add8cca7d8 --- /dev/null +++ b/chromium/ash/public/interfaces/user_window_controller.mojom @@ -0,0 +1,38 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module ash.mojom; + +struct UserWindow { + uint32 window_id; // The local window id, defined by UserWindowController. + string window_title; // The window title. + bool window_has_focus; // A flag; true if the window is currently focused. + array<uint8> window_app_icon; // A serialized SkBitmap. + string window_app_id; // The window application ID (ie. 'mojo:foo'). + bool ignored_by_shelf; // A flag; true to avoid showing a shelf item. +}; + +// An observer of user windows within mojom::Container::USER_WINDOWS. +// TODO(msw): Observe focus changes, title/icon changes, etc. +interface UserWindowObserver { + // Called when the observer is first added to supply the initial state. + OnUserWindowObserverAdded(array<UserWindow> user_windows); + + OnUserWindowAdded(UserWindow user_window); + OnUserWindowRemoved(uint32 window_id); + + OnUserWindowTitleChanged(uint32 window_id, string window_title); + + // |app_icon| is a serialized SkBitmap. + OnUserWindowAppIconChanged(uint32 window_id, array<uint8> app_icon); + + OnUserWindowFocusChanged(uint32 window_id, bool has_focus); +}; + +// An interface allowing system UIs to manage the set of user windows. +// TODO(msw): Add minimization, restoration, opening a chooser view, etc. +interface UserWindowController { + AddUserWindowObserver(UserWindowObserver observer); + FocusUserWindow(uint32 window_id); +}; diff --git a/chromium/ash/resources/BUILD.gn b/chromium/ash/resources/BUILD.gn new file mode 100644 index 00000000000..6f2fd27ee41 --- /dev/null +++ b/chromium/ash/resources/BUILD.gn @@ -0,0 +1,77 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") +import("//tools/grit/repack.gni") +import("//ui/base/ui_features.gni") + +assert(enable_hidpi) + +grit("resources") { + source = "ash_resources.grd" + outputs = [ + "grit/ash_resources.h", + "ash_resources_100_percent.pak", + "ash_resources_200_percent.pak", + ] +} + +# Generates a rule to repack ash resources for a given percentage (e.g. "100"). +# TODO(msw): Use ui_test.pak instead of its pieces? (no 200% support?) +template("ash_test_resources") { + percent = invoker.percent + + repack("ash_test_resources_${target_name}") { + output = "$root_build_dir/ash_test_resources_${percent}_percent.pak" + + sources = [ + "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak", + "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak", + ] + + if (percent == "100") { + sources += [ + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/ui/resources/webui_resources.pak", + ] + } + + deps = [ + "//ash/resources", + "//content:resources", + "//ui/resources", + ] + + if (toolkit_views) { + deps += [ + "//ui/app_list/resources", + "//ui/views/resources", + ] + sources += [ + "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak", + "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak", + ] + + if (percent == "100") { + # TODO(msw): This seems bad, but follows repack_ui_test_pak's example. + deps += [ "//third_party/WebKit/public:resources_grit" ] + sources += + [ "$root_gen_dir/blink/public/resources/blink_resources.pak" ] + } + } + + if (is_chromeos) { + sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ] + deps += [ "//ui/chromeos/resources" ] + } + } +} + +ash_test_resources("100_percent") { + percent = "100" +} + +ash_test_resources("200_percent") { + percent = "200" +} diff --git a/chromium/ash/strings/BUILD.gn b/chromium/ash/strings/BUILD.gn new file mode 100644 index 00000000000..68f39cc8865 --- /dev/null +++ b/chromium/ash/strings/BUILD.gn @@ -0,0 +1,94 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") +import("//tools/grit/repack.gni") + +grit("strings") { + source = "../ash_strings.grd" + outputs = [ + "grit/ash_strings.h", + "ash_strings_am.pak", + "ash_strings_ar.pak", + "ash_strings_bg.pak", + "ash_strings_bn.pak", + "ash_strings_ca.pak", + "ash_strings_cs.pak", + "ash_strings_da.pak", + "ash_strings_de.pak", + "ash_strings_el.pak", + "ash_strings_en-GB.pak", + "ash_strings_en-US.pak", + "ash_strings_es.pak", + "ash_strings_es-419.pak", + "ash_strings_et.pak", + "ash_strings_fa.pak", + "ash_strings_fake-bidi.pak", + "ash_strings_fi.pak", + "ash_strings_fil.pak", + "ash_strings_fr.pak", + "ash_strings_gu.pak", + "ash_strings_he.pak", + "ash_strings_hi.pak", + "ash_strings_hr.pak", + "ash_strings_hu.pak", + "ash_strings_id.pak", + "ash_strings_it.pak", + "ash_strings_ja.pak", + "ash_strings_kn.pak", + "ash_strings_ko.pak", + "ash_strings_lt.pak", + "ash_strings_lv.pak", + "ash_strings_ml.pak", + "ash_strings_mr.pak", + "ash_strings_ms.pak", + "ash_strings_nl.pak", + "ash_strings_nb.pak", + "ash_strings_pl.pak", + "ash_strings_pt-BR.pak", + "ash_strings_pt-PT.pak", + "ash_strings_ro.pak", + "ash_strings_ru.pak", + "ash_strings_sk.pak", + "ash_strings_sl.pak", + "ash_strings_sr.pak", + "ash_strings_sv.pak", + "ash_strings_sw.pak", + "ash_strings_ta.pak", + "ash_strings_te.pak", + "ash_strings_th.pak", + "ash_strings_tr.pak", + "ash_strings_uk.pak", + "ash_strings_vi.pak", + "ash_strings_zh-CN.pak", + "ash_strings_zh-TW.pak", + ] +} + +# Creates a pak file containing strings for ash_unittests, etc. +repack("ash_test_strings") { + output = "$root_build_dir/ash_test_strings.pak" + + sources = [ + "$root_gen_dir/ash/strings/ash_strings_en-US.pak", + "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", + "$root_gen_dir/ui/strings/ui_strings_en-US.pak", + ] + + deps = [ + "//ash/strings", + "//ui/strings", + ] + + if (is_chromeos) { + sources += [ + "$root_gen_dir/device/bluetooth/strings/bluetooth_strings_en-US.pak", + "$root_gen_dir/ui/chromeos/strings/ui_chromeos_strings_en-US.pak", + ] + deps += [ + "//device/bluetooth/strings", + "//ui/chromeos/strings", + ] + } +} diff --git a/chromium/ash/sysui/BUILD.gn b/chromium/ash/sysui/BUILD.gn new file mode 100644 index 00000000000..a038dd006be --- /dev/null +++ b/chromium/ash/sysui/BUILD.gn @@ -0,0 +1,136 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//tools/grit/repack.gni") + +source_set("lib") { + sources = [ + "app_list_presenter_mus.cc", + "app_list_presenter_mus.h", + "context_menu_mus.cc", + "context_menu_mus.h", + "keyboard_ui_mus.cc", + "keyboard_ui_mus.h", + "pointer_watcher_delegate_mus.cc", + "pointer_watcher_delegate_mus.h", + "shelf_delegate_mus.cc", + "shelf_delegate_mus.h", + "shell_delegate_mus.cc", + "shell_delegate_mus.h", + "stub_context_factory.cc", + "stub_context_factory.h", + "sysui_application.cc", + "sysui_application.h", + "user_wallpaper_delegate_mus.cc", + "user_wallpaper_delegate_mus.h", + ] + + deps = [ + "//ash", + "//ash/public/interfaces", + "//cc", + "//cc/surfaces", + "//components/mus/common:mus_common", + "//components/mus/public/cpp", + "//components/mus/public/cpp/input_devices", + "//components/mus/public/interfaces", + "//components/user_manager", + "//components/wallpaper", + "//device/bluetooth", + "//mojo/common:common_base", + "//services/catalog/public/cpp", + "//services/shell/public/cpp", + "//services/tracing/public/cpp", + "//ui/app_list/presenter", + "//ui/app_list/presenter:mojom", + "//ui/aura", + "//ui/events", + "//ui/events/devices", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gfx/geometry/mojo", + "//ui/keyboard:mojom", + "//ui/message_center", + "//ui/platform_window/stub", + "//ui/resources", + "//ui/strings", + "//ui/views", + "//ui/views/mus:for_mojo_application", + "//ui/wm", + ] + + public_deps = [ + "//ash/sysui/public/interfaces", + "//mash/shelf/public/interfaces", + ] + + if (is_chromeos) { + deps += [ "//chromeos" ] + } +} + +mojo_application_manifest("manifest") { + application_name = "ash_sysui" + source = "manifest.json" +} + +mojo_native_application("sysui") { + output_name = "ash_sysui" + sources = [ + "main.cc", + ] + deps = [ + ":lib", + ":resources_100", + ":resources_200", + ":resources_strings", + "//services/shell/public/cpp", + ] + + data_deps = [ + ":manifest", + "//components/mus", + ] + + resources = [ + "$root_out_dir/ash_resources_strings.pak", + "$root_out_dir/ash_resources_100_percent.pak", + "$root_out_dir/ash_resources_200_percent.pak", + ] +} + +#TODO(msw): Do not load 'test' resources (include sys lang?). +repack("resources_strings") { + sources = [ + "$root_out_dir/ash_test_strings.pak", + ] + output = "$root_out_dir/ash_resources_strings.pak" + deps = [ + "//ash/strings:ash_test_strings", + ] +} + +repack("resources_100") { + sources = [ + "$root_out_dir/ash_test_resources_100_percent.pak", + ] + output = "$root_out_dir/ash_resources_100_percent.pak" + deps = [ + "//ash/resources:ash_test_resources_100_percent", + ] +} + +repack("resources_200") { + sources = [ + "$root_out_dir/ash_test_resources_200_percent.pak", + ] + output = "$root_out_dir/ash_resources_200_percent.pak" + deps = [ + "//ash/resources:ash_test_resources_200_percent", + ] +} diff --git a/chromium/ash/sysui/public/interfaces/BUILD.gn b/chromium/ash/sysui/public/interfaces/BUILD.gn new file mode 100644 index 00000000000..5dc80b1c58f --- /dev/null +++ b/chromium/ash/sysui/public/interfaces/BUILD.gn @@ -0,0 +1,15 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("interfaces") { + sources = [ + "wallpaper.mojom", + ] + + deps = [ + "//skia/public/interfaces", + ] +} diff --git a/chromium/ash/sysui/public/interfaces/wallpaper.mojom b/chromium/ash/sysui/public/interfaces/wallpaper.mojom new file mode 100644 index 00000000000..af7b7128db1 --- /dev/null +++ b/chromium/ash/sysui/public/interfaces/wallpaper.mojom @@ -0,0 +1,20 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module ash.sysui.mojom; + +import "skia/public/interfaces/bitmap.mojom"; + +// These values match wallpaper::WallpaperLayout. +enum WallpaperLayout { CENTER, CENTER_CROPPED, STRETCH, TILE, }; + +// Used by Chrome to set the wallpaper displayed by ash_sysui. +interface WallpaperController { + SetWallpaper(skia.mojom.Bitmap wallpaper, WallpaperLayout layout); +}; + +// Used by ash_sysui to trigger Chrome's wallpaper picker functionality. +interface WallpaperManager { + Open(); +}; diff --git a/chromium/base/android/jni_generator/BUILD.gn b/chromium/base/android/jni_generator/BUILD.gn new file mode 100644 index 00000000000..1d989022497 --- /dev/null +++ b/chromium/base/android/jni_generator/BUILD.gn @@ -0,0 +1,58 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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("//testing/test.gni") + +# GYP: //base/android/jni_generator/jni_generator.gyp:jni_generator_py_tests +action("jni_generator_py_tests") { + _stamp = "$target_gen_dir/jni_generator_py_tests.stamp" + inputs = [ + "jni_generator.py", + "jni_generator_tests.py", + "java/src/org/chromium/example/jni_generator/SampleForTests.java", + "golden_sample_for_tests_jni.h", + ] + outputs = [ + _stamp, + ] + script = "jni_generator_tests.py" + args = [ + "--stamp", + rebase_path(_stamp, root_build_dir), + ] +} + +# GYP: //base/android/jni_generator/jni_generator.gyp:jni_sample_header +generate_jni("jni_sample_header") { + sources = [ + "java/src/org/chromium/example/jni_generator/SampleForTests.java", + ] + jni_package = "example" +} + +# GYP: //base/android/jni_generator/jni_generator.gyp:jni_sample_java +android_library("jni_sample_java") { + java_files = + [ "java/src/org/chromium/example/jni_generator/SampleForTests.java" ] + deps = [ + "//base:base_java", + ] +} + +# This executable doesn't actually run, but at least serves to test that +# generated bindings compile properly. +# GYP: //base/android/jni_generator/jni_generator.gyp:jni_generator_tests +executable("jni_generator_tests") { + deps = [ + ":jni_generator_py_tests", + ":jni_sample_header", + ":jni_sample_java", + "//base", + ] + sources = [ + "sample_for_tests.cc", + "sample_for_tests.h", + ] +} diff --git a/chromium/base/test/BUILD.gn b/chromium/base/test/BUILD.gn new file mode 100644 index 00000000000..ab9472dd5d1 --- /dev/null +++ b/chromium/base/test/BUILD.gn @@ -0,0 +1,273 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//build/config/nacl/config.gni") + +if (is_android) { + import("//build/config/android/rules.gni") +} + +source_set("test_config") { + testonly = true + sources = [ + "test_switches.cc", + "test_switches.h", + "test_timeouts.cc", + "test_timeouts.h", + ] + deps = [ + "//base", + ] +} + +# GYP: //base/base.gyp:test_support_base +source_set("test_support") { + testonly = true + sources = [ + "gtest_util.cc", + "gtest_util.h", + "gtest_xml_unittest_result_printer.cc", + "gtest_xml_unittest_result_printer.h", + "gtest_xml_util.cc", + "gtest_xml_util.h", + "histogram_tester.cc", + "histogram_tester.h", + "ios/wait_util.h", + "ios/wait_util.mm", + "launcher/test_result.cc", + "launcher/test_result.h", + "launcher/test_results_tracker.h", + "launcher/unit_test_launcher.h", + "mock_chrome_application_mac.h", + "mock_chrome_application_mac.mm", + "mock_devices_changed_observer.cc", + "mock_devices_changed_observer.h", + "mock_entropy_provider.cc", + "mock_entropy_provider.h", + "mock_log.cc", + "mock_log.h", + "multiprocess_test.h", + "null_task_runner.cc", + "null_task_runner.h", + "opaque_ref_counted.cc", + "opaque_ref_counted.h", + "perf_log.cc", + "perf_log.h", + "perf_test_suite.cc", + "perf_test_suite.h", + "perf_time_logger.cc", + "perf_time_logger.h", + "power_monitor_test_base.cc", + "power_monitor_test_base.h", + "scoped_command_line.cc", + "scoped_command_line.h", + "scoped_locale.cc", + "scoped_locale.h", + "scoped_path_override.cc", + "scoped_path_override.h", + "sequenced_task_runner_test_template.cc", + "sequenced_task_runner_test_template.h", + "sequenced_worker_pool_owner.cc", + "sequenced_worker_pool_owner.h", + "simple_test_clock.cc", + "simple_test_clock.h", + "simple_test_tick_clock.cc", + "simple_test_tick_clock.h", + "task_runner_test_template.cc", + "task_runner_test_template.h", + "test_discardable_memory_allocator.cc", + "test_discardable_memory_allocator.h", + "test_file_util.cc", + "test_file_util.h", + "test_file_util_android.cc", + "test_file_util_linux.cc", + "test_file_util_mac.cc", + "test_file_util_posix.cc", + "test_file_util_win.cc", + "test_io_thread.cc", + "test_io_thread.h", + "test_listener_ios.h", + "test_listener_ios.mm", + "test_message_loop.cc", + "test_message_loop.h", + "test_mock_time_task_runner.cc", + "test_mock_time_task_runner.h", + "test_pending_task.cc", + "test_pending_task.h", + "test_reg_util_win.cc", + "test_reg_util_win.h", + "test_shortcut_win.cc", + "test_shortcut_win.h", + "test_simple_task_runner.cc", + "test_simple_task_runner.h", + "test_suite.cc", + "test_suite.h", + "test_support_android.cc", + "test_support_android.h", + "test_support_ios.h", + "test_support_ios.mm", + "test_ui_thread_android.cc", + "test_ui_thread_android.h", + "thread_test_helper.cc", + "thread_test_helper.h", + "trace_event_analyzer.cc", + "trace_event_analyzer.h", + "trace_to_file.cc", + "trace_to_file.h", + "user_action_tester.cc", + "user_action_tester.h", + "values_test_util.cc", + "values_test_util.h", + ] + + if (is_ios) { + sources += [ "launcher/unit_test_launcher_ios.cc" ] + } else if (!is_nacl_nonsfi) { + sources += [ + "launcher/test_launcher.cc", + "launcher/test_launcher.h", + "launcher/test_results_tracker.cc", + "launcher/unit_test_launcher.cc", + "multiprocess_test.cc", + "multiprocess_test_android.cc", + ] + } + + configs += [ "//build/config:precompiled_headers" ] + + data = [ + # The isolate needs this script for setting up the test. It's not actually + # needed to run this target locally. + "//testing/test_env.py", + ] + + public_deps = [ + ":test_config", + "//base", + "//base:base_static", + "//base:i18n", + ] + deps = [ + "//base/third_party/dynamic_annotations", + "//testing/gmock", + "//testing/gtest", + "//third_party/icu:icuuc", + "//third_party/libxml", + ] + + if (!is_posix) { + sources -= [ + "scoped_locale.cc", + "scoped_locale.h", + ] + } + + if (is_ios) { + set_sources_assignment_filter([]) + sources += [ "test_file_util_mac.cc" ] + set_sources_assignment_filter(sources_assignment_filter) + } + + if (is_mac) { + libs = [ "AppKit.framework" ] + } + + if (is_android) { + deps += [ ":base_unittests_jni_headers" ] + } + + if (is_nacl_nonsfi) { + sources += [ + "launcher/test_launcher.h", + "launcher/test_result.h", + "launcher/unit_test_launcher.h", + "launcher/unit_test_launcher_nacl_nonsfi.cc", + ] + sources -= [ + "gtest_xml_util.cc", + "gtest_xml_util.h", + "perf_test_suite.cc", + "perf_test_suite.h", + "scoped_path_override.cc", + "scoped_path_override.h", + "test_discardable_memory_allocator.cc", + "test_discardable_memory_allocator.h", + "test_file_util.cc", + "test_file_util.h", + "test_file_util_posix.cc", + "test_suite.cc", + "test_suite.h", + "trace_to_file.cc", + "trace_to_file.h", + ] + public_deps -= [ "//base:i18n" ] + deps -= [ + "//third_party/icu:icuuc", + "//third_party/libxml", + ] + } +} + +config("perf_test_config") { + defines = [ "PERF_TEST" ] +} + +source_set("test_support_perf") { + testonly = true + sources = [ + "run_all_perftests.cc", + ] + deps = [ + ":test_support", + "//base", + "//testing/gtest", + ] + + public_configs = [ ":perf_test_config" ] +} + +source_set("test_launcher_nacl_nonsfi") { + testonly = true + sources = [ + "launcher/test_launcher_nacl_nonsfi.cc", + "launcher/test_launcher_nacl_nonsfi.h", + ] + deps = [ + ":test_support", + ] +} + +source_set("run_all_unittests") { + testonly = true + sources = [ + "run_all_unittests.cc", + ] + deps = [ + ":test_support", + ] +} + +if (is_linux) { + shared_library("malloc_wrapper") { + testonly = true + sources = [ + "malloc_wrapper.cc", + ] + deps = [ + "//base", + "//build/config/sanitizers:deps", + ] + } +} + +if (is_android) { + generate_jni("base_unittests_jni_headers") { + sources = [ + "android/java/src/org/chromium/base/ContentUriTestUtils.java", + "android/java/src/org/chromium/base/TestUiThread.java", + ] + jni_package = "base" + } +} diff --git a/chromium/blimp/test/BUILD.gn b/chromium/blimp/test/BUILD.gn new file mode 100644 index 00000000000..0802b66ef63 --- /dev/null +++ b/chromium/blimp/test/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("support") { + testonly = true + + sources = [ + "support/compositor/picture_cache_test_support.cc", + "support/compositor/picture_cache_test_support.h", + ] + + deps = [ + "//blimp/common", + "//cc", + "//skia", + "//testing/gmock", + "//ui/gfx", + "//ui/gfx/geometry", + ] +} diff --git a/chromium/breakpad/BUILD.gn b/chromium/breakpad/BUILD.gn new file mode 100644 index 00000000000..d01e696fe8a --- /dev/null +++ b/chromium/breakpad/BUILD.gn @@ -0,0 +1,909 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/symlink.gni") +import("//testing/test.gni") + +if (is_android) { + import("//build/config/android/rules.gni") +} + +config("tools_config") { + include_dirs = [ + "src", + "src/third_party", + ] + if (is_android) { + defines = [ "__ANDROID__" ] + } + if (is_clang) { + cflags = [ "-Wno-tautological-constant-out-of-range-compare" ] + } +} + +config("internal_config") { + include_dirs = [ "src" ] + defines = [] + if (is_debug) { + # This is needed for GTMLogger to work correctly. + defines += [ "DEBUG" ] + } + if (is_android) { + defines += [ "__ANDROID__" ] + } +} + +config("client_config") { + include_dirs = [ "src" ] + if (is_android) { + include_dirs += [ "src/common/android/include" ] + } + if (is_chromeos) { + defines = [ "__CHROMEOS__" ] + } +} + +config("handler_config") { + include_dirs = [ "src" ] +} + +config("sender_config") { + include_dirs = [ "src" ] +} + +config("breakpad_unittest_config") { + # One of the breakpad unit tests test that we can detect the proper build-id. + # We must override the build-id for this one target. + ldflags = [ "-Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" ] +} + +# {micro,mini}dump_stackwalk and minidump_dump are tool-type executables +# that do not build on Windows. +if (!is_win) { + if (current_toolchain == host_toolchain) { + # Contains the code shared by both {micro,mini}dump_stackwalk. + static_library("stackwalk_common") { + # Always want these files included regardless of platform. + set_sources_assignment_filter([]) + sources = [ + "src/processor/basic_code_module.h", + "src/processor/basic_code_modules.cc", + "src/processor/basic_code_modules.h", + "src/processor/basic_source_line_resolver.cc", + "src/processor/call_stack.cc", + "src/processor/cfi_frame_info.cc", + "src/processor/cfi_frame_info.h", + "src/processor/disassembler_x86.cc", + "src/processor/disassembler_x86.h", + "src/processor/dump_context.cc", + "src/processor/dump_object.cc", + "src/processor/logging.cc", + "src/processor/logging.h", + "src/processor/pathname_stripper.cc", + "src/processor/pathname_stripper.h", + "src/processor/proc_maps_linux.cc", + "src/processor/process_state.cc", + "src/processor/simple_symbol_supplier.cc", + "src/processor/simple_symbol_supplier.h", + "src/processor/source_line_resolver_base.cc", + "src/processor/stack_frame_cpu.cc", + "src/processor/stack_frame_symbolizer.cc", + "src/processor/stackwalk_common.cc", + "src/processor/stackwalker.cc", + "src/processor/stackwalker_amd64.cc", + "src/processor/stackwalker_amd64.h", + "src/processor/stackwalker_arm.cc", + "src/processor/stackwalker_arm.h", + "src/processor/stackwalker_arm64.cc", + "src/processor/stackwalker_arm64.h", + "src/processor/stackwalker_mips.cc", + "src/processor/stackwalker_mips.h", + "src/processor/stackwalker_ppc.cc", + "src/processor/stackwalker_ppc.h", + "src/processor/stackwalker_ppc64.cc", + "src/processor/stackwalker_ppc64.h", + "src/processor/stackwalker_sparc.cc", + "src/processor/stackwalker_sparc.h", + "src/processor/stackwalker_x86.cc", + "src/processor/stackwalker_x86.h", + "src/processor/tokenize.cc", + "src/processor/tokenize.h", + + # libdisasm + "src/third_party/libdisasm/ia32_implicit.c", + "src/third_party/libdisasm/ia32_implicit.h", + "src/third_party/libdisasm/ia32_insn.c", + "src/third_party/libdisasm/ia32_insn.h", + "src/third_party/libdisasm/ia32_invariant.c", + "src/third_party/libdisasm/ia32_invariant.h", + "src/third_party/libdisasm/ia32_modrm.c", + "src/third_party/libdisasm/ia32_modrm.h", + "src/third_party/libdisasm/ia32_opcode_tables.c", + "src/third_party/libdisasm/ia32_opcode_tables.h", + "src/third_party/libdisasm/ia32_operand.c", + "src/third_party/libdisasm/ia32_operand.h", + "src/third_party/libdisasm/ia32_reg.c", + "src/third_party/libdisasm/ia32_reg.h", + "src/third_party/libdisasm/ia32_settings.c", + "src/third_party/libdisasm/ia32_settings.h", + "src/third_party/libdisasm/libdis.h", + "src/third_party/libdisasm/qword.h", + "src/third_party/libdisasm/x86_disasm.c", + "src/third_party/libdisasm/x86_format.c", + "src/third_party/libdisasm/x86_imm.c", + "src/third_party/libdisasm/x86_imm.h", + "src/third_party/libdisasm/x86_insn.c", + "src/third_party/libdisasm/x86_misc.c", + "src/third_party/libdisasm/x86_operand_list.c", + "src/third_party/libdisasm/x86_operand_list.h", + ] + + defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":tools_config" ] + } + + executable("microdump_stackwalk") { + sources = [ + "src/processor/microdump.cc", + "src/processor/microdump_processor.cc", + "src/processor/microdump_stackwalk.cc", + ] + + deps = [ + ":stackwalk_common", + "//build/config/sanitizers:deps", + ] + + defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":tools_config" ] + } + + executable("minidump_stackwalk") { + sources = [ + "src/processor/exploitability.cc", + "src/processor/minidump.cc", + "src/processor/minidump_processor.cc", + "src/processor/minidump_stackwalk.cc", + ] + + deps = [ + ":stackwalk_common", + "//build/config/sanitizers:deps", + ] + + defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs += [ ":tools_config" ] + + # Always want these files included regardless of platform. + set_sources_assignment_filter([]) + sources += [ + "src/processor/exploitability_linux.cc", + "src/processor/exploitability_linux.h", + "src/processor/exploitability_win.cc", + "src/processor/exploitability_win.h", + "src/processor/symbolic_constants_win.cc", + "src/processor/symbolic_constants_win.h", + ] + } + + executable("minidump_dump") { + set_sources_assignment_filter([]) + sources = [ + "src/processor/basic_code_module.h", + "src/processor/basic_code_modules.cc", + "src/processor/basic_code_modules.h", + "src/processor/dump_context.cc", + "src/processor/dump_object.cc", + "src/processor/logging.cc", + "src/processor/logging.h", + "src/processor/minidump.cc", + "src/processor/minidump_dump.cc", + "src/processor/pathname_stripper.cc", + "src/processor/pathname_stripper.h", + "src/processor/proc_maps_linux.cc", + ] + + configs += [ ":tools_config" ] + + # There are some warnings in this code. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + "//build/config/sanitizers:deps", + ] + } + } else { + # Aliases for convenience. + binary_symlink("microdump_stackwalk") { + binary_label = ":$target_name($host_toolchain)" + } + binary_symlink("minidump_stackwalk") { + binary_label = ":$target_name($host_toolchain)" + } + binary_symlink("minidump_dump") { + binary_label = ":$target_name($host_toolchain)" + } + } +} + +# Mac -------------------------------------------------------------------------- + +if (is_mac) { + if (current_toolchain == host_toolchain) { + # TODO(GYP) This should be only 64-bit on Mac. From .gypi: + # Like ld, dump_syms needs to operate on enough data that it may + # actually need to be able to address more than 4GB. Use x86_64. + # Don't worry! An x86_64 dump_syms is perfectly able to dump + # 32-bit files. + executable("dump_syms") { + sources = [ + "src/common/dwarf/bytereader.cc", + "src/common/dwarf/dwarf2diehandler.cc", + "src/common/dwarf/dwarf2reader.cc", + "src/common/dwarf/elf_reader.cc", + "src/common/dwarf/elf_reader.h", + "src/common/dwarf_cfi_to_module.cc", + "src/common/dwarf_cu_to_module.cc", + "src/common/dwarf_line_to_module.cc", + "src/common/language.cc", + "src/common/mac/arch_utilities.cc", + "src/common/mac/arch_utilities.h", + "src/common/mac/dump_syms.cc", + "src/common/mac/file_id.cc", + "src/common/mac/macho_id.cc", + "src/common/mac/macho_reader.cc", + "src/common/mac/macho_utilities.cc", + "src/common/mac/macho_walker.cc", + "src/common/md5.cc", + "src/common/module.cc", + "src/common/stabs_reader.cc", + "src/common/stabs_to_module.cc", + "src/tools/mac/dump_syms/dump_syms_tool.cc", + ] + + # For src/common/stabs_reader.h. + defines = [ "HAVE_MACH_O_NLIST_H" ] + include_dirs = [ "src/common/mac" ] + + # The DWARF utilities require -funsigned-char. + cflags = [ "-funsigned-char" ] + + configs += [ ":internal_config" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + # dwarf2reader.cc uses dynamic_cast. + configs -= [ "//build/config/compiler:no_rtti" ] + configs += [ "//build/config/compiler:rtti" ] + + libs = [ "Foundation.framework" ] + + if (!is_debug) { + # dump_syms crashes when built at -O1, -O2, and -O3. It does + # not crash at -Os. To play it safe, dump_syms is always built + # at -O0 until this can be sorted out. + # http://code.google.com/p/google-breakpad/issues/detail?id=329 + configs -= [ "//build/config/compiler:default_optimization" ] + cflags += [ "-O0" ] + } + + deps = [ + "//build/config/sanitizers:deps", + ] + } + + executable("symupload") { + sources = [ + "src/common/mac/HTTPMultipartUpload.m", + "src/tools/mac/symupload/symupload.m", + ] + + include_dirs = [ "src/common/mac" ] + + libs = [ "Foundation.framework" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + "//build/config/sanitizers:deps", + ] + } + } else { + binary_symlink("dump_syms") { + binary_label = ":$target_name($host_toolchain)" + } + binary_symlink("symupload") { + binary_label = ":$target_name($host_toolchain)" + } + } +} + +if (is_mac) { + static_library("utilities") { + sources = [ + "src/client/mac/crash_generation/ConfigFile.mm", + "src/client/mac/handler/breakpad_nlist_64.cc", + "src/client/mac/handler/dynamic_images.cc", + "src/client/mac/handler/minidump_generator.cc", + "src/client/minidump_file_writer.cc", + "src/common/convert_UTF.c", + "src/common/mac/MachIPC.mm", + "src/common/mac/arch_utilities.cc", + "src/common/mac/bootstrap_compat.cc", + "src/common/mac/file_id.cc", + "src/common/mac/launch_reporter.cc", + "src/common/mac/macho_id.cc", + "src/common/mac/macho_utilities.cc", + "src/common/mac/macho_walker.cc", + "src/common/mac/string_utilities.cc", + "src/common/md5.cc", + "src/common/simple_string_dictionary.cc", + "src/common/string_conversion.cc", + ] + + configs += [ ":internal_config" ] + + # There are some warnings in this code. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + } + + executable("crash_inspector") { + sources = [ + "src/client/mac/crash_generation/Inspector.mm", + "src/client/mac/crash_generation/InspectorMain.mm", + ] + + # TODO(GYP): 'mac_real_dsym': 1, + + include_dirs = [ + "src/client/apple/Framework", + "src/common/mac", + "src", + ] + libs = [ + "CoreServices.framework", + "Foundation.framework", + ] + + deps = [ + ":utilities", + "//build/config/sanitizers:deps", + ] + } + + # TODO(GYP) this target has some mac_bundle_resources stuff. + # executable("crash_report_sender") { + # } + group("crash_report_sender") { + } + + config("breakpad_config") { + include_dirs = [ "src/client/apple/Framework" ] + } + + static_library("breakpad") { + sources = [ + "src/client/mac/Framework/Breakpad.mm", + "src/client/mac/Framework/OnDemandServer.mm", + "src/client/mac/crash_generation/crash_generation_client.cc", + "src/client/mac/crash_generation/crash_generation_client.h", + "src/client/mac/handler/exception_handler.cc", + "src/client/mac/handler/protected_memory_allocator.cc", + ] + + configs += [ ":internal_config" ] + public_configs = [ ":breakpad_config" ] + + defines = [ "USE_PROTECTED_ALLOCATIONS=1" ] + include_dirs = [ "src/client/apple/Framework" ] + + deps = [ + ":crash_inspector", + ":crash_report_sender", + ":utilities", + ] + } + + group("client") { + public_configs = [ ":client_config" ] + } +} + +if (is_linux || is_android) { + if (current_toolchain == host_toolchain) { + executable("symupload") { + sources = [ + "src/common/linux/http_upload.cc", + "src/common/linux/http_upload.h", + "src/common/linux/symbol_upload.cc", + "src/common/linux/symbol_upload.h", + "src/tools/linux/symupload/sym_upload.cc", + ] + + include_dirs = [ + "src", + "src/third_party", + ] + + configs += [ ":tools_config" ] + + libs = [ "dl" ] + + deps = [ + "//build/config/sanitizers:deps", + ] + } + + # dump_syms is a host tool, so only compile it for the host system. + executable("dump_syms") { + sources = [ + "src/common/dwarf/bytereader.cc", + "src/common/dwarf/dwarf2diehandler.cc", + "src/common/dwarf/dwarf2reader.cc", + "src/common/dwarf/elf_reader.cc", + "src/common/dwarf/elf_reader.h", + "src/common/dwarf_cfi_to_module.cc", + "src/common/dwarf_cfi_to_module.h", + "src/common/dwarf_cu_to_module.cc", + "src/common/dwarf_cu_to_module.h", + "src/common/dwarf_line_to_module.cc", + "src/common/dwarf_line_to_module.h", + "src/common/language.cc", + "src/common/language.h", + "src/common/linux/crc32.cc", + "src/common/linux/crc32.h", + "src/common/linux/dump_symbols.cc", + "src/common/linux/dump_symbols.h", + "src/common/linux/elf_symbols_to_module.cc", + "src/common/linux/elf_symbols_to_module.h", + "src/common/linux/elfutils.cc", + "src/common/linux/elfutils.h", + "src/common/linux/file_id.cc", + "src/common/linux/file_id.h", + "src/common/linux/guid_creator.h", + "src/common/linux/linux_libc_support.cc", + "src/common/linux/linux_libc_support.h", + "src/common/linux/memory_mapped_file.cc", + "src/common/linux/memory_mapped_file.h", + "src/common/module.cc", + "src/common/module.h", + "src/common/stabs_reader.cc", + "src/common/stabs_reader.h", + "src/common/stabs_to_module.cc", + "src/common/stabs_to_module.h", + "src/tools/linux/dump_syms/dump_syms.cc", + ] + + # There are some warnings in this code. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + # dwarf2reader.cc uses dynamic_cast. Because we don't typically + # don't support RTTI, we enable it for this single target. Since + # dump_syms doesn't share any object files with anything else, + # this doesn't end up polluting Chrome itself. + configs -= [ "//build/config/compiler:no_rtti" ] + configs += [ "//build/config/compiler:rtti" ] + + # Breakpad rev 583 introduced this flag. + # Using this define, stabs_reader.h will include a.out.h to + # build on Linux. + defines = [ "HAVE_A_OUT_H" ] + + include_dirs = [ "src" ] + + deps = [ + "//build/config/sanitizers:deps", + ] + } + } else { + # Aliases for convenience. + binary_symlink("dump_syms") { + binary_label = ":dump_syms($host_toolchain)" + } + binary_symlink("symupload") { + binary_label = ":symupload($host_toolchain)" + } + } + + static_library("client") { + # Want all these sources for both Linux and Android. + set_sources_assignment_filter([]) + sources = [ + "src/client/linux/crash_generation/crash_generation_client.cc", + "src/client/linux/crash_generation/crash_generation_client.h", + "src/client/linux/dump_writer_common/mapping_info.h", + "src/client/linux/dump_writer_common/thread_info.cc", + "src/client/linux/dump_writer_common/thread_info.h", + "src/client/linux/dump_writer_common/ucontext_reader.cc", + "src/client/linux/dump_writer_common/ucontext_reader.h", + "src/client/linux/handler/exception_handler.cc", + "src/client/linux/handler/exception_handler.h", + "src/client/linux/handler/minidump_descriptor.cc", + "src/client/linux/handler/minidump_descriptor.h", + "src/client/linux/log/log.cc", + "src/client/linux/log/log.h", + "src/client/linux/microdump_writer/microdump_writer.cc", + "src/client/linux/microdump_writer/microdump_writer.h", + "src/client/linux/minidump_writer/cpu_set.h", + "src/client/linux/minidump_writer/directory_reader.h", + "src/client/linux/minidump_writer/line_reader.h", + "src/client/linux/minidump_writer/linux_core_dumper.cc", + "src/client/linux/minidump_writer/linux_core_dumper.h", + "src/client/linux/minidump_writer/linux_dumper.cc", + "src/client/linux/minidump_writer/linux_dumper.h", + "src/client/linux/minidump_writer/linux_ptrace_dumper.cc", + "src/client/linux/minidump_writer/linux_ptrace_dumper.h", + "src/client/linux/minidump_writer/minidump_writer.cc", + "src/client/linux/minidump_writer/minidump_writer.h", + "src/client/linux/minidump_writer/proc_cpuinfo_reader.h", + "src/client/minidump_file_writer-inl.h", + "src/client/minidump_file_writer.cc", + "src/client/minidump_file_writer.h", + "src/common/convert_UTF.c", + "src/common/convert_UTF.h", + "src/common/linux/elf_core_dump.cc", + "src/common/linux/elf_core_dump.h", + "src/common/linux/elfutils.cc", + "src/common/linux/elfutils.h", + "src/common/linux/file_id.cc", + "src/common/linux/file_id.h", + "src/common/linux/google_crashdump_uploader.cc", + "src/common/linux/google_crashdump_uploader.h", + "src/common/linux/guid_creator.cc", + "src/common/linux/guid_creator.h", + "src/common/linux/libcurl_wrapper.cc", + "src/common/linux/libcurl_wrapper.h", + "src/common/linux/linux_libc_support.cc", + "src/common/linux/linux_libc_support.h", + "src/common/linux/memory_mapped_file.cc", + "src/common/linux/memory_mapped_file.h", + "src/common/linux/safe_readlink.cc", + "src/common/linux/safe_readlink.h", + "src/common/memory.h", + "src/common/simple_string_dictionary.cc", + "src/common/simple_string_dictionary.h", + "src/common/string_conversion.cc", + "src/common/string_conversion.h", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + public_configs = [ ":client_config" ] + + if (current_cpu == "arm" && is_chromeos) { + # Avoid running out of registers in + # linux_syscall_support.h:sys_clone()'s inline assembly. + cflags = [ "-marm" ] + } + + # Clang's -mstackrealign doesn't work well with + # linux_syscall_support.h hand written asm syscalls. + # See https://crbug.com/556393 + configs -= [ "//build/config/compiler:clang_stackrealign" ] + + if (is_android) { + sources += [ "src/common/android/breakpad_getcontext.S" ] + } + + libs = [ "dl" ] + + include_dirs = [ + ".", + "src", + "src/client", + "src/third_party/linux/include", + ] + } + + static_library("processor_support") { + set_sources_assignment_filter([]) + sources = [ + "src/common/scoped_ptr.h", + "src/processor/basic_code_modules.cc", + "src/processor/basic_code_modules.h", + "src/processor/dump_context.cc", + "src/processor/dump_object.cc", + "src/processor/logging.cc", + "src/processor/logging.h", + "src/processor/minidump.cc", + "src/processor/pathname_stripper.cc", + "src/processor/pathname_stripper.h", + "src/processor/proc_maps_linux.cc", + ] + + include_dirs = [ + "src", + "src/client", + "src/third_party/linux/include", + ".", + ] + + # There are some warnings in this code. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + } + + test("breakpad_unittests") { + set_sources_assignment_filter([]) + sources = [ + "linux/breakpad_googletest_includes.h", + "src/client/linux/handler/exception_handler_unittest.cc", + "src/client/linux/minidump_writer/cpu_set_unittest.cc", + "src/client/linux/minidump_writer/directory_reader_unittest.cc", + "src/client/linux/minidump_writer/line_reader_unittest.cc", + "src/client/linux/minidump_writer/linux_core_dumper_unittest.cc", + "src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc", + "src/client/linux/minidump_writer/minidump_writer_unittest.cc", + "src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc", + "src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc", + "src/common/linux/elf_core_dump_unittest.cc", + "src/common/linux/file_id_unittest.cc", + "src/common/linux/linux_libc_support_unittest.cc", + "src/common/linux/synth_elf.cc", + "src/common/linux/tests/auto_testfile.h", + "src/common/linux/tests/crash_generator.cc", + "src/common/linux/tests/crash_generator.h", + "src/common/memory_range.h", + "src/common/memory_unittest.cc", + "src/common/simple_string_dictionary_unittest.cc", + "src/common/test_assembler.cc", + "src/common/tests/file_utils.cc", + "src/common/tests/file_utils.h", + "src/tools/linux/md2core/minidump_memory_range.h", + "src/tools/linux/md2core/minidump_memory_range_unittest.cc", + ] + + deps = [ + ":client", + ":linux_dumper_unittest_helper", + ":processor_support", + "//build/config/sanitizers:deps", + "//testing/gmock", + "//testing/gtest", + "//testing/gtest:gtest_main", + ] + + include_dirs = [ + "linux", # Use our copy of breakpad_googletest_includes.h + "src", + ".", + ] + + # There are some warnings in this code. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + if (is_clang) { + # See http://crbug.com/138571#c18 + cflags = [ "-Wno-unused-value" ] + } + + if (is_android) { + use_raw_android_executable = true + sources += [ "src/common/android/breakpad_getcontext_unittest.cc" ] + libs = [ "log" ] + include_dirs += [ "src/common/android/include" ] + extra_dist_files = [ "$root_out_dir/linux_dumper_unittest_helper" ] + } + + # Clang's -mstackrealign doesn't work well with + # linux_syscall_support.h hand written asm syscalls. + # See https://crbug.com/556393 + configs -= [ "//build/config/compiler:clang_stackrealign" ] + + # Add the breakpad unittest config at the end to override all configs. + configs += [ ":breakpad_unittest_config" ] + } + + executable("linux_dumper_unittest_helper") { + set_sources_assignment_filter([]) + testonly = true + sources = [ + "src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc", + ] + deps = [ + ":processor_support", + "//build/config/sanitizers:deps", + ] + + include_dirs = [ "src" ] + + if (current_cpu == "mipsel" && is_android) { + include_dirs += [ "src/common/android/include" ] + } + } + + executable("generate_test_dump") { + set_sources_assignment_filter([]) + testonly = true + sources = [ + "linux/generate-test-dump.cc", + ] + + # This file has an unused variable warning. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + ":client", + "//build/config/sanitizers:deps", + ] + + include_dirs = [ "src" ] + + if (is_android) { + libs = [ "log" ] + include_dirs += [ "src/common/android/include" ] + } + } + + executable("minidump-2-core") { + set_sources_assignment_filter([]) + sources = [ + "src/tools/linux/md2core/minidump-2-core.cc", + ] + + include_dirs = [ "src" ] + + deps = [ + ":client", + "//build/config/sanitizers:deps", + ] + } + + executable("core-2-minidump") { + set_sources_assignment_filter([]) + sources = [ + "src/tools/linux/core2md/core2md.cc", + ] + + deps = [ + ":client", + "//build/config/sanitizers:deps", + ] + + include_dirs = [ "src" ] + } +} + +if (is_ios) { + static_library("client") { + set_sources_assignment_filter([]) + sources = [ + "src/client/ios/Breakpad.h", + "src/client/ios/Breakpad.mm", + "src/client/ios/BreakpadController.h", + "src/client/ios/BreakpadController.mm", + "src/client/ios/handler/ios_exception_minidump_generator.h", + "src/client/ios/handler/ios_exception_minidump_generator.mm", + "src/client/mac/crash_generation/ConfigFile.h", + "src/client/mac/crash_generation/ConfigFile.mm", + "src/client/mac/handler/breakpad_nlist_64.cc", + "src/client/mac/handler/breakpad_nlist_64.h", + "src/client/mac/handler/dynamic_images.cc", + "src/client/mac/handler/dynamic_images.h", + "src/client/mac/handler/exception_handler.cc", + "src/client/mac/handler/exception_handler.h", + "src/client/mac/handler/minidump_generator.cc", + "src/client/mac/handler/minidump_generator.h", + "src/client/mac/handler/protected_memory_allocator.cc", + "src/client/mac/handler/protected_memory_allocator.h", + "src/client/mac/sender/uploader.h", + "src/client/mac/sender/uploader.mm", + "src/client/minidump_file_writer-inl.h", + "src/client/minidump_file_writer.cc", + "src/client/minidump_file_writer.h", + "src/common/convert_UTF.c", + "src/common/convert_UTF.h", + "src/common/mac/HTTPMultipartUpload.m", + "src/common/mac/file_id.cc", + "src/common/mac/file_id.h", + "src/common/mac/macho_id.cc", + "src/common/mac/macho_id.h", + "src/common/mac/macho_utilities.cc", + "src/common/mac/macho_utilities.h", + "src/common/mac/macho_walker.cc", + "src/common/mac/macho_walker.h", + "src/common/mac/string_utilities.cc", + "src/common/mac/string_utilities.h", + "src/common/md5.cc", + "src/common/md5.h", + "src/common/simple_string_dictionary.cc", + "src/common/simple_string_dictionary.h", + "src/common/string_conversion.cc", + "src/common/string_conversion.h", + "src/google_breakpad/common/minidump_format.h", + ] + set_sources_assignment_filter(sources_assignment_filter) + + include_dirs = [ + "src", + "src/client/mac/Framework", + "src/common/mac", + ] + + public_configs = [ ":client_config" ] + + if (is_clang) { + # See https://bugs.chromium.org/p/google-breakpad/issues/detail?id=675. + cflags = [ "-Wno-deprecated-declarations" ] + } + } + # TODO(GYP) There is some XCode-only targets like ninja-breakpad. +} + +if (is_win) { + group("client") { + public_configs = [ ":client_config" ] + } + + config("breakpad_handler_warnings") { + if (is_clang) { + # See https://code.google.com/p/google-breakpad/issues/detail?id=658. + cflags = [ "-Wno-reorder" ] + } + } + + source_set("breakpad_handler") { + configs += [ ":handler_config" ] + if (is_win) { + public_configs = [ ":handler_config" ] + } + + defines = [ "BREAKPAD_NO_TERMINATE_THREAD" ] + + sources = [ + "src/client/windows/crash_generation/client_info.cc", + "src/client/windows/crash_generation/client_info.h", + "src/client/windows/crash_generation/crash_generation_client.cc", + "src/client/windows/crash_generation/crash_generation_client.h", + "src/client/windows/crash_generation/crash_generation_server.cc", + "src/client/windows/crash_generation/crash_generation_server.h", + "src/client/windows/crash_generation/minidump_generator.cc", + "src/client/windows/crash_generation/minidump_generator.h", + "src/client/windows/handler/exception_handler.cc", + "src/client/windows/handler/exception_handler.h", + "src/common/windows/guid_string.cc", + "src/common/windows/guid_string.h", + "src/common/windows/string_utils-inl.h", + "src/google_breakpad/common/minidump_format.h", + ] + configs += [ ":breakpad_handler_warnings" ] + } + + source_set("breakpad_sender") { + sources = [ + "src/client/windows/sender/crash_report_sender.cc", + "src/client/windows/sender/crash_report_sender.h", + "src/common/windows/http_upload.cc", + "src/common/windows/http_upload.h", + ] + configs += [ ":sender_config" ] + public_configs = [ ":sender_config" ] + } +} + +if (is_android) { + # TODO(GYP_GONE) Delete this after we've converted everything to GN. + group("breakpad_unittests_deps") { + testonly = true + deps = [ + ":breakpad_unittests", + ] + } +} diff --git a/chromium/build/android/BUILD.gn b/chromium/build/android/BUILD.gn new file mode 100644 index 00000000000..066dd194794 --- /dev/null +++ b/chromium/build/android/BUILD.gn @@ -0,0 +1,143 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +if (enable_java_templates) { + import("//third_party/ijar/ijar.gni") + + sun_tools_jar_path = "$root_gen_dir/sun_tools_jar/tools.jar" + + # Create or update the API versions cache if necessary by running a + # functionally empty lint task. This prevents racy creation of the + # cache while linting java targets in android_lint. + android_lint("prepare_android_lint_cache") { + android_manifest = "//build/android/AndroidManifest.xml" + create_cache = true + } + + action("find_sun_tools_jar") { + script = "//build/android/gyp/find_sun_tools_jar.py" + depfile = "$target_gen_dir/$target_name.d" + outputs = [ + depfile, + sun_tools_jar_path, + ] + args = [ + "--depfile", + rebase_path(depfile, root_build_dir), + "--output", + rebase_path(sun_tools_jar_path, root_build_dir), + ] + } + + java_prebuilt("sun_tools_java") { + jar_path = sun_tools_jar_path + jar_dep = ":find_sun_tools_jar" + } + + generate_interface_jar("android_ijar") { + input_jar = android_sdk_jar + output_jar = "$root_out_dir/lib.java/android.interface.jar" + } +} + +# Copy to the lib.unstripped directory so that gdb can easily find it. +copy("cpplib_unstripped") { + _soname = "libc++_shared.so" + sources = [ + "${android_libcpp_lib_dir}/${_soname}", + ] + outputs = [ + "${root_out_dir}/lib.unstripped/${_soname}", + ] +} + +action("cpplib_stripped") { + _strip_bin = "${android_tool_prefix}strip" + _soname = "libc++_shared.so" + _input_so = "${root_out_dir}/lib.unstripped/${_soname}" + _output_so = "${root_shlib_dir}/${_soname}" + + deps = [ + ":cpplib_unstripped", + ] + + script = "//build/gn_run_binary.py" + inputs = [ + _strip_bin, + ] + sources = [ + _input_so, + ] + outputs = [ + _output_so, + ] + data = [ + _output_so, + ] + + _rebased_strip_bin = rebase_path(_strip_bin, root_out_dir) + _rebased_input_so = rebase_path(_input_so, root_out_dir) + _rebased_output_so = rebase_path(_output_so, root_out_dir) + args = [ + _rebased_strip_bin, + "--strip-unneeded", + "-o", + _rebased_output_so, + _rebased_input_so, + ] +} + +group("test_runner_py") { + _py_files = read_file("test_runner.pydeps", "list lines") + + # Filter out comments. + set_sources_assignment_filter([ "#*" ]) + sources = _py_files + + data = sources + [ + "devil_chromium.json", + "pylib/gtest/filter/", + "//third_party/android_tools/sdk/build-tools/23.0.1/aapt", + "//third_party/android_tools/sdk/build-tools/23.0.1/dexdump", + "//third_party/android_tools/sdk/build-tools/23.0.1/lib/libc++.so", + "//third_party/android_tools/sdk/build-tools/23.0.1/split-select", + "//third_party/android_tools/sdk/platform-tools/adb", + "//third_party/catapult/third_party/gsutil/", + "//third_party/catapult/devil/devil/devil_dependencies.json", + "//third_party/proguard/lib/proguard.jar", + ] + data_deps = [ + "//tools/swarming_client:isolate_py", + ] +} + +# Create wrapper scripts in out/bin that takes care of setting the +# --output-directory. +_scripts_to_wrap = [ + # TODO(agrieve): Once GYP is no more, delete the checked-in adb_gdb_* scripts + # and generated a script for each android_apk() that has a native library. + "adb_gdb_android_webview_shell", + "adb_gdb_blimp_client", + "adb_gdb_chrome_public", + "adb_gdb_content_shell", + "adb_gdb_cronet_sample", + "adb_gdb_mojo_shell", + "asan_symbolize.py", + "tombstones.py", +] + +_wrapper_targets = [] +foreach(script, _scripts_to_wrap) { + _target_name = get_path_info(script, "name") + "_wrapper" + _wrapper_targets += [ ":$_target_name" ] + wrapper_script(_target_name) { + target = script + } +} + +group("wrapper_scripts") { + deps = _wrapper_targets +} diff --git a/chromium/build/android/gyp/test/BUILD.gn b/chromium/build/android/gyp/test/BUILD.gn new file mode 100644 index 00000000000..2deac1d56f2 --- /dev/null +++ b/chromium/build/android/gyp/test/BUILD.gn @@ -0,0 +1,13 @@ +import("//build/config/android/rules.gni") + +java_library("hello_world_java") { + java_files = [ "java/org/chromium/helloworld/HelloWorldPrinter.java" ] +} + +java_binary("hello_world") { + deps = [ + ":hello_world_java", + ] + java_files = [ "java/org/chromium/helloworld/HelloWorldMain.java" ] + main_class = "org.chromium.helloworld.HelloWorldMain" +} diff --git a/chromium/build/android/incremental_install/BUILD.gn b/chromium/build/android/incremental_install/BUILD.gn new file mode 100644 index 00000000000..3bb4696ea4b --- /dev/null +++ b/chromium/build/android/incremental_install/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +android_library("bootstrap_java") { + # Use .dex rather than .dex.jar to be usable by package_apk(). + dex_path = "$target_gen_dir/bootstrap.dex" + java_files = [ + "java/org/chromium/incrementalinstall/BootstrapApplication.java", + "java/org/chromium/incrementalinstall/BootstrapInstrumentation.java", + "java/org/chromium/incrementalinstall/ClassLoaderPatcher.java", + "java/org/chromium/incrementalinstall/LockFile.java", + "java/org/chromium/incrementalinstall/Reflect.java", + ] + emma_never_instrument = true + run_findbugs_override = false +} diff --git a/chromium/build/android/pylib/device/commands/BUILD.gn b/chromium/build/android/pylib/device/commands/BUILD.gn new file mode 100644 index 00000000000..c6d4b42f31f --- /dev/null +++ b/chromium/build/android/pylib/device/commands/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +group("commands") { + data_deps = [ + ":chromium_commands", + ] +} + +# GYP: //build/android/pylib/device/commands/commands.gyp:chromium_commands +android_library("chromium_commands") { + java_files = [ "java/src/org/chromium/android/commands/unzip/Unzip.java" ] + dex_path = "$root_build_dir/lib.java/chromium_commands.dex.jar" +} diff --git a/chromium/build/android/pylib/remote/device/dummy/BUILD.gn b/chromium/build/android/pylib/remote/device/dummy/BUILD.gn new file mode 100644 index 00000000000..54ca275ea34 --- /dev/null +++ b/chromium/build/android/pylib/remote/device/dummy/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +# GYP: //build/android/pylib/remote/device/dummy/dummy.gyp:remote_device_dummy_apk +android_apk("remote_device_dummy_apk") { + android_manifest = "//build/android/AndroidManifest.xml" + java_files = [ "src/org/chromium/dummy/Dummy.java" ] + apk_name = "remote_device_dummy" + testonly = true +} diff --git a/chromium/build/android/rezip/BUILD.gn b/chromium/build/android/rezip/BUILD.gn new file mode 100644 index 00000000000..b9a39a6920d --- /dev/null +++ b/chromium/build/android/rezip/BUILD.gn @@ -0,0 +1,11 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //build/android/rezip.gyp:rezip_apk_jar +java_library("rezip") { + jar_path = "$root_build_dir/lib.java/rezip_apk.jar" + java_files = [ "RezipApk.java" ] +} diff --git a/chromium/chrome/BUILD.gn b/chromium/chrome/BUILD.gn new file mode 100644 index 00000000000..1c26c3f2901 --- /dev/null +++ b/chromium/chrome/BUILD.gn @@ -0,0 +1,1783 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/buildflag_header.gni") +import("//build/config/chrome_build.gni") +import("//build/config/compiler/compiler.gni") +import("//build/config/features.gni") +import("//build/config/locales.gni") +import("//build/config/sanitizers/sanitizers.gni") +import("//build/config/ui.gni") +import("//build/config/win/console_app.gni") +import("//build/config/win/manifest.gni") +import("//chrome/chrome_repack_locales.gni") +import("//chrome/common/features.gni") +import("//chrome/version.gni") +import("//ui/base/ui_features.gni") + +if (is_android) { + import("//build/config/android/rules.gni") +} else if (is_mac) { + import("//build/compiled_action.gni") + import("//build/config/mac/rules.gni") + import("//build/config/mac/symbols.gni") + import("//build/mac/tweak_info_plist.gni") + import("//build/util/branding.gni") + import("//build/util/version.gni") + import("//build_overrides/v8.gni") + import("//media/cdm/ppapi/cdm_paths.gni") +} + +if (is_win) { + action("reorder_imports") { + script = "//build/win/reorder-imports.py" + + # See comment in chrome_dll.gypi in the hardlink_to_output + # target for why this cannot be 'initial' like the DLL. + inputs = [ + "$root_out_dir/initialexe/chrome.exe", + ] + outputs = [ + "$root_out_dir/chrome.exe", + "$root_out_dir/chrome.exe.pdb", + ] + args = [ + "-i", + rebase_path("$root_out_dir/initialexe", root_build_dir), + "-o", + rebase_path("$root_out_dir", root_build_dir), + "-a", + current_cpu, + ] + deps = [ + ":chrome_initial", + ] + } +} + +if (!is_android && !is_mac) { + group("chrome") { + public_deps = [ + ":chrome_initial", + ] + data_deps = [ + ":chrome_initial", + ] + if (is_win) { + public_deps += [ ":reorder_imports" ] + } + if (use_aura && (is_win || is_linux)) { + data_deps += [ "//chrome/app:mojo_manifests" ] + } + } + + executable("chrome_initial") { + if (is_win) { + output_name = "initialexe/chrome" + } else { + output_name = "chrome" + } + + # Because the sources list varies so significantly per-platform, generally + # each platform lists its own files rather than relying on filtering or + # removing unused files. + sources = [ + "app/chrome_exe_resource.h", + ] + defines = [] + public_deps = [] + deps = [ + "//build/config/sanitizers:deps", + ] + + data = [ + "$root_out_dir/resources.pak", + ] + if (is_linux || is_win) { + data += [ + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/locales/en-US.pak", + "$root_out_dir/locales/fr.pak", + ] + } + + data_deps = [] + + if (is_win) { + sources += [ + "app/chrome_crash_reporter_client_win.cc", + "app/chrome_crash_reporter_client_win.h", + "app/chrome_exe.rc", + "app/chrome_exe_load_config_win.cc", + "app/chrome_exe_main_win.cc", + "app/chrome_watcher_client_win.cc", + "app/chrome_watcher_client_win.h", + "app/chrome_watcher_command_line_win.cc", + "app/chrome_watcher_command_line_win.h", + "app/kasko_client.cc", + "app/kasko_client.h", + "app/main_dll_loader_win.cc", + "app/main_dll_loader_win.h", + "common/crash_keys.cc", + "common/crash_keys.h", + ] + + deps += [ + ":chrome_dll", + ":chrome_exe_version", + ":file_pre_reader", + ":visual_elements_resources", + "//base", + "//breakpad:breakpad_handler", + "//breakpad:breakpad_sender", + "//chrome/app/version_assembly:chrome_exe_manifest", + "//chrome/browser:chrome_process_finder", + "//chrome/chrome_watcher", + "//chrome/chrome_watcher:client", + "//chrome/common:constants", + "//chrome/common:metrics_constants_util_win", + "//chrome/install_static:install_static_util", + "//chrome/installer/util:with_no_strings", + "//chrome_elf", + "//components/browser_watcher:browser_watcher_client", + "//components/crash/content/app", + "//components/crash/core/common", + "//components/flags_ui:switches", + "//components/startup_metric_utils/common", + "//content:sandbox_helper_win", + "//content/public/common:static_switches", + "//crypto", + "//sandbox", + "//ui/gfx", + ] + data_deps = [ + "//chrome/app/version_assembly:version_assembly_manifest", + ] + + if (win_console_app) { + defines += [ "WIN_CONSOLE_APP" ] + } else { + # Set /SUBSYSTEM:WINDOWS for chrome.exe itself, unless a console build + # has been requested. + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + } + + ldflags = [ + "/DELAYLOAD:dbghelp.dll", + "/DELAYLOAD:dwmapi.dll", + "/DELAYLOAD:uxtheme.dll", + "/DELAYLOAD:ole32.dll", + "/DELAYLOAD:oleaut32.dll", + ] + } else if (use_aura) { + # Non-Windows aura entrypoint. + sources += [ "app/chrome_exe_main_aura.cc" ] + } + + if (is_linux) { + sources += [ + "app/chrome_dll_resource.h", + "app/chrome_main.cc", + "app/chrome_main_delegate.cc", + "app/chrome_main_delegate.h", + ] + + deps += [ + # On Linux, link the dependencies (libraries) that make up actual + # Chromium functionality directly into the executable. + ":browser_dependencies", + ":child_dependencies", + ":manpage", + + # Needed to use the master_preferences functions + "//chrome/installer/util:with_no_strings", + "//content/public/app:both", + ] + if (enable_plugins && enable_pdf) { + deps += [ "//pdf" ] + } + + public_deps = [ + ":xdg_mime", # Needs to be public for installer to consume files. + "//chrome/common:features", + ] + + # GYP has this in a 'profiling==0 and linux_disable_pie==0' condition. + # but GN doesn't have either of these flags. + ldflags = [ "-pie" ] + + if (use_pango || use_cairo) { + # Needed for chrome_main.cc initialization of libraries. + configs += [ "//build/config/linux/pangocairo" ] + } + + if (use_x11) { + configs += [ + "//build/config/linux:x11", + "//build/config/linux:xext", + ] + } + + if (enable_package_mash_services) { + deps += [ "//chrome/app/mash" ] + data_deps += [ "//chrome/app:mojo_manifests" ] + } + } + + # These files are used by the installer so we need a public dep. + public_deps += [ + ":packed_extra_resources", + ":packed_resources", + ] + deps += [ + "//components/startup_metric_utils/browser:lib", + + # Precompiled plugins that need to get copied to the output directory. + # On Mac, internal plugins go inside the framework, so these + # dependencies are on chrome.dll. + "//third_party/adobe/flash:flapper_binaries", + ] + + data_deps += [ "//third_party/widevine/cdm:widevinecdmadapter" ] + + if (is_multi_dll_chrome) { + defines += [ "CHROME_MULTIPLE_DLL" ] + data_deps += [ ":chrome_child" ] + } + } +} # !is_android && !is_mac + +if (is_win) { + # This target is a forwarding target to compile the necessary DLLs used + # by Chrome. + group("chrome_dll") { + # TODO(GYP) support incremental_chrome_dll on Windows for faster links in + # developer component builds. When that's supported, this target will need + # to become more complicated. + data_deps = [ + ":main_dll", + ] + if (is_multi_dll_chrome) { + data_deps += [ ":chrome_child" ] + } + } + + shared_library("main_dll") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + defines = [] + ldflags = [] + + sources = [ + "//base/win/dllmain.cc", + "app/chrome_command_ids.h", + "app/chrome_dll.rc", + "app/chrome_dll_resource.h", + "app/chrome_main.cc", + "app/chrome_main_delegate.cc", + "app/chrome_main_delegate.h", + "app/chrome_main_mac.h", + "app/chrome_main_mac.mm", + ] + + deps = [ + ":browser_dependencies", + "//build/config/sanitizers:deps", + "//chrome/common:features", + "//third_party/cld_2", + ] + if (is_win) { + output_name = "chrome" + + deps += [ + ":chrome_dll_manifest", + ":chrome_dll_version", + "//base/trace_event/etw_manifest:chrome_events_win", + "//chrome/app/theme:chrome_unscaled_resources", + "//chrome/install_static:install_static_util", + "//chrome_elf", + "//components/crash/content/app", + "//components/policy", + "//content/app/resources", + "//crypto", + "//net:net_resources", + "//third_party/wtl", + "//ui/views", + ] + + ldflags += [ + "/DELAYLOAD:comdlg32.dll", + "/DELAYLOAD:crypt32.dll", + "/DELAYLOAD:cryptui.dll", + "/DELAYLOAD:dhcpcsvc.dll", + "/DELAYLOAD:dwmapi.dll", + "/DELAYLOAD:imagehlp.dll", + "/DELAYLOAD:imm32.dll", + "/DELAYLOAD:iphlpapi.dll", + "/DELAYLOAD:setupapi.dll", + "/DELAYLOAD:urlmon.dll", + "/DELAYLOAD:winhttp.dll", + "/DELAYLOAD:wininet.dll", + "/DELAYLOAD:winspool.drv", + "/DELAYLOAD:ws2_32.dll", + "/DELAYLOAD:wsock32.dll", + ] + + # This is a large module that can't do incremental linking in some cases. + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + } + + if (use_aura) { + deps += [ "//ui/compositor" ] + } + + if (is_multi_dll_chrome) { + defines += [ "CHROME_MULTIPLE_DLL_BROWSER" ] + deps += [ "//content/public/app:browser" ] + } else { + deps += [ + ":child_dependencies", + "//content/public/app:both", + ] + } + + if (enable_plugins && enable_pdf && !is_multi_dll_chrome) { + deps += [ "//pdf" ] + } + + if (enable_package_mash_services) { + deps += [ "//chrome/app/mash" ] + } + } + + if (is_multi_dll_chrome) { + # This manifest matches what GYP produces. It may not even be necessary. + windows_manifest("chrome_child_manifest") { + sources = [ + as_invoker_manifest, + ] + type = "dll" + } + + shared_library("chrome_child") { + sources = [ + "app/chrome_main.cc", + "app/chrome_main_delegate.cc", + "app/chrome_main_delegate.h", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + defines = [ "CHROME_MULTIPLE_DLL_CHILD" ] + + deps = [ + ":child_dependencies", + ":chrome_child_manifest", + ":chrome_dll_version", + "//build/config/sanitizers:deps", + "//chrome/common:features", + "//components/browser_watcher:browser_watcher_client", + "//components/crash/content/app", + "//content/public/app:child", + ] + + if (is_win) { + deps += [ "//chrome/install_static:install_static_util" ] + + ldflags = [ + "/DELAYLOAD:d3d11.dll", + "/DELAYLOAD:d3d9.dll", + "/DELAYLOAD:dwmapi.dll", + "/DELAYLOAD:dxva2.dll", + "/DELAYLOAD:esent.dll", + "/DELAYLOAD:wininet.dll", + ] + + if (symbol_level == 2) { + # Incremental linking doesn't work on this target in debug mode with + # full symbols, but does work in other cases, including minimal + # symbols. + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += [ "//build/config/win:no_incremental_linking" ] + } + if (chrome_pgo_phase == 1) { + ldflags += [ + "/LTCG:PGINSTRUMENT", + "/PogoSafeMode", + ] + } else if (chrome_pgo_phase == 2) { + ldflags += [ "/LTCG:PGOPTIMIZE" ] + } + } + + deps += [ "//chrome/browser/policy:path_parser" ] + + if (enable_plugins && enable_pdf) { + deps += [ "//pdf" ] + } + } + } +} else if (is_mac) { + chrome_helper_name = chrome_product_full_name + " Helper" + chrome_framework_name = chrome_product_full_name + " Framework" + + group("chrome") { + deps = [ + ":chrome_app", + ] + + data_deps = [ + ":chrome_app", + ] + + if (debug_devtools) { + deps += [ ":devtools_debug_resources" ] + } + + if (is_chrome_branded && is_official_build) { + deps += [ + ":chrome_dsym_archive", + ":chrome_dump_syms", + ] + } + } + + tweak_info_plist("chrome_app_plist") { + info_plist = "app/app-Info.plist" + _keystone_arg = "0" + if (enable_mac_keystone) { + _keystone_arg = "1" + } + args = [ + "--breakpad=0", + "--keystone=$_keystone_arg", + "--scm=1", + "--bundle_id=$chrome_mac_bundle_id", + ] + } + + mac_app_bundle("chrome_app") { + output_name = chrome_product_full_name + + info_plist_target = ":chrome_app_plist" + extra_substitutions = [ + "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", + "CHROMIUM_SHORT_NAME=$chrome_product_short_name", + "CHROMIUM_CREATOR=$chrome_mac_creator_code", + ] + + sources = [ + "app/chrome_exe_main_mac.c", + ] + + extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + ":chrome_app_strings_bundle_data", + ":chrome_resources", + ":chrome_versioned_bundle_data", + "//chrome/common:version_header", + ] + + # Remove the default strip configuration (which strips all symbols) so that + # a saves file can be specified. + if (enable_stripping) { + remove_configs = [ "//build/config/mac:strip_all" ] + + ldflags = + [ "-Wcrl,strip,-s," + rebase_path("app/app.saves", root_build_dir) ] + } + } + + compiled_action("chrome_app_strings") { + tool = "//chrome/tools/mac_helpers:infoplist_strings_tool" + + inputs = [ + chrome_version_file, + ] + + outputs = [] + + foreach(locale, locales) { + if (is_chrome_branded) { + _strings_file = "google_chrome_strings" + } else { + _strings_file = "chromium_strings" + } + + inputs += [ "$root_gen_dir/chrome/${_strings_file}_${locale}.pak" ] + } + + foreach(locale, locales_as_mac_outputs) { + outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlist.strings" ] + } + + args = + [ + "-b", + "${branding_path_component}_strings", + "-v", + rebase_path(chrome_version_file, root_build_dir), + "-g", + rebase_path("$root_gen_dir/chrome", root_build_dir), + "-o", + rebase_path("$target_gen_dir/app_infoplist_strings", root_build_dir), + "-t", + "main", + ] + locales + + if (is_chrome_branded) { + deps = [ + "//chrome/app:google_chrome_strings", + ] + } else { + deps = [ + "//chrome/app:chromium_strings", + ] + } + } + + foreach(locale, locales_as_mac_outputs) { + bundle_data("chrome_app_strings_${locale}_bundle_data") { + sources = [ + "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlist.strings", + ] + outputs = [ + "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}", + ] + public_deps = [ + ":chrome_app_strings", + ] + } + } + group("chrome_app_strings_bundle_data") { + public_deps = [] + foreach(locale, locales_as_mac_outputs) { + public_deps += [ ":chrome_app_strings_${locale}_bundle_data" ] + } + } + + bundle_data("chrome_resources") { + sources = [ + "$root_out_dir/$chrome_mac_bundle_id.manifest", + "app/theme/$branding_path_component/mac/app.icns", + "app/theme/$branding_path_component/mac/document.icns", + "browser/ui/cocoa/applescript/scripting.sdef", + ] + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + public_deps = [ + ":chrome_app_strings", + "//components/policy:chrome_manifest_bundle", + ] + } + + bundle_data("chrome_versioned_bundle_data") { + sources = [ + "$root_out_dir/$chrome_framework_name.framework", + "$root_out_dir/$chrome_helper_name.app", + ] + outputs = [ + "{{bundle_root_dir}}/Versions/$chrome_version_full/{{source_file_part}}", + ] + public_deps = [ + ":chrome_helper_app", + + # keystone_registration_framework copies the framework into the framework + # bundle via a script that performs additional actions, rather than + # relying on a bundle_data to copy it. + ":keystone_registration_framework", + + # verify_chrome_framework_order depends on :chrome_framework and, for + # non-component builds, will ensure the export symbol table is correct. + ":verify_chrome_framework_order", + ] + } + + tweak_info_plist("chrome_helper_plist") { + info_plist = "app/helper-Info.plist" + args = [ + "--breakpad=0", + "--keystone=0", + "--scm=0", + ] + } + + mac_app_bundle("chrome_helper_app") { + output_name = chrome_helper_name + + info_plist_target = ":chrome_helper_plist" + extra_substitutions = [ + "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", + "CHROMIUM_SHORT_NAME=$chrome_product_short_name", + ] + + sources = [ + "app/chrome_exe_main_mac.c", + ] + + extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] + + defines = [ "HELPER_EXECUTABLE" ] + + deps = [ + "//chrome/common:version_header", + ] + + ldflags = [ + # The helper is in Chromium.app/Contents/Versions/X/Chromium Helper.app/Conents/MacOS/ + # so set rpath up to the base. + "-rpath", + "@loader_path/../../../../../../..", + ] + + # Remove the default strip configuration (which strips all symbols) so that + # a saves file can be specified. + if (enable_stripping) { + remove_configs = [ "//build/config/mac:strip_all" ] + + ldflags += + [ "-Wcrl,strip,-s," + rebase_path("app/app.saves", root_build_dir) ] + } + } + + bundle_data("chrome_framework_locales") { + sources = [] + public_deps = [ + ":repack_locales_pack", + ] + + foreach(locale, locales_as_mac_outputs) { + sources += [ "$root_gen_dir/repack/locales/$locale.pak" ] + } + + outputs = [ + "{{bundle_resources_dir}}/{{source_name_part}}.lproj/locale.pak", + ] + } + + bundle_data("chrome_framework_helpers") { + sources = [ + "$root_out_dir/crashpad_handler", + ] + + outputs = [ + "{{bundle_root_dir}}/Helpers/{{source_file_part}}", + ] + + public_deps = [ + "//third_party/crashpad/crashpad/handler:crashpad_handler", + ] + } + + bundle_data("chrome_framework_resources") { + sources = [ + # This image is used to badge the lock icon in the + # authentication dialogs, such as those used for installation + # from disk image and Keystone promotion (if so enabled). It + # needs to exist as a file on disk and not just something in a + # resource bundle because that's the interface that + # Authorization Services uses. Also, Authorization Services + # can't deal with .icns files. + "$root_gen_dir/repack/resources.pak", + "$root_out_dir/app_mode_loader.app", + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/icudtl.dat", + "app/theme/default_100_percent/$branding_path_component/product_logo_32.png", + "browser/mac/install.sh", + ] + + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + + public_deps = [ + ":packed_extra_resources", + ":packed_resources", + "//chrome/app_shim:app_mode_loader", + "//third_party/icu:icudata", + ] + + if (enable_hidpi) { + sources += [ "$root_out_dir/chrome_200_percent.pak" ] + } + + # TODO(estade): remove material design specific resources. + # See crbug.com/613593 + if (is_mac) { + sources += [ "$root_out_dir/chrome_material_100_percent.pak" ] + + if (enable_hidpi) { + sources += [ "$root_out_dir/chrome_material_200_percent.pak" ] + } + } + + if (enable_mac_keystone) { + sources += [ + "browser/mac/keystone_promote_postflight.sh", + "browser/mac/keystone_promote_preflight.sh", + ] + } + + if (v8_use_external_startup_data) { + sources += [ + "$root_out_dir/natives_blob.bin", + "$root_out_dir/snapshot_blob.bin", + ] + public_deps += [ "//v8" ] + } + } + + # When debug_devtools is enabled, symlink the inspector resources into the + # framework bundle. The resources go into the final output directory for the + # framework in the app bundle, rather than the framework bundle in + # root_out_dir, since copy_bundle_data copies the contents of the link + # rather than the link itself. + action("devtools_debug_resources") { + _stamp = "$target_out_dir/run_${target_name}.stamp" + + outputs = [ + _stamp, + ] + + script = "//build/symlink.py" + args = [ + "-f", + "--touch", + rebase_path(_stamp, root_out_dir), + + # Convert the symlink source and destination to an absolute paths, which + # makes symlinking easier (now pwd manipulation). + rebase_path("$root_out_dir/resources/inspector"), + rebase_path( + "$root_out_dir/$chrome_product_full_name.app/Contents/Versions/$chrome_version_full/$chrome_framework_name.framework/Resources/inspector"), + ] + + deps = [ + # Depend on :chrome_app to ensure that the bundle is produced before + # creating or destroying the symlink. + ":chrome_app", + "//third_party/WebKit/public:blink_devtools_frontend_resources", + ] + } + + if (enable_nacl) { + bundle_data("chrome_framework_plugins") { + sources = [] + outputs = [ + "{{bundle_root_dir}}/Internet Plug-Ins/{{source_file_part}}", + ] + public_deps = [] + + if (enable_nacl) { + sources += [ "$root_out_dir/nacl_irt_x86_64.nexe" ] + public_deps += [ "//ppapi/native_client:irt" ] + } + } + } else { + group("chrome_framework_plugins") { + } + } + + if (is_chrome_branded) { + bundle_data("flash_player_plugin") { + sources = [ + "$root_out_dir/PepperFlash/PepperFlashPlayer.plugin", + "$root_out_dir/PepperFlash/manifest.json", + ] + outputs = [ + "{{bundle_root_dir}}/Internet Plug-Ins/PepperFlash/{{source_file_part}}", + ] + public_deps = [ + "//third_party/adobe/flash:flapper_binaries", + ] + } + + bundle_data("widevine_cdm_library_binaries") { + sources = [ + "$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib", + "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin", + ] + outputs = [ + "{{bundle_root_dir}}/Libraries/$widevine_cdm_path/{{source_file_part}}", + ] + public_deps = [ + "//third_party/widevine/cdm:widevinecdm", + "//third_party/widevine/cdm:widevinecdmadapter", + ] + } + + bundle_data("widevine_cdm_library_manifest") { + sources = [ + "$root_out_dir/WidevineCdm/manifest.json", + ] + outputs = [ + "{{bundle_root_dir}}/Libraries/WidevineCdm/{{source_file_part}}", + ] + public_deps = [ + "//third_party/widevine/cdm:widevine_cdm_manifest", + ] + } + } else { + group("flash_player_plugin") { + } + } + + group("widevine_cdm_library") { + if (is_chrome_branded) { + deps = [ + ":widevine_cdm_library_binaries", + ":widevine_cdm_library_manifest", + ] + } + } + + if (enable_mac_keystone) { + action("keystone_registration_framework") { + script = "//chrome/tools/build/mac/copy_keystone_framework.py" + + framework_path = "//third_party/googlemac/Releases/Keystone/KeystoneRegistration.framework" + output_path = "$root_out_dir/$chrome_framework_name.framework/Frameworks/" + + sources = [ + framework_path, + script, + ] + + args = [ + rebase_path(framework_path, root_out_dir), + rebase_path(output_path, root_out_dir), + ] + + outputs = [ + "$output_path/KeystoneRegistration.framework", + ] + } + } else { + group("keystone_registration_framework") { + } + } + + tweak_info_plist("chrome_framework_plist") { + info_plist = "app/framework-Info.plist" + _breakpad_uploads_arg = "0" + if (enable_mac_crash_collection) { + _breakpad_uploads_arg = "1" + } + args = [ + "--breakpad=1", + "--breakpad_uploads=$_breakpad_uploads_arg", + "--keystone=0", + "--scm=1", + "--branding", + chrome_product_short_name, + ] + } + + # On Mac, speed up the component build by not re-bundling the framework + # every time it changes. Instead, place all the sources and their deps in + # a library that the bundled framework links (and re-exports). That way + # only the library needs to be re-linked when it changes. + if (is_component_build) { + _dll_target_type = "shared_library" + } else { + _dll_target_type = "source_set" + } + target(_dll_target_type, "chrome_dll") { + visibility = [ + ":chrome_framework", + ":chrome_framework_shared_library", + ] + + sources = [ + "app/chrome_command_ids.h", + "app/chrome_crash_reporter_client.cc", + "app/chrome_crash_reporter_client.h", + "app/chrome_crash_reporter_client_mac.mm", + "app/chrome_dll_resource.h", + "app/chrome_main.cc", + "app/chrome_main_delegate.cc", + "app/chrome_main_delegate.h", + "app/chrome_main_mac.h", + "app/chrome_main_mac.mm", + ] + + deps = [ + ":browser_dependencies", + ":child_dependencies", + "//chrome/common:features", + "//components/crash/content/app", + "//components/policy", + "//content/public/app:both", + "//third_party/cld_2", + ] + + if (is_component_build) { + libs = [ "Carbon.framework" ] + } + + ldflags = [ + "-Wl,-order_file", + "-Wl," + rebase_path("app/framework.order", root_build_dir), + "-ObjC", + ] + + if (enable_plugins && enable_pdf) { + deps += [ "//pdf" ] + } + + if (enable_package_mash_services) { + deps += [ "//chrome/app/mash" ] + } + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + } + + mac_framework_bundle("chrome_framework") { + output_name = chrome_framework_name + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + info_plist_target = ":chrome_framework_plist" + extra_substitutions = [ + "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", + "CHROMIUM_SHORT_NAME=$chrome_product_short_name", + ] + + public_deps = [ + ":chrome_dll", + ] + + deps = [ + ":chrome_framework_helpers", + ":chrome_framework_locales", + ":chrome_framework_plugins", + ":chrome_framework_resources", + ":flash_player_plugin", + ":widevine_cdm_library", + "//build/config/sanitizers:deps", + "//chrome/app/nibs:chrome_xibs", + ] + + if (is_chrome_branded) { + deps += [ ":default_apps" ] + } + + ldflags = [ + "-Wl,-install_name,@executable_path/../Versions/$chrome_version_full/$chrome_framework_name.framework/$chrome_framework_name", + "-compatibility_version", + chrome_dylib_version, + "-current_version", + chrome_dylib_version, + "-Wl,-order_file," + rebase_path("app/framework.order", root_build_dir), + ] + + if (is_component_build) { + ldflags += [ + "-rpath", + "@loader_path/../../../../..", + "-Wl,-reexport_library,libchrome_dll.dylib", + ] + + data_deps = [ + ":chrome_dll", + ] + } + } + + if (!is_asan && !is_component_build) { + action("verify_chrome_framework_order") { + script = "//chrome/tools/build/mac/run_verify_order.py" + stamp_file = "$target_out_dir/run_$target_name.stamp" + inputs = [ + script, + "//chrome/tools/build/mac/verify_order", + ] + args = [ + "--stamp", + rebase_path(stamp_file, root_out_dir), + "_ChromeMain", + rebase_path( + "$root_out_dir/$chrome_framework_name.framework/$chrome_framework_name", + root_out_dir), + ] + outputs = [ + stamp_file, + ] + public_deps = [ + ":chrome_framework", + ] + } + } else { + group("verify_chrome_framework_order") { + public_deps = [ + ":chrome_framework", + ] + } + } + + if (enable_dsyms) { + # This list must be updated with the two targets' deps list below, and + # the list of _dsyms in :chrome_dsym_archive. + _chrome_symbols_sources = [ + "$root_out_dir/$chrome_framework_name.framework/$chrome_framework_name", + "$root_out_dir/$chrome_helper_name.app/Contents/MacOS/$chrome_helper_name", + "$root_out_dir/$chrome_product_full_name.app/Contents/MacOS/$chrome_product_full_name", + "$root_out_dir/crashpad_handler", + ] + + # It is possible to run dump_syms on unstripped products without dSYMs, + # but doing so isn't logical and won't happen in practice. + action_foreach("chrome_dump_syms") { + script = "//build/redirect_stdout.py" + + sources = _chrome_symbols_sources + + outputs = [ + "$root_out_dir/{{source_file_part}}-$chrome_version_full.breakpad", + ] + + # Use an aboslute path to dump_syms in case a user has it in their path. + args = rebase_path(outputs, root_out_dir) + [ + rebase_path("$root_out_dir/dump_syms"), + "-g", + rebase_path( + "$root_out_dir/{{source_name_part}}.dSYM/Contents/Resources/DWARF/{{source_name_part}}", + root_out_dir), + "{{source}}", + ] + + deps = [ + ":chrome_app", + ":chrome_framework", + ":chrome_helper_app", + "//breakpad:dump_syms", + "//third_party/crashpad/crashpad/handler:crashpad_handler", + ] + } + + action("chrome_dsym_archive") { + script = "//chrome/tools/build/mac/archive_symbols.py" + + # These are the dSYMs that will be archived. The sources list must be + # are the target outputs that correspond to the dSYMs (since a dSYM is + # a directory it cannot be listed as a source file). The targets that + # generate both the dSYM and binary image are listed in deps. + _dsyms = [ + "$root_out_dir/$chrome_framework_name.dSYM", + "$root_out_dir/$chrome_helper_name.dSYM", + "$root_out_dir/$chrome_product_full_name.dSYM", + "$root_out_dir/crashpad_handler.dSYM", + ] + + sources = _chrome_symbols_sources + + _output = "$root_out_dir/$chrome_product_full_name.dSYM.tar.bz2" + + outputs = [ + _output, + ] + + args = [ rebase_path(_output, root_out_dir) ] + + rebase_path(_dsyms, root_out_dir) + + deps = [ + ":chrome_app", + ":chrome_framework", + ":chrome_helper_app", + "//third_party/crashpad/crashpad/handler:crashpad_handler", + ] + } + } else { + group("chrome_dump_syms") { + } + group("chrome_symbol_archive") { + } + } +} + +# GYP version: chromium_browser_dependencies variable in chrome.gyp +group("browser_dependencies") { + public_deps = [ + "//chrome/browser", + "//chrome/common", + "//sync", + ] + if (enable_plugins) { + public_deps += [ "//ppapi/host" ] + } + + if (enable_basic_printing || enable_print_preview) { + public_deps += [ "//printing" ] + if (enable_print_preview) { + public_deps += [ "//chrome/service" ] + } + } + + if (!is_component_build) { + assert_no_deps = [ + # Blink and V8 should not be used in the browser process. In component + # build this is OK because all of content is linked into one library. + # Note that the blink_headers target is OK, so we can't do a wildcard for + # all blink targets. + "//third_party/WebKit/public:blink", + # TODO(brettw) bug 581766: V8 should not be linked into the browser + # process, and then we can enable this. + #"//v8/*", + ] + } +} + +# GYP version: chromium_child_dependencies variable in chrome.gyp +group("child_dependencies") { + public_deps = [ + "//chrome/common", + "//sync", + ] + if (!is_ios) { + public_deps += [ + "//chrome/browser/devtools", + "//chrome/child", + "//chrome/gpu", + "//chrome/renderer", + "//chrome/utility", + "//content/public/child", + "//third_party/WebKit/public:blink_devtools_frontend_resources", + ] + } + + if (enable_nacl) { + public_deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ] + } +} + +if (is_win) { + process_version("chrome_exe_version") { + template_file = chrome_version_rc_template + sources = [ + "app/chrome_exe.ver", + ] + output = "$target_gen_dir/chrome_exe_version.rc" + } + + process_version("chrome_dll_version") { + template_file = chrome_version_rc_template + sources = [ + "app/chrome_dll.ver", + ] + output = "$target_gen_dir/chrome_dll_version.rc" + } + + # This manifest matches what GYP produces. It may not even be necessary. + windows_manifest("chrome_dll_manifest") { + sources = [ + as_invoker_manifest, + common_controls_manifest, + ] + type = "dll" + } + + process_version("nacl64_exe_version") { + template_file = chrome_version_rc_template + sources = [ + "app/nacl64_exe.ver", + ] + output = "$target_gen_dir/nacl64_exe_version.rc" + } + + process_version("other_version") { + template_file = chrome_version_rc_template + sources = [ + "app/other.ver", + ] + output = "$target_gen_dir/other_version.rc" + } + + source_set("file_pre_reader") { + sources = [ + "app/file_pre_reader_win.cc", + "app/file_pre_reader_win.h", + ] + deps = [ + "//base", + "//components/startup_metric_utils/common", + ] + } +} + +# GYP version: chrome/chrome_exe.gypi:visual_elements_resources +copy("visual_elements_resources") { + sources = [ + "app/visual_elements_resources/Logo.png", + "app/visual_elements_resources/SecondaryTile.png", + "app/visual_elements_resources/SmallLogo.png", + "app/visual_elements_resources/chrome.VisualElementsManifest.xml", + ] + + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] +} + +# GYP version: chrome/chrome_resources.gyp:chrome_resources +group("resources") { + public_deps = [ + # Note: GYP lists some dependencies in addition to these actions. However, + # these are just dependencies for the actions themselves, which our actions + # list individually when needed. + "//chrome/browser:resources", + "//chrome/common:resources", + "//chrome/renderer:resources", + ] + + if (enable_extensions) { + public_deps += [ "//chrome/common:extensions_api_resources" ] + } +} + +# GYP version: chrome/chrome_resources.gyp:chrome_extra_resources +group("extra_resources") { + public_deps = [ + "//chrome/browser/resources:invalidations_resources", + "//chrome/browser/resources:net_internals_resources", + "//chrome/browser/resources:password_manager_internals_resources", + "//chrome/browser/resources:policy_resources", + "//chrome/browser/resources:translate_internals_resources", + ] + if (!is_ios) { + public_deps += [ + "//chrome/browser/resources:component_extension_resources", + "//chrome/browser/resources:options_resources", + "//chrome/browser/resources:settings_resources", + ] + } + + if (is_chromeos) { + public_deps += [ "//chrome/browser/resources/chromeos/chromevox" ] + } + + if (enable_extensions) { + public_deps += [ + "//chrome/browser/resources:quota_internals_resources", + "//chrome/browser/resources:sync_file_system_internals_resources", + ] + } +} + +if (is_chrome_branded) { + if (!is_mac) { + _default_apps_target_type = "copy" + } else { + _default_apps_target_type = "bundle_data" + } + + target(_default_apps_target_type, "default_apps") { + visibility = [ ":packed_resources" ] + if (is_mac) { + visibility += [ + ":chrome_framework", + ":chrome_framework_shared_library", + ] + } + + sources = [ + "browser/resources/default_apps/docs.crx", + "browser/resources/default_apps/drive.crx", + "browser/resources/default_apps/external_extensions.json", + "browser/resources/default_apps/gmail.crx", + "browser/resources/default_apps/youtube.crx", + ] + + if (!is_mac) { + outputs = [ + "$root_out_dir/default_apps/{{source_file_part}}", + ] + } else { + outputs = [ + "{{bundle_root_dir}}/Default Apps/{{source_file_part}}", + ] + } + + # Force anybody that depends on this to get the default apps as data files. + data = process_file_template(sources, outputs) + } +} + +group("packed_resources") { + public_deps = [ + ":repack_chrome_100_percent", + ":repack_locales_pack", + ":repack_pseudo_locales_pack", + ] + + if (is_chrome_branded && !is_mac) { + public_deps += [ ":default_apps" ] + } + + if (enable_hidpi) { + public_deps += [ ":repack_chrome_200_percent" ] + } + + if (is_mac) { + public_deps += [ ":repack_chrome_material_100_percent" ] + + if (enable_hidpi) { + public_deps += [ ":repack_chrome_material_200_percent" ] + } + } +} + +repack("packed_extra_resources") { + visibility = [ "./*" ] + sources = [ + "$root_gen_dir/chrome/browser_resources.pak", + "$root_gen_dir/chrome/chrome_unscaled_resources.pak", + "$root_gen_dir/chrome/common_resources.pak", + "$root_gen_dir/chrome/invalidations_resources.pak", + "$root_gen_dir/chrome/net_internals_resources.pak", + "$root_gen_dir/chrome/password_manager_internals_resources.pak", + "$root_gen_dir/chrome/policy_resources.pak", + "$root_gen_dir/chrome/translate_internals_resources.pak", + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/net/net_resources.pak", + "$root_gen_dir/ui/resources/webui_resources.pak", + ] + deps = [ + "//chrome/app/theme:chrome_unscaled_resources", + "//chrome/browser:resources", + "//chrome/browser/resources:invalidations_resources", + "//chrome/browser/resources:net_internals_resources", + "//chrome/browser/resources:password_manager_internals_resources", + "//chrome/browser/resources:policy_resources", + "//chrome/browser/resources:translate_internals_resources", + "//chrome/common:resources", + "//components/resources", + "//net:net_resources", + "//ui/resources", + ] + + if (!is_ios && !is_android) { + # New paks should be added here by default. + sources += [ + "$root_gen_dir/blink/devtools_resources.pak", + "$root_gen_dir/chrome/component_extension_resources.pak", + "$root_gen_dir/chrome/options_resources.pak", + "$root_gen_dir/chrome/quota_internals_resources.pak", + "$root_gen_dir/chrome/settings_resources.pak", + "$root_gen_dir/chrome/sync_file_system_internals_resources.pak", + ] + deps += [ + "//chrome/browser/resources:component_extension_resources", + "//chrome/browser/resources:options_resources", + "//chrome/browser/resources:quota_internals_resources", + "//chrome/browser/resources:settings_resources", + "//chrome/browser/resources:sync_file_system_internals_resources", + "//content/browser/devtools:devtools_resources", + ] + } + if (!is_ios) { + sources += [ + "$root_gen_dir/blink/public/resources/blink_resources.pak", + "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + ] + deps += [ + "//content:resources", + "//content/browser/tracing:resources", + "//third_party/WebKit/public:resources", + ] + } + if (is_chromeos) { + sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ] + deps += [ "//ui/file_manager:resources" ] + } + if (enable_extensions) { + sources += [ + "$root_gen_dir/chrome/extensions_api_resources.pak", + "$root_gen_dir/extensions/extensions_renderer_resources.pak", + "$root_gen_dir/extensions/extensions_resources.pak", + ] + deps += [ + "//chrome/common:extensions_api_resources", + "//extensions:extensions_resources", + ] + } + + # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms + # it them copies it. This skipes the copy step and writes it to the final + # location. + if (is_mac || is_ios) { + output = "$root_gen_dir/repack/resources.pak" + } else { + output = "$root_out_dir/resources.pak" + } +} + +# GYP version: chrome/chrome_resources.gyp:browser_tests_pak +repack("browser_tests_pak") { + sources = [ + "$root_gen_dir/chrome/options_test_resources.pak", + "$root_gen_dir/chrome/webui_test_resources.pak", + ] + output = "$root_out_dir/browser_tests.pak" + deps = [ + "//chrome/browser/resources:options_test_resources", + "//chrome/test/data:webui_test_resources", + ] +} + +# Collects per-locale grit files from many sources into global per-locale files. +chrome_repack_locales("repack_locales_pack") { + visibility = [ ":*" ] + + input_locales = locales + + if (is_mac) { + output_locales = locales_as_mac_outputs + } else { + output_locales = locales + } +} + +chrome_repack_locales("repack_pseudo_locales_pack") { + visibility = [ ":*" ] + + input_locales = [ "fake-bidi" ] + + if (is_mac) { + output_locales = [ "fake_bidi" ] # Mac uses underscores. + } else { + output_locales = [ "fake-bidi" ] + } +} + +# Generates a rule to repack a set of resources, substituting a given string +# in for the percentage (e.g. "100", "200"). It generates the repacked files in +# the "gen" directory, and then introduces a copy rule to copy it to the root +# build directory. +# +# It's not clear why this two-step dance is necessary as opposed to just +# generating the file in the destination. However, this is what the GYP build +# does, and for maintenance purposes, this keeps the same files in the same +# place between the two builds when possible. +# +# Argument: +# percent [required] +# String to substitute for the percentage. +template("chrome_repack_percent") { + percent = invoker.percent + + repack_name = "${target_name}_repack" + repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak" + + copy_name = target_name + + repack(repack_name) { + visibility = [ ":$copy_name" ] + + # All sources should also have deps for completeness. + sources = [ + "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak", + "$root_gen_dir/chrome/theme_resources_${percent}_percent.pak", + "$root_gen_dir/components/components_resources_${percent}_percent.pak", + "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak", + ] + + deps = [ + "//chrome/app/theme:theme_resources", + "//chrome/renderer:resources", + "//components/resources", + "//components/strings", + "//net:net_resources", + "//ui/resources", + ] + + if (!is_ios) { + sources += [ + "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak", + "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak", + ] + deps += [ + "//content/app/resources", + "//third_party/WebKit/public:image_resources", + ] + } + if (use_ash) { + sources += + [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ] + deps += [ "//ash/resources" ] + } + if (toolkit_views) { + sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ] + deps += [ "//ui/views/resources" ] + } + if (is_chromeos) { + sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ] + deps += [ "//ui/chromeos/resources" ] + } + if (enable_extensions) { + sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ] + deps += [ "//extensions:extensions_browser_resources" ] + } + if (enable_app_list) { + sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak" ] + deps += [ "//ui/app_list/resources" ] + } + + output = repack_output_file + } + + copy(copy_name) { + visibility = [ ":*" ] + deps = [ + ":$repack_name", + ] + sources = [ + repack_output_file, + ] + outputs = [ + "$root_build_dir/chrome_${percent}_percent.pak", + ] + } +} + +chrome_repack_percent("repack_chrome_100_percent") { + percent = "100" +} + +if (enable_hidpi) { + chrome_repack_percent("repack_chrome_200_percent") { + percent = "200" + } +} + +# Generates a rule to repack a set of material design resources for the browser +# top chrome, substituting a given string in for the percentage (e.g. "100", +# "200"). +template("chrome_repack_material_percent") { + percent = invoker.percent + + repack_name = "${target_name}_repack" + repack_output_file = + "$root_gen_dir/repack/chrome_material_${percent}_percent.pak" + + copy_name = target_name + + repack(repack_name) { + visibility = [ ":$copy_name" ] + + # All sources should also have deps for completeness. + sources = [ + "$root_gen_dir/chrome/theme_resources_material_${percent}_percent.pak", + ] + + deps = [ + "//chrome/app/theme:theme_resources", + "//components/resources", + ] + + output = repack_output_file + } + + copy(copy_name) { + visibility = [ ":*" ] + deps = [ + ":$repack_name", + ] + sources = [ + repack_output_file, + ] + outputs = [ + "$root_build_dir/chrome_material_${percent}_percent.pak", + ] + } +} + +if (is_mac) { + chrome_repack_material_percent("repack_chrome_material_100_percent") { + percent = "100" + } + + if (enable_hidpi) { + chrome_repack_material_percent("repack_chrome_material_200_percent") { + percent = "200" + } + } +} + +# GYP version: chrome/chrome_resources.gyp:chrome_strings +group("strings") { + public_deps = [ + "//chrome/app:chromium_strings", + "//chrome/app:generated_resources", + "//chrome/app:google_chrome_strings", + "//chrome/app:settings_chromium_strings", + "//chrome/app:settings_google_chrome_strings", + "//chrome/app:settings_strings", + "//chrome/app/resources:locale_settings", + ] +} + +if (is_android) { + # GYP: //chrome/chrome.gyp:data_use_ui_message_enum_java + java_cpp_enum("data_use_ui_message_enum_javagen") { + sources = [ + "browser/android/data_usage/data_use_tab_ui_manager_android.cc", + ] + } + + # GYP: //chrome/chrome.gyp:content_setting_java + java_cpp_enum("content_setting_javagen") { + sources = [ + "../components/content_settings/core/common/content_settings.h", + ] + } + + # GYP: //chrome/chrome.gyp:content_settings_type_java + java_cpp_enum("content_settings_type_javagen") { + sources = [ + "../components/content_settings/core/common/content_settings_types.h", + ] + } + + # GYP: //chrome/chrome.gyp:signin_metrics_enum_java + java_cpp_enum("signin_metrics_enum_javagen") { + sources = [ + "../components/signin/core/browser/signin_metrics.h", + ] + } + + # GYP: //chrome/chrome.gyp:page_info_connection_type_java + java_cpp_enum("page_info_connection_type_javagen") { + sources = [ + "browser/ui/android/website_settings_popup_android.h", + ] + } + + # GYP: //chrome/chrome.gyp:website_settings_action_java + java_cpp_enum("website_settings_action_javagen") { + sources = [ + "browser/ui/website_settings/website_settings.h", + ] + } + + # GYP: //chrome/chrome_android.gypi:chrome_android_core + source_set("chrome_android_core") { + sources = [ + "app/android/chrome_android_initializer.cc", + "app/android/chrome_android_initializer.h", + "app/android/chrome_jni_onload.cc", + "app/android/chrome_jni_onload.h", + "app/android/chrome_main_delegate_android.cc", + "app/android/chrome_main_delegate_android.h", + "app/chrome_main_delegate.cc", + "app/chrome_main_delegate.h", + ] + + include_dirs = [ android_ndk_include_dir ] + + libs = [ + "android", + "jnigraphics", + ] + + deps = [ + "//chrome/browser", + "//chrome/browser/ui", + "//chrome/child", + "//chrome/common", + "//chrome/gpu", + "//chrome/renderer", + "//chrome/utility", + "//components/safe_browsing_db:safe_browsing_db_mobile", + "//content/public/app:both", + ] + } +} + +if (is_linux) { + action("manpage") { + if (is_chrome_branded) { + name = "Google Chrome" + filename = "google-chrome" + confdir = "google-chrome" + } else { + name = "Chromium" + filename = "chromium-browser" + confdir = "chromium" + } + + script = "//chrome/tools/build/linux/sed.py" + infile = "app/resources/manpage.1.in" + inputs = [ + infile, + ] + + outfile = "$root_out_dir/chrome.1" + outputs = [ + outfile, + ] + + args = [ + rebase_path(infile, root_build_dir), + rebase_path(outfile, root_build_dir), + "-e s/@@NAME@@/$name/", + "-e s/@@FILENAME@@/$filename/", + "-e s/@@CONFDIR@@/$confdir/", + ] + } + + if (is_official_build) { + action("linux_symbols") { + script = "//build/linux/dump_app_syms.py" + + dump_syms_label = "//breakpad:dump_syms($host_toolchain)" + dump_syms_binary = + get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms" + + chrome_binary = "$root_out_dir/chrome" + if (current_cpu == "x86") { + # Use "ia32" instead of "x86" for GYP compat. + symbol_file = "$root_out_dir/chrome.breakpad.ia32" + } else { + symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu" + } + + inputs = [ + chrome_binary, + dump_syms_binary, + ] + outputs = [ + symbol_file, + ] + + args = [ + "./" + rebase_path(dump_syms_binary, root_build_dir), + "0", # strip_binary = false + rebase_path(chrome_binary, root_build_dir), + rebase_path(symbol_file, root_build_dir), + ] + + deps = [ + ":chrome", + dump_syms_label, + ] + } + } + + # Copies some scripts and resources that are used for desktop integration. + copy("xdg_mime") { + sources = [ + "//chrome/app/theme/$branding_path_component/product_logo_48.png", + "//chrome/tools/build/linux/chrome-wrapper", + "//third_party/xdg-utils/scripts/xdg-mime", + "//third_party/xdg-utils/scripts/xdg-settings", + ] + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] + } +} diff --git a/chromium/chrome/android/BUILD.gn b/chromium/chrome/android/BUILD.gn new file mode 100644 index 00000000000..e4a0591e4c5 --- /dev/null +++ b/chromium/chrome/android/BUILD.gn @@ -0,0 +1,602 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") +import("//build_overrides/v8.gni") +import("//chrome/android/chrome_public_apk_tmpl.gni") +import("//chrome/common/features.gni") +import("//chrome/version.gni") +import("//testing/test.gni") +import("//third_party/icu/config.gni") +import("//third_party/protobuf/proto_library.gni") +import("channel.gni") +import("java_sources.gni") + +manifest_package = "org.chromium.chrome" + +chrome_public_jinja_variables = default_chrome_public_jinja_variables + + [ "manifest_package=$manifest_package" ] + +chrome_sync_shell_jinja_variables = + default_chrome_public_jinja_variables + + [ "manifest_package=org.chromium.chrome.sync_shell" ] + +chrome_apk_gypi = exec_script("//build/gypi_to_gn.py", + [ rebase_path("chrome_apk.gyp") ], + "scope", + [ "chrome_apk.gyp" ]) + +chrome_android_paks_gypi = + exec_script("//build/gypi_to_gn.py", + [ + rebase_path("//chrome/chrome_android_paks.gypi"), + "--replace=<(PRODUCT_DIR)=$root_out_dir", + ], + "scope", + [ "//chrome/chrome_android_paks.gypi" ]) + +locale_pak_resources("chrome_locale_paks") { + sources = chrome_android_paks_gypi.chrome_android_pak_locale_resources + + deps = [ + "//chrome:packed_resources", + ] +} + +# GYP: //chrome/chrome.gyp:chrome_java (resources part) +android_resources("chrome_java_resources") { + resource_dirs = [ + "java/res", + "//chrome/android/java/res_chromium", + ] + deps = [ + ":chrome_locale_paks", + ":chrome_strings_grd", + "//chrome/app:java_strings_grd", + "//components/policy:app_restrictions_resources", + "//components/strings:components_locale_settings_grd", + "//components/strings:components_strings_grd", + "//content/public/android:content_java_resources", + "//third_party/android_data_chart:android_data_chart_java_resources", + "//third_party/android_media:android_media_resources", + ] + custom_package = "org.chromium.chrome" +} + +# GYP: //chrome/chrome.gyp:chrome_strings_grd +java_strings_grd("chrome_strings_grd") { + grd_file = "java/strings/android_chrome_strings.grd" + outputs = [ + "values-am/android_chrome_strings.xml", + "values-ar/android_chrome_strings.xml", + "values-bg/android_chrome_strings.xml", + "values-ca/android_chrome_strings.xml", + "values-cs/android_chrome_strings.xml", + "values-da/android_chrome_strings.xml", + "values-de/android_chrome_strings.xml", + "values-el/android_chrome_strings.xml", + "values/android_chrome_strings.xml", + "values-en-rGB/android_chrome_strings.xml", + "values-es/android_chrome_strings.xml", + "values-es-rUS/android_chrome_strings.xml", + "values-fa/android_chrome_strings.xml", + "values-fi/android_chrome_strings.xml", + "values-tl/android_chrome_strings.xml", + "values-fr/android_chrome_strings.xml", + "values-hi/android_chrome_strings.xml", + "values-hr/android_chrome_strings.xml", + "values-hu/android_chrome_strings.xml", + "values-in/android_chrome_strings.xml", + "values-it/android_chrome_strings.xml", + "values-iw/android_chrome_strings.xml", + "values-ja/android_chrome_strings.xml", + "values-ko/android_chrome_strings.xml", + "values-lt/android_chrome_strings.xml", + "values-lv/android_chrome_strings.xml", + "values-nl/android_chrome_strings.xml", + "values-nb/android_chrome_strings.xml", + "values-pl/android_chrome_strings.xml", + "values-pt-rBR/android_chrome_strings.xml", + "values-pt-rPT/android_chrome_strings.xml", + "values-ro/android_chrome_strings.xml", + "values-ru/android_chrome_strings.xml", + "values-sk/android_chrome_strings.xml", + "values-sl/android_chrome_strings.xml", + "values-sr/android_chrome_strings.xml", + "values-sv/android_chrome_strings.xml", + "values-sw/android_chrome_strings.xml", + "values-th/android_chrome_strings.xml", + "values-tr/android_chrome_strings.xml", + "values-uk/android_chrome_strings.xml", + "values-vi/android_chrome_strings.xml", + "values-zh-rCN/android_chrome_strings.xml", + "values-zh-rTW/android_chrome_strings.xml", + ] +} + +# GYP: //chrome/chrome.gyp:chrome_java +android_library("chrome_java") { + deps = [ + "//base:base_java", + "//chrome/android/webapk/libs/client:client_java", + "//chrome/android/webapk/libs/common:common_java", + "//components/safe_json/android:safe_json_java", + "//components/variations/android:variations_java", + "//components/web_contents_delegate_android:web_contents_delegate_android_java", + "//components/web_restrictions:web_restrictions_java", + "//content/public/android:content_java", + "//media/base/android:media_java", + "//media/capture/video/android:capture_java", + "//media/midi:midi_java", + "//mojo/public/java:bindings", + "//mojo/public/java:system", + "//net/android:net_java", + "//printing:printing_java", + "//third_party/WebKit/public:android_mojo_bindings_java", + "//third_party/WebKit/public:blink_headers_java", + "//third_party/android_data_chart:android_data_chart_java", + "//third_party/android_media:android_media_java", + "//third_party/android_protobuf:protobuf_nano_javalib", + "//third_party/android_swipe_refresh:android_swipe_refresh_java", + "//third_party/android_tools:android_gcm_java", + "//third_party/android_tools:android_support_design_java", + "//third_party/android_tools:android_support_v13_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + "//third_party/android_tools:android_support_v7_mediarouter_java", + "//third_party/android_tools:android_support_v7_recyclerview_java", + "//third_party/cacheinvalidation:cacheinvalidation_javalib", + "//third_party/cacheinvalidation:cacheinvalidation_proto_java", + "//third_party/custom_tabs_client:custom_tabs_support_lib", + "//third_party/gif_player:gif_player_java", + "//third_party/jsr-305:jsr_305_javalib", + "//third_party/leakcanary:leakcanary_java", + "//ui/android:ui_java", + google_play_services_library, + ] + + srcjar_deps = [ + ":chrome_android_java_enums_srcjar", + ":chrome_android_java_google_api_keys_srcjar", + ":chrome_version_srcjar", + ":resource_id_javagen", + "//base:base_build_config_gen", + "//chrome:content_setting_javagen", + "//chrome:content_settings_type_javagen", + "//chrome:data_use_ui_message_enum_javagen", + "//chrome:signin_metrics_enum_javagen", + ] + + # New versions of BuildConfig.java will be created when creating an apk. + jar_excluded_patterns = [ "*/BuildConfig.class" ] + + # TODO(sievers): Split java code into components. Not everything + # is really all that UI related here. + if (android_java_ui) { + # From java_sources.gni. + java_files = chrome_java_sources + + srcjar_deps += [ + "//chrome:page_info_connection_type_javagen", + "//chrome:website_settings_action_javagen", + "//components/infobars/core:infobar_enums_java", + "//components/ntp_snippets:ntp_snippets_java_enums_srcjar", + "//components/ntp_tiles:ntp_tiles_enums_java", + "//components/offline_pages:offline_page_model_enums_java", + "//components/omnibox/browser:autocomplete_match_javagen", + "//components/omnibox/browser:autocomplete_match_type_javagen", + "//components/security_state:security_state_enums_java", + "//components/signin/core/browser:investigated_scenario_java", + ] + + deps += [ + ":chrome_java_resources", + ":document_tab_model_info_proto_java", + "//components/bookmarks/common/android:bookmarks_java", + "//components/dom_distiller/android:dom_distiller_content_java", + "//components/dom_distiller/android:dom_distiller_core_java", + "//components/gcm_driver/android:gcm_driver_java", + "//components/gcm_driver/instance_id/android:instance_id_driver_java", + "//components/invalidation/impl:java", + "//components/location/android:location_java", + "//components/navigation_interception/android:navigation_interception_java", + "//components/ntp_tiles/android:ntp_tiles_java", + "//components/policy/android:policy_java", + "//components/precache/android:precache_java", + "//components/safe_json/android:safe_json_java", + "//components/service_tab_launcher:service_tab_launcher_java", + "//components/signin/core/browser/android:java", + "//components/web_contents_delegate_android:web_contents_delegate_android_java", + "//sync/android:sync_java", + ] + } +} + +# GYP: //chrome/chrome_browser.gypi:activity_type_ids_java +# GYP: //chrome/chrome_browser.gypi:connectivity_check_result_java +# GYP: //chrome/chrome_browser.gypi:shortcut_source_java +# GYP: //chrome/chrome_browser.gypi:profile_account_management_metrics_java +# GYP: //chrome/chrome_browser.gypi:tab_load_status_java +# GYP: //chrome/chrome_browser.gypi:infobar_action_type_java + +action("chrome_android_java_google_api_keys_srcjar") { + script = "//build/android/gyp/java_google_api_keys.py" + _output_path = "$target_gen_dir/$target_name.srcjar" + outputs = [ + _output_path, + ] + args = [ + "--srcjar", + rebase_path(_output_path, root_build_dir), + ] +} + +java_cpp_enum("chrome_android_java_enums_srcjar") { + sources = [ + "//chrome/browser/android/activity_type_ids.h", + "//chrome/browser/android/feedback/connectivity_checker.cc", + "//chrome/browser/android/policy/policy_auditor.cc", + "//chrome/browser/android/shortcut_info.h", + "//chrome/browser/android/tab_android.h", + "//chrome/browser/browsing_data/browsing_data_counter_utils.h", + "//chrome/browser/browsing_data/browsing_data_remover.h", + "//chrome/browser/profiles/profile_metrics.h", + "//chrome/browser/ui/android/infobars/infobar_android.h", + ] +} + +# GYP: //chrome/chrome_browser.gypi:document_tab_model_info_proto_java +proto_java_library("document_tab_model_info_proto_java") { + proto_path = "java/src/org/chromium/chrome/browser/tabmodel/document" + sources = [ + "$proto_path/document_tab_model_info.proto", + ] +} + +# GYP: //chrome/chrome_browser.gypi:resource_id_java +java_cpp_template("resource_id_javagen") { + sources = [ + "java/ResourceId.template", + ] + package_name = "org/chromium/chrome/browser" + inputs = [ + "../browser/android/resource_id.h", + ] +} + +# GYP: //chrome/chrome_tests.gypi:chrome_junit_tests +junit_binary("chrome_junit_tests") { + # From java_sources.gni. + java_files = chrome_junit_test_java_sources + deps = [ + ":chrome_java", + ":chrome_java_resources", + "//base:base_java", + "//base:base_java_test_support", + "//base:base_junit_test_support", + "//components/bookmarks/common/android:bookmarks_java", + "//components/invalidation/impl:java", + "//components/web_restrictions:web_restrictions_java", + "//content/public/android:content_java", + "//net/android:net_java", + "//sync:sync_java_test_support", + "//sync/android:sync_java", + "//third_party/WebKit/public:blink_headers_java", + "//third_party/android_tools:android_support_v7_mediarouter_java", + "//third_party/android_tools:android_support_v7_recyclerview_java", + "//third_party/cacheinvalidation:cacheinvalidation_javalib", + "//third_party/junit:hamcrest", + "//ui/android:ui_java", + google_play_services_library, + ] +} + +# GYP: //chrome/chrome_android.gypi:chrome_version_java +chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java" +chrome_version_java_file = "$chrome_version_java_dir/org/chromium/chrome/browser/ChromeVersionConstants.java" +process_version("chrome_version_java") { + template_file = "java/ChromeVersionConstants.java.version" + output = chrome_version_java_file + extra_args = [ + "-e", + "CHANNEL=str.upper('$android_channel')", + ] +} + +zip("chrome_version_srcjar") { + inputs = [ + chrome_version_java_file, + ] + output = "$target_gen_dir/$target_name.srcjar" + base_dir = chrome_version_java_dir + deps = [ + ":chrome_version_java", + ] +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_test_java +android_library("chrome_test_java") { + testonly = true + + # From java_sources.gni. + java_files = chrome_test_java_sources + + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//chrome/android:chrome_java", + "//chrome/android/webapk/libs/common:common_java", + "//chrome/test/android:chrome_java_test_support", + "//components/bookmarks/common/android:bookmarks_java", + "//components/dom_distiller/android:dom_distiller_core_java", + "//components/gcm_driver/android:gcm_driver_java", + "//components/invalidation/impl:java", + "//components/invalidation/impl:javatests", + "//components/location/android:location_java", + "//components/navigation_interception/android:navigation_interception_java", + "//components/policy/android:policy_java", + "//components/precache/android:precache_java", + "//components/precache/android:precache_javatests", + "//components/web_contents_delegate_android:web_contents_delegate_android_java", + "//components/web_restrictions:web_restrictions_java", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//mojo/public/java:bindings", + "//mojo/public/java:system", + "//net/android:net_java", + "//net/android:net_java_test_support", + "//printing:printing_java", + "//sync:sync_java_test_support", + "//sync/android:sync_java", + "//sync/android:sync_javatests", + "//third_party/WebKit/public:android_mojo_bindings_java", + "//third_party/WebKit/public:blink_headers_java", + "//third_party/android_tools:android_support_design_java", + "//third_party/android_tools:android_support_v13_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + "//third_party/android_tools:android_support_v7_recyclerview_java", + "//third_party/android_tools:legacy_http_javalib", + "//third_party/cacheinvalidation:cacheinvalidation_javalib", + "//third_party/custom_tabs_client:custom_tabs_support_lib", + "//third_party/jsr-305:jsr_305_javalib", + "//ui/android:ui_java", + "//ui/android:ui_javatests", + google_play_services_library, + ] +} + +# Overrides icon / name defined in chrome_java_resources. +android_resources("chrome_public_apk_resources") { + resource_dirs = [ "java/res_chromium" ] + + # Dep needed to ensure override works properly. + deps = [ + ":chrome_java_resources", + ] +} + +android_assets("chrome_public_apk_assets") { + sources = chrome_android_paks_gypi.chrome_android_pak_input_resources + sources += [ "$root_build_dir/resources.pak" ] + disable_compression = true + + deps = [ + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//chrome/android/webapk/libs/runtime_library:runtime_library_assets", + "//third_party/icu:icu_assets", + "//v8:v8_external_startup_data_assets", + ] +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_apk_manifest +jinja_template("chrome_public_apk_manifest") { + input = "java/AndroidManifest.xml" + output = "$root_gen_dir/chrome_public_apk_manifest/AndroidManifest.xml" + variables = chrome_public_jinja_variables + variables += [ + "min_sdk_version=16", + "target_sdk_version=23", + ] +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_apk_manifest +jinja_template("chrome_sync_shell_apk_manifest") { + input = "java/AndroidManifest.xml" + output = "$root_gen_dir/chrome_sync_shell_apk_manifest/AndroidManifest.xml" + variables = chrome_sync_shell_jinja_variables + variables += [ + "min_sdk_version=16", + "target_sdk_version=22", + ] +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_public_apk_template_resources +jinja_template_resources("chrome_public_apk_template_resources") { + resources = [ + "java/res_template/xml/chromebackupscheme.xml", + "java/res_template/xml/searchable.xml", + "java/res_template/xml/syncadapter.xml", + ] + res_dir = "java/res_template" + variables = chrome_public_jinja_variables +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_apk_template_resources +jinja_template_resources("chrome_sync_shell_apk_template_resources") { + resources = [ + "java/res_template/xml/chromebackupscheme.xml", + "java/res_template/xml/searchable.xml", + "java/res_template/xml/syncadapter.xml", + ] + res_dir = "java/res_template" + variables = chrome_sync_shell_jinja_variables +} + +# GYP: none +shared_library("chrome") { + sources = chrome_apk_gypi.chrome_app_native_sources + deps = [ + "//build/config/sanitizers:deps", + "//chrome:chrome_android_core", + ] + + if (is_android && use_order_profiling) { + deps += [ "//tools/cygprofile" ] + } + + public_configs = extra_chrome_shared_library_configs +} + +# GYP: none +if (!defined(webview_only_libmonochrome) || !webview_only_libmonochrome) { + shared_library("monochrome") { + sources = chrome_apk_gypi.monochrome_app_native_sources + deps = [ + "//android_webview:common", + "//chrome:chrome_android_core", + ] + + configs -= [ "//build/config/android:hide_native_jni_exports" ] + if (is_android && use_order_profiling) { + deps += [ "//tools/cygprofile" ] + } + + public_configs = extra_chrome_shared_library_configs + } +} + +# GYP: //chrome/android/chrome_apk.gyp:libchrome_sync_shell +shared_library("chrome_sync_shell") { + testonly = true + deps = [ + "//build/config/sanitizers:deps", + "//chrome:chrome_android_core", + "//sync", + "//sync:test_support_sync_fake_server_android", + ] + sources = chrome_apk_gypi.chrome_sync_shell_app_native_sources +} + +# Contains rules common to chrome_public_apk and chrome_sync_shell_apk +template("chrome_public_apk_tmpl_shared") { + chrome_public_apk_tmpl(target_name) { + forward_variables_from(invoker, "*") + + native_lib_version_rule = "//build/util:chrome_version_json" + + deps += [ + ":chrome_java", + ":chrome_public_apk_assets", + ":chrome_public_apk_resources", + "//base:base_java", + ] + } +} + +chrome_public_apk_tmpl_shared("chrome_public_apk") { + android_manifest = get_target_outputs(":chrome_public_apk_manifest") + android_manifest = android_manifest[1] + android_manifest_dep = ":chrome_public_apk_manifest" + apk_name = "ChromePublic" + shared_libraries = [ ":chrome" ] + + deps = [ + ":chrome_public_apk_template_resources", + ] +} + +chrome_public_apk_tmpl_shared("chrome_sync_shell_apk") { + testonly = true + android_manifest = get_target_outputs(":chrome_sync_shell_apk_manifest") + android_manifest = android_manifest[1] + android_manifest_dep = ":chrome_sync_shell_apk_manifest" + apk_name = "ChromeSyncShell" + shared_libraries = [ ":chrome_sync_shell" ] + + deps = [ + ":chrome_sync_shell_apk_template_resources", + + # This exists here because com.google.protobuf.nano is needed in tests, + # but that code is stripped out via proguard. Adding this deps adds + # usages and prevents removal of the proto code. + "//sync:test_support_sync_proto_java", + ] +} + +chrome_public_test_apk_manifest = + "$root_gen_dir/chrome_public_test_apk_manifest/AndroidManifest.xml" +chrome_sync_shell_test_apk_manifest = + "$root_gen_dir/chrome_sync_shell_test_apk_manifest/AndroidManifest.xml" + +# GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk_manifest +jinja_template("chrome_public_test_apk_manifest") { + input = "javatests/AndroidManifest.xml" + output = chrome_public_test_apk_manifest + variables = chrome_public_jinja_variables +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_test_apk_manifest +jinja_template("chrome_sync_shell_test_apk_manifest") { + input = "sync_shell/javatests/AndroidManifest.xml" + output = chrome_sync_shell_test_apk_manifest + variables = chrome_sync_shell_jinja_variables +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk +instrumentation_test_apk("chrome_public_test_apk") { + apk_name = "ChromePublicTest" + apk_under_test = ":chrome_public_apk" + android_manifest = chrome_public_test_apk_manifest + android_manifest_dep = ":chrome_public_test_apk_manifest" + + deps = [ + ":chrome_test_java", + "//chrome/android/webapk/shell_apk:shell_apk_javatests", + ] + additional_apks = [ + "//chrome/android/webapk/shell_apk/javatests/dex_optimizer:dex_optimizer_apk", + "//chrome/test/android/chrome_public_test_support:chrome_public_test_support_apk", + "//net/android:net_test_support_apk", + ] + isolate_file = "../chrome_public_test_apk.isolate" + proguard_enabled = !is_java_debug +} + +android_library("chrome_sync_shell_test_apk_java") { + testonly = true + + # From java_sources.jni. + java_files = sync_shell_test_java_sources + + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//chrome/android:chrome_java", + "//chrome/test/android:chrome_java_test_support", + "//components/bookmarks/common/android:bookmarks_java", + "//components/policy/android:policy_java", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//sync:sync_java_test_support", + "//sync:test_support_sync_proto_java", + "//sync/android:sync_java", + "//third_party/android_protobuf:protobuf_nano_javalib", + "//third_party/android_tools:android_support_v13_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + "//ui/android:ui_java", + ] +} + +# GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_test_apk +instrumentation_test_apk("chrome_sync_shell_test_apk") { + apk_name = "ChromeSyncShellTest" + apk_under_test = ":chrome_sync_shell_apk" + android_manifest = chrome_sync_shell_test_apk_manifest + android_manifest_dep = ":chrome_sync_shell_test_apk_manifest" + deps = [ + ":chrome_sync_shell_test_apk_java", + ] + proguard_enabled = !is_java_debug +} diff --git a/chromium/chrome/android/channel.gni b/chromium/chrome/android/channel.gni new file mode 100644 index 00000000000..397f83aa236 --- /dev/null +++ b/chromium/chrome/android/channel.gni @@ -0,0 +1,14 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # The channel to build on Android: stable, beta, dev, canary, work, or + # default. "default" should be used on non-official builds. + android_channel = "default" +} + +assert(android_channel == "default" || android_channel == "canary" || + android_channel == "dev" || android_channel == "beta" || + android_channel == "stable" || android_channel == "work", + "Invalid channel: " + android_channel) diff --git a/chromium/chrome/android/chrome_public_apk_tmpl.gni b/chromium/chrome/android/chrome_public_apk_tmpl.gni new file mode 100644 index 00000000000..a99b02a6814 --- /dev/null +++ b/chromium/chrome/android/chrome_public_apk_tmpl.gni @@ -0,0 +1,69 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//base/android/linker/config.gni") +import("//build/config/android/rules.gni") +import("//chrome/common/features.gni") +import("//third_party/leakcanary/config.gni") +import("channel.gni") + +declare_args() { + # Whether chrome_public_apk should use the crazy linker. + chrome_public_apk_use_chromium_linker = chromium_linker_supported + + # Whether chrome_public_apk should use the relocation packer. + # TODO: Enable packed relocations for x64. See: b/20532404 + chrome_public_apk_use_relocation_packer = + chromium_linker_supported && current_cpu != "x64" + + # Whether native libraries should be loaded from within the apk. + # Only attempt loading the library from the APK for 64 bit devices + # until the number of 32 bit devices which don't support this + # approach falls to a minimal level - http://crbug.com/390618. + chrome_public_apk_load_library_from_apk = + chromium_linker_supported && + (current_cpu == "arm64" || current_cpu == "x64") +} + +default_chrome_public_jinja_variables = [ + "channel=$android_channel", + "enable_leakcanary=$enable_leakcanary", +] + +# GYP: //chrome/android/chrome_apk.gypi +template("chrome_public_apk_tmpl") { + android_apk(target_name) { + forward_variables_from(invoker, "*") + _native_lib_file = + rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir) + native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)" + + if (is_java_debug) { + enable_multidex = true + } else { + proguard_enabled = true + _prev_proguard_configs = [] + if (defined(proguard_configs)) { + _prev_proguard_configs = proguard_configs + } + proguard_configs = [] + proguard_configs = + [ "//chrome/android/java/proguard.flags" ] + _prev_proguard_configs + } + + if (!defined(use_chromium_linker)) { + use_chromium_linker = chrome_public_apk_use_chromium_linker + } + + if (use_chromium_linker) { + if (!defined(load_library_from_apk)) { + load_library_from_apk = chrome_public_apk_load_library_from_apk + } + + if (!defined(enable_relocation_packing)) { + enable_relocation_packing = chrome_public_apk_use_relocation_packer + } + } + } +} diff --git a/chromium/chrome/android/java_sources.gni b/chromium/chrome/android/java_sources.gni new file mode 100644 index 00000000000..b8498c645a6 --- /dev/null +++ b/chromium/chrome/android/java_sources.gni @@ -0,0 +1,1347 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +chrome_java_sources = [ + "java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java", + "java/src/org/chromium/chrome/browser/ActivityTabTaskDescriptionHelper.java", + "java/src/org/chromium/chrome/browser/ActivityTaskDescriptionIconGenerator.java", + "java/src/org/chromium/chrome/browser/AfterStartupTaskUtils.java", + "java/src/org/chromium/chrome/browser/AppLinkHandler.java", + "java/src/org/chromium/chrome/browser/ApplicationInitialization.java", + "java/src/org/chromium/chrome/browser/ApplicationLifetime.java", + "java/src/org/chromium/chrome/browser/AssistStatusHandler.java", + "java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java", + "java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java", + "java/src/org/chromium/chrome/browser/BrowserRestartActivity.java", + "java/src/org/chromium/chrome/browser/ChromeActivity.java", + "java/src/org/chromium/chrome/browser/ChromeApplication.java", + "java/src/org/chromium/chrome/browser/ChromeBackgroundService.java", + "java/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiter.java", + "java/src/org/chromium/chrome/browser/ChromeBackupAgent.java", + "java/src/org/chromium/chrome/browser/ChromeFeatureList.java", + "java/src/org/chromium/chrome/browser/ChromeHttpAuthHandler.java", + "java/src/org/chromium/chrome/browser/ChromeLifetimeController.java", + "java/src/org/chromium/chrome/browser/ChromeServiceTabLauncher.java", + "java/src/org/chromium/chrome/browser/ChromeStrictMode.java", + "java/src/org/chromium/chrome/browser/ChromeSwitches.java", + "java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java", + "java/src/org/chromium/chrome/browser/ChromeTabbedActivity2.java", + "java/src/org/chromium/chrome/browser/ChromeVersionInfo.java", + "java/src/org/chromium/chrome/browser/ChromeWindow.java", + "java/src/org/chromium/chrome/browser/DeferredStartupHandler.java", + "java/src/org/chromium/chrome/browser/DevToolsServer.java", + "java/src/org/chromium/chrome/browser/EmbedContentViewActivity.java", + "java/src/org/chromium/chrome/browser/FileProviderHelper.java", + "java/src/org/chromium/chrome/browser/FrozenNativePage.java", + "java/src/org/chromium/chrome/browser/InsetObserverView.java", + "java/src/org/chromium/chrome/browser/IntentHandler.java", + "java/src/org/chromium/chrome/browser/IntentHelper.java", + "java/src/org/chromium/chrome/browser/ItemChooserDialog.java", + "java/src/org/chromium/chrome/browser/JavaExceptionReporter.java", + "java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java", + "java/src/org/chromium/chrome/browser/KeyboardShortcuts.java", + "java/src/org/chromium/chrome/browser/LauncherShortcutActivity.java", + "java/src/org/chromium/chrome/browser/LoginPrompt.java", + "java/src/org/chromium/chrome/browser/LollipopTtsPlatformImpl.java", + "java/src/org/chromium/chrome/browser/NativePage.java", + "java/src/org/chromium/chrome/browser/NavigationPopup.java", + "java/src/org/chromium/chrome/browser/PasswordUIView.java", + "java/src/org/chromium/chrome/browser/PowerBroadcastReceiver.java", + "java/src/org/chromium/chrome/browser/RepostFormWarningDialog.java", + "java/src/org/chromium/chrome/browser/SnackbarActivity.java", + "java/src/org/chromium/chrome/browser/SSLClientCertificateRequest.java", + "java/src/org/chromium/chrome/browser/ShortcutHelper.java", + "java/src/org/chromium/chrome/browser/SwipeRefreshHandler.java", + "java/src/org/chromium/chrome/browser/SynchronousInitializationActivity.java", + "java/src/org/chromium/chrome/browser/TabState.java", + "java/src/org/chromium/chrome/browser/TtsPlatformImpl.java", + "java/src/org/chromium/chrome/browser/UrlConstants.java", + "java/src/org/chromium/chrome/browser/UsbChooserDialog.java", + "java/src/org/chromium/chrome/browser/WarmupManager.java", + "java/src/org/chromium/chrome/browser/WebContentsFactory.java", + "java/src/org/chromium/chrome/browser/WindowDelegate.java", + "java/src/org/chromium/chrome/browser/accessibility/FontSizePrefs.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenu.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenuButtonHelper.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenuDragHelper.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenuItemIcon.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenuObserver.java", + "java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java", + "java/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryBridge.java", + "java/src/org/chromium/chrome/browser/autofill/AutofillLogger.java", + "java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java", + "java/src/org/chromium/chrome/browser/autofill/CardUnmaskBridge.java", + "java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java", + "java/src/org/chromium/chrome/browser/autofill/CreditCardScanner.java", + "java/src/org/chromium/chrome/browser/autofill/PasswordGenerationAdapter.java", + "java/src/org/chromium/chrome/browser/autofill/PasswordGenerationPopupBridge.java", + "java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java", + "java/src/org/chromium/chrome/browser/banners/AppBannerManager.java", + "java/src/org/chromium/chrome/browser/banners/AppData.java", + "java/src/org/chromium/chrome/browser/banners/AppDetailsDelegate.java", + "java/src/org/chromium/chrome/browser/banners/InstallerDelegate.java", + "java/src/org/chromium/chrome/browser/banners/SwipableOverlayView.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkAddActivity.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkAddEditFolderActivity.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkContentView.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListItemView.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListView.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkDrawerListViewAdapter.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderRow.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkFolderSelectActivity.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemHighlightView.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkLaunchLocation.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkMatch.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkModel.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkRecyclerView.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchRow.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchView.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIObserver.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIState.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkUndoController.java", + "java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java", + "java/src/org/chromium/chrome/browser/bookmarkswidget/BookmarkWidgetProvider.java", + "java/src/org/chromium/chrome/browser/bookmarkswidget/BookmarkWidgetProxy.java", + "java/src/org/chromium/chrome/browser/bookmarkswidget/BookmarkWidgetService.java", + "java/src/org/chromium/chrome/browser/childaccounts/ChildAccountFeedbackReporter.java", + "java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java", + "java/src/org/chromium/chrome/browser/childaccounts/ExternalFeedbackReporter.java", + "java/src/org/chromium/chrome/browser/compositor/CompositorView.java", + "java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java", + "java/src/org/chromium/chrome/browser/compositor/Invalidator.java", + "java/src/org/chromium/chrome/browser/compositor/LayerTitleCache.java", + "java/src/org/chromium/chrome/browser/compositor/TitleCache.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayContentDelegate.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayContentProgressObserver.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelAnimation.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContentFactory.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContentViewDelegate.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelInflater.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelManager.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchBarControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchCaptionControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchContextControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchIconSpriteControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelMetrics.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPeekPromoControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPromoControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchTermControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/readermode/ReaderModeBarControl.java", + "java/src/org/chromium/chrome/browser/compositor/bottombar/readermode/ReaderModePanel.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/ChromeAnimation.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/EdgeSwipeHandlerLayoutDelegate.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/EmptyOverviewModeObserver.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/GestureHandlerLayoutDelegate.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManager.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromeTablet.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocument.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerDocumentTabSwitcher.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerHost.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutProvider.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutRenderHost.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/LayoutUpdateHost.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/OverviewModeBehavior.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/SceneChangeObserver.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/StaticLayout.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/components/CompositorButton.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/components/LayoutTab.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/components/VirtualView.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/content/ContentOffsetProvider.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/content/InvalidationAwareThumbnailProvider.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/content/TitleBitmapFactory.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/AreaGestureEventFilter.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/BlackHoleEventFilter.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/CascadeEventFilter.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/EdgeSwipeEventFilter.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/EdgeSwipeHandler.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/EmptyEdgeSwipeHandler.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/EventFilter.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/EventFilterHost.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/GestureEventFilter.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/GestureHandler.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/eventfilter/OverlayPanelEventFilter.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/SimpleAnimationLayout.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/Stack.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimation.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationPortrait.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackTab.java", + "java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackViewAnimation.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/SceneOverlay.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/CascadingStripStacker.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/ScrollingStripStacker.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutTab.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripStacker.java", + "java/src/org/chromium/chrome/browser/compositor/overlays/strip/TabLoadTracker.java", + "java/src/org/chromium/chrome/browser/compositor/resources/StaticResourcePreloads.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/ContextualSearchSceneLayer.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/ReaderModeSceneLayer.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/SceneLayer.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/SceneOverlayLayer.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/StaticTabSceneLayer.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java", + "java/src/org/chromium/chrome/browser/compositor/scene_layer/ToolbarSceneLayer.java", + "java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java", + "java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java", + "java/src/org/chromium/chrome/browser/contextmenu/ContextMenuItemDelegate.java", + "java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java", + "java/src/org/chromium/chrome/browser/contextmenu/ContextMenuPopulator.java", + "java/src/org/chromium/chrome/browser/contextmenu/ContextMenuTitleView.java", + "java/src/org/chromium/chrome/browser/contextualsearch/BarOverlapTapSuppression.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchBlacklist.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHeuristic.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHeuristics.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagementDelegate.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchNetworkCommunicator.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchObserver.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPolicy.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRequest.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionHandler.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapState.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTranslateController.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTranslateInterface.java", + "java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java", + "java/src/org/chromium/chrome/browser/contextualsearch/DisableablePromoTapCounter.java", + "java/src/org/chromium/chrome/browser/contextualsearch/NearTopTapSuppression.java", + "java/src/org/chromium/chrome/browser/contextualsearch/QuickAnswersHeuristic.java", + "java/src/org/chromium/chrome/browser/contextualsearch/RecentScrollTapSuppression.java", + "java/src/org/chromium/chrome/browser/contextualsearch/SwipeRecognizer.java", + "java/src/org/chromium/chrome/browser/contextualsearch/TapFarFromPreviousSuppression.java", + "java/src/org/chromium/chrome/browser/contextualsearch/TapSuppression.java", + "java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java", + "java/src/org/chromium/chrome/browser/cookies/CanonicalCookie.java", + "java/src/org/chromium/chrome/browser/cookies/CookiesFetcher.java", + "java/src/org/chromium/chrome/browser/crash/CrashFileManager.java", + "java/src/org/chromium/chrome/browser/crash/LogcatExtractionCallable.java", + "java/src/org/chromium/chrome/browser/crash/LogcatExtractionService.java", + "java/src/org/chromium/chrome/browser/crash/MinidumpDirectoryObserver.java", + "java/src/org/chromium/chrome/browser/crash/MinidumpPreparationCallable.java", + "java/src/org/chromium/chrome/browser/crash/MinidumpPreparationService.java", + "java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java", + "java/src/org/chromium/chrome/browser/crash/MinidumpUploadRetry.java", + "java/src/org/chromium/chrome/browser/crash/MinidumpUploadService.java", + "java/src/org/chromium/chrome/browser/customtabs/ClientManager.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomButtonParams.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabContentHandler.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabLayoutManager.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java", + "java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java", + "java/src/org/chromium/chrome/browser/customtabs/RequestThrottler.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity0.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity1.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity2.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity3.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity4.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity5.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity6.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity7.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity8.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskCustomTabActivity9.java", + "java/src/org/chromium/chrome/browser/customtabs/SeparateTaskManagedCustomTabActivity.java", + "java/src/org/chromium/chrome/browser/database/SQLiteCursor.java", + "java/src/org/chromium/chrome/browser/datausage/DataUseTabUIManager.java", + "java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java", + "java/src/org/chromium/chrome/browser/device/DeviceClassManager.java", + "java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java", + "java/src/org/chromium/chrome/browser/document/CipherKeyActivity.java", + "java/src/org/chromium/chrome/browser/document/DocumentActivity.java", + "java/src/org/chromium/chrome/browser/document/DocumentUtils.java", + "java/src/org/chromium/chrome/browser/document/DocumentWebContentsDelegate.java", + "java/src/org/chromium/chrome/browser/document/IncognitoDocumentActivity.java", + "java/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsView.java", + "java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerServiceFactory.java", + "java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java", + "java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerUIUtils.java", + "java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java", + "java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManagerDelegate.java", + "java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeTabInfo.java", + "java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java", + "java/src/org/chromium/chrome/browser/download/DownloadActivity.java", + "java/src/org/chromium/chrome/browser/download/DownloadBroadcastReceiver.java", + "java/src/org/chromium/chrome/browser/download/DownloadController.java", + "java/src/org/chromium/chrome/browser/download/DownloadInfo.java", + "java/src/org/chromium/chrome/browser/download/DownloadItem.java", + "java/src/org/chromium/chrome/browser/download/DownloadManagerDelegate.java", + "java/src/org/chromium/chrome/browser/download/DownloadManagerService.java", + "java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java", + "java/src/org/chromium/chrome/browser/download/DownloadNotifier.java", + "java/src/org/chromium/chrome/browser/download/DownloadResumptionScheduler.java", + "java/src/org/chromium/chrome/browser/download/DownloadSharedPreferenceEntry.java", + "java/src/org/chromium/chrome/browser/download/DownloadSnackbarController.java", + "java/src/org/chromium/chrome/browser/download/DownloadUmaStatsEntry.java", + "java/src/org/chromium/chrome/browser/download/OMADownloadHandler.java", + "java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java", + "java/src/org/chromium/chrome/browser/download/ui/DownloadManagerUi.java", + "java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java", + "java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java", + "java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java", + "java/src/org/chromium/chrome/browser/externalauth/VerifiedHandler.java", + "java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegate.java", + "java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java", + "java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java", + "java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationParams.java", + "java/src/org/chromium/chrome/browser/externalnav/IntentWithGesturesHandler.java", + "java/src/org/chromium/chrome/browser/favicon/FaviconHelper.java", + "java/src/org/chromium/chrome/browser/favicon/LargeIconBridge.java", + "java/src/org/chromium/chrome/browser/feedback/ConnectivityChecker.java", + "java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java", + "java/src/org/chromium/chrome/browser/feedback/EmptyFeedbackReporter.java", + "java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java", + "java/src/org/chromium/chrome/browser/feedback/FeedbackReporter.java", + "java/src/org/chromium/chrome/browser/feedback/ScreenshotTask.java", + "java/src/org/chromium/chrome/browser/findinpage/FindInPageBridge.java", + "java/src/org/chromium/chrome/browser/findinpage/FindMatchRectsDetails.java", + "java/src/org/chromium/chrome/browser/findinpage/FindNotificationDetails.java", + "java/src/org/chromium/chrome/browser/firstrun/AccountFirstRunFragment.java", + "java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyFirstRunFragment.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunGlue.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunGlueImpl.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunPage.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunPageDelegate.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunPagerAdapter.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunSignInProcessor.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunView.java", + "java/src/org/chromium/chrome/browser/firstrun/ForcedSigninProcessor.java", + "java/src/org/chromium/chrome/browser/firstrun/ProfileDataCache.java", + "java/src/org/chromium/chrome/browser/firstrun/ToSAckedReceiver.java", + "java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java", + "java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java", + "java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java", + "java/src/org/chromium/chrome/browser/fullscreen/FullscreenManager.java", + "java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClient.java", + "java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java", + "java/src/org/chromium/chrome/browser/gcore/ConnectedTask.java", + "java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java", + "java/src/org/chromium/chrome/browser/gcore/LifecycleHook.java", + "java/src/org/chromium/chrome/browser/gsa/ContextReporter.java", + "java/src/org/chromium/chrome/browser/gsa/GSAContextDisplaySelection.java", + "java/src/org/chromium/chrome/browser/gsa/GSAContextReportDelegate.java", + "java/src/org/chromium/chrome/browser/gsa/GSAHelper.java", + "java/src/org/chromium/chrome/browser/gsa/GSAServiceClient.java", + "java/src/org/chromium/chrome/browser/gsa/GSAState.java", + "java/src/org/chromium/chrome/browser/help/HelpAndFeedback.java", + "java/src/org/chromium/chrome/browser/historyreport/DeltaFileEntry.java", + "java/src/org/chromium/chrome/browser/historyreport/HistoryReportJniBridge.java", + "java/src/org/chromium/chrome/browser/historyreport/SearchJniBridge.java", + "java/src/org/chromium/chrome/browser/historyreport/UsageReport.java", + "java/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGenerator.java", + "java/src/org/chromium/chrome/browser/identity/UniqueIdentificationGenerator.java", + "java/src/org/chromium/chrome/browser/identity/UniqueIdentificationGeneratorFactory.java", + "java/src/org/chromium/chrome/browser/identity/UuidBasedUniqueIdentificationGenerator.java", + "java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java", + "java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java", + "java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java", + "java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarDelegateAndroid.java", + "java/src/org/chromium/chrome/browser/infobar/AutofillSaveCardInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/DataReductionPromoInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/DataReductionPromoInfoBarDelegate.java", + "java/src/org/chromium/chrome/browser/infobar/DownloadOverwriteInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/GeneratedPasswordSavedInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/GeneratedPasswordSavedInfoBarDelegate.java", + "java/src/org/chromium/chrome/browser/infobar/GroupedPermissionInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/InfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java", + "java/src/org/chromium/chrome/browser/infobar/InfoBarContainerLayout.java", + "java/src/org/chromium/chrome/browser/infobar/InfoBarControlLayout.java", + "java/src/org/chromium/chrome/browser/infobar/InfoBarLayout.java", + "java/src/org/chromium/chrome/browser/infobar/InfoBarView.java", + "java/src/org/chromium/chrome/browser/infobar/InfoBarWrapper.java", + "java/src/org/chromium/chrome/browser/infobar/PermissionUpdateInfoBarDelegate.java", + "java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/SimpleConfirmInfoBarBuilder.java", + "java/src/org/chromium/chrome/browser/infobar/SubPanelListener.java", + "java/src/org/chromium/chrome/browser/infobar/TranslateAlwaysPanel.java", + "java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java", + "java/src/org/chromium/chrome/browser/infobar/TranslateLanguagePanel.java", + "java/src/org/chromium/chrome/browser/infobar/TranslateNeverPanel.java", + "java/src/org/chromium/chrome/browser/infobar/TranslateOptions.java", + "java/src/org/chromium/chrome/browser/infobar/TranslateSubPanel.java", + "java/src/org/chromium/chrome/browser/infobar/UpdatePasswordInfoBar.java", + "java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java", + "java/src/org/chromium/chrome/browser/init/BrowserParts.java", + "java/src/org/chromium/chrome/browser/init/ChromeActivityNativeDelegate.java", + "java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java", + "java/src/org/chromium/chrome/browser/init/EmptyBrowserParts.java", + "java/src/org/chromium/chrome/browser/init/InvalidStartupDialog.java", + "java/src/org/chromium/chrome/browser/init/NativeInitializationController.java", + "java/src/org/chromium/chrome/browser/invalidation/ChromeBrowserSyncAdapter.java", + "java/src/org/chromium/chrome/browser/invalidation/ChromeBrowserSyncAdapterService.java", + "java/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsController.java", + "java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java", + "java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java", + "java/src/org/chromium/chrome/browser/invalidation/UniqueIdInvalidationClientNameGenerator.java", + "java/src/org/chromium/chrome/browser/locale/LocaleManager.java", + "java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java", + "java/src/org/chromium/chrome/browser/media/cdm/MediaDrmCredentialManager.java", + "java/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteController.java", + "java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java", + "java/src/org/chromium/chrome/browser/media/remote/DefaultMediaRouteController.java", + "java/src/org/chromium/chrome/browser/media/remote/ExpandedControllerActivity.java", + "java/src/org/chromium/chrome/browser/media/remote/FullscreenMediaRouteButton.java", + "java/src/org/chromium/chrome/browser/media/remote/MediaRouteChooserDialogFactory.java", + "java/src/org/chromium/chrome/browser/media/remote/MediaRouteController.java", + "java/src/org/chromium/chrome/browser/media/remote/MediaRouteControllerDialogFactory.java", + "java/src/org/chromium/chrome/browser/media/remote/MediaUrlResolver.java", + "java/src/org/chromium/chrome/browser/media/remote/RecordCastAction.java", + "java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerBridge.java", + "java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerController.java", + "java/src/org/chromium/chrome/browser/media/remote/RemoteVideoInfo.java", + "java/src/org/chromium/chrome/browser/media/remote/PositionExtrapolator.java", + "java/src/org/chromium/chrome/browser/media/router/BaseMediaRouteDialogManager.java", + "java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java", + "java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java", + "java/src/org/chromium/chrome/browser/media/router/DiscoveryDelegate.java", + "java/src/org/chromium/chrome/browser/media/router/MediaRoute.java", + "java/src/org/chromium/chrome/browser/media/router/MediaRouteChooserDialogManager.java", + "java/src/org/chromium/chrome/browser/media/router/MediaRouteControllerDialogManager.java", + "java/src/org/chromium/chrome/browser/media/router/MediaRouteDialogDelegate.java", + "java/src/org/chromium/chrome/browser/media/router/MediaRouteDialogManager.java", + "java/src/org/chromium/chrome/browser/media/router/MediaRouteManager.java", + "java/src/org/chromium/chrome/browser/media/router/MediaRouteProvider.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandler.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CastRequestIdGenerator.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CastSession.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CastSessionInfo.java", + "java/src/org/chromium/chrome/browser/media/router/cast/ClientRecord.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java", + "java/src/org/chromium/chrome/browser/media/router/cast/DiscoveryCallback.java", + "java/src/org/chromium/chrome/browser/media/router/cast/MediaSink.java", + "java/src/org/chromium/chrome/browser/media/router/cast/MediaSource.java", + "java/src/org/chromium/chrome/browser/media/ui/MediaButtonReceiver.java", + "java/src/org/chromium/chrome/browser/media/ui/MediaNotificationInfo.java", + "java/src/org/chromium/chrome/browser/media/ui/MediaNotificationListener.java", + "java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java", + "java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java", + "java/src/org/chromium/chrome/browser/metrics/ActivityStopMetrics.java", + "java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java", + "java/src/org/chromium/chrome/browser/metrics/MediaSessionUMA.java", + "java/src/org/chromium/chrome/browser/metrics/MediaNotificationUma.java", + "java/src/org/chromium/chrome/browser/metrics/MemoryUma.java", + "java/src/org/chromium/chrome/browser/metrics/StartupMetrics.java", + "java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java", + "java/src/org/chromium/chrome/browser/metrics/UmaUtils.java", + "java/src/org/chromium/chrome/browser/metrics/VariationsSession.java", + "java/src/org/chromium/chrome/browser/metrics/WebappUma.java", + "java/src/org/chromium/chrome/browser/mojo/ChromeServiceRegistrar.java", + "java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceChromeTabbedActivity.java", + "java/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtils.java", + "java/src/org/chromium/chrome/browser/net/qualityprovider/ExternalEstimateProviderAndroid.java", + "java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java", + "java/src/org/chromium/chrome/browser/nfc/BeamCallback.java", + "java/src/org/chromium/chrome/browser/nfc/BeamController.java", + "java/src/org/chromium/chrome/browser/nfc/BeamProvider.java", + "java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java", + "java/src/org/chromium/chrome/browser/notifications/GoogleServicesNotificationController.java", + "java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java", + "java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java", + "java/src/org/chromium/chrome/browser/notifications/NotificationManagerProxy.java", + "java/src/org/chromium/chrome/browser/notifications/NotificationManagerProxyImpl.java", + "java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java", + "java/src/org/chromium/chrome/browser/notifications/NotificationService.java", + "java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java", + "java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java", + "java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java", + "java/src/org/chromium/chrome/browser/ntp/CurrentlyOpenTab.java", + "java/src/org/chromium/chrome/browser/ntp/ForeignSessionHelper.java", + "java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java", + "java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java", + "java/src/org/chromium/chrome/browser/ntp/LogoBridge.java", + "java/src/org/chromium/chrome/browser/ntp/LogoView.java", + "java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java", + "java/src/org/chromium/chrome/browser/ntp/MostVisitedItemView.java", + "java/src/org/chromium/chrome/browser/ntp/MostVisitedLayout.java", + "java/src/org/chromium/chrome/browser/ntp/NativePageAssassin.java", + "java/src/org/chromium/chrome/browser/ntp/NativePageDialog.java", + "java/src/org/chromium/chrome/browser/ntp/NativePageFactory.java", + "java/src/org/chromium/chrome/browser/ntp/NativePageRootFrameLayout.java", + "java/src/org/chromium/chrome/browser/ntp/NewTabPage.java", + "java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java", + "java/src/org/chromium/chrome/browser/ntp/NewTabPagePrefs.java", + "java/src/org/chromium/chrome/browser/ntp/NewTabPageScrollView.java", + "java/src/org/chromium/chrome/browser/ntp/NewTabPageToolbar.java", + "java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java", + "java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java", + "java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java", + "java/src/org/chromium/chrome/browser/ntp/RecentTabsExpandableListView.java", + "java/src/org/chromium/chrome/browser/ntp/RecentTabsGroupView.java", + "java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java", + "java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java", + "java/src/org/chromium/chrome/browser/ntp/RecentTabsRowAdapter.java", + "java/src/org/chromium/chrome/browser/ntp/RecentlyClosedBridge.java", + "java/src/org/chromium/chrome/browser/ntp/interests/InterestsItemView.java", + "java/src/org/chromium/chrome/browser/ntp/interests/InterestsPage.java", + "java/src/org/chromium/chrome/browser/ntp/interests/InterestsService.java", + "java/src/org/chromium/chrome/browser/ntp/interests/InterestsView.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetHeaderListItem.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetHeaderViewHolder.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java", + "java/src/org/chromium/chrome/browser/ntp/cards/AboveTheFoldListItem.java", + "java/src/org/chromium/chrome/browser/ntp/cards/CardViewHolder.java", + "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java", + "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageListItem.java", + "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java", + "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageViewHolder.java", + "java/src/org/chromium/chrome/browser/ntp/cards/SpacingListItem.java", + "java/src/org/chromium/chrome/browser/ntp/cards/StatusListItem.java", + "java/src/org/chromium/chrome/browser/offlinepages/DeviceConditions.java", + "java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java", + "java/src/org/chromium/chrome/browser/offlinepages/BackgroundScheduler.java", + "java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java", + "java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerProcessorImpl.java", + "java/src/org/chromium/chrome/browser/offlinepages/ClientId.java", + "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java", + "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageItem.java", + "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java", + "java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java", + "java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java", + "java/src/org/chromium/chrome/browser/offlinepages/TriggerConditions.java", + "java/src/org/chromium/chrome/browser/offlinepages/interfaces/BackgroundSchedulerProcessor.java", + "java/src/org/chromium/chrome/browser/omaha/ExponentialBackoffScheduler.java", + "java/src/org/chromium/chrome/browser/omaha/MarketURLGetter.java", + "java/src/org/chromium/chrome/browser/omaha/OmahaClient.java", + "java/src/org/chromium/chrome/browser/omaha/RequestData.java", + "java/src/org/chromium/chrome/browser/omaha/RequestFailureException.java", + "java/src/org/chromium/chrome/browser/omaha/RequestGenerator.java", + "java/src/org/chromium/chrome/browser/omaha/ResponseParser.java", + "java/src/org/chromium/chrome/browser/omaha/StringSanitizer.java", + "java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java", + "java/src/org/chromium/chrome/browser/omaha/VersionNumber.java", + "java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java", + "java/src/org/chromium/chrome/browser/omaha/XMLParser.java", + "java/src/org/chromium/chrome/browser/omnibox/AnswerTextBuilder.java", + "java/src/org/chromium/chrome/browser/omnibox/AnswersImage.java", + "java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java", + "java/src/org/chromium/chrome/browser/omnibox/LocationBar.java", + "java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java", + "java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java", + "java/src/org/chromium/chrome/browser/omnibox/LocationBarTablet.java", + "java/src/org/chromium/chrome/browser/omnibox/OmniboxPrerender.java", + "java/src/org/chromium/chrome/browser/omnibox/OmniboxResultsAdapter.java", + "java/src/org/chromium/chrome/browser/omnibox/OmniboxSuggestion.java", + "java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java", + "java/src/org/chromium/chrome/browser/omnibox/OmniboxViewUtil.java", + "java/src/org/chromium/chrome/browser/omnibox/SuggestionAnswer.java", + "java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java", + "java/src/org/chromium/chrome/browser/omnibox/TrailingTextView.java", + "java/src/org/chromium/chrome/browser/omnibox/UrlBar.java", + "java/src/org/chromium/chrome/browser/omnibox/UrlFocusChangeListener.java", + "java/src/org/chromium/chrome/browser/omnibox/VoiceSuggestionProvider.java", + "java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java", + "java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationSnackbarController.java", + "java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationTracker.java", + "java/src/org/chromium/chrome/browser/pageinfo/CertificateViewer.java", + "java/src/org/chromium/chrome/browser/pageinfo/ConnectionInfoPopup.java", + "java/src/org/chromium/chrome/browser/pageinfo/WebsiteSettingsPopup.java", + "java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksProviderIterator.java", + "java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReader.java", + "java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksShim.java", + "java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java", + "java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java", + "java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java", + "java/src/org/chromium/chrome/browser/password_manager/AutoSigninFirstRunDialog.java", + "java/src/org/chromium/chrome/browser/password_manager/Credential.java", + "java/src/org/chromium/chrome/browser/payments/AddressEditor.java", + "java/src/org/chromium/chrome/browser/payments/AutofillAddress.java", + "java/src/org/chromium/chrome/browser/payments/AutofillContact.java", + "java/src/org/chromium/chrome/browser/payments/AutofillPaymentApp.java", + "java/src/org/chromium/chrome/browser/payments/AutofillPaymentInstrument.java", + "java/src/org/chromium/chrome/browser/payments/CardEditor.java", + "java/src/org/chromium/chrome/browser/payments/ContactEditor.java", + "java/src/org/chromium/chrome/browser/payments/CurrencyStringFormatter.java", + "java/src/org/chromium/chrome/browser/payments/EditorBase.java", + "java/src/org/chromium/chrome/browser/payments/PaymentApp.java", + "java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java", + "java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java", + "java/src/org/chromium/chrome/browser/payments/PaymentRequestFactory.java", + "java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java", + "java/src/org/chromium/chrome/browser/payments/PaymentRequestMetrics.java", + "java/src/org/chromium/chrome/browser/payments/ui/Completable.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorDialogToolbar.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorDropdownField.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorLabelField.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorModel.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java", + "java/src/org/chromium/chrome/browser/payments/ui/EditorView.java", + "java/src/org/chromium/chrome/browser/payments/ui/FadingEdgeScrollView.java", + "java/src/org/chromium/chrome/browser/payments/ui/LineItem.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentInformation.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java", + "java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUiErrorView.java", + "java/src/org/chromium/chrome/browser/payments/ui/SectionInformation.java", + "java/src/org/chromium/chrome/browser/payments/ui/ShoppingCart.java", + "java/src/org/chromium/chrome/browser/payments/ui/Validatable.java", + "java/src/org/chromium/chrome/browser/physicalweb/BitmapHttpRequest.java", + "java/src/org/chromium/chrome/browser/physicalweb/ClearNotificationAlarmReceiver.java", + "java/src/org/chromium/chrome/browser/physicalweb/HttpRequest.java", + "java/src/org/chromium/chrome/browser/physicalweb/JsonObjectHttpRequest.java", + "java/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivity.java", + "java/src/org/chromium/chrome/browser/physicalweb/NearbyUrlsAdapter.java", + "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java", + "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java", + "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java", + "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java", + "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java", + "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java", + "java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java", + "java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java", + "java/src/org/chromium/chrome/browser/physicalweb/PwsResult.java", + "java/src/org/chromium/chrome/browser/physicalweb/SwipeRefreshWidget.java", + "java/src/org/chromium/chrome/browser/physicalweb/UrlInfo.java", + "java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java", + "java/src/org/chromium/chrome/browser/physicalweb/Utils.java", + "java/src/org/chromium/chrome/browser/policy/PolicyAuditor.java", + "java/src/org/chromium/chrome/browser/precache/FailureReason.java", + "java/src/org/chromium/chrome/browser/precache/PrecacheController.java", + "java/src/org/chromium/chrome/browser/precache/PrecacheLauncher.java", + "java/src/org/chromium/chrome/browser/precache/PrecacheTaskScheduler.java", + "java/src/org/chromium/chrome/browser/precache/PrecacheUMA.java", + "java/src/org/chromium/chrome/browser/precache/SyncServiceInitializedNotifier.java", + "java/src/org/chromium/chrome/browser/preferences/AboutChromePreferences.java", + "java/src/org/chromium/chrome/browser/preferences/AccessibilityPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/ButtonPreference.java", + "java/src/org/chromium/chrome/browser/preferences/ChromeBaseCheckBoxPreference.java", + "java/src/org/chromium/chrome/browser/preferences/ChromeBaseListPreference.java", + "java/src/org/chromium/chrome/browser/preferences/ChromeBasePreference.java", + "java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java", + "java/src/org/chromium/chrome/browser/preferences/ChromeSwitchPreference.java", + "java/src/org/chromium/chrome/browser/preferences/ClearBrowsingDataCheckBoxPreference.java", + "java/src/org/chromium/chrome/browser/preferences/ExpandablePreferenceGroup.java", + "java/src/org/chromium/chrome/browser/preferences/HomepageEditor.java", + "java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java", + "java/src/org/chromium/chrome/browser/preferences/HyperlinkPreference.java", + "java/src/org/chromium/chrome/browser/preferences/LearnMorePreference.java", + "java/src/org/chromium/chrome/browser/preferences/LegalInformationPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/LocationSettings.java", + "java/src/org/chromium/chrome/browser/preferences/MainPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/ManagedPreferenceDelegate.java", + "java/src/org/chromium/chrome/browser/preferences/ManagedPreferencesUtils.java", + "java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java", + "java/src/org/chromium/chrome/browser/preferences/PreferenceCategoryWithButton.java", + "java/src/org/chromium/chrome/browser/preferences/Preferences.java", + "java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java", + "java/src/org/chromium/chrome/browser/preferences/ProtectedContentResetCredentialConfirmDialogFragment.java", + "java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java", + "java/src/org/chromium/chrome/browser/preferences/SearchEnginePreference.java", + "java/src/org/chromium/chrome/browser/preferences/SeekBarLinkedCheckBoxPreference.java", + "java/src/org/chromium/chrome/browser/preferences/SeekBarPreference.java", + "java/src/org/chromium/chrome/browser/preferences/SignInPreference.java", + "java/src/org/chromium/chrome/browser/preferences/SpinnerPreference.java", + "java/src/org/chromium/chrome/browser/preferences/SyncPreference.java", + "java/src/org/chromium/chrome/browser/preferences/SyncedAccountPreference.java", + "java/src/org/chromium/chrome/browser/preferences/TextAndButtonPreference.java", + "java/src/org/chromium/chrome/browser/preferences/TextMessagePreference.java", + "java/src/org/chromium/chrome/browser/preferences/TextMessageWithLinkAndIconPreference.java", + "java/src/org/chromium/chrome/browser/preferences/TextScalePreference.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillEditorBase.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillLocalCardEditor.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileBridge.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillServerCardEditor.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillServerProfilePreferences.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/CreditCardNumberFormattingTextWatcher.java", + "java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoScreen.java", + "java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java", + "java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoView.java", + "java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java", + "java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionStatsPreference.java", + "java/src/org/chromium/chrome/browser/preferences/password/PasswordEntryEditor.java", + "java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/BandwidthType.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataCounterBridge.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/ConfirmImportantSitesDialogFragment.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/ContextualSearchPreferenceFragment.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/CrashDumpUploadPreference.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/CrashReportingPermissionManager.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/DoNotTrackPreference.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/OtherFormsOfHistoryDialogFragment.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/PhysicalWebPreferenceFragment.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/UsageAndCrashReportsPreferenceFragment.java", + "java/src/org/chromium/chrome/browser/preferences/website/AddExceptionPreference.java", + "java/src/org/chromium/chrome/browser/preferences/website/CameraInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/ClearWebsiteStorage.java", + "java/src/org/chromium/chrome/browser/preferences/website/ContentSetting.java", + "java/src/org/chromium/chrome/browser/preferences/website/ContentSettingException.java", + "java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java", + "java/src/org/chromium/chrome/browser/preferences/website/FullscreenInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/GeolocationInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/KeygenInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/LanguagePreferences.java", + "java/src/org/chromium/chrome/browser/preferences/website/LocalStorageInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/LocationCategory.java", + "java/src/org/chromium/chrome/browser/preferences/website/ManageSpaceActivity.java", + "java/src/org/chromium/chrome/browser/preferences/website/MicrophoneInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/MidiInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/NotificationInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/PermissionInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/ProtectedMediaIdentifierInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java", + "java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java", + "java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreference.java", + "java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/website/StorageInfo.java", + "java/src/org/chromium/chrome/browser/preferences/website/Website.java", + "java/src/org/chromium/chrome/browser/preferences/website/WebsiteAddress.java", + "java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java", + "java/src/org/chromium/chrome/browser/preferences/website/WebsitePreference.java", + "java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java", + "java/src/org/chromium/chrome/browser/prerender/ChromePrerenderService.java", + "java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java", + "java/src/org/chromium/chrome/browser/printing/PrintingControllerFactory.java", + "java/src/org/chromium/chrome/browser/printing/TabPrinter.java", + "java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java", + "java/src/org/chromium/chrome/browser/profiles/Profile.java", + "java/src/org/chromium/chrome/browser/profiles/ProfileDownloader.java", + "java/src/org/chromium/chrome/browser/provider/BaseColumns.java", + "java/src/org/chromium/chrome/browser/provider/BookmarkColumns.java", + "java/src/org/chromium/chrome/browser/provider/ChromeBrowserProvider.java", + "java/src/org/chromium/chrome/browser/provider/ChromeBrowserProviderSuggestionsCursor.java", + "java/src/org/chromium/chrome/browser/provider/SearchColumns.java", + "java/src/org/chromium/chrome/browser/push_messaging/PushMessagingServiceObserver.java", + "java/src/org/chromium/chrome/browser/rappor/RapporServiceBridge.java", + "java/src/org/chromium/chrome/browser/rlz/RevenueStats.java", + "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingApiBridge.java", + "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingApiHandler.java", + "java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java", + "java/src/org/chromium/chrome/browser/services/AccountsChangedReceiver.java", + "java/src/org/chromium/chrome/browser/services/AndroidEduAndChildAccountHelper.java", + "java/src/org/chromium/chrome/browser/services/AndroidEduOwnerCheckCallback.java", + "java/src/org/chromium/chrome/browser/services/GoogleServicesManager.java", + "java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java", + "java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java", + "java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java", + "java/src/org/chromium/chrome/browser/sessions/SessionTabHelper.java", + "java/src/org/chromium/chrome/browser/share/ShareDialogAdapter.java", + "java/src/org/chromium/chrome/browser/share/ShareHelper.java", + "java/src/org/chromium/chrome/browser/signin/AccountAdder.java", + "java/src/org/chromium/chrome/browser/signin/AccountIdProvider.java", + "java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java", + "java/src/org/chromium/chrome/browser/signin/AccountManagementScreenHelper.java", + "java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java", + "java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java", + "java/src/org/chromium/chrome/browser/signin/AccountSigninConfirmationView.java", + "java/src/org/chromium/chrome/browser/signin/AccountSigninView.java", + "java/src/org/chromium/chrome/browser/signin/AccountTrackerService.java", + "java/src/org/chromium/chrome/browser/signin/ConfirmImportSyncDataDialog.java", + "java/src/org/chromium/chrome/browser/signin/ConfirmManagedSyncDataDialog.java", + "java/src/org/chromium/chrome/browser/signin/ConfirmSyncDataStateMachine.java", + "java/src/org/chromium/chrome/browser/signin/GoogleActivityController.java", + "java/src/org/chromium/chrome/browser/signin/OAuth2TokenService.java", + "java/src/org/chromium/chrome/browser/signin/SignOutDialogFragment.java", + "java/src/org/chromium/chrome/browser/signin/SigninAndSyncView.java", + "java/src/org/chromium/chrome/browser/signin/SigninHelper.java", + "java/src/org/chromium/chrome/browser/signin/SigninInvestigator.java", + "java/src/org/chromium/chrome/browser/signin/SigninManager.java", + "java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java", + "java/src/org/chromium/chrome/browser/snackbar/DataUseSnackbarController.java", + "java/src/org/chromium/chrome/browser/snackbar/LofiBarController.java", + "java/src/org/chromium/chrome/browser/snackbar/Snackbar.java", + "java/src/org/chromium/chrome/browser/snackbar/SnackbarCollection.java", + "java/src/org/chromium/chrome/browser/snackbar/SnackbarManager.java", + "java/src/org/chromium/chrome/browser/snackbar/SnackbarView.java", + "java/src/org/chromium/chrome/browser/snackbar/TemplatePreservingTextView.java", + "java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java", + "java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java", + "java/src/org/chromium/chrome/browser/spellchecker/SpellCheckerSessionBridge.java", + "java/src/org/chromium/chrome/browser/ssl/SecurityStateModel.java", + "java/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProvider.java", + "java/src/org/chromium/chrome/browser/sync/GmsCoreSyncListener.java", + "java/src/org/chromium/chrome/browser/sync/GoogleServiceAuthError.java", + "java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java", + "java/src/org/chromium/chrome/browser/sync/SyncAccountSwitcher.java", + "java/src/org/chromium/chrome/browser/sync/SyncController.java", + "java/src/org/chromium/chrome/browser/sync/SyncNotificationController.java", + "java/src/org/chromium/chrome/browser/sync/SyncSessionsMetrics.java", + "java/src/org/chromium/chrome/browser/sync/SyncUserDataWiper.java", + "java/src/org/chromium/chrome/browser/sync/ui/PassphraseActivity.java", + "java/src/org/chromium/chrome/browser/sync/ui/PassphraseCreationDialogFragment.java", + "java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java", + "java/src/org/chromium/chrome/browser/sync/ui/PassphraseTypeDialogFragment.java", + "java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java", + "java/src/org/chromium/chrome/browser/tab/AuthenticatorNavigationInterceptor.java", + "java/src/org/chromium/chrome/browser/tab/ChildBackgroundTabShowObserver.java", + "java/src/org/chromium/chrome/browser/tab/EmptyTabObserver.java", + "java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java", + "java/src/org/chromium/chrome/browser/tab/SadTabView.java", + "java/src/org/chromium/chrome/browser/tab/SadTabViewFactory.java", + "java/src/org/chromium/chrome/browser/tab/Tab.java", + "java/src/org/chromium/chrome/browser/tab/TabContentViewParent.java", + "java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java", + "java/src/org/chromium/chrome/browser/tab/TabContextMenuPopulator.java", + "java/src/org/chromium/chrome/browser/tab/TabDelegateFactory.java", + "java/src/org/chromium/chrome/browser/tab/TabIdManager.java", + "java/src/org/chromium/chrome/browser/tab/TabObserver.java", + "java/src/org/chromium/chrome/browser/tab/TabRedirectHandler.java", + "java/src/org/chromium/chrome/browser/tab/TabUma.java", + "java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java", + "java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java", + "java/src/org/chromium/chrome/browser/tab/TopControlsVisibilityDelegate.java", + "java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParams.java", + "java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java", + "java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java", + "java/src/org/chromium/chrome/browser/tabmodel/DocumentModeAssassin.java", + "java/src/org/chromium/chrome/browser/tabmodel/EmptyTabModel.java", + "java/src/org/chromium/chrome/browser/tabmodel/EmptyTabModelObserver.java", + "java/src/org/chromium/chrome/browser/tabmodel/EmptyTabModelSelectorObserver.java", + "java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModel.java", + "java/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModelImplCreator.java", + "java/src/org/chromium/chrome/browser/tabmodel/SingleTabModel.java", + "java/src/org/chromium/chrome/browser/tabmodel/SingleTabModelSelector.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabList.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModel.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelDelegate.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelJniBridge.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelObserver.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelOrderController.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorImpl.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorObserver.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserver.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorUma.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabModelUtils.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabPersister.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabReparentingParams.java", + "java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/ActivityDelegate.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/ActivityDelegateImpl.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/AsyncTabCreationParams.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModel.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelImpl.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelSelector.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/OffTheRecordDocumentTabModel.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/StorageDelegate.java", + "java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java", + "java/src/org/chromium/chrome/browser/toolbar/ActionModeController.java", + "java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java", + "java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbarAnimationDelegate.java", + "java/src/org/chromium/chrome/browser/toolbar/HomePageButton.java", + "java/src/org/chromium/chrome/browser/toolbar/KeyboardNavigationListener.java", + "java/src/org/chromium/chrome/browser/toolbar/TabSwitcherCallout.java", + "java/src/org/chromium/chrome/browser/toolbar/TabSwitcherDrawable.java", + "java/src/org/chromium/chrome/browser/toolbar/Toolbar.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarActionModeCallback.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarControlContainer.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarDataProvider.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarModelImpl.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarTabController.java", + "java/src/org/chromium/chrome/browser/toolbar/ToolbarTablet.java", + "java/src/org/chromium/chrome/browser/upgrade/PackageReplacedBroadcastReceiver.java", + "java/src/org/chromium/chrome/browser/upgrade/UpgradeActivity.java", + "java/src/org/chromium/chrome/browser/upgrade/UpgradeIntentService.java", + "java/src/org/chromium/chrome/browser/util/AccessibilityUtil.java", + "java/src/org/chromium/chrome/browser/util/ColorUtils.java", + "java/src/org/chromium/chrome/browser/util/CompatibilityFileProvider.java", + "java/src/org/chromium/chrome/browser/util/FeatureUtilities.java", + "java/src/org/chromium/chrome/browser/util/HashUtil.java", + "java/src/org/chromium/chrome/browser/util/HttpURLConnectionFactory.java", + "java/src/org/chromium/chrome/browser/util/HttpURLConnectionFactoryImpl.java", + "java/src/org/chromium/chrome/browser/util/IntentUtils.java", + "java/src/org/chromium/chrome/browser/util/KeyNavigationUtil.java", + "java/src/org/chromium/chrome/browser/util/MathUtils.java", + "java/src/org/chromium/chrome/browser/util/NonThreadSafe.java", + "java/src/org/chromium/chrome/browser/util/PlatformUtil.java", + "java/src/org/chromium/chrome/browser/util/UrlUtilities.java", + "java/src/org/chromium/chrome/browser/util/ViewUtils.java", + "java/src/org/chromium/chrome/browser/webapps/ActivityAssigner.java", + "java/src/org/chromium/chrome/browser/webapps/AddToHomescreenDialog.java", + "java/src/org/chromium/chrome/browser/webapps/AddToHomescreenDialogHelper.java", + "java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java", + "java/src/org/chromium/chrome/browser/webapps/FullScreenActivity.java", + "java/src/org/chromium/chrome/browser/webapps/FullScreenDelegateFactory.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity0.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity1.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity2.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity3.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity4.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity5.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity6.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity7.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity8.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkActivity9.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkBuilder.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkManagedActivity.java", + "java/src/org/chromium/chrome/browser/webapps/WebApkVersionManager.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity0.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity1.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity2.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity3.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity4.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity5.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity6.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity7.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity8.java", + "java/src/org/chromium/chrome/browser/webapps/WebappActivity9.java", + "java/src/org/chromium/chrome/browser/webapps/WebappAuthenticator.java", + "java/src/org/chromium/chrome/browser/webapps/WebappControlContainer.java", + "java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java", + "java/src/org/chromium/chrome/browser/webapps/WebappDelegateFactory.java", + "java/src/org/chromium/chrome/browser/webapps/WebappDirectoryManager.java", + "java/src/org/chromium/chrome/browser/webapps/WebappInfo.java", + "java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java", + "java/src/org/chromium/chrome/browser/webapps/WebappManagedActivity.java", + "java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java", + "java/src/org/chromium/chrome/browser/webapps/WebappUrlBar.java", + "java/src/org/chromium/chrome/browser/widget/AlertDialogEditText.java", + "java/src/org/chromium/chrome/browser/widget/AlwaysDismissedDialog.java", + "java/src/org/chromium/chrome/browser/widget/BoundedLinearLayout.java", + "java/src/org/chromium/chrome/browser/widget/ClipDrawableProgressBar.java", + "java/src/org/chromium/chrome/browser/widget/CompatibilityTextInputLayout.java", + "java/src/org/chromium/chrome/browser/widget/ControlContainer.java", + "java/src/org/chromium/chrome/browser/widget/DualControlLayout.java", + "java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java", + "java/src/org/chromium/chrome/browser/widget/FadingShadow.java", + "java/src/org/chromium/chrome/browser/widget/FadingShadowView.java", + "java/src/org/chromium/chrome/browser/widget/FloatLabelLayout.java", + "java/src/org/chromium/chrome/browser/widget/LoadingView.java", + "java/src/org/chromium/chrome/browser/widget/NumberRollView.java", + "java/src/org/chromium/chrome/browser/widget/OverviewListLayout.java", + "java/src/org/chromium/chrome/browser/widget/PaddedFrameLayout.java", + "java/src/org/chromium/chrome/browser/widget/ProgressAnimationFastStart.java", + "java/src/org/chromium/chrome/browser/widget/ProgressAnimationLinear.java", + "java/src/org/chromium/chrome/browser/widget/ProgressAnimationSmooth.java", + "java/src/org/chromium/chrome/browser/widget/RadioButtonWithDescription.java", + "java/src/org/chromium/chrome/browser/widget/RoundedIconGenerator.java", + "java/src/org/chromium/chrome/browser/widget/SlowedProgressBar.java", + "java/src/org/chromium/chrome/browser/widget/SmoothProgressBar.java", + "java/src/org/chromium/chrome/browser/widget/TextBubble.java", + "java/src/org/chromium/chrome/browser/widget/TintedDrawable.java", + "java/src/org/chromium/chrome/browser/widget/TintedImageButton.java", + "java/src/org/chromium/chrome/browser/widget/TintedImageView.java", + "java/src/org/chromium/chrome/browser/widget/ToolbarProgressBar.java", + "java/src/org/chromium/chrome/browser/widget/ToolbarProgressBarAnimatingView.java", + "java/src/org/chromium/chrome/browser/widget/VerticallyFixedEditText.java", + "java/src/org/chromium/chrome/browser/widget/ViewResourceFrameLayout.java", + "java/src/org/chromium/chrome/browser/widget/accessibility/AccessibilityTabModelAdapter.java", + "java/src/org/chromium/chrome/browser/widget/accessibility/AccessibilityTabModelListItem.java", + "java/src/org/chromium/chrome/browser/widget/accessibility/AccessibilityTabModelListView.java", + "java/src/org/chromium/chrome/browser/widget/accessibility/AccessibilityTabModelWrapper.java", + "java/src/org/chromium/chrome/browser/widget/animation/AnimatorProperties.java", + "java/src/org/chromium/chrome/browser/widget/animation/CancelAwareAnimatorListener.java", + "java/src/org/chromium/chrome/browser/widget/animation/FocusAnimator.java", + "java/src/org/chromium/chrome/browser/widget/emptybackground/EmptyBackgroundViewTablet.java", + "java/src/org/chromium/chrome/browser/widget/emptybackground/EmptyBackgroundViewWrapper.java", + "java/src/org/chromium/chrome/browser/widget/findinpage/FindResultBar.java", + "java/src/org/chromium/chrome/browser/widget/findinpage/FindToolbar.java", + "java/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarManager.java", + "java/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarObserver.java", + "java/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarPhone.java", + "java/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarTablet.java", + "java/src/org/chromium/chrome/browser/widget/incognitotoggle/IncognitoToggleButtonTablet.java", + "java/src/org/chromium/chrome/browser/widget/newtab/NewTabButton.java", +] + +chrome_test_java_sources = [ + "javatests/src/org/chromium/base/test/util/parameter/ParameterizedTestAnnotationTest.java", + "javatests/src/org/chromium/base/test/util/parameter/ParameterizedTestClassAnnotationInheritanceTest.java", + "javatests/src/org/chromium/base/test/util/parameter/ParameterizedTestClassAnnotationParameterSetAndTest.java", + "javatests/src/org/chromium/base/test/util/parameter/ParameterizedTestClassAnnotationParametersTest.java", + "javatests/src/org/chromium/base/test/util/parameter/ParameterizedTestClassAnnotationParametersTestSetInheritanceTest.java", + "javatests/src/org/chromium/base/test/util/parameter/ParameterizedTestClassAnnotationParametersTestSetTest.java", + "javatests/src/org/chromium/base/test/util/parameter/ParameterizedTestClassAnnotationTest.java", + "javatests/src/org/chromium/chrome/browser/AudioTest.java", + "javatests/src/org/chromium/chrome/browser/BackgroundSyncLauncherTest.java", + "javatests/src/org/chromium/chrome/browser/BindingManagerIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java", + "javatests/src/org/chromium/chrome/browser/ChromeActivityTest.java", + "javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java", + "javatests/src/org/chromium/chrome/browser/ChromeBackupIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/ContentViewFocusTest.java", + "javatests/src/org/chromium/chrome/browser/FocusedEditableTextFieldZoomTest.java", + "javatests/src/org/chromium/chrome/browser/GeolocationTest.java", + "javatests/src/org/chromium/chrome/browser/HistoryUITest.java", + "javatests/src/org/chromium/chrome/browser/IntentHandlerTest.java", + "javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java", + "javatests/src/org/chromium/chrome/browser/JavaScriptEvalChromeTest.java", + "javatests/src/org/chromium/chrome/browser/MainActivityWithURLTest.java", + "javatests/src/org/chromium/chrome/browser/ModalDialogTest.java", + "javatests/src/org/chromium/chrome/browser/NavigateTest.java", + "javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java", + "javatests/src/org/chromium/chrome/browser/OSKOverscrollTest.java", + "javatests/src/org/chromium/chrome/browser/PopularUrlsTest.java", + "javatests/src/org/chromium/chrome/browser/PopupTest.java", + "javatests/src/org/chromium/chrome/browser/PowerBroadcastReceiverTest.java", + "javatests/src/org/chromium/chrome/browser/PrerenderTest.java", + "javatests/src/org/chromium/chrome/browser/ProcessIsolationTest.java", + "javatests/src/org/chromium/chrome/browser/RepostFormWarningTest.java", + "javatests/src/org/chromium/chrome/browser/SelectFileDialogTest.java", + "javatests/src/org/chromium/chrome/browser/SmartClipProviderTest.java", + "javatests/src/org/chromium/chrome/browser/TabCountLabelTest.java", + "javatests/src/org/chromium/chrome/browser/TabStateTest.java", + "javatests/src/org/chromium/chrome/browser/TabTest.java", + "javatests/src/org/chromium/chrome/browser/TabThemeTest.java", + "javatests/src/org/chromium/chrome/browser/TabsOpenedFromExternalAppTest.java", + "javatests/src/org/chromium/chrome/browser/TabsTest.java", + "javatests/src/org/chromium/chrome/browser/UrlSchemeTest.java", + "javatests/src/org/chromium/chrome/browser/UsbChooserDialogTest.java", + "javatests/src/org/chromium/chrome/browser/accessibility/FontSizePrefsTest.java", + "javatests/src/org/chromium/chrome/browser/appmenu/AppMenuTest.java", + "javatests/src/org/chromium/chrome/browser/autofill/AutofillKeyboardAccessoryTest.java", + "javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java", + "javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java", + "javatests/src/org/chromium/chrome/browser/autofill/AutofillTest.java", + "javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java", + "javatests/src/org/chromium/chrome/browser/autofill/PersonalDataManagerTest.java", + "javatests/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java", + "javatests/src/org/chromium/chrome/browser/banners/InstallerDelegateTest.java", + "javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkBridgeTest.java", + "javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkModelTest.java", + "javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java", + "javatests/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBaseTest.java", + "javatests/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelEventFilterTest.java", + "javatests/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelManagerTest.java", + "javatests/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelManagerWrapper.java", + "javatests/src/org/chromium/chrome/browser/compositor/eventfilter/MockEventFilterHost.java", + "javatests/src/org/chromium/chrome/browser/compositor/layouts/ChromeAnimationTest.java", + "javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java", + "javatests/src/org/chromium/chrome/browser/compositor/layouts/MockContextForLayout.java", + "javatests/src/org/chromium/chrome/browser/compositor/layouts/MockLayoutHost.java", + "javatests/src/org/chromium/chrome/browser/compositor/layouts/MockResourcesForLayout.java", + "javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java", + "javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java", + "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java", + "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java", + "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPolicyTest.java", + "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRequestTest.java", + "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTapEventTest.java", + "javatests/src/org/chromium/chrome/browser/contextualsearch/MockContextualSearchPolicy.java", + "javatests/src/org/chromium/chrome/browser/crash/CrashFileManagerTest.java", + "javatests/src/org/chromium/chrome/browser/crash/CrashTestCase.java", + "javatests/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableTest.java", + "javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadCallableTest.java", + "javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadServiceTest.java", + "javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java", + "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java", + "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTestBase.java", + "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabExternalNavigationTest.java", + "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java", + "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java", + "javatests/src/org/chromium/chrome/browser/customtabs/RequestThrottlerTest.java", + "javatests/src/org/chromium/chrome/browser/document/LauncherActivityTest.java", + "javatests/src/org/chromium/chrome/browser/dom_distiller/DistillabilityServiceTest.java", + "javatests/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsTest.java", + "javatests/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManagerTest.java", + "javatests/src/org/chromium/chrome/browser/download/ChromeDownloadDelegateTest.java", + "javatests/src/org/chromium/chrome/browser/download/DownloadInfoTest.java", + "javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java", + "javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java", + "javatests/src/org/chromium/chrome/browser/download/DownloadTest.java", + "javatests/src/org/chromium/chrome/browser/download/DownloadTestBase.java", + "javatests/src/org/chromium/chrome/browser/download/MockDownloadNotificationService.java", + "javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java", + "javatests/src/org/chromium/chrome/browser/download/SystemDownloadNotifierTest.java", + "javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImplTest.java", + "javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java", + "javatests/src/org/chromium/chrome/browser/externalnav/IntentWithGesturesHandlerTest.java", + "javatests/src/org/chromium/chrome/browser/externalnav/UrlOverridingTest.java", + "javatests/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerTest.java", + "javatests/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerTestBase.java", + "javatests/src/org/chromium/chrome/browser/feedback/ConnectivityTaskTest.java", + "javatests/src/org/chromium/chrome/browser/feedback/FeedbackCollectorTest.java", + "javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java", + "javatests/src/org/chromium/chrome/browser/gcore/MockConnectedTask.java", + "javatests/src/org/chromium/chrome/browser/gcore/MockConnectedTaskTest.java", + "javatests/src/org/chromium/chrome/browser/hardware_acceleration/ChromeTabbedActivityHWATest.java", + "javatests/src/org/chromium/chrome/browser/hardware_acceleration/CustomTabActivityHWATest.java", + "javatests/src/org/chromium/chrome/browser/hardware_acceleration/EmbedContentViewActivityHWATest.java", + "javatests/src/org/chromium/chrome/browser/hardware_acceleration/ManifestHWATest.java", + "javatests/src/org/chromium/chrome/browser/hardware_acceleration/Utils.java", + "javatests/src/org/chromium/chrome/browser/hardware_acceleration/WebappActivityHWATest.java", + "javatests/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGeneratorTest.java", + "javatests/src/org/chromium/chrome/browser/identity/UniqueIdentificationGeneratorFactoryTest.java", + "javatests/src/org/chromium/chrome/browser/identity/UuidBasedUniqueIdentificationGeneratorTest.java", + "javatests/src/org/chromium/chrome/browser/incognito/IncognitoNotificationServiceTest.java", + "javatests/src/org/chromium/chrome/browser/infobar/InfoBarContainerTest.java", + "javatests/src/org/chromium/chrome/browser/infobar/InfoBarControlLayoutTest.java", + "javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest.java", + "javatests/src/org/chromium/chrome/browser/infobar/PermissionUpdateInfobarTest.java", + "javatests/src/org/chromium/chrome/browser/input/SelectPopupOtherContentViewTest.java", + "javatests/src/org/chromium/chrome/browser/invalidation/ChromeBrowserSyncAdapterTest.java", + "javatests/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsControllerTest.java", + "javatests/src/org/chromium/chrome/browser/invalidation/InvalidationServiceTest.java", + "javatests/src/org/chromium/chrome/browser/media/RouterTestUtils.java", + "javatests/src/org/chromium/chrome/browser/media/remote/CastNotificationTest.java", + "javatests/src/org/chromium/chrome/browser/media/remote/CastPositionTransferTest.java", + "javatests/src/org/chromium/chrome/browser/media/remote/CastStartStopTest.java", + "javatests/src/org/chromium/chrome/browser/media/remote/CastSwitchVideoTest.java", + "javatests/src/org/chromium/chrome/browser/media/remote/CastTestBase.java", + "javatests/src/org/chromium/chrome/browser/media/remote/CastVideoControlsTest.java", + "javatests/src/org/chromium/chrome/browser/media/router/MediaRouterIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/media/router/MockMediaRouteProvider.java", + "javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java", + "javatests/src/org/chromium/chrome/browser/media/ui/PauseOnHeadsetUnplugTest.java", + "javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtilsTest.java", + "javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java", + "javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeIntentTest.java", + "javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java", + "javatests/src/org/chromium/chrome/browser/notifications/NotificationTestBase.java", + "javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java", + "javatests/src/org/chromium/chrome/browser/ntp/FakeMostVisitedSites.java", + "javatests/src/org/chromium/chrome/browser/ntp/NewTabPageNavigationTest.java", + "javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java", + "javatests/src/org/chromium/chrome/browser/ntp/interests/InterestsServiceTest.java", + "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java", + "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java", + "javatests/src/org/chromium/chrome/browser/omaha/ExponentialBackoffSchedulerTest.java", + "javatests/src/org/chromium/chrome/browser/omaha/MockExponentialBackoffScheduler.java", + "javatests/src/org/chromium/chrome/browser/omaha/OmahaClientTest.java", + "javatests/src/org/chromium/chrome/browser/omaha/RequestGeneratorTest.java", + "javatests/src/org/chromium/chrome/browser/omaha/StringSanitizerTest.java", + "javatests/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelperTest.java", + "javatests/src/org/chromium/chrome/browser/omnibox/OmniboxTest.java", + "javatests/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizerTest.java", + "javatests/src/org/chromium/chrome/browser/omnibox/SuggestionAnswerTest.java", + "javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java", + "javatests/src/org/chromium/chrome/browser/omnibox/VoiceSuggestionProviderTest.java", + "javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java", + "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationUnitTest.java", + "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableBookmarksEditingUnitTest.java", + "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableIncognitoModeIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableIncognitoModeUnitTest.java", + "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerHomepageIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerHomepageUnitTest.java", + "javatests/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivityTest.java", + "javatests/src/org/chromium/chrome/browser/physicalweb/MockPwsClient.java", + "javatests/src/org/chromium/chrome/browser/physicalweb/PwsClientImplTest.java", + "javatests/src/org/chromium/chrome/browser/physicalweb/UrlInfoTest.java", + "javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java", + "javatests/src/org/chromium/chrome/browser/policy/CombinedPolicyProviderTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestAbortTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsAndFreeShippingTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestDynamicShippingMultipleAddressesTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestDynamicShippingSingleAddressTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestEmailTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestEmailAndFreeShippingTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFailCompleteTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestIncompleteContactDetailsTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestIncompleteEmailTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestIncompletePhoneTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestIncompleteServerCardTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsUnitTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMultipleContactDetailsTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNoShippingTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndCardsTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneAndFreeShippingTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestRemoveBillingAddressTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServerCardTest.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java", + "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestUseStatsTest.java", + "javatests/src/org/chromium/chrome/browser/precache/MockPrecacheController.java", + "javatests/src/org/chromium/chrome/browser/precache/PrecacheLauncherTest.java", + "javatests/src/org/chromium/chrome/browser/precache/PrecacheControllerTest.java", + "javatests/src/org/chromium/chrome/browser/precache/PrecacheUMATest.java", + "javatests/src/org/chromium/chrome/browser/preferences/PreferencesTest.java", + "javatests/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtilsTest.java", + "javatests/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferencesTest.java", + "javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTest.java", + "javatests/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManagerTest.java", + "javatests/src/org/chromium/chrome/browser/preferences/website/ManageSpaceActivityTest.java", + "javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java", + "javatests/src/org/chromium/chrome/browser/preferences/website/WebsiteAddressTest.java", + "javatests/src/org/chromium/chrome/browser/printing/PrintingControllerTest.java", + "javatests/src/org/chromium/chrome/browser/provider/ProviderBookmarkNodeUnitTest.java", + "javatests/src/org/chromium/chrome/browser/provider/ProviderBookmarksUriTest.java", + "javatests/src/org/chromium/chrome/browser/provider/ProviderSearchesUriTest.java", + "javatests/src/org/chromium/chrome/browser/provider/ProviderTestBase.java", + "javatests/src/org/chromium/chrome/browser/push_messaging/PushMessagingTest.java", + "javatests/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceTest.java", + "javatests/src/org/chromium/chrome/browser/services/GoogleServicesManagerIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/share/ShareUrlTest.java", + "javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceTest.java", + "javatests/src/org/chromium/chrome/browser/signin/SigninHelperTest.java", + "javatests/src/org/chromium/chrome/browser/signin/SigninTest.java", + "javatests/src/org/chromium/chrome/browser/snackbar/SnackbarTest.java", + "javatests/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderTest.java", + "javatests/src/org/chromium/chrome/browser/sync/FakeProfileSyncService.java", + "javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java", + "javatests/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateTest.java", + "javatests/src/org/chromium/chrome/browser/tab/SadTabTest.java", + "javatests/src/org/chromium/chrome/browser/tab/TabIdManagerTest.java", + "javatests/src/org/chromium/chrome/browser/tab/TabRedirectHandlerTest.java", + "javatests/src/org/chromium/chrome/browser/tab/TabTestUtils.java", + "javatests/src/org/chromium/chrome/browser/tab/TabUmaTest.java", + "javatests/src/org/chromium/chrome/browser/tab/UndoIntegrationTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/AsyncTabCreationParamsManagerTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreatorTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/ContextMenuLoadUrlParamsTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/DocumentModeAssassinTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/MultiInstanceMigrationTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/OffTheRecordTabModelTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/TestTabModelDirectory.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java", + "javatests/src/org/chromium/chrome/browser/tabmodel/document/MockDocumentTabModel.java", + "javatests/src/org/chromium/chrome/browser/toolbar/BrandColorTest.java", + "javatests/src/org/chromium/chrome/browser/toolbar/ToolbarModelTest.java", + "javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java", + "javatests/src/org/chromium/chrome/browser/translate/TranslateInfoBarTest.java", + "javatests/src/org/chromium/chrome/browser/translate/TranslateOptionsTest.java", + "javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java", + "javatests/src/org/chromium/chrome/browser/util/HashUtilTest.java", + "javatests/src/org/chromium/chrome/browser/util/UrlUtilitiesTest.java", + "javatests/src/org/chromium/chrome/browser/video/FullscreenVideoTest.java", + "javatests/src/org/chromium/chrome/browser/video/VideoTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/ActivityAssignerTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenDialogHelperTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenDialogTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappAuthenticatorTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenBackgroundColorTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenHomescreenIconTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenIconTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenThemeColorTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappUrlBarTest.java", + "javatests/src/org/chromium/chrome/browser/webapps/WebappVisibilityTest.java", + "javatests/src/org/chromium/chrome/browser/widget/DualControlLayoutTest.java", + "javatests/src/org/chromium/chrome/browser/widget/OverviewListLayoutTest.java", + "javatests/src/org/chromium/chrome/browser/widget/RoundedIconGeneratorTest.java", + "javatests/src/org/chromium/chrome/browser/widget/ToolbarProgressBarTest.java", + "javatests/src/org/chromium/chrome/browser/widget/findinpage/FindTest.java", + "javatests/src/org/chromium/chrome/test/ParametersOnMultiTest.java", + "javatests/src/org/chromium/chrome/test/util/ChromeSigninUtilsTest.java", + "javatests/src/org/chromium/chrome/test/util/parameters/SigninParametersTest.java", +] + +chrome_junit_test_java_sources = [ + "junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java", + "junit/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiterTest.java", + "junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java", + "junit/src/org/chromium/chrome/browser/SSLClientCertificateRequestTest.java", + "junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java", + "junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionControllerTest.java", + "junit/src/org/chromium/chrome/browser/cookies/CanonicalCookieTest.java", + "junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableTest.java", + "junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java", + "junit/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencerTest.java", + "junit/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelperTest.java", + "junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java", + "junit/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteControllerTest.java", + "junit/src/org/chromium/chrome/browser/media/remote/MediaUrlResolverTest.java", + "junit/src/org/chromium/chrome/browser/media/remote/RemoteVideoInfoTest.java", + "junit/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterRouteTest.java", + "junit/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterSinkObservationTest.java", + "junit/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterTestBase.java", + "junit/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandlerTest.java", + "junit/src/org/chromium/chrome/browser/media/router/cast/DiscoveryCallbackTest.java", + "junit/src/org/chromium/chrome/browser/media/router/cast/JSONTestUtils.java", + "junit/src/org/chromium/chrome/browser/media/router/cast/MediaSourceTest.java", + "junit/src/org/chromium/chrome/browser/media/router/cast/TestUtils.java", + "junit/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java", + "junit/src/org/chromium/chrome/browser/ntp/NativePageFactoryTest.java", + "junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java", + "junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java", + "junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java", + "junit/src/org/chromium/chrome/browser/offlinepages/ClientIdTest.java", + "junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java", + "junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserverTest.java", + "junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java", + "junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java", + "junit/src/org/chromium/chrome/browser/offlinepages/StubBackgroundSchedulerProcessor.java", + "junit/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPackerTest.java", + "junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java", + "junit/src/org/chromium/chrome/browser/omaha/VersionNumberTest.java", + "junit/src/org/chromium/chrome/browser/payments/AutofillContactTest.java", + "junit/src/org/chromium/chrome/browser/payments/CurrencyStringFormatterTest.java", + "junit/src/org/chromium/chrome/browser/snackbar/SnackbarCollectionUnitTest.java", + "junit/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderUnitTest.java", + "junit/src/org/chromium/chrome/browser/util/NonThreadSafeTest.java", + "junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java", + "junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java", +] + +sync_shell_test_java_sources = [ + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/AutofillTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/BookmarksTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/FakeServerHelper.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/GmsCoreSyncListenerTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/TypedUrlsTest.java", + "sync_shell/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseTypeDialogFragmentTest.java", +] diff --git a/chromium/chrome/android/webapk/libs/client/BUILD.gn b/chromium/chrome/android/webapk/libs/client/BUILD.gn new file mode 100644 index 00000000000..57d4a97f6ee --- /dev/null +++ b/chromium/chrome/android/webapk/libs/client/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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("//chrome/android/webapk/libs/runtime_library_version.gni") + +android_library("client_java") { + java_files = [ + "src/org/chromium/webapk/lib/client/DexOptimizer.java", + "src/org/chromium/webapk/lib/client/WebApkNavigationClient.java", + "src/org/chromium/webapk/lib/client/WebApkServiceConnectionManager.java", + "src/org/chromium/webapk/lib/client/WebApkValidator.java", + ] + deps = [ + "//chrome/android/webapk/libs/common:common_java", + ] + srcjar_deps = [ + ":runtime_library_version_java", + "//chrome/android/webapk/libs/runtime_library:webapk_service_aidl", + ] +} + +java_cpp_template("runtime_library_version_java") { + package_name = "org/chromium/webapk/lib/client" + sources = [ + "src/org/chromium/webapk/lib/client/WebApkVersion.template", + ] + defines = [ "CURRENT_RUNTIME_DEX_VERSION_VALUE=$runtime_library_version" ] +} + +junit_binary("webapk_client_junit_tests") { + java_files = [ + "junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.java", + "junit/src/org/chromium/webapk/lib/client/WebApkValidatorTest.java", + ] + deps = [ + ":client_java", + "//base:base_junit_test_support", + ] +} diff --git a/chromium/chrome/android/webapk/libs/common/BUILD.gn b/chromium/chrome/android/webapk/libs/common/BUILD.gn new file mode 100644 index 00000000000..5158efb49fd --- /dev/null +++ b/chromium/chrome/android/webapk/libs/common/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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") + +android_library("common_java") { + java_files = [ + "src/org/chromium/webapk/lib/common/WebApkConstants.java", + "src/org/chromium/webapk/lib/common/WebApkUtils.java", + ] +} diff --git a/chromium/chrome/android/webapk/libs/runtime_library/BUILD.gn b/chromium/chrome/android/webapk/libs/runtime_library/BUILD.gn new file mode 100644 index 00000000000..563da8c9a20 --- /dev/null +++ b/chromium/chrome/android/webapk/libs/runtime_library/BUILD.gn @@ -0,0 +1,51 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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("//chrome/android/webapk/libs/runtime_library_version.gni") + +# runtime_library_version.gni must be updated whenever the runtime library is +# updated. The WebAPK re-extracts the runtime library from the Chrome APK when +# |runtime_library_version| is incremented. + +# Whenever this constant is changed, WebApkUtils#getRuntimeDexName() must also +# be changed. +runtime_library_dex_asset_name = "webapk$runtime_library_version.dex" + +android_aidl("webapk_service_aidl") { + import_include = "src/org/chromium/webapk/lib/runtime_library" + interface_file = "src/org/chromium/webapk/lib/runtime_library/common.aidl" + sources = [ + "src/org/chromium/webapk/lib/runtime_library/IWebApkApi.aidl", + ] +} + +android_library("runtime_library_java") { + dex_path = "$target_gen_dir/$runtime_library_dex_asset_name" + java_files = + [ "src/org/chromium/webapk/lib/runtime_library/WebApkServiceImpl.java" ] + srcjar_deps = [ ":webapk_service_aidl" ] +} + +android_assets("runtime_library_assets") { + write_file("$target_gen_dir/webapk_dex_version.txt", runtime_library_version) + + sources = [ + "$target_gen_dir/$runtime_library_dex_asset_name", + "$target_gen_dir/webapk_dex_version.txt", + ] + disable_compression = true + + deps = [ + ":runtime_library_java", + ] +} + +junit_binary("webapk_runtime_library_junit_tests") { + java_files = [ "junit/src/org/chromium/webapk/lib/runtime_library/WebApkServiceImplTest.java" ] + deps = [ + ":runtime_library_java", + "//base:base_junit_test_support", + ] +} diff --git a/chromium/chrome/android/webapk/libs/runtime_library_version.gni b/chromium/chrome/android/webapk/libs/runtime_library_version.gni new file mode 100644 index 00000000000..21a07fb8b4b --- /dev/null +++ b/chromium/chrome/android/webapk/libs/runtime_library_version.gni @@ -0,0 +1,8 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Must be incremented whenever the runtime library is updated. The WebAPK +# re-extracts the runtime library from the Chrome APK when +# |runtime_library_version| is incremented. +runtime_library_version = 1 diff --git a/chromium/chrome/android/webapk/shell_apk/BUILD.gn b/chromium/chrome/android/webapk/shell_apk/BUILD.gn new file mode 100644 index 00000000000..498aca2fd06 --- /dev/null +++ b/chromium/chrome/android/webapk/shell_apk/BUILD.gn @@ -0,0 +1,105 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +declare_args() { + # The origin URL of the WebAPK. Used to generate a unique package name for + # WebAPK. Example: "foo.com" + webapk_manifest_package_origin = "template" + + # The browser that the WebAPK will be bound to. + webapk_runtime_host = "com.google.android.apps.chrome" + + # Attributes from Web Manifest. + webapk_start_url = "https://www.template.com/home_page" + webapk_name = "Longer Sample WebAPK Name" + webapk_short_name = "Sample WebAPK" + webapk_scope_url = "https://www.template.com" + webapk_display_mode = "standalone" + webapk_orientation = "portrait" + webapk_theme_color = "4288230399L" #0xFF9933FF + webapk_background_color = "4291624959L" #0xFFCCFFFF + + # The URL of the app icon. Empty if the app icon is generated. + webapk_icon_url = "http://www.template.com/icon.png" + + # Host part of |webapk_scope_url|. + webapk_scope_url_host = "www.template.com" +} + +shell_apk_manifest_package = + "org.chromium.webapk.$webapk_manifest_package_origin" + +shell_apk_manifest = "$target_gen_dir/shell_apk_manifest/AndroidManifest.xml" + +jinja_template("shell_apk_manifest") { + input = "AndroidManifest.xml" + output = shell_apk_manifest + + variables = [ + "manifest_package=$shell_apk_manifest_package", + "runtime_host=$webapk_runtime_host", + "start_url=$webapk_start_url", + "name=$webapk_name", + "short_name=$webapk_short_name", + "scope_url=$webapk_scope_url", + "display_mode=$webapk_display_mode", + "orientation=$webapk_orientation", + "theme_color=$webapk_theme_color", + "background_color=$webapk_background_color", + "icon_url=$webapk_icon_url", + "scope_url_host=$webapk_scope_url_host", + ] +} + +android_resources("shell_apk_resources") { + resource_dirs = [ "res" ] + custom_package = "org.chromium.webapk.shell_apk" +} + +android_library("dex_loader_java") { + java_files = [ "src/org/chromium/webapk/shell_apk/DexLoader.java" ] +} + +# Template for WebAPK. When a WebAPK is generated: +# - Android manifest is customized to the website. +# - App icon is extracted from the website and added to the APK's resources. +android_apk("webapk") { + android_manifest = shell_apk_manifest + android_manifest_dep = ":shell_apk_manifest" + apk_name = "WebApk.$webapk_manifest_package_origin" + java_files = [ + "src/org/chromium/webapk/shell_apk/MainActivity.java", + "src/org/chromium/webapk/shell_apk/WebApkSandboxedProcessService.java", + "src/org/chromium/webapk/shell_apk/WebApkSandboxedProcessService0.java", + "src/org/chromium/webapk/shell_apk/WebApkSandboxedProcessService1.java", + "src/org/chromium/webapk/shell_apk/WebApkSandboxedProcessService2.java", + "src/org/chromium/webapk/shell_apk/WebApkServiceFactory.java", + ] + deps = [ + ":dex_loader_java", + ":shell_apk_resources", + "//chrome/android/webapk/libs/common:common_java", + "//chrome/android/webapk/libs/runtime_library:runtime_library_java", + ] + if (!is_java_debug) { + proguard_enabled = true + proguard_configs = [ "//chrome/android/java/proguard.flags" ] + } +} + +android_library("shell_apk_javatests") { + testonly = true + java_files = + [ "javatests/src/org/chromium/webapk/shell_apk/DexLoaderTest.java" ] + deps = [ + ":dex_loader_java", + "//base:base_java", + "//base:base_java_test_support", + "//chrome/android/webapk/libs/common:common_java", + "//content/public/test/android:content_java_test_support", + ] + srcjar_deps = [ "javatests/dex_optimizer:dex_optimizer_service_aidl" ] +} diff --git a/chromium/chrome/android/webapk/shell_apk/javatests/canary_lib/BUILD.gn b/chromium/chrome/android/webapk/shell_apk/javatests/canary_lib/BUILD.gn new file mode 100644 index 00000000000..a7e61de672a --- /dev/null +++ b/chromium/chrome/android/webapk/shell_apk/javatests/canary_lib/BUILD.gn @@ -0,0 +1,22 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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") + +android_library("canary_lib_java") { + dex_path = "$target_gen_dir/canary.dex" + java_files = [ "src/org/chromium/webapk/shell_apk/test/canary/Canary.java" ] +} + +# dex asset added to dex_optimizer_apk in order to test creating ClassLoader +# from .dex in remote APK. +android_assets("canary_dex_assets") { + sources = [ + "$target_gen_dir/canary.dex", + ] + disable_compression = true + deps = [ + ":canary_lib_java", + ] +} diff --git a/chromium/chrome/android/webapk/shell_apk/javatests/dex_optimizer/BUILD.gn b/chromium/chrome/android/webapk/shell_apk/javatests/dex_optimizer/BUILD.gn new file mode 100644 index 00000000000..69937a4e3ce --- /dev/null +++ b/chromium/chrome/android/webapk/shell_apk/javatests/dex_optimizer/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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") + +android_aidl("dex_optimizer_service_aidl") { + interface_file = + "src/org/chromium/webapk/shell_apk/test/dex_optimizer/common.aidl" + sources = [ + "src/org/chromium/webapk/shell_apk/test/dex_optimizer/IDexOptimizerService.aidl", + ] +} + +android_apk("dex_optimizer_apk") { + android_manifest = "AndroidManifest.xml" + apk_name = "DexOptimizer" + chromium_code = false + java_files = [ "src/org/chromium/webapk/shell_apk/test/dex_optimizer/DexOptimizerServiceImpl.java" ] + deps = [ + "//base:base_java", + "//chrome/android/webapk/libs/client:client_java", + "//chrome/android/webapk/shell_apk/javatests/canary_lib:canary_dex_assets", + ] + srcjar_deps = [ ":dex_optimizer_service_aidl" ] +} diff --git a/chromium/chrome/app/BUILD.gn b/chromium/chrome/app/BUILD.gn new file mode 100644 index 00000000000..2829c9bd83b --- /dev/null +++ b/chromium/chrome/app/BUILD.gn @@ -0,0 +1,396 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//tools/grit/grit_rule.gni") + +if (is_android) { + import("//build/config/android/rules.gni") + android_generated_java_resources = [ + "java/res/values-am/generated_resources.xml", + "java/res/values-ar/generated_resources.xml", + "java/res/values-bg/generated_resources.xml", + "java/res/values-ca/generated_resources.xml", + "java/res/values-cs/generated_resources.xml", + "java/res/values-da/generated_resources.xml", + "java/res/values-de/generated_resources.xml", + "java/res/values-el/generated_resources.xml", + "java/res/values-en-rGB/generated_resources.xml", + "java/res/values-es-rUS/generated_resources.xml", + "java/res/values-es/generated_resources.xml", + "java/res/values-fa/generated_resources.xml", + "java/res/values-fi/generated_resources.xml", + "java/res/values-fr/generated_resources.xml", + "java/res/values-hi/generated_resources.xml", + "java/res/values-hr/generated_resources.xml", + "java/res/values-hu/generated_resources.xml", + "java/res/values-in/generated_resources.xml", + "java/res/values-it/generated_resources.xml", + "java/res/values-iw/generated_resources.xml", + "java/res/values-ja/generated_resources.xml", + "java/res/values-ko/generated_resources.xml", + "java/res/values-lt/generated_resources.xml", + "java/res/values-lv/generated_resources.xml", + "java/res/values-nb/generated_resources.xml", + "java/res/values-nl/generated_resources.xml", + "java/res/values-pl/generated_resources.xml", + "java/res/values-pt-rBR/generated_resources.xml", + "java/res/values-pt-rPT/generated_resources.xml", + "java/res/values-ro/generated_resources.xml", + "java/res/values-ru/generated_resources.xml", + "java/res/values-sk/generated_resources.xml", + "java/res/values-sl/generated_resources.xml", + "java/res/values-sr/generated_resources.xml", + "java/res/values-sv/generated_resources.xml", + "java/res/values-sw/generated_resources.xml", + "java/res/values-th/generated_resources.xml", + "java/res/values-tl/generated_resources.xml", + "java/res/values-tr/generated_resources.xml", + "java/res/values-uk/generated_resources.xml", + "java/res/values-vi/generated_resources.xml", + "java/res/values-zh-rCN/generated_resources.xml", + "java/res/values-zh-rTW/generated_resources.xml", + "java/res/values/generated_resources.xml", + ] +} + +# GYP version: chrome/chrome_resources.gyp:chrome_strings +# (generate_generated_resources action) +grit("generated_resources") { + source = "generated_resources.grd" + output_dir = "$root_gen_dir/chrome" + use_qualified_include = true + outputs = [ + "grit/generated_resources.h", + "generated_resources_am.pak", + "generated_resources_ar.pak", + "generated_resources_bg.pak", + "generated_resources_bn.pak", + "generated_resources_ca.pak", + "generated_resources_cs.pak", + "generated_resources_da.pak", + "generated_resources_de.pak", + "generated_resources_el.pak", + "generated_resources_en-GB.pak", + "generated_resources_en-US.pak", + "generated_resources_es.pak", + "generated_resources_es-419.pak", + "generated_resources_et.pak", + "generated_resources_fa.pak", + "generated_resources_fake-bidi.pak", + "generated_resources_fi.pak", + "generated_resources_fil.pak", + "generated_resources_fr.pak", + "generated_resources_gu.pak", + "generated_resources_he.pak", + "generated_resources_hi.pak", + "generated_resources_hr.pak", + "generated_resources_hu.pak", + "generated_resources_id.pak", + "generated_resources_it.pak", + "generated_resources_ja.pak", + "generated_resources_kn.pak", + "generated_resources_ko.pak", + "generated_resources_lt.pak", + "generated_resources_lv.pak", + "generated_resources_ml.pak", + "generated_resources_mr.pak", + "generated_resources_ms.pak", + "generated_resources_nl.pak", + "generated_resources_nb.pak", + "generated_resources_pl.pak", + "generated_resources_pt-BR.pak", + "generated_resources_pt-PT.pak", + "generated_resources_ro.pak", + "generated_resources_ru.pak", + "generated_resources_sk.pak", + "generated_resources_sl.pak", + "generated_resources_sr.pak", + "generated_resources_sv.pak", + "generated_resources_sw.pak", + "generated_resources_ta.pak", + "generated_resources_te.pak", + "generated_resources_th.pak", + "generated_resources_tr.pak", + "generated_resources_uk.pak", + "generated_resources_vi.pak", + "generated_resources_zh-CN.pak", + "generated_resources_zh-TW.pak", + ] + + if (is_android) { + outputs += android_generated_java_resources + } +} + +if (is_android) { + java_strings_grd_prebuilt("java_strings_grd") { + grit_output_dir = "$root_gen_dir/chrome/java/res" + generated_files = + rebase_path(android_generated_java_resources, "java/res", ".") + deps = [ + ":generated_resources", + ] + } +} + +# GYP version: chrome/chrome_resources.gyp:chrome_strings +# (generate_google_chrome_strings action) +grit("google_chrome_strings") { + source = "google_chrome_strings.grd" + output_dir = "$root_gen_dir/chrome" + use_qualified_include = true + outputs = [ + "grit/google_chrome_strings.h", + "google_chrome_strings_am.pak", + "google_chrome_strings_ar.pak", + "google_chrome_strings_bg.pak", + "google_chrome_strings_bn.pak", + "google_chrome_strings_ca.pak", + "google_chrome_strings_cs.pak", + "google_chrome_strings_da.pak", + "google_chrome_strings_de.pak", + "google_chrome_strings_el.pak", + "google_chrome_strings_en-GB.pak", + "google_chrome_strings_en-US.pak", + "google_chrome_strings_es.pak", + "google_chrome_strings_es-419.pak", + "google_chrome_strings_et.pak", + "google_chrome_strings_fa.pak", + "google_chrome_strings_fi.pak", + "google_chrome_strings_fil.pak", + "google_chrome_strings_fr.pak", + "google_chrome_strings_gu.pak", + "google_chrome_strings_he.pak", + "google_chrome_strings_hi.pak", + "google_chrome_strings_hr.pak", + "google_chrome_strings_hu.pak", + "google_chrome_strings_id.pak", + "google_chrome_strings_it.pak", + "google_chrome_strings_ja.pak", + "google_chrome_strings_kn.pak", + "google_chrome_strings_ko.pak", + "google_chrome_strings_lt.pak", + "google_chrome_strings_lv.pak", + "google_chrome_strings_ml.pak", + "google_chrome_strings_mr.pak", + "google_chrome_strings_ms.pak", + "google_chrome_strings_nl.pak", + "google_chrome_strings_nb.pak", + "google_chrome_strings_pl.pak", + "google_chrome_strings_pt-BR.pak", + "google_chrome_strings_pt-PT.pak", + "google_chrome_strings_ro.pak", + "google_chrome_strings_ru.pak", + "google_chrome_strings_sk.pak", + "google_chrome_strings_sl.pak", + "google_chrome_strings_sr.pak", + "google_chrome_strings_sv.pak", + "google_chrome_strings_sw.pak", + "google_chrome_strings_ta.pak", + "google_chrome_strings_te.pak", + "google_chrome_strings_th.pak", + "google_chrome_strings_tr.pak", + "google_chrome_strings_uk.pak", + "google_chrome_strings_vi.pak", + "google_chrome_strings_zh-CN.pak", + "google_chrome_strings_zh-TW.pak", + "google_chrome_strings_fake-bidi.pak", + ] +} + +# GYP version: chrome/chrome_resources.gyp:chrome_strings +# (generate_chromium_strings action) +grit("chromium_strings") { + source = "chromium_strings.grd" + output_dir = "$root_gen_dir/chrome" + use_qualified_include = true + outputs = [ + "grit/chromium_strings.h", + "chromium_strings_am.pak", + "chromium_strings_ar.pak", + "chromium_strings_bg.pak", + "chromium_strings_bn.pak", + "chromium_strings_ca.pak", + "chromium_strings_cs.pak", + "chromium_strings_da.pak", + "chromium_strings_de.pak", + "chromium_strings_el.pak", + "chromium_strings_en-GB.pak", + "chromium_strings_en-US.pak", + "chromium_strings_es.pak", + "chromium_strings_es-419.pak", + "chromium_strings_et.pak", + "chromium_strings_fa.pak", + "chromium_strings_fake-bidi.pak", + "chromium_strings_fi.pak", + "chromium_strings_fil.pak", + "chromium_strings_fr.pak", + "chromium_strings_gu.pak", + "chromium_strings_he.pak", + "chromium_strings_hi.pak", + "chromium_strings_hr.pak", + "chromium_strings_hu.pak", + "chromium_strings_id.pak", + "chromium_strings_it.pak", + "chromium_strings_ja.pak", + "chromium_strings_kn.pak", + "chromium_strings_ko.pak", + "chromium_strings_lt.pak", + "chromium_strings_lv.pak", + "chromium_strings_ml.pak", + "chromium_strings_mr.pak", + "chromium_strings_ms.pak", + "chromium_strings_nl.pak", + "chromium_strings_nb.pak", + "chromium_strings_pl.pak", + "chromium_strings_pt-BR.pak", + "chromium_strings_pt-PT.pak", + "chromium_strings_ro.pak", + "chromium_strings_ru.pak", + "chromium_strings_sk.pak", + "chromium_strings_sl.pak", + "chromium_strings_sr.pak", + "chromium_strings_sv.pak", + "chromium_strings_sw.pak", + "chromium_strings_ta.pak", + "chromium_strings_te.pak", + "chromium_strings_th.pak", + "chromium_strings_tr.pak", + "chromium_strings_uk.pak", + "chromium_strings_vi.pak", + "chromium_strings_zh-CN.pak", + "chromium_strings_zh-TW.pak", + ] +} + +# GYP version: chrome/settings_strings.gyp:settings_strings +# (generate_settings_strings action) +grit("settings_strings") { + source = "settings_strings.grd" + output_dir = "$root_gen_dir/chrome" + use_qualified_include = true + outputs = [ + "grit/settings_strings.h", + + # The settings strings are not being treated as strings because they are + # not translated (English only), this should change in late 2015. + "settings_strings.pak", + ] +} + +# GYP version: chrome/settings_chromium_strings.gyp:settings_chromium_strings +# (generate_settings_chromium_strings action) +grit("settings_chromium_strings") { + source = "settings_chromium_strings.grd" + output_dir = "$root_gen_dir/chrome" + use_qualified_include = true + outputs = [ + "grit/settings_chromium_strings.h", + + # These strings are not being treated as strings because they are + # not translated (English only), this should change in late 2015. + "settings_chromium_strings.pak", + ] +} + +# GYP version: +# chrome/settings_google_chrome_strings.gyp:settings_google_chrome_strings +# (generate_settings_google_chrome_strings action) +grit("settings_google_chrome_strings") { + source = "settings_google_chrome_strings.grd" + output_dir = "$root_gen_dir/chrome" + use_qualified_include = true + outputs = [ + "grit/settings_google_chrome_strings.h", + + # These strings are not being treated as strings because they are + # not translated (English only), this should change in late 2015. + "settings_google_chrome_strings.pak", + ] +} + +source_set("test_support") { + testonly = true + visibility = [ "//chrome/test:test_support" ] + + sources = [ + "chrome_main_delegate.cc", + "chrome_main_delegate.h", + ] + + deps = [ + "//base", + "//chrome/browser", + "//chrome/browser/policy:path_parser", + "//chrome/child", + "//chrome/common", + "//chrome/gpu", + "//chrome/renderer", + "//chrome/utility", + "//components/crash/content/app", + "//components/crash/content/app:lib", + "//components/startup_metric_utils/browser:lib", + "//content/public/app:both", + "//content/public/common", + "//ui/base", + ] + + if (is_mac) { + sources += [ "chrome_main_mac.mm" ] + + deps += [ "//chrome:chrome_framework" ] + } + + if (is_win) { + deps += [ + "//chrome:chrome_initial", + "//sandbox/win:sandbox", + ] + } + + if (is_chromeos) { + deps += [ + "//chrome/browser/chromeos", + "//components/metrics:leak_detector", + ] + } + + if (enable_pdf) { + deps += [ "//pdf" ] + } + + if (enable_plugins && enable_nacl) { + deps += [ + "//components/nacl/browser", + "//components/nacl/renderer/plugin:nacl_trusted_plugin", + ] + } +} + +if (use_aura) { + mojo_application_manifest("chrome_manifest") { + type = "exe" + application_name = "chrome" + source = "mojo/chrome_manifest.json" + base_manifest = "${root_out_dir}/content_browser_manifest.json" + base_deps = [ "//content/public/app:browser_manifest" ] + } + + mojo_application_manifest("chrome_renderer_manifest") { + type = "exe" + application_name = "chrome_renderer" + source = "mojo/chrome_renderer_manifest.json" + base_manifest = "${root_out_dir}/content_renderer_manifest.json" + base_deps = [ "//content/public/app:renderer_manifest" ] + } + + group("mojo_manifests") { + data_deps = [ + ":chrome_manifest", + ":chrome_renderer_manifest", + ] + } +} diff --git a/chromium/chrome/app/mash/BUILD.gn b/chromium/chrome/app/mash/BUILD.gn new file mode 100644 index 00000000000..b335b49f7a7 --- /dev/null +++ b/chromium/chrome/app/mash/BUILD.gn @@ -0,0 +1,68 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application_manifest.gni") + +source_set("mash") { + sources = [ + "mash_runner.cc", + "mash_runner.h", + ] + deps = [ + "//ash/mus:lib", + "//ash/resources", + "//ash/sysui:lib", + "//base:i18n", + "//components/mus:lib", + "//content/public/common", + "//mash/app_driver:lib", + "//mash/quick_launch:lib", + "//mash/session:lib", + "//mash/task_viewer:lib", + "//services/shell", + "//services/shell/background:lib", + "//services/shell/public/cpp", + "//services/shell/public/interfaces", + "//services/shell/runner/common", + "//services/shell/runner/host:child_process_base", + "//services/shell/runner/host:lib", + "//url", + ] + data_deps = [ + ":manifest", + ] + + if (is_linux && !is_android) { + deps += [ "//components/font_service:lib" ] + } +} + +mojo_application_manifest("manifest") { + type = "exe" + application_name = "chrome_mash" + source = "chrome_mash_manifest.json" + deps = [ + "//ash/mus:manifest", + "//ash/sysui:manifest", + "//components/mus:manifest", + "//mash/app_driver:manifest", + "//mash/quick_launch:manifest", + "//mash/session:manifest", + "//mash/task_viewer:manifest", + ] + packaged_applications = [ + "app_driver", + "ash", + "ash_sysui", + "mash_session", + "mus", + "quick_launch", + "task_viewer", + ] + + if (is_linux && !is_android) { + deps += [ "//components/font_service:manifest" ] + packaged_applications += [ "font_service" ] + } +} diff --git a/chromium/chrome/app/nibs/BUILD.gn b/chromium/chrome/app/nibs/BUILD.gn new file mode 100644 index 00000000000..e7c10f87e58 --- /dev/null +++ b/chromium/chrome/app/nibs/BUILD.gn @@ -0,0 +1,53 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/mac/rules.gni") + +# GYP version: chrome/chrome_nibs.gypi +mac_xib_bundle_data("chrome_xibs") { + sources = [ + "AppMenu.xib", + "AvatarMenuItem.xib", + "BookmarkAllTabs.xib", + "BookmarkBar.xib", + "BookmarkBarFolderWindow.xib", + "BookmarkBubble.xib", + "BookmarkEditor.xib", + "BookmarkNameFolder.xib", + "CollectedCookies.xib", + "ContentBlockedCookies.xib", + "ContentBlockedDownloads.xib", + "ContentBlockedGeolocation.xib", + "ContentBlockedMIDISysEx.xib", + "ContentBlockedMedia.xib", + "ContentBlockedMixedScript.xib", + "ContentBlockedPlugins.xib", + "ContentBlockedPopups.xib", + "ContentBlockedSimple.xib", + "ContentProtocolHandlers.xib", + "CookieDetailsView.xib", + "DevicePermissionsPrompt.xib", + "DownloadItem.xib", + "DownloadShelf.xib", + "ExtensionInstallPrompt.xib", + "ExtensionInstallPromptNoWarnings.xib", + "ExtensionInstallPromptWebstoreData.xib", + "ExtensionInstalledBubble.xib", + "FindBar.xib", + "FirstRunBubble.xib", + "FirstRunDialog.xib", + "GlobalErrorBubble.xib", + "HttpAuthLoginSheet.xib", + "HungRendererDialog.xib", + "ImportProgressDialog.xib", + "InfoBar.xib", + "MainMenu.xib", + "OneClickSigninBubble.xib", + "OneClickSigninDialog.xib", + "Panel.xib", + "SaveAccessoryView.xib", + "TaskManager.xib", + "Toolbar.xib", + ] +} diff --git a/chromium/chrome/app/version_assembly/BUILD.gn b/chromium/chrome/app/version_assembly/BUILD.gn new file mode 100644 index 00000000000..5e38ca978bb --- /dev/null +++ b/chromium/chrome/app/version_assembly/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/win/manifest.gni") +import("//build/util/version.gni") +import("//chrome/version.gni") + +version_assembly_output_file = "$target_gen_dir/version_assembly.manifest" + +# Generates a manifest file with the current build's version information. +process_version("chrome_exe_version_manifest") { + visibility = [ ":*" ] + template_file = "chrome_exe_manifest.template" + output = version_assembly_output_file +} + +# Generates the manifest for chrome.exe. This is the normal manifest stuff plus +# the version information. +windows_manifest("chrome_exe_manifest") { + sources = [ + as_invoker_manifest, + common_controls_manifest, + default_compatibility_manifest, + version_assembly_output_file, + ] + + type = "exe" + + deps = [ + ":chrome_exe_version_manifest", + ] +} + +# Generates the manifest for the version assembly, which is the versioned +# directory where Chrome finds chrome.dll. +process_version("version_assembly_manifest") { + template_file = "version_assembly_manifest.template" + output = "$root_build_dir/$chrome_version_full.manifest" + process_only = true +} diff --git a/chromium/chrome/app_shim/BUILD.gn b/chromium/chrome/app_shim/BUILD.gn new file mode 100644 index 00000000000..8fe9981cb6f --- /dev/null +++ b/chromium/chrome/app_shim/BUILD.gn @@ -0,0 +1,51 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/mac/rules.gni") +import("//build/mac/tweak_info_plist.gni") +import("//build/util/branding.gni") + +# This is the part of the shim process compiled into Chrome. It runs only +# in the shim process, after the shim finds and loads the Chrome +# Framework bundle. +source_set("app_shim") { + sources = [ + "chrome_main_app_mode_mac.mm", + ] + + deps = [ + "//chrome:strings", + "//chrome/common:app_mode_app_support", + ] +} + +tweak_info_plist("app_mode_loader_plist") { + info_plist = "app_mode-Info.plist" + args = [ + "--breakpad=0", + "--keystone=0", + "--scm=0", + ] +} + +mac_app_bundle("app_mode_loader") { + extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] + + info_plist_target = ":app_mode_loader_plist" + extra_substitutions = [ "APP_MODE_APP_BUNDLE_ID=$chrome_mac_bundle_id.app.@APP_MODE_SHORTCUT_ID@" ] + + sources = [ + "app_mode_loader_mac.mm", + ] + + deps = [ + "//chrome/common:app_mode_app_support", + ] + + libs = [ + "AppKit.framework", + "CoreFoundation.framework", + "Foundation.framework", + ] +} diff --git a/chromium/chrome/browser/BUILD.gn b/chromium/chrome/browser/BUILD.gn new file mode 100644 index 00000000000..5eac8c6d958 --- /dev/null +++ b/chromium/chrome/browser/BUILD.gn @@ -0,0 +1,1371 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//build/config/crypto.gni") +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//build/split_static_library.gni") +import("//chrome/common/features.gni") +import("//media/media_options.gni") +import("//third_party/protobuf/proto_library.gni") + +# //build/config/android/rules.gni imports //tools/grit/grit_rule.gni, which +# produces a conflict for the "grit" template so we have to only include one. +if (is_android) { + import("//build/config/android/rules.gni") +} else { + import("//tools/grit/grit_rule.gni") +} +if (is_desktop_linux) { + import("//build/config/linux/pkg_config.gni") +} + +declare_args() { + # 'Ok Google' hotwording is disabled by default. Set to true to enable. (This + # will download a closed-source NaCl module at startup.) Chrome-branded + # ChromeOS builds have this enabled by default. + enable_hotwording = is_chrome_branded && is_chromeos +} + +additional_modules_list_file = + "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt" + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("../chrome_browser.gypi") ], + "scope", + [ "../chrome_browser.gypi" ]) + +if (is_win) { + # This is in a separate config so the flags can be applied to dependents. + # ldflags in GN aren't automatically inherited. + config("browser_win_linker_flags") { + libs = [ + "credui.lib", + "cryptui.lib", + "dwmapi.lib", + "netapi32.lib", + "ndfapi.lib", # Used by browser/net/net_error_diagnostics_dialog_win.h + "pdh.lib", # Used by browser/private_working_set_snapshot.h + ] + ldflags = [ + "/DELAYLOAD:ndfapi.dll", + "/DELAYLOAD:pdh.dll", # The task manager is rarely used. + ] + } +} + +if (is_desktop_linux) { + # Gnome-keyring is normally dynamically loaded. The gnome_keyring config + # will set this up. + pkg_config("gnome_keyring") { + packages = [ "gnome-keyring-1" ] + defines = [ + "USE_GNOME_KEYRING", + "DLOPEN_GNOME_KEYRING", + ] + ignore_libs = true + } + + # If you want to link gnome-keyring directly (use only for unit tests) + # ADDITIONALLY add this config on top of ":gnome_keyring". pkg-config is a + # bit slow, so prefer not to run it again. In practice, gnome-keyring's libs + # are just itself and common gnome ones we link already, so we can get away + # with additionally just coding the library name here. + config("gnome_keyring_direct") { + libs = [ "gnome-keyring" ] + } +} + +# Use a static library here because many test binaries depend on this but don't +# require many files from it. This makes linking more efficient. +split_static_library("browser") { + # Split into multiple static libraries on Windows official builds, where we + # run into a 2GB max size limit. + if (is_win && is_official_build) { + split_count = 5 + } else { + split_count = 1 + } + + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//build/config:precompiled_headers", + "//third_party/WebKit/public:debug_devtools", + ] + defines = [] + sources = [] + libs = [] + ldflags = [] + + allow_circular_includes_from = [ "//chrome/browser/ui" ] + + # iOS/non-iOS shared deps. New dependencies should generally be added in the + # non-iOS deps below. + public_deps = [ + "//components/autofill/core/browser", + "//content/public/browser", + "//sql", + "//sync", + ] + deps = [ + "//chrome:extra_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/app/resources:platform_locale_settings", + "//chrome/app/theme:theme_resources", + "//chrome/browser/metrics/variations:chrome_ui_string_overrider_factory", + "//chrome/browser/net:probe_message_proto", + "//chrome/browser/ui", + "//chrome/common", + "//components/autofill/core/browser", + "//components/bookmarks/browser", + "//components/bookmarks/managed", + "//components/browser_sync/browser", + "//components/browser_sync/common", + "//components/captive_portal", + "//components/certificate_reporting", + "//components/certificate_transparency", + "//components/cloud_devices/common", + "//components/component_updater", + "//components/content_settings/content/common", + "//components/content_settings/core/browser", + "//components/content_settings/core/common", + "//components/cookie_config", + "//components/crx_file", + "//components/data_reduction_proxy/core/browser", + "//components/data_usage/core", + "//components/data_use_measurement/core", + "//components/device_event_log", + "//components/domain_reliability", + "//components/favicon/core", + "//components/favicon_base", + "//components/flags_ui", + "//components/gcm_driver", + "//components/gcm_driver/instance_id", + "//components/google/core/browser", + "//components/guest_view/browser", + "//components/handoff", + "//components/history/core/browser", + "//components/history/core/common", + "//components/infobars/core", + "//components/invalidation/impl", + "//components/metrics:gpu", + "//components/metrics:net", + "//components/metrics:profiler", + "//components/metrics:profiler_content", + "//components/metrics:ui", + "//components/metrics/proto:proto", + "//components/metrics_services_manager", + "//components/mime_util", + "//components/navigation_metrics", + "//components/network_session_configurator", + "//components/network_time", + "//components/ntp_snippets", + "//components/ntp_tiles", + "//components/offline_pages", + "//components/offline_pages/background:background_offliner", + "//components/omnibox/browser", + "//components/os_crypt", + "//components/packed_ct_ev_whitelist", + "//components/password_manager/core/browser", + "//components/password_manager/core/common", + "//components/policy", + "//components/policy:policy_component", + "//components/policy/proto", + "//components/proxy_config", + "//components/query_parser", + "//components/rappor", + "//components/renderer_context_menu", + "//components/search", + "//components/search_engines", + "//components/search_provider_logos", + "//components/security_interstitials/core", + "//components/security_state", + "//components/signin/core/browser", + "//components/ssl_errors", + "//components/startup_metric_utils/browser:host", + "//components/startup_metric_utils/browser:lib", + + # TODO(fdoray): Remove this once the PreRead field trial has expired. + # crbug.com/577698 + "//components/startup_metric_utils/common", + "//components/strings", + "//components/subresource_filter/core/browser", + "//components/suggestions", + "//components/supervised_user_error_page", + "//components/sync_bookmarks", + "//components/sync_driver", + "//components/sync_sessions", + "//components/tracing:startup_tracing", + "//components/translate/core/browser", + "//components/translate/core/common", + "//components/undo", + "//components/update_client", + "//components/url_formatter", + "//components/user_prefs", + "//components/user_prefs/tracked:user_prefs_tracked", + "//components/variations", + "//components/variations/net", + "//components/variations/service", + "//components/web_resource", + "//components/webdata/common", + "//components/webdata_services", + "//components/zoom", + "//content/public/browser", + "//content/public/common", + "//content/public/common:feature_h264_with_openh264_ffmpeg", + "//content/public/common:features", + "//courgette:courgette_lib", + "//crypto", + "//crypto:platform", + "//google_apis", + "//gpu/config", + "//skia", + "//sql", + "//sync", + "//third_party/cacheinvalidation", + "//third_party/icu", + "//third_party/libjingle", + "//third_party/libxml", + "//third_party/widevine/cdm:version_h", + "//third_party/zlib", + "//third_party/zlib:compression_utils", + "//third_party/zlib:minizip", + "//third_party/zlib:zip", + "//ui/base", + "//ui/base:ui_data_pack", + "//ui/events:events_base", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/message_center", + "//ui/resources", + "//ui/shell_dialogs", + "//ui/strings", + ] + data_deps = [] + + sources += + rebase_path(gypi_values.chrome_browser_undo_sources, ".", "//chrome") + + if (!is_ios) { + sources += + rebase_path(gypi_values.chrome_browser_non_ios_sources, ".", "//chrome") + sources += rebase_path(gypi_values.chrome_browser_autocomplete_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_bookmark_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_browser_process_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_content_settings_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_data_usage_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_engagement_sources, + ".", + "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_favicon_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_google_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_history_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_metrics_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_net_sources, ".", "//chrome") + sources += rebase_path(gypi_values.chrome_browser_password_manager_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_permissions_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_predictor_sources, + ".", + "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_pref_sources, ".", "//chrome") + sources += rebase_path(gypi_values.chrome_browser_profiles_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_search_engines_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_services_sources, + ".", + "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_session_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_signin_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_ssl_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_sync_sources, ".", "//chrome") + if (android_java_ui) { + sources += + rebase_path(gypi_values.chrome_browser_sync_android_java_ui_sources, + ".", + "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_ssl_android_java_ui_sources, + ".", + "//chrome") + sources += rebase_path( + gypi_values.chrome_browser_history_android_java_ui_sources, + ".", + "//chrome") + sources += rebase_path( + gypi_values.chrome_browser_permissions_android_java_ui_sources, + ".", + "//chrome") + sources += rebase_path( + gypi_values.chrome_browser_search_engines_android_java_ui_sources, + ".", + "//chrome") + if (enable_supervised_users) { + sources += rebase_path( + gypi_values.chrome_browser_supervised_user_android_java_ui_sources, + ".", + "//chrome") + } + } + + deps += [ + "//cc", + "//chrome/app/theme:theme_resources", + "//chrome/browser/devtools", + "//chrome/browser/metrics/variations:chrome_ui_string_overrider_factory", + "//chrome/browser/resources:component_extension_resources", + "//chrome/common/net", + "//chrome/installer/util:with_no_strings", + "//components/about_handler", + "//components/app_modal", + "//components/autofill/content/browser", + "//components/browsing_data", + "//components/contextual_search:browser", + "//components/data_reduction_proxy/content/browser", + "//components/data_use_measurement/content", + "//components/devtools_discovery", + "//components/devtools_http_handler", + "//components/dom_distiller/content/browser", + "//components/error_page/common", + "//components/favicon/content", + "//components/history/content/browser", + "//components/keyed_service/content", + "//components/navigation_interception", + "//components/net_log", + "//components/network_hints/common", + "//components/password_manager/content/browser", + "//components/password_manager/sync/browser", + "//components/profile_metrics", + "//components/proxy_config", + "//components/resources", + "//components/safe_browsing_db", + "//components/safe_json", + "//components/sessions", + "//components/ssl_config", + "//components/storage_monitor", + "//components/subresource_filter/content/browser", + "//components/syncable_prefs", + "//components/translate/content/browser", + "//components/upload_list", + "//components/url_matcher", + "//components/visitedlink/browser", + "//components/visitedlink/common", + "//components/web_cache/browser", + "//components/webusb", + "//content/app/resources", + "//device/core", + "//device/usb/mojo", + "//device/usb/public/interfaces", + "//media", + "//media/midi", + "//mojo/common", + "//mojo/edk/system", + "//mojo/public/cpp/bindings", + "//mojo/public/js", + "//net:extras", + "//net:net_with_v8", + "//services/shell/public/cpp", + "//storage/browser", + "//storage/common", + "//third_party/WebKit/public:image_resources", + "//third_party/WebKit/public:resources", + "//third_party/kasko", + "//third_party/leveldatabase", + "//third_party/libaddressinput", + "//third_party/libyuv", + "//third_party/re2", + "//third_party/smhasher:cityhash", + "//third_party/webrtc/modules/desktop_capture", + "//ui/base/ime", + "//ui/gl", + "//ui/resources", + "//ui/surface", + "//ui/web_dialogs", + "//v8", + ] + + if (toolkit_views) { + deps += [ "//ui/views" ] + } + } else { # iOS + sources += + rebase_path(gypi_values.chrome_browser_ios_sources, ".", "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_google_sources, ".", "//chrome") + deps += [ "//net" ] + libs += [ + "CoreTelephony.framework", + "CoreText.framework", + "MobileCoreServices.framework", + "QuartzCore.framework", + ] + ldflags += [ + "-weak_framework", + "CoreImage", + ] + } + + if (is_win || is_mac) { + sources += + rebase_path(gypi_values.chrome_browser_win_mac_sources, ".", "//chrome") + } + if (!is_win && !is_mac && !is_ios) { + sources += [ "net/net_error_diagnostics_dialog_generic.cc" ] + } + if (!is_android && !is_ios && !is_chromeos) { + sources += [ + "net/disk_cache_dir_policy_handler.cc", + "net/disk_cache_dir_policy_handler.h", + ] + } + if (is_mac) { + sources += + rebase_path(gypi_values.chrome_browser_mac_sources, ".", "//chrome") + deps += [ + "//chrome/app_shim", + "//chrome/browser/apps/app_shim", + ] + } + if (enable_extensions) { + public_deps += [ "//chrome/browser/extensions" ] + deps += [ + "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto", + "//chrome/common/extensions/api", + "//chrome/common/extensions/api:api_registration", + "//components/drive:drive", + "//components/proximity_auth/ble", + "//components/proximity_auth/cryptauth", + "//extensions/components/javascript_dialog_extensions_client", + "//media/cast:net", + ] + sources += rebase_path(gypi_values.chrome_browser_extensions_sources, + ".", + "//chrome") + } + if (enable_background) { + sources += rebase_path(gypi_values.chrome_browser_background_sources, + ".", + "//chrome") + if (!use_aura || is_win || is_chromeos) { + sources -= [ "background/background_mode_manager_aura.cc" ] + } + } + if (enable_task_manager) { + sources += rebase_path(gypi_values.chrome_browser_task_manager_sources, + ".", + "//chrome") + if (is_chromeos) { + sources += + rebase_path(gypi_values.chrome_browser_task_manager_chromeos_sources, + ".", + "//chrome") + } + + if (is_mac && !mac_views_browser) { + sources += + rebase_path(gypi_values.chrome_browser_old_task_manager_cocoa_sources, + ".", + "//chrome") + } + } + if (enable_spellcheck) { + sources += rebase_path(gypi_values.chrome_browser_spellchecker_sources, + ".", + "//chrome") + if (!is_android) { + deps += [ "//third_party/hunspell" ] + } + } + if (enable_nacl) { + sources += + rebase_path(gypi_values.chrome_browser_nacl_sources, ".", "//chrome") + deps += [ "//components/nacl/browser" ] + } + + if (enable_plugins) { + sources += + rebase_path(gypi_values.chrome_browser_plugins_sources, ".", "//chrome") + deps += [ + "//components/pdf/browser", + "//ppapi/proxy:ipc", + "//third_party/adobe/flash:flapper_version_h", + ] + } + if (safe_browsing_mode != 0) { + sources += + rebase_path(gypi_values.chrome_browser_safe_browsing_basic_sources, + ".", + "//chrome") + deps += [ + "//chrome/browser/safe_browsing:chunk_proto", + "//chrome/common/safe_browsing:proto", + "//components/safe_browsing_db:metadata_proto", + ] + if (safe_browsing_mode == 1) { + sources += + rebase_path(gypi_values.chrome_browser_safe_browsing_full_sources, + ".", + "//chrome") + if (is_win) { + deps += [ "//chrome/browser/safe_browsing/incident_reporting:state_store_data_proto" ] + } + } else if (safe_browsing_mode == 2) { + sources += + rebase_path(gypi_values.chrome_browser_safe_browsing_mobile_sources, + ".", + "//chrome") + deps += [ "//components/safe_browsing_db:safe_browsing_db_mobile" ] + } + } + + if (enable_hotwording) { + defines += [ "ENABLE_HOTWORDING" ] + } + + if (is_linux) { + deps += [ "//device/media_transfer_protocol" ] + } + + if (use_udev) { + deps += [ "//device/udev_linux" ] + } + + if (is_linux && !is_chromeos) { + deps += [ "//third_party/speech-dispatcher" ] + } + + if (is_chromeos) { + sources += rebase_path(gypi_values.chrome_browser_chromeos_sources, + ".", + "//chrome") + deps += [ "//chrome/browser/chromeos" ] + } else { # Non-ChromeOS. + sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources, + ".", + "//chrome") + } + + if (is_chromeos || is_ios) { + sources -= [ + "signin/chrome_signin_status_metrics_provider_delegate.cc", + "signin/chrome_signin_status_metrics_provider_delegate.h", + ] + } + + if (is_chromeos) { + sources += [ + "metrics/leak_detector/leak_detector_controller.cc", + "metrics/leak_detector/leak_detector_controller.h", + ] + public_deps += [ "//components/metrics:leak_detector" ] + } + + if (use_cups) { + configs += [ "//printing:cups" ] + } + if (is_desktop_linux) { + sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources, + ".", + "//chrome") + configs += [ ":gnome_keyring" ] + } + if (is_desktop_linux) { + sources += rebase_path(gypi_values.chrome_browser_libsecret_sources, + ".", + "//chrome") + defines += [ "USE_LIBSECRET" ] + deps += [ "//third_party/libsecret" ] + } + if (use_aura) { + sources += + rebase_path(gypi_values.chrome_browser_aura_sources, ".", "//chrome") + + # These files are only built in a GN build because they bring in + # dependencies that don't build with GYP. + sources += [ + "ui/views/frame/browser_frame_mus.cc", + "ui/views/frame/browser_frame_mus.h", + "ui/views/frame/browser_non_client_frame_view_mus.cc", + "ui/views/frame/browser_non_client_frame_view_mus.h", + ] + deps += [ + "//components/mus/public/cpp", + "//components/mus/public/cpp/input_devices", + "//content/public/common", + "//ui/aura", + "//ui/compositor", + "//ui/views/mus", + ] + defines += [ "MOJO_SHELL_CLIENT" ] + } + if (ui_compositor_image_transport) { + deps += [ "//ui/gl" ] + } + + if (use_ash) { + sources += + rebase_path(gypi_values.chrome_browser_ash_sources, ".", "//chrome") + } + + if (use_x11) { + sources += + rebase_path(gypi_values.chrome_browser_x11_sources, ".", "//chrome") + } else { + sources -= [ "password_manager/password_store_x.cc" ] + } + if (is_posix && !is_mac && !is_ios) { + sources += [ + "//chrome/app/chrome_crash_reporter_client.cc", + "//chrome/app/chrome_crash_reporter_client.h", + ] + deps += [ + "//components/crash/content/app", + "//components/crash/content/browser", + "//components/version_info:generate_version_info", + ] + } + if (use_nss_certs) { + sources += + rebase_path(gypi_values.chrome_browser_nss_sources, ".", "//chrome") + if (is_chromeos) { + sources -= [ "net/nss_context_linux.cc" ] + } + } + if (enable_notifications) { + sources += rebase_path(gypi_values.chrome_browser_notifications_sources, + ".", + "//chrome") + if (android_java_ui) { + sources += rebase_path( + gypi_values.chrome_browser_notifications_android_java_ui_sources, + ".", + "//chrome") + } else { + sources += rebase_path( + gypi_values.chrome_browser_notifications_non_android_sources, + ".", + "//chrome") + } + if (is_mac) { + deps += [ "//chrome/browser/ui/cocoa/notifications:common" ] + } + } + if (enable_themes) { + sources += + rebase_path(gypi_values.chrome_browser_themes_sources, ".", "//chrome") + } + + if (enable_basic_printing || enable_print_preview) { + # Some form of printing support. + sources += rebase_path(gypi_values.chrome_browser_printing_basic_sources, + ".", + "//chrome") + deps += [ + "//components/printing/browser", + "//printing", + ] + + if (is_win) { + sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources, + ".", + "//chrome") + } + if (enable_print_preview) { + # Full printing on top of the above. + sources += rebase_path(gypi_values.chrome_browser_printing_full_sources, + ".", + "//chrome") + } else { + # Partial-only printing support. + sources += + rebase_path(gypi_values.chrome_browser_printing_basic_only_sources, + ".", + "//chrome") + } + } + if (enable_captive_portal_detection) { + sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources, + ".", + "//chrome") + } + if (enable_session_service) { + sources += rebase_path(gypi_values.chrome_browser_session_service_sources, + ".", + "//chrome") + } + + if (!is_android && !is_ios && !is_chromeos) { + sources += + rebase_path(gypi_values.chrome_browser_desktop_sources, ".", "//chrome") + } + + if (is_android || is_ios) { + # Mobile. + sources += + rebase_path(gypi_values.chrome_browser_mobile_sources, ".", "//chrome") + } else { + # Non-mobile. + deps += [ + "//apps", + "//chrome/browser/policy:path_parser", + "//chrome/browser/profile_resetter:profile_reset_report_proto", + "//components/feedback", + "//components/web_modal", + "//net:net_browser_services", + ] + sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources, + ".", + "//chrome") + } + + if (!is_chrome_branded) { + sources += [ + "search/local_files_ntp_source.cc", + "search/local_files_ntp_source.h", + ] + } + + if (is_android) { + sources += + rebase_path(gypi_values.chrome_browser_android_sources, ".", "//chrome") + } + + if (android_java_ui) { + sources += rebase_path(gypi_values.chrome_browser_android_java_ui_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_offline_pages_sources, + ".", + "//chrome") + deps += [ + ":client_discourse_context_proto", + ":delta_file_proto", + ":jni_headers", + "//components/data_usage/android", + "//components/precache/content", + "//components/precache/core", + "//components/resources:components_resources", + "//components/service_tab_launcher", + "//components/toolbar", + "//components/web_contents_delegate_android", + ] + } + + if (is_android) { + deps += [ + "//components/cdm/browser", + "//components/resources:components_resources", + "//third_party/android_opengl/etc1", + "//third_party/android_tools:cpu_features", + "//third_party/libaddressinput:util", + ] + + deps -= [ + "//components/storage_monitor", + "//third_party/libaddressinput", + ] + + if (use_seccomp_bpf) { + defines += [ "USE_SECCOMP_BPF" ] + deps += [ "//sandbox/linux:seccomp_bpf" ] + } + } + + if (is_mac) { + deps += [ + "//third_party/google_toolbox_for_mac", + "//third_party/mozilla", + ] + libs += [ + "Accelerate.framework", + "AddressBook.framework", + "AudioUnit.framework", + "DiskArbitration.framework", + "IOKit.framework", + "ImageCaptureCore.framework", + "OpenGL.framework", + "QuartzCore.framework", + "SecurityInterface.framework", + ] + } + + if (enable_rlz) { + deps += [ ":rlz" ] + } + + if (is_win) { + sources += + rebase_path(gypi_values.chrome_browser_win_sources, ".", "//chrome") + public_deps += [ + "//ui/views", + "//ui/views/controls/webview", + ] + deps += [ + ":chrome_process_finder", + "//chrome:file_pre_reader", + "//chrome/chrome_watcher:client", + "//chrome/common:metrics_constants_util_win", + "//chrome/common:version_header", + "//chrome/installer/util:strings", + "//chrome_elf", + "//chrome_elf:constants", + "//chrome_elf:dll_hash", + "//components/browser_watcher", + "//components/browser_watcher:browser_watcher_client", + "//components/startup_metric_utils/common", + "//google_update", + "//third_party/iaccessible2", + "//third_party/isimpledom", + "//third_party/wtl", + ] + + all_dependent_configs = [ ":browser_win_linker_flags" ] + + if (!is_chrome_branded) { + deps -= [ "//google_update" ] + sources -= [ + "google/did_run_updater_win.cc", + "google/did_run_updater_win.h", + "google/google_update_win.cc", + "google/google_update_win.h", + ] + } + } else { + # Non-Windows. + sources += + rebase_path(gypi_values.chrome_browser_non_win_sources, ".", "//chrome") + if (toolkit_views) { + deps += [ + "//ui/views", + "//ui/views/controls/webview", + ] + } + } + + if (is_linux) { + if (use_aura) { + deps += [ "//build/linux:fontconfig" ] + if (use_dbus) { + deps += [ "//dbus" ] + } + } + if (use_x11) { + configs += [ "//build/config/linux:x11" ] + deps += [ "//ui/gfx/x" ] + } + } + + if (is_linux || is_win) { + sources += rebase_path(gypi_values.chrome_browser_non_mac_desktop_sources, + ".", + "//chrome") + } + + if (is_desktop_linux) { + sources += rebase_path(gypi_values.chrome_browser_linux_desktop_sources, + ".", + "//chrome") + } + if (enable_plugin_installation) { + sources += + rebase_path(gypi_values.chrome_browser_plugin_installation_sources, + ".", + "//chrome") + } + if (enable_app_list) { + deps += [ "//ui/app_list" ] + } + if (enable_supervised_users) { + sources += rebase_path(gypi_values.chrome_browser_supervised_user_sources, + ".", + "//chrome") + } + if (enable_supervised_users && !is_android && !is_ios) { + sources += + rebase_path(gypi_values.chrome_browser_supervised_user_legacy_sources, + ".", + "//chrome") + } + if (enable_supervised_users && enable_themes) { + sources += rebase_path( + gypi_values.chrome_browser_supervised_user_and_themes_sources, + ".", + "//chrome") + } + if (enable_webrtc) { + sources += + rebase_path(gypi_values.chrome_browser_webrtc_sources, ".", "//chrome") + } + if (enable_service_discovery) { + sources += rebase_path(gypi_values.chrome_browser_service_discovery_sources, + ".", + "//chrome") + } + if (enable_mdns) { + sources += + rebase_path(gypi_values.chrome_browser_mdns_sources, ".", "//chrome") + } + if (is_android || is_ios) { + sources -= [ + "autofill/validation_rules_storage_factory.cc", + "autofill/validation_rules_storage_factory.h", + ] + } + if (enable_media_router) { + deps += [ "//chrome/browser/media/router" ] + } + + if (enable_mojo_media) { + configs += [ "//media/mojo/services:mojo_media_config" ] + sources += [ + "media/output_protection_impl.cc", + "media/output_protection_impl.h", + ] + deps += [ "//media/mojo/interfaces" ] + if (mojo_media_host == "browser") { + deps += [ "//media/mojo/services" ] + } + } + + if (enable_wayland_server) { + deps += [ + "//components/exo", + "//components/exo/wayland", + ] + sources += [ + "chrome_browser_main_extra_parts_exo.cc", + "chrome_browser_main_extra_parts_exo.h", + ] + } +} + +if (android_java_ui) { + # GYP version: chrome/chrome_browser.gypi:chrome_browser_jni_headers + generate_jni("jni_headers") { + sources = + rebase_path(gypi_values.chrome_browser_jni_sources, ".", "//chrome") + jni_package = "chrome" + } + + #GYP: '//chrome/chrome_browser.gypi:client_discourse_context_proto' + proto_library("client_discourse_context_proto") { + sources = [ + "android/proto/client_discourse_context.proto", + ] + } + + #GYP: '//chrome/chrome_browser.gypi:delta_file_proto' + proto_library("delta_file_proto") { + sources = [ + "android/proto/delta_file.proto", + ] + } +} + +if (is_win) { + source_set("chrome_process_finder") { + sources = [ + "win/chrome_process_finder.cc", + "win/chrome_process_finder.h", + ] + deps = [ + "//base", + "//chrome/common:constants", + ] + if (enable_configuration_policy) { + deps += [ "//chrome/browser/policy:path_parser" ] + } + } +} + +# GYP version: chrome/chrome_resources.gyp:chrome_resources +# (generate_browser_resources action) +grit("resources") { + source = "browser_resources.grd" + defines = chrome_grit_defines + output_dir = "$root_gen_dir/chrome" + outputs = [ + "grit/browser_resources.h", + "browser_resources.pak", + ] + + grit_flags = [ + "-E", + "additional_modules_list_file=" + + rebase_path(additional_modules_list_file, root_build_dir), + "-E", + "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir), + ] + + deps = [ + ":chrome_internal_resources_gen", + "//chrome/browser/resources/safe_browsing:make_file_types_protobuf", + + # Depend only on the generated mojo bindings since we read the .mojom.js + # file, rather than the whole mojo target which will link the C++ bindings. + "//chrome/browser/ui/webui/engagement:mojo_bindings__generator", + "//chrome/browser/ui/webui/omnibox:mojo_bindings__generator", + "//chrome/browser/ui/webui/plugins:mojo_bindings__generator", + "//url/mojo:url_mojom_gurl__generator", + ] +} + +# GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen +if (is_chrome_branded) { + action("chrome_internal_resources_gen") { + script = "internal/transform_additional_modules_list.py" + sources = [ + "internal/resources/additional_modules_list.input", + ] + outputs = [ + additional_modules_list_file, + ] + args = rebase_path(sources, root_build_dir) + + rebase_path(outputs, root_build_dir) + } +} else { + group("chrome_internal_resources_gen") { + # Empty placeholder. + } +} + +# In GYP this is part of test_support_common. +# +# Use a static library here because many test binaries depend on this but don't +# require many files from it. This makes linking more efficient. +static_library("test_support") { + testonly = true + + # Always include this via the main test support target. + visibility = [ "//chrome/test:test_support" ] + + sources = [ + "browsing_data/mock_browsing_data_appcache_helper.cc", + "browsing_data/mock_browsing_data_appcache_helper.h", + "browsing_data/mock_browsing_data_cache_storage_helper.cc", + "browsing_data/mock_browsing_data_cache_storage_helper.h", + "browsing_data/mock_browsing_data_channel_id_helper.cc", + "browsing_data/mock_browsing_data_channel_id_helper.h", + "browsing_data/mock_browsing_data_cookie_helper.cc", + "browsing_data/mock_browsing_data_cookie_helper.h", + "browsing_data/mock_browsing_data_database_helper.cc", + "browsing_data/mock_browsing_data_database_helper.h", + "browsing_data/mock_browsing_data_file_system_helper.cc", + "browsing_data/mock_browsing_data_file_system_helper.h", + "browsing_data/mock_browsing_data_flash_lso_helper.cc", + "browsing_data/mock_browsing_data_flash_lso_helper.h", + "browsing_data/mock_browsing_data_indexed_db_helper.cc", + "browsing_data/mock_browsing_data_indexed_db_helper.h", + "browsing_data/mock_browsing_data_local_storage_helper.cc", + "browsing_data/mock_browsing_data_local_storage_helper.h", + "browsing_data/mock_browsing_data_quota_helper.cc", + "browsing_data/mock_browsing_data_quota_helper.h", + "browsing_data/mock_browsing_data_service_worker_helper.cc", + "browsing_data/mock_browsing_data_service_worker_helper.h", + "download/download_test_file_activity_observer.cc", + "download/download_test_file_activity_observer.h", + "download/test_download_shelf.cc", + "download/test_download_shelf.h", + "media/fake_desktop_media_list.cc", + "media/fake_desktop_media_list.h", + "net/dns_probe_test_util.cc", + "net/dns_probe_test_util.h", + "net/url_request_mock_util.cc", + "net/url_request_mock_util.h", + "notifications/notification_test_util.cc", + "notifications/notification_test_util.h", + "notifications/stub_notification_platform_bridge.cc", + "notifications/stub_notification_platform_bridge.h", + "profile_resetter/profile_resetter_test_base.cc", + "profile_resetter/profile_resetter_test_base.h", + "search_engines/template_url_service_factory_test_util.cc", + "search_engines/template_url_service_factory_test_util.h", + "search_engines/template_url_service_test_util.cc", + "search_engines/template_url_service_test_util.h", + "sessions/session_restore_test_helper.cc", + "sessions/session_restore_test_helper.h", + "sessions/session_service_test_helper.cc", + "sessions/session_service_test_helper.h", + "signin/fake_account_fetcher_service_builder.cc", + "signin/fake_account_fetcher_service_builder.h", + "signin/fake_gaia_cookie_manager_service_builder.cc", + "signin/fake_gaia_cookie_manager_service_builder.h", + "signin/fake_profile_oauth2_token_service_builder.cc", + "signin/fake_profile_oauth2_token_service_builder.h", + "signin/fake_signin_manager_builder.cc", + "signin/fake_signin_manager_builder.h", + "ssl/ssl_client_auth_requestor_mock.cc", + "ssl/ssl_client_auth_requestor_mock.h", + "sync/profile_sync_test_util.cc", + "sync/profile_sync_test_util.h", + ] + + configs += [ "//build/config:precompiled_headers" ] + + public_deps = [ + ":browser", + "//chrome/browser/ui:test_support", + ] + deps = [ + "//chrome/app/theme:theme_resources", + "//chrome/browser", + "//chrome/common", + "//chrome/common/safe_browsing:proto", + "//components/browser_sync/browser:test_support", + "//components/invalidation/impl", + "//components/invalidation/impl:test_support", + "//components/password_manager/core/browser:test_support", + "//components/prefs:test_support", + "//components/search_engines:test_support", + "//components/subresource_filter/core/browser:test_support", + "//components/syncable_prefs:test_support", + "//components/user_prefs/tracked:user_prefs_tracked_test_support", + "//content/test:browsertest_base", + "//content/test:test_support", + "//net:test_support", + "//skia", + "//testing/gmock", + "//testing/gtest", + "//ui/gfx", + ] + + if (!is_ios) { + deps += [ + "//components/sessions:test_support", + "//google_apis:test_support", + ] + } + + if (is_android) { + sources -= [ + "download/test_download_shelf.cc", + "download/test_download_shelf.h", + "profile_resetter/profile_resetter_test_base.cc", + "profile_resetter/profile_resetter_test_base.h", + "sessions/session_restore_test_helper.cc", + "sessions/session_restore_test_helper.h", + "sessions/session_service_test_helper.cc", + "sessions/session_service_test_helper.h", + ] + } + + if (enable_extensions) { + sources += [ + "extensions/extension_action_test_util.cc", + "extensions/extension_action_test_util.h", + ] + deps += [ "//extensions:test_support" ] + } + + if (is_chromeos) { + sources += [ + "chromeos/app_mode/fake_cws.cc", + "chromeos/app_mode/fake_cws.h", + "chromeos/file_manager/fake_disk_mount_manager.cc", + "chromeos/file_manager/fake_disk_mount_manager.h", + "chromeos/input_method/mock_candidate_window_controller.cc", + "chromeos/input_method/mock_candidate_window_controller.h", + "chromeos/input_method/mock_input_method_engine.cc", + "chromeos/input_method/mock_input_method_engine.h", + "chromeos/input_method/mock_input_method_manager.cc", + "chromeos/input_method/mock_input_method_manager.h", + "chromeos/login/screens/mock_device_disabled_screen_actor.cc", + "chromeos/login/screens/mock_device_disabled_screen_actor.h", + "chromeos/login/session/user_session_manager_test_api.cc", + "chromeos/login/session/user_session_manager_test_api.h", + "chromeos/login/test/js_checker.cc", + "chromeos/login/test/js_checker.h", + "chromeos/login/test/oobe_screen_waiter.cc", + "chromeos/login/test/oobe_screen_waiter.h", + "chromeos/login/ui/mock_login_display.cc", + "chromeos/login/ui/mock_login_display.h", + "chromeos/login/ui/mock_login_display_host.cc", + "chromeos/login/ui/mock_login_display_host.h", + "chromeos/login/users/avatar/mock_user_image_manager.cc", + "chromeos/login/users/avatar/mock_user_image_manager.h", + "chromeos/login/users/fake_chrome_user_manager.cc", + "chromeos/login/users/fake_chrome_user_manager.h", + "chromeos/login/users/fake_supervised_user_manager.cc", + "chromeos/login/users/fake_supervised_user_manager.h", + "chromeos/login/users/mock_user_manager.cc", + "chromeos/login/users/mock_user_manager.h", + "chromeos/net/network_portal_detector_test_utils.cc", + "chromeos/net/network_portal_detector_test_utils.h", + "chromeos/policy/cloud_external_data_manager_base_test_util.cc", + "chromeos/policy/cloud_external_data_manager_base_test_util.h", + "chromeos/policy/device_policy_builder.cc", + "chromeos/policy/device_policy_builder.h", + "chromeos/policy/fake_consumer_management_service.cc", + "chromeos/policy/fake_consumer_management_service.h", + "chromeos/policy/fake_device_cloud_policy_initializer.cc", + "chromeos/policy/fake_device_cloud_policy_initializer.h", + "chromeos/policy/fake_device_cloud_policy_manager.cc", + "chromeos/policy/fake_device_cloud_policy_manager.h", + "chromeos/policy/stub_enterprise_install_attributes.cc", + "chromeos/policy/stub_enterprise_install_attributes.h", + "chromeos/settings/device_settings_test_helper.cc", + "chromeos/settings/device_settings_test_helper.h", + "chromeos/system/fake_input_device_settings.cc", + "chromeos/system/fake_input_device_settings.h", + ] + configs += [ "//build/config/linux/dbus" ] + deps += [ "//chromeos:test_support" ] + } + + if (enable_configuration_policy) { + sources += [ + "policy/test/local_policy_test_server.cc", + "policy/test/local_policy_test_server.h", + ] + public_deps += [ + "//components/policy:policy_component_test_support", + "//components/policy:test_support", + ] + } + + if (safe_browsing_mode == 1) { + sources += [ + "extensions/fake_safe_browsing_database_manager.cc", + "extensions/fake_safe_browsing_database_manager.h", + ] + } + + if (enable_extensions) { + sources += [ + "extensions/api/messaging/native_messaging_test_util.cc", + "extensions/api/messaging/native_messaging_test_util.h", + "extensions/mock_extension_special_storage_policy.cc", + "extensions/mock_extension_special_storage_policy.h", + "extensions/test_blacklist.cc", + "extensions/test_blacklist.h", + "extensions/test_blacklist_state_fetcher.cc", + "extensions/test_blacklist_state_fetcher.h", + "extensions/test_extension_dir.cc", + "extensions/test_extension_dir.h", + "extensions/test_extension_environment.cc", + "extensions/test_extension_environment.h", + "extensions/test_extension_prefs.cc", + "extensions/test_extension_prefs.h", + "extensions/test_extension_service.cc", + "extensions/test_extension_service.h", + "extensions/test_extension_system.cc", + "extensions/test_extension_system.h", + "media_galleries/media_galleries_test_util.cc", + "media_galleries/media_galleries_test_util.h", + ] + deps += [ + "//components/drive:test_support", + "//components/storage_monitor:test_support", + ] + } + + if (enable_mdns) { + sources += [ + "local_discovery/test_service_discovery_client.cc", + "local_discovery/test_service_discovery_client.h", + ] + } + + if (enable_app_list) { + sources += [ + "ui/app_list/test/chrome_app_list_test_support.cc", + "ui/app_list/test/chrome_app_list_test_support.h", + "ui/app_list/test/test_app_list_controller_delegate.cc", + "ui/app_list/test/test_app_list_controller_delegate.h", + ] + } + + if (enable_pepper_cdms) { + sources += [ + "media/pepper_cdm_test_helper.cc", + "media/pepper_cdm_test_helper.h", + ] + deps += [ + ":pepper_cdm_test_constants", + "//media:cdm_paths", + ] + } +} + +# In GYP this is part of test_support_ui. +source_set("test_support_ui") { + testonly = true + + # Always include this via the main test support UI target. + visibility = [ "//chrome/test:test_support_ui" ] + + sources = [ + "password_manager/password_manager_test_base.cc", + "password_manager/password_manager_test_base.h", + "signin/token_revoker_test_utils.cc", + "signin/token_revoker_test_utils.h", + "ui/webui/signin/login_ui_test_utils.cc", + "ui/webui/signin/login_ui_test_utils.h", + ] + + configs += [ "//build/config:precompiled_headers" ] + + deps = [ + "//components/metrics:test_support", + "//components/password_manager/content/public/interfaces", + "//components/password_manager/core/browser:test_support", + "//skia", + "//testing/gtest", + ] +} + +if (enable_rlz_support) { + source_set("rlz") { + sources = + rebase_path(gypi_values.chrome_browser_rlz_sources, ".", "//chrome") + deps = [ + "//components/google/core/browser", + "//components/omnibox/browser", + "//components/rlz", + "//components/search_engines", + "//rlz:rlz_lib", + ] + } +} + +if (enable_pepper_cdms) { + # These constants are separated so that test binaries can use them without + # linking all of the test support. + source_set("pepper_cdm_test_constants") { + testonly = true + visibility = [ "//chrome/*" ] + sources = [ + "media/pepper_cdm_test_constants.cc", + "media/pepper_cdm_test_constants.h", + ] + } +} diff --git a/chromium/chrome/browser/android/offline_pages/BUILD.gn b/chromium/chrome/browser/android/offline_pages/BUILD.gn new file mode 100644 index 00000000000..f906f38a318 --- /dev/null +++ b/chromium/chrome/browser/android/offline_pages/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_browser.gypi:offline_pages_proto +proto_library("offline_pages_proto") { + sources = [ + "offline_pages.proto", + ] +} diff --git a/chromium/chrome/browser/apps/app_shim/BUILD.gn b/chromium/chrome/browser/apps/app_shim/BUILD.gn new file mode 100644 index 00000000000..78aeb3668cb --- /dev/null +++ b/chromium/chrome/browser/apps/app_shim/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This is the part of the Chrome browser process responsible for launching and +# communicating with app_shim processes on Mac. +# +# GYP version: chrome/browser/apps/app_shim/browser_app_shim.gypi:browser_app_shim +source_set("app_shim") { + sources = [ + "app_shim_handler_mac.cc", + "app_shim_handler_mac.h", + "app_shim_host_mac.cc", + "app_shim_host_mac.h", + "app_shim_host_manager_mac.h", + "app_shim_host_manager_mac.mm", + "extension_app_shim_handler_mac.cc", + "extension_app_shim_handler_mac.h", + "unix_domain_socket_acceptor.cc", + "unix_domain_socket_acceptor.h", + ] + + deps = [ + "//content/public/browser", + "//content/public/common", + ] +} diff --git a/chromium/chrome/browser/chromeos/BUILD.gn b/chromium/chrome/browser/chromeos/BUILD.gn new file mode 100644 index 00000000000..a83f2661590 --- /dev/null +++ b/chromium/chrome/browser/chromeos/BUILD.gn @@ -0,0 +1,229 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//chrome/chrome_tests.gni") +import("//media/media_options.gni") +import("//third_party/protobuf/proto_library.gni") + +assert(is_chromeos) + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("../../chrome_browser_chromeos.gypi") ], + "scope", + [ "../../chrome_browser_chromeos.gypi" ]) + +source_set("chromeos") { + assert(enable_extensions, "ChromeOS Chrome has to be built with extensions") + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + public_deps = [ + "//ash/resources", + "//ash/strings", + "//chrome:extra_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/app/resources:platform_locale_settings", + "//chrome/app/theme:theme_resources", + "//components/wallpaper", + "//content/app/resources", + "//ui/chromeos/resources", + "//ui/chromeos/strings", + "//ui/resources", + "//ui/strings", + ] + + deps = [ + # TODO(tbarzic): Cleanup this list. + ":attestation_proto", + ":device_policy_proto", + "//ash", + "//ash:ash_with_content", + "//ash/public/interfaces", + "//ash/sysui/public/interfaces", + "//build/linux:fontconfig", + "//chrome/browser/devtools", + "//chrome/browser/extensions", + "//chrome/browser/safe_browsing:chunk_proto", + "//chrome/common", + "//chrome/common/extensions/api", + "//chrome/common/extensions/api:api_registration", + "//chrome/common/net", + "//chrome/common/safe_browsing:proto", + "//chrome/installer/util:with_no_strings", + "//chromeos", + "//chromeos:cryptohome_proto", + "//chromeos:cryptohome_signkey_proto", + "//chromeos:power_manager_proto", + "//components/arc", + "//components/certificate_reporting:cert_logger_proto", + "//components/certificate_reporting:encrypted_cert_logger_proto", + "//components/drive", + "//components/drive:drive_chromeos", + "//components/feedback", + "//components/flags_ui", + "//components/login", + "//components/onc", + "//components/ownership", + "//components/pairing", + "//components/policy", + "//components/proxy_config", + "//components/safe_browsing_db:metadata_proto", + "//components/session_manager/core", + "//components/user_manager", + "//components/wifi_sync", + + # This depends directly on the variations target, rather than just + # transitively via the common target because the proto sources need to + # be generated before code in this target can start building. + "//components/resources", + "//components/strings", + "//components/variations", + "//content/public/browser", + "//content/public/common", + "//crypto", + "//dbus", + "//device/bluetooth", + "//device/hid", + "//mash/public/interfaces", + "//media", + "//media/mojo/interfaces", + "//mojo/common", + "//net", + "//ppapi/proxy:ipc", # For PpapiMsg_LoadPlugin + "//services/shell/public/cpp", + + # TODO: care about enable_basic_printing and enable_print_preview. + "//printing", + "//skia", + "//storage/browser", + "//storage/common", + "//sync", + "//third_party/adobe/flash:flapper_version_h", + "//third_party/cacheinvalidation", + "//third_party/icu", + "//third_party/leveldatabase", + "//third_party/libjingle", + "//third_party/libusb", + "//third_party/protobuf:protobuf_lite", + "//third_party/protobuf:protoc($host_toolchain)", + "//third_party/re2", + "//third_party/zlib", + "//ui/app_list", + "//ui/app_list/presenter:mojom", + "//ui/aura", + "//ui/base", + "//ui/chromeos:ui_chromeos", + "//ui/compositor", + "//ui/display", + "//ui/events:dom_keycode_converter", + "//ui/events/devices", + "//ui/events/platform", + "//ui/file_manager", + "//ui/keyboard:mojom", + "//ui/message_center", + "//ui/surface", + "//ui/views", + "//ui/views/controls/webview", + "//ui/web_dialogs", + "//url", + "//v8", + ] + + defines = [ "MOJO_SHELL_CLIENT" ] + + sources = rebase_path(gypi_values.browser_chromeos_sources, ".", "//chrome") + + rebase_path(gypi_values.browser_chromeos_extension_sources, + ".", + "//chrome") + sources += [ + "chrome_interface_factory.cc", + "chrome_interface_factory.h", + ] + if (use_x11) { + configs += [ "//build/config/linux:x11" ] + deps += [ + "//ui/events/devices", + "//ui/events/devices/x11", + ] + sources -= [ + "system/input_device_settings_impl_ozone.cc", + "system_logs/touch_log_source_ozone.cc", + ] + } else { + assert(use_ozone, "Either use_x11 or use_ozone has to be specified.") + deps += [ "//ui/ozone" ] + sources -= [ + "device_uma.cc", + "device_uma.h", + "events/system_key_event_listener.cc", + "events/system_key_event_listener.h", + "events/xinput_hierarchy_changed_event_listener.cc", + "events/xinput_hierarchy_changed_event_listener.h", + "system/input_device_settings_impl_x11.cc", + "system_logs/touch_log_source_x11.cc", + ] + } + + if (use_cras) { + defines += [ "USE_CRAS" ] + } + + if (ui_compositor_image_transport) { + deps += [ "//ui/gl" ] + } +} + +source_set("unit_tests") { + testonly = true + + sources = rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_chromeos_sources + + chrome_tests_unit_gypi_values.chrome_unit_tests_arc_sources, + ".", + "//chrome") + + public_deps = [ + ":chromeos", + ] + deps = [ + ":attestation_proto", + ":device_policy_proto", + "//ash/resources", + "//components/drive", + "//components/drive:test_support_chromeos", + "//components/invalidation/public", + "//components/policy", + "//components/resources", + "//crypto:platform", + "//dbus", + "//mojo/public/cpp/system:system", + "//skia", + "//sync", + "//testing/gmock", + "//testing/gtest", + "//third_party/icu", + "//third_party/leveldatabase", + "//ui/chromeos/resources", + ] + data = [ + "//chromeos/test/data/", + ] +} + +proto_library("device_policy_proto") { + sources = [ + "policy/proto/chrome_device_policy.proto", + "policy/proto/install_attributes.proto", + ] +} + +proto_library("attestation_proto") { + sources = [ + "attestation/attestation_key_payload.proto", + "attestation/attestation_signed_data.proto", + ] +} diff --git a/chromium/chrome/browser/devtools/BUILD.gn b/chromium/chrome/browser/devtools/BUILD.gn new file mode 100644 index 00000000000..1d58c22fd7c --- /dev/null +++ b/chromium/chrome/browser/devtools/BUILD.gn @@ -0,0 +1,146 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if (!is_android) { + import("//build/config/features.gni") + import("//tools/grit/grit_rule.gni") +} + +action("devtools_protocol_constants") { + script = "devtools_protocol_constants_generator.py" + deps = [ + "//third_party/WebKit/Source/core/inspector:protocol_version", + ] + blink_protocol = "$root_gen_dir/blink/core/inspector/protocol.json" + browser_protocol = "//content/browser/devtools/browser_protocol.json" + inputs = [ + blink_protocol, + browser_protocol, + ] + outputs = [ + "$target_gen_dir/devtools_protocol_constants.cc", + "$target_gen_dir/devtools_protocol_constants.h", + ] + + args = [ "chrome" ] + args += rebase_path(outputs, root_build_dir) + args += [ rebase_path(blink_protocol, root_build_dir) ] + args += [ rebase_path(browser_protocol, root_build_dir) ] +} + +# GYP version: chrome/chrome_debugger.gypi:debugger +static_library("devtools") { + # Note: new sources and deps should be generally added in (!is_android) below. + sources = [ + "chrome_devtools_manager_delegate.cc", + "chrome_devtools_manager_delegate.h", + "devtools_network_conditions.cc", + "devtools_network_conditions.h", + "devtools_network_controller.cc", + "devtools_network_controller.h", + "devtools_network_controller_handle.cc", + "devtools_network_controller_handle.h", + "devtools_network_interceptor.cc", + "devtools_network_interceptor.h", + "devtools_network_protocol_handler.cc", + "devtools_network_protocol_handler.h", + "devtools_network_transaction.cc", + "devtools_network_transaction.h", + "devtools_network_transaction_factory.cc", + "devtools_network_transaction_factory.h", + "devtools_network_upload_data_stream.cc", + "devtools_network_upload_data_stream.h", + "devtools_protocol.cc", + "devtools_protocol.h", + ] + sources += get_target_outputs(":devtools_protocol_constants") + + configs += [ + "//build/config/compiler:no_size_t_to_int_warning", + "//build/config/compiler:wexit_time_destructors", + "//build/config:precompiled_headers", + "//third_party/WebKit/public:debug_devtools", + ] + + deps = [ + ":devtools_protocol_constants", + "//base", + "//content/public/browser", + "//net", + "//ui/events:dom_keycode_converter", + ] + + if (!is_android) { + deps += [ + "//chrome:extra_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/app/theme:theme_resources", + "//chrome/common/extensions/api", + "//components/devtools_http_handler", + "//net:http_server", + "//skia", + "//third_party/icu", + "//third_party/leveldatabase", + ] + sources += [ + "chrome_devtools_discovery_provider.cc", + "chrome_devtools_discovery_provider.h", + "device/adb/adb_client_socket.cc", + "device/adb/adb_client_socket.h", + "device/adb/adb_device_provider.cc", + "device/adb/adb_device_provider.h", + "device/android_device_info_query.cc", + "device/android_device_manager.cc", + "device/android_device_manager.h", + "device/android_web_socket.cc", + "device/devtools_android_bridge.cc", + "device/devtools_android_bridge.h", + "device/port_forwarding_controller.cc", + "device/port_forwarding_controller.h", + "device/tcp_device_provider.cc", + "device/tcp_device_provider.h", + "device/usb/android_rsa.cc", + "device/usb/android_rsa.h", + "device/usb/android_usb_device.cc", + "device/usb/android_usb_device.h", + "device/usb/android_usb_socket.cc", + "device/usb/android_usb_socket.h", + "device/usb/usb_device_provider.cc", + "device/usb/usb_device_provider.h", + "devtools_auto_opener.cc", + "devtools_auto_opener.h", + "devtools_contents_resizing_strategy.cc", + "devtools_contents_resizing_strategy.h", + "devtools_embedder_message_dispatcher.cc", + "devtools_embedder_message_dispatcher.h", + "devtools_file_helper.cc", + "devtools_file_helper.h", + "devtools_file_system_indexer.cc", + "devtools_file_system_indexer.h", + "devtools_file_watcher.cc", + "devtools_file_watcher.h", + "devtools_target_impl.cc", + "devtools_target_impl.h", + "devtools_targets_ui.cc", + "devtools_targets_ui.h", + "devtools_toggle_action.cc", + "devtools_toggle_action.h", + "devtools_ui_bindings.cc", + "devtools_ui_bindings.h", + "devtools_window.cc", + "devtools_window.h", + "global_confirm_info_bar.cc", + "global_confirm_info_bar.h", + "remote_debugging_server.cc", + "remote_debugging_server.h", + ] + if (enable_service_discovery) { + sources += [ + "device/cast_device_provider.cc", + "device/cast_device_provider.h", + ] + } + } +} diff --git a/chromium/chrome/browser/extensions/BUILD.gn b/chromium/chrome/browser/extensions/BUILD.gn new file mode 100644 index 00000000000..c304abdfcf8 --- /dev/null +++ b/chromium/chrome/browser/extensions/BUILD.gn @@ -0,0 +1,234 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") + +assert(enable_extensions) + +gypi_values = + exec_script("//build/gypi_to_gn.py", + [ rebase_path("../../chrome_browser_extensions.gypi") ], + "scope", + [ "../../chrome_browser_extensions.gypi" ]) + +# GYP version: chrome/chrome_browser_extensions.gypi:browser_extensions +static_library("extensions") { + sources = [] + sources += rebase_path(gypi_values.chrome_browser_extensions_enabled_sources, + ".", + "//chrome") + + configs += [ + "//build/config:precompiled_headers", + "//build/config/compiler:wexit_time_destructors", + ] + defines = [] + + # Since browser and browser_extensions actually depend on each other, + # we must omit the dependency from browser_extensions to browser. + # However, this means browser_extensions and browser should more or less + # have the same dependencies. Once browser_extensions is untangled from + # browser, then we can clean up these dependencies. + public_deps = [ + "//chrome/common/extensions/api", + "//content/public/browser", + ] + deps = [ + "//chrome:extra_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/app/resources:platform_locale_settings", + "//chrome/app/theme:theme_resources", + "//chrome/browser/devtools", + "//chrome/common", + "//chrome/common/extensions/api:api_registration", + "//chrome/common/safe_browsing:proto", + "//chrome/installer/util:with_no_strings", + "//components/copresence", + "//components/data_reduction_proxy/proto:data_reduction_proxy_proto", + "//components/dom_distiller/core", + "//components/onc", + "//components/policy", + "//components/proximity_auth", + "//components/resources", + "//components/strings", + "//components/update_client", + "//components/url_matcher", + "//content/app/resources", + "//content/public/common", + "//crypto", + "//device/bluetooth", + "//device/hid", + "//extensions:extensions_resources", + "//extensions/browser", + "//extensions/common/api", + "//extensions/common/api:api_registration", + "//extensions/strings", + "//net", + "//skia", + "//storage/browser", + "//storage/common", + "//sync", + "//third_party/WebKit/public:image_resources", + "//third_party/WebKit/public:resources", + "//third_party/cacheinvalidation", + "//third_party/icu", + "//third_party/leveldatabase", + "//third_party/libaddressinput:util", + "//third_party/re2", + "//third_party/webrtc/modules/desktop_capture", + "//ui/accessibility:ax_gen", + "//ui/base", + "//ui/base/ime", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/resources", + "//ui/strings", + "//url", + ] + + if (enable_task_manager) { + sources += rebase_path( + gypi_values.chrome_browser_extensions_task_manager_enabled_sources, + ".", + "//chrome") + } + + if (is_chromeos) { + sources += + rebase_path(gypi_values.chrome_browser_extensions_chromeos_sources, + ".", + "//chrome") + sources -= [ "api/music_manager_private/device_id_linux.cc" ] + if (use_dbus) { + configs += [ "//build/config/linux/dbus" ] + } + deps += [ + "//components/chrome_apps", + "//remoting/host/it2me:common", + "//third_party/protobuf:protobuf_lite", + ] + } else { + sources += [ + "default_apps.cc", + "default_apps.h'", + ] + sources += + rebase_path(gypi_values.chrome_browser_extensions_non_chromeos_sources, + ".", + "//chrome") + } + + if (enable_service_discovery) { + sources += rebase_path( + gypi_values.chrome_browser_extensions_service_discovery_sources, + ".", + "//chrome") + } + + if (use_ash) { + sources += [ + "api/tabs/ash_panel_contents.cc", + "api/tabs/ash_panel_contents.h", + ] + } + + if (use_aura) { + deps += [ + "//ui/keyboard", + "//ui/keyboard:keyboard_with_content", + "//ui/keyboard:resources", + ] + } + + if (toolkit_views) { + deps += [ "//ui/views" ] + } + + if (is_linux) { + deps += [ "//build/linux:fontconfig" ] + + if (use_dbus) { + deps += [ "//dbus" ] + } + + if (use_x11) { + configs += [ "//build/config/linux:x11" ] + deps += [ + "//ui/events:events_base", + "//ui/events/platform", + "//ui/events/platform/x11", + ] + } + if (!is_chromeos) { + sources += rebase_path( + gypi_values.chrome_browser_extensions_input_ime_linux_win_sources, + ".", + "//chrome") + } + } + + if (enable_webrtc) { + sources += [ "api/webrtc_logging_private/webrtc_logging_private_api.cc" ] + } else { + sources += + [ "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc" ] + } + + if (use_brlapi) { + deps += [ "//build/linux/libbrlapi" ] + sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources, + ".", + "//chrome") + } else { + sources += [ "api/braille_display_private/braille_controller_stub.cc" ] + } + + # chromeos uses its own global_shortcut_listener, _x11 is not necessary. + if (is_chromeos || !use_x11) { + sources -= [ + "global_shortcut_listener_x11.cc", + "global_shortcut_listener_x11.h", + ] + } + + if (is_win || is_mac) { + deps += [ "//components/wifi" ] + sources += rebase_path( + gypi_values.chrome_browser_extensions_networking_private_sources_winmac, + ".", + "//chrome") + } + + if (is_win) { + deps += [ + "//third_party/iaccessible2", + "//third_party/isimpledom", + ] + sources += rebase_path( + gypi_values.chrome_browser_extensions_input_ime_linux_win_sources, + ".", + "//chrome") + } else if (use_aura && !is_chromeos) { + sources += [ + "display_info_provider_aura.cc", + "display_info_provider_aura.h", + ] + } + + if (enable_app_list) { + sources += + rebase_path(gypi_values.chrome_browser_extensions_app_list_sources, + ".", + "//chrome") + } + + if (is_chromeos && use_ozone) { + sources -= [ "global_shortcut_listener_chromeos.cc" ] + } + if (!use_ozone) { + sources -= [ "global_shortcut_listener_ozone.cc" ] + } +} diff --git a/chromium/chrome/browser/extensions/default_extensions/BUILD.gn b/chromium/chrome/browser/extensions/default_extensions/BUILD.gn new file mode 100644 index 00000000000..77a0554f54f --- /dev/null +++ b/chromium/chrome/browser/extensions/default_extensions/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if (is_win) { + copy("default_extensions") { + sources = [ + "external_extensions.json", + ] + outputs = [ + "$root_out_dir/extensions/{{source_file_part}}", + ] + } +} else { + # No-op on non-Windows. + group("default_extensions") { + } +} diff --git a/chromium/chrome/browser/media/router/BUILD.gn b/chromium/chrome/browser/media/router/BUILD.gn new file mode 100644 index 00000000000..8e14962577f --- /dev/null +++ b/chromium/chrome/browser/media/router/BUILD.gn @@ -0,0 +1,64 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# + +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("media_router.gypi") ], + "scope", + [ "media_router.gypi" ]) + +static_library("router") { + deps = [ + "//base", + "//chrome/common:constants", + "//components/keyed_service/content", + "//components/keyed_service/core", + "//content/public/browser", + "//url", + ] + sources = rebase_path(gypi_values.media_router_sources, + ".", + "//chrome/browser/media/router") + if (!is_android) { + deps += [ + ":mojo_bindings", + "//extensions/browser", + "//mojo/public/cpp/bindings", + ] + sources += rebase_path(gypi_values.media_router_non_android_sources, + ".", + "//chrome/browser/media/router") + } +} + +mojom("mojo_bindings") { + sources = [ + "mojo/media_router.mojom", + ] +} + +source_set("test_support") { + testonly = true + deps = [ + ":router", + "//chrome/test:test_support", + "//testing/gmock", + ] + sources = rebase_path(gypi_values.media_router_test_support_sources, + ".", + "//chrome/browser/media/router") + if (!is_android) { + deps += [ + ":mojo_bindings", + "//extensions/common", + ] + sources += + rebase_path(gypi_values.media_router_non_android_test_support_sources, + ".", + "//chrome/browser/media/router") + } +} diff --git a/chromium/chrome/browser/media/router/mojo/media_router.mojom b/chromium/chrome/browser/media/router/mojo/media_router.mojom new file mode 100644 index 00000000000..4fcdbdf70d5 --- /dev/null +++ b/chromium/chrome/browser/media/router/mojo/media_router.mojom @@ -0,0 +1,395 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module media_router.interfaces; + +// Represents an output sink to which media can be routed. +struct MediaSink { + enum IconType { + CAST, + CAST_AUDIO, + CAST_AUDIO_GROUP, + GENERIC, + HANGOUT + }; + + // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." + string sink_id; + // The human-readable name, e.g. "Janet's Chromecast". + string name; + // Optional description of the sink. + string? description; + // Optional domain of the sink if this sink is associated with an identity. + string? domain; + // The type of icon to show in the UI for this media sink. + IconType icon_type; +}; + +// Should be kept in sync with media_route.h. +struct MediaRoute { + // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". + string media_route_id; + // The ID of the media source being sent through this media route. + // May be missing if route is not local. + string? media_source; + // The ID of sink that is rendering the media content. + string media_sink_id; + // Human readable description of this route, e.g. + // "Tab casting". + string description; + // Specifies that the route is requested locally. + bool is_local; + // An optional path to an HTML page bundled bundled with the media router + // component extension. When set, the route can have custom route detail as + // well as its own route controls in the media router dialog. + string? custom_controller_path; + // Set to true if this route should be displayed for |media_sink_id| in UI. + bool for_display; + // Set to true if this route was created by an off the record (incognito) + // profile. + bool off_the_record; +}; + +// Notifications or an actionable events to be shown to the user. +// When is_blocking is true, media router UI shows issue only: +// +// Title +// Message +// default_action_button secondary_action_button +// +// When is_blocking is false, media router UI uses banner: +// +// Title default_action_link secondary_action_link +// +// above receiver list if route_id is not provided; otherwise it is +// above route detail and controls. +struct Issue { + enum Severity { + FATAL, + WARNING, + NOTIFICATION + }; + + enum ActionType { + DISMISS, + LEARN_MORE + }; + + // If set, the ID of the route to which this issue pertains. + // If not set (default), then this is a global issue. + string? route_id; + + Severity severity; + + // When true, the issue must be presented to the user and resolved + // before other actions are allowed. + bool is_blocking; + + // Short description about the issue. + string title; + + // Message about issue detail or how to handle issue. + // Messages should be suitable for end users to decide which actions to take. + string? message; + + ActionType default_action; + + array<ActionType>? secondary_actions; + + // The ID of the help page to be opened if users select learn_more. + int32 help_page_id; +}; + +struct RouteMessage { + enum Type { + TEXT, + BINARY + }; + // The type of this message. + Type type; + // Used when the |type| is TEXT. + string? message; + // Used when the |type| is BINARY. + array<uint8>? data; +}; + +struct SinkSearchCriteria { + // Input to the search method which each Media Route Provider may interpret + // differently. + string input; + // The user's current hosted domain. + string domain; +}; + +// Keep in sync with: +// - RouteRequestResult::ResultCode in route_request_result.h +// - MediaRouteProviderResult enum in tools/metrics/histograms.xml. +// - mr.RouteRequestResultCode in route_request_error.js +enum RouteRequestResultCode { + UNKNOWN_ERROR, + OK, + TIMED_OUT, + ROUTE_NOT_FOUND, + SINK_NOT_FOUND, + INVALID_ORIGIN, + OFF_THE_RECORD_MISMATCH, + NO_SUPPORTED_PROVIDER +// New values must be added here. +}; + +// Modeled after the MediaRouter interface defined in +// chrome/browser/media/router/media_router.h +interface MediaRouteProvider { + // Creates a media route from |media_source| to the sink given by |sink_id|. + // + // The presentation ID of the route created will be |presentation_id|, but it + // may be overridden by a provider implementation. The presentation ID will + // be used by the presentation API to refer to the created route. + // + // |origin| and |tab_id| may be passed in for enforcing same-origin and/or + // same-tab scopes. Use -1 as |tab_id| in cases where the request is not + // made on behalf of a tab. + // + // If |timeout_millis| is positive, it will be used in place of the default + // timeout defined by Media Route Provider Manager. + // + // If |off_the_record| is true, the request was made by an off the record + // (incognito) profile. + // + // If the operation was successful, |route| will be defined and + // |error_text| will be null. + // If the operation failed, |route| will be null and |error_text| + // will be set. + // |result| will be set to OK if successful, or an error code if an error + // occurred. + CreateRoute(string media_source, + string sink_id, + string original_presentation_id, + string origin, + int32 tab_id, + int64 timeout_millis, + bool off_the_record) => + (MediaRoute? route, + string? error_text, + RouteRequestResultCode result_code); + + // Requests a connection to an established route for |media_source| given + // by |presentation_id|. + // + // |origin| and |tab_id| are used for validating same-origin/tab scopes; + // see CreateRoute for additional documentation. + // + // If |timeout_millis| is positive, it will be used in place of the default + // timeout defined by Media Route Provider Manager. + // + // If the route request was created by an off the record (incognito) profile, + // |off_the_record| must be true. + // + // If the operation was successful, |route| will be defined and + // |error_text| will be null. + // If the operation failed, |route| will be null and |error_text| + // will be set. + // |result| will be set to OK if successful, or an error code if an error + // occurred. + JoinRoute(string media_source, + string presentation_id, + string origin, + int32 tab_id, + int64 timeout_millis, + bool off_the_record) => + (MediaRoute? route, + string? error_text, + RouteRequestResultCode result_code); + + // Creates a new route for |media_source| that connects to the established + // route given by |route_id|. + // + // The presentation ID of the new route will be |presentation_id|, but it may + // be overridden by a provider implementation. The presentation ID will be + // used by the presentation API to refer to the created route. + // + // |origin| and |tab_id| are used for validating same-origin/tab scopes; see + // CreateRoute for additional documentation. + // + // If |timeout_millis| is positive, it will be used in place of the default + // timeout defined by Media Route Provider Manager; see CreateRoute for + // additional documentation. + // + // If the route request was created by an off the record (incognito) profile, + // |off_the_record| must be true. + // + // If the operation was successful, |route| will be defined and + // |error_text| will be null. If the operation failed, |route| will be null + // and |error_text| will be set. + // + // |result| will be set to OK if successful, or an error code if an error + // occurred. + ConnectRouteByRouteId(string media_source, + string route_id, + string presentation_id, + string origin, + int32 tab_id, + int64 timeout_millis, + bool off_the_record) => + (MediaRoute? route, + string? error_text, + RouteRequestResultCode result_code); + + // Terminates the route specified by |route_id|. If the route was terminated + // successfully, |result_code| is set to OK and |error_text| is null. + // Otherwise, |result_code| is an error code and |error_text| describes the + // error. + TerminateRoute(string route_id) => + (string? error_text, RouteRequestResultCode result_code); + + // Sends |message| via the media route |media_route_id|. + // If the operation was successful, |sent| is true; otherwise it is false. + SendRouteMessage(string media_route_id, string message) => (bool sent); + + // Sends |data| via the media route |media_route_id|. + // If the operation was successful, |sent| is true; otherwise it is false. + SendRouteBinaryMessage(string media_route_id, array<uint8> data) + => (bool sent); + + // Starts querying for sinks capable of displaying |media_source|. + StartObservingMediaSinks(string media_source); + + // Stops querying sinks for |media_source|. + StopObservingMediaSinks(string media_source); + + // Starts reporting the state of active media routes via + // OnRoutesUpdated() in the context of the |media_source|. The + // |media_source| represents the application interested in the media + // routes (usually the web page from which the content originates). + // If no |media_source| is given, this should be considered an + // observer that is not associated with a media source, and thus + // cannot connect to a remote route without showing a source. The + // |media_source| should be considered when returning joinable routes in the + // OnRoutesUpdated() call. If an empty |media_source| is given, there is no + // context in which a joinable route makes sense and therefore, there should + // not be any joinable routes returned in OnRoutesUpdated(). + // Querying will continue until StopObservingMediaRoutes() is called with + // the same |media_source| (even if it's an empty string). + StartObservingMediaRoutes(string media_source); + + // Stops querying the state of all media routes in the context of + // the |media_source|. StartObservingMediaRoutes() has + // to be called with the same |media_source| for this to have any effect even + // if it's empty. Thus, StartObservingMediaRoutes(media_source) must be + // matched with StopObservingMediaRoutes(media_source). + // Calling StopObservingMediaRoutes() without a media_source will stop + // any media routes queries associated with emtpy strings (queries + // that being with StartObservingMediaRoutes()). + StopObservingMediaRoutes(string media_source); + + // Starts listening for messages from the media sink for the route given by + // |route_id|. + // |MediaRouter::OnRouteMessagesReceived| will be invoked when a batch of + // messages arrives, or when there is an error. + // |StopListeningForRouteMessages| will stop the Media Router from receiving + // further messages for |route_id|. + StartListeningForRouteMessages(string route_id); + + // Called when there are no more listeners for messages for |route_id|. + StopListeningForRouteMessages(string route_id); + + // Indicates that a PresentationConnection that was connected to route + // |route_id| has been closed (via .close(), garbage collection or + // navigation). + DetachRoute(string route_id); + + // Enables mDNS discovery. No-op if mDNS discovery is already enabled. + // Calling this will trigger a firewall prompt on Windows if there is not + // already a firewall rule for mDNS. + EnableMdnsDiscovery(); + + // Updates media sinks capable of displaying |media_source|. + UpdateMediaSinks(string media_source); + + // Indicates that the Media Router is interested in finding a sink that + // matches |search_criteria| and is compatible with the source urn + // |media_source|. |search_criteria| should contain an exact copy of the user + // input. The user's current domain is also used to search. The domain is the + // hosted domain of the user's signed-in identity, or empty if the user has no + // domain or is not signed in. + SearchSinks(string sink_id, + string media_source, + SinkSearchCriteria search_criteria) => + (string sink_id); +}; + +// Interface for a service which observes state changes across media +// sources, sinks, and issues. +interface MediaRouter { + + // Represents overall media sink availability states. + // UNAVAILABLE - No sinks are available. + // PER_SOURCE - Sinks are available, but are only compatible with specific + // media sources. + // AVAILABLE - A sink is available regardless of source. + enum SinkAvailability { + UNAVAILABLE, + PER_SOURCE, + AVAILABLE + }; + + // Keep in sync with content/public/browser/presentation_session.h. + enum PresentationConnectionState { + CONNECTING, + CONNECTED, + CLOSED, + TERMINATED + }; + + // Keep in sync with content/public/browser/presentation_session.h. + enum PresentationConnectionCloseReason { + CONNECTION_ERROR, + CLOSED, + WENT_AWAY + }; + + // Registers a MediaRouteProvider with the MediaRouter. + // Returns a string that uniquely identifies the Media Router browser + // process. + RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => + (string instance_id); + + // Called when the Media Route Manager receives a new list of |sinks| + // compatible with |media_source|. The result is only valid for |origins|. If + // |origins| is empty, the result is valid for any origin. + OnSinksReceived(string media_source, array<MediaSink> sinks, + array<string> origins); + + // Called when issues are reported for media routes. + OnIssue(Issue issue); + + // Called when list of routes has been updated in the context of the + // calling |media_source|. The array |joinable_route_ids| should + // contain route IDs of joinable routes found in the |routes| array. + OnRoutesUpdated(array<MediaRoute> routes, string media_source, + array<string> joinable_route_ids); + + // Called when the overall availability of media sinks has been updated. + OnSinkAvailabilityUpdated(SinkAvailability availability); + + // Called when the state of presentation connected to route |route_id| has + // changed to |state|. + OnPresentationConnectionStateChanged( + string route_id, PresentationConnectionState state); + + // Called when the presentation connected to route |route_id| has closed. + OnPresentationConnectionClosed( + string route_id, PresentationConnectionCloseReason reason, + string message); + + // Called when the a batch of messages arrives from the media sink for the + // route given by |route_id|. + // |StartListeningForRouteMessages| must be called first in order to receive + // messages. + // |route_id|: ID of route of the messages. + // |messages|: A non-empty list of messages received. + OnRouteMessagesReceived(string route_id, + array<RouteMessage> messages); +}; + diff --git a/chromium/chrome/browser/metrics/variations/BUILD.gn b/chromium/chrome/browser/metrics/variations/BUILD.gn new file mode 100644 index 00000000000..2c421d3ec6f --- /dev/null +++ b/chromium/chrome/browser/metrics/variations/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//components/variations/service/generate_ui_string_overrider.gni") + +# GYP version: chrome/chrome_resources.gyp:chrome_ui_string_overrider_factory +generate_ui_string_overrider("chrome_ui_string_overrider_factory") { + inputs = [ + "$root_gen_dir/chrome/grit/chromium_strings.h", + "$root_gen_dir/chrome/grit/generated_resources.h", + "$root_gen_dir/chrome/grit/google_chrome_strings.h", + "$root_gen_dir/chrome/grit/settings_chromium_strings.h", + "$root_gen_dir/chrome/grit/settings_google_chrome_strings.h", + "$root_gen_dir/chrome/grit/settings_strings.h", + "$root_gen_dir/components/strings/grit/components_chromium_strings.h", + "$root_gen_dir/components/strings/grit/components_google_chrome_strings.h", + "$root_gen_dir/components/strings/grit/components_strings.h", + ] + deps = [ + "//chrome/app:chromium_strings", + "//chrome/app:generated_resources", + "//chrome/app:google_chrome_strings", + "//chrome/app:settings_chromium_strings", + "//chrome/app:settings_google_chrome_strings", + "//chrome/app:settings_strings", + "//components/strings:components_chromium_strings", + "//components/strings:components_google_chrome_strings", + "//components/strings:components_strings", + ] + namespace = "chrome_variations" + header_filename = "ui_string_overrider_factory.h" + source_filename = "ui_string_overrider_factory.cc" +} diff --git a/chromium/chrome/browser/nacl_host/test/BUILD.gn b/chromium/chrome/browser/nacl_host/test/BUILD.gn new file mode 100644 index 00000000000..4716ffea789 --- /dev/null +++ b/chromium/chrome/browser/nacl_host/test/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +if (enable_nacl && (is_linux || is_win)) { + executable("mock_nacl_gdb") { + sources = [ + "mock_nacl_gdb.cc", + ] + deps = [ + "//base", + + # Default manifest on Windows (a no-op elsewhere). + "//build/win:default_exe_manifest", + ] + } +} diff --git a/chromium/chrome/browser/net/BUILD.gn b/chromium/chrome/browser/net/BUILD.gn new file mode 100644 index 00000000000..4320c4c30ec --- /dev/null +++ b/chromium/chrome/browser/net/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_browser.gypi:probe_message_proto +proto_library("probe_message_proto") { + sources = [ + "probe_message.proto", + ] +} diff --git a/chromium/chrome/browser/policy/BUILD.gn b/chromium/chrome/browser/policy/BUILD.gn new file mode 100644 index 00000000000..abfe35e1633 --- /dev/null +++ b/chromium/chrome/browser/policy/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +source_set("path_parser") { + sources = [ + "policy_path_parser.h", + "policy_path_parser_linux.cc", + "policy_path_parser_mac.mm", + "policy_path_parser_win.cc", + ] + + deps = [ + "//base", + "//chrome/common:constants", + "//components/policy", + ] + + if (is_win) { + libs = [ "wtsapi32.lib" ] + } +} diff --git a/chromium/chrome/browser/profile_resetter/BUILD.gn b/chromium/chrome/browser/profile_resetter/BUILD.gn new file mode 100644 index 00000000000..46a443d4ab3 --- /dev/null +++ b/chromium/chrome/browser/profile_resetter/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_browser.gypi:probe_message_proto +proto_library("profile_reset_report_proto") { + sources = [ + "profile_reset_report.proto", + ] +} diff --git a/chromium/chrome/browser/resources/chromeos/braille_ime/BUILD.gn b/chromium/chrome/browser/resources/chromeos/braille_ime/BUILD.gn new file mode 100644 index 00000000000..092cbce3bc1 --- /dev/null +++ b/chromium/chrome/browser/resources/chromeos/braille_ime/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_chromeos) + +copy("braille_ime_manifest") { + sources = [ + "manifest.json", + ] + outputs = [ + "$root_out_dir/resources/chromeos/braille_ime/manifest.json", + ] +} diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn b/chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn new file mode 100644 index 00000000000..890fec4ed96 --- /dev/null +++ b/chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn @@ -0,0 +1,406 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//testing/test.gni") +import("//chrome/test/base/js2gtest.gni") +import("chromevox.gni") + +assert(is_chromeos) + +declare_args() { + # Whether to compress the main Chromevox javascript files or load the + # modules individually from source files. + chromevox_compress_js = !is_debug +} + +chromevox_out_dir = "$root_out_dir/resources/chromeos/chromevox" + +group("chromevox") { + deps = [ + ":chromevox_copied_files", + ":chromevox_guest_manifest", + ":chromevox_manifest", + "//chrome/browser/resources/chromeos/braille_ime:braille_ime_manifest", + "//chrome/browser/resources/chromeos/chromevox/strings:chromevox_strings", + "//chrome/third_party/chromevox:chromevox_third_party_resources", + ] + if (enable_nacl) { + deps += [ "//third_party/liblouis" ] + } + if (chromevox_compress_js) { + deps += [ + ":chromevox_background_script", + ":chromevox_content_script", + ":chromevox_kbexplorer_script", + ":chromevox_min_content_script", + ":chromevox_options_script", + ":chromevox_panel_script", + ] + } else { + deps += [ ":chromevox_deps_js" ] + } +} + +template("run_jsbundler") { + assert(defined(invoker.mode)) + assert(defined(invoker.sources)) + if (defined(invoker.modules)) { + modules = invoker.modules + } else { + modules = [] + } + if (defined(invoker.rewrite_rules)) { + rewrite_rules = invoker.rewrite_rules + } else { + rewrite_rules = [] + } + action(target_name) { + script = "tools/jsbundler.py" + inputs = jsbundler_modules + sources = invoker.sources + if (defined(invoker.output_file)) { + if (defined(invoker.modules)) { + depfile = "$target_out_dir/" + + get_path_info(invoker.output_file, "name") + ".d" + } + outputs = [ + invoker.output_file, + ] + } else { + assert(!defined(invoker.modules)) + stampfile = "$target_out_dir/${target_name}_copy.stamp" + outputs = [ + stampfile, + ] + } + args = [ + "-m", + invoker.mode, + ] + if (defined(depfile)) { + args += [ + "--depfile", + rebase_path(depfile, root_build_dir), + ] + } + if (defined(stampfile)) { + args += [ + "--stampfile", + rebase_path(stampfile, root_build_dir), + ] + } + if (defined(invoker.output_file)) { + args += [ + "-o", + rebase_path(invoker.output_file, root_build_dir), + ] + } + if (defined(invoker.dest_dir)) { + args += [ + "-d", + rebase_path(invoker.dest_dir, root_build_dir), + ] + } + foreach(module, modules) { + args += [ + "-M", + rebase_path(module, root_build_dir), + ] + } + foreach(rule, rewrite_rules) { + args += [ + "-w", + rule, + ] + } + args += rebase_path(sources, root_build_dir) + } +} + +chromevox_assets_gypi_values = + exec_script("//build/gypi_to_gn.py", + [ rebase_path("chromevox_assets.gypi") ], + "scope", + [ "chromevox_assets.gypi" ]) + +chromevox_vars_gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("chromevox_vars.gypi") ], + "scope", + [ "chromevox_vars.gypi" ]) + +# Instead of setting up one copy target for each subdirectory, use a script +# to copy all files. +run_jsbundler("chromevox_copied_files") { + mode = "copy" + dest_dir = chromevox_out_dir + sources = chromevox_assets_gypi_values.chromevox_assets_images + sources += + chromevox_assets_gypi_values.chromevox_assets_chromevox_background_earcons + sources += + chromevox_assets_gypi_values.chromevox_assets_chromevox_background_keymaps + sources += chromevox_assets_gypi_values.chromevox_assets_chromevox_background_mathmaps_functions + sources += chromevox_assets_gypi_values.chromevox_assets_chromevox_background_mathmaps_symbols + sources += + chromevox_assets_gypi_values.chromevox_assets_cvox2_background_earcons + sources += [ + "chromevox/background/background.html", + "chromevox/background/kbexplorer.html", + "chromevox/background/options.html", + "chromevox/injected/api.js", + "cvox2/background/background.html", + "cvox2/background/panel.css", + "cvox2/background/panel.html", + ] + if (chromevox_compress_js) { + sources += [ "chromevox/injected/api_util.js" ] + } else { + sources += chromevox_modules + sources += [ + "closure/closure_preinit.js", + chromevox_vars_gypi_values.chromevox_content_script_loader_file, + chromevox_vars_gypi_values.chromevox_kbexplorer_loader_file, + chromevox_vars_gypi_values.chromevox_options_script_loader_file, + chromevox_vars_gypi_values.chromevox_background_script_loader_file, + chromevox_vars_gypi_values.chromevox_min_content_script_loader_file, + chromevox_vars_gypi_values.chromevox_panel_script_loader_file, + ] + } + if (!chromevox_compress_js) { + sources += closure_library_modules + } + rewrite_rules = [ + rebase_path(".", root_build_dir) + ":", + rebase_path(closure_library_dir, root_build_dir) + ":closure", + ] +} + +template("manifest") { + version_file = "//chrome/VERSION" + version_script = "//build/util/version.py" + template_file = "manifest.json.jinja2" + output_file = invoker.output_file + key = chromevox_vars_gypi_values.chromevox_extension_key + action(target_name) { + script = "tools/generate_manifest.py" + inputs = [ + version_file, + version_script, + ] + sources = [ + template_file, + ] + outputs = [ + output_file, + ] + args = [ + "--key=$key", + "--version_file=" + rebase_path(version_file, root_build_dir), + "--output_manifest=" + rebase_path(output_file, root_build_dir), + ] + if (defined(invoker.is_guest_manifest) && invoker.is_guest_manifest) { + args += [ "--is_guest_manifest=1" ] + } + if (!chromevox_compress_js) { + args += [ "--is_js_compressed=0" ] + } + args += rebase_path(sources, root_build_dir) + } +} + +manifest("chromevox_manifest") { + output_file = "$chromevox_out_dir/manifest.json" +} + +manifest("chromevox_guest_manifest") { + output_file = "$chromevox_out_dir/manifest_guest.json" + is_guest_manifest = true +} + +template("generate_deps_js") { + if (defined(invoker.rewrite_rules)) { + rewrite_rules = invoker.rewrite_rules + } else { + rewrite_rules = [] + } + action(target_name) { + if (defined(invoker.testonly)) { + testonly = invoker.testonly + } + script = "tools/generate_deps.py" + inputs = jsbundler_modules + sources = invoker.sources + outputs = [ + invoker.output_file, + ] + args = [ + "-o", + rebase_path(invoker.output_file, root_build_dir), + ] + foreach(rule, rewrite_rules) { + args += [ + "-w", + rule, + ] + } + args += rebase_path(sources, root_build_dir) + if (defined(invoker.deps)) { + deps = invoker.deps + } + } +} + +if (chromevox_compress_js) { + template("compress_js") { + run_jsbundler(target_name) { + assert(defined(invoker.output_file)) + mode = "compressed_bundle" + modules = chromevox_modules + closure_library_modules + sources = invoker.sources + output_file = invoker.output_file + } + } + + compress_js("chromevox_content_script") { + sources = [ + chromevox_vars_gypi_values.chromevox_content_script_loader_file, + ] + output_file = "$chromevox_out_dir/chromeVoxChromePageScript.js" + } + + compress_js("chromevox_kbexplorer_script") { + sources = [ + chromevox_vars_gypi_values.chromevox_kbexplorer_loader_file, + ] + output_file = "$chromevox_out_dir/chromeVoxKbExplorerScript.js" + } + + compress_js("chromevox_options_script") { + sources = [ + chromevox_vars_gypi_values.chromevox_options_script_loader_file, + ] + output_file = "$chromevox_out_dir/chromeVoxChromeOptionsScript.js" + } + + compress_js("chromevox_background_script") { + sources = [ + chromevox_vars_gypi_values.chromevox_background_script_loader_file, + ] + output_file = "$chromevox_out_dir/chromeVox2ChromeBackgroundScript.js" + } + + compress_js("chromevox_min_content_script") { + sources = [ + chromevox_vars_gypi_values.chromevox_min_content_script_loader_file, + ] + output_file = "$chromevox_out_dir/chromeVox2ChromePageScript.js" + } + + compress_js("chromevox_panel_script") { + sources = [ + chromevox_vars_gypi_values.chromevox_panel_script_loader_file, + ] + output_file = "$chromevox_out_dir/chromeVoxPanelScript.js" + } +} else { + generate_deps_js("chromevox_deps_js") { + sources = chromevox_modules + closure_library_modules + output_file = "$chromevox_out_dir/deps.js" + rewrite_rules = [ + rebase_path(".", root_build_dir) + ":..", + rebase_path(closure_library_dir, root_build_dir) + ":../closure", + ] + } +} + +chromevox_tests_gypi_values = + exec_script("//build/gypi_to_gn.py", + [ rebase_path("chromevox_tests.gypi") ], + "scope", + [ "chromevox_tests.gypi" ]) + +test("chromevox_tests") { + sources = chromevox_tests_gypi_values.chromevox_tests_sources + + deps = [ + ":chromevox_extjs_tests", + ":chromevox_unitjs_tests", + "//base", + "//base:i18n", + "//base/test:test_support", + "//chrome:browser_tests_pak", + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/browser", + "//chrome/renderer", + "//chrome/test:test_support", + "//chrome/test:test_support_ui", + "//content/test:browsertest_base", + "//testing/gmock", + "//testing/gtest", + ] +} + +action("chromevox_test_messages_js") { + script = "tools/generate_test_messages.py" + sources = [ + "$chromevox_out_dir/_locales/en/messages.json", + ] + output_file = "$root_out_dir/test_data/chrome/browser/resources/chromeos/chromevox/host/testing/test_messages.js" + outputs = [ + output_file, + ] + deps = [ + "strings:chromevox_strings", + ] + args = [ + "-o", + rebase_path(output_file, root_build_dir), + ] + rebase_path(sources, root_build_dir) +} + +chromevox_test_modules = [ + "host/testing/earcons.js", + "host/testing/host.js", + "host/testing/mathjax.js", + "host/testing/tts.js", + "testing/spoken_list_builder.js", + "testing/test_msgs.js", + "testing/tester.js", + ] + get_target_outputs(":chromevox_test_messages_js") + +generate_deps_js("chromevox_test_deps_js") { + sources = closure_library_modules + chromevox_modules + chromevox_test_modules + output_file = "$target_gen_dir/test_deps.js" + rewrite_rules = [ + rebase_path("//", root_build_dir) + ":", + rebase_path("$root_out_dir/test_data", root_build_dir) + ":", + ] + deps = [ + ":chromevox_test_messages_js", + ] +} + +js2gtest("chromevox_unitjs_tests") { + test_type = "webui" + sources = chromevox_tests_gypi_values.chromevox_tests_unitjs_sources + gen_include_files = + chromevox_tests_gypi_values.chromevox_tests_unit_gen_include_sources + test_deps_js_outputs = get_target_outputs(":chromevox_test_deps_js") + deps_js = test_deps_js_outputs[0] + deps = [ + ":chromevox_test_deps_js", + ] + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] +} + +js2gtest("chromevox_extjs_tests") { + test_type = "extension" + sources = chromevox_tests_gypi_values.chromevox_tests_extjs_sources + gen_include_files = + chromevox_tests_gypi_values.chromevox_tests_ext_gen_include_sources + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] +} diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox.gni b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox.gni new file mode 100644 index 00000000000..75ed2c765ec --- /dev/null +++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox.gni @@ -0,0 +1,222 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# Common variables shared amongst all ChromeVox targets. + +assert(is_chromeos) + +# TODO(plundblad): Move the below variables to BUILD.gn when crbug.com/395883 +# is resolved. + +closure_library_dir = + "//chrome/third_party/chromevox/third_party/closure-library/closure/goog" + +jsbundler_modules = rebase_path([ + "depstree.py", + "source.py", + "treescan.py", + ], + ".", + "$closure_library_dir/../bin/build") +jsbundler_modules += + [ "//third_party/WebKit/Source/devtools/scripts/rjsmin.py" ] + +# List of all modules that are included in one or more of the production +# chromevox scripts. +chromevox_modules = [ + "braille/braille_display_manager.js", + "braille/braille_input_handler.js", + "braille/braille_key_types.js", + "braille/braille_table.js", + "braille/braille_translator_manager.js", + "braille/expanding_braille_translator.js", + "braille/liblouis.js", + "braille/nav_braille.js", + "braille/pan_strategy.js", + "braille/spans.js", + "chromevox/background/background.js", + "chromevox/background/braille_captions_background.js", + "chromevox/background/injected_script_loader.js", + "chromevox/background/kbexplorer.js", + "chromevox/background/keymaps/key_map.js", + "chromevox/background/mathmaps/math_map.js", + "chromevox/background/options.js", + "chromevox/background/prefs.js", + "chromevox/background/tabs_api_handler.js", + "chromevox/injected/active_indicator.js", + "chromevox/injected/api_implementation.js", + "chromevox/injected/api_util.js", + "chromevox/injected/console_tts.js", + "chromevox/injected/event_suspender.js", + "chromevox/injected/event_watcher.js", + "chromevox/injected/history.js", + "chromevox/injected/init_document.js", + "chromevox/injected/init_globals.js", + "chromevox/injected/initial_speech.js", + "chromevox/injected/keyboard_handler.js", + "chromevox/injected/live_regions.js", + "chromevox/injected/navigation_history.js", + "chromevox/injected/navigation_manager.js", + "chromevox/injected/navigation_shifter.js", + "chromevox/injected/navigation_speaker.js", + "chromevox/injected/node_breadcrumb.js", + "chromevox/injected/script_installer.js", + "chromevox/injected/serializer.js", + "chromevox/injected/ui/braille_overlay_widget.js", + "chromevox/injected/ui/context_menu_widget.js", + "chromevox/injected/ui/keyboard_help_widget.js", + "chromevox/injected/ui/node_search_widget.js", + "chromevox/injected/ui/overlay_widget.js", + "chromevox/injected/ui/search_widget.js", + "chromevox/injected/ui/select_widget.js", + "chromevox/injected/ui/spoken_messages.js", + "chromevox/injected/ui/widget.js", + "chromevox/injected/user_commands.js", + "chromevox/injected/user_event_detail.js", + "common/aria_util.js", + "common/aural_style_util.js", + "common/braille_text_handler.js", + "common/braille_util.js", + "common/buildinfo.js", + "common/chromevox.js", + "common/chromevox_json.js", + "common/command_store.js", + "common/composite_tts.js", + "common/content_editable_extractor.js", + "common/cursor.js", + "common/cursor_selection.js", + "common/date_widget.js", + "common/description_util.js", + "common/dom_predicates.js", + "common/dom_util.js", + "common/earcon_util.js", + "common/editable_text.js", + "common/editable_text_area_shadow.js", + "common/editable_text_base.js", + "common/find_util.js", + "common/focus_util.js", + "common/focuser.js", + "common/group_util.js", + "common/interframe.js", + "common/key_sequence.js", + "common/key_util.js", + "common/math_semantic_attr.js", + "common/math_semantic_tree.js", + "common/math_semantic_util.js", + "common/math_util.js", + "common/media_widget.js", + "common/memoize.js", + "common/msgs.js", + "common/nav_description.js", + "common/nav_math_description.js", + "common/node_state.js", + "common/page_selection.js", + "common/platform_util.js", + "common/selection_util.js", + "common/spannable.js", + "common/string_util.js", + "common/table_util.js", + "common/time_widget.js", + "common/traverse_content.js", + "common/traverse_math.js", + "common/traverse_table.js", + "common/traverse_util.js", + "common/xpath_util.js", + "cvox2/background/automation_object_constructor_installer.js", + "cvox2/background/automation_predicate.js", + "cvox2/background/automation_util.js", + "cvox2/background/background.js", + "cvox2/background/base_automation_handler.js", + "cvox2/background/chromevox_state.js", + "cvox2/background/constants.js", + "cvox2/background/cursors.js", + "cvox2/background/desktop_automation_handler.js", + "cvox2/background/earcon_engine.js", + "cvox2/background/editing.js", + "cvox2/background/i_search.js", + "cvox2/background/live_regions.js", + "cvox2/background/next_earcons.js", + "cvox2/background/notifications.js", + "cvox2/background/output.js", + "cvox2/background/panel.js", + "cvox2/background/panel_command.js", + "cvox2/background/panel_menu.js", + "cvox2/background/panel_menu_item.js", + "cvox2/background/stubs.js", + "cvox2/background/tabs_automation_handler.js", + "cvox2/background/tree_walker.js", + "cvox2/background/tutorial.js", + "cvox2/injected/keyboard_handler.js", + "cvox2/injected/loader.js", + "extensions/searchvox/abstract_result.js", + "extensions/searchvox/constants.js", + "extensions/searchvox/context_menu.js", + "extensions/searchvox/loader.js", + "extensions/searchvox/results.js", + "extensions/searchvox/search.js", + "extensions/searchvox/search_tools.js", + "extensions/searchvox/util.js", + "host/chrome/braille.js", + "host/chrome/braille_background.js", + "host/chrome/classic_earcons.js", + "host/chrome/earcons.js", + "host/chrome/extension_bridge.js", + "host/chrome/host.js", + "host/chrome/mathjax.js", + "host/chrome/tts.js", + "host/chrome/tts_background.js", + "host/chrome/tts_base.js", + "host/interface/abstract_earcons.js", + "host/interface/abstract_host.js", + "host/interface/abstract_mathjax.js", + "host/interface/abstract_tts.js", + "host/interface/braille_interface.js", + "host/interface/host_factory.js", + "host/interface/mathjax_interface.js", + "host/interface/tts_interface.js", + "speech_rules/base_rule_store.js", + "speech_rules/math_simple_store.js", + "speech_rules/math_store.js", + "speech_rules/mathml_store.js", + "speech_rules/mathml_store_rules.js", + "speech_rules/mathml_store_util.js", + "speech_rules/speech_rule.js", + "speech_rules/speech_rule_engine.js", + "speech_rules/speech_rule_evaluator.js", + "speech_rules/speech_rule_functions.js", + "speech_rules/speech_rule_store.js", + "speech_rules/store_util.js", + "walkers/abstract_node_walker.js", + "walkers/abstract_selection_walker.js", + "walkers/abstract_shifter.js", + "walkers/abstract_walker.js", + "walkers/bare_object_walker.js", + "walkers/character_walker.js", + "walkers/column_walker.js", + "walkers/group_walker.js", + "walkers/layout_line_walker.js", + "walkers/math_shifter.js", + "walkers/object_walker.js", + "walkers/row_walker.js", + "walkers/sentence_walker.js", + "walkers/structural_line_walker.js", + "walkers/table_shifter.js", + "walkers/table_walker.js", + "walkers/word_walker.js", +] + +# Closure library modules neede by chromevox. +relative_closure_library_modules = [ + "i18n/pluralrules.js", + "i18n/ordinalrules.js", + "i18n/messageformat.js", + "string/string.js", + "dom/nodetype.js", + "base.js", + "asserts/asserts.js", + "debug/error.js", + "object/object.js", +] + +closure_library_modules = + rebase_path(relative_closure_library_modules, ".", closure_library_dir) diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/strings/BUILD.gn b/chromium/chrome/browser/resources/chromeos/chromevox/strings/BUILD.gn new file mode 100644 index 00000000000..9a7f8566756 --- /dev/null +++ b/chromium/chrome/browser/resources/chromeos/chromevox/strings/BUILD.gn @@ -0,0 +1,71 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +chromevox_out_dir = "$root_out_dir/resources/chromeos/chromevox" + +grit("chromevox_strings") { + source = "chromevox_strings.grd" + outputs = [ + "_locales/am/messages.json", + "_locales/ar/messages.json", + "_locales/bg/messages.json", + "_locales/bn/messages.json", + "_locales/ca/messages.json", + "_locales/cs/messages.json", + "_locales/da/messages.json", + "_locales/de/messages.json", + "_locales/el/messages.json", + "_locales/en_GB/messages.json", + "_locales/en/messages.json", + "_locales/es/messages.json", + "_locales/es_419/messages.json", + "_locales/et/messages.json", + "_locales/fa/messages.json", + "_locales/fi/messages.json", + "_locales/fil/messages.json", + "_locales/fr/messages.json", + "_locales/gu/messages.json", + "_locales/he/messages.json", + "_locales/hi/messages.json", + "_locales/hr/messages.json", + "_locales/hu/messages.json", + "_locales/id/messages.json", + "_locales/it/messages.json", + "_locales/ja/messages.json", + "_locales/kn/messages.json", + "_locales/ko/messages.json", + "_locales/lt/messages.json", + "_locales/lv/messages.json", + "_locales/ml/messages.json", + "_locales/mr/messages.json", + "_locales/ms/messages.json", + "_locales/nl/messages.json", + "_locales/nb/messages.json", + "_locales/pl/messages.json", + "_locales/pt_BR/messages.json", + "_locales/pt_PT/messages.json", + "_locales/ro/messages.json", + "_locales/ru/messages.json", + "_locales/sk/messages.json", + "_locales/sl/messages.json", + "_locales/sr/messages.json", + "_locales/sv/messages.json", + "_locales/sw/messages.json", + "_locales/ta/messages.json", + "_locales/te/messages.json", + "_locales/th/messages.json", + "_locales/tr/messages.json", + "_locales/uk/messages.json", + "_locales/vi/messages.json", + "_locales/zh_CN/messages.json", + "_locales/zh_TW/messages.json", + ] + output_dir = chromevox_out_dir + + # Don't polute the extension directory with stamp and .d files. + depfile_dir = target_out_dir + resource_ids = "" +} diff --git a/chromium/chrome/browser/safe_browsing/BUILD.gn b/chromium/chrome/browser/safe_browsing/BUILD.gn new file mode 100644 index 00000000000..241e227921c --- /dev/null +++ b/chromium/chrome/browser/safe_browsing/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_browser.gypi:safe_browsing_chunk_proto +proto_library("chunk_proto") { + sources = [ + "chunk.proto", + ] +} diff --git a/chromium/chrome/browser/safe_browsing/incident_reporting/BUILD.gn b/chromium/chrome/browser/safe_browsing/incident_reporting/BUILD.gn new file mode 100644 index 00000000000..d8ec0ef8438 --- /dev/null +++ b/chromium/chrome/browser/safe_browsing/incident_reporting/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_browser.gypi:incident_reporting_state_store_data_proto +proto_library("state_store_data_proto") { + sources = [ + "state_store_data.proto", + ] +} diff --git a/chromium/chrome/browser/safe_browsing/incident_reporting/verifier_test/BUILD.gn b/chromium/chrome/browser/safe_browsing/incident_reporting/verifier_test/BUILD.gn new file mode 100644 index 00000000000..be7f890c615 --- /dev/null +++ b/chromium/chrome/browser/safe_browsing/incident_reporting/verifier_test/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_win) + +shared_library("verifier_test_dll_1") { + testonly = true + sources = [ + "verifier_test_dll.cc", + "verifier_test_dll_1.def", + ] + + # Unconditionally disable incremental linking for these modules so that + # their exports do not go through an ILT jmp stub. + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += [ "//build/config/win:no_incremental_linking" ] +} + +shared_library("verifier_test_dll_2") { + testonly = true + sources = [ + "verifier_test_dll.cc", + "verifier_test_dll_2.def", + ] + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += [ "//build/config/win:no_incremental_linking" ] +} diff --git a/chromium/chrome/browser/sync_file_system/drive_backend/BUILD.gn b/chromium/chrome/browser/sync_file_system/drive_backend/BUILD.gn new file mode 100644 index 00000000000..c1661cf01d6 --- /dev/null +++ b/chromium/chrome/browser/sync_file_system/drive_backend/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_browser.gypi:sync_file_system_drive_proto +proto_library("sync_file_system_drive_proto") { + sources = [ + "metadata_database.proto", + ] +} diff --git a/chromium/chrome/browser/ui/BUILD.gn b/chromium/chrome/browser/ui/BUILD.gn new file mode 100644 index 00000000000..3146b7fbbb7 --- /dev/null +++ b/chromium/chrome/browser/ui/BUILD.gn @@ -0,0 +1,716 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/crypto.gni") +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//build/split_static_library.gni") +import("//chrome/common/features.gni") + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("../../chrome_browser_ui.gypi") ], + "scope", + [ "../../chrome_browser_ui.gypi" ]) + +config("ui_warnings") { + if (is_clang) { + # TODO(thakis): Remove this once http://crbug.com/383820 is figured out + cflags = [ "-Wno-nonnull" ] + } +} + +# Use a static library here because many test binaries depend on this but don't +# require many files from it. This makes linking more efficient. +split_static_library("ui") { + # Split into multiple static libraries on Windows official builds, where we + # run into a 2GB max size limit. + if (is_win && is_official_build) { + split_count = 5 + } else { + split_count = 1 + } + + sources = [] + defines = [] + libs = [] + + configs += [ + ":ui_warnings", + "//build/config:precompiled_headers", + "//build/config/compiler:wexit_time_destructors", + "//third_party/WebKit/public:debug_devtools", + ] + + # Since browser and browser_ui actually depend on each other, + # we must omit the dependency from browser_ui to browser. + # However, this means browser_ui and browser should more or less + # have the same dependencies. Once browser_ui is untangled from + # browser, then we can clean up these dependencies. + public_deps = [ + "//components/dom_distiller/core", + "//content/public/browser", + "//sync", + ] + deps = [ + # NOTE: New dependencies should generally be added in the OS!="ios" + # dependencies block below, rather than here. + "//base", + "//chrome:extra_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/app/resources:platform_locale_settings", + "//chrome/app/theme:theme_resources", + "//chrome/common", + "//components/app_modal", + "//components/autofill/core/browser", + "//components/bookmarks/browser", + "//components/browser_sync/browser", + "//components/certificate_reporting:cert_logger_proto", + "//components/certificate_reporting:encrypted_cert_logger_proto", + "//components/content_settings/core/browser", + "//components/data_reduction_proxy/core/browser", + "//components/device_event_log", + "//components/dom_distiller/content/browser", + "//components/dom_distiller/webui", + "//components/domain_reliability", + "//components/favicon/content", + "//components/favicon/core", + "//components/feedback", + "//components/flags_ui", + "//components/gcm_driver", + "//components/google/core/browser", + "//components/guest_view/browser", + "//components/history/core/browser", + "//components/infobars/core", + "//components/invalidation/impl", + "//components/keyed_service/content", + "//components/keyed_service/core", + "//components/metrics:profiler", + "//components/mime_util", + "//components/omnibox/browser", + "//components/onc", + "//components/password_manager/content/browser", + "//components/password_manager/core/browser", + "//components/pdf/browser", + "//components/policy", + "//components/pref_registry", + "//components/proximity_auth", + "//components/proxy_config", + "//components/query_parser", + "//components/rappor", + "//components/renderer_context_menu", + "//components/resources", + "//components/search", + "//components/search_engines", + "//components/security_interstitials/core", + "//components/security_state", + "//components/signin/core/account_id", + "//components/signin/core/browser", + "//components/ssl_errors", + "//components/startup_metric_utils/browser:lib", + "//components/strings", + "//components/sync_driver", + "//components/sync_sessions", + "//components/toolbar", + "//components/translate/core/browser", + "//components/update_client", + "//components/upload_list", + "//components/user_prefs", + "//components/version_ui", + "//components/web_resource", + "//components/zoom", + "//content/public/common", + "//crypto", + "//device/core", + "//services/shell/runner/common", + "//skia", + "//third_party/cacheinvalidation", + "//third_party/icu", + "//third_party/zlib", + "//ui/accessibility", + "//ui/base", + "//ui/content_accelerators", + "//ui/display", + "//ui/events", + "//ui/events:gesture_detection", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/message_center", + "//ui/native_theme", + "//ui/resources", + "//ui/shell_dialogs", + "//ui/snapshot", + "//ui/strings", + ] + + if (enable_extensions) { + deps += [ "//extensions/browser" ] + } + + if (!is_ios) { + sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources, + ".", + "//chrome") + sources += rebase_path(gypi_values.chrome_browser_ui_toolbar_model_sources, + ".", + "//chrome") + deps += [ + "//chrome/browser/devtools", + "//chrome/browser/ui/views", + "//chrome/browser/ui/webui/engagement:mojo_bindings", + "//chrome/browser/ui/webui/omnibox:mojo_bindings", + "//chrome/browser/ui/webui/plugins:mojo_bindings", + "//chrome/common/net", + "//chrome/installer/util:with_no_strings", + "//components/autofill/content/browser:risk_proto", + "//components/browsing_data_ui", + "//components/bubble:bubble", + "//components/crash/core/browser", + "//components/net_log", + "//components/page_load_metrics/browser", + "//components/power", + "//components/suggestions/proto", + "//components/url_formatter", + "//device/nfc", + "//media", + "//net:net_with_v8", + "//net:stale_while_revalidate_experiment_domains", + "//storage/browser", + "//storage/common", + "//third_party/WebKit/public:resources", + "//third_party/adobe/flash:flapper_version_h", + "//third_party/brotli", + "//third_party/leveldatabase", + "//third_party/libjingle", + "//third_party/re2", + "//ui/base/ime", + "//ui/compositor", + "//ui/surface", + "//ui/web_dialogs", + "//v8", + ] + } else { + # iOS. + sources += + rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome") + deps += [ "//net" ] + } + + if (!android_java_ui && !is_ios) { + sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources, + ".", + "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources, + ".", + "//chrome") + deps += [ + "//chrome/browser/profile_resetter:profile_reset_report_proto", + "//chrome/common:features", + "//components/chooser_controller:chooser_controller", + "//components/copresence", + "//components/feedback/proto", + "//components/proximity_auth/webui", + "//device/bluetooth", + ] + } + + if (use_aura) { + defines += [ "MOJO_RUNNER_CLIENT" ] + } + + if (enable_basic_printing || enable_print_preview) { + deps += [ "//printing" ] + } + + if (enable_nacl) { + sources += + rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome") + deps += [ "//native_client/src/trusted/service_runtime:sel" ] + } + if (enable_plugins) { + sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources, + ".", + "//chrome") + deps += [ "//ppapi/proxy:ipc" ] + } + if (safe_browsing_mode == 1) { + deps += [ + "//chrome/browser/safe_browsing:chunk_proto", + "//chrome/common/safe_browsing:proto", + ] + } + + if (is_chromeos && !is_official_build) { + sources += + rebase_path(gypi_values.chrome_browser_ui_chromeos_non_official_sources, + ".", + "//chrome") + } + + if (is_chromeos) { + sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources, + ".", + "//chrome") + deps += [ + "//chrome/browser/chromeos", + "//components/arc", + "//ui/base/ime", + ] + } + if (use_cups) { + configs += [ "//printing:cups" ] + } + if (use_ash) { + sources += + rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome") + sources += [ + "ash/app_list/app_list_presenter_service.cc", + "ash/app_list/app_list_presenter_service.h", + "ash/chrome_wallpaper_manager.cc", + "ash/chrome_wallpaper_manager.h", + "ash/keyboard_ui_service.cc", + "ash/keyboard_ui_service.h", + "ash/launcher/chrome_launcher_controller_mus.cc", + "ash/launcher/chrome_launcher_controller_mus.h", + "ash/launcher/chrome_mash_shelf_controller.cc", + "ash/launcher/chrome_mash_shelf_controller.h", + ] + deps += [ + "//ash", + "//ash:ash_with_content", + "//ash/strings", + "//ash/sysui/public/interfaces", + "//components/user_manager", + "//mash/shelf/public/interfaces", + "//ui/app_list/presenter", + "//ui/app_list/presenter:mojom", + "//ui/keyboard:mojom", + ] + } else { # Not ash. + sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources, + ".", + "//chrome") + } + if (toolkit_views) { + sources += rebase_path(gypi_values.chrome_browser_ui_views_sources, + ".", + "//chrome") + deps += [ "//components/constrained_window" ] + + if (enable_extensions) { + deps += [ "//extensions/components/native_app_window" ] + } + + if (is_chromeos) { + sources += + rebase_path(gypi_values.chrome_browser_ui_views_chromeos_sources, + ".", + "//chrome") + } else if (!is_mac || mac_views_browser) { + sources += + rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources, + ".", + "//chrome") + } + if (!is_mac) { + sources += + rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources, + ".", + "//chrome") + if (use_aura) { + deps += [ + "//components/mus/public/cpp", + "//components/mus/public/interfaces", + ] + } + if (enable_extensions) { + sources += rebase_path( + gypi_values.chrome_browser_ui_views_extensions_non_mac_sources, + ".", + "//chrome") + } + } + if (use_ash) { + sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources, + ".", + "//chrome") + } + } else { + # !toolkit_views + if (!is_ios) { + deps -= [ "//chrome/browser/ui/views" ] + } + } + if (use_aura && !use_ozone && is_desktop_linux) { + deps += [ + "//build/linux/libgio", + + # gtk2 is the only component that can interact with gtk2 in our new + # world. + "//chrome/browser/ui/libgtk2ui", + ] + } + if (is_win || is_mac || is_desktop_linux) { + sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources, + ".", + "//chrome") + if (is_mac && !mac_views_browser) { + sources -= [ + # This is not explicitly excluded in GYP, but I think the static + # library linking rules means it's never referenced when compiling in + # non-Views mode on Mac. It appears not to link in that case. + "views/frame/avatar_button_manager.cc", + "views/frame/avatar_button_manager.h", + "views/profiles/new_avatar_button.cc", + "views/profiles/new_avatar_button.h", + ] + } + } + if (use_aura) { + sources += + rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome") + deps += [ + # aura uses some of ash resources. + "//ash/resources", + "//ui/aura", + "//ui/keyboard", + "//ui/keyboard:keyboard_with_content", + "//ui/keyboard:resources", + "//ui/wm", + ] + defines += [ "MOJO_SHELL_CLIENT" ] + if (!is_chromeos) { + sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos, + ".", + "//chrome") + } + } + if (ui_compositor_image_transport) { + deps += [ "//ui/gl" ] + } + if (use_nss_certs) { + sources += + rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome") + } + if (is_mac || is_win) { + sources += rebase_path(gypi_values.chrome_browser_ui_non_nss_sources, + ".", + "//chrome") + } + if (!enable_themes) { + sources -= [ "webui/theme_source.cc" ] + } + if (enable_print_preview) { + sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources, + ".", + "//chrome") + } + + if (is_android) { + deps += [ "//crypto:platform" ] + + if (android_java_ui) { + sources += + rebase_path(gypi_values.chrome_browser_ui_android_java_ui_sources, + ".", + "//chrome") + deps += [ + "//chrome/browser:jni_headers", + "//components/web_contents_delegate_android", + ] + deps -= [ "//ui/events" ] + } + } + + if (is_mac) { + sources += + rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome") + deps += [ + ":generate_localizer", + "//third_party/apple_sample_code", + "//third_party/google_toolbox_for_mac", + "//third_party/molokocacao", + "//third_party/mozilla", + "//ui/accelerated_widget_mac:accelerated_widget_mac", + ] + if (mac_views_browser) { + sources += rebase_path( + gypi_values.chrome_browser_ui_views_mac_experimental_sources, + ".", + "//chrome") + sources += + rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources, + ".", + "//chrome") + sources += rebase_path( + gypi_values.chrome_browser_ui_views_extensions_non_mac_sources, + ".", + "//chrome") + + sources -= [ + "views/extensions/extension_popup_aura.cc", + "views/extensions/extension_popup_aura.h", + ] + + deps += [ "//extensions/components/native_app_window" ] + } else { + sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources, + ".", + "//chrome") + } + include_dirs = [ "$target_gen_dir" ] + libs += [ + "Carbon.framework", + "Quartz.framework", + ] + } else { # non-Mac. + sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources, + ".", + "//chrome") + } + + if (is_win) { + sources += + rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome") + public_deps += [ + "//ui/views", + "//ui/views/controls/webview", + ] + deps += [ + "//chrome/installer/util:strings", + "//components/search_engines", + "//google_update", + "//third_party/iaccessible2", + "//third_party/isimpledom", + "//third_party/wtl", + "//ui/base/ime", + "//ui/events:dom_keycode_converter", + ] + if (!is_chrome_branded) { + deps -= [ "//google_update" ] + sources -= [ "webui/help/version_updater_win.cc" ] + sources += [ + "webui/help/version_updater_basic.cc", + "webui/help/version_updater_basic.h", + ] + } + if (enable_app_list) { + deps += [ "//ui/app_list" ] + } + } else { # 'OS!="win" + if (toolkit_views) { + public_deps += [ + "//ui/views", + "//ui/views/controls/webview", + ] + } + } + if (is_desktop_linux) { + sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources, + ".", + "//chrome") + deps += [ + "//ui/base/ime", + "//ui/events:dom_keycode_converter", + ] + } + if (is_linux) { # Both desktop Linux and ChromeOS. + sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources, + ".", + "//chrome") + if (use_aura) { + deps += [ "//build/linux:fontconfig" ] + if (use_dbus) { + deps += [ "//dbus" ] + } + } + if (use_x11) { + sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources, + ".", + "//chrome") + configs += [ "//build/config/linux:x11" ] + deps += [ "//ui/events/devices" ] + if (is_chromeos) { + sources -= [ "views/tabs/window_finder_x11.cc" ] + } + } + } + + if (use_udev) { + deps += [ "//device/udev_linux" ] + } + + if (enable_app_list) { + sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources, + ".", + "//chrome") + if (is_chromeos) { + sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_arc_sources, + ".", + "//chrome") + } + if (is_desktop_linux) { + sources += + rebase_path(gypi_values.chrome_browser_ui_app_list_linux_sources, + ".", + "//chrome") + } + if (!is_mac && !use_ash) { + sources += + rebase_path(gypi_values.chrome_browser_ui_app_list_views_sources, + ".", + "//chrome") + } + deps += [ "//ui/app_list" ] + } else { + sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources, + ".", + "//chrome") + } + if (!android_java_ui && !is_ios) { + deps += [ + "//third_party/libaddressinput", + "//third_party/libaddressinput:strings", + ] + } + if (enable_extensions) { + deps += [ + "//chrome/browser/extensions", + "//chrome/common/extensions/api", + "//chrome/common/extensions/api:api_registration", + ] + sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources, + ".", + "//chrome") + } + if (enable_google_now && !is_android) { + sources += rebase_path( + gypi_values.chrome_browser_ui_google_now_non_android_sources, + ".", + "//chrome") + } + if (enable_media_router && !is_android && !is_ios) { + sources += rebase_path(gypi_values.chrome_browser_ui_media_router_sources, + ".", + "//chrome") + if (is_mac && !mac_views_browser) { + sources -= [ + # This file is compiled on GYP but never referenced on Mac. Since it's + # in a static library, it never gets pulled in and we never try to link + # it (it doesn't link). In GN, source sets force us to get this rule + # correct. + "views/toolbar/media_router_action_platform_delegate_views.cc", + "views/toolbar/media_router_action_platform_delegate_views.h", + ] + } + deps += [ "//chrome/browser/media/router" ] + } + if (enable_webrtc) { + sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources, + ".", + "//chrome") + } + if (enable_service_discovery) { + sources += + rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources, + ".", + "//chrome") + } +} + +if (is_mac) { + nib_gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("../../chrome_nibs.gypi") ], + "scope", + [ "../../chrome_nibs.gypi" ]) + + action("generate_localizer") { + script = "//chrome/tools/build/mac/generate_localizer" + sources = rebase_path(nib_gypi_values.mac_translated_xibs, ".", "//chrome") + table_path = "$target_gen_dir/ui_localizer_table.h" + outputs = [ + table_path, + ] + args = [ rebase_path(table_path, root_build_dir) ] + + rebase_path(nib_gypi_values.mac_translated_xibs, + root_build_dir, + "//chrome") + } +} + +# In GYP this is part of test_support_common. +static_library("test_support") { + testonly = true + + sources = [ + "browser.h", + "cocoa/cocoa_test_helper.h", + "cocoa/cocoa_test_helper.mm", + "cocoa/run_loop_testing.h", + "cocoa/run_loop_testing.mm", + "exclusive_access/fullscreen_controller_state_test.cc", + "exclusive_access/fullscreen_controller_state_test.h", + "exclusive_access/fullscreen_controller_state_tests.h", + "exclusive_access/fullscreen_controller_test.cc", + "exclusive_access/fullscreen_controller_test.h", + "find_bar/find_bar_host_unittest_util.h", + "login/login_handler_test_utils.cc", + "login/login_handler_test_utils.h", + "test/test_confirm_bubble_model.cc", + "test/test_confirm_bubble_model.h", + "toolbar/test_toolbar_action_view_controller.cc", + "toolbar/test_toolbar_action_view_controller.h", + ] + + if (!is_ios && !is_android) { + sources += [ + "passwords/manage_passwords_ui_controller_mock.cc", + "passwords/manage_passwords_ui_controller_mock.h", + "passwords/password_dialog_controller_mock.cc", + "passwords/password_dialog_controller_mock.h", + "website_settings/mock_permission_bubble_request.cc", + "website_settings/mock_permission_bubble_request.h", + ] + } + + if (toolkit_views && (!is_mac || mac_views_browser)) { + sources += [ + "views/find_bar_host_unittest_util_views.cc", + "views/toolbar/browser_action_test_util_views.cc", + ] + } else { + sources += [ + "cocoa/extensions/browser_action_test_util_mac.mm", + "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm", + ] + } + + if (is_android) { + sources -= [ + "exclusive_access/fullscreen_controller_state_test.cc", + "exclusive_access/fullscreen_controller_state_test.h", + "exclusive_access/fullscreen_controller_state_tests.h", + "exclusive_access/fullscreen_controller_test.cc", + "exclusive_access/fullscreen_controller_test.h", + "test/test_confirm_bubble_model.cc", + "test/test_confirm_bubble_model.h", + ] + } + + public_deps = [ + ":ui", + ] + deps = [ + "//chrome/app/theme:theme_resources", + "//chrome/browser", + "//content/public/browser", + "//content/public/common", + "//content/test:test_support", + "//net:test_support", + "//skia", + "//testing/gtest", + "//ui/base", + ] +} diff --git a/chromium/chrome/browser/ui/cocoa/notifications/BUILD.gn b/chromium/chrome/browser/ui/cocoa/notifications/BUILD.gn new file mode 100644 index 00000000000..57a45135210 --- /dev/null +++ b/chromium/chrome/browser/ui/cocoa/notifications/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("common") { + sources = [ + "notification_builder_mac.h", + "notification_builder_mac.mm", + "notification_constants_mac.h", + "notification_constants_mac.mm", + "notification_response_builder_mac.h", + "notification_response_builder_mac.mm", + ] + + deps = [ + "//base", + "//chrome:strings", + "//ui/base:base", + ] +} diff --git a/chromium/chrome/browser/ui/libgtk2ui/BUILD.gn b/chromium/chrome/browser/ui/libgtk2ui/BUILD.gn new file mode 100644 index 00000000000..a0d36e46933 --- /dev/null +++ b/chromium/chrome/browser/ui/libgtk2ui/BUILD.gn @@ -0,0 +1,132 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_linux, "This file should only be referenced on Linux") + +import("//build/config/features.gni") +import("//build/config/ui.gni") + +# gn orders flags on a target before flags from configs. The default config +# adds -Wall, and these flags have to be after -Wall -- so they need to come +# from a config and can't be on the target directly. +config("libgtk2ui_warnings") { + if (is_clang) { + cflags = [ + # G_DEFINE_TYPE automatically generates a *get_instance_private inline + # function after glib 2.37. That's unused. Prevent to complain about it. + "-Wno-unused-function", + + # G_STATIC_ASSERT uses a typedef as a static_assert. + "-Wno-unused-local-typedef", + ] + } +} + +component("libgtk2ui") { + sources = [ + "app_indicator_icon.cc", + "app_indicator_icon.h", + "app_indicator_icon_menu.cc", + "app_indicator_icon_menu.h", + "chrome_gtk_frame.cc", + "chrome_gtk_frame.h", + "chrome_gtk_menu_subclasses.cc", + "chrome_gtk_menu_subclasses.h", + "gtk2_event_loop.cc", + "gtk2_event_loop.h", + "gtk2_key_bindings_handler.cc", + "gtk2_key_bindings_handler.h", + "gtk2_status_icon.cc", + "gtk2_status_icon.h", + "gtk2_ui.cc", + "gtk2_ui.h", + "gtk2_util.cc", + "gtk2_util.h", + "libgtk2ui_export.h", + "menu_util.cc", + "menu_util.h", + "native_theme_gtk2.cc", + "native_theme_gtk2.h", + "print_dialog_gtk2.cc", + "print_dialog_gtk2.h", + "printing_gtk2_util.cc", + "printing_gtk2_util.h", + "select_file_dialog_impl.cc", + "select_file_dialog_impl.h", + "select_file_dialog_impl_gtk2.cc", + "select_file_dialog_impl_gtk2.h", + "select_file_dialog_impl_kde.cc", + "skia_utils_gtk2.cc", + "skia_utils_gtk2.h", + "unity_service.cc", + "unity_service.h", + "x11_input_method_context_impl_gtk2.cc", + "x11_input_method_context_impl_gtk2.h", + ] + + if (use_gconf) { + sources += [ + "gconf_listener.cc", + "gconf_listener.h", + ] + configs += [ "//build/config/linux/gconf" ] + } + defines = [ "LIBGTK2UI_IMPLEMENTATION" ] + + if (use_cups) { + configs += [ "//printing:cups" ] + } + + # GTK2 pulls pangoft2 as dependency, and pangoft2 depends on harfbuzz. + # To avoid missing indirectly referenced harfbuzz symbols from pango, + # some hack is required when bundled harfbuzz is used and component build is + # disabled. + # See crbug.com/462689 for details. + all_dependent_configs = [ "//third_party/harfbuzz-ng:pangoft2_link_hack" ] + + configs += [ + ":libgtk2ui_warnings", + "//build/config/linux:x11", + ] + + deps = [ + "//base", + "//base:i18n", + "//base/third_party/dynamic_annotations", + "//chrome:extra_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/app/theme:theme_resources", + "//components/resources", + "//content/public/browser", + "//printing", + "//skia", + "//ui/aura", + "//ui/base", + "//ui/base/ime", + "//ui/display", + "//ui/events", + "//ui/events:events_base", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gfx/x", + "//ui/native_theme", + "//ui/resources", + "//ui/shell_dialogs", + "//ui/strings", + "//ui/views", + ] + + if (use_gtk3) { + deps += [ + "//build/config/linux/gtk3", + "//build/config/linux/gtk3:gtkprint3", + ] + } else { + deps += [ + "//build/config/linux/gtk2", + "//build/config/linux/gtk2:gtkprint2", + ] + } +} diff --git a/chromium/chrome/browser/ui/views/BUILD.gn b/chromium/chrome/browser/ui/views/BUILD.gn new file mode 100644 index 00000000000..4cf4327ef24 --- /dev/null +++ b/chromium/chrome/browser/ui/views/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") + +assert(toolkit_views) + +component("views") { + output_name = "browser_ui_views" + sources = [ + "accelerator_table.cc", + "accelerator_table.h", + "chrome_views_export.h", + "event_utils.cc", + "event_utils.h", + "tab_icon_view_model.h", + "tabs/tab_renderer_data.cc", + "tabs/tab_renderer_data.h", + "tabs/tab_strip_observer.cc", + "tabs/tab_strip_observer.h", + "tabs/tab_strip_types.h", + ] + + defines = [ "CHROME_VIEWS_IMPLEMENTATION" ] + + deps = [ + "//base", + "//skia", + "//ui/base", + "//ui/events", + "//ui/gfx", + "//ui/gfx/geometry", + "//url", + ] + + if (use_ash) { + deps += [ "//ash" ] + } +} diff --git a/chromium/chrome/browser/ui/webui/engagement/BUILD.gn b/chromium/chrome/browser/ui/webui/engagement/BUILD.gn new file mode 100644 index 00000000000..87e75e6d4e0 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/engagement/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +# GYP version: chrome/chrome_web_ui_mojo_bindings.gyp:webui_mojo_bindings +mojom("mojo_bindings") { + sources = [ + "site_engagement.mojom", + ] + + public_deps = [ + "//url/mojo:url_mojom_gurl", + ] +} diff --git a/chromium/chrome/browser/ui/webui/engagement/site_engagement.mojom b/chromium/chrome/browser/ui/webui/engagement/site_engagement.mojom new file mode 100644 index 00000000000..a1ccb2ef8fe --- /dev/null +++ b/chromium/chrome/browser/ui/webui/engagement/site_engagement.mojom @@ -0,0 +1,17 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojom; + +import "url/mojo/url.mojom"; + +struct SiteEngagementInfo { + url.mojom.Url origin; + double score; +}; + +interface SiteEngagementUIHandler { + GetSiteEngagementInfo() => (array<SiteEngagementInfo> info); + SetSiteEngagementScoreForOrigin(url.mojom.Url origin, double score); +}; diff --git a/chromium/chrome/browser/ui/webui/omnibox/BUILD.gn b/chromium/chrome/browser/ui/webui/omnibox/BUILD.gn new file mode 100644 index 00000000000..a2815802ef6 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/omnibox/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +# GYP version: chrome/chrome_web_ui_mojo_bindings.gyp:webui_mojo_bindings +mojom("mojo_bindings") { + sources = [ + "omnibox.mojom", + ] +} diff --git a/chromium/chrome/browser/ui/webui/omnibox/omnibox.mojom b/chromium/chrome/browser/ui/webui/omnibox/omnibox.mojom new file mode 100644 index 00000000000..a7ccc4c32f1 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/omnibox/omnibox.mojom @@ -0,0 +1,62 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojom; + +// The structures here roughly mirror those from autocomplete. + +struct AutocompleteAdditionalInfo { + string key; + string value; +}; + +struct AutocompleteMatch { + string? provider_name; + // Only meaningful if |provider_name| is valid. + bool provider_done; + int32 relevance; + bool deletable; + string fill_into_edit; + string inline_autocompletion; + string destination_url; + string contents; + string description; + int32 transition; + bool allowed_to_be_default_match; + string type; + string? associated_keyword; + string keyword; + bool starred; + int32 duplicates; + bool from_previous; + array<AutocompleteAdditionalInfo> additional_info; +}; + +struct AutocompleteResultsForProvider { + string provider_name; + array<AutocompleteMatch> results; +}; + +struct OmniboxResult { + bool done; + // Time delta since the request was started, in milliseconds. + int32 time_since_omnibox_started_ms; + string host; + bool is_typed_host; + array<AutocompleteMatch> combined_results; + array<AutocompleteResultsForProvider> results_by_provider; +}; + +interface OmniboxPageHandler { + SetClientPage(OmniboxPage page); + StartOmniboxQuery(string input_string, + int32 cursor_position, + bool prevent_inline_autocomplete, + bool prefer_keyword, + int32 page_classification); +}; + +interface OmniboxPage { + HandleNewAutocompleteResult(OmniboxResult result); +}; diff --git a/chromium/chrome/browser/ui/webui/plugins/BUILD.gn b/chromium/chrome/browser/ui/webui/plugins/BUILD.gn new file mode 100644 index 00000000000..595c9e1ae50 --- /dev/null +++ b/chromium/chrome/browser/ui/webui/plugins/BUILD.gn @@ -0,0 +1,11 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +import("//mojo/public/tools/bindings/mojom.gni") + +# GYP version: chrome/chrome_web_ui_mojo_bindings.gyp:webui_mojo_bindings +mojom("mojo_bindings") { + sources = [ + "plugins.mojom", + ] +} diff --git a/chromium/chrome/browser/ui/webui/plugins/plugins.mojom b/chromium/chrome/browser/ui/webui/plugins/plugins.mojom new file mode 100644 index 00000000000..12efc008eec --- /dev/null +++ b/chromium/chrome/browser/ui/webui/plugins/plugins.mojom @@ -0,0 +1,48 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojom; + +struct MimeType { + string description; + array<string> file_extensions; + string mime_type; +}; + +struct PluginFile { + string description; + string enabled_mode; + array<MimeType> mime_types; + string name; + string path; + string type; + string version; +}; + +struct PluginData { + bool always_allowed; + bool trusted; + string description; + bool critical; + string enabled_mode; + string id; + string name; + string update_url; + string version; + array<PluginFile> plugin_files; +}; + +interface PluginsPageHandler { + GetPluginsData() => (array<PluginData> plugins); + GetShowDetails() => (bool show_details); + SaveShowDetailsToPrefs(bool details_mode); + SetPluginAlwaysAllowed(string plugin, bool allowed); + SetPluginEnabled(string plugin_path, bool enable); + SetPluginGroupEnabled(string group_name, bool enable); + SetClientPage(PluginsPage page); +}; + +interface PluginsPage { + OnPluginsUpdated(array<PluginData> plugins); +}; diff --git a/chromium/chrome/child/BUILD.gn b/chromium/chrome/child/BUILD.gn new file mode 100644 index 00000000000..1b268f18b2e --- /dev/null +++ b/chromium/chrome/child/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("child") { + sources = [ + "pdf_child_init.cc", + "pdf_child_init.h", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//base", + "//content/public/child", + ] +} diff --git a/chromium/chrome/chrome_tests.gni b/chromium/chrome/chrome_tests.gni new file mode 100644 index 00000000000..f8f9976ace9 --- /dev/null +++ b/chromium/chrome/chrome_tests.gni @@ -0,0 +1,15 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file loads the chrome_tests variables which is then shared between +# all BUILD.gn files that need it. +chrome_tests_gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("chrome_tests.gypi") ], + "scope", + [ "chrome_tests.gypi" ]) +chrome_tests_unit_gypi_values = + exec_script("//build/gypi_to_gn.py", + [ rebase_path("chrome_tests_unit.gypi") ], + "scope", + [ "chrome_tests_unit.gypi" ]) diff --git a/chromium/chrome/chrome_watcher/BUILD.gn b/chromium/chrome/chrome_watcher/BUILD.gn new file mode 100644 index 00000000000..8a3e48a931d --- /dev/null +++ b/chromium/chrome/chrome_watcher/BUILD.gn @@ -0,0 +1,79 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//chrome/version.gni") +import("//testing/test.gni") + +source_set("client") { + sources = [ + "chrome_watcher_main_api.cc", + "chrome_watcher_main_api.h", + ] + deps = [ + "//base", + ] +} + +source_set("hang_util") { + sources = [ + "system_load_estimator.cc", + "system_load_estimator.h", + ] + deps = [ + "//base", + "//components/memory_pressure", + ] + libs = [ "pdh.lib" ] # Used by system_load_estimator.h. + ldflags = [ "/DELAYLOAD:pdh.dll" ] # Only used on report capture. +} + +test("system_load_estimator_unittests") { + sources = [ + "system_load_estimator_unittest.cc", + ] + deps = [ + ":client", + ":hang_util", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//testing/gtest", + ] +} + +group("kasko_util") { + public_deps = [ + "//third_party/kasko:kasko_features", + ] +} + +process_version("chrome_watcher_resources") { + template_file = chrome_version_rc_template + sources = [ + "chrome_watcher.ver", + ] + output = "$target_gen_dir/chrome_watcher_version.rc" +} + +shared_library("chrome_watcher") { + sources = [ + "chrome_watcher_main.cc", + ] + inputs = [ + "chrome_watcher.def", + ] + deps = [ + ":chrome_watcher_resources", + ":client", + ":kasko_util", + "//base", + "//base:base_static", + "//build/config/sanitizers:deps", + "//chrome/common:metrics_constants_util_win", + "//chrome/installer/util:with_no_strings", + "//components/browser_watcher", + ] + ldflags = [ "/DEF:" + rebase_path("chrome_watcher.def", root_build_dir) ] + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] +} diff --git a/chromium/chrome/common/BUILD.gn b/chromium/chrome/common/BUILD.gn new file mode 100644 index 00000000000..65ccfccad85 --- /dev/null +++ b/chromium/chrome/common/BUILD.gn @@ -0,0 +1,436 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/buildflag_header.gni") +import("//chrome/common/features.gni") +import("//chrome/version.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//tools/grit/grit_rule.gni") + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("../chrome_common.gypi") ], + "scope", + [ "../chrome_common.gypi" ]) + +# GYP version: chrome/chrome_resources.gyp:chrome_resources +# (generate_common_resources action) +grit("resources") { + source = "common_resources.grd" + output_dir = "$root_gen_dir/chrome" + output_name = "common_resources" + outputs = [ + "grit/common_resources.h", + "common_resources.pak", + ] +} + +# GYP version: chrome/chrome_resources.gyp:chrome_resources +# (generate_extensions_api_resources action) +if (enable_extensions) { + grit("extensions_api_resources") { + source = "extensions_api_resources.grd" + output_dir = "$root_gen_dir/chrome" + outputs = [ + "grit/extensions_api_resources.h", + "extensions_api_resources.pak", + ] + } +} + +buildflag_header("features") { + header = "features.h" + flags = [ + "ANDROID_JAVA_UI=$android_java_ui", + "ENABLE_BACKGROUND=$enable_background", + "ENABLE_GOOGLE_NOW=$enable_google_now", + "ENABLE_ONE_CLICK_SIGNIN=$enable_one_click_signin", + "ENABLE_PACKAGE_MASH_SERVICES=$enable_package_mash_services", + "USE_VULCANIZE=$use_vulcanize", + ] +} + +# GYP version: chrome/chrome_common.gypi:common +# +# Use a static library here because many test binaries depend on this but don't +# require many files from it. This makes linking more efficient. +static_library("common") { + sources = rebase_path(gypi_values.chrome_common_sources, ".", "//chrome") + defines = [] + + configs += [ + "//build/config:precompiled_headers", + "//build/config/compiler:wexit_time_destructors", + ] + + public_deps = [ + ":features", + "//base:base", + "//base:base_static", + "//base:i18n", + "//chrome:resources", + "//chrome:strings", + "//chrome/app/theme:theme_resources", + "//chrome/common:constants", + "//chrome/common/safe_browsing:proto", + "//chrome/common/variations:fieldtrial_testing_config", + "//chrome/installer/util:with_no_strings", + "//components/cast_certificate", + "//components/cdm/common", + "//components/cloud_devices/common", + "//components/component_updater", + "//components/content_settings/core/common", + "//components/crash/core/common", + "//components/data_reduction_proxy/content/common", + "//components/dom_distiller/core", + "//components/error_page/common", + "//components/favicon_base", + "//components/flags_ui:switches", + "//components/gcm_driver/common", + "//components/json_schema", + "//components/metrics", + "//components/metrics:net", + "//components/nacl/common:process_type", + "//components/nacl/common:switches", + "//components/network_session_configurator:switches", + "//components/offline_pages:switches", + "//components/omnibox/common", + "//components/policy", + "//components/policy:policy_component_common", + "//components/prefs", + "//components/strings", + "//components/translate/core/common", + "//components/url_formatter", + "//components/variations", + "//components/version_info", + "//content/public/common", + "//crypto", + "//extensions/common:common_constants", + "//gin", + "//google_apis", + "//gpu/command_buffer/service", + "//gpu/config", + "//net", + "//skia", + "//third_party/icu", + "//third_party/kasko:kasko_features", + "//third_party/zlib:zip", + "//ui/accessibility", + "//ui/base", + "//ui/gfx/ipc", + "//ui/gfx/ipc/geometry", + "//ui/gfx/ipc/skia", + "//ui/gl", + "//ui/message_center", + "//ui/resources:resources", + "//url", + ] + + if (enable_plugins) { + public_deps += [ "//ppapi/shared_impl" ] + } + + if (is_ios) { + sources += [ + # Use this Mac file that was filtered out. + "channel_info_mac.mm", + ] + sources -= [ + "resource_usage_reporter_type_converters.cc", + "resource_usage_reporter_type_converters.h", + ] + } else { + # Non-iOS. + public_deps += [ + ":mojo_bindings", + "//chrome/common/net", + "//components/autofill/content/common", + "//components/autofill/core/common", + "//components/password_manager/content/public/interfaces", + "//components/password_manager/core/common", + "//components/signin/core/common", + "//components/translate/content/common", + "//components/visitedlink/common", + "//ipc", + "//media", + "//mojo/public/cpp/bindings", + "//third_party/re2", + "//third_party/widevine/cdm:version_h", + ] + } + + if (enable_extensions) { + sources += rebase_path(gypi_values.chrome_common_extensions_sources, + ".", + "//chrome") + public_deps += [ + "//chrome/common/extensions/api", + "//device/usb", + "//extensions:extensions_resources", + "//extensions/common", + "//extensions/common/api", + "//extensions/strings", + "//media/cast:net", + ] + if (is_chromeos) { + sources += + rebase_path(gypi_values.chrome_common_extensions_chromeos_sources, + ".", + "//chrome") + } + if (use_aura) { + # This dependency is for a header used only by extensions code. + public_deps += [ "//ui/keyboard:keyboard_with_content" ] + } + } + + if (is_win || is_mac) { + sources += + rebase_path(gypi_values.chrome_common_win_mac_sources, ".", "//chrome") + } + if (is_win || is_mac || is_chromeos) { + sources += rebase_path(gypi_values.chrome_common_networking_private_sources, + ".", + "//chrome") + + # networking_private_crypto.cc depends on boringssl. + public_deps += [ "//third_party/boringssl" ] + } + if (is_mac) { + public_deps += [ ":app_mode_app_support" ] + } + if (is_chromeos) { + public_deps += [ "//chromeos" ] + } + + if (enable_nacl) { + public_deps += [ "//components/nacl/common" ] + } + + # Printing. + if (enable_basic_printing || enable_print_preview) { + sources += + rebase_path(gypi_values.chrome_common_printing_sources, ".", "//chrome") + + public_deps += [ + "//components/printing/common", + "//printing", + ] + if (enable_print_preview) { + # Full printing support. + sources += rebase_path(gypi_values.chrome_common_service_process_sources, + ".", + "//chrome") + } + } + + if (is_android) { + sources -= [ + "channel_info_posix.cc", + "media_galleries/metadata_types.h", + ] + } else { + # Non-Android. + sources += + rebase_path(gypi_values.chrome_common_importer_sources, ".", "//chrome") + } + + if (is_chromeos) { + sources -= [ "channel_info_posix.cc" ] + } + + if (is_win) { + public_deps += [ + "//components/dom_distiller/core", # Needed by chrome_content_client.cc. + "//third_party/wtl", + ] + + libs = [ "wintrust.lib" ] + } + + if (is_mac) { + sources -= [ "channel_info_posix.cc" ] + public_deps += [ + "//third_party/google_toolbox_for_mac", + "//third_party/mach_override", + ] + } + + if (enable_plugins) { + sources += [ + "pepper_flash.cc", + "pepper_flash.h", + "ppapi_utils.cc", + "ppapi_utils.h", + ] + public_deps += [ "//third_party/adobe/flash:flapper_version_h" ] + } + if (enable_plugins && enable_extensions) { + sources += [ + "pepper_permission_util.cc", + "pepper_permission_util.h", + ] + } + if (!enable_webrtc) { + sources -= [ "media/webrtc_logging_messages.h" ] + } + + if (safe_browsing_mode != 0) { + sources += + rebase_path(gypi_values.chrome_common_shared_safe_browsing_sources, + ".", + "//chrome") + + if (safe_browsing_mode == 1) { + sources += + rebase_path(gypi_values.chrome_common_full_safe_browsing_sources, + ".", + "//chrome") + } + } +} + +# GYP version: chrome/common_constants.gyp:version_header +process_version("version_header") { + # TODO(brettw) this should have more reduced visibility, but chrome/browser + # currently depends on this. + #visibility = [ ":*" ] + + # This one just uses the custom template and no separate sources. + sources = [] + template_file = "chrome_version.h.in" + + output = "$target_gen_dir/chrome_version.h" +} + +# GYP version: chrome/common_constants.gyp:common_constants +static_library("constants") { + sources = [ + "chrome_constants.cc", + "chrome_constants.h", + "chrome_features.cc", + "chrome_features.h", + "chrome_icon_resources_win.cc", + "chrome_icon_resources_win.h", + "chrome_paths.cc", + "chrome_paths.h", + "chrome_paths_android.cc", + "chrome_paths_internal.h", + "chrome_paths_linux.cc", + "chrome_paths_mac.mm", + "chrome_paths_win.cc", + "chrome_result_codes.h", + "chrome_switches.cc", + "chrome_switches.h", + "env_vars.cc", + "env_vars.h", + "pref_font_script_names-inl.h", + "pref_font_webkit_names.h", + "pref_names.cc", + "pref_names.h", + ] + + public_deps = [ + "//content/public/common:result_codes", + ] + deps = [ + ":features", + ":version_header", + "//base", + "//base/third_party/dynamic_annotations", + "//components/bookmarks/common", + "//components/nacl/common:switches", + "//media:cdm_paths", # Needed by chrome_paths.cc. + "//third_party/widevine/cdm:version_h", + ] + + if (is_android) { + # This dependency must only be added for Android. + # + # On Windows, //chrome/installer/util depends on this target to get + # constants. That target is in turn used in a number of installer helper + # targets independent of Chrome that we want to keep small. So we don't + # want something large like //ui/base. + # + # Android doesn't have this structure and corresponding size limitation + # on this target. On that platform one of the Chrome paths forwards to one + # implemented in //ui/base, so we need that dependency. + deps += [ "//ui/base" ] + } +} + +if (is_win) { + # GYP version: chrome/chrome_common.gypi:metrics_constants_util_win + source_set("metrics_constants_util_win") { + sources = [ + "metrics_constants_util_win.cc", + "metrics_constants_util_win.h", + ] + + deps = [ + "//base", + "//chrome/installer/util:with_no_strings", + ] + } +} + +# Use a static library here because many test binaries depend on this but don't +# require many files from it. This makes linking more efficient. +static_library("test_support") { + testonly = true + visibility = [ "//chrome/test:test_support" ] + + sources = [] + + deps = [ + ":common", + "//base", + "//testing/gtest", + ] + + if (is_win || is_mac) { + sources += [ + "media_galleries/picasa_test_util.cc", + "media_galleries/picasa_test_util.h", + "media_galleries/pmp_test_util.cc", + "media_galleries/pmp_test_util.h", + ] + } + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + if (enable_extensions) { + sources += [ + "extensions/extension_test_util.cc", + "extensions/extension_test_util.h", + ] + } +} + +# GYP version: chrome/chrome.gyp:app_mode_app_support +source_set("app_mode_app_support") { + sources = [ + "mac/app_mode_chrome_locator.h", + "mac/app_mode_chrome_locator.mm", + "mac/app_mode_common.h", + "mac/app_mode_common.mm", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + ":constants", + "//base", + ] +} + +mojom("mojo_bindings") { + sources = [ + "image_decoder.mojom", + "resource_usage_reporter.mojom", + ] + + public_deps = [ + "//skia/public/interfaces", + ] +} diff --git a/chromium/chrome/common/features.gni b/chromium/chrome/common/features.gni new file mode 100644 index 00000000000..5cc2a0997b8 --- /dev/null +++ b/chromium/chrome/common/features.gni @@ -0,0 +1,35 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This is the GN version of //chrome/chrome_features.gypi. +# Please keep in sync! + +declare_args() { + enable_google_now = !is_ios && !is_android + + # Whether the Java UI is being used (Java infobars and popups, Java native + # settings and first run experience, sign-in etc.). + # Default to true if compiling for android, but allow this being overriden + # through the environment. + android_java_ui = is_android + + # Use vulcanized HTML/CSS/JS resources to speed up WebUI (chrome://) + # pages. https://github.com/polymer/vulcanize + use_vulcanize = true + + # Enables support for background apps. + enable_background = !is_ios && !is_android + + enable_one_click_signin = is_win || is_mac || (is_linux && !is_chromeos) + + # Set to true to bundle all the mash related mojo services into chrome. + # Specify --mash to chrome to have chrome start the mash environment. + enable_package_mash_services = is_chromeos +} + +chrome_grit_defines = [ + "enable_background=$enable_background", + "enable_google_now=$enable_google_now", + "use_vulcanize=$use_vulcanize", +] diff --git a/chromium/chrome/common/image_decoder.mojom b/chromium/chrome/common/image_decoder.mojom new file mode 100644 index 00000000000..3467afa4e06 --- /dev/null +++ b/chromium/chrome/common/image_decoder.mojom @@ -0,0 +1,18 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojom; + +import "skia/public/interfaces/bitmap.mojom"; + +enum ImageCodec { + DEFAULT, + ROBUST_JPEG, + ROBUST_PNG, +}; + +interface ImageDecoder { + DecodeImage(array<uint8> encoded_data, ImageCodec codec, bool shrink_to_fit) + => (skia.mojom.Bitmap? decoded_image); +}; diff --git a/chromium/chrome/common/net/BUILD.gn b/chromium/chrome/common/net/BUILD.gn new file mode 100644 index 00000000000..1268d6a6804 --- /dev/null +++ b/chromium/chrome/common/net/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/crypto.gni") + +# GYP version: chrome/chrome_common.gypi:common_net +static_library("net") { + sources = [ + "net_resource_provider.cc", + "net_resource_provider.h", + "x509_certificate_model.cc", + "x509_certificate_model.h", + "x509_certificate_model_nss.cc", + ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + "//base", + "//base:i18n", + "//chrome:resources", + "//chrome:strings", + "//components/url_formatter", + "//crypto", + "//net", + "//net:net_resources", + "//third_party/icu", + "//ui/base", + ] + + if (is_ios) { + sources -= [ "net_resource_provider.cc" ] + } + + if (is_android || is_ios) { + sources -= [ "x509_certificate_model.cc" ] + } + + if (use_nss_certs) { + deps += [ + "//chrome/third_party/mozilla_security_manager", + "//crypto:platform", + ] + allow_circular_includes_from = + [ "//chrome/third_party/mozilla_security_manager" ] + } else { + sources -= [ "x509_certificate_model_nss.cc" ] + } +} diff --git a/chromium/chrome/common/resource_usage_reporter.mojom b/chromium/chrome/common/resource_usage_reporter.mojom new file mode 100644 index 00000000000..6ccf0cd3dc4 --- /dev/null +++ b/chromium/chrome/common/resource_usage_reporter.mojom @@ -0,0 +1,41 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojom; + +// Mirror of blink::WebCache::ResourceTypeStat. +// Note: These are size_t in blink. +struct ResourceTypeStat { + uint64 count = 0; + uint64 size = 0; + uint64 live_size = 0; + uint64 decoded_size = 0; +}; + +// Blink resource cache statistics. Mirror of +// blink::WebCache::ResourceTypeStats. +struct ResourceTypeStats { + ResourceTypeStat images; + ResourceTypeStat css_style_sheets; + ResourceTypeStat scripts; + ResourceTypeStat xsl_style_sheets; + ResourceTypeStat fonts; + ResourceTypeStat other; +}; + +struct ResourceUsageData { + // V8 memory usage information. + // NOTE: For utility processes, this only reports V8 memory used by the proxy + // resolver. + bool reports_v8_stats = false; + uint64 v8_bytes_allocated = 0; + uint64 v8_bytes_used = 0; + + // Blink cache information. + ResourceTypeStats? web_cache_stats; +}; + +interface ResourceUsageReporter { + GetUsageData() => (ResourceUsageData data); +}; diff --git a/chromium/chrome/common/safe_browsing/BUILD.gn b/chromium/chrome/common/safe_browsing/BUILD.gn new file mode 100644 index 00000000000..2c75265eca6 --- /dev/null +++ b/chromium/chrome/common/safe_browsing/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: chrome/chrome_common.gypi:safe_browsing_proto +proto_library("proto") { + sources = [ + "client_model.proto", + "crx_info.proto", + "csd.proto", + "download_file_types.proto", + "permission_report.proto", + ] +} diff --git a/chromium/chrome/common/variations/BUILD.gn b/chromium/chrome/common/variations/BUILD.gn new file mode 100644 index 00000000000..8a539761949 --- /dev/null +++ b/chromium/chrome/common/variations/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +action("fieldtrial_testing_config_action") { + visibility = [ ":fieldtrial_testing_config" ] + script = "//tools/variations/fieldtrial_to_struct.py" + + if (is_win) { + source = "//testing/variations/fieldtrial_testing_config_win.json" + } + if (is_mac) { + source = "//testing/variations/fieldtrial_testing_config_mac.json" + } + if (is_linux) { + source = "//testing/variations/fieldtrial_testing_config_linux.json" + } + if (is_chromeos) { + source = "//testing/variations/fieldtrial_testing_config_chromeos.json" + } + if (is_android) { + source = "//testing/variations/fieldtrial_testing_config_android.json" + } + if (is_ios) { + source = "//testing/variations/fieldtrial_testing_config_ios.json" + } + + inputs = [ + "//tools/json_to_struct/element_generator.py", + "//tools/json_to_struct/json_to_struct.py", + "//tools/json_to_struct/struct_generator.py", + source, + ] + out_name = "fieldtrial_testing_config" + outputs = [ + "$target_gen_dir/$out_name.cc", + "$target_gen_dir/$out_name.h", + ] + + args = [ + rebase_path(source, root_build_dir), + "--destbase=" + rebase_path(target_gen_dir, root_build_dir), + "--namespace=chrome_variations", + "--schema=" + + rebase_path("fieldtrial_testing_config_schema.json", root_build_dir), + "--output=$out_name", + ] +} + +source_set("fieldtrial_testing_config") { + sources = get_target_outputs(":fieldtrial_testing_config_action") + deps = [ + ":fieldtrial_testing_config_action", + ] +} diff --git a/chromium/chrome/gpu/BUILD.gn b/chromium/chrome/gpu/BUILD.gn new file mode 100644 index 00000000000..384b4186e54 --- /dev/null +++ b/chromium/chrome/gpu/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("gpu") { + deps = [ + "//content/public/common", + "//content/public/gpu", + ] + + sources = [ + "chrome_content_gpu_client.cc", + "chrome_content_gpu_client.h", + ] + + if (is_chromeos) { + deps += [ "//components/arc:arc_bindings" ] + sources += [ + "arc_gpu_video_decode_accelerator.cc", + "arc_gpu_video_decode_accelerator.h", + "arc_video_accelerator.h", + "gpu_arc_video_service.cc", + "gpu_arc_video_service.h", + ] + } +} diff --git a/chromium/chrome/install_static/BUILD.gn b/chromium/chrome/install_static/BUILD.gn new file mode 100644 index 00000000000..ec8ff5f6f49 --- /dev/null +++ b/chromium/chrome/install_static/BUILD.gn @@ -0,0 +1,47 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//testing/test.gni") + +assert(is_win) + +# This file only contains utility functions which must only depend on kernel32 +# and advapi32. Please don't add dependencies on other system libraries. +static_library("install_static_util") { + sources = [ + "install_util.cc", + "install_util.h", + ] + + deps = [ + "//base", + ] + + libs = [ + "kernel32.lib", + "advapi32.lib", + ] + + configs += [ + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "//build/config/compiler:no_size_t_to_int_warning", + ] +} + +test("install_static_unittests") { + output_name = "install_static_unittests" + sources = [ + "install_util_unittest.cc", + ] + include_dirs = [ "$target_gen_dir" ] + deps = [ + "//base", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//chrome/install_static:install_static_util", + "//testing/gmock", + "//testing/gtest", + ] +} diff --git a/chromium/chrome/installer/BUILD.gn b/chromium/chrome/installer/BUILD.gn new file mode 100644 index 00000000000..1bd34f40b76 --- /dev/null +++ b/chromium/chrome/installer/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") + +# Meta-target that forwards to the installer of the correct type (if any). +group("installer") { + # We only make Linux installers for 64-bit desktop. + if (is_desktop_linux && is_chrome_branded && target_cpu == "x64") { + deps = [ + "//chrome/installer/linux", + ] + } + + if (is_mac) { + deps = [ + "//chrome/installer/mac", + ] + } +} diff --git a/chromium/chrome/installer/gcapi/BUILD.gn b/chromium/chrome/installer/gcapi/BUILD.gn new file mode 100644 index 00000000000..f8bad02b44e --- /dev/null +++ b/chromium/chrome/installer/gcapi/BUILD.gn @@ -0,0 +1,85 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//chrome/version.gni") +import("//testing/test.gni") + +assert(is_win) + +shared_library("gcapi") { + output_name = "gcapi_dll" + + sources = [ + "gcapi.def", + "gcapi_dll.cc", + "gcapi_dll_version.rc.version", + ] + + deps = [ + ":copy_gcapi_header", + ":gcapi_dll_version", + ":lib", + "//base", + "//chrome/install_static:install_static_util", + ] +} + +copy("copy_gcapi_header") { + sources = [ + "gcapi.h", + ] + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] +} + +process_version("gcapi_dll_version") { + template_file = "gcapi_dll_version.rc.version" + output = "$target_gen_dir/gcapi_dll_version.rc" +} + +source_set("lib") { + sources = [ + "gcapi.cc", + "gcapi.h", + "gcapi_omaha_experiment.cc", + "gcapi_omaha_experiment.h", + "gcapi_reactivation.cc", + "gcapi_reactivation.h", + ] + + deps = [ + "//base", + "//chrome/installer/launcher_support", + "//chrome/installer/util:with_no_strings", + "//components/variations", + "//google_update", + ] +} + +test("gcapi_test") { + sources = [ + "gcapi_last_run_test.cc", + "gcapi_omaha_experiment_test.cc", + "gcapi_reactivation_test.cc", + "gcapi_test.cc", + "gcapi_test.rc", + "gcapi_test_registry_overrider.cc", + "gcapi_test_registry_overrider.h", + "resource.h", + ] + + deps = [ + ":lib", + "//base/test:test_support", + "//chrome/install_static:install_static_util", + "//chrome/installer/util:with_no_strings", + "//components/variations", + "//testing/gtest", + ] + + data_deps = [ + ":gcapi", # Runtime dependency on this DLL. + ] +} diff --git a/chromium/chrome/installer/launcher_support/BUILD.gn b/chromium/chrome/installer/launcher_support/BUILD.gn new file mode 100644 index 00000000000..9abab50df0a --- /dev/null +++ b/chromium/chrome/installer/launcher_support/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("launcher_support") { + sources = [ + "chrome_launcher_support.cc", + "chrome_launcher_support.h", + ] + + deps = [ + "//base", + ] +} diff --git a/chromium/chrome/installer/linux/BUILD.gn b/chromium/chrome/installer/linux/BUILD.gn new file mode 100644 index 00000000000..c30993b23e9 --- /dev/null +++ b/chromium/chrome/installer/linux/BUILD.gn @@ -0,0 +1,353 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//build/config/features.gni") +import("//build/config/sanitizers/sanitizers.gni") +import("//build/util/version.gni") +import("//chrome/version.gni") + +if (current_cpu == "x86" || current_cpu == "x64") { + import("//media/cdm/ppapi/cdm_paths.gni") +} + +assert(is_linux && is_chrome_branded) + +# This target builds all "normal" Linux installers. +# GYP version: chrome/chrome_installer.gypi:linux_packages_all +# +# The bot setup is to build stable, unstable, and beta packages for the current +# build. Then a later step picks up the package corresponding to what the +# current build is supposed to be. This is wasteful since one build will only +# be one of these. This build file also has targets for trunk and possibly asan +# installers. +# +# TODO it would be much nicer to have a build variable so the bot can tell us +# what the current build should be, so we only have to make one .deb/.rpm pair. +# +# +# TO BUILD LINUX INSTALLER PACKAGES +# +# The packages list the exact versions of each library used. The versions used +# on the bots are likely different than those on your workstation, so you'll +# get a stream of errors like: +# < libasound2 (>= 1.0.23) +# --- +# > libasound2 (>= 1.0.16) +# +# To avoid these warnings for testing purposes, do: +# +# export IGNORE_DEPS_CHANGES=1 +# +# before you build. +group("linux") { + deps = [ + ":beta", + ":stable", + ":unstable", + ] +} + +# This target is provided for compatibility w/ GYP. Users should always +# depend directly on :linux instead of this target (we set visibility +# to the empty list to prevent unwanted callers). +# TODO(GYP_GONE): Delete this target after we've migrated away from GYP and +# updated the bots to build :linux instead. +group("linux_packages_all") { + visibility = [] + deps = [ + ":linux", + ] +} + +branding_dir = "//chrome/app/theme/$branding_path_component" +branding_dir_100 = + "//chrome/app/theme/default_100_percent/$branding_path_component" + +copy("common_packaging_files") { + visibility = [ ":*" ] + sources = [ + "common/apt.include", + "common/default-app-block.template", + "common/default-app.template", + "common/desktop.template", + "common/google-chrome/google-chrome.info", + "common/installer.include", + "common/postinst.include", + "common/prerm.include", + "common/repo.cron", + "common/rpm.include", + "common/rpmrepo.cron", + "common/symlinks.include", + "common/variables.include", + "common/wrapper", + ] + + if (current_cpu == "x86") { + sources += [ "//build/linux/bin/eu-strip" ] + } else if (current_cpu == "x64") { + sources += [ "/usr/bin/eu-strip" ] + } + + outputs = [ + "$root_out_dir/installer/common/{{source_file_part}}", + ] +} + +copy("deb_packaging_files") { + visibility = [ ":*" ] + sources = [ + "debian/build.sh", + "debian/changelog.template", + "debian/control.template", + "debian/debian.menu", + "debian/expected_deps_ia32", + "debian/expected_deps_x64", + "debian/postinst", + "debian/postrm", + "debian/prerm", + ] + outputs = [ + "$root_out_dir/installer/debian/{{source_file_part}}", + ] +} + +copy("theme_files") { + visibility = [ ":*" ] + sources = [ + "$branding_dir/BRANDING", + "$branding_dir/linux/product_logo_32.xpm", + "$branding_dir/product_logo_128.png", + "$branding_dir/product_logo_22.png", + "$branding_dir/product_logo_24.png", + "$branding_dir/product_logo_256.png", + "$branding_dir/product_logo_48.png", + "$branding_dir/product_logo_64.png", + "$branding_dir_100/product_logo_16.png", + "$branding_dir_100/product_logo_32.png", + ] + outputs = [ + "$root_out_dir/installer/theme/{{source_file_part}}", + ] +} + +if (!is_chromeos) { + copy("rpm_packaging_files") { + visibility = [ ":*" ] + sources = [ + "rpm/build.sh", + "rpm/chrome.spec.template", + "rpm/expected_deps_i386", + "rpm/expected_deps_x86_64", + ] + outputs = [ + "$root_out_dir/installer/rpm/{{source_file_part}}", + ] + } +} + +process_version("save_build_info") { + # Just output the default version info variables (no template). + process_only = true + output = "$root_out_dir/installer/version.txt" +} + +# Dependencies for all Linux installer targets. +group("installer_deps") { + # Though many of these things appear in data_deps further down the + # dependency chain, they must appear here as public_deps so that they can + # be listed as inputs to the actions that depend on ":installer_deps" + # and are guaranteed to have been built before those actions run. + + public_deps = [ + ":common_packaging_files", + ":deb_packaging_files", + ":save_build_info", + ":theme_files", + "//chrome", + "//chrome:packed_resources", + "//sandbox/linux:chrome_sandbox", + "//third_party/adobe/flash:flapper_binaries", + ] + if (enable_nacl) { + public_deps += [ + "//components/nacl/loader:nacl_helper", + + # These are data_deps of nacl_helper, but that is not enough, + # as explained above. + "//native_client/src/trusted/service_runtime/linux:bootstrap", + "//ppapi/native_client:irt", + ] + } + if (current_cpu == "x86" || current_cpu == "x64") { + public_deps += [ + "//third_party/widevine/cdm:widevinecdm", + "//third_party/widevine/cdm:widevinecdmadapter", + ] + } + if (!is_chromeos) { + public_deps += [ ":rpm_packaging_files" ] + } +} + +# Creates .deb and .rpm (RPM for non-ChromeOS only) installer packages. +# +# channel: +# Name of the channel. +template("linux_package") { + assert(defined(invoker.channel)) + channel = invoker.channel + + if (current_cpu == "x86") { + # The shell scripts use "ia32" instead of "x86". + build_script_arch = "ia32" + } else { + build_script_arch = current_cpu + } + + packaging_files_binaries = [ + # TODO(mmoss) Any convenient way to get all the relevant build + # files? (e.g. all locales, resources, etc.) + "$root_out_dir/chrome", + "$root_out_dir/chrome_sandbox", + "$root_out_dir/xdg-mime", + "$root_out_dir/xdg-settings", + "$root_out_dir/locales/en-US.pak", + + "$root_out_dir/nacl_helper", + "$root_out_dir/nacl_helper_bootstrap", + "$root_out_dir/PepperFlash/libpepflashplayer.so", + "$root_out_dir/PepperFlash/manifest.json", + ] + + if (current_cpu == "x86") { + packaging_files_binaries += [ + "$root_out_dir/nacl_irt_x86_32.nexe", + "$root_out_dir/$widevine_cdm_path/libwidevinecdmadapter.so", + "$root_out_dir/$widevine_cdm_path/libwidevinecdm.so", + ] + } else if (current_cpu == "x64") { + packaging_files_binaries += [ + "$root_out_dir/nacl_irt_x86_64.nexe", + "$root_out_dir/$widevine_cdm_path/libwidevinecdmadapter.so", + "$root_out_dir/$widevine_cdm_path/libwidevinecdm.so", + ] + } else if (current_cpu == "arm") { + packaging_files_binaries += [ "$root_out_dir/nacl_irt_arm.nexe" ] + } + if (is_asan) { + packaging_files_binaries += [ "$root_out_dir/lib/libc++.so" ] + } + + deb_target_name = "${target_name}_deb" + action(deb_target_name) { + visibility = [ ":*" ] + script = "flock_make_package.py" + + if (current_cpu == "x86") { + deb_arch = "i386" + } else if (current_cpu == "x64") { + deb_arch = "amd64" + } else if (current_cpu == "arm") { + deb_arch = "arm" + } else { + assert(false, "Linux installer not configured for this architecture.") + } + + inputs = packaging_files_binaries + outputs = [ + "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1_${deb_arch}.deb", + ] + + args = [ + rebase_path("$root_out_dir/linux_package.lock", root_build_dir), + rebase_path("$root_out_dir/installer/debian/build.sh", root_build_dir), + "-o", + rebase_path(root_out_dir, root_build_dir), + "-b", + rebase_path(root_out_dir, root_build_dir), + "-a", + build_script_arch, + "-c", + invoker.channel, + "-d", + branding_path_component, + ] + deps = [ + ":installer_deps", + ] + } + + if (!is_chromeos) { + rpm_target_name = "${target_name}_rpm" + action(rpm_target_name) { + visibility = [ ":*" ] + script = "flock_make_package.py" + + if (current_cpu == "x86") { + rpm_arch = "i386" + } else if (current_cpu == "x64") { + rpm_arch = "x86_64" + } else if (current_cpu == "arm") { + rpm_arch = "arm" + } else { + assert(false, "Linux installer not configured for this architecture.") + } + + inputs = packaging_files_binaries + outputs = [ + "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1.${rpm_arch}.rpm", + ] + + args = [ + rebase_path("$root_out_dir/linux_package.lock", root_build_dir), + rebase_path("$root_out_dir/installer/rpm/build.sh", root_build_dir), + "-o", + rebase_path(root_out_dir, root_build_dir), + "-b", + rebase_path(root_out_dir, root_build_dir), + "-a", + build_script_arch, + "-c", + invoker.channel, + "-d", + branding_path_component, + ] + deps = [ + ":installer_deps", + ] + } + } + + group(target_name) { + deps = [ + ":$deb_target_name", + ] + if (!is_chromeos) { + deps += [ ":$rpm_target_name" ] + } + } +} + +# Standard packages. +linux_package("stable") { + channel = "stable" +} +linux_package("beta") { + channel = "beta" +} +linux_package("unstable") { + channel = "unstable" +} + +# Other packages that we support that aren't included in the default "linux" +# target. +linux_package("trunk") { + channel = "trunk" +} +if (is_asan) { + linux_package("asan") { + channel = "asan" + } +} diff --git a/chromium/chrome/installer/mac/BUILD.gn b/chromium/chrome/installer/mac/BUILD.gn new file mode 100644 index 00000000000..837f5386b62 --- /dev/null +++ b/chromium/chrome/installer/mac/BUILD.gn @@ -0,0 +1,90 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/util/branding.gni") +import("//build/util/version.gni") +import("//build/config/features.gni") + +group("mac") { + public_deps = [ + ":copies", + ":make_signers", + ] +} + +_packaging_dir = "$root_out_dir/$chrome_product_full_name Packaging" + +action("make_signers") { + visibility = [ ":mac" ] + + script = "//build/gn_run_binary.py" + shell_script = "//chrome/installer/mac/make_signers.sh" + + inputs = [ + script, + shell_script, + "sign_app.sh.in", + "sign_versioned_dir.sh.in", + "app_resource_rules.plist.in", + "//chrome/VERSION", + ] + + outputs = [ + "$_packaging_dir/sign_app.sh", + "$_packaging_dir/sign_versioned_dir.sh", + "$_packaging_dir/app_resource_rules.plist", + ] + + args = [ + rebase_path(shell_script, root_build_dir), + rebase_path(_packaging_dir, root_build_dir), + chrome_product_full_name, + chrome_version_full, + ] +} + +copy("copies") { + visibility = [ ":mac" ] + + deps = [ + "//chrome/installer/mac/third_party/bsdiff:goobsdiff", + "//chrome/installer/mac/third_party/bsdiff:goobspatch", + "//chrome/installer/mac/third_party/xz:lzma_decompress", + "//chrome/installer/mac/third_party/xz:xz", + "//chrome/installer/mac/third_party/xz:xzdec", + ] + + sources = [ + "$root_out_dir/goobsdiff", + "$root_out_dir/goobspatch", + "$root_out_dir/liblzma_decompress.dylib", + "$root_out_dir/xz", + "$root_out_dir/xzdec", + "dirdiffer.sh", + "dirpatcher.sh", + "pkg-dmg", + "sign_installer_tools.sh", + ] + + if (enable_mac_keystone) { + sources += [ "keystone_install.sh" ] + } + + if (is_chrome_branded) { + sources += [ + "//chrome/app/theme/google_chrome/mac/app_canary.icns", + "//chrome/app/theme/google_chrome/mac/document_canary.icns", + "internal/chrome_canary_dmg_dsstore", + "internal/chrome_canary_dmg_icon.icns", + "internal/chrome_dmg_background.png", + "internal/chrome_dmg_dsstore", + "internal/chrome_dmg_icon.icns", + "internal/generate_dmgs", + ] + } + + outputs = [ + "$_packaging_dir/{{source_file_part}}", + ] +} diff --git a/chromium/chrome/installer/mac/third_party/bsdiff/BUILD.gn b/chromium/chrome/installer/mac/third_party/bsdiff/BUILD.gn new file mode 100644 index 00000000000..ba4787e9e72 --- /dev/null +++ b/chromium/chrome/installer/mac/third_party/bsdiff/BUILD.gn @@ -0,0 +1,60 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Because size is a concern, don't link against all of base. Instead, +# just bring in a copy of the one component that's needed, along with +# the adapter that allows it to be called from C (not C++) code. +static_library("goobsdiff_sha1_adapter") { + visibility = [ ":*" ] + + check_includes = false + + sources = [ + "../../../../../base/sha1.cc", + "sha1_adapter.cc", + "sha1_adapter.h", + ] +} + +executable("goobsdiff") { + sources = [ + "goobsdiff.c", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + ":goobsdiff_sha1_adapter", + "//chrome/installer/mac/third_party/xz:lzma", + ] + + cflags = [ "-Os" ] + + libs = [ + "bz2", + "z", + ] +} + +executable("goobspatch") { + sources = [ + "goobspatch.c", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + ":goobsdiff_sha1_adapter", + "//chrome/installer/mac/third_party/xz:lzma_decompress", + ] + + cflags = [ "-Os" ] + + libs = [ + "bz2", + "z", + ] +} diff --git a/chromium/chrome/installer/mac/third_party/xz/BUILD.gn b/chromium/chrome/installer/mac/third_party/xz/BUILD.gn new file mode 100644 index 00000000000..f723cc4da3a --- /dev/null +++ b/chromium/chrome/installer/mac/third_party/xz/BUILD.gn @@ -0,0 +1,403 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Configuration. Ordinarily, all of these features are enabled, and +# "small" is disabled. For Chromium's purposes, enable "small" and disable +# nearly everything else to save about 36kB in the lzma_decompress +# library, which will be distributed with updates. This also translates to +# a 25kB savings in the compressed disk image that will contain the +# update. +_check_crc32 = true +_check_crc64 = false +_check_sha256 = false +_coder_lzma1 = false +_coder_lzma2 = true +_coder_delta = false +_coder_bcj_arm = false +_coder_bcj_armthumb = false +_coder_bcj_ia64 = false +_coder_bcj_powerpc = false +_coder_bcj_sparc = false +_coder_bcj_x86 = true +_coder_simple = _coder_bcj_arm || _coder_bcj_armthumb || _coder_bcj_ia64 || + _coder_bcj_powerpc || _coder_bcj_sparc || _coder_bcj_x86 +_small = true + +config("common_config") { + visibility = [ ":*" ] + defines = [ "HAVE_CONFIG_H" ] + + include_dirs = [ + "config/$host_os", + "xz/src/common", + "xz/src/liblzma/api", + "xz/src/liblzma/check", + "xz/src/liblzma/common", + "xz/src/liblzma/delta", + "xz/src/liblzma/lz", + "xz/src/liblzma/lzma", + "xz/src/liblzma/rangecoder", + "xz/src/liblzma/simple", + ] + + if (_small) { + defines += [ "HAVE_SMALL=1" ] + } + if (_check_crc32) { + defines += [ "HAVE_CHECK_CRC32=1" ] + } + if (_check_crc64) { + defines += [ "HAVE_CHECK_CRC64=1" ] + } + if (_check_sha256) { + defines += [ "HAVE_CHECK_SHA256=1" ] + } +} + +config("decompress_config") { + visibility = [ ":*" ] + defines = [] + + if (_coder_lzma1) { + defines += [ "HAVE_DECODER_LZMA1=1" ] + } + if (_coder_lzma2) { + defines += [ "HAVE_DECODER_LZMA2=1" ] + } + if (_coder_delta) { + defines += [ "HAVE_DECODER_DELTA=1" ] + } + if (_coder_bcj_arm) { + defines += [ "HAVE_DECODER_ARM=1" ] + } + if (_coder_bcj_armthumb) { + defines += [ "HAVE_DECODER_ARMTHUMB=1" ] + } + if (_coder_bcj_ia64) { + defines += [ "HAVE_DECODER_IA64=1" ] + } + if (_coder_bcj_powerpc) { + defines += [ "HAVE_DECODER_POWERPC=1" ] + } + if (_coder_bcj_sparc) { + defines += [ "HAVE_DECODER_SPARC=1" ] + } + if (_coder_bcj_x86) { + defines += [ "HAVE_DECODER_X86=1" ] + } +} + +config("compress_config") { + visibility = [ ":*" ] + defines = [] + + if (_coder_lzma1) { + defines += [ "HAVE_ENCODER_LZMA1=1" ] + } + if (_coder_lzma2) { + defines += [ "HAVE_ENCODER_LZMA2=1" ] + } + if (_coder_delta) { + defines += [ "HAVE_ENCODER_DELTA=1" ] + } + if (_coder_bcj_arm) { + defines += [ "HAVE_ENCODER_ARM=1" ] + } + if (_coder_bcj_armthumb) { + defines += [ "HAVE_ENCODER_ARMTHUMB=1" ] + } + if (_coder_bcj_ia64) { + defines += [ "HAVE_ENCODER_IA64=1" ] + } + if (_coder_bcj_powerpc) { + defines += [ "HAVE_ENCODER_POWERPC=1" ] + } + if (_coder_bcj_sparc) { + defines += [ "HAVE_ENCODER_SPARC=1" ] + } + if (_coder_bcj_x86) { + defines += [ "HAVE_ENCODER_X86=1" ] + } +} + +source_set("common") { + visibility = [ ":*" ] + configs += [ ":common_config" ] + + sources = [ + "xz/src/common/tuklib_physmem.c", + "xz/src/liblzma/check/check.c", + "xz/src/liblzma/common/block_util.c", + "xz/src/liblzma/common/common.c", + "xz/src/liblzma/common/easy_preset.c", + "xz/src/liblzma/common/filter_common.c", + "xz/src/liblzma/common/hardware_physmem.c", + "xz/src/liblzma/common/index.c", + "xz/src/liblzma/common/stream_flags_common.c", + "xz/src/liblzma/common/vli_size.c", + "xz/src/liblzma/lzma/lzma_encoder_presets.c", + "xz/src/liblzma/rangecoder/price_table.c", + ] + + if (_small) { + sources += [ + # CRC-32 must be compiled for header integrity checks, even if it is + # not enabled for payload integrity checks. + "xz/src/liblzma/check/crc32_small.c", + ] + + if (_check_crc64) { + sources += [ "xz/src/liblzma/check/crc64_small.c" ] + } + } else { + sources += [ + # CRC-32 must be compiled for header integrity checks, even if it is + # not enabled for payload integrity checks. + # + # Use the "fast" implementation instead of the "x86" one for + # architecture independence. Both require the "table." + "xz/src/liblzma/check/crc32_fast.c", + "xz/src/liblzma/check/crc32_table.c", + + # "xz/src/liblzma/check/crc32_x86.S", + ] + + if (_check_crc64) { + sources += [ + # Use the "fast" implementation instead of the "x86" one for + # architecture independence. Both require the "table." + "xz/src/liblzma/check/crc64_fast.c", + "xz/src/liblzma/check/crc64_table.c", + + # "xz/src/liblzma/check/crc64_x86.S", + ] + } + } + + if (_check_sha256) { + sources += [ "xz/src/liblzma/check/sha256.c" ] + } + if (_coder_delta) { + sources += [ "xz/src/liblzma/delta/delta_common.c" ] + } + if (_coder_bcj_arm) { + sources += [ "xz/src/liblzma/simple/arm.c" ] + } + if (_coder_bcj_armthumb) { + sources += [ "xz/src/liblzma/simple/armthumb.c" ] + } + if (_coder_bcj_ia64) { + sources += [ "xz/src/liblzma/simple/ia64.c" ] + } + if (_coder_bcj_powerpc) { + sources += [ "xz/src/liblzma/simple/powerpc.c" ] + } + if (_coder_bcj_sparc) { + sources += [ "xz/src/liblzma/simple/sparc.c" ] + } + if (_coder_bcj_x86) { + sources += [ "xz/src/liblzma/simple/x86.c" ] + } + if (_coder_simple) { + sources += [ "xz/src/liblzma/simple/simple_coder.c" ] + } +} + +source_set("decompress") { + visibility = [ ":*" ] + configs += [ + ":common_config", + ":decompress_config", + ] + + sources = [ + "xz/src/liblzma/common/alone_decoder.c", + "xz/src/liblzma/common/auto_decoder.c", + "xz/src/liblzma/common/block_buffer_decoder.c", + "xz/src/liblzma/common/block_decoder.c", + "xz/src/liblzma/common/block_header_decoder.c", + "xz/src/liblzma/common/easy_decoder_memusage.c", + "xz/src/liblzma/common/filter_buffer_decoder.c", + "xz/src/liblzma/common/filter_decoder.c", + "xz/src/liblzma/common/filter_flags_decoder.c", + "xz/src/liblzma/common/index_decoder.c", + "xz/src/liblzma/common/index_hash.c", + "xz/src/liblzma/common/stream_buffer_decoder.c", + "xz/src/liblzma/common/stream_decoder.c", + "xz/src/liblzma/common/stream_flags_decoder.c", + "xz/src/liblzma/common/vli_decoder.c", + "xz/src/liblzma/lz/lz_decoder.c", + "xz/src/liblzma/lzma/lzma_decoder.c", + ] + + if (_coder_lzma2) { + sources += [ "xz/src/liblzma/lzma/lzma2_decoder.c" ] + } + if (_coder_delta) { + sources += [ "xz/src/liblzma/delta/delta_decoder.c" ] + } + if (_coder_simple) { + sources += [ "xz/src/liblzma/simple/simple_decoder.c" ] + } + + cflags = [ + # Use -Os to minimize the size of the installer tools. + "-Os", + ] +} + +source_set("compress") { + visibility = [ ":*" ] + configs += [ + ":common_config", + ":compress_config", + ] + + sources = [ + "xz/src/liblzma/common/alone_encoder.c", + "xz/src/liblzma/common/block_buffer_encoder.c", + "xz/src/liblzma/common/block_encoder.c", + "xz/src/liblzma/common/block_header_encoder.c", + "xz/src/liblzma/common/easy_buffer_encoder.c", + "xz/src/liblzma/common/easy_encoder.c", + "xz/src/liblzma/common/easy_encoder_memusage.c", + "xz/src/liblzma/common/filter_buffer_encoder.c", + "xz/src/liblzma/common/filter_encoder.c", + "xz/src/liblzma/common/filter_flags_encoder.c", + "xz/src/liblzma/common/index_encoder.c", + "xz/src/liblzma/common/stream_buffer_encoder.c", + "xz/src/liblzma/common/stream_encoder.c", + "xz/src/liblzma/common/stream_flags_encoder.c", + "xz/src/liblzma/common/vli_encoder.c", + "xz/src/liblzma/lz/lz_encoder.c", + "xz/src/liblzma/lz/lz_encoder_mf.c", + "xz/src/liblzma/lzma/lzma_encoder.c", + "xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c", + "xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c", + ] + + if (!_small) { + sources += [ "xz/src/liblzma/lzma/fastpos_table.c" ] + } + if (_coder_lzma2) { + sources += [ "xz/src/liblzma/lzma/lzma2_encoder.c" ] + } + if (_coder_delta) { + sources += [ "xz/src/liblzma/delta/delta_encoder.c" ] + } + if (_coder_simple) { + sources += [ "xz/src/liblzma/simple/simple_encoder.c" ] + } +} + +config("lzma_decompress_config") { + include_dirs = [ "xz/src/liblzma/api" ] +} + +source_set("lzma") { + deps = [ + ":common", + ":compress", + ":decompress", + ] + configs += [ + ":common_config", + ":decompress_config", + ":compress_config", + ] + public_configs = [ ":lzma_decompress_config" ] +} + +# Always build as a shared library to promote code sharing. This library +# is distributed in Google Chrome update disk images and is used by more +# than one tool. +shared_library("lzma_decompress") { + configs += [ + ":common_config", + ":decompress_config", + ] + + public_configs = [ ":lzma_decompress_config" ] + + deps = [ + ":common", + ":decompress", + ] + + ldflags = [ + # The library will reside in the same directory as executables linked + # against it. + "-Wl,-install_name,@loader_path/lib$target_name.dylib", + + # Trim the list of exported symbols to just those needed by + # dependents. This limits the set of "roots" seen during dead-code + # stripping and reduces the size of the library. + "-Wl,-exported_symbols_list," + + rebase_path("lzma_decompress.export", root_build_dir), + ] +} + +executable("xz") { + configs += [ + ":common_config", + ":decompress_config", + ":compress_config", + ] + + sources = [ + "xz/src/common/tuklib_cpucores.c", + "xz/src/common/tuklib_exit.c", + "xz/src/common/tuklib_mbstr_fw.c", + "xz/src/common/tuklib_mbstr_width.c", + "xz/src/common/tuklib_open_stdxxx.c", + "xz/src/common/tuklib_progname.c", + "xz/src/xz/args.c", + "xz/src/xz/coder.c", + "xz/src/xz/file_io.c", + "xz/src/xz/hardware.c", + "xz/src/xz/list.c", + "xz/src/xz/main.c", + "xz/src/xz/message.c", + "xz/src/xz/options.c", + "xz/src/xz/signals.c", + "xz/src/xz/suffix.c", + "xz/src/xz/util.c", + ] + + deps = [ + ":lzma", + ] + + include_dirs = [ + "config/$host_os", + "xz/src/common", + ] +} + +executable("xzdec") { + configs += [ + ":common_config", + ":decompress_config", + ] + + sources = [ + "xz/src/common/tuklib_exit.c", + "xz/src/common/tuklib_progname.c", + "xz/src/xzdec/xzdec.c", + ] + + deps = [ + ":lzma_decompress", + ] + + include_dirs = [ + "config/$host_os", + "xz/src/common", + ] + + cflags = [ + # Use -Os to minimize the size of the installer tools. + "-Os", + ] +} diff --git a/chromium/chrome/installer/mini_installer/BUILD.gn b/chromium/chrome/installer/mini_installer/BUILD.gn new file mode 100644 index 00000000000..699f56f537d --- /dev/null +++ b/chromium/chrome/installer/mini_installer/BUILD.gn @@ -0,0 +1,295 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/compiler/compiler.gni") +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//build/config/win/visual_studio_version.gni") +import("//build_overrides/v8.gni") +import("//chrome/test/mini_installer/mini_installer_test.gni") +import("//chrome/version.gni") +import("//third_party/icu/config.gni") +import("//ui/base/ui_features.gni") + +config("mini_installer_compiler_flags") { + # Disable buffer security checking. + cflags = [ "/GS-" ] +} + +source_set("lib") { + sources = [ + "appid.h", + "chrome.release", + "chrome_appid.cc", + "configuration.cc", + "configuration.h", + "decompress.cc", + "decompress.h", + "mini_installer.ico", + "mini_installer.rc", + "mini_installer_constants.cc", + "mini_installer_constants.h", + "mini_installer_resource.h", + "mini_string.cc", + "mini_string.h", + "pe_resource.cc", + "pe_resource.h", + "regkey.cc", + "regkey.h", + ] + + configs += [ ":mini_installer_compiler_flags" ] + + # This input dependency on the mini installer test Python files will force a + # recompilation when any of the Python files have changed. This will then + # invalidate the build and trigger running the test on the bots even when + # no other Chrome files have changed. These have to be inputs rather than a + # dependency because a dependency won't actually trigger recompiles in + # incremental build cases unless a source file actually references one of the + # dependency outputs. + inputs = mini_installer_test_files +} + +process_version("version") { + template_file = "mini_installer_exe_version.rc.version" + output = "$target_gen_dir/mini_installer_version.rc" +} + +source_set("unit_tests") { + testonly = true + + sources = [ + "configuration_test.cc", + "decompress_test.cc", + "mini_string_test.cc", + ] + + public_deps = [ + ":lib", + ] + deps = [ + "//base", + "//testing/gtest", + ] +} + +# The runtime deps are used to tell create_installer_archive what component +# DLLs need to be packaged in a component build. +chrome_runtime_deps = "$root_gen_dir/chrome_component.runtime_deps" +setup_runtime_deps = "$root_gen_dir/setup.runtime_deps" + +group("chrome_runtime_deps") { + write_runtime_deps = chrome_runtime_deps + data_deps = [ + "//chrome", + ] +} + +group("setup_runtime_deps") { + write_runtime_deps = setup_runtime_deps + data_deps = [ + "//chrome/installer/setup", + ] +} + +# Generates a mini installer. +# +# out_dir (required) +# The output directory out_dir where the mini_installer image should be +# written. +# +# chrome_dll_file (required) +# The path to the version of chrome.dll that should be included in the +# installer archive. +# +# chrome_dll_target (required) +# The target that generated chrome_dll_file. +# +# deps (required) +# Normal meaning. +template("generate_mini_installer") { + chrome_dll_file = invoker.chrome_dll_file + chrome_dll_target = invoker.chrome_dll_target + output_dir = invoker.out_dir + + packed_files_rc_file = "$target_gen_dir/$target_name/packed_files.rc" + archive_name = target_name + "_archive" + staging_dir = "$target_gen_dir/$target_name" + + action(archive_name) { + script = "//chrome/tools/build/win/create_installer_archive.py" + + release_file = "chrome.release" + + inputs = [ + "$chrome_dll_file", + "$root_out_dir/chrome.exe", + "$root_out_dir/locales/en-US.pak", + "$root_out_dir/setup.exe", + release_file, + ] + + outputs = [ + # See also chrome.packed.7z conditionally added below. + "$output_dir/chrome.7z", + "$output_dir/setup.ex_", + packed_files_rc_file, + ] + args = [ + "--build_dir", + rebase_path(root_out_dir, root_build_dir), + "--staging_dir", + rebase_path(staging_dir, root_build_dir), + "--input_file", + rebase_path(release_file, root_build_dir), + "--resource_file_path", + rebase_path(packed_files_rc_file, root_build_dir), + "--target_arch=$current_cpu", + "--distribution=_google_chrome", + "--output_dir", + rebase_path(output_dir, root_build_dir), + "--chrome_runtime_deps", + rebase_path(chrome_runtime_deps, root_build_dir), + "--setup_runtime_deps", + rebase_path(setup_runtime_deps, root_build_dir), + + # Optional arguments to generate diff installer. + #'--last_chrome_installer=C:/Temp/base', + #'--setup_exe_format=DIFF', + #'--diff_algorithm=COURGETTE', + + # Optional argument for verbose archiving output. + #'--verbose', + ] + + deps = [ + ":chrome_runtime_deps", + ":setup_runtime_deps", + "//chrome", + "//chrome/browser/extensions/default_extensions", + "//chrome/installer/setup", + "//third_party/icu:icudata", + chrome_dll_target, + ] + + if (enable_hidpi) { + args += [ "--enable_hidpi=1" ] + } + if (is_component_build) { + args += [ "--component_build=1" ] + } else { + outputs += [ "$output_dir/chrome.packed.7z" ] + } + + if (enable_nacl) { + inputs += [ "$root_out_dir/nacl_irt_x86_64.nexe" ] + deps += [ "//ppapi/native_client:irt" ] + if (current_cpu == "x86") { + inputs += [ + "$root_out_dir/nacl64.exe", + "$root_out_dir/nacl_irt_x86_32.nexe", + ] + deps += [ "//components/nacl/broker:nacl64" ] + } + } + + if (icu_use_data_file) { + inputs += [ "$root_out_dir/icudtl.dat" ] + } else { + inputs += [ "$root_out_dir/icudt.dll" ] + } + + if (v8_use_external_startup_data) { + inputs += [ + "$root_out_dir/natives_blob.bin", + "$root_out_dir/snapshot_blob.bin", + ] + deps += [ "//v8" ] + } + + depfile = "$target_gen_dir/archive.d" + args += [ + "--depfile", + rebase_path(depfile, root_build_dir), + ] + } + + executable(target_name) { + output_name = "mini_installer" + sources = [ + "mini_installer.cc", + packed_files_rc_file, + ] + + # This target is special so we manually override most linker flags and + # specify our own to keep the size down. Also make sure that we don't use + # WPO as it's not supported by the mini installer. + configs -= [ + "//build/config/compiler:default_optimization", + "//build/config:executable_config", + "//build/config/win:console", + ] + configs += [ + ":mini_installer_compiler_flags", + "//build/config/compiler:optimize_no_wpo", + "//build/config/win:sdk_link", + "//build/config/win:windowed", + ] + + ldflags = [ + "/ENTRY:MainEntryPoint", + "/FIXED:NO", + "/ignore:4199", + "/NXCOMPAT", + ] + + libs = [ "setupapi.lib" ] + + deps = [ + ":$archive_name", + ":lib", + ":version", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + } +} + +generate_mini_installer("mini_installer") { + out_dir = root_out_dir + chrome_dll_file = "$root_out_dir/chrome.dll" + chrome_dll_target = "//chrome:main_dll" +} + +if (syzygy_optimize) { + generate_mini_installer("mini_installer_syzygy") { + out_dir = "$root_out_dir/syzygy/" + chrome_dll_file = "$root_out_dir/syzygy/chrome.dll" + chrome_dll_target = "//chrome/tools/build/win/syzygy:chrome_dll_syzygy" + } +} + +# next_version_mini_installer.exe can't be generated in an x86 Debug component +# build because it requires too much memory. +if (!(is_component_build && is_debug && target_cpu == "x86")) { + action("next_version_mini_installer") { + script = "generate_next_version_mini_installer.py" + testonly = true + inputs = [ + "$root_out_dir/alternate_version_generator.exe", + "$root_out_dir/mini_installer.exe", + ] + outputs = [ + "$root_out_dir/$target_name.exe", + ] + args = [ + "--out", + "$target_name.exe", + ] + deps = [ + ":mini_installer", + "//chrome/installer/test:alternate_version_generator", + ] + } +} diff --git a/chromium/chrome/installer/setup/BUILD.gn b/chromium/chrome/installer/setup/BUILD.gn new file mode 100644 index 00000000000..92dc4a9ce0c --- /dev/null +++ b/chromium/chrome/installer/setup/BUILD.gn @@ -0,0 +1,113 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//chrome/version.gni") +import("//testing/test.gni") + +if (is_win) { + executable("setup") { + sources = [ + "setup.ico", + "setup.rc", + "setup_exe_version.rc.version", + "setup_main.cc", + "setup_main.h", + "setup_resource.h", + "uninstall.cc", + "uninstall.h", + ] + + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + + deps = [ + ":lib", + ":setup_exe_version", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//chrome/install_static:install_static_util", + "//components/crash/content/app:app", + ] + } + + static_library("lib") { + sources = [ + "app_launcher_installer.cc", + "app_launcher_installer.h", + "archive_patch_helper.cc", + "archive_patch_helper.h", + "install.cc", + "install.h", + "install_worker.cc", + "install_worker.h", + "installer_crash_reporter_client.cc", + "installer_crash_reporter_client.h", + "installer_crash_reporting.cc", + "installer_crash_reporting.h", + "installer_metrics.cc", + "installer_metrics.h", + "setup_constants.cc", + "setup_constants.h", + "setup_util.cc", + "setup_util.h", + "update_active_setup_version_work_item.cc", + "update_active_setup_version_work_item.h", + "user_hive_visitor.cc", + "user_hive_visitor.h", + ] + + public_deps = [ + "//base", + "//chrome/common:constants", + "//chrome/common:version_header", + "//chrome/installer/util:with_rc_strings", + "//chrome_elf:constants", + "//components/base32", + "//components/crash/content/app:app", + "//components/crash/content/app:lib", + "//components/crash/core/common", + "//content/public/common:static_switches", + "//courgette:courgette_lib", + "//rlz:rlz_lib", + "//third_party/bspatch", + "//third_party/zlib", + ] + } + + process_version("setup_exe_version") { + template_file = "setup_exe_version.rc.version" + output = "$target_gen_dir/setup_exe_version.rc" + } + + # This test covers the mini installer and setup tests. + test("setup_unittests") { + sources = [ + "archive_patch_helper_unittest.cc", + "install_unittest.cc", + "install_worker_unittest.cc", + "memory_unittest.cc", + "run_all_unittests.cc", + "setup_util_unittest.cc", + "setup_util_unittest.h", + "update_active_setup_version_work_item_unittest.cc", + "user_hive_visitor_unittest.cc", + ] + + deps = [ + ":lib", + "//base", + "//base:i18n", + "//base/test:test_support", + "//chrome/install_static:install_static_util", + "//chrome/installer/mini_installer:unit_tests", + "//testing/gmock", + "//testing/gtest", + ] + + data = [ + "//chrome/installer/test/data/", + "//chrome/test/data/installer/", + ] + } +} diff --git a/chromium/chrome/installer/test/BUILD.gn b/chromium/chrome/installer/test/BUILD.gn new file mode 100644 index 00000000000..c91c65f736a --- /dev/null +++ b/chromium/chrome/installer/test/BUILD.gn @@ -0,0 +1,63 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +assert(is_win) + +executable("alternate_version_generator") { + testonly = true + sources = [ + "alternate_version_generator_main.cc", + ] + + deps = [ + ":alternate_version_generator_lib", + "//base", + "//base/test:test_support", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//chrome/common:constants", + "//chrome/installer/util:with_rc_strings", + "//testing/gtest", + ] +} + +static_library("alternate_version_generator_lib") { + testonly = true + sources = [ + "alternate_version_generator.cc", + "alternate_version_generator.h", + "pe_image_resources.cc", + "pe_image_resources.h", + "resource_loader.cc", + "resource_loader.h", + "resource_updater.cc", + "resource_updater.h", + ] + deps = [ + "//base", + "//base:base_static", + "//chrome/common:constants", + "//chrome/installer/util:with_rc_strings", + ] +} + +test("upgrade_test") { + sources = [ + "run_all_tests.cc", + "upgrade_test.cc", + ] + deps = [ + ":alternate_version_generator_lib", + "//base", + "//base/test:test_support", + "//chrome/common:constants", + "//chrome/installer/util:with_rc_strings", + "//testing/gtest", + ] + data_deps = [ + "//chrome/installer/mini_installer", + ] +} diff --git a/chromium/chrome/installer/util/BUILD.gn b/chromium/chrome/installer/util/BUILD.gn new file mode 100644 index 00000000000..f9519b94846 --- /dev/null +++ b/chromium/chrome/installer/util/BUILD.gn @@ -0,0 +1,353 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//testing/test.gni") + +# This file deliberately has no default "util" target so dependants have to +# specify with the ":with_no_strings" or ":with_rc_strings" variants. Random +# code that ends up getting linked into chrome proper should depend on the +# ":with_no_strings" variant. Other standalone apps will need to decide if they +# need the resource strings or not. +# +# chrome/installer/util has generated strings on Windows. These appear as +# Windows resources and are fairly large (~200KB). They are generated by the +# ":generate_strings" target and compiled by the ":strings" target. +# +# Some code, like the Windows chrome.exe (the small bootstrap binary, not +# all of chrome.dll) code uses installer_util functions without calling any +# functions that use the strings. And historically in the GYP build the strings +# resource had to be manually linked, so the strings never ended up being in +# chrome.exe and everything was fine. +# +# Other code, like chrome.dll links to installer util, and hooks up a +# TranslationDelegate which overrides the strings retrieved from the resources +# with grit pak strings. +# +# In both of these cases, link to the ":with_no_strings" variant. However, this +# is obviously a fragile and confusing situation. In the "I don't use strings +# at all case", there is no definition of what works and doesn't work, and this +# may also change over time. As an example at the time of this writing, +# chrome.exe calls BrowserDistribution::GetRegistryPath. This function doesn't +# use any strings, but lots of other functions in BrowserDistribution do use +# localized strings. +# +# Ideally, this should be cleaved in two parts: the main "installer util" and +# some kind of mini installer util that just contains the functions needed by +# chrome.exe and any other clients that don't need the strings. It's likely +# we would still need the variant with no strings for when chrome.dll replaces +# all strings with its own versions. +static_library("with_no_strings") { + deps = [ + "//base", + "//chrome:strings", + "//chrome/common:constants", + "//components/variations", + "//content/public/common:result_codes", + ] + + # The constants target checks the Chrome distribution from this target. Both + # targets have to be linked together in practice. + allow_circular_includes_from = [ "//chrome/common:constants" ] + + if (is_win) { + sources = [ + "chrome_binaries_operations.cc", + "chrome_binaries_operations.h", + "chrome_browser_operations.cc", + "chrome_browser_operations.h", + "chrome_browser_sxs_operations.cc", + "chrome_browser_sxs_operations.h", + "chrome_frame_operations.cc", + "chrome_frame_operations.h", + "compat_checks.cc", + "compat_checks.h", + "delete_after_reboot_helper.cc", + "delete_after_reboot_helper.h", + "google_chrome_distribution.cc", + "google_chrome_distribution.h", + "html_dialog.h", + "html_dialog_impl.cc", + "installation_validator.cc", + "installation_validator.h", + "logging_installer.cc", + "logging_installer.h", + "lzma_file_allocator.cc", + "lzma_file_allocator.h", + "lzma_util.cc", + "lzma_util.h", + "master_preferences.cc", + "master_preferences.h", + "product.cc", + "product.h", + "product_operations.h", + "registry_entry.cc", + "registry_entry.h", + "scoped_user_protocol_entry.cc", + "scoped_user_protocol_entry.h", + "self_cleaning_temp_dir.cc", + "self_cleaning_temp_dir.h", + "shell_util.cc", + "shell_util.h", + "uninstall_metrics.cc", + "uninstall_metrics.h", + "user_experiment.cc", + "user_experiment.h", + ] + + deps += [ + # Need to depend on the generated strings target since files here + # depend on the generated header, but only depend on the ":strings" + # target (which actually compiles and causes the generated code to be + # linked) from the ":util" target. + ":generate_strings", + "//base/third_party/dynamic_annotations", + "//chrome/install_static:install_static_util", + "//components/base32", + "//components/metrics", + "//courgette:courgette_lib", + "//crypto", + "//third_party/bspatch", + "//third_party/crashpad/crashpad/client", + "//third_party/icu", + "//third_party/lzma_sdk", + ] + + libs = [ + "urlmon.lib", + "wbemuuid.lib", + "wtsapi32.lib", + ] + + configs += [ + "//build/config:precompiled_headers", + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "//build/config/compiler:no_size_t_to_int_warning", + ] + + sources += [ + "advanced_firewall_manager_win.cc", + "advanced_firewall_manager_win.h", + "app_command.cc", + "app_command.h", + "app_commands.cc", + "app_commands.h", + "app_registration_data.h", + "auto_launch_util.cc", + "auto_launch_util.h", + "beacons.cc", + "beacons.h", + "browser_distribution.cc", + "browser_distribution.h", + "callback_work_item.cc", + "callback_work_item.h", + "channel_info.cc", + "channel_info.h", + "chrome_frame_distribution.cc", + "chrome_frame_distribution.h", + "chromium_binaries_distribution.cc", + "chromium_binaries_distribution.h", + "conditional_work_item_list.cc", + "conditional_work_item_list.h", + "copy_tree_work_item.cc", + "copy_tree_work_item.h", + "create_dir_work_item.cc", + "create_dir_work_item.h", + "create_reg_key_work_item.cc", + "create_reg_key_work_item.h", + "delete_reg_key_work_item.cc", + "delete_reg_key_work_item.h", + "delete_reg_value_work_item.cc", + "delete_reg_value_work_item.h", + "delete_tree_work_item.cc", + "delete_tree_work_item.h", + "duplicate_tree_detector.cc", + "duplicate_tree_detector.h", + "firewall_manager_win.cc", + "firewall_manager_win.h", + "google_chrome_binaries_distribution.cc", + "google_chrome_binaries_distribution.h", + "google_chrome_sxs_distribution.cc", + "google_chrome_sxs_distribution.h", + "google_update_constants.cc", + "google_update_constants.h", + "google_update_settings.cc", + "google_update_settings.h", + "google_update_util.cc", + "google_update_util.h", + "helper.cc", + "helper.h", + "install_util.cc", + "install_util.h", + "installation_state.cc", + "installation_state.h", + "installer_state.cc", + "installer_state.h", + "l10n_string_util.cc", + "l10n_string_util.h", + "language_selector.cc", + "language_selector.h", + "legacy_firewall_manager_win.cc", + "legacy_firewall_manager_win.h", + "master_preferences_constants.cc", + "master_preferences_constants.h", + "module_util_win.cc", + "module_util_win.h", + "move_tree_work_item.cc", + "move_tree_work_item.h", + "non_updating_app_registration_data.cc", + "non_updating_app_registration_data.h", + "registry_key_backup.cc", + "registry_key_backup.h", + "self_reg_work_item.cc", + "self_reg_work_item.h", + "set_reg_value_work_item.cc", + "set_reg_value_work_item.h", + "updating_app_registration_data.cc", + "updating_app_registration_data.h", + "util_constants.cc", + "util_constants.h", + "wmi.cc", + "wmi.h", + "work_item.cc", + "work_item.h", + "work_item_list.cc", + "work_item_list.h", + ] + } else { + sources = [ + "master_preferences.cc", + "master_preferences.h", + "master_preferences_constants.cc", + "master_preferences_constants.h", + ] + } +} + +# Use this version of installer_util to link to the generated strings in .rc +# format. +group("with_rc_strings") { + public_deps = [ + ":with_no_strings", + ] + if (is_win) { + public_deps += [ ":strings" ] + } +} + +action("generate_strings") { + visibility = [ + ":strings", + ":with_no_strings", + ] + script = "prebuild/create_string_rc.py" + + if (is_chrome_branded) { + grdfile = "//chrome/app/google_chrome_strings.grd" + } else { + grdfile = "//chrome/app/chromium_strings.grd" + } + + inputs = [ + grdfile, + ] + + outputs = [ + "$target_gen_dir/installer_util_strings.h", + "$target_gen_dir/installer_util_strings.rc", + ] + + args = [ + "-i", + rebase_path(grdfile, root_build_dir) + ":resources", + "-n", + "installer_util_strings", + "-o", + rebase_path(target_gen_dir, root_build_dir), + ] +} + +# Compile the generated .rc file. +source_set("strings") { + sources = get_target_outputs(":generate_strings") + public_deps = [ + ":generate_strings", + ] +} + +if (is_win) { + test("installer_util_unittests") { + sources = [ + "../setup/compat_checks_unittest.cc", + "advanced_firewall_manager_win_unittest.cc", + "beacons_unittest.cc", + "callback_work_item_unittest.cc", + "channel_info_unittest.cc", + "conditional_work_item_list_unittest.cc", + "copy_tree_work_item_unittest.cc", + "create_dir_work_item_unittest.cc", + "create_reg_key_work_item_unittest.cc", + "delete_after_reboot_helper_unittest.cc", + "delete_reg_key_work_item_unittest.cc", + "delete_reg_value_work_item_unittest.cc", + "delete_tree_work_item_unittest.cc", + "duplicate_tree_detector_unittest.cc", + "fake_installation_state.h", + "fake_product_state.h", + "google_update_settings_unittest.cc", + "install_util_unittest.cc", + "installation_validation_helper.cc", + "installation_validation_helper.h", + "installation_validator_unittest.cc", + "installer_state_unittest.cc", + "installer_util_test_common.cc", + "installer_util_test_common.h", + "language_selector_unittest.cc", + "legacy_firewall_manager_win_unittest.cc", + "logging_installer_unittest.cc", + "lzma_file_allocator_unittest.cc", + "lzma_util_unittest.cc", + "master_preferences_unittest.cc", + "move_tree_work_item_unittest.cc", + "product_state_unittest.cc", + "product_unittest.cc", + "registry_key_backup_unittest.cc", + "registry_test_data.cc", + "registry_test_data.h", + "run_all_unittests.cc", + "scoped_user_protocol_entry_unittest.cc", + "self_cleaning_temp_dir_unittest.cc", + "set_reg_value_work_item_unittest.cc", + "shell_util_unittest.cc", + "test_app_registration_data.cc", + "test_app_registration_data.h", + "uninstall_metrics_unittest.cc", + "wmi_unittest.cc", + "work_item_list_unittest.cc", + "work_item_mocks.cc", + "work_item_mocks.h", + "work_item_unittest.cc", + ] + + deps = [ + ":with_rc_strings", + "//base", + "//base:i18n", + "//base/test:test_support", + "//chrome:other_version", + "//chrome/install_static:install_static_util", + "//chrome/installer/setup:lib", + "//chrome/installer/test:alternate_version_generator_lib", + "//components/variations", + "//testing/gmock", + "//testing/gtest", + ] + + data = [ + "//chrome/test/data/extensions/", + "//chrome/test/data/installer/", + ] + } +} # is_win diff --git a/chromium/chrome/renderer/BUILD.gn b/chromium/chrome/renderer/BUILD.gn new file mode 100644 index 00000000000..309f71033f0 --- /dev/null +++ b/chromium/chrome/renderer/BUILD.gn @@ -0,0 +1,227 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//tools/grit/grit_rule.gni") + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("../chrome_renderer.gypi") ], + "scope", + [ "../chrome_renderer.gypi" ]) + +# GYP version: chrome/chrome_resources.gyp:chrome_resources +# (generate_renderer_resources action) +grit("resources") { + source = "resources/renderer_resources.grd" + output_dir = "$root_gen_dir/chrome" + output_name = "renderer_resources" + outputs = [ + "grit/renderer_resources.h", + "renderer_resources_100_percent.pak", + "renderer_resources_200_percent.pak", + "renderer_resources_300_percent.pak", + ] +} + +static_library("renderer") { + sources = rebase_path(gypi_values.chrome_renderer_sources, ".", "..") + + defines = [] + + deps = [ + "//chrome:resources", + "//chrome:strings", + "//chrome/common", + "//chrome/common:mojo_bindings", + "//components/autofill/content/renderer", + "//components/cdm/renderer", + "//components/content_settings/content/common", + "//components/data_reduction_proxy/content/common", + "//components/data_reduction_proxy/core/common", + "//components/dom_distiller/content/renderer", + "//components/error_page/renderer", + "//components/guest_view/renderer", + "//components/network_hints/renderer", + "//components/omnibox/common", + "//components/page_load_metrics/renderer", + "//components/password_manager/content/renderer", + "//components/plugins/renderer", + "//components/printing/renderer", + "//components/resources:components_resources", + "//components/startup_metric_utils/common:interfaces", + "//components/subresource_filter/content/renderer", + "//components/translate/content/renderer", + "//components/translate/core/common", + "//components/translate/core/language_detection", + "//components/visitedlink/renderer", + "//components/web_cache/renderer", + "//content/app/resources", + "//content/app/strings", + "//content/public/renderer", + "//net", + "//skia", + "//storage/common", + "//third_party/WebKit/public:blink", + "//third_party/WebKit/public:image_resources", + "//third_party/WebKit/public:resources", + "//third_party/icu", + "//third_party/re2", + "//third_party/widevine/cdm:version_h", + "//ui/surface", + "//v8:v8", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + if (!is_ios) { + deps += [ + "//chrome/common/net", + "//components/contextual_search:renderer", + "//media", + ] + } + + if (enable_nacl) { + deps += [ + "//components/nacl/loader", + "//components/nacl/renderer", + ] + } + + if (enable_plugins) { + sources += + rebase_path(gypi_values.chrome_renderer_plugin_sources, ".", "..") + deps += [ + "//components/pdf/renderer", + "//components/strings", + "//ppapi/host", + "//ppapi/proxy", + "//ppapi/proxy:ipc", + "//ppapi/shared_impl", + ] + } + + if (safe_browsing_mode != 0) { + sources += + rebase_path(gypi_values.chrome_renderer_basic_safe_browsing_sources, + ".", + "..") + if (safe_browsing_mode == 1) { + sources += + rebase_path(gypi_values.chrome_renderer_full_safe_browsing_sources, + ".", + "..") + deps += [ + "//chrome/common/safe_browsing:proto", + "//third_party/smhasher:murmurhash3", + ] + } + } + + if (enable_extensions) { + sources += + rebase_path(gypi_values.chrome_renderer_extensions_sources, ".", "..") + deps += [ + # TODO(hclam): See crbug.com/298380 for details. + # We should isolate the APIs needed by the renderer. + "//chrome/common/extensions/api", + "//extensions:extensions_resources", + "//extensions/renderer", + "//media/cast:net", + "//media/cast:receiver", + "//media/cast:sender", + ] + if (!enable_webrtc) { + sources -= [ + "media/cast_receiver_session.cc", + "media/cast_receiver_session.h", + "media/cast_rtp_stream.cc", + "media/cast_rtp_stream.h", + ] + } + } + if (enable_webrtc) { + sources += + rebase_path(gypi_values.chrome_renderer_webrtc_sources, ".", "..") + } + if (enable_extensions && enable_webrtc) { + sources += + rebase_path(gypi_values.chrome_renderer_webrtc_extensions_sources, + ".", + "..") + } + if (enable_spellcheck) { + sources += + rebase_path(gypi_values.chrome_renderer_spellchecker_sources, ".", "..") + if (!is_android) { + deps += [ "//third_party/hunspell" ] + } + } + if (!use_browser_spellchecker) { + sources -= [ + "spellchecker/platform_spelling_engine.cc", + "spellchecker/platform_spelling_engine.h", + ] + } + if (enable_basic_printing || enable_print_preview) { + deps += [ "//printing" ] + sources += + rebase_path(gypi_values.chrome_renderer_printing_sources, ".", "..") + if (enable_print_preview) { + sources += rebase_path(gypi_values.chrome_renderer_full_printing_sources, + ".", + "..") + } + } + + if (is_win) { + deps += [ "//third_party/wtl" ] + } + if (is_android) { + sources -= [ + "spellchecker/hunspell_engine.cc", + "spellchecker/hunspell_engine.h", + ] + } +} + +# In GYP this is part of test_support_common. +source_set("test_support") { + testonly = true + visibility = [ "//chrome/test:test_support" ] + + sources = [ + "chrome_mock_render_thread.cc", + "chrome_mock_render_thread.h", + "safe_browsing/mock_feature_extractor_clock.cc", + "safe_browsing/mock_feature_extractor_clock.h", + "safe_browsing/test_utils.cc", + "safe_browsing/test_utils.h", + ] + + deps = [ + ":renderer", + "//content/test:test_support", + "//testing/gmock", + "//testing/gtest", + ] + + if (enable_print_preview) { + deps += [ "//chrome/service" ] + } + + if (enable_webrtc) { + sources += [ + "media/mock_webrtc_logging_message_filter.cc", + "media/mock_webrtc_logging_message_filter.h", + ] + } + + if (is_android) { + sources -= [ + "safe_browsing/mock_feature_extractor_clock.cc", + "safe_browsing/mock_feature_extractor_clock.h", + ] + } +} diff --git a/chromium/chrome/service/BUILD.gn b/chromium/chrome/service/BUILD.gn new file mode 100644 index 00000000000..8cadbc2232b --- /dev/null +++ b/chromium/chrome/service/BUILD.gn @@ -0,0 +1,81 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +static_library("service") { + sources = [ + "cloud_print/cdd_conversion_win.cc", + "cloud_print/cdd_conversion_win.h", + "cloud_print/cloud_print_auth.cc", + "cloud_print/cloud_print_auth.h", + "cloud_print/cloud_print_connector.cc", + "cloud_print/cloud_print_connector.h", + "cloud_print/cloud_print_message_handler.cc", + "cloud_print/cloud_print_message_handler.h", + "cloud_print/cloud_print_proxy.cc", + "cloud_print/cloud_print_proxy.h", + "cloud_print/cloud_print_proxy_backend.cc", + "cloud_print/cloud_print_proxy_backend.h", + "cloud_print/cloud_print_service_helpers.cc", + "cloud_print/cloud_print_service_helpers.h", + "cloud_print/cloud_print_token_store.cc", + "cloud_print/cloud_print_token_store.h", + "cloud_print/cloud_print_url_fetcher.cc", + "cloud_print/cloud_print_url_fetcher.h", + "cloud_print/cloud_print_wipeout.cc", + "cloud_print/cloud_print_wipeout.h", + "cloud_print/connector_settings.cc", + "cloud_print/connector_settings.h", + "cloud_print/job_status_updater.cc", + "cloud_print/job_status_updater.h", + "cloud_print/print_system.cc", + "cloud_print/print_system.h", + "cloud_print/print_system_win.cc", + "cloud_print/printer_job_handler.cc", + "cloud_print/printer_job_handler.h", + "cloud_print/printer_job_queue_handler.cc", + "cloud_print/printer_job_queue_handler.h", + "net/service_url_request_context_getter.cc", + "net/service_url_request_context_getter.h", + "service_ipc_server.cc", + "service_ipc_server.h", + "service_main.cc", + "service_process.cc", + "service_process.h", + "service_process_prefs.cc", + "service_process_prefs.h", + ] + + configs += [ + "//build/config/compiler:no_size_t_to_int_warning", + "//build/config/compiler:wexit_time_destructors", + ] + + deps = [ + "//base", + "//chrome:strings", + "//chrome/common", + "//components/cloud_devices/common", + "//google_apis", + "//jingle:notifier", + "//mojo/edk/system", + "//net", + "//printing", + "//skia", + "//third_party/libjingle", + ] + + if (use_cups && !is_chromeos) { + sources += [ "cloud_print/print_system_cups.cc" ] + configs += [ "//printing:cups" ] + } else if (is_win) { + sources += [ + "service_utility_process_host.cc", + "service_utility_process_host.h", + ] + } else { + sources += [ "cloud_print/print_system_dummy.cc" ] + } +} diff --git a/chromium/chrome/test/BUILD.gn b/chromium/chrome/test/BUILD.gn new file mode 100644 index 00000000000..0a016f2ffeb --- /dev/null +++ b/chromium/chrome/test/BUILD.gn @@ -0,0 +1,2474 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//build/config/compiler/compiler.gni") +import("//build/config/crypto.gni") +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//chrome/chrome_tests.gni") +import("//chrome/common/features.gni") +import("//chrome/test/base/js2gtest.gni") +import("//testing/test.gni") + +if (is_android) { + import("//build/config/android/rules.gni") +} + +# This target exists to reference other test executables to bring these files +# into the build. +group("test") { + testonly = true +} + +# GYP version: chrome/chrome_tests_unit.gypi:test_support_common +# +# Use a static library here because many test binaries depend on this but don't +# require many files from it. This makes linking more efficient. +static_library("test_support") { + defines = [] + testonly = true + + sources = [ + "base/chrome_process_util.cc", + "base/chrome_process_util.h", + "base/chrome_process_util_mac.cc", + "base/chrome_render_view_host_test_harness.cc", + "base/chrome_render_view_host_test_harness.h", + "base/chrome_test_launcher.cc", + "base/chrome_test_launcher.h", + "base/chrome_test_suite.cc", + "base/chrome_test_suite.h", + "base/chrome_unit_test_suite.cc", + "base/chrome_unit_test_suite.h", + "base/dialog_test_browser_window.cc", + "base/dialog_test_browser_window.h", + "base/find_in_page_observer.cc", + "base/find_in_page_observer.h", + "base/scoped_browser_locale.cc", + "base/scoped_browser_locale.h", + "base/scoped_bundle_swizzler_mac.h", + "base/scoped_bundle_swizzler_mac.mm", + "base/scoped_testing_local_state.cc", + "base/scoped_testing_local_state.h", + "base/search_test_utils.cc", + "base/search_test_utils.h", + "base/test_browser_window.cc", + "base/test_browser_window.h", + "base/test_launcher_utils.cc", + "base/test_launcher_utils.h", + "base/test_switches.cc", + "base/test_switches.h", + "base/testing_browser_process.cc", + "base/testing_browser_process.h", + "base/testing_browser_process_platform_part.cc", + "base/testing_browser_process_platform_part.h", + "base/testing_io_thread_state.cc", + "base/testing_io_thread_state.h", + "base/testing_profile.cc", + "base/testing_profile.h", + "base/testing_profile_manager.cc", + "base/testing_profile_manager.h", + "base/tracing.cc", + "base/tracing.h", + "logging/win/file_logger.cc", + "logging/win/file_logger.h", + "logging/win/log_file_printer.cc", + "logging/win/log_file_printer.h", + "logging/win/log_file_reader.cc", + "logging/win/log_file_reader.h", + "logging/win/mof_data_parser.cc", + "logging/win/mof_data_parser.h", + "logging/win/test_log_collector.cc", + "logging/win/test_log_collector.h", + ] + + configs += [ "//build/config:precompiled_headers" ] + + # New deps should go in the non-iOS section below. + public_deps = [ + "//base/test:test_support", + "//chrome:resources", + "//chrome:strings", + "//chrome/app:test_support", + + #"//chrome/app/theme:theme_resources", + "//chrome/browser:test_support", + "//chrome/common:test_support", + "//chrome/renderer:test_support", + "//components/bookmarks/test", + "//components/gcm_driver:test_support", + "//components/gcm_driver/instance_id:test_support", + "//components/history/core/test:test", + "//components/metrics:test_support", + "//components/omnibox/browser:test_support", + "//components/password_manager/core/browser:test_support", + "//components/pref_registry:test_support", + "//components/prefs:test_support", + "//components/rappor:test_support", + "//components/search_engines:test_support", + "//components/signin/core/browser:test_support", + "//components/sync_driver:test_support", + "//components/sync_sessions:test_support", + "//components/syncable_prefs:test_support", + "//components/toolbar:test_support", + "//components/update_client:test_support", + "//components/zoom:test_support", + "//content/public/app:both", + "//content/test:test_support", + "//net", + "//net:test_support", + "//skia", + "//sql", + "//sql:test_support", + "//sync", + "//testing/gmock", + "//testing/gtest", + "//third_party/zlib", + "//ui/gfx:test_support", + "//ui/message_center:test_support", + ] + + if (!is_ios) { + public_deps += [ + "//chrome/child", + "//chrome/renderer", + "//chrome/utility", + "//components/autofill/core/browser:test_support", + "//components/captive_portal:test_support", + "//components/chooser_controller:test_support", + "//components/gcm_driver/crypto:test_support", + "//components/guest_view/browser:test_support", + "//components/infobars/core", + "//components/sessions:test_support", + "//components/web_resource:test_support", + "//content/public/child", + "//content/public/common", + "//content/public/renderer", + "//content/public/utility", + "//google_apis:test_support", + "//ipc:test_support", + "//media:test_support", + "//sql:test_support", + "//third_party/leveldatabase", + "//ui/base", + "//ui/events:events_base", + "//ui/gl", + ] + } + if (enable_plugins) { + public_deps += [ "//ppapi/shared_impl" ] + } + + if (is_android) { + public_deps -= [ "//ui/message_center:test_support" ] + sources -= [ + "base/dialog_test_browser_window.cc", + "base/dialog_test_browser_window.h", + "base/test_browser_window.cc", + "base/test_browser_window.h", + ] + } + + if (enable_extensions) { + public_deps += [ + "//chrome/common/extensions/api", + "//extensions:test_support", + ] + } + + if (is_linux) { + public_deps += [ "//crypto:platform" ] + } + if (is_mac) { + sources += [ + "//chrome/app/chrome_crash_reporter_client.cc", + "//chrome/app/chrome_crash_reporter_client_mac.mm", + ] + public_deps += [ + "//breakpad", + "//components/crash/content/app", + "//third_party/ocmock", + ] + } + if (is_win) { + sources += [ "//chrome/app/chrome_crash_reporter_client_win.cc" ] + public_deps += [ + "//chrome/install_static:install_static_util", + "//components/crash/content/app", + "//third_party/wtl", + ] + } + if (is_chromeos) { + public_deps += [ + "//components/ownership", + "//components/user_manager:test_support", + ] + } + + if (use_aura) { + sources += [ + "base/test_browser_window_aura.cc", + "base/test_browser_window_aura.h", + ] + } + + if (enable_plugins && enable_pdf) { + public_deps += [ "//pdf" ] + } + + if (use_ash) { + sources += [ + "base/default_ash_event_generator_delegate.cc", + "base/default_ash_event_generator_delegate.h", + ] + + public_deps += [ + "//ash", + "//ash:test_support", + "//ui/aura", + "//ui/aura:test_support", + ] + } + if (toolkit_views) { + public_deps += [ "//ui/views:test_support" ] + } + + if (enable_extensions) { + public_deps += [ + "//chrome/common/extensions/api", + "//extensions:test_support", + ] + } +} + +# TODO(GYP_GONE): Delete this after we've converted everything to GN. +# The _run targets exist only for compatibility w/ GYP. +group("telemetry_gpu_test_run") { + testonly = true + deps = [ + ":telemetry_gpu_test", + ] +} + +group("telemetry_gpu_test") { + testonly = true + deps = [ + "//tools/perf/chrome_telemetry_build:telemetry_chrome_test", + ] + + data = [ + # For isolate contract. + "//testing/scripts/common.py", + "//testing/xvfb.py", + "//testing/scripts/run_telemetry_benchmark_as_googletest.py", + + "//content/test/gpu/", + "//content/test/data/gpu/", + + # For GpuProcess.video + "//content/test/data/media/bear.ogv", + + # For webgl_conformance + "//third_party/webgl/", + "//content/test/gpu/run_gpu_test.py", + ] +} + +# TODO(GYP_GONE): Delete this after we've converted everything to GN. +# The _run targets exist only for compatibility w/ GYP. +group("telemetry_gpu_integration_test_run") { + testonly = true + deps = [ + ":telemetry_gpu_integration_test", + ] +} + +group("telemetry_gpu_integration_test") { + testonly = true + deps = [ + "//tools/perf/chrome_telemetry_build:telemetry_chrome_test", + ] + + data = [ + # For isolate contract. + "//testing/scripts/common.py", + "//testing/xvfb.py", + "//testing/scripts/run_gpu_integration_test_as_googletest.py", + + "//content/test/gpu/", + "//content/test/data/gpu/", + + # For GpuProcess.video + "//content/test/data/media/bear.ogv", + + # For webgl_conformance + "//third_party/webgl/", + "//content/test/gpu/run_gpu_integration_test.py", + ] +} + +if (!is_android) { + # GYP version: chrome/chrome_tests.gypi:test_support_ui + static_library("test_support_ui") { + defines = [] + testonly = true + + sources = [ + "base/in_process_browser_test.cc", + "base/in_process_browser_test.h", + "base/in_process_browser_test_mac.cc", + "base/ui_test_utils.cc", + "base/ui_test_utils.h", + ] + + configs += [ "//build/config:precompiled_headers" ] + + public_deps = [ + "//chrome/browser:test_support_ui", + ] + deps = [ + "//components/metrics:test_support", + "//components/os_crypt:test_support", + "//skia", + "//testing/gtest", + ] + + if (enable_plugins) { + sources += [ + "ppapi/ppapi_test.cc", + "ppapi/ppapi_test.h", + ] + } + } + + import("//third_party/protobuf/proto_library.gni") + + # GYP version: chrome/chrome_tests_unit.gypi:ipc_protobuf_message_test_proto + proto_library("test_proto") { + sources = [ + "../common/safe_browsing/ipc_protobuf_message_test.proto", + ] + } + + test("interactive_ui_tests") { + sources = + rebase_path(chrome_tests_gypi_values.chrome_interactive_ui_test_sources, + ".", + "//chrome") + + configs += [ "//build/config:precompiled_headers" ] + + data_deps = [] + + data = [ + "data/", + "//content/test/data/", + "//net/tools/testserver/", + "//ppapi/tests/test_case.html", + "//ppapi/tests/test_case.html.mock-http-headers", + "//ppapi/tests/test_page.css", + "//ppapi/tests/test_page.css.mock-http-headers", + "//third_party/pyftpdlib/", + "//third_party/pywebsocket/", + "//third_party/tlslite/", + "//third_party/zlib/google/test/data/", + "//tools/metrics/histograms/histograms.xml", + "$root_out_dir/pyproto/google/", + "$root_out_dir/ui_test.pak", + ] + if (is_linux || is_win) { + data += [ + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/chrome_200_percent.pak", + "$root_out_dir/locales/en-US.pak", + "$root_out_dir/locales/fr.pak", + ] + } + if (is_linux) { + data += [ "$root_out_dir/libppapi_tests.so" ] + } + + if (!is_mac) { + data_deps += [ "//chrome:packed_extra_resources" ] + } + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + ldflags = [] + + deps = [ + ":test_support", + ":test_support_ui", + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/browser", + "//chrome/browser/devtools", + "//chrome/renderer", + "//components/resources", + "//content/app/resources", + "//content/test:browsertest_base", + "//crypto:platform", + "//crypto:test_support", + "//google_apis:test_support", + "//net", + "//net:net_resources", + "//net:test_support", + "//skia", + "//sync", + "//sync:test_support_sync_api", + "//testing/gmock", + "//testing/gtest", + "//third_party/hunspell", + "//third_party/icu", + "//third_party/libpng", + "//third_party/zlib", + "//ui/base:test_support", + "//ui/resources:ui_test_pak", + "//ui/web_dialogs:test_support", + ] + + # TODO(rockot) bug 505926: The chrome_extensions_interactive_uitests target + # should be deleted and this line removed. See the + # chrome_extensions_interactive_uitests target for more. + deps += [ "//extensions:chrome_extensions_interactive_uitests" ] + + # Runtime dependencies + data_deps += [ + "//ppapi:ppapi_tests", + "//third_party/mesa:osmesa", + ] + + if (toolkit_views) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_views_sources, + ".", + "//chrome") + deps += [ + "//ui/views", + "//ui/views:test_support", + "//ui/views/controls/webview:test_support", + ] + if (!is_mac) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_views_non_mac_sources, + ".", + "//chrome") + } + if (is_linux) { + if (!is_chromeos) { + # Desktop linux. + sources -= [ + # TODO(port): This times out. Attempts have been made to fix the + # individual failures, but each time I disable a test from these + # suites, it seems like one or another starts timing out too. + "../browser/ui/views/keyboard_access_browsertest.cc", + ] + if (!use_ozone) { + sources += [ "../browser/ui/libgtk2ui/select_file_dialog_interactive_uitest.cc" ] + configs += [ "//build/config/linux/gtk2:gtk2_internal_config" ] + } + } + } + if (is_chromeos || !use_x11) { + sources -= [ + "../../ui/views/widget/desktop_aura/desktop_window_tree_host_x11_interactive_uitest.cc", + "../../ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc", + ] + } + if (use_aura) { + # TODO(ekaramad): These tests are activated for aura only. They should + # be moved to 'interactive_ui_tests' sources for all platforms once bug + # 578168 is fixed. + sources += [ "//chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc" ] + deps += [ "//ui/touch_selection" ] + } + } + + if (!is_desktop_linux) { + # Everything but desktop Linux. + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_non_desktop_linux_sources, + ".", + "//chrome") + } + + if (is_chromeos) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_chromeos_sources, + ".", + "//chrome") + sources += [ "../browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc" ] + + deps += [ + "//ash/resources", + "//chromeos", + ] + + data += [ + "//chrome/browser/chromeos/login/test/https_forwarder.py", + "//google_apis/test/", + "$root_out_dir/resources/chromeos/", + ] + + data_deps += [ "//ui/keyboard:resources" ] + + if (enable_nacl) { + data_deps += [ + "//components/nacl/loader:nacl_helper", + "//components/nacl/loader:helper_nonsfi", + "//ppapi/native_client:irt", + ] + } + + if (is_chrome_branded) { + sources -= [ + # These tests are failing on official cros bots. crbug.com/431450. + "../browser/ui/views/bookmarks/bookmark_bar_view_test.cc", + ] + } + } else { + # ChromeOS doesn't use panels, everybody else does. + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_panels_sources, + ".", + "//chrome") + + # TODO(tapted): Include on mac when views panels are ported. + if (toolkit_views && !is_mac) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_panels_views_sources, + ".", + "//chrome") + } + } + + if (!is_linux) { + # Non-Linux platforms (Linux includes ChromeOS here). + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_non_linux_and_chromeos_sources, + ".", + "//chrome") + } + + if (is_win) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_win_sources, + ".", + "//chrome") + deps += [ + "//chrome:other_version", + "//chrome/install_static:install_static_util", + "//third_party/isimpledom", + "//third_party/wtl", + "//ui/resources", + ] + + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + + libs = [ "oleacc.lib" ] + } + + if (is_mac) { + data_deps += [ + "//chrome", + "//chrome:chrome_framework", + ] + + # The browser window can be views or Cocoa on Mac. Test accordingly. + if (mac_views_browser) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_views_non_mac_sources, + ".", + "//chrome") + + # Aura depended tests. + sources -= [ "../browser/ui/views/bookmarks/bookmark_bar_view_test.cc" ] + } else { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_cocoa_sources, + ".", + "//chrome") + } + } + + if (use_x11) { + configs += [ "//build/config/linux:xtst" ] + data_deps += [ "//tools/xdisplaycheck" ] + } + + if (enable_app_list) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_app_list_sources, + ".", + "//chrome") + } + + if (!use_aura) { + sources -= [ + "base/interactive_test_utils_aura.cc", + "base/interactive_test_utils_aura.h", + ] + } + + if (use_ash) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_ash_sources, + ".", + "//chrome") + if (is_chromeos) { + sources -= [ + # Use only the _chromeos version on ChromeOS. + "base/view_event_test_platform_part_default.cc", + ] + } + deps += [ "//ash:interactive_ui_test_support" ] + } + + if (enable_notifications) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_interactive_ui_test_notifications_sources, + ".", + "//chrome") + + # Non-ChromeOS notifications tests (ChromeOS does not use cross-platform + # panels). + if (!is_chromeos) { + sources += [ + "../browser/notifications/notification_interactive_uitest.cc", + "../browser/notifications/platform_notification_service_interactive_uitest.cc", + ] + } + + if (is_android) { + sources -= [ + # Android does not use the message center-based Notification system. + "../browser/notifications/message_center_notifications_browsertest.cc", + + # TODO(peter): Enable the Notification browser tests. + "../browser/notifications/notification_interactive_uitest.cc", + "../browser/notifications/platform_notification_service_interactive_uitest.cc", + ] + } + } # enable_notifications + + if (!use_aura || is_chromeos) { + sources -= + [ "../../ui/views/corewm/desktop_capture_controller_unittest.cc" ] + } + } + + if (enable_app_list && use_ash) { + source_set("test_support_applist_ash") { + defines = [] + testonly = true + + sources = rebase_path( + chrome_tests_gypi_values.chrome_browser_app_list_ash_test_support_sources, + ".", + "//chrome") + + deps = [ + "//chrome/browser/ui", + "//ui/app_list/presenter:test_support", + ] + } + } + + source_set("sync_integration_test_support") { + testonly = true + sources = rebase_path( + chrome_tests_gypi_values.test_support_sync_integration_sources, + ".", + "//chrome") + public_deps = [ + "//chrome/browser", + ] + deps = [ + ":test_support", + "//base", + "//components/invalidation/impl", + "//components/invalidation/impl:test_support", + "//content/test:browsertest_base", + "//net", + "//skia", + "//sync", + "//sync:test_support_sync_fake_server", + "//sync:test_support_sync_testserver", + ] + + if (is_mac) { + sources -= [ + "../browser/sync/test/integration/dictionary_helper.cc", + "../browser/sync/test/integration/dictionary_helper.h", + "../browser/sync/test/integration/dictionary_load_observer.cc", + "../browser/sync/test/integration/dictionary_load_observer.h", + ] + } + if (enable_app_list) { + deps += [ "//ui/app_list:test_support" ] + } else { + sources -= [ + "../browser/sync/test/integration/sync_app_list_helper.cc", + "../browser/sync/test/integration/sync_app_list_helper.h", + ] + } + if (!is_chromeos) { + sources -= [ + "../browser/sync/test/integration/sync_arc_package_helper.cc", + "../browser/sync/test/integration/sync_arc_package_helper.h", + "../browser/sync/test/integration/wifi_credentials_helper.cc", + "../browser/sync/test/integration/wifi_credentials_helper.h", + ] + } + if (is_chromeos) { + deps += [ + "//components/arc:arc_test_support", + "//components/user_manager:test_support", + ] + } + } + + js2gtest("browser_tests_js_webui") { + test_type = "webui" + sources = rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_webui_js_sources, + ".", + "//chrome") + if (is_chrome_branded) { + # crbug.com/230471 + sources -= [ "data/webui/accessibility_audit_browsertest.js" ] + } + if (!is_chromeos) { + sources -= [ + "data/webui/certificate_viewer_dialog_test.js", + "data/webui/settings/bluetooth_page_browsertest_chromeos.js", + "data/webui/settings/easy_unlock_browsertest_chromeos.js", + ] + } else { + sources -= [ "data/webui/md_user_manager/user_manager_browsertest.js" ] + } + if (is_mac) { + sources -= [ + # TODO(rouslan): This test depends on the custom dictionary UI, + # which is disabled on Mac. + "../browser/ui/webui/options/edit_dictionary_browsertest.js", + + # TODO(rouslan): This test depends on hunspell and we cannot run it + # on Mac, which does not use hunspell by default. + "../browser/ui/webui/options/language_options_dictionary_download_browsertest.js", + "../browser/ui/webui/options/multilanguage_options_webui_browsertest.js", + ] + } + if (!enable_app_list) { + sources -= [ "../browser/ui/webui/app_list/start_page_browsertest.js" ] + } + if (!enable_print_preview) { + sources -= [ "data/webui/print_preview.js" ] + } + if (enable_media_router) { + sources += + [ "data/webui/media_router/media_router_elements_browsertest.js" ] + } + deps = [ + "//chrome/browser/ui", + "//skia", + ] + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + } + + # TODO(GYP_GONE): Delete this after we've converted everything to GN. + # The _run targets exist only for compatibility w/ GYP. + group("telemetry_unittests_run") { + testonly = true + deps = [ + ":telemetry_unittests", + ] + } + + group("telemetry_unittests") { + testonly = true + deps = [ + "//tools/perf/chrome_telemetry_build:telemetry_chrome_test", + ] + + data = [ + "//tools/perf/run_telemetry_tests", + + # For isolate contract. + "//testing/scripts/common.py", + "//testing/xvfb.py", + "//testing/scripts/run_telemetry_as_googletest.py", + ] + } + + group("telemetry_gpu_unittests_run") { + testonly = true + deps = [ + ":telemetry_gpu_unittests", + ] + } + + group("telemetry_gpu_unittests") { + deps = [ + "//third_party/catapult/telemetry:telemetry_test_support", + ] + data = [ + # TODO(kbr): refactor the telemetry dependencies more cleanly. + "//content/test/gpu/", + "//content/test/data/gpu/", + + # For GpuProcess.video + "//content/test/data/media/bear.ogv", + + # For webgl_conformance_expectations_unittest + "//third_party/webgl/src/sdk/tests/", + + # For resolve the imports in content/test/gpu/run_gpu_test.py + "//tools/perf/chrome_telemetry_build/", + + # From telemetry_gpu_unittests.isolate + "//third_party/pylint/", + "//third_party/logilab/", + "//testing/scripts/common.py", + "//testing/xvfb.py", + "//testing/scripts/run_telemetry_as_googletest.py", + ] + } + + # TODO(GYP_GONE): Delete this after we've converted everything to GN. + # The _run targets exist only for compatibility w/ GYP. + group("tab_capture_end2end_tests_run") { + testonly = true + deps = [ + ":browser_tests", + ] + } + + # TODO(GYP_GONE): Delete this after we've converted everything to GN. + # The _run targets exist only for compatibility w/ GYP. + group("mash_browser_tests_run") { + testonly = true + deps = [ + ":mash_browser_tests", + ] + } + + group("mash_browser_tests") { + testonly = true + data = [ + "//testing/buildbot/filters/mojo.fyi.browser_tests.filter", + ] + data_deps = [ + ":browser_tests", + ] + } + + test("browser_tests") { + sources = [ + "base/browser_tests_main.cc", + ] + sources += + rebase_path(chrome_tests_gypi_values.chrome_browser_tests_sources, + ".", + "//chrome") + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_extensions_test_support_sources, + ".", + "//chrome") + + configs += [ + "//build/config:precompiled_headers", + "//third_party/WebKit/public:debug_devtools", + ] + + data = [ + "data/", + "//chrome/browser/policy/test/asn1der.py", + "//chrome/browser/policy/test/policy_testserver.py", + "//chrome/common/extensions/docs/examples/apps/calculator/", + "//chrome/third_party/mock4js/", + "//content/test/data/", + "//google_apis/test/", + "//media/test/data/", + "//net/tools/testserver/", + "//ppapi/tests/test_case.html", + "//ppapi/tests/test_case.html.mock-http-headers", + "//ppapi/tests/test_page.css", + "//ppapi/tests/test_page.css.mock-http-headers", + "//testing/test_env.py", + "//third_party/accessibility-audit/axs_testing.js", + "//third_party/chaijs/chai.js", + "//third_party/mocha/mocha.js", + "//third_party/pyftpdlib/", + "//third_party/pywebsocket/", + "//third_party/simplejson/", + "//third_party/tlslite/", + "//ui/webui/resources/js/", + "$root_out_dir/pyproto/", + "$root_out_dir/browser_tests.pak", + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/chrome_200_percent.pak", + "$root_out_dir/remoting/unittests/", + "$root_out_dir/resources/extension/", + "$root_out_dir/test_case.html", + "$root_out_dir/test_case.html.mock-http-headers", + "$root_out_dir/test_data/", + "$root_out_dir/test_page.css", + "$root_out_dir/test_page.css.mock-http-headers", + "$root_out_dir/test_url_loader_data/", + ] + if (is_win) { + data += [ "$root_out_dir/chrome_200_percent.pak" ] + } + if (is_mac) { + data += [ + "$root_out_dir/chrome_material_100_percent.pak", + "$root_out_dir/chrome_material_200_percent.pak", + ] + } + if (is_chromeos) { + data += [ + # TODO(GYP): figure out which of these things are + # actually needed and also which should be pulled in via + # data or data_deps and through which dependencies. + "//chrome/browser/chromeos/login/test/https_forwarder.py", + "//chrome/browser/resources/chromeos/wallpaper_manager/", + "//chromeos/test/data/", + "//components/chrome_apps/webstore_widget/cws_widget/", + "//ui/file_manager/file_manager/", + "//ui/file_manager/gallery/", + "//ui/file_manager/image_loader/", + "//ui/file_manager/integration_tests/", + "//third_party/analytics/", + "//third_party/polymer/v1_0/components-chromium/polymer/", + "$root_out_dir/chromevox_test_data/", + "$root_out_dir/content_shell.pak", + "$root_out_dir/locales/", + "$root_out_dir/resources/chromeos/", + ] + + data_deps = [ + "//ui/keyboard:resources", + ] + + if (enable_nacl) { + data_deps += [ + "//components/nacl/loader:nacl_helper", + "//ppapi/native_client:irt", + ] + } + } else { + data_deps = [] + } + + deps = [ + ":browser_tests_js_webui", + ":sync_integration_test_support", + ":test_support", + ":test_support_ui", + "//base", + "//base:i18n", + "//base/test:test_support", + "//chrome:browser_tests_pak", + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/browser", + "//chrome/browser/resources:extension_resource_demo", + "//chrome/common/extensions/api", + "//chrome/renderer", + "//components/autofill/content/browser:risk_proto", + "//components/autofill/content/renderer:test_support", + "//components/captive_portal:test_support", + "//components/dom_distiller/content/browser", + "//components/dom_distiller/content/renderer", + "//components/dom_distiller/core:test_support", + "//components/guest_view/browser:test_support", + "//components/resources", + "//components/safe_browsing_db:test_database_manager", + "//components/strings", + "//components/translate/core/common", + "//content/public/common:features", + "//content/test:browsertest_base", + "//crypto:platform", + "//crypto:test_support", + "//device/bluetooth:mocks", + "//device/serial:test_support", + "//device/usb:test_support", + "//extensions/common/api", + "//google_apis:test_support", + "//media", + "//media/base:test_support", + "//media/cast:test_support", + "//net", + "//net:test_support", + "//sdch", + "//skia", + "//sync", + "//sync:test_support_sync_api", + "//testing/gmock", + "//testing/gtest", + "//testing/perf", + "//third_party/cacheinvalidation", + "//third_party/icu", + "//third_party/leveldatabase", + "//third_party/libjingle", + "//third_party/webrtc/modules/desktop_capture", + "//third_party/widevine/cdm:version_h", + "//ui/accessibility:test_support", + "//ui/base:test_support", + "//ui/compositor:test_support", + "//ui/resources", + "//ui/web_dialogs:test_support", + "//v8", + ] + + # TODO(rockot) bug 505926: The chrome_extensions_browsertests target should + # be deleted and this line removed. See the chrome_extensions_browsertests + # target for more. + deps += [ "//extensions:chrome_extensions_browsertests" ] + + # Runtime dependencies + data_deps += [ + "//chrome", + "//ppapi:ppapi_tests", + "//ppapi:power_saver_test_plugin", + "//remoting/webapp:browser_test_resources", + "//remoting/webapp:unit_tests", + "//third_party/mesa:osmesa", + "//third_party/widevine/cdm:widevine_test_license_server", + ] + + if (!is_mac) { + data += [ "$root_out_dir/locales/" ] + data_deps += [ "//chrome:packed_extra_resources" ] + } + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + if (!enable_one_click_signin) { + sources -= [ "../browser/ui/sync/one_click_signin_links_delegate_impl_browsertest.cc" ] + } + if (enable_nacl) { + sources += [ + "../browser/extensions/extension_nacl_browsertest.cc", + "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc", + "nacl/nacl_browsertest.cc", + "nacl/nacl_browsertest_uma.cc", + "nacl/nacl_browsertest_util.cc", + "nacl/nacl_browsertest_util.h", + "nacl/pnacl_header_test.cc", + "nacl/pnacl_header_test.h", + ] + deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ] + + data_deps += [ + "//chrome/test/data/nacl", + "//ppapi/native_client:irt", + "//ppapi:ppapi_nacl_tests_all", + "//ppapi/tests/extensions", + ] + if (is_chromeos) { + sources += [ "//third_party/liblouis/nacl_wrapper/liblouis_wrapper_browsertest.cc" ] + deps += [ "//chrome/browser/chromeos" ] + data_deps += [ "//third_party/liblouis:liblouis_test_data" ] + } else if (is_linux || is_win) { + sources += [ + "../browser/ui/views/ime/ime_warning_bubble_browsertest.cc", + "../browser/ui/views/ime/ime_window_browsertest.cc", + ] + } + + if (is_win || is_linux) { + sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ] + data_deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ] + } + if (is_win) { + # TODO(halyavin) NaCl on Windows can't open debug stub socket in + # browser process as needed by this test. See http://crbug.com/157312. + sources -= [ "../browser/nacl_host/test/gdb_debug_stub_browsertest.cc" ] + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + } + if (is_linux) { + data_deps += [ + "//components/nacl/loader:nacl_helper", + "//components/nacl/loader:helper_nonsfi", + ] + } + } + if (use_ash) { + sources += + rebase_path(chrome_tests_gypi_values.chrome_browser_tests_ash_sources, + ".", + "//chrome") + deps += [ "//ash:test_support" ] + + if (enable_app_list) { + deps += [ ":test_support_applist_ash" ] + } + } + if (use_aura || toolkit_views) { + deps += [ "//ui/events:test_support" ] + } + if (toolkit_views) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_views_sources, + ".", + "//chrome") + deps += [ "//ui/views" ] + if (!is_mac) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_views_non_mac_sources, + ".", + "//chrome") + if (!is_chromeos) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_views_non_cros_or_mac_sources, + ".", + "//chrome") + } + } + } + + if (is_linux && !is_component_build) { + # Set rpath to find the CDM adapter even in a non-component build. + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + + if (is_chromeos) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_chromeos_sources, + ".", + "//chrome") + sources -= [ + "../../apps/load_and_launch_browsertest.cc", + "../browser/policy/policy_startup_browsertest.cc", + + # chromeos does not support profile list avatar menu + "../browser/profiles/profile_list_desktop_browsertest.cc", + "../browser/service_process/service_process_control_browsertest.cc", + + # chromeos does not use cross-platform panels + "../browser/ui/panels/panel_extension_browsertest.cc", + + # inline login UI is disabled on chromeos + "../browser/ui/webui/signin/inline_login_ui_browsertest.cc", + + # chromeos does not use the desktop user manager + "../browser/ui/webui/signin/user_manager_ui_browsertest.cc", + ] + deps += [ + "//chromeos/ime:gencode", + "//components/arc:arc_test_support", + "//components/user_manager:test_support", + "//ui/login:resources", + ] + + if (use_dbus) { + deps += [ "//dbus:test_support" ] + } + } else { + sources -= [ + "../browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc", + "../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc", + "../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc", + "../browser/extensions/api/terminal/terminal_private_apitest.cc", + "../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc", + "../browser/net/nss_context_chromeos_browsertest.cc", + "data/webui/certificate_viewer_ui_test-inl.h", + ] + if (use_ash) { + sources -= [ "../browser/ui/ash/keyboard_controller_browsertest.cc" ] + } + if (toolkit_views) { + sources -= [ "../browser/ui/views/select_file_dialog_extension_browsertest.cc" ] + } + if (is_win || is_linux) { + sources += + [ "../browser/ui/views/ime/input_ime_apitest_nonchromeos.cc" ] + } + } + if (enable_web_speech) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_speech_sources, + ".", + "//chrome") + } + if (safe_browsing_mode == 1) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_full_safe_browsing_sources, + ".", + "//chrome") + } + if (enable_captive_portal_detection) { + sources += [ "../browser/captive_portal/captive_portal_browsertest.cc" ] + } + if (enable_webrtc) { + deps += [ "//content/public/common:feature_h264_with_openh264_ffmpeg" ] + } else { + sources -= [ + "../browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc", + "../browser/extensions/api/webrtc_logging_private/webrtc_event_log_apitest.cc", + "../browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc", + "../browser/media/webrtc_apprtc_browsertest.cc", + "../browser/media/webrtc_audio_quality_browsertest.cc", + "../browser/media/webrtc_browsertest.cc", + "../browser/media/webrtc_disable_encryption_flag_browsertest.cc", + "../browser/media/webrtc_getmediadevices_browsertest.cc", + "../browser/media/webrtc_perf_browsertest.cc", + "../browser/media/webrtc_simulcast_browsertest.cc", + "../browser/media/webrtc_video_quality_browsertest.cc", + "../browser/media/webrtc_webcam_browsertest.cc", + ] + } + if (enable_media_router) { + sources += [ "../browser/ui/webui/media_router/media_router_dialog_controller_impl_browsertest.cc" ] + deps += [ "//chrome/test/media_router:media_router_browsertests" ] + } + if (is_win) { + deps += [ + "//chrome:other_version", + "//third_party/wtl", + "//ui/resources", + ] + } else { + sources -= [ + "../app/chrome_command_ids.h", + "../app/chrome_dll_resource.h", + "../app/chrome_version.rc.version", + "../browser/media_galleries/fileapi/iapps_finder_impl_win_browsertest.cc", + ] + } + if (!is_chromeos && use_ash) { + sources -= [ + # On Windows and Linux, we currently don't support enough of the + # ash environment to run these unit tests. + # + # TODO: enable these on windows and linux. + "../browser/ui/ash/accelerator_commands_browsertest.cc", + "../browser/ui/ash/accelerator_controller_browsertest.cc", + "../browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc", + "../browser/ui/ash/launcher/launcher_favicon_loader_browsertest.cc", + "../browser/ui/ash/shelf_browsertest.cc", + ] + + if (toolkit_views) { + sources -= [ "../browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc" ] + } + } + if (is_mac) { + # TODO(mark): We really want this for all non-static library + # targets, but when we tried to pull it up to the common.gypi + # level, it broke other things like the ui and startup tests. *shrug* + ldflags = [ "-Wl,-ObjC" ] + + # Other platforms only need + # chrome_resources.gyp:{packed_extra_resources,packed_resources}, + # and can build this target standalone much faster. + deps += [ + "//chrome", + "//chrome/common:app_mode_app_support", + + # TODO(GYP) Mac: GYP has this dependency. Uncommenting this line + # generates duplicate symbols between + # obj/components/crash/content/app/breakpad_stubs/crash_reporter_client.o + # obj/components/crash/content/app/lib/crash_reporter_client.o + # It's not clear how this is supposed to work. The intent seems to be + # to not link breakpad in the tests. The dependency on .../app:lib + # seems to come from //chrome/app:test_support. That reference maybe + # should be a dependency on the stubs instead because it could be all + # tests might want them. Or it could be that we need to make a new + # "headers" target to make GN check happy, and then force each + # executable to link the correct implementation. Somebody with a + # higher-level understanding of Mac crash reporting needs to think + # about this. + # "//components/crash/content/app:breakpad_stubs", + "//third_party/ocmock", + ] + sources += + rebase_path(chrome_tests_gypi_values.chrome_browser_tests_mac_sources, + ".", + "//chrome") + sources -= [ + # TODO(groby): This test depends on hunspell and we cannot run it on + # Mac, which does not use hunspell by default. + "../browser/spellchecker/spellcheck_service_browsertest.cc", + + # ProcessSingletonMac doesn"t do anything. + "../browser/process_singleton_browsertest.cc", + ] + + if (safe_browsing_mode == 1) { + sources -= [ + # single-process mode hangs on Mac sometimes because of multiple UI + # message loops. See 306348 + "../renderer/safe_browsing/phishing_classifier_browsertest.cc", + "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc", + ] + } + + data_deps += [ + "//chrome", + "//chrome:chrome_framework", + ] + + # TODO(rsesek): Remove once https://crbug.com/611414 is fixed. + data += [ + "$root_out_dir/Chromium.app/", + "$root_out_dir/Chromium Framework.framework/", + "$root_out_dir/power_saver_test_plugin.plugin/", + "$root_out_dir/ppapi_tests.plugin/", + ] + + # The browser window can be views or Cocoa on Mac. Test accordingly. + if (mac_views_browser) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_views_non_mac_sources, + ".", + "//chrome") + } else { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_cocoa_sources, + ".", + "//chrome") + } + } + if (is_mac || is_win) { + sources += [ + "../browser/extensions/api/networking_private/networking_private_apitest.cc", + "../browser/extensions/api/networking_private/networking_private_service_client_apitest.cc", + "../browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc", + "../browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc", + ] + deps += [ "//components/wifi:test_support" ] + } + if (is_linux || is_win) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_non_mac_desktop_sources, + ".", + "//chrome") + } + if (!is_posix || is_chromeos) { + sources -= [ "../common/time_format_browsertest.cc" ] + } + if (is_android) { + sources -= [ + "../browser/policy/cloud/component_cloud_policy_browsertest.cc", + "../browser/prefs/pref_hash_browsertest.cc", + "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc", + "../renderer/spellchecker/spellcheck_unittest.cc", + ] + } + if (is_chromeos) { + sources += [ + "../browser/extensions/api/networking_private/networking_private_apitest.cc", + "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc", + ] + } + if (is_android || is_ios || is_chromeos) { + sources -= [ "../browser/profiles/profile_statistics_browsertest.cc" ] + } + if (!is_android && !is_ios) { + sources += + [ "../browser/copresence/chrome_whispernet_client_browsertest.cc" ] + deps += [ + "//components/copresence", + "//third_party/libaddressinput", + ] + } + if (enable_app_list) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_app_list_sources, + ".", + "//chrome") + if (is_mac) { + # This assumes the AppList is views-based, but Mac only links + # browser parts for the Cocoa implementation. + sources -= + [ "../browser/ui/app_list/app_list_service_views_browsertest.cc" ] + } + } + if (enable_service_discovery) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_service_discovery_sources, + ".", + "//chrome") + } + if (enable_supervised_users) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_supervised_user_sources, + ".", + "//chrome") + } + if (enable_pepper_cdms) { + # Runtime dependencies. + data_deps += [ + "//media/cdm/ppapi:clearkeycdmadapter", + "//third_party/widevine/cdm:widevinecdmadapter", + ] + } + if (!enable_print_preview) { + sources -= [ + "../browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc", + "../browser/printing/print_preview_dialog_controller_browsertest.cc", + "../browser/printing/print_preview_pdf_generated_browsertest.cc", + "../browser/service_process/service_process_control_browsertest.cc", + "../browser/ui/webui/print_preview/print_preview_ui_browsertest.cc", + "data/webui/print_preview.cc", + "data/webui/print_preview.h", + ] + } + if (!enable_print_preview || is_mac || is_chromeos) { + sources -= [ + # This test depends on GetCommandLineForRelaunch, which is not + # available on Mac. It is also not intended to run on ChromeOS. + "../browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc", + ] + } + if (!enable_print_preview || is_chromeos) { + sources -= [ + # Not intended to run on ChromeOS. + "../browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc", + ] + } + if (enable_mdns) { + sources += [ + "../browser/extensions/api/gcd_private/gcd_private_apitest.cc", + "../browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc", + ] + } + if (use_brlapi) { + deps += [ "//build/linux/libbrlapi" ] + } else { + sources -= [ "../browser/extensions/api/braille_display_private/braille_display_private_apitest.cc" ] + } + if (is_chrome_branded && safe_browsing_mode == 1 && !is_mac) { + sources -= [ + # These tests depend on single process mode, which is disabled in + # official builds. + "../renderer/safe_browsing/phishing_classifier_browsertest.cc", + "../renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc", + ] + } + if (is_android || is_ios) { + } + if (enable_remoting) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_remoting_sources, + ".", + "//chrome") + deps += [ "//remoting/webapp" ] + } + if (use_x11) { + deps += [ "//tools/xdisplaycheck" ] + } + + if (use_aura) { + sources += [ + "base/mash_browser_tests_main.cc", + "base/mash_browser_tests_main.h", + "base/mojo_test_connector.cc", + "base/mojo_test_connector.h", + ] + + deps += [ + "//services/shell/background:lib", + "//services/shell/background/tests:test_support", + ] + + data_deps += [ + "//chrome/app:mojo_manifests", + "//mash/session", + ] + + defines += [ "MOJO_SHELL_CLIENT" ] + + if (enable_wifi_display) { + sources += rebase_path( + chrome_tests_gypi_values.chrome_browser_tests_display_source_apitest, + ".", + "//chrome") + } + } + } + + test("sync_integration_tests") { + sources = + rebase_path(chrome_tests_gypi_values.sync_integration_tests_sources, + ".", + "//chrome") + + data = [ + "//chrome/test/data/sync/", + "//net/tools/testserver/", + "//sync/tools/testserver/", + "//third_party/pyftpdlib/", + "//third_party/pywebsocket/", + "//third_party/tlslite/", + "$root_out_dir/pyproto/", + ] + + if (is_linux || is_win) { + data += [ + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/chrome_200_percent.pak", + "$root_out_dir/locales/en-US.pak", + ] + } + + # TODO(phajdan.jr): Only temporary, to make transition easier. + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + ":sync_integration_test_support", + ":test_support", + ":test_support_ui", + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/common", + "//chrome/renderer", + "//crypto:platform", + "//sync", + "//testing/gmock", + "//testing/gtest", + "//third_party/WebKit/public:blink", + "//third_party/icu", + "//third_party/leveldatabase", + ] + + data_deps = [ + "//third_party/mesa:osmesa", + ] + + if (!is_mac) { + data_deps += [ "//chrome:packed_extra_resources" ] + } + + if (is_mac) { + # Dictionary sync is disabled on Mac. + sources -= [ + "../browser/sync/test/integration/single_client_dictionary_sync_test.cc", + "../browser/sync/test/integration/two_client_dictionary_sync_test.cc", + ] + + data_deps += [ + "//chrome", + "//chrome:chrome_framework", + ] + } + if (is_win) { + deps += [ + "//chrome:other_version", + "//third_party/wtl", + "//ui/resources", + ] + + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + } else { + sources -= [ "../app/chrome_version.rc.version" ] + } + if (!is_chromeos) { + sources -= [ + "../browser/sync/test/integration/single_client_arc_package_sync_test.cc", + "../browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc", + "../browser/sync/test/integration/two_client_arc_package_sync_test.cc", + "../browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc", + ] + } + + if (toolkit_views) { + deps += [ "//ui/views" ] + } + if (enable_basic_printing || enable_print_preview) { + deps += [ "//printing" ] + } + if (!enable_app_list) { + sources -= [ + "../browser/sync/test/integration/single_client_app_list_sync_test.cc", + "../browser/sync/test/integration/two_client_app_list_sync_test.cc", + ] + } + if (!enable_supervised_users) { + sources -= [ "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc" ] + } + } + + test("sync_performance_tests") { + sources = + rebase_path(chrome_tests_gypi_values.sync_performance_tests_sources, + ".", + "//chrome") + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + ":sync_integration_test_support", + ":test_support_ui", + "//crypto:platform", + "//sync", + "//testing/gmock", + "//testing/gtest", + ] + + if (is_mac) { + # Dictionary sync is disabled on Mac. + sources -= [ "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc" ] + + # The sync_performance_tests do not run on mac without this flag. + # Search for comments about "xcode_settings" elsewhere in this file. + ldflags = [ "-Wl,-ObjC" ] + } + if (is_win) { + deps += [ + "//chrome:other_version", + "//chrome/installer/util:strings", + "//third_party/wtl", + "//ui/resources", + ] + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + } else { + sources -= [ "../app/chrome_version.rc.version" ] + } + + if (toolkit_views) { + deps += [ "//ui/views" ] + } + + # This target should not require the Chrome executable to run. + assert_no_deps = [ "//chrome" ] + } + + # Executable to measure time to load libraries. + test("load_library_perf_tests") { + sources = [ + "../browser/load_library_perf_test.cc", + ] + + # This test deliberately does not depend in chrome's test support targets. + # This is a small test and Chrome's test support targets bring in the + # world, causing link time to explode. Please don't add more dependencies + # here without understanding how it affects link time (and factor them + # differently if possible). + deps = [ + "//base/test:test_support_perf", + "//testing/gtest", + "//testing/perf", + "//third_party/widevine/cdm:version_h", + ] + + if (enable_pepper_cdms) { + deps += [ + "//chrome/browser:pepper_cdm_test_constants", + "//media:cdm_paths", + ] + data_deps = [ + "//media/cdm/ppapi:clearkeycdmadapter", + "//third_party/widevine/cdm:widevinecdmadapter", + ] + } + + # This target should not require the Chrome executable to run. + assert_no_deps = [ "//chrome" ] + } +} + +# TODO(GYP_GONE): Delete this after we've converted everything to GN. +# The _run targets exist only for compatibility w/ GYP. +group("telemetry_perf_unittests_run") { + testonly = true + deps = [ + ":telemetry_perf_unittests", + ] +} + +group("telemetry_perf_unittests") { + testonly = true + deps = [ + "//tools/perf:perf", + ] + + data = [ + # For isolate contract. + "//testing/scripts/common.py", + "//testing/xvfb.py", + "//testing/scripts/run_telemetry_as_googletest.py", + ] +} + +js2gtest("unit_tests_js") { + test_type = "unit" + sources = rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_gtestjs_sources, + ".", + "//chrome") + extra_js_files = + rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_js_sources, + ".", + "//chrome") + if (is_chromeos) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_chromeos_gtestjs_sources, + ".", + "//chrome") + extra_js_files += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_chromeos_js_sources, + ".", + "//chrome") + } +} + +test("unit_tests") { + sources = rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_sources, + ".", + "//chrome") + + configs += [ "//build/config:precompiled_headers" ] + + data = [ + "data/", + "//base/test/data/", + "//chrome/third_party/mock4js/", + "//components/test/data/", + "//extensions/test/data/", + "//google_apis/test/data/", + "//net/tools/testserver/", + "//third_party/accessibility-audit/axs_testing.js", + "//third_party/chaijs/chai.js", + "//third_party/hunspell_dictionaries/", + "//third_party/pyftpdlib/", + "//third_party/pywebsocket/", + "//third_party/tlslite/", + "//third_party/zlib/google/test/data/", + "//tools/metrics/histograms/histograms.xml", + "$root_out_dir/pyproto/google/", + ] + if (is_android || is_linux || is_win) { + data += [ + "$root_out_dir/chrome_100_percent.pak", + "$root_out_dir/locales/en-US.pak", + ] + } + if (is_linux || is_win) { + data += [ "$root_out_dir/chrome_200_percent.pak" ] + } + + defines = [] + + deps = [ + # NOTE: New dependencies should generally be added in the OS!="ios" + # dependencies block below, rather than here. + # Unit tests should only depend on: + # 1) everything that the chrome binaries depend on: + "//chrome:browser_dependencies", + "//chrome:child_dependencies", + + # 2) test-specific support libraries: + ":test_support", + ":test_support_unit", + "//base/test:test_support", + "//components/browser_sync/browser:test_support", + "//components/content_settings/core/test:test_support", + "//components/resources", + "//content/public/app:both", + "//content/test:test_support", + "//crypto:platform", + "//crypto:test_support", + "//net", + "//net:test_support", + "//sync:test_support_sync_api", + "//sync:test_support_sync_core", + "//sync:test_support_sync_internal_api", + "//testing/gmock", + "//testing/gtest", + + # 3) anything tests directly depend on + "//chrome:resources", + "//chrome:strings", + "//components/component_updater:test_support", + "//components/safe_browsing_db:test_database_manager", + "//components/subresource_filter/core/browser:test_support", + "//components/version_info:generate_version_info", + "//courgette:courgette_lib", + "//google_apis", + "//skia", + "//third_party/cacheinvalidation", + "//third_party/icu", + "//third_party/libxml", + "//ui/base:test_support", + "//ui/display:test_support", + "//ui/gfx:test_support", + "//ui/resources", + ] + data_deps = [] + + if (!is_ios) { + deps += [ + "//components/autofill/content/renderer:test_support", + "//components/data_reduction_proxy/core/browser:test_support", + "//components/data_use_measurement/core", + "//components/metrics/proto", + "//components/os_crypt:test_support", + "//components/safe_browsing_db", + "//components/safe_json:test_support", + "//components/strings", + "//components/webdata_services:test_support", + "//content/app/resources", + "//device/bluetooth:mocks", + "//device/core:mocks", + "//device/usb:test_support", + "//gpu:test_support", + "//media:test_support", + "//third_party/leveldatabase", + "//third_party/libaddressinput", + "//third_party/libjingle", + "//third_party/libphonenumber", + "//third_party/webrtc/modules/desktop_capture", + "//tools/json_schema_compiler/test", + "//ui/gl", + "//v8", + ] + } + + if (is_mac) { + data_deps += [ "//chrome:chrome_framework" ] + data += [ "$root_out_dir/Chromium Framework.framework/" ] + } else { + data_deps += [ "//chrome:packed_extra_resources" ] + } + + if (is_android) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_offline_pages_sources, + ".", + "//chrome") + sources -= [ "../browser/policy/policy_path_parser_unittest.cc" ] + deps += [ + ":unit_tests_java", + "//components/offline_pages:test_support", + "//v8:v8_external_startup_data_assets", + ] + deps -= [ "//third_party/libaddressinput" ] + + android_manifest = + "//chrome/test/android/unit_tests_apk/AndroidManifest.xml" + enable_multidex = true + + # Some android targets still depend on --gc-sections to link. + # TODO: remove --gc-sections for Debug builds (crbug.com/159847). + ldflags = [ "-Wl,--gc-sections" ] + } else { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_non_android_sources, + ".", + "//chrome") + sources -= + [ "../browser/download/download_request_infobar_delegate_unittest.cc" ] + } + + if (!is_ios && !is_android) { + deps += [ + ":unit_tests_js", + "//components/bubble:test_support", + ] + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_non_mobile_sources, + ".", + "//chrome") + data += [ + "$root_out_dir/test_data/chrome/browser/resources/google_now/", + "$root_out_dir/test_data/chrome/browser/resources/print_preview/", + "$root_out_dir/test_data/chrome/renderer/resources/extensions/", + "$root_out_dir/test_data/ui/webui/", + ] + } + + if (is_ios || is_chromeos) { + sources -= [ "../browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc" ] + } + if (enable_background) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_background_sources, + ".", + "//chrome") + } + if (enable_spellcheck) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_spellchecker_sources, + ".", + "//chrome") + if (is_mac && !is_ios) { + deps += [ "//third_party/hunspell" ] + } + + if (is_android) { + sources -= [ + "../renderer/spellchecker/spellcheck_multilingual_unittest.cc", + "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc", + "../renderer/spellchecker/spellcheck_unittest.cc", + ] + } + } + + if (enable_one_click_signin) { + sources += [ + "../browser/ui/sync/one_click_signin_sync_observer_unittest.cc", + "../browser/ui/sync/one_click_signin_sync_starter_unittest.cc", + ] + } + + if (enable_extensions) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_sources, + ".", + "//chrome") + deps += [ + "//chrome/common/extensions/api", + "//components/audio_modem:test_support", + "//extensions:extensions_resources", + "//extensions/strings", + ] + if (enable_service_discovery) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_service_discovery_sources, + ".", + "//chrome") + } + if (!is_chromeos) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_extensions_non_chromeos_sources, + ".", + "//chrome") + } + } + if (use_ash) { + sources += + rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_ash_sources, + ".", + "//chrome") + deps += [ + "//ash:test_support", + "//ash/resources", + "//ash/strings", + ] + + # We eventually want to compile both in Win Aura builds, see + # http://crbug.com/155545. + if (!is_win) { + sources -= [ "../browser/ui/window_sizer/window_sizer_unittest.cc" ] + } + } + if (use_aura) { + deps += [ + "//ui/aura:test_support", + "//ui/views:test_support", + "//ui/wm", + ] + } + if (!is_chromeos && is_linux) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_desktop_linux_sources, + ".", + "//chrome") + } + if (!is_android && !is_ios && !is_chromeos) { + sources += [ + "../browser/net/disk_cache_dir_policy_handler_unittest.cc", + "//chrome/browser/profiles/profile_list_desktop_unittest.cc", + "//chrome/browser/profiles/profile_statistics_unittest.cc", + "//chrome/browser/ui/startup/default_browser_infobar_delegate_unittest.cc", + ] + } + if (!is_chromeos && !use_ozone && is_linux) { + deps += [ + "//build/linux/libgio", + "//chrome/browser/ui/libgtk2ui", + ] + } + + if (enable_task_manager) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_task_manager_sources, + ".", + "//chrome") + } + if (enable_mdns) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_mdns_sources, + ".", + "//chrome") + } + if (enable_service_discovery) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_service_discovery_sources, + ".", + "//chrome") + } + if (enable_web_speech) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_speech_sources, + ".", + "//chrome") + } + if (enable_notifications) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_notifications_sources, + ".", + "//chrome") + if (is_android) { + sources -= [ + # Android does not use the Message Center notification system. + "../browser/notifications/message_center_notifications_unittest.cc", + "../browser/notifications/message_center_settings_controller_unittest.cc", + ] + } + } + if (safe_browsing_mode == 1) { + # TODO(sgurun): enable tests for safe_browsing==2. + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_full_safe_browsing_sources + chrome_tests_unit_gypi_values.chrome_unit_tests_shared_safe_browsing_sources, + ".", + "//chrome") + deps += [ ":test_proto" ] + + if (is_mac) { + deps += [ ":mac_safe_browsing_test_data" ] + data += [ "$root_out_dir/test_data/chrome/safe_browsing_dmg/" ] + } + } else if (safe_browsing_mode == 2) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_shared_safe_browsing_sources, + ".", + "//chrome") + } + if (enable_plugins) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_plugins_sources, + ".", + "//chrome") + } + if (enable_print_preview) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_print_preview_sources, + ".", + "//chrome") + } + if (enable_media_router) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_media_router_sources, + ".", + "//chrome") + deps += [ "//chrome/browser/media/router:test_support" ] + if (!is_android) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_media_router_non_android_sources, + ".", + "//chrome") + } + } + if (enable_captive_portal_detection) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_captive_portal_sources, + ".", + "//chrome") + } + if (enable_session_service) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_session_service_sources, + ".", + "//chrome") + } + if (enable_webrtc) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_webrtc_sources, + ".", + "//chrome") + } + if (is_chromeos) { + deps += [ + "//chrome/browser/chromeos:unit_tests", + "//chromeos/ime:gencode", + ] + sources -= [ + "../browser/policy/cloud/user_policy_signin_service_unittest.cc", + "../browser/signin/signin_manager_unittest.cc", + ] + } + if (use_x11) { + deps += [ "//ui/events/devices" ] + data_deps += [ "//tools/xdisplaycheck" ] + } else { + sources -= [ "../browser/password_manager/password_store_x_unittest.cc" ] + } + if (is_desktop_linux && current_cpu == "x64") { + # Only add this test for 64 bit builds because otherwise we need the 32 + # bit library on 64 bit systems when running this test. + sources += + [ "../browser/password_manager/native_backend_gnome_x_unittest.cc" ] + configs += [ + "//chrome/browser:gnome_keyring", + "//chrome/browser:gnome_keyring_direct", + ] + } + if (is_linux && !is_chromeos) { + sources += + [ "../browser/password_manager/native_backend_libsecret_unittest.cc" ] + deps += [ "//third_party/libsecret" ] + } + if (is_linux && use_aura) { + deps += [ "//ui/aura:test_support" ] + if (use_dbus) { + deps += [ "//dbus:test_support" ] + } + } + if (is_linux && is_chrome_branded && current_cpu == "x86") { + ldflags = [ "-Wl,--strip-debug" ] + } + if (is_mac) { + sources -= [ + # This tests the function GetSpellCheckLanguages which is not used on + # Mac. + "../browser/spellchecker/spellcheck_service_unittest.cc", + "../browser/ui/tests/ui_gfx_image_unittest.cc", + + # This tests Chrome's spellchecker which Mac doesn't use. + "../renderer/spellchecker/spellcheck_multilingual_unittest.cc", + "../renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc", + "../tools/convert_dict/convert_dict_unittest.cc", + ] + + # The test fetches resources which means Mac need the app bundle to exist + # on disk so it can pull from it. + deps += [ + "//third_party/google_toolbox_for_mac", + "//third_party/ocmock", + ] + + if (mac_views_browser) { + # TODO(tapted): Add chrome_unit_tests_views_non_mac_sources. + } else { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_cocoa_sources, + ".", + "//chrome") + } + + # TODO(mark): We really want this for all non-static library targets, + # but when we tried to pull it up to the common.gypi level, it broke + # other things like the ui and startup tests. *shrug* + ldflags = [ "-Wl,-ObjC" ] + } + if (is_android) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_android_sources, + ".", + "//chrome") + } + if (!is_mac && !is_ios) { + deps += [ + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//chrome/tools/convert_dict:lib", + "//third_party/hunspell", + ] + } + if (is_win || is_mac) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_win_mac_sources, + ".", + "//chrome") + } + if (is_win || is_mac || is_chromeos) { + sources += [ "../common/extensions/api/networking_private/networking_private_crypto_unittest.cc" ] + } + if (enable_rlz_support) { + sources += [ "../browser/rlz/chrome_rlz_tracker_delegate_unittest.cc" ] + deps += [ + "//chrome/browser:rlz", + "//components/rlz", + "//rlz:test_support", + ] + } + if (is_win) { + # The PDB gets too large for incremental linking. + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += [ "//build/config/win:no_incremental_linking" ] + + sources += + rebase_path(chrome_tests_unit_gypi_values.chrome_unit_tests_win_sources, + ".", + "//chrome") + deps += [ + "//chrome:other_version", + "//chrome/install_static:install_static_util", + "//chrome/installer/util:strings", + "//chrome_elf:blacklist_test_dll_1", + "//third_party/iaccessible2", + "//third_party/isimpledom", + "//third_party/wtl", + "//ui/resources", + ] + data_deps += [ + "//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_1", + "//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_2", + ] + + libs = [ + "comsupp.lib", + "oleacc.lib", + "rpcrt4.lib", + "urlmon.lib", + "winmm.lib", + ] + if (!is_chrome_branded) { + sources -= [ "../browser/google/google_update_win_unittest.cc" ] + } + } + if (is_android || is_ios) { + sources -= [ + "../browser/ui/bookmarks/bookmark_ui_utils_desktop_unittest.cc", + "../browser/ui/sync/sync_promo_ui_unittest.cc", + ] + } + if (!is_android && !is_chromeos) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_non_android_or_chromeos_sources, + ".", + "//chrome") + } + if (enable_themes) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_themes_sources, + ".", + "//chrome") + } + if (toolkit_views) { + deps += [ + "//components/web_modal:test_support", + "//ui/views", + "//ui/views:test_support", + ] + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_views_sources, + ".", + "//chrome") + if (!is_chromeos && (!is_mac || mac_views_browser)) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_views_non_chromeos_sources, + ".", + "//chrome") + } + if (!is_mac) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_views_non_mac_sources, + ".", + "//chrome") + } + } + if (!is_android && use_nss_certs) { + sources += [ "../common/net/x509_certificate_model_unittest.cc" ] + } + if (enable_supervised_users) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_supervised_user_sources, + ".", + "//chrome") + } + if (enable_supervised_users && !is_android && !is_ios) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_supervised_user_legacy_sources, + ".", + "//chrome") + } + if (safe_browsing_mode == 1 && enable_extensions) { + sources += [ "../browser/extensions/blacklist_unittest.cc" ] + } + if (enable_app_list) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_app_list_sources, + ".", + "//chrome") + deps += [ "//ui/app_list:test_support" ] + } + if (enable_app_list && is_chromeos) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_unit_tests_app_list_chromeos_sources, + ".", + "//chrome") + sources -= + [ "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc" ] + deps += [ "//components/arc:arc_test_support" ] + } + if (enable_plugins && !enable_plugin_installation) { + sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ] + } +} + +if (safe_browsing_mode == 1 && is_mac) { + action("mac_safe_browsing_test_data") { + script = "//build/gn_run_binary.py" + shell_script = "//chrome/test/data/safe_browsing/dmg/generate_test_data.sh" + inputs = [ + script, + shell_script, + "data/safe_browsing/dmg/make_hfs.sh", + "data/safe_browsing/mach_o/executablefat", + "data/safe_browsing/mach_o/lib64.dylib", + ] + _output_dir = "$root_out_dir/test_data/chrome/safe_browsing_dmg" + outputs = [ + "$_output_dir/dmg_UDBZ_GPTSPUD.dmg", + "$_output_dir/dmg_UDBZ_NONE.dmg", + "$_output_dir/dmg_UDBZ_SPUD.dmg", + "$_output_dir/dmg_UDCO_GPTSPUD.dmg", + "$_output_dir/dmg_UDCO_NONE.dmg", + "$_output_dir/dmg_UDCO_SPUD.dmg", + "$_output_dir/dmg_UDRO_GPTSPUD.dmg", + "$_output_dir/dmg_UDRO_NONE.dmg", + "$_output_dir/dmg_UDRO_SPUD.dmg", + "$_output_dir/dmg_UDRW_GPTSPUD.dmg", + "$_output_dir/dmg_UDRW_NONE.dmg", + "$_output_dir/dmg_UDRW_SPUD.dmg", + "$_output_dir/dmg_UDSP_GPTSPUD.sparseimage", + "$_output_dir/dmg_UDSP_NONE.sparseimage", + "$_output_dir/dmg_UDSP_SPUD.sparseimage", + "$_output_dir/dmg_UDTO_GPTSPUD.cdr", + "$_output_dir/dmg_UDTO_NONE.cdr", + "$_output_dir/dmg_UDTO_SPUD.cdr", + "$_output_dir/dmg_UDZO_GPTSPUD.dmg", + "$_output_dir/dmg_UDZO_NONE.dmg", + "$_output_dir/dmg_UDZO_SPUD.dmg", + "$_output_dir/dmg_UFBI_GPTSPUD.dmg", + "$_output_dir/dmg_UFBI_NONE.dmg", + "$_output_dir/dmg_UFBI_SPUD.dmg", + "$_output_dir/hfs_plus.img", + "$_output_dir/hfsx_case_sensitive.img", + "$_output_dir/mach_o_in_dmg.dmg", + ] + args = [ + rebase_path(shell_script, root_out_dir), + rebase_path(_output_dir, root_out_dir), + ] + } +} + +if (!is_android) { + # TODO(609855): Make this compile on Android and run on the bots. + test("chrome_app_unittests") { + sources = [ + "../app/chrome_watcher_client_unittest_win.cc", + "../app/chrome_watcher_client_win.cc", + "../app/chrome_watcher_command_line_win.cc", + "../app/chrome_watcher_command_line_win_unittest.cc", + "../app/resources/resources_unittest.cc", + "../common/crash_keys.cc", + "../common/crash_keys.h", + ] + deps = [ + ":test_support", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//breakpad:client", + "//chrome/browser", + "//chrome/child", + "//components/crash/core/common", + "//components/flags_ui:switches", + "//third_party/kasko:kasko_features", + ] + } +} + +if (!is_android && !is_ios && !is_chromecast) { + test("performance_browser_tests") { + sources = + rebase_path(chrome_tests_gypi_values.performance_browser_tests_sources, + ".", + "//chrome") + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + ":test_support", + ":test_support_ui", + "//base", + "//base:i18n", + "//base/test:test_support", + "//chrome/browser", + "//chrome/renderer", + "//components/about_handler", + "//components/autofill/content/renderer:test_support", + "//content/test:browsertest_base", + "//media/cast:test_support", + "//testing/gmock", + "//testing/gtest", + "//testing/perf", + ] + + if (is_win) { + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + } else { + sources -= [ + "../app/chrome_command_ids.h", + "../app/chrome_version.rc.version", + ] + } + if (!is_mac) { + sources -= [ "perf/mach_ports_performancetest.cc" ] + } + + # This target should not require the Chrome executable to run. + assert_no_deps = [ "//chrome" ] + } +} + +source_set("test_support_unit") { + testonly = true + sources = [ + "../browser/sync/glue/session_sync_test_helper.cc", + "../browser/sync/glue/session_sync_test_helper.h", + "base/run_all_unittests.cc", + ] + + public_deps = [ + ":test_support", + "//base", + "//chrome:resources", + "//chrome:strings", + "//chrome/browser", + "//chrome/common", + "//mojo/edk/system", + ] + + if (!is_android && use_ash) { + sources += rebase_path( + chrome_tests_unit_gypi_values.chrome_test_support_unit_ash_sources, + ".", + "//chrome") + } +} + +if (is_android) { + android_library("unit_tests_java") { + java_files = [ "android/unit_tests_apk/src/org/chromium/chrome/unit_tests_apk/ChromeNativeTestApplication.java" ] + deps = [ + "//base:base_java", + "//chrome/android:chrome_java", + "//content/public/android:content_java", + ] + } +} diff --git a/chromium/chrome/test/android/BUILD.gn b/chromium/chrome/test/android/BUILD.gn new file mode 100644 index 00000000000..ece34236104 --- /dev/null +++ b/chromium/chrome/test/android/BUILD.gn @@ -0,0 +1,83 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //chrome/chrome_tests.gypi:chrome_java_test_support +android_library("chrome_java_test_support") { + testonly = true + java_files = [ + "javatests/src/org/chromium/chrome/test/ChromeActivityTestCaseBase.java", + "javatests/src/org/chromium/chrome/test/ChromeInstrumentationTestRunner.java", + "javatests/src/org/chromium/chrome/test/ChromeTabbedActivityTestBase.java", + "javatests/src/org/chromium/chrome/test/DocumentActivityTestBase.java", + "javatests/src/org/chromium/chrome/test/gcore/MockChromeGoogleApiClient.java", + "javatests/src/org/chromium/chrome/test/invalidation/IntentSavingContext.java", + "javatests/src/org/chromium/chrome/test/MultiActivityTestBase.java", + "javatests/src/org/chromium/chrome/test/omaha/AttributeFinder.java", + "javatests/src/org/chromium/chrome/test/omaha/MockRequestGenerator.java", + "javatests/src/org/chromium/chrome/test/partnercustomizations/TestPartnerBrowserCustomizationsDelayedProvider.java", + "javatests/src/org/chromium/chrome/test/partnercustomizations/TestPartnerBrowserCustomizationsProvider.java", + "javatests/src/org/chromium/chrome/test/TestContentProvider.java", + "javatests/src/org/chromium/chrome/test/util/ActivityUtils.java", + "javatests/src/org/chromium/chrome/test/util/ApplicationData.java", + "javatests/src/org/chromium/chrome/test/util/ApplicationTestUtils.java", + "javatests/src/org/chromium/chrome/test/util/BookmarkTestUtil.java", + "javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java", + "javatests/src/org/chromium/chrome/test/util/browser/LocationSettingsTestUtil.java", + "javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java", + "javatests/src/org/chromium/chrome/test/util/browser/signin/MockChangeEventChecker.java", + "javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestUtil.java", + "javatests/src/org/chromium/chrome/test/util/browser/sync/SyncTestUtil.java", + "javatests/src/org/chromium/chrome/test/util/browser/TabLoadObserver.java", + "javatests/src/org/chromium/chrome/test/util/browser/tabmodel/document/MockActivityDelegate.java", + "javatests/src/org/chromium/chrome/test/util/browser/tabmodel/document/MockDocumentTabCreatorManager.java", + "javatests/src/org/chromium/chrome/test/util/browser/tabmodel/document/MockStorageDelegate.java", + "javatests/src/org/chromium/chrome/test/util/browser/tabmodel/document/MockTabDelegate.java", + "javatests/src/org/chromium/chrome/test/util/browser/tabmodel/MockTabModel.java", + "javatests/src/org/chromium/chrome/test/util/browser/tabmodel/MockTabModelSelector.java", + "javatests/src/org/chromium/chrome/test/util/browser/TabTitleObserver.java", + "javatests/src/org/chromium/chrome/test/util/ChromeRestriction.java", + "javatests/src/org/chromium/chrome/test/util/ChromeSigninUtils.java", + "javatests/src/org/chromium/chrome/test/util/ChromeTabUtils.java", + "javatests/src/org/chromium/chrome/test/util/DisableInTabbedMode.java", + "javatests/src/org/chromium/chrome/test/util/FullscreenTestUtils.java", + "javatests/src/org/chromium/chrome/test/util/InfoBarTestAnimationListener.java", + "javatests/src/org/chromium/chrome/test/util/InfoBarUtil.java", + "javatests/src/org/chromium/chrome/test/util/MenuUtils.java", + "javatests/src/org/chromium/chrome/test/util/NewTabPageTestUtils.java", + "javatests/src/org/chromium/chrome/test/util/OmniboxTestUtils.java", + "javatests/src/org/chromium/chrome/test/util/OverviewModeBehaviorWatcher.java", + "javatests/src/org/chromium/chrome/test/util/parameters/AddFakeAccountToAppParameter.java", + "javatests/src/org/chromium/chrome/test/util/parameters/AddFakeAccountToOsParameter.java", + "javatests/src/org/chromium/chrome/test/util/parameters/AddGoogleAccountToOsParameter.java", + "javatests/src/org/chromium/chrome/test/util/PrerenderTestHelper.java", + "javatests/src/org/chromium/chrome/test/util/TabStripUtils.java", + "javatests/src/org/chromium/chrome/test/util/TranslateUtil.java", + ] + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//chrome/android:chrome_java", + "//components/bookmarks/common/android:bookmarks_java", + "//components/invalidation/impl:java", + "//components/location/android:location_java", + "//components/policy/android:policy_java", + "//components/policy/android:policy_java_test_support", + "//components/web_contents_delegate_android:web_contents_delegate_android_java", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//net/android:net_java", + "//net/android:net_java_test_support", + "//sync:sync_java_test_support", + "//sync/android:sync_java", + "//testing/android/reporter:reporter_java", + "//third_party/android_tools:android_support_v13_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + "//third_party/android_tools:legacy_http_javalib", + "//third_party/jsr-305:jsr_305_javalib", + "//ui/android:ui_java", + google_play_services_library, + ] +} diff --git a/chromium/chrome/test/android/cast_emulator/BUILD.gn b/chromium/chrome/test/android/cast_emulator/BUILD.gn new file mode 100644 index 00000000000..1cc9ff3fc50 --- /dev/null +++ b/chromium/chrome/test/android/cast_emulator/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +# GYP: //clank/native/clank.gyp:cast_emulator +android_library("cast_emulator") { + chromium_code = true + + java_files = [ + "src/org/chromium/chrome/browser/media/TestMediaRouteProvider.java", + "src/org/chromium/chrome/browser/media/TestMediaRouteProviderService.java", + "src/org/chromium/chrome/browser/media/RoutePublisher.java", + "src/org/chromium/chrome/browser/media/remote/DummyPlayer.java", + "src/org/chromium/chrome/browser/media/remote/LocalSessionManager.java", + "src/org/chromium/chrome/browser/media/remote/MediaItem.java", + "src/org/chromium/chrome/browser/media/remote/RemotePlaybackRoutePublisher.java", + "src/org/chromium/chrome/browser/media/remote/RemoteSessionManager.java", + "src/org/chromium/chrome/browser/media/router/DummyRoutePublisher.java", + ] + deps = [ + "//base:base_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + "//third_party/android_tools:android_support_v7_mediarouter_java", + google_play_services_library, + ] +} diff --git a/chromium/chrome/test/android/chrome_public_test_support/BUILD.gn b/chromium/chrome/test/android/chrome_public_test_support/BUILD.gn new file mode 100644 index 00000000000..d65584b0479 --- /dev/null +++ b/chromium/chrome/test/android/chrome_public_test_support/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +# GYP: //clank/native/clank.gyp:chrome_public_test_support_apk +android_apk("chrome_public_test_support_apk") { + deps = [ + "//chrome/test/android/cast_emulator:cast_emulator", + ] + + apk_name = "ChromePublicTestSupport" + android_manifest = "AndroidManifest.xml" +} diff --git a/chromium/chrome/test/base/js2gtest.gni b/chromium/chrome/test/base/js2gtest.gni new file mode 100644 index 00000000000..c4fde1f4865 --- /dev/null +++ b/chromium/chrome/test/base/js2gtest.gni @@ -0,0 +1,137 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build_overrides/v8.gni") +import("//v8/snapshot_toolchain.gni") + +# Variables: +# test_type: One of 'webui', 'unit' or 'extension' indicating what +# environment the test runs under. +# sources: List of javascript test source files. +# deps_js: Javascript file with closure library dependencies. Only needed +# if the test fixtures use closureModuleDeps. +# gen_include_files: List of javascript files used in GEN_INCLUDE calls +# in the tests and therefore considered input to the C++ generation step. +# extra_js_files: List of javascript files needed by the test at runtime, +# typically listed in the extraLibraries member of the test fixture. +# defines +# deps +# visibility +template("js2gtest") { + assert(defined(invoker.test_type) && + (invoker.test_type == "webui" || invoker.test_type == "unit" || + invoker.test_type == "extension")) + action_name = target_name + "_action" + source_set_name = target_name + + # The mapping from sources to the copied version. + copied_source_pattern = "$root_out_dir/test_data/{{source_root_relative_dir}}/{{source_file_part}}" + + gen_source_pattern = "{{source_gen_dir}}/{{source_name_part}}-gen.cc" + + action_foreach(action_name) { + testonly = true + visibility = [ ":$source_set_name" ] + script = "//tools/gypv8sh.py" + + sources = invoker.sources + + v8_shell_path = get_label_info("//v8:v8_shell($snapshot_toolchain)", + "root_out_dir") + "/v8_shell" + if (is_win) { + v8_shell_path += ".exe" + } + + input_js = [ + "//chrome/third_party/mock4js/mock4js.js", + "//chrome/test/data/webui/test_api.js", + "//chrome/test/base/js2gtest.js", + ] + inputs = [ v8_shell_path ] + input_js + if (defined(invoker.deps_js)) { + inputs += [ invoker.deps_js ] + } + if (defined(invoker.gen_include_files)) { + inputs += invoker.gen_include_files + } + + # Outputs. The script will copy the source files to the output directory, + # which then must be treated as runtime data. The generated .cc file isn't + # data, it will be compiled in a step below. + outputs = [ + copied_source_pattern, + gen_source_pattern, + ] + data = process_file_template(sources, [ copied_source_pattern ]) + + args = [] + if (defined(invoker.deps_js)) { + args += [ + "--deps_js", + rebase_path(invoker.deps_js, root_build_dir), + ] + } + args += [ + # Need "./" for script to find binary (cur dir is not on path). + "./" + rebase_path(v8_shell_path, root_build_dir), + ] + args += rebase_path(input_js, root_build_dir) + [ invoker.test_type ] + if (v8_use_external_startup_data) { + args += [ "--external=y" ] + } else { + args += [ "--external=n" ] + } + args += [ + "{{source}}", + "{{source_root_relative_dir}}/{{source_file_part}}", + gen_source_pattern, + rebase_path(copied_source_pattern, root_build_dir), + ] + + deps = [ + "//v8:v8_shell($snapshot_toolchain)", + ] + if (defined(invoker.deps)) { + deps += invoker.deps + } + } + + if (defined(invoker.extra_js_files)) { + copy_target_name = target_name + "_copy" + copy(copy_target_name) { + visibility = [ ":$source_set_name" ] + sources = invoker.extra_js_files + outputs = [ + copied_source_pattern, + ] + } + } + + source_set(source_set_name) { + testonly = true + forward_variables_from(invoker, + [ + "defines", + "visibility", + ]) + sources = get_target_outputs(":$action_name") + deps = [ + ":$action_name", + + # The generator implicitly makes includes from these targets. + "//chrome/test:test_support", + "//testing/gmock", + "//testing/gtest", + "//url", + ] + if (defined(invoker.deps)) { + deps += invoker.deps + } + if (defined(invoker.extra_js_files)) { + data_deps = [ + ":$copy_target_name", + ] + } + } +} diff --git a/chromium/chrome/test/chromedriver/BUILD.gn b/chromium/chrome/test/chromedriver/BUILD.gn new file mode 100644 index 00000000000..990b6c31a26 --- /dev/null +++ b/chromium/chrome/test/chromedriver/BUILD.gn @@ -0,0 +1,244 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//chrome/chrome_tests.gni") +import("//testing/test.gni") + +# GYP version: chrome/chrome_tests.gypi:automation_client_lib +# (embed_js_in_cpp action) +action("embed_js_in_cpp") { + script = "embed_js_in_cpp.py" + + js_files = [ + "js/add_cookie.js", + "js/call_function.js", + "js/execute_async_script.js", + "js/focus.js", + "js/get_element_region.js", + "js/is_option_element_toggleable.js", + ] + + inputs = [ "cpp_source.py" ] + js_files + + outputs = [ + "$target_gen_dir/chrome/js.cc", + "$target_gen_dir/chrome/js.h", + ] + args = [ + "--directory", + rebase_path("$target_gen_dir/chrome", root_build_dir), + ] + args += rebase_path(js_files, root_build_dir) +} + +# GYP version: chrome/chrome_tests.gypi:automation_client_lib +# (embed_user_data_dir_in_cpp action) +action("embed_user_data_dir_in_cpp") { + script = "embed_user_data_dir_in_cpp.py" + + files = [ + "chrome/preferences.txt", + "chrome/local_state.txt", + ] + + inputs = [ "cpp_source.py" ] + files + outputs = [ + "$target_gen_dir/chrome/user_data_dir.cc", + "$target_gen_dir/chrome/user_data_dir.h", + ] + + args = [ + "--directory", + rebase_path("$target_gen_dir/chrome", root_build_dir), + ] + args += rebase_path(files, root_build_dir) +} + +# GYP version: chrome/chrome_tests.gypi:automation_client_lib +# (embed_extension_in_cpp action) +action("embed_extension_in_cpp") { + script = "embed_extension_in_cpp.py" + + files = [ + "extension/background.js", + "extension/manifest.json", + ] + + inputs = [ "cpp_source.py" ] + files + outputs = [ + "$target_gen_dir/chrome/embedded_automation_extension.cc", + "$target_gen_dir/chrome/embedded_automation_extension.h", + ] + + args = [ + "--directory", + rebase_path("$target_gen_dir/chrome", root_build_dir), + ] + args += rebase_path(files, root_build_dir) +} + +# GYP version: chrome/chrome_tests.gypi:automation_client_lib +source_set("automation_client_lib") { + sources = + rebase_path(chrome_tests_gypi_values.chrome_automation_client_lib_sources, + ".", + "//chrome") + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + # Also compile the generated files. + sources += get_target_outputs(":embed_extension_in_cpp") + sources += get_target_outputs(":embed_js_in_cpp") + sources += get_target_outputs(":embed_user_data_dir_in_cpp") + + deps = [ + ":embed_extension_in_cpp", + ":embed_js_in_cpp", + ":embed_user_data_dir_in_cpp", + "//base", + "//base/third_party/dynamic_annotations", + "//net", + "//third_party/zlib:minizip", + "//third_party/zlib:zip", + "//ui/accessibility:ax_gen", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry", + "//url", + ] +} + +# GYP version: chrome/chrome_tests.gypi:chromedriver_lib +# (embed_version_in_cpp action) +action("embed_version_in_cpp") { + script = "embed_version_in_cpp.py" + inputs = [ + "cpp_source.py", + "VERSION", + ] + outputs = [ + "$target_gen_dir/version.cc", + "$target_gen_dir/version.h", + ] + + args = [ + "--version-file", + rebase_path("VERSION", root_build_dir), + "--directory", + rebase_path(target_gen_dir, root_build_dir), + ] +} + +# GYP version: chrome/chrome_tests.gypi:chromedriver_lib +source_set("lib") { + sources = rebase_path(chrome_tests_gypi_values.chrome_driver_lib_sources, + ".", + "//chrome") + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + # Also compile the generated version files. + sources += get_target_outputs(":embed_version_in_cpp") + + # These aren't automatically filtered out. + if (!use_x11) { + sources -= [ "keycode_text_conversion_x.cc" ] + } + if (!use_ozone) { + sources -= [ "keycode_text_conversion_ozone.cc" ] + } + + deps = [ + ":automation_client_lib", + ":embed_version_in_cpp", + "//base", + "//base/third_party/dynamic_annotations", + "//chrome/common:version_header", + "//crypto", + "//net", + "//net:http_server", + "//third_party/zlib", + "//ui/base", + "//ui/events:dom_keycode_converter", + "//ui/events:events_base", + "//ui/events/ozone:events_ozone_layout", + "//ui/gfx", + "//ui/gfx/geometry", + ] + + if (use_x11) { + configs += [ "//build/config/linux:x11" ] + deps += [ "//ui/gfx/x" ] + } + + if (is_mac) { + libs = [ "Carbon.framework" ] + } +} + +executable("chromedriver") { + sources = [ + "server/chromedriver_server.cc", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":lib", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} + +test("chromedriver_unittests") { + sources = + rebase_path(chrome_tests_gypi_values.chrome_driver_unittests_sources, + ".", + "//chrome") + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + data = [ + "//chrome/test/data/chromedriver/", + ] + + deps = [ + ":lib", + "//base", + "//base/test:run_all_unittests", + "//net", + "//net:http_server", + "//testing/gtest", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry", + ] +} + +# ChromeDriver tests that aren't run on the main buildbot. Available as an +# optional test type on trybots. +test("chromedriver_tests") { + sources = rebase_path(chrome_tests_gypi_values.chrome_driver_tests_sources, + ".", + "//chrome") + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":lib", + "//base", + "//base/test:run_all_unittests", + "//net", + "//net:http_server", + "//net:test_support", + "//testing/gtest", + "//url", + ] +} diff --git a/chromium/chrome/test/chromedriver/test/webview_shell/BUILD.gn b/chromium/chrome/test/chromedriver/test/webview_shell/BUILD.gn new file mode 100644 index 00000000000..1ac38960ed3 --- /dev/null +++ b/chromium/chrome/test/chromedriver/test/webview_shell/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +android_resources("chromedriver_webview_shell_resources") { + resource_dirs = [ "java/res" ] + android_manifest = "java/AndroidManifest.xml" +} +android_apk("chromedriver_webview_shell_apk") { + apk_name = "ChromeDriverWebViewShell" + deps = [ + ":chromedriver_webview_shell_resources", + ] + java_files = [ "java/src/org/chromium/chromedriver_webview_shell/Main.java" ] + android_manifest = "java/AndroidManifest.xml" +} diff --git a/chromium/chrome/test/data/BUILD.gn b/chromium/chrome/test/data/BUILD.gn new file mode 100644 index 00000000000..ef59dc6b11d --- /dev/null +++ b/chromium/chrome/test/data/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +grit("webui_test_resources") { + source = "webui_test_resources.grd" + outputs = [ + "chrome/test/data/grit/webui_test_resources.h", + "webui_test_resources.pak", + ] + output_dir = "$root_gen_dir/chrome" +} diff --git a/chromium/chrome/test/data/nacl/BUILD.gn b/chromium/chrome/test/data/nacl/BUILD.gn new file mode 100644 index 00000000000..9b8671af082 --- /dev/null +++ b/chromium/chrome/test/data/nacl/BUILD.gn @@ -0,0 +1,618 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/nacl/config.gni") +import("//ppapi/native_client/nacl_test_data.gni") + +group("nacl") { + newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}" + glibc = "//build/toolchain/nacl:glibc_${target_cpu}" + pnacl = "//build/toolchain/nacl:newlib_pnacl" + data_deps = [ + ":exit_status_test($glibc)", + ":exit_status_test($newlib)", + ":exit_status_test($pnacl)", + ":extension_validation_cache($glibc)", + ":extension_validation_cache($newlib)", + ":irt_exception_test($glibc)", + ":irt_exception_test($newlib)", + ":irt_exception_test($pnacl)", + ":irt_manifest_file($newlib)", + ":pnacl_debug_url_test($pnacl)", + ":pnacl_dyncode_syscall_disabled_test($pnacl)", + ":pnacl_error_handling_test($pnacl)", + ":pnacl_hw_eh_disabled_test($pnacl)", + ":pnacl_mime_type_test($glibc)", + ":pnacl_mime_type_test($newlib)", + ":pnacl_mime_type_test($pnacl)", + ":pnacl_options_test($pnacl)", + ":pnacl_url_loader_test($pnacl)", + ":ppapi_bad_get_ppp_instance_crash($newlib)", + ":ppapi_bad_no_ppp_instance($newlib)", + ":ppapi_bad_ppp_initialize($newlib)", + ":ppapi_bad_ppp_initialize_crash($newlib)", + ":ppapi_bad_ppp_instance_didcreate($newlib)", + ":ppapi_bad_ppp_instance_didcreate_crash($newlib)", + ":ppapi_crash_in_callback($glibc)", + ":ppapi_crash_in_callback($newlib)", + ":ppapi_crash_in_callback($pnacl)", + ":ppapi_crash_off_main_thread($glibc)", + ":ppapi_crash_off_main_thread($newlib)", + ":ppapi_crash_off_main_thread($pnacl)", + ":ppapi_crash_ppapi_off_main_thread($glibc)", + ":ppapi_crash_ppapi_off_main_thread($newlib)", + ":ppapi_crash_ppapi_off_main_thread($pnacl)", + ":ppapi_crash_via_check_failure($glibc)", + ":ppapi_crash_via_check_failure($newlib)", + ":ppapi_crash_via_check_failure($pnacl)", + ":ppapi_crash_via_exit_call($glibc)", + ":ppapi_crash_via_exit_call($newlib)", + ":ppapi_crash_via_exit_call($pnacl)", + ":ppapi_extension_mime_handler($newlib)", + ":ppapi_ppb_core($glibc)", + ":ppapi_ppb_core($newlib)", + ":ppapi_ppb_core($pnacl)", + ":ppapi_ppb_instance($glibc)", + ":ppapi_ppb_instance($newlib)", + ":ppapi_ppb_instance($pnacl)", + ":ppapi_ppp_instance($glibc)", + ":ppapi_ppp_instance($newlib)", + ":ppapi_ppp_instance($pnacl)", + ":ppapi_progress_events($glibc)", + ":ppapi_progress_events($newlib)", + ":ppapi_progress_events($pnacl)", + ":shared_test_files($glibc)", + ":shared_test_files($newlib)", + ":shared_test_files($pnacl)", + ":simple_test($glibc)", + ":simple_test($newlib)", + ":simple_test($pnacl)", + ":sysconf_nprocessors_onln_test($glibc)", + ":sysconf_nprocessors_onln_test($newlib)", + ":sysconf_nprocessors_onln_test($pnacl)", + ] + if (target_cpu != "arm") { + data_deps += [ ":partly_invalid($newlib)" ] + } + if (is_linux) { + nonsfi = "//build/toolchain/nacl:newlib_pnacl_nonsfi" + data_deps += [ + ":irt_exception_test($nonsfi)", + ":irt_manifest_file($nonsfi)", + ":shared_test_files($nonsfi)", + ] + if (is_clang) { + data_deps += [ ":nonsfi_libc_free" ] + } + } +} + +if (is_nacl) { + copy("shared_test_files") { + sources = [ + # TODO(ncbray) move into chrome/test/data/nacl when all tests are + # converted. + "//ppapi/native_client/tools/browser_tester/browserdata/nacltest.js", + + # Files that aren't associated with any particular executable. + "bad/ppapi_bad.html", + "bad/ppapi_bad.js", + "bad/ppapi_bad_doesnotexist.nmf", + "bad/ppapi_bad_magic.nmf", + "bad/ppapi_bad_manifest_bad_files.nmf", + "bad/ppapi_bad_manifest_nexe_arch.nmf", + "bad/ppapi_bad_manifest_uses_nexes.nmf", + "bad/ppapi_bad_native.html", + "crash/ppapi_crash.js", + "crash/ppapi_crash_in_callback.html", + "crash/ppapi_crash_off_main_thread.html", + "crash/ppapi_crash_ppapi_off_main_thread.html", + "crash/ppapi_crash_via_check_failure.html", + "crash/ppapi_crash_via_exit_call.html", + "load_util.js", + "manifest_file/test_file.txt", + "progress_event_listener.js", + "simple_cc.js", + ] + outputs = [ + "${root_build_dir}/nacl_test_data/${nacl_toolchain_variant}/{{source_file_part}}", + ] + } + + source_set("ppapi_test_lib") { + sources = [ + "ppapi_test_lib/get_browser_interface.cc", + "ppapi_test_lib/get_browser_interface.h", + "ppapi_test_lib/internal_utils.cc", + "ppapi_test_lib/internal_utils.h", + "ppapi_test_lib/module_instance.cc", + "ppapi_test_lib/test_interface.cc", + "ppapi_test_lib/test_interface.h", + "ppapi_test_lib/testable_callback.cc", + "ppapi_test_lib/testable_callback.h", + ] + deps = [ + "//native_client/src/shared/gio", + "//native_client/src/shared/platform", + "//ppapi/native_client:ppapi_lib", + ] + } + + nacl_test_data("irt_manifest_file") { + sources = [ + "manifest_file/irt_manifest_file_test.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + nmfflags = [ + "-xtest_file:test_file.txt", + "-xnmf says hello world:test_file.txt", + + # There is no dummy_test_file.txt file intentionally. This is just for + # a test case where there is a manifest entry, but no actual file. + "-xdummy_test_file:dummy_test_file.txt", + ] + destination_dir = "nacl_test_data" + test_files = [ "manifest_file/irt_manifest_file_test.html" ] + } + + nacl_test_data("irt_exception_test") { + sources = [ + "irt_exception/irt_exception_test.cc", + ] + deps = [ + ":ppapi_test_lib", + ] + libs = [ "nacl_exception" ] + destination_dir = "nacl_test_data" + test_files = [ "irt_exception/irt_exception_test.html" ] + } +} + +if (is_nacl && !is_nacl_nonsfi) { + nacl_test_data("simple_test") { + output_name = "simple" + sources = [ + "simple.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "nacl_test_data" + test_files = [ "nacl_load_test.html" ] + } + + nacl_test_data("exit_status_test") { + output_name = "pm_exit_status_test" + sources = [ + "exit_status/pm_exit_status_test.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "nacl_test_data" + test_files = [ "exit_status/pm_exit_status_test.html" ] + } + + nacl_test_data("extension_validation_cache") { + sources = [ + "simple.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + + # Need a new directory to not clash with with other extension + # tests's files (e.g., manifest.json). + destination_dir = "nacl_test_data/extension_vcache_test" + test_files = [ + # TODO(ncbray) move into chrome/test/data/nacl when all tests are + # converted. + "//ppapi/native_client/tools/browser_tester/browserdata/nacltest.js", + "extension_validation_cache/extension_validation_cache.html", + "extension_validation_cache/extension_validation_cache.js", + + # Turns the test data directory into an extension. + # Use a different nexe_destination_dir to isolate the files. + # Note that the .nexe names are embedded in this file. + "extension_validation_cache/manifest.json", + "load_util.js", + "simple_cc.js", + ] + } + + nacl_test_data("sysconf_nprocessors_onln_test") { + sources = [ + "sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "nacl_test_data" + test_files = + [ "sysconf_nprocessors_onln/sysconf_nprocessors_onln_test.html" ] + } + + nacl_test_data("ppapi_progress_events") { + sources = [ + "progress_events/ppapi_progress_events.cc", + ] + destination_dir = "nacl_test_data" + test_files = [ "progress_events/ppapi_progress_events.html" ] + deps = [ + ":ppapi_test_lib", + ] + } + + nacl_test_data("ppapi_bad_ppp_initialize") { + sources = [ + "bad/ppapi_bad_ppp_initialize.cc", + ] + destination_dir = "nacl_test_data" + } + + nacl_test_data("ppapi_bad_ppp_initialize_crash") { + sources = [ + "bad/ppapi_bad_ppp_initialize_crash.cc", + ] + destination_dir = "nacl_test_data" + } + + nacl_test_data("ppapi_bad_no_ppp_instance") { + sources = [ + "bad/ppapi_bad_no_ppp_instance.cc", + ] + deps = [ + "//native_client/src/shared/platform", + ] + destination_dir = "nacl_test_data" + } + + nacl_test_data("ppapi_bad_get_ppp_instance_crash") { + sources = [ + "bad/ppapi_bad_get_ppp_instance_crash.cc", + ] + destination_dir = "nacl_test_data" + } + + nacl_test_data("ppapi_bad_ppp_instance_didcreate") { + sources = [ + "bad/ppapi_bad_ppp_instance_didcreate.cc", + ] + destination_dir = "nacl_test_data" + } + + nacl_test_data("ppapi_bad_ppp_instance_didcreate_crash") { + sources = [ + "bad/ppapi_bad_ppp_instance_didcreate_crash.cc", + ] + destination_dir = "nacl_test_data" + } + + nacl_test_data("ppapi_crash_via_check_failure") { + sources = [ + "crash/ppapi_crash_via_check_failure.cc", + ] + destination_dir = "nacl_test_data" + deps = [ + ":ppapi_test_lib", + ] + } + + nacl_test_data("ppapi_crash_via_exit_call") { + sources = [ + "crash/ppapi_crash_via_exit_call.cc", + ] + destination_dir = "nacl_test_data" + deps = [ + ":ppapi_test_lib", + ] + } + + nacl_test_data("ppapi_crash_in_callback") { + sources = [ + "crash/ppapi_crash_in_callback.cc", + ] + destination_dir = "nacl_test_data" + deps = [ + ":ppapi_test_lib", + ] + } + + nacl_test_data("ppapi_crash_off_main_thread") { + sources = [ + "crash/ppapi_crash_off_main_thread.cc", + ] + destination_dir = "nacl_test_data" + deps = [ + ":ppapi_test_lib", + ] + } + + nacl_test_data("ppapi_crash_ppapi_off_main_thread") { + sources = [ + "crash/ppapi_crash_ppapi_off_main_thread.cc", + ] + destination_dir = "nacl_test_data" + deps = [ + ":ppapi_test_lib", + ] + } + + nacl_test_data("ppapi_extension_mime_handler") { + sources = [ + "extension_mime_handler/ppapi_extension_mime_handler.cc", + ] + deps = [ + ":ppapi_test_lib", + ] + destination_dir = "nacl_test_data" + test_files = [ + "extension_mime_handler/ppapi_extension_mime_handler.html", + "extension_mime_handler/mime_test_data.dat", + + # For faking the file's MIME type. + "extension_mime_handler/mime_test_data.dat.mock-http-headers", + + # Turns the test data directory into an extension. Hackish. + # Note that the .nexe names are embedded in this file. + "extension_mime_handler/manifest.json", + ] + } + + nacl_test_data("pnacl_debug_url_test") { + output_name = "pnacl_debug_url" + sources = [ + "simple.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + generate_nmf = false + if (current_cpu == "pnacl") { + debug_pexe = true + } + destination_dir = "nacl_test_data" + test_files = [ + "pnacl_debug_url/pnacl_debug_url.html", + "pnacl_debug_url/pnacl_has_debug.nmf", + "pnacl_debug_url/pnacl_has_debug_flag_off.nmf", + "pnacl_debug_url/pnacl_no_debug.nmf", + ] + } + + nacl_test_data("pnacl_error_handling_test") { + output_name = "pnacl_errors" + sources = [ + "simple.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + generate_nmf = false + if (current_cpu == "pnacl") { + nonstable_pexe = true + } + destination_dir = "nacl_test_data" + test_files = [ + "pnacl_error_handling/pnacl_error_handling.html", + "pnacl_error_handling/bad.pexe", + "pnacl_error_handling/pnacl_bad_pexe.nmf", + "pnacl_error_handling/pnacl_bad_pexe_O0.nmf", + "pnacl_error_handling/pnacl_bad_doesnotexist.nmf", + "pnacl_error_handling/pnacl_illformed_manifest.nmf", + "pnacl_error_handling/pnacl_nonfinal_pexe_O0.nmf", + ] + } + + copy("pnacl_mime_type_test") { + sources = [ + "pnacl_mime_type/pnacl_mime_type.html", + ] + outputs = [ + "${root_build_dir}/nacl_test_data/${nacl_toolchain_variant}/{{source_file_part}}", + ] + } + + nacl_test_data("pnacl_options_test") { + output_name = "pnacl_options" + sources = [ + "simple.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + generate_nmf = false + destination_dir = "nacl_test_data" + test_files = [ + "pnacl_nmf_options/pnacl_options.html", + "pnacl_nmf_options/pnacl_o_0.nmf", + "pnacl_nmf_options/pnacl_o_2.nmf", + "pnacl_nmf_options/pnacl_o_large.nmf", + ] + } + + nacl_test_data("pnacl_url_loader_test") { + output_name = "pnacl_url_loader" + sources = [ + "pnacl_url_loader/pnacl_url_loader.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + generate_nmf = true + destination_dir = "nacl_test_data" + test_files = [ "pnacl_url_loader/pnacl_url_loader.html" ] + } + + nacl_test_data("pnacl_dyncode_syscall_disabled_test") { + output_name = "pnacl_dyncode_syscall_disabled" + sources = [ + "pnacl_dyncode_syscall_disabled/pnacl_dyncode_syscall_disabled.cc", + ] + deps = [ + ":ppapi_test_lib", + "//native_client/src/untrusted/nacl:nacl_dyncode_private", + ] + destination_dir = "nacl_test_data" + test_files = + [ "pnacl_dyncode_syscall_disabled/pnacl_dyncode_syscall_disabled.html" ] + } + + nacl_test_data("pnacl_hw_eh_disabled_test") { + output_name = "pnacl_hw_eh_disabled" + sources = [ + "pnacl_hw_eh_disabled/pnacl_hw_eh_disabled.cc", + ] + deps = [ + ":ppapi_test_lib", + "//native_client/src/untrusted/nacl:nacl_exception_private", + ] + destination_dir = "nacl_test_data" + test_files = [ "pnacl_hw_eh_disabled/pnacl_hw_eh_disabled.html" ] + } + + # Legacy NaCl PPAPI interface tests being here. + nacl_test_data("ppapi_ppb_core") { + sources = [ + "ppapi/ppb_core/ppapi_ppb_core.cc", + ] + deps = [ + ":ppapi_test_lib", + ] + destination_dir = "nacl_test_data" + test_files = [ "ppapi/ppb_core/ppapi_ppb_core.html" ] + } + + nacl_test_data("ppapi_ppb_instance") { + sources = [ + "ppapi/ppb_instance/ppapi_ppb_instance.cc", + ] + deps = [ + ":ppapi_test_lib", + ] + destination_dir = "nacl_test_data" + test_files = [ "ppapi/ppb_instance/ppapi_ppb_instance.html" ] + } + + nacl_test_data("ppapi_ppp_instance") { + sources = [ + "ppapi/ppp_instance/ppapi_ppp_instance.cc", + ] + deps = [ + ":ppapi_test_lib", + ] + destination_dir = "nacl_test_data" + test_files = [ + "ppapi/ppp_instance/ppapi_ppp_instance.html", + "ppapi/ppp_instance/ppapi_ppp_instance.js", + ] + } + + if (target_cpu != "arm") { + # Source file does not have asm for ARM. + nacl_test_data("partly_invalid") { + sources = [ + "//native_client/tests/stubout_mode/partly_invalid.c", + ] + destination_dir = "nacl_test_data" + if (target_cpu == "mipsel") { + cflags = [ + "--pnacl-mips-bias", + "-arch", + "mips32", + "--pnacl-allow-translate", + ] + ldflags = [ "--pnacl-allow-native" ] + } + } + } +} + +if (is_linux && is_clang) { + if (target_cpu == "x86") { + arch = "x86_32" + } else if (target_cpu == "x64") { + arch = "x86_64" + } else { + arch = target_cpu + } + + config("nonsfi_libc_free_nexe_config") { + cflags = [ + "-Wno-sign-compare", + + # Stack-Smashing protector does not work with libc-free context. + "-fno-stack-protector", + + # Optimizers may translate the original code to code which + # requires builtin functions and/or relocations. Specifically, + # the LLVM's optimizer translates for-loop based zero + # clear to memset. + "-O0", + + # ARM GCC emits symbols like __aeabi_unwind_cpp_pr0 in + # .exidx sections without this flag. + "-fno-unwind-tables", + ] + } + + executable("nonsfi_libc_free_nexe") { + output_name = "libc_free_$arch" + output_extension = "nexe" + sources = [ + "nonsfi/libc_free.c", + ] + + # Here, we would like to link a relocatable, libc-free executable. + # -shared/-fPIC make this binary relocatable. -nostdlib ensures + # this is libc-free. + # The program does not apply any dynamic relocations at start up, + # so it cannot rely on relocations having been applied. + # In addition, -fvisibility=hidden avoids creating some types + # of relocation. + cflags = [ + "-fPIC", + "-fvisibility=hidden", + ] + ldflags = [ + "-nostdlib", + "-shared", + + # This binary cannot relocate itself, so we should have no + # undefined references left. + "-Wl,--no-undefined", + + # Silence the warning about the unused '-pthread' argument. + # TODO(gn): Come up with a way to remove the -pthread flag instead. + "-Qunused-arguments", + ] + defines = [ "NACL_LINUX=1" ] + include_dirs = [ "../../../.." ] + + # Do not use any sanitizers tools, which require a few symbols. + configs -= [ "//build/config/sanitizers:default_sanitizer_flags" ] + configs += [ ":nonsfi_libc_free_nexe_config" ] + } + + copy("nonsfi_libc_free") { + sources = [ + "${root_out_dir}/libc_free_${arch}.nexe", + + # TODO(ncbray) move into chrome/test/data/nacl when all tests are + # converted. + "//ppapi/native_client/tools/browser_tester/browserdata/nacltest.js", + "nonsfi/irt_test.html", + "nonsfi/libc_free.html", + "nonsfi/libc_free.nmf", + ] + outputs = [ + "${root_build_dir}/nacl_test_data/libc-free/{{source_file_part}}", + ] + deps = [ + ":nonsfi_libc_free_nexe", + ] + } +} diff --git a/chromium/chrome/test/media_router/BUILD.gn b/chromium/chrome/test/media_router/BUILD.gn new file mode 100644 index 00000000000..42dc30ef3bf --- /dev/null +++ b/chromium/chrome/test/media_router/BUILD.gn @@ -0,0 +1,65 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Browser test resource files. +media_router_integration_test_resources = [ + "resources/basic_test.html", + "resources/close_route_with_error_on_send.json", + "resources/common.js", + "resources/fail_create_route.json", + "resources/fail_reconnect_session.html", + "resources/fail_reconnect_session.json", + "resources/no_provider.json", + "resources/no_sinks.json", + "resources/no_supported_sinks.json", + "resources/route_creation_timed_out.json", +] + +media_router_test_extension_resources = [ + "telemetry/extension/manifest.json", + "telemetry/extension/script.js", +] + +# GYP version: chrome/test/media_router/media_router_tests.gypi: +# media_router_test_extension_files +copy("test_extension_resource_files") { + sources = media_router_test_extension_resources + outputs = [ + "$root_out_dir/media_router/test_extension/{{source_file_part}}", + ] +} + +# GYP version: chrome/test/media_router/media_router_tests.gypi: +# media_router_integration_test_files +copy("browser_tests_resource_files") { + sources = media_router_integration_test_resources + outputs = [ + "$root_out_dir/media_router/browser_test_resources/{{source_file_part}}", + ] +} + +source_set("media_router_browsertests") { + testonly = true + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + sources = [ + "media_router_base_browsertest.cc", + "media_router_base_browsertest.h", + "media_router_e2e_browsertest.cc", + "media_router_e2e_browsertest.h", + "media_router_e2e_ui_browsertest.cc", + "media_router_integration_browsertest.cc", + "media_router_integration_browsertest.h", + "media_router_integration_ui_browsertest.cc", + "test_media_sinks_observer.cc", + "test_media_sinks_observer.h", + ] + deps = [ + ":browser_tests_resource_files", + "//chrome/browser/media/router:test_support", + "//chrome/test:test_support", + "//chrome/test:test_support_ui", + "//skia", + "//testing/gtest", + ] +} diff --git a/chromium/chrome/test/mini_installer/mini_installer_test.gni b/chromium/chrome/test/mini_installer/mini_installer_test.gni new file mode 100644 index 00000000000..dc663a87dc3 --- /dev/null +++ b/chromium/chrome/test/mini_installer/mini_installer_test.gni @@ -0,0 +1,37 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# All test files. After get_path_info they will be in absolute-path format. +# This list is used to know when to re-trigger running this test. +mini_installer_test_files = + get_path_info([ + "chrome_helper.py", + "config/chrome_canary_installed.prop", + "config/chrome_canary_inuse.prop", + "config/chrome_canary_no_pv.prop", + "config/chrome_canary_not_installed.prop", + "config/chrome_canary_not_inuse.prop", + "config/chrome_system_installed.prop", + "config/chrome_system_inuse.prop", + "config/chrome_system_no_pv.prop", + "config/chrome_system_not_installed.prop", + "config/chrome_system_not_inuse.prop", + "config/chrome_user_installed.prop", + "config/chrome_user_inuse.prop", + "config/chrome_user_no_pv.prop", + "config/chrome_user_not_installed.prop", + "config/chrome_user_not_inuse.prop", + "config/config.config", + "file_verifier.py", + "launch_chrome.py", + "process_verifier.py", + "quit_chrome.py", + "registry_verifier.py", + "test_installer.py", + "uninstall_chrome.py", + "variable_expander.py", + "verifier.py", + "verifier_runner.py", + ], + "abspath") diff --git a/chromium/chrome/third_party/mozilla_security_manager/BUILD.gn b/chromium/chrome/third_party/mozilla_security_manager/BUILD.gn new file mode 100644 index 00000000000..5aa58cfc88c --- /dev/null +++ b/chromium/chrome/third_party/mozilla_security_manager/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("mozilla_security_manager") { + sources = [ + "nsNSSCertHelper.cpp", + "nsNSSCertHelper.h", + "nsNSSCertificate.cpp", + "nsNSSCertificate.h", + "nsUsageArrayHelper.cpp", + "nsUsageArrayHelper.h", + ] + + deps = [ + "//base", + "//base:i18n", + "//chrome/app:generated_resources", + "//crypto:platform", + "//net", + "//third_party/icu", + "//ui/base", + ] +} diff --git a/chromium/chrome/tools/build/win/syzygy/BUILD.gn b/chromium/chrome/tools/build/win/syzygy/BUILD.gn new file mode 100644 index 00000000000..822a645f3e4 --- /dev/null +++ b/chromium/chrome/tools/build/win/syzygy/BUILD.gn @@ -0,0 +1,246 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//build/config/compiler/compiler.gni") +import("//build/config/sanitizers/sanitizers.gni") + +assert(!syzygy_optimize || !is_syzyasan, + "Don't do both syzygy_optimize and is_syzyasan") + +# Where the output binaries will be placed. +syzygy_dest_dir = "$root_out_dir/syzygy" + +if (syzygy_optimize) { + # Generates a Syzygy optimize target. + # + # dll_name (required) + # Name of the DLL to be instrumented, with no extension or path. This + # ${dll_name}.dll is assumed to be in the output directory and must be + # generated by a dependency of this target. + # + # deps (required) + # Normal meaning. + # + # data_deps + # Normal meaning. + template("syzygy_optimize") { + action(target_name) { + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + script = "//chrome/tools/build/win/syzygy/reorder.py" + + dll_name = invoker.dll_name + input_dll = "$root_out_dir/$dll_name.dll" + input_pdb = "$root_out_dir/$dll_name.dll.pdb" + + inputs = [ + input_dll, + #input_pdb, + ] + + outputs = [ + "$syzygy_dest_dir/$dll_name.dll", + "$syzygy_dest_dir/$dll_name.dll.pdb", + ] + + args = [ + "--input_executable", + rebase_path(input_dll, root_build_dir), + "--input_symbol", + rebase_path(input_pdb, root_build_dir), + "--destination_dir", + rebase_path(syzygy_dest_dir, root_build_dir), + ] + + forward_variables_from(invoker, + [ + "deps", + "data_deps", + "public_deps", + ]) + } + } + + syzygy_optimize("chrome_dll_syzygy") { + dll_name = "chrome" + deps = [ + "//chrome:main_dll", + ] + if (is_multi_dll_chrome) { + data_deps = [ + ":chrome_child_dll_syzygy", + ] + } + } + if (is_multi_dll_chrome) { + # Also instrument chrome_child.dll. + syzygy_optimize("chrome_child_dll_syzygy") { + dll_name = "chrome_child" + deps = [ + "//chrome:chrome_child", + ] + } + } +} else if (is_syzyasan) { + # Instruments a binary with SyzyAsan. + # + # binary_name (required) + # Name of the binary to be instrumented, with no extension or path. This + # binary_name is assumed to be in the output directory and must be + # generated by a dependency of this target. + # + # dest_dir (required) + # The destination directory where the instrumented image should be + # written. + # + # deps (required) + # Normal meaning. + # + # public_deps + # Normal meaning. + # + # data_deps + # Normal meaning. + template("syzygy_asan") { + action(target_name) { + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + script = "//chrome/tools/build/win/syzygy/instrument.py" + + filter = "syzyasan-instrumentation-filter.txt" + + binary_name = invoker.binary_name + dest_dir = invoker.dest_dir + input_image = "$root_out_dir/$binary_name" + input_pdb = "$root_out_dir/$binary_name.pdb" + + inputs = [ + filter, + input_image, + + #input_pdb, + ] + + output_filter = "$dest_dir/win-syzyasan-filter-$binary_name.txt.json" + + outputs = [ + "$dest_dir/$input_image", + "$dest_dir/$input_image.pdb", + output_filter, + ] + + args = [ + "--mode", + "asan", + "--input_executable", + rebase_path(input_image, root_build_dir), + "--input_symbol", + rebase_path(input_pdb, root_build_dir), + "--filter", + rebase_path(filter, root_build_dir), + "--output-filter-file", + rebase_path(output_filter, root_build_dir), + "--destination_dir", + rebase_path(dest_dir, root_build_dir), + ] + + deps = [ + "//chrome/tools/build/win/syzygy:copy_syzyasan_binaries", + ] + if (defined(invoker.deps)) { + deps += invoker.deps + } + forward_variables_from(invoker, + [ + "data_deps", + "public_deps", + ]) + } + } + + syzygy_asan("chrome_dll_syzygy") { + binary_name = "chrome.dll" + dest_dir = syzygy_dest_dir + deps = [ + "//chrome:main_dll", + ] + } + + if (is_multi_dll_chrome) { + # Also instrument chrome_child.dll. + # + # For official builds, the instrumented version will be put into an + # "instrumented" subdirectory and the regular output will be + # uninstrumented. Otherwise, chrome_child is also instrumented to the + # normal place. + syzygy_asan("chrome_child_dll_syzygy") { + binary_name = "chrome_child.dll" + deps = [ + "//chrome:chrome_child", + ] + + if (is_official_build) { + dest_dir = "$syzygy_dest_dir/instrumented" + deps += [ ":chrome_child_dll_syzygy_copy" ] + } else { + dest_dir = syzygy_dest_dir + } + + data_deps = [ + ":chrome_child_dll_syzygy", + ] + } + + if (is_official_build) { + # Copies the uninstrumented chrome_child.dll. + # GYP version: chrome/chrome_syzygy.gyp:chrome_child_dll_syzygy_copy + copy("chrome_child_dll_syzygy_copy") { + sources = [ + "$root_out_dir/chrome_child.dll", + "$root_out_dir/chrome_child.dll.pdb", + ] + outputs = [ + "$dest_dir/{{source_file_part}}", + ] + deps = [ + "//chrome:chrome_child", + ] + } + } + } +} else { + # No syzygy. Generate dummy targets so other targets can unconditionally + # depend on these without having to duplicate our conditions. + group("chrome_dll_syzygy") { + } + if (is_multi_dll_chrome) { + group("chrome_child_dll_syzygy") { + } + } +} + +if (is_syzyasan || syzygy_optimize) { + copy("copy_syzyasan_binaries") { + visibility = [ "//chrome/*" ] + + source_dir = "//third_party/syzygy/binaries/exe" + + sources = [ + "$source_dir/agent_logger.exe", + "$source_dir/minidump_symbolizer.py", + "$source_dir/syzyasan_rtl.dll", + "$source_dir/syzyasan_rtl.dll.pdb", + ] + + outputs = [ + "$syzygy_dest_dir/{{source_file_part}}", + ] + } +} + +# Prevent unused variable warning for code paths where this is unused. +assert(syzygy_dest_dir != "") diff --git a/chromium/chrome/tools/mac_helpers/BUILD.gn b/chromium/chrome/tools/mac_helpers/BUILD.gn new file mode 100644 index 00000000000..2beb33b6c8a --- /dev/null +++ b/chromium/chrome/tools/mac_helpers/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("infoplist_strings_tool") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + sources = [ + "infoplist_strings_util.mm", + ] + + deps = [ + "//base", + "//base:i18n", + "//chrome:strings", + "//third_party/icu", + "//ui/base:ui_data_pack", + ] + + libs = [ "Foundation.framework" ] +} diff --git a/chromium/chrome/tools/service_discovery_sniffer/BUILD.gn b/chromium/chrome/tools/service_discovery_sniffer/BUILD.gn new file mode 100644 index 00000000000..9b8b2c97f65 --- /dev/null +++ b/chromium/chrome/tools/service_discovery_sniffer/BUILD.gn @@ -0,0 +1,25 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +executable("service_discovery_sniffer") { + testonly = true + sources = [ + "service_discovery_sniffer.cc", + "service_discovery_sniffer.h", + ] + + deps = [ + "//base", + "//base/test:test_support", + "//build/config/sanitizers:deps", + "//chrome/browser", + "//net", + ] + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } +} diff --git a/chromium/chrome/utility/BUILD.gn b/chromium/chrome/utility/BUILD.gn new file mode 100644 index 00000000000..2f5c4f45202 --- /dev/null +++ b/chromium/chrome/utility/BUILD.gn @@ -0,0 +1,143 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/crypto.gni") +import("//build/config/features.gni") +import("//build/config/sysroot.gni") + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("../chrome_utility.gypi") ], + "scope", + [ "../chrome_utility.gypi" ]) + +# Provides a way for the utility library to push ldflags to dependents. +config("utility_ldflags") { + if (is_mac && safe_browsing_mode == 1) { + libs = [ "bz2" ] + } +} + +static_library("utility") { + sources = rebase_path(gypi_values.chrome_utility_sources, ".", "..") + defines = [] + configs += [ + "//build/config:precompiled_headers", + "//build/config/compiler:wexit_time_destructors", + ] + all_dependent_configs = [ ":utility_ldflags" ] + + public_deps = [] + deps = [ + "//base", + "//chrome:resources", + "//chrome:strings", + "//chrome/common", + "//chrome/common:mojo_bindings", + "//components/safe_json/utility", + "//components/search_engines", + "//components/strings", + "//components/url_formatter", + "//content/public/child", + "//content/public/common", + "//content/public/utility", + "//courgette:courgette_lib", + "//media", + "//net:net_with_v8", + "//services/shell/public/cpp", + "//skia", + "//sql", + "//third_party/libxml", + ] + + if (!is_android) { + deps += [ + "//chrome/common:mojo_bindings", + "//net:net_utility_services", + ] + sources += + rebase_path(gypi_values.chrome_utility_importer_sources, ".", "..") + } + + if (enable_extensions) { + deps += [ + "//chrome/common/extensions/api", + "//extensions/utility", + ] + + public_deps += [ "//chrome/common/extensions/api" ] + + sources += + rebase_path(gypi_values.chrome_utility_extensions_sources, ".", "..") + sources += + rebase_path(gypi_values.chrome_utility_shared_media_sources, ".", "..") + + # Prevent wininet from loading in the renderer. http://crbug.com/460679 + if (is_win) { + ldflags = [ "/DELAYLOAD:wininet.dll" ] + + # Add ESE library for Edge Import support. + libs = [ "esent.lib" ] + ldflags += [ "/DELAYLOAD:esent.dll" ] + } + + if (is_win || is_mac) { + sources += + rebase_path(gypi_values.chrome_utility_win_mac_media_gallery_sources, + ".", + "..") + deps += [ "//components/wifi" ] + } else { + sources += [ "image_writer/image_writer_stub.cc" ] + } + } + + if (use_nss_certs) { + sources += [ + "importer/nss_decryptor_system_nss.cc", + "importer/nss_decryptor_system_nss.h", + ] + deps += [ + "//crypto", + "//crypto:platform", + ] + } + + if (enable_print_preview || (enable_basic_printing && is_win)) { + deps += [ "//pdf" ] + } else { + sources -= [ + "printing_handler.cc", + "printing_handler.h", + ] + } + + if (safe_browsing_mode == 1) { + sources += + rebase_path(gypi_values.chrome_utility_safe_browsing_sources, ".", "..") + deps += [ "//third_party/zlib" ] + } +} + +if (is_mac) { + import("//testing/libfuzzer/fuzzer_test.gni") + fuzzer_test("safe_browsing_dmg_fuzzer") { + sources = [ + "safe_browsing/mac/convert_big_endian.h", + "safe_browsing/mac/fuzzer.cc", + "safe_browsing/mac/hfs.cc", + "safe_browsing/mac/hfs.h", + "safe_browsing/mac/read_stream.cc", + "safe_browsing/mac/read_stream.h", + "safe_browsing/mac/udif.cc", + "safe_browsing/mac/udif.h", + ] + + additional_configs = [ ":utility_ldflags" ] + + deps = [ + "//base", + "//third_party/zlib", + ] + } +} diff --git a/chromium/chrome/version.gni b/chromium/chrome/version.gni new file mode 100644 index 00000000000..a29cb8d372e --- /dev/null +++ b/chromium/chrome/version.gni @@ -0,0 +1,153 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") + +# Runs the version processing script over the given template file to produce +# an output file. This is used for generating various forms of files that +# incorporate the product name and version. +# +# Unlike GYP, this will actually compile the resulting file, so you don't need +# to add it separately to the sources, just depend on the target. +# +# This template automatically includes VERSION, LASTCHANGE, and BRANDING. It +# automatically uses the template file . +# GYP parameterizes this template file but all current invocations use this +# same one. If in the future we need to set it, this should be added as an +# optional argument. +# +# In GYP this is a rule that runs once per ".ver" file. In GN this just +# processes one file per invocation of the template so you may have to have +# multiple targets. +# +# Parameters: +# sources (optional): +# List of file names to read. When converting a GYP target, this should +# list the 'source' (see above) as well as any extra_variable_files. +# +# output: +# File name of file to write. In GYP this is unspecified and it will +# make up a file name for you based on the input name, and tack on +# "_version.rc" to the end. But in GN you need to specify the full name. +# +# template_file (optional): +# Template file to use (not a list). Most Windows uses for generating +# resources will want to specify the chrome_version_rc_template defined +# below. +# +# extra_args (optional): +# Extra arguments to pass to version.py. Any "-f <filename>" args should +# use sources instead. +# +# process_only (optional, defaults to false) +# Set to generate only one action that processes the version file and +# doesn't attempt to link the result into a source set. This is for if +# you are processing the version as data only. +# +# visibility (optional) +# +# Example: +# process_version("myversion") { +# sources = [ "myfile.h.in" ] +# output = "$target_gen_dir/myfile.h" +# extra_args = ["-e", "FOO=42"] +# extra_files = [ "foo/BRANDING" ] +# } +template("process_version") { + assert(defined(invoker.output), "Output must be defined for $target_name") + + process_only = defined(invoker.process_only) && invoker.process_only + + if (process_only) { + action_name = target_name + } else { + action_name = target_name + "_action" + source_set_name = target_name + } + + action(action_name) { + script = "//build/util/version.py" + + lastchange_path = "//build/util/LASTCHANGE" + version_path = "//chrome/VERSION" + if (is_chrome_branded) { + branding_path = "//chrome/app/theme/google_chrome/BRANDING" + } else { + branding_path = "//chrome/app/theme/chromium/BRANDING" + } + + inputs = [ + version_path, + lastchange_path, + branding_path, + ] + if (defined(invoker.inputs)) { + inputs += invoker.inputs + } + if (defined(invoker.template_file)) { + inputs += [ invoker.template_file ] + } + + outputs = [ + invoker.output, + ] + + args = [] + + if (is_official_build) { + args += [ "--official" ] + } + + if (defined(invoker.sources)) { + inputs += invoker.sources + foreach(i, invoker.sources) { + args += [ + "-f", + rebase_path(i, root_build_dir), + ] + } + } + + args += [ + "-f", + rebase_path(version_path, root_build_dir), + "-f", + rebase_path(branding_path, root_build_dir), + "-f", + rebase_path(lastchange_path, root_build_dir), + ] + if (defined(invoker.extra_args)) { + args += invoker.extra_args + } + args += [ + "-o", + rebase_path(invoker.output, root_build_dir), + ] + if (defined(invoker.template_file)) { + args += [ rebase_path(invoker.template_file, root_build_dir) ] + } + + forward_variables_from(invoker, [ "deps" ]) + + if (process_only) { + # When processing only, visibility gets applied to this target. + forward_variables_from(invoker, [ "visibility" ]) + } else { + # When linking the result, only the source set can depend on the action. + visibility = [ ":$source_set_name" ] + } + } + + if (!process_only) { + source_set(source_set_name) { + forward_variables_from(invoker, [ "visibility" ]) + sources = get_target_outputs(":$action_name") + public_deps = [ + ":$action_name", + ] + } + } +} + +chrome_version_rc_template = "//chrome/app/chrome_version.rc.version" diff --git a/chromium/chromecast/build/tests/cast_test.gni b/chromium/chromecast/build/tests/cast_test.gni new file mode 100644 index 00000000000..94a03c8ce21 --- /dev/null +++ b/chromium/chromecast/build/tests/cast_test.gni @@ -0,0 +1,346 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file contains templates which are meant to simplify building and +# running test binaries with the Chromecast build infrastructure. See +# documentation above each template for specific use. +# +# Example Usage +# +# # This is a standard test() template from //testing/test.gni. This generates +# # a binary called foo_unittests. +# test("foo_unittests") { +# sources = [ "foo_unittest.cc" ] +# +# deps = [ +# ":foo", +# "//testing/gtest", +# "//testing/gmock", +# ] +# } +# +# # And another standard test() target, which generates bar_unittests +# test("bar_unittests") { +# sources = [ "bar_unittest.cc" ] +# +# deps = [ ... ] +# } +# +# # This is an organizational target. This cannot be built directly. +# cast_test_group("cast_tests") { +# tests = [ +# ":bar_unittests", +# "//path/to:foo_unittests", +# ] +# } +# +# # Here is another cast_test_group target which builds a bunch of other +# # test binaries, and wants to apply some filters. +# cast_test_group("external_tests") { +# tests = [ +# "//path/to/widget:widget_unittests", +# "//even/more/foo:foo_unittests", +# ] +# +# filters = [ +# "widget_unittests --gtest_filter=-WidgetTest.TestToBeFiltered", +# ] +# } +# +# # Build this to create build and run lists for bar and foo tests. +# cast_test_group_list("cast_test_lists") { +# test_groups = [ +# ":cast_tests", +# ":external_tests", +# ] +# +# build_list_paths = "$root_out_dir/path/to/test/build_list.txt" +# +# run_list_path = "$root_out_dir/path/to/list/run_list.txt" +# } + +import("//testing/test.gni") + +# Do not allow mixing of gtests and junit tests. All gtests must go into one +# directory, while all junit tests must go into another directory. +_gtest_gen_dir = "$root_gen_dir/chromecast/tests" +_junit_gen_dir = "$root_gen_dir/chromecast/junit" + +# A group of test executables. Including test targets in this group makes it +# possible for Chromecast build infrastructure to build and run them with +# filters. To accomplish this, it defines two actions, one which generates a +# build list of all |tests|, and one which generates a run list of all |tests|. +# It also creates a group with dependencies on each test, to ensure that they +# are valid targets. Do not build these targets. Build cast_test_group_list +# instead. +# +# Parameters +# tests (required) +# A list of test targets included in the assembly. Do not include any +# other type of target. Each target's name must match the name of the +# executable it builds. +# +# filters (optional) +# A list of strings of format: "<test_name> --gtest_filter=<filter_logic>" +# The <test_name> used must correspond to a test in |tests|. Please see +# //chromecast/tools/build/generate_test_lists.py for more information. +# If this is not defined, no filters are applied. +# +# priority (optional) +# A string which takes any single-digit integer bewtween "1" and "9", +# inclusive. Assign this to prioritize filters applied by other +# cast_test_groups, where a higher number trumps a lower number. +# If not assigned, priority defaults to "1", the lowest priority. +# +# test_type (optional) +# A string, which must be either "junit" or "gtest". If not defined, +# defaults to "gtest". +# +template("cast_test_group") { + assert(defined(invoker.tests), + "$target_name needs 'tests' listing the test() targets") + + _test_type = "gtest" + if (defined(invoker.test_type)) { + assert(invoker.test_type == "gtest" || invoker.test_type == "junit") + _test_type = invoker.test_type + } + + if (_test_type == "gtest") { + _shared_dir = _gtest_gen_dir + } else if (_test_type == "junit") { + _shared_dir = _junit_gen_dir + } + + # If a set of filters has not been defined, use the empty list. + _filters = [] + if (defined(invoker.filters)) { + _filters = invoker.filters + } + + # If priority has not been set, set the priority to "1", the lowest priority. + _priority = "1" + if (defined(invoker.priority)) { + _priority = invoker.priority + } + + # Assert that |_priority| is an integer between "1" and "9", inclusive. + assert(_priority == "1" || _priority == "2" || _priority == "3" || + _priority == "4" || _priority == "5" || _priority == "6" || + _priority == "7" || _priority == "8" || _priority == "9") + + # This will be the prefix of each output file. + _output_prefix = "$_shared_dir/$_priority-$target_name" + + # Create a list of all the target names. These must correspond to the name of + # the test binary. + _test_names = [] + foreach(_test, invoker.tests) { + _test_names += [ get_label_info(_test, "name") ] + } + + # This action generates a list of target names to build and run. It will be + # depended upon by the "pack_build" action of the cast_test_group_list + # instance which depends on this cast_test_group. + action(target_name + "_create_list") { + script = "//chromecast/tools/build/generate_test_lists.py" + + outputs = [ + "$_output_prefix.tests", + ] + + args = [ + "-o", + rebase_path("$_output_prefix.tests"), + "create_list", + ] + + args += _test_names + + deps = [] + if (defined(invoker.deps)) { + foreach(_dep, invoker.deps) { + deps += [ _dep + "_create_list" ] + } + } + } + + # This action generates a list of test filters, which will have a priority + # [1-9]. This will be depended upon by the "pack_run" action of the + # cast_test_group_list which depends on this group. + action(target_name + "_filters") { + script = "//chromecast/tools/build/generate_test_lists.py" + + outputs = [ + "$_output_prefix.filters", + ] + + args = [ + "-o", + rebase_path("$_output_prefix.filters"), + "create_list", + ] + + args += _filters + + deps = [] + if (defined(invoker.deps)) { + foreach(_dep, invoker.deps) { + deps += [ _dep + "_filters" ] + } + } + } + + # This target allows us to reference each test as a fully-qualified GN path, + # to ensure that each path is correct. If a test does not exist, gives a + # helpful error message at the line it is included. Do not build this target + # directly. + group(target_name + "_build_tests") { + testonly = true + deps = invoker.tests + if (defined(invoker.deps)) { + foreach(_dep, invoker.deps) { + deps += [ _dep + "_build_tests" ] + } + } + } +} + +# This template runs a script which generates lists of test to be built and run. +# +# Parameters +# test_groups (required) +# The cast_test_group() targets for which this binary is to be created. +# The targets referenced here must be cast_test_group targets, or buiding +# this target will fail. +# +# build_list_path (required) +# The absolute filepath of the output file which will hold the list of +# tests to be built. +# +# run_list_path (required) +# The absolute filepath of the output file which will hold the list of +# tests to be run, each with filters assigned by cast_groups. +# +# additional_options (optional) +# Options which are passed to the python script, and applied to every test +# +# build_tests (optional) +# Set this to true to build all of the tests included in |test_groups|. +# Defaults to false. Note that if this is set to true, the test targets +# will be built after all the lists are generated. +# test_type (optional) +# A string, which must be either "junit" or "gtest". If not defined, +# defaults to "gtest". +# +template("cast_test_group_list") { + assert(defined(invoker.test_groups), "$target_name needs 'test_groups'") + assert(defined(invoker.run_list_path), "$target_name needs 'run_list_path'") + assert(defined(invoker.build_list_path), + "$target_name needs 'build_list_path'") + + _pack_build_action = target_name + "_pack_build" + + _test_type = "gtest" + if (defined(invoker.test_type)) { + assert(invoker.test_type == "gtest" || invoker.test_type == "junit") + _test_type = invoker.test_type + } + + if (_test_type == "gtest") { + _shared_dir = _gtest_gen_dir + } else if (_test_type == "junit") { + _shared_dir = _junit_gen_dir + } + + # Generate a list of the "create_list" actions for each group. These will be + # depended upon to ensure they're run before the "pack_build" step. + _build_actions = [] + foreach(_test_group, invoker.test_groups) { + _build_actions += [ _test_group + "_create_list" ] + } + + # Generate a list of the "filter" actions for each group. These will be + # depended upon to ensure they're run before the "pack_run" step. + _filter_actions = [] + foreach(_test_group, invoker.test_groups) { + _filter_actions += [ _test_group + "_filters" ] + } + + # Generate a list of the groups of targets, so that they can be depended upon + # by the "pack_run" step and built when this target is invoked. + if (defined(invoker.build_tests) && invoker.build_tests) { + _build_tests = [] + foreach(_test_group, invoker.test_groups) { + _build_tests += [ _test_group + "_build_tests" ] + } + } + + # The "pack_build" step. This step looks in the common folder for files with + # the ".tests" extenstion, collecting these and packing them into an output + # file. The steps which create these files are depeneded upon, to ensure + # they're run before this step. Do not invoke this target directly. + action(_pack_build_action) { + script = "//chromecast/tools/build/generate_test_lists.py" + + outputs = [ + invoker.build_list_path, + ] + + args = [ + "-o", + rebase_path(invoker.build_list_path), + "-t", + rebase_path(_shared_dir), + "pack_build", + ] + + deps = _build_actions + } + + # The "pack_run" step. This step looks in the common folder for files with + # the ".tests" and ".filters" extensions, creating a script of tests to run, + # with filters and priorities. See + # //chromecast/tools/build/generate_test_lists.py for more information. + # Note that this target takes the name of the invoker, such that invoking the + # target runs this step. + action(target_name) { + testonly = true + + script = "//chromecast/tools/build/generate_test_lists.py" + + outputs = [ + invoker.run_list_path, + ] + + args = [ + "-o", + rebase_path(invoker.run_list_path), + "-t", + rebase_path(_shared_dir), + "pack_run", + ] + + # Add addtional options if they have been set. + if (defined(invoker.additional_options)) { + args += [ "-a" ] + args += invoker.additional_options + } + + # Depend first on the "pack_build" step, so that the build lists are created. + deps = [ + ":$_pack_build_action", + ] + + # Next, depend on the filter steps, such that they are created before this + # script executes. + deps += _filter_actions + + # If |build_tests| has been set to true, depend on the testing targets so + # that the tests are built. + if (defined(_build_tests)) { + deps += _build_tests + } + } +} diff --git a/chromium/chromeos/BUILD.gn b/chromium/chromeos/BUILD.gn new file mode 100644 index 00000000000..9cdf567f071 --- /dev/null +++ b/chromium/chromeos/BUILD.gn @@ -0,0 +1,212 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//testing/test.gni") +import("//third_party/protobuf/proto_library.gni") + +assert(is_chromeos, "Non-ChromeOS builds must not depend on //chromeos") + +declare_args() { + # Use binder. Binder related code is compiled only when true. + use_binder = false +} + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("chromeos.gyp") ], + "scope", + [ "chromeos.gyp" ]) + +component("chromeos") { + configs += [ "//third_party/nss:system_nss_no_ssl_config" ] + public_deps = [ + "//dbus", + ] + deps = [ + ":cryptohome_proto", + ":power_manager_proto", + "//base", + "//base:i18n", + "//base/third_party/dynamic_annotations", + "//components/device_event_log", + "//components/onc", + "//components/policy/proto", + "//components/prefs", + "//components/proxy_config", + "//components/signin/core/account_id", + "//components/user_manager", + "//crypto", + "//crypto:platform", + "//google_apis", + "//net", + "//third_party/icu", + "//third_party/libxml", + "//third_party/protobuf:protobuf_lite", + "//url", + ] + sources = gypi_values.chromeos_sources + defines = [ "CHROMEOS_IMPLEMENTATION" ] + if (current_cpu == "arm" || current_cpu == "x86") { + defines += [ "BINDER_IPC_32BIT" ] + } +} + +# TYhis must be a static library instead of a source set because some of the +# files pull in things with dependencies that aren't linked in all cases. +# +# TODO this should probably be changed such that it links in all cases and +# can be converted to a source set. +static_library("test_support") { + testonly = true + configs += [ "//build/config/linux/dbus" ] + public_deps = [ + ":chromeos", + ":cryptohome_proto", + ":power_manager_proto", + ] + deps = [ + ":test_support_without_gmock", + "//components/signin/core/account_id", + "//dbus:test_support", + "//google_apis", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + ] + sources = [ + "attestation/mock_attestation_flow.cc", + "attestation/mock_attestation_flow.h", + "chromeos_test_utils.cc", + "chromeos_test_utils.h", + "cryptohome/mock_async_method_caller.cc", + "cryptohome/mock_async_method_caller.h", + "cryptohome/mock_homedir_methods.cc", + "cryptohome/mock_homedir_methods.h", + "dbus/mock_cryptohome_client.cc", + "dbus/mock_cryptohome_client.h", + "dbus/mock_lorgnette_manager_client.cc", + "dbus/mock_lorgnette_manager_client.h", + "dbus/mock_permission_broker_client.cc", + "dbus/mock_permission_broker_client.h", + "dbus/mock_session_manager_client.cc", + "dbus/mock_session_manager_client.h", + "dbus/mock_shill_manager_client.cc", + "dbus/mock_shill_manager_client.h", + "dbus/mock_shill_profile_client.cc", + "dbus/mock_shill_profile_client.h", + "dbus/mock_shill_service_client.cc", + "dbus/mock_shill_service_client.h", + "dbus/services/service_provider_test_helper.cc", + "dbus/services/service_provider_test_helper.h", + "disks/mock_disk_mount_manager.cc", + "disks/mock_disk_mount_manager.h", + "login/auth/fake_extended_authenticator.cc", + "login/auth/fake_extended_authenticator.h", + "login/auth/mock_auth_attempt_state_resolver.cc", + "login/auth/mock_auth_attempt_state_resolver.h", + "login/auth/mock_auth_status_consumer.cc", + "login/auth/mock_auth_status_consumer.h", + "login/auth/mock_url_fetchers.cc", + "login/auth/mock_url_fetchers.h", + "network/fake_network_device_handler.cc", + "network/fake_network_device_handler.h", + "network/mock_managed_network_configuration_handler.cc", + "network/mock_managed_network_configuration_handler.h", + "network/mock_network_device_handler.cc", + "network/mock_network_device_handler.h", + "network/onc/onc_test_utils.cc", + "network/onc/onc_test_utils.h", + "system/fake_statistics_provider.cc", + "system/fake_statistics_provider.h", + ] +} + +static_library("test_support_without_gmock") { + testonly = true + configs += [ "//build/config/linux/dbus" ] + deps = [ + ":chromeos", + ":cryptohome_proto", + ":power_manager_proto", + "//crypto", + ] + sources = [ + "dbus/fake_cros_disks_client.cc", + "dbus/fake_cros_disks_client.h", + "dbus/fake_session_manager_client.cc", + "dbus/fake_session_manager_client.h", + "dbus/fake_shill_manager_client.cc", + "dbus/fake_shill_manager_client.h", + "dbus/fake_update_engine_client.cc", + "dbus/fake_update_engine_client.h", + ] +} + +test("chromeos_unittests") { + configs += [ + "//build/config/linux/dbus", + "//third_party/nss:system_nss_no_ssl_config", + ] + deps = [ + ":cryptohome_proto", + ":power_manager_proto", + ":test_support", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//components/onc", + "//components/prefs:test_support", + "//components/proxy_config", + "//components/signin/core/account_id", + "//crypto", + "//crypto:test_support", + "//dbus:test_support", + "//google_apis", + "//net", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/icu", + "//url", + ] + sources = gypi_values.chromeos_test_sources + if (use_binder) { + if (current_cpu == "arm" || current_cpu == "x86") { + defines += [ "BINDER_IPC_32BIT" ] + } + sources += gypi_values.chromeos_binder_test_sources + } + + data = [ + "test/data/", + ] +} + +proto_library("power_manager_proto") { + sources = [ + "//third_party/cros_system_api/dbus/power_manager/input_event.proto", + "//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto", + "//third_party/cros_system_api/dbus/power_manager/policy.proto", + "//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto", + "//third_party/cros_system_api/dbus/power_manager/suspend.proto", + ] + + proto_out_dir = "chromeos/dbus/power_manager" +} + +proto_library("cryptohome_proto") { + sources = [ + "//third_party/cros_system_api/dbus/cryptohome/key.proto", + "//third_party/cros_system_api/dbus/cryptohome/rpc.proto", + ] + + proto_out_dir = "chromeos/dbus/cryptohome" +} + +proto_library("cryptohome_signkey_proto") { + sources = [ + "//third_party/cros_system_api/dbus/cryptohome/signed_secret.proto", + ] + + proto_out_dir = "chromeos/cryptohome" +} diff --git a/chromium/chromeos/ime/BUILD.gn b/chromium/chromeos/ime/BUILD.gn new file mode 100644 index 00000000000..c471ca415fb --- /dev/null +++ b/chromium/chromeos/ime/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +action("gencode") { + script = "gen_input_methods.py" + sources = [ + "//chromeos/ime/input_methods.txt", + ] + outputs = [ + "$target_gen_dir/input_methods.h", + ] + args = [ + rebase_path("//chromeos/ime/input_methods.txt"), + rebase_path("$target_gen_dir/input_methods.h"), + ] +} diff --git a/chromium/components/bookmarks/test/BUILD.gn b/chromium/components/bookmarks/test/BUILD.gn new file mode 100644 index 00000000000..3a2c6a98ee2 --- /dev/null +++ b/chromium/components/bookmarks/test/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") + +source_set("test") { + testonly = true + sources = [ + "bookmark_test_helpers.cc", + "bookmark_test_helpers.h", + "mock_bookmark_model_observer.cc", + "mock_bookmark_model_observer.h", + "test_bookmark_client.cc", + "test_bookmark_client.h", + ] + + deps = [ + "//base", + "//components/bookmarks/browser", + "//testing/gmock", + "//ui/events/platform", + "//url", + ] + + if (use_x11) { + deps += [ "//ui/events/platform/x11" ] + } +} diff --git a/chromium/components/chrome_apps/BUILD.gn b/chromium/components/chrome_apps/BUILD.gn new file mode 100644 index 00000000000..6b7b67ae175 --- /dev/null +++ b/chromium/components/chrome_apps/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +grit("resources") { + source = "chrome_apps_resources.grd" + outputs = [ + "grit/chrome_apps_resources.h", + "grit/chrome_apps_resources_map.cc", + "grit/chrome_apps_resources_map.h", + "chrome_apps_resources.pak", + "chrome_apps_resources.rc", + ] +} + +component("chrome_apps") { + sources = [ + "chrome_apps_export.h", + "chrome_apps_resource_util.cc", + "chrome_apps_resource_util.h", + ] + deps = [ + ":resources", + "//base", + ] + defines = [ "CHROME_APPS_IMPLEMENTATION" ] +} diff --git a/chromium/components/content_settings/core/test/BUILD.gn b/chromium/components/content_settings/core/test/BUILD.gn new file mode 100644 index 00000000000..2c1316df30b --- /dev/null +++ b/chromium/components/content_settings/core/test/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("test_support") { + testonly = true + sources = [ + "content_settings_test_utils.cc", + "content_settings_test_utils.h", + ] + + public_deps = [ + "//components/content_settings/core/browser", + ] + deps = [ + "//base", + "//components/content_settings/core/common", + "//testing/gmock", + "//testing/gtest", + ] +} diff --git a/chromium/components/cronet/android/BUILD.gn b/chromium/components/cronet/android/BUILD.gn new file mode 100644 index 00000000000..ec59f29b533 --- /dev/null +++ b/chromium/components/cronet/android/BUILD.gn @@ -0,0 +1,901 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/buildflag_header.gni") +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") +import("//build/util/version.gni") +import("//chrome/version.gni") +import("//testing/test.gni") +import("//third_party/protobuf/proto_library.gni") +import("//url/features.gni") + +assert(!is_component_build, "Cronet requires static library build.") + +declare_args() { + cronet_enable_data_reduction_proxy_support = false +} + +generate_jni("cronet_jni_headers") { + sources = [ + "java/src/org/chromium/net/ChromiumUrlRequest.java", + "java/src/org/chromium/net/ChromiumUrlRequestContext.java", + "java/src/org/chromium/net/CronetBidirectionalStream.java", + "java/src/org/chromium/net/CronetLibraryLoader.java", + "java/src/org/chromium/net/CronetUploadDataStream.java", + "java/src/org/chromium/net/CronetUrlRequest.java", + "java/src/org/chromium/net/CronetUrlRequestContext.java", + ] + jni_package = "cronet" +} + +java_cpp_enum("chromium_url_request_java") { + sources = [ + "chromium_url_request.h", + ] +} + +java_cpp_enum("net_request_priority_java") { + sources = [ + "//net/base/request_priority.h", + ] +} + +java_cpp_enum("network_quality_observation_source_java") { + sources = [ + "//net/nqe/network_quality_observation_source.h", + ] +} + +java_cpp_enum("url_request_error_java") { + sources = [ + "url_request_error.h", + ] +} + +# This target is a jar file containing classes that Cronet's javadocs +# may reference but are not included in the javadocs themselves. +android_library("cronet_javadoc_classpath") { + srcjar_deps = [ ":url_request_error_java" ] +} + +java_cpp_enum("http_cache_type_java") { + sources = [ + "//components/cronet/url_request_context_config.h", + ] +} + +java_cpp_template("load_states_list") { + sources = [ + "java/src/org/chromium/net/LoadState.template", + ] + inputs = [ + "//net/base/load_states_list.h", + ] + package_name = "org/chromium/net" +} + +_generated_version_java_dir = "$target_gen_dir/templates/cronet_version_java" +_generated_version_java = + "$_generated_version_java_dir/org/chromium/net/Version.java" + +process_version("cronet_version_java") { + template_file = "java/src/org/chromium/net/Version.template" + output = _generated_version_java +} + +zip("cronet_version_srcjar") { + inputs = [ + _generated_version_java, + ] + output = "$target_gen_dir/$target_name.srcjar" + base_dir = _generated_version_java_dir + deps = [ + ":cronet_version_java", + ] +} + +_cronet_version_header_include_dir = "$target_gen_dir/cronet_version_header" +process_version("cronet_version_header") { + template_file = "//components/cronet/version.h.in" + output = "$_cronet_version_header_include_dir/components/cronet/version.h" + extra_args = [ + "-e", + "VERSION_FULL=\"$chrome_version_full\"", + ] +} + +proto_library("cronet_android_cert_proto") { + visibility = [ "//components/cronet/android/*" ] + + sources = [ + "//components/cronet/android/cert/proto/cert_verification.proto", + ] + + deps = [ + "//third_party/protobuf:protobuf_lite", + ] + + extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] +} + +# Variables: +# defines: Extra defines. +# deps: Extra dependencies. +template("cronet_static_tmpl") { + source_set(target_name) { + defines = [] + + deps = [ + ":chromium_url_request_java", + ":cronet_android_cert_proto", + ":cronet_jni_headers", + ":cronet_version_header", + "//base", + "//base/third_party/dynamic_annotations", + "//components/metrics", + "//components/prefs", + "//url:url_features", + ] + sources = [ + "//components/cronet/android/cert/cert_verifier_cache_serializer.cc", + "//components/cronet/android/cert/cert_verifier_cache_serializer.h", + "//components/cronet/android/chromium_url_request.cc", + "//components/cronet/android/chromium_url_request.h", + "//components/cronet/android/chromium_url_request_context.cc", + "//components/cronet/android/chromium_url_request_context.h", + "//components/cronet/android/cronet_bidirectional_stream_adapter.cc", + "//components/cronet/android/cronet_bidirectional_stream_adapter.h", + "//components/cronet/android/cronet_in_memory_pref_store.cc", + "//components/cronet/android/cronet_in_memory_pref_store.h", + "//components/cronet/android/cronet_library_loader.cc", + "//components/cronet/android/cronet_library_loader.h", + "//components/cronet/android/cronet_upload_data_stream.cc", + "//components/cronet/android/cronet_upload_data_stream.h", + "//components/cronet/android/cronet_upload_data_stream_adapter.cc", + "//components/cronet/android/cronet_upload_data_stream_adapter.h", + "//components/cronet/android/cronet_url_request_adapter.cc", + "//components/cronet/android/cronet_url_request_adapter.h", + "//components/cronet/android/cronet_url_request_context_adapter.cc", + "//components/cronet/android/cronet_url_request_context_adapter.h", + "//components/cronet/android/io_buffer_with_byte_buffer.cc", + "//components/cronet/android/io_buffer_with_byte_buffer.h", + "//components/cronet/android/url_request_adapter.cc", + "//components/cronet/android/url_request_adapter.h", + "//components/cronet/android/url_request_context_adapter.cc", + "//components/cronet/android/url_request_context_adapter.h", + "//components/cronet/android/url_request_error.cc", + "//components/cronet/android/url_request_error.h", + "//components/cronet/android/wrapped_channel_upload_element_reader.cc", + "//components/cronet/android/wrapped_channel_upload_element_reader.h", + "//components/cronet/histogram_manager.cc", + "//components/cronet/histogram_manager.h", + "//components/cronet/url_request_context_config.cc", + "//components/cronet/url_request_context_config.h", + ] + + include_dirs = [ _cronet_version_header_include_dir ] + + cflags = [ + "-DLOGGING=1", + "-Wno-sign-promo", + ] + + libs = [ + "android", + "log", + ] + + if (cronet_enable_data_reduction_proxy_support) { + defines += [ "DATA_REDUCTION_PROXY_SUPPORT" ] + sources += [ + "//components/cronet/android/cronet_data_reduction_proxy.cc", + "//components/cronet/android/cronet_data_reduction_proxy.h", + ] + } + + if (defined(invoker.defines)) { + defines += invoker.defines + } + + if (defined(invoker.deps)) { + deps += invoker.deps + } + } +} + +cronet_static_tmpl("cronet_static") { + deps = [ + "//net", + "//url", + ] + + if (cronet_enable_data_reduction_proxy_support) { + deps += [ + "//components/data_reduction_proxy/core/browser:browser_small", + "//components/data_reduction_proxy/core/common", + ] + } + + if (!use_platform_icu_alternatives) { + deps += [ "//base:i18n" ] + } +} + +shared_library("cronet") { + sources = [ + "cronet_jni.cc", + ] + deps = [ + ":cronet_static", + "//base", + "//net:net", + ] + ldflags = [ "-Wl,--version-script=" + + rebase_path("//components/cronet/android/only_jni_exports.lst") ] + + # Avoid hide_native_jni_exports as it adds another version script, and the + # ARM64 linker throws an error for multiple version scripts with anonymous + # version tags. + configs -= [ "//build/config/android:hide_native_jni_exports" ] +} + +# cronet_api.jar defines Cronet API and provides implementation of +# legacy api using HttpUrlConnection (not the Chromium stack). +android_library("cronet_api") { + java_files = [ + "api/src/org/chromium/net/BidirectionalStream.java", + "api/src/org/chromium/net/ChunkedWritableByteChannel.java", + "api/src/org/chromium/net/CronetEngine.java", + "api/src/org/chromium/net/CronetException.java", + "api/src/org/chromium/net/HttpUrlConnectionUrlRequest.java", + "api/src/org/chromium/net/HttpUrlConnectionUrlRequestFactory.java", + "api/src/org/chromium/net/HttpUrlRequest.java", + "api/src/org/chromium/net/HttpUrlRequestFactory.java", + "api/src/org/chromium/net/HttpUrlRequestFactoryConfig.java", + "api/src/org/chromium/net/HttpUrlRequestListener.java", + "api/src/org/chromium/net/InputStreamChannel.java", + "api/src/org/chromium/net/JavaCronetEngine.java", + "api/src/org/chromium/net/JavaUrlRequest.java", + "api/src/org/chromium/net/NetworkQualityRttListener.java", + "api/src/org/chromium/net/NetworkQualityThroughputListener.java", + "api/src/org/chromium/net/Preconditions.java", + "api/src/org/chromium/net/QuicException.java", + "api/src/org/chromium/net/ResponseTooLargeException.java", + "api/src/org/chromium/net/UploadDataProvider.java", + "api/src/org/chromium/net/UploadDataProviders.java", + "api/src/org/chromium/net/UploadDataSink.java", + "api/src/org/chromium/net/UrlRequest.java", + "api/src/org/chromium/net/UrlRequestContextConfig.java", + "api/src/org/chromium/net/UrlRequestException.java", + "api/src/org/chromium/net/UrlResponseInfo.java", + "api/src/org/chromium/net/UserAgent.java", + ] + + deps = [ + "//third_party/android_tools:android_support_annotations_javalib", + ] + + srcjar_deps = [ + ":cronet_version_srcjar", + ":http_cache_type_java", + ":url_request_error_java", + ":load_states_list", + ":network_quality_observation_source_java", + ] + + run_findbugs_override = true +} + +android_library("cronet_java") { + java_files = [ + "java/src/org/chromium/net/ChromiumUrlRequest.java", + "java/src/org/chromium/net/ChromiumUrlRequestContext.java", + "java/src/org/chromium/net/ChromiumUrlRequestFactory.java", + "java/src/org/chromium/net/CronetBidirectionalStream.java", + "java/src/org/chromium/net/CronetLibraryLoader.java", + "java/src/org/chromium/net/CronetUploadDataStream.java", + "java/src/org/chromium/net/CronetUrlRequest.java", + "java/src/org/chromium/net/CronetUrlRequestContext.java", + "java/src/org/chromium/net/urlconnection/CronetBufferedOutputStream.java", + "java/src/org/chromium/net/urlconnection/CronetChunkedOutputStream.java", + "java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java", + "java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java", + "java/src/org/chromium/net/urlconnection/CronetHttpURLStreamHandler.java", + "java/src/org/chromium/net/urlconnection/CronetInputStream.java", + "java/src/org/chromium/net/urlconnection/CronetOutputStream.java", + "java/src/org/chromium/net/urlconnection/CronetURLStreamHandlerFactory.java", + "java/src/org/chromium/net/urlconnection/MessageLoop.java", + ] + + deps = [ + ":cronet_api", + "//base:base_java", + "//net/android:net_java", + "//third_party/android_tools:android_support_annotations_javalib", + "//third_party/jsr-305:jsr_305_javalib", + ] + + srcjar_deps = [ + ":chromium_url_request_java", + ":net_request_priority_java", + ] + + run_findbugs_override = true +} + +android_resources("cronet_sample_apk_resources") { + resource_dirs = [ "sample/res" ] + android_manifest = "sample/AndroidManifest.xml" +} + +android_library("cronet_sample_apk_java") { + java_files = [ + "sample/src/org/chromium/cronet_sample_apk/CronetSampleActivity.java", + "sample/src/org/chromium/cronet_sample_apk/CronetSampleApplication.java", + ] + + deps = [ + ":cronet_api", + ":cronet_java", + ":cronet_sample_apk_resources", + "//base:base_java", + ] + + run_findbugs_override = true +} + +android_apk("cronet_sample_apk") { + apk_name = "CronetSample" + android_manifest = "sample/AndroidManifest.xml" + shared_libraries = [ ":cronet" ] + + deps = [ + ":cronet_sample_apk_java", + ":cronet_sample_apk_resources", + "//base:base_java", + "//third_party/jsr-305:jsr_305_javalib", + ] + + run_findbugs_override = true + if (!is_java_debug) { + proguard_enabled = true + proguard_configs = [ + "proguard.cfg", + "sample/javatests/proguard.cfg", + ] + } +} + +# cronet_sample_test_apk_resources is identical to +# cronet_sample_apk_resources. The two have to be different targets because +# targets which are common between the "instrumentation test apk" and the +# "tested apk" are removed from the "instrumentation test apk". +android_resources("cronet_sample_test_apk_resources") { + resource_dirs = [ "sample/res" ] + android_manifest = "sample/AndroidManifest.xml" +} + +instrumentation_test_apk("cronet_sample_test_apk") { + apk_name = "CronetSampleTest" + apk_under_test = ":cronet_sample_apk" + android_manifest = "sample/javatests/AndroidManifest.xml" + java_files = [ + "sample/javatests/src/org/chromium/cronet_sample_apk/Criteria.java", + "sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java", + ] + + deps = [ + ":cronet_api", + ":cronet_java", + ":cronet_sample_apk_java", + ":cronet_sample_test_apk_resources", + "//base:base_java", + "//base:base_java_test_support", + "//net/android:net_java_test_support", + ] + additional_apks = [ "//net/android:net_test_support_apk" ] + + run_findbugs_override = true + proguard_enabled = !is_java_debug +} + +generate_jni("cronet_tests_jni_headers") { + testonly = true + sources = [ + "test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java", + "test/src/org/chromium/net/CronetTestUtil.java", + "test/src/org/chromium/net/MockCertVerifier.java", + "test/src/org/chromium/net/MockUrlRequestJobFactory.java", + "test/src/org/chromium/net/NativeTestServer.java", + "test/src/org/chromium/net/NetworkChangeNotifierUtil.java", + "test/src/org/chromium/net/QuicTestServer.java", + "test/src/org/chromium/net/SdchObserver.java", + "test/src/org/chromium/net/TestUploadDataStreamHandler.java", + ] + jni_package = "cronet_tests" +} + +shared_library("cronet_tests") { + testonly = true + sources = [ + "test/cronet_test_jni.cc", + "test/cronet_test_util.cc", + "test/cronet_test_util.h", + "test/cronet_url_request_context_config_test.cc", + "test/cronet_url_request_context_config_test.h", + "test/mock_cert_verifier.cc", + "test/mock_cert_verifier.h", + "test/mock_url_request_job_factory.cc", + "test/mock_url_request_job_factory.h", + "test/native_test_server.cc", + "test/native_test_server.h", + "test/network_change_notifier_util.cc", + "test/network_change_notifier_util.h", + "test/quic_test_server.cc", + "test/quic_test_server.h", + "test/sdch_test_util.cc", + "test/sdch_test_util.h", + "test/test_upload_data_stream_handler.cc", + "test/test_upload_data_stream_handler.h", + ] + + deps = [ + ":cronet_static", + ":cronet_tests_jni_headers", + ":cronet_version_header", + "//base", + "//base:i18n", + "//base/test:test_support", + "//net", + "//net:simple_quic_tools", + "//net:test_support", + "//third_party/icu", + ] + + include_dirs = [ _cronet_version_header_include_dir ] + + ldflags = [ "-Wl,--version-script=" + + rebase_path("//components/cronet/android/only_jni_exports.lst") ] + + # Avoid hide_native_jni_exports as it adds another version script, and the + # ARM64 linker throws an error for multiple version scripts with anonymous + # version tags. + configs -= [ "//build/config/android:hide_native_jni_exports" ] + + if (cronet_enable_data_reduction_proxy_support) { + deps += [ "//components/data_reduction_proxy/core/browser:browser_small" ] + } +} + +android_resources("cronet_test_apk_resources") { + testonly = true + resource_dirs = [ "test/res" ] + android_manifest = "test/AndroidManifest.xml" +} + +android_library("cronet_test_apk_java") { + testonly = true + + java_files = [ + "test/src/org/chromium/net/CronetTestApplication.java", + "test/src/org/chromium/net/CronetTestFramework.java", + "test/src/org/chromium/net/CronetTestUtil.java", + "test/src/org/chromium/net/Http2TestHandler.java", + "test/src/org/chromium/net/Http2TestServer.java", + "test/src/org/chromium/net/MockCertVerifier.java", + "test/src/org/chromium/net/MockUrlRequestJobFactory.java", + "test/src/org/chromium/net/NativeTestServer.java", + "test/src/org/chromium/net/NetworkChangeNotifierUtil.java", + "test/src/org/chromium/net/QuicTestServer.java", + "test/src/org/chromium/net/SdchObserver.java", + "test/src/org/chromium/net/TestFilesInstaller.java", + "test/src/org/chromium/net/TestUploadDataStreamHandler.java", + ] + + deps = [ + ":cronet_api", + ":cronet_java", + "//base:base_java", + "//base:base_java_test_support", + "//net/android:net_java_test_support", + "//third_party/netty-tcnative:netty-tcnative", + "//third_party/netty4:netty_all", + ] + + run_findbugs_override = true +} + +android_assets("cronet_test_apk_assets") { + testonly = true + + # Need to use renaming_sources to maintain subdirectories. + renaming_sources = [ + "test/assets/test/cacheable.txt", + "test/assets/test/cacheable.txt.mock-http-headers", + "test/assets/test/content_length_mismatch.html", + "test/assets/test/content_length_mismatch.html.mock-http-headers", + "test/assets/test/datareductionproxysuccess.txt", + "test/assets/test/datareductionproxysuccess.txt.mock-http-headers", + "test/assets/test/gzipped.html", + "test/assets/test/gzipped.html.mock-http-headers", + "test/assets/test/multiredirect.html", + "test/assets/test/multiredirect.html.mock-http-headers", + "test/assets/test/notfound.html", + "test/assets/test/notfound.html.mock-http-headers", + "test/assets/test/quic_data/simple.txt", + "test/assets/test/redirect.html", + "test/assets/test/redirect.html.mock-http-headers", + "test/assets/test/redirect_invalid_scheme.html", + "test/assets/test/redirect_invalid_scheme.html.mock-http-headers", + "test/assets/test/set_cookie.html", + "test/assets/test/set_cookie.html.mock-http-headers", + "test/assets/test/sdch/dict/LeQxM80O", + "test/assets/test/sdch/dict/LeQxM80O.mock-http-headers", + "test/assets/test/sdch/index", + "test/assets/test/sdch/index.mock-http-headers", + "test/assets/test/sdch/LeQxM80O_encoded", + "test/assets/test/sdch/LeQxM80O_encoded.mock-http-headers", + "test/assets/test/secureproxychecksuccess.txt", + "test/assets/test/secureproxychecksuccess.txt.mock-http-headers", + "test/assets/test/success.txt", + "test/assets/test/success.txt.mock-http-headers", + ] + + # Maintain directory structure. Example entry: "test/sdch/index". + renaming_destinations = rebase_path(renaming_sources, "test/assets") +} + +android_apk("cronet_test_apk") { + testonly = true + apk_name = "CronetTest" + android_manifest = "test/AndroidManifest.xml" + shared_libraries = [ ":cronet_tests" ] + loadable_modules = [ "$root_out_dir/libnetty-tcnative.so" ] + + deps = [ + ":cronet_test_apk_assets", + ":cronet_test_apk_java", + ":cronet_test_apk_resources", + "//base:base_java", + "//third_party/netty-tcnative:netty-tcnative_all", + ] + + run_findbugs_override = true +} + +android_library("cronet_javatests") { + testonly = true + + java_files = [ + "test/javatests/src/org/chromium/net/BidirectionalStreamQuicTest.java", + "test/javatests/src/org/chromium/net/BidirectionalStreamTest.java", + "test/javatests/src/org/chromium/net/ChromiumUrlRequestTest.java", + "test/javatests/src/org/chromium/net/ChunkedWritableByteChannelTest.java", + "test/javatests/src/org/chromium/net/ContextInitTest.java", + "test/javatests/src/org/chromium/net/Criteria.java", + "test/javatests/src/org/chromium/net/CronetTestBase.java", + "test/javatests/src/org/chromium/net/CronetUploadTest.java", + "test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java", + "test/javatests/src/org/chromium/net/CronetUrlRequestTest.java", + "test/javatests/src/org/chromium/net/CronetUrlTest.java", + "test/javatests/src/org/chromium/net/DiskStorageTest.java", + "test/javatests/src/org/chromium/net/GetStatusTest.java", + "test/javatests/src/org/chromium/net/HttpUrlRequestFactoryTest.java", + "test/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java", + "test/javatests/src/org/chromium/net/PkpTest.java", + "test/javatests/src/org/chromium/net/QuicTest.java", + "test/javatests/src/org/chromium/net/SdchTest.java", + "test/javatests/src/org/chromium/net/TestBidirectionalStreamCallback.java", + "test/javatests/src/org/chromium/net/TestDrivenDataProvider.java", + "test/javatests/src/org/chromium/net/TestHttpUrlRequestListener.java", + "test/javatests/src/org/chromium/net/TestNetworkQualityRttListener.java", + "test/javatests/src/org/chromium/net/TestNetworkQualityThroughputListener.java", + "test/javatests/src/org/chromium/net/TestUploadDataProvider.java", + "test/javatests/src/org/chromium/net/TestUrlRequestCallback.java", + "test/javatests/src/org/chromium/net/UploadDataProvidersTest.java", + "test/javatests/src/org/chromium/net/UploadTest.java", + "test/javatests/src/org/chromium/net/urlconnection/CronetBufferedOutputStreamTest.java", + "test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java", + "test/javatests/src/org/chromium/net/urlconnection/CronetFixedModeOutputStreamTest.java", + "test/javatests/src/org/chromium/net/urlconnection/CronetHttpURLConnectionTest.java", + "test/javatests/src/org/chromium/net/urlconnection/CronetHttpURLStreamHandlerTest.java", + "test/javatests/src/org/chromium/net/urlconnection/CronetURLStreamHandlerFactoryTest.java", + "test/javatests/src/org/chromium/net/urlconnection/MessageLoopTest.java", + "test/javatests/src/org/chromium/net/urlconnection/QuicUploadTest.java", + "test/javatests/src/org/chromium/net/urlconnection/TestUtil.java", + "test/javatests/src/org/chromium/net/UrlResponseInfoTest.java", + ] + + deps = [ + ":cronet_api", + ":cronet_java", + ":cronet_test_apk_java", + "//base:base_java", + "//base:base_java_test_support", + "//net/android:net_java", + "//net/android:net_java_test_support", + ] + + run_findbugs_override = true +} + +instrumentation_test_apk("cronet_test_instrumentation_apk") { + apk_name = "CronetTestInstrumentation" + apk_under_test = ":cronet_test_apk" + android_manifest = "test/javatests/AndroidManifest.xml" + + deps = [ + ":cronet_api", + ":cronet_java", + ":cronet_javatests", + ":cronet_test_apk_java", + "//base:base_java", + "//base:base_java_test_support", + "//net/android:net_java", + "//net/android:net_java_test_support", + ] + additional_apks = [ "//net/android:net_test_support_apk" ] + + data = [ + "//net/data/ssl/certificates/quic_test.example.com.crt", + "//net/data/ssl/certificates/quic_test.example.com.key", + "//net/data/ssl/certificates/quic_test.example.com.key.pkcs8", + "//net/data/ssl/certificates/quic_test.example.com.key.sct", + ] + + # TODO(jbudorick): Remove this once GN uses the generated .isolate files. + isolate_file = "cronet_test_instrumentation_apk.isolate" + + run_findbugs_override = true +} + +android_library("cronet_perf_test_apk_java") { + testonly = true + java_files = + [ "test/javaperftests/src/org/chromium/net/CronetPerfTestActivity.java" ] + + deps = [ + ":cronet_api", + ":cronet_java", + ":cronet_javatests", + ":cronet_test_apk_java", + "//base:base_java", + ] + + run_findbugs_override = true +} + +android_apk("cronet_perf_test_apk") { + testonly = true + apk_name = "CronetPerfTest" + android_manifest = "test/javaperftests/AndroidManifest.xml" + shared_libraries = [ ":cronet_tests" ] + + deps = [ + ":cronet_perf_test_apk_java", + ":cronet_test_apk_java", + "//base:base_java", + ] + + run_findbugs_override = true + proguard_enabled = true + proguard_configs = [ + "proguard.cfg", + "test/javaperftests/proguard.cfg", + ] +} + +test("cronet_unittests") { + sources = [ + "//components/cronet/android/cert/cert_verifier_cache_serializer_unittest.cc", + "//components/cronet/histogram_manager_unittest.cc", + "//components/cronet/run_all_unittests.cc", + "//components/cronet/url_request_context_config_unittest.cc", + ] + + deps = [ + ":cronet_android_cert_proto", + ":cronet_static", + "//base", + "//base/test:test_support", + "//components/metrics", + "//net", + "//net:test_support", + "//testing/gtest", + ] + + if (is_android) { + shard_timeout = 180 + } +} + +_package_dir = "$root_out_dir/cronet" +_extract_cronet_jars_dir = "$target_gen_dir/cronet_jar_extract" + +action("extract_cronet_jars") { + # extract_from_jars.py deletes the target directory before extracting. + script = "//components/cronet/tools/extract_from_jars.py" + depfile = "$target_gen_dir/$target_name.d" + + sources = [ + "$root_out_dir/lib.java/base/base_java.jar", + "$root_out_dir/lib.java/components/cronet/android/cronet_java.jar", + "$root_out_dir/lib.java/net/android/net_java.jar", + "$root_out_dir/lib.java/url/url_java.jar", + ] + outputs = [ + depfile, + ] + + _rebased_sources = rebase_path(sources, root_build_dir) + + args = [ + "--classes-dir", + rebase_path(_extract_cronet_jars_dir, root_build_dir), + "--jars=${_rebased_sources}", + "--depfile", + rebase_path(depfile, root_build_dir), + ] + + deps = [ + ":cronet_java", + "//base:base_java", + "//net/android:net_java", + "//url:url_java", + ] +} + +action("repackage_extracted_jars") { + _output_jar = "$_package_dir/cronet.jar" + + script = "//build/android/gyp/jar.py" + outputs = [ + _output_jar, + ] + + args = [ + "--classes-dir", + rebase_path(_extract_cronet_jars_dir, root_build_dir), + "--jar-path", + rebase_path(_output_jar, root_build_dir), + ] + + deps = [ + ":extract_cronet_jars", + ] +} + +template("jar_src") { + action(target_name) { + _rebased_src_dirs = rebase_path(invoker.src_dirs, root_build_dir) + + script = "//components/cronet/tools/jar_src.py" + depfile = "$target_gen_dir/$target_name.d" + outputs = [ + depfile, + invoker.jar_path, + ] + args = [ + "--src-dir=${_rebased_src_dirs}", + "--jar-path", + rebase_path(invoker.jar_path, root_build_dir), + "--depfile", + rebase_path(depfile, root_build_dir), + ] + } +} + +jar_src("jar_cronet_api_source") { + src_dirs = [ "api/src" ] + jar_path = "$_package_dir/cronet_api-src.jar" +} + +jar_src("jar_cronet_sample_source") { + src_dirs = [ "sample" ] + jar_path = "$_package_dir/cronet-sample-src.jar" +} + +jar_src("jar_cronet_other_source") { + src_dirs = [ + "//base/android/java/src", + "//components/cronet/android/java/src", + "//net/android/java/src", + "//url/android/java/src", + ] + jar_path = "$_package_dir/cronet-src.jar" +} + +action("generate_licenses") { + _license_path = "$_package_dir/LICENSE" + + script = "//components/cronet/tools/cronet_licenses.py" + outputs = [ + _license_path, + ] + args = [ + "license", + rebase_path(_license_path, root_build_dir), + ] +} + +action("generate_javadoc") { + script = "//components/cronet/tools/generate_javadoc.py" + depfile = "$target_gen_dir/$target_name.d" + outputs = [ + depfile, + ] + args = [ + "--output-dir", + rebase_path(_package_dir, root_build_dir), + "--input-dir", + rebase_path("//components/cronet", root_build_dir), + "--overview-file", + rebase_path("$_package_dir/README.md.html", root_build_dir), + "--readme-file", + rebase_path("//components/cronet/README.md", root_build_dir), + "--depfile", + rebase_path(depfile, root_build_dir), + "--lib-java-dir", + rebase_path("$root_build_dir/lib.java/components/cronet/android", + root_build_dir), + ] + deps = [ + ":cronet_javadoc_classpath", + ] +} + +copy("cronet_package_copy") { + sources = [ + "$root_out_dir/lib.java/components/cronet/android/cronet_api.jar", + "//AUTHORS", + "//chrome/VERSION", + "//components/cronet/android/proguard.cfg", + ] + outputs = [ + "$_package_dir/{{source_file_part}}", + ] + + deps = [ + ":cronet_api", + ] +} + +copy("cronet_package_copy_native_lib") { + sources = [ + "$root_out_dir/libcronet.so", + ] + outputs = [ + "$_package_dir/libs/${android_app_abi}/libcronet.so", + ] + deps = [ + ":cronet", + ] +} + +copy("cronet_package_copy_native_lib_unstripped") { + sources = [ + "$root_out_dir/lib.unstripped/libcronet.so", + ] + outputs = [ + "$_package_dir/symbols/${android_app_abi}/libcronet.so", + ] + deps = [ + ":cronet", + ] +} + +group("cronet_package") { + deps = [ + ":cronet_package_copy", + ":cronet_package_copy_native_lib", + ":cronet_package_copy_native_lib_unstripped", + ":generate_javadoc", + ":generate_licenses", + ":jar_cronet_api_source", + ":jar_cronet_other_source", + ":jar_cronet_sample_source", + ":repackage_extracted_jars", + ] +} diff --git a/chromium/components/cronet/ios/BUILD.gn b/chromium/components/cronet/ios/BUILD.gn new file mode 100644 index 00000000000..19ff7514cf2 --- /dev/null +++ b/chromium/components/cronet/ios/BUILD.gn @@ -0,0 +1,170 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/buildflag_header.gni") +import("//build/config/ios/rules.gni") +import("//build/util/version.gni") +import("//chrome/version.gni") +import("//testing/test.gni") +import("//url/features.gni") + +assert(!is_component_build, "Cronet requires static library build.") + +declare_args() { + cronet_enable_data_reduction_proxy_support = false +} + +process_version("cronet_version_header") { + template_file = "//components/cronet/version.h.in" + output = "$target_gen_dir/version.h" + extra_args = [ + "-e", + "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)", + ] +} + +source_set("cronet_sources") { + deps = [ + ":cronet_version_header", + "//base:base", + "//components/metrics:metrics", + "//components/metrics/proto:proto", + "//components/prefs:prefs", + "//net", + "//url", + ] + + sources = [ + "../histogram_manager.cc", + "../histogram_manager.h", + "../url_request_context_config.cc", + "../url_request_context_config.h", + "cronet_bidirectional_stream.cc", + "cronet_bidirectional_stream.h", + "cronet_c_for_grpc.cc", + "cronet_c_for_grpc.h", + "cronet_environment.cc", + "cronet_environment.h", + ] + + if (!use_platform_icu_alternatives) { + deps += [ "//base:i18n" ] + } +} + +ios_framework_bundle("cronet_framework") { + output_name = "Cronet" + + deps = [ + ":cronet_sources", + "//base", + "//net:net", + ] + + info_plist = "Info.plist" + + libs = [ "UIKit.Framework" ] + + public_headers = [ + "Cronet.h", + "cronet_c_for_grpc.h", + ] + + sources = [ + "Cronet.h", + "Cronet.mm", + ] +} + +bundle_data("cronet_test_bundle_data") { + testonly = true + sources = [ + "//net/data/ssl/certificates/quic_test.example.com.crt", + "//net/data/ssl/certificates/quic_test.example.com.key", + "//net/data/ssl/certificates/quic_test.example.com.key.pkcs8", + "//net/data/ssl/certificates/quic_test.example.com.key.sct", + ] + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] +} + +test("cronet_test") { + testonly = true + sources = [ + "test/cronet_bidirectional_stream_test.mm", + "test/cronet_test_runner.mm", + "test/quic_test_server.cc", + "test/quic_test_server.h", + ] + + deps = [ + ":cronet_sources", + ":cronet_test_bundle_data", + ":cronet_version_header", + "//base", + "//base:i18n", + "//net", + "//net:simple_quic_tools", + "//net:test_support", + "//third_party/icu", + ] +} + +test("cronet_unittests") { + sources = [ + "//components/cronet/histogram_manager_unittest.cc", + "//components/cronet/run_all_unittests.cc", + "//components/cronet/url_request_context_config_unittest.cc", + ] + + deps = [ + ":cronet_sources", + "//base", + "//base/test:test_support", + "//components/metrics", + "//net", + "//testing/gtest", + ] +} + +_package_dir = "$root_out_dir/cronet" + +action("generate_license") { + _license_path = "$_package_dir/LICENSE" + + script = "//components/cronet/tools/cronet_licenses.py" + outputs = [ + _license_path, + ] + args = [ + "license", + rebase_path(_license_path, root_build_dir), + "--gn", + ] +} + +copy("cronet_package_copy") { + sources = [ + "$root_out_dir/Cronet.framework", + "//AUTHORS", + "//chrome/VERSION", + "//components/cronet/ios/Cronet.h", + "//components/cronet/ios/cronet_c_for_grpc.h", + ] + outputs = [ + "$_package_dir/{{source_file_part}}", + ] + + deps = [ + ":cronet_framework", + ] +} + +group("cronet_package") { + deps = [ + ":cronet_package_copy", + ":generate_license", + ] +} diff --git a/chromium/components/drive/BUILD.gn b/chromium/components/drive/BUILD.gn new file mode 100644 index 00000000000..c5c9516234d --- /dev/null +++ b/chromium/components/drive/BUILD.gn @@ -0,0 +1,189 @@ +# Copyright (c) 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +source_set("drive") { + sources = [ + "drive_api_util.cc", + "drive_api_util.h", + "drive_app_registry.cc", + "drive_app_registry.h", + "drive_app_registry_observer.h", + "drive_notification_manager.cc", + "drive_notification_manager.h", + "drive_notification_observer.h", + "drive_pref_names.cc", + "drive_pref_names.h", + "drive_uploader.cc", + "drive_uploader.h", + "event_logger.cc", + "event_logger.h", + "file_change.cc", + "file_change.h", + "file_errors.cc", + "file_errors.h", + "file_system_core_util.cc", + "file_system_core_util.h", + "file_system_metadata.cc", + "file_system_metadata.h", + "file_write_watcher.cc", + "file_write_watcher.h", + "job_list.cc", + "job_list.h", + "job_queue.cc", + "job_queue.h", + "job_scheduler.cc", + "job_scheduler.h", + "local_file_reader.cc", + "local_file_reader.h", + "resource_entry_conversion.cc", + "resource_entry_conversion.h", + "resource_metadata_storage.cc", + "resource_metadata_storage.h", + "service/drive_api_service.cc", + "service/drive_api_service.h", + "service/drive_service_interface.cc", + "service/drive_service_interface.h", + ] + deps = [ + "//base", + "//base:i18n", + "//components/invalidation/public", + "//components/keyed_service/core", + "//components/prefs", + + # TODO(lukasza): Remove this dependency (see DEPS file for more info). + "//content/public/browser", + "//device/power_save_blocker", + "//google_apis:google_apis", + "//net:net", + "//third_party/cacheinvalidation", + "//third_party/leveldatabase", + "//third_party/re2", + ] + public_deps = [ + ":proto", + ] +} + +source_set("drive_chromeos") { + sources = [ + "chromeos/change_list_loader.cc", + "chromeos/change_list_loader.h", + "chromeos/change_list_loader_observer.h", + "chromeos/change_list_processor.cc", + "chromeos/change_list_processor.h", + "chromeos/directory_loader.cc", + "chromeos/directory_loader.h", + "chromeos/file_cache.cc", + "chromeos/file_cache.h", + "chromeos/file_system.cc", + "chromeos/file_system.h", + "chromeos/file_system/copy_operation.cc", + "chromeos/file_system/copy_operation.h", + "chromeos/file_system/create_directory_operation.cc", + "chromeos/file_system/create_directory_operation.h", + "chromeos/file_system/create_file_operation.cc", + "chromeos/file_system/create_file_operation.h", + "chromeos/file_system/download_operation.cc", + "chromeos/file_system/download_operation.h", + "chromeos/file_system/get_file_for_saving_operation.cc", + "chromeos/file_system/get_file_for_saving_operation.h", + "chromeos/file_system/move_operation.cc", + "chromeos/file_system/move_operation.h", + "chromeos/file_system/open_file_operation.cc", + "chromeos/file_system/open_file_operation.h", + "chromeos/file_system/operation_delegate.cc", + "chromeos/file_system/operation_delegate.h", + "chromeos/file_system/remove_operation.cc", + "chromeos/file_system/remove_operation.h", + "chromeos/file_system/search_operation.cc", + "chromeos/file_system/search_operation.h", + "chromeos/file_system/set_property_operation.cc", + "chromeos/file_system/set_property_operation.h", + "chromeos/file_system/touch_operation.cc", + "chromeos/file_system/touch_operation.h", + "chromeos/file_system/truncate_operation.cc", + "chromeos/file_system/truncate_operation.h", + "chromeos/file_system_interface.cc", + "chromeos/file_system_interface.h", + "chromeos/file_system_observer.h", + "chromeos/remove_stale_cache_files.cc", + "chromeos/remove_stale_cache_files.h", + "chromeos/resource_metadata.cc", + "chromeos/resource_metadata.h", + "chromeos/search_metadata.cc", + "chromeos/search_metadata.h", + "chromeos/sync/entry_revert_performer.cc", + "chromeos/sync/entry_revert_performer.h", + "chromeos/sync/entry_update_performer.cc", + "chromeos/sync/entry_update_performer.h", + "chromeos/sync/remove_performer.cc", + "chromeos/sync/remove_performer.h", + "chromeos/sync_client.cc", + "chromeos/sync_client.h", + ] + deps = [ + ":drive", + "//base", + "//base:i18n", + "//components/prefs", + "//google_apis:google_apis", + "//net:net", + ] + public_deps = [ + ":proto", + ] +} + +proto_library("proto") { + sources = [ + "drive.proto", + ] +} + +source_set("test_support") { + testonly = true + sources = [ + "service/dummy_drive_service.cc", + "service/dummy_drive_service.h", + "service/fake_drive_service.cc", + "service/fake_drive_service.h", + "service/test_util.cc", + "service/test_util.h", + ] + deps = [ + ":drive", + ":proto", + "//base", + "//components/prefs:test_support", + "//content/test:test_support", + "//google_apis:test_support", + "//net:net", + ] +} + +source_set("test_support_chromeos") { + testonly = true + sources = [ + "chromeos/drive_test_util.cc", + "chromeos/drive_test_util.h", + "chromeos/dummy_file_system.cc", + "chromeos/dummy_file_system.h", + "chromeos/fake_file_system.cc", + "chromeos/fake_file_system.h", + "chromeos/fake_free_disk_space_getter.cc", + "chromeos/fake_free_disk_space_getter.h", + ] + deps = [ + ":drive", + ":drive_chromeos", + ":proto", + "//base", + "//components/prefs:test_support", + "//content/test:test_support", + "//google_apis:test_support", + ] +} diff --git a/chromium/components/gcm_driver/BUILD.gn b/chromium/components/gcm_driver/BUILD.gn new file mode 100644 index 00000000000..918029d3042 --- /dev/null +++ b/chromium/components/gcm_driver/BUILD.gn @@ -0,0 +1,182 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# GYP version: components/gcm_driver.gypi:gcm_driver +static_library("gcm_driver") { + sources = [ + "android/component_jni_registrar.cc", + "android/component_jni_registrar.h", + "default_gcm_app_handler.cc", + "default_gcm_app_handler.h", + "gcm_account_mapper.cc", + "gcm_account_mapper.h", + "gcm_account_tracker.cc", + "gcm_account_tracker.h", + "gcm_activity.cc", + "gcm_activity.h", + "gcm_app_handler.cc", + "gcm_app_handler.h", + "gcm_backoff_policy.cc", + "gcm_backoff_policy.h", + "gcm_channel_status_request.cc", + "gcm_channel_status_request.h", + "gcm_channel_status_syncer.cc", + "gcm_channel_status_syncer.h", + "gcm_client.cc", + "gcm_client.h", + "gcm_client_factory.cc", + "gcm_client_factory.h", + "gcm_client_impl.cc", + "gcm_client_impl.h", + "gcm_connection_observer.cc", + "gcm_connection_observer.h", + "gcm_delayed_task_controller.cc", + "gcm_delayed_task_controller.h", + "gcm_desktop_utils.cc", + "gcm_desktop_utils.h", + "gcm_driver.cc", + "gcm_driver.h", + "gcm_driver_android.cc", + "gcm_driver_android.h", + "gcm_driver_constants.cc", + "gcm_driver_constants.h", + "gcm_driver_desktop.cc", + "gcm_driver_desktop.h", + "gcm_internals_constants.cc", + "gcm_internals_constants.h", + "gcm_internals_helper.cc", + "gcm_internals_helper.h", + "gcm_profile_service.cc", + "gcm_profile_service.h", + "gcm_stats_recorder_android.cc", + "gcm_stats_recorder_android.h", + "gcm_stats_recorder_impl.cc", + "gcm_stats_recorder_impl.h", + "registration_info.cc", + "registration_info.h", + "system_encryptor.cc", + "system_encryptor.h", + ] + + deps = [ + "//base", + "//components/gcm_driver/common", + "//components/gcm_driver/crypto", + "//components/keyed_service/core", + "//components/os_crypt", + "//components/pref_registry", + "//components/prefs", + "//components/signin/core/browser", + "//components/sync_driver", + "//components/version_info", + "//google_apis", + "//google_apis/gcm", + "//net", + "//sync/protocol", + "//url:url", + ] + allow_circular_includes_from = [ "//components/gcm_driver/crypto" ] + + if (is_chromeos) { + deps += [ "//components/timers" ] + } + + if (is_android) { + sources -= [ + "gcm_account_mapper.cc", + "gcm_account_mapper.h", + "gcm_channel_status_request.cc", + "gcm_channel_status_request.h", + "gcm_channel_status_syncer.cc", + "gcm_channel_status_syncer.h", + "gcm_client_factory.cc", + "gcm_client_factory.h", + "gcm_client_impl.cc", + "gcm_client_impl.h", + "gcm_desktop_utils.cc", + "gcm_desktop_utils.h", + "gcm_driver_desktop.cc", + "gcm_driver_desktop.h", + "gcm_stats_recorder_impl.cc", + "gcm_stats_recorder_impl.h", + ] + deps -= [ "//google_apis/gcm" ] + deps += [ "android:jni_headers" ] + } +} + +# GYP version: components/gcm_driver.gypi:gcm_driver_test_support +source_set("test_support") { + testonly = true + sources = [ + "fake_gcm_app_handler.cc", + "fake_gcm_app_handler.h", + "fake_gcm_client.cc", + "fake_gcm_client.h", + "fake_gcm_client_factory.cc", + "fake_gcm_client_factory.h", + "fake_gcm_driver.cc", + "fake_gcm_driver.h", + ] + + public_deps = [ + ":gcm_driver", + ] + deps = [ + "//base", + "//google_apis/gcm:test_support", + "//net", + "//testing/gtest", + ] + + if (is_android) { + sources -= [ + "fake_gcm_client.cc", + "fake_gcm_client.h", + "fake_gcm_client_factory.cc", + "fake_gcm_client_factory.h", + ] + deps -= [ "//google_apis/gcm:test_support" ] + } +} + +source_set("unit_tests") { + testonly = true + + sources = [ + "gcm_account_mapper_unittest.cc", + "gcm_account_tracker_unittest.cc", + "gcm_channel_status_request_unittest.cc", + "gcm_client_impl_unittest.cc", + "gcm_delayed_task_controller_unittest.cc", + "gcm_driver_desktop_unittest.cc", + "gcm_stats_recorder_android_unittest.cc", + "gcm_stats_recorder_impl_unittest.cc", + ] + + deps = [ + ":gcm_driver", + ":test_support", + "//base", + "//base/test:test_support", + "//components/gcm_driver/crypto", + "//components/prefs:test_support", + "//google_apis:test_support", + "//google_apis/gcm:test_support", + "//net:test_support", + "//sync/protocol", + "//testing/gtest", + "//third_party/protobuf:protobuf_lite", + ] + + if (is_android) { + sources -= [ + "gcm_account_mapper_unittest.cc", + "gcm_channel_status_request_unittest.cc", + "gcm_client_impl_unittest.cc", + "gcm_driver_desktop_unittest.cc", + "gcm_stats_recorder_impl_unittest.cc", + ] + } +} diff --git a/chromium/components/gcm_driver/android/BUILD.gn b/chromium/components/gcm_driver/android/BUILD.gn new file mode 100644 index 00000000000..3f674c61718 --- /dev/null +++ b/chromium/components/gcm_driver/android/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +# GYP version: components/gcm_driver.gypi:gcm_driver_jni_headers +generate_jni("jni_headers") { + sources = [ + "java/src/org/chromium/components/gcm_driver/GCMDriver.java", + ] + jni_package = "components/gcm_driver" +} + +# GYP version: components/gcm_driver.gypi:gcm_driver_java +android_library("gcm_driver_java") { + deps = [ + "//base:base_java", + "//content/public/android:content_java", + "//third_party/android_tools:android_gcm_java", + "//third_party/jsr-305:jsr_305_javalib", + ] + + java_files = [ + "java/src/org/chromium/components/gcm_driver/FakeGoogleCloudMessagingSubscriber.java", + "java/src/org/chromium/components/gcm_driver/GCMDriver.java", + "java/src/org/chromium/components/gcm_driver/GoogleCloudMessagingSubscriber.java", + "java/src/org/chromium/components/gcm_driver/GoogleCloudMessagingV2.java", + ] +} diff --git a/chromium/components/gcm_driver/common/BUILD.gn b/chromium/components/gcm_driver/common/BUILD.gn new file mode 100644 index 00000000000..b9dc6e6f253 --- /dev/null +++ b/chromium/components/gcm_driver/common/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# GYP version: components/gcm_driver.gypi:gcm_driver_common +component("common") { + sources = [ + "gcm_driver_export.h", + "gcm_messages.cc", + "gcm_messages.h", + ] + + defines = [ "GCM_DRIVER_IMPLEMENTATION" ] +} diff --git a/chromium/components/gcm_driver/crypto/BUILD.gn b/chromium/components/gcm_driver/crypto/BUILD.gn new file mode 100644 index 00000000000..3752eb9b100 --- /dev/null +++ b/chromium/components/gcm_driver/crypto/BUILD.gn @@ -0,0 +1,71 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/crypto.gni") + +# GYP version: components/gcm_driver.gypi:gcm_driver_crypto +source_set("crypto") { + sources = [ + "encryption_header_parsers.cc", + "encryption_header_parsers.h", + "gcm_encryption_provider.cc", + "gcm_encryption_provider.h", + "gcm_key_store.cc", + "gcm_key_store.h", + "gcm_message_cryptographer.cc", + "gcm_message_cryptographer.h", + "p256_key_util.cc", + "p256_key_util.h", + ] + + deps = [ + "//base", + "//components/gcm_driver/common", + "//components/gcm_driver/crypto/proto", + "//components/leveldb_proto", + "//crypto", + "//crypto:platform", + "//net", + "//third_party/protobuf:protobuf_lite", + ] +} + +# GYP version: components/gcm_driver.gypi:gcm_driver_crypto_test_support +source_set("test_support") { + testonly = true + sources = [ + "gcm_crypto_test_helpers.cc", + "gcm_crypto_test_helpers.h", + ] + + deps = [ + ":crypto", + "//base", + "//components/gcm_driver/common", + "//crypto", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "encryption_header_parsers_unittest.cc", + "gcm_encryption_provider_unittest.cc", + "gcm_key_store_unittest.cc", + "gcm_message_cryptographer_unittest.cc", + "p256_key_util_unittest.cc", + ] + + deps = [ + ":crypto", + "//base", + "//base/test:test_support", + "//components/gcm_driver/common", + "//crypto", + "//crypto:platform", + "//net:test_support", + "//testing/gtest", + "//third_party/protobuf:protobuf_lite", + ] +} diff --git a/chromium/components/gcm_driver/crypto/proto/BUILD.gn b/chromium/components/gcm_driver/crypto/proto/BUILD.gn new file mode 100644 index 00000000000..852cebf8bc0 --- /dev/null +++ b/chromium/components/gcm_driver/crypto/proto/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: components/gcm_driver.gypi:gcm_driver_crypto_proto +proto_library("proto") { + visibility = [ "//components/gcm_driver/crypto" ] + + sources = [ + "gcm_encryption_data.proto", + ] +} diff --git a/chromium/components/gcm_driver/instance_id/BUILD.gn b/chromium/components/gcm_driver/instance_id/BUILD.gn new file mode 100644 index 00000000000..7e893ffe6b4 --- /dev/null +++ b/chromium/components/gcm_driver/instance_id/BUILD.gn @@ -0,0 +1,75 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# GYP version: components/gcm_driver.gypi:instance_id_driver +source_set("instance_id") { + sources = [ + "android/component_jni_registrar.cc", + "android/component_jni_registrar.h", + "instance_id.cc", + "instance_id.h", + "instance_id_driver.cc", + "instance_id_driver.h", + "instance_id_impl.cc", + "instance_id_impl.h", + ] + + deps = [ + "//base", + "//components/gcm_driver", + "//crypto", + ] + allow_circular_includes_from = [ "//components/gcm_driver" ] + + if (is_android) { + sources -= [ + "instance_id_impl.cc", + "instance_id_impl.h", + ] + sources += [ + "instance_id_android.cc", + "instance_id_android.h", + ] + deps += [ "android:jni_headers" ] + } +} + +# GYP version: components/gcm_driver.gypi:instance_id_test_support +source_set("test_support") { + testonly = true + sources = [ + "fake_gcm_driver_for_instance_id.cc", + "fake_gcm_driver_for_instance_id.h", + "scoped_use_fake_instance_id_android.cc", + "scoped_use_fake_instance_id_android.h", + ] + + public_deps = [ + ":instance_id", + ] + deps = [ + "//base", + "//components/gcm_driver:test_support", + "//testing/gtest", + ] + + if (is_android) { + deps += [ "android:test_support_jni_headers" ] + } +} + +source_set("unit_tests") { + testonly = true + sources = [ + "instance_id_driver_unittest.cc", + ] + + deps = [ + ":instance_id", + ":test_support", + "//base", + "//google_apis/gcm", + "//testing/gtest", + ] +} diff --git a/chromium/components/gcm_driver/instance_id/android/BUILD.gn b/chromium/components/gcm_driver/instance_id/android/BUILD.gn new file mode 100644 index 00000000000..9d980403b92 --- /dev/null +++ b/chromium/components/gcm_driver/instance_id/android/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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") + +# GYP version: components/gcm_driver.gypi:instance_id_driver_jni_headers +generate_jni("jni_headers") { + sources = [ + "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java", + ] + jni_package = "components/gcm_driver/instance_id" +} + +# GYP version: components/gcm_driver.gypi:instance_id_driver_test_support_jni_headers +generate_jni("test_support_jni_headers") { + sources = [ + "javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java", + ] + jni_package = "components/gcm_driver/instance_id" +} + +# GYP version: components/gcm_driver.gypi:instance_id_driver_java +android_library("instance_id_driver_java") { + deps = [ + "//base:base_java", + google_play_services_library, + ] + + java_files = [ + "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java", + "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java", + ] +} + +# GYP version: components/gcm_driver.gypi:instance_id_driver_test_support_java +android_library("instance_id_driver_test_support_java") { + deps = [ + ":instance_id_driver_java", + "//base:base_java", + google_play_services_library, + ] + + java_files = [ "javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java" ] +} diff --git a/chromium/components/history/core/test/BUILD.gn b/chromium/components/history/core/test/BUILD.gn new file mode 100644 index 00000000000..9bc56b1fd5a --- /dev/null +++ b/chromium/components/history/core/test/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("test") { + testonly = true + sources = [ + "database_test_utils.cc", + "database_test_utils.h", + "fake_web_history_service.cc", + "fake_web_history_service.h", + "history_backend_db_base_test.cc", + "history_backend_db_base_test.h", + "history_client_fake_bookmarks.cc", + "history_client_fake_bookmarks.h", + "history_service_test_util.cc", + "history_service_test_util.h", + "history_unittest_base.cc", + "history_unittest_base.h", + "test_history_database.cc", + "test_history_database.h", + "thumbnail-inl.h", + "thumbnail.cc", + "thumbnail.h", + "thumbnail_ios.mm", + "wait_top_sites_loaded_observer.cc", + "wait_top_sites_loaded_observer.h", + ] + + deps = [ + "//base", + "//components/history/core/browser", + "//net", + "//sql", + "//sql:test_support", + "//sync/protocol:protocol", + "//testing/gtest", + "//ui/gfx", + "//url", + ] + + if (is_ios) { + sources -= [ "thumbnail.cc" ] + } +} diff --git a/chromium/components/invalidation/impl/BUILD.gn b/chromium/components/invalidation/impl/BUILD.gn new file mode 100644 index 00000000000..c984af957ee --- /dev/null +++ b/chromium/components/invalidation/impl/BUILD.gn @@ -0,0 +1,256 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if (is_android) { + import("//build/config/android/rules.gni") +} + +source_set("impl") { + sources = [ + "invalidation_logger.cc", + "invalidation_logger.h", + "invalidation_logger_observer.h", + "invalidation_prefs.cc", + "invalidation_prefs.h", + "invalidation_service_util.cc", + "invalidation_service_util.h", + "invalidation_state_tracker.cc", + "invalidation_state_tracker.h", + "invalidation_switches.cc", + "invalidation_switches.h", + "invalidator.cc", + "invalidator.h", + "invalidator_registrar.cc", + "invalidator_registrar.h", + "invalidator_storage.cc", + "invalidator_storage.h", + "mock_ack_handler.cc", + "mock_ack_handler.h", + "profile_invalidation_provider.cc", + "profile_invalidation_provider.h", + "unacked_invalidation_set.cc", + "unacked_invalidation_set.h", + ] + + public_deps = [ + "//components/invalidation/public", + ] + deps = [ + "//base", + "//base:i18n", + "//components/data_use_measurement/core", + "//components/gcm_driver", + "//components/keyed_service/core", + "//components/pref_registry", + "//components/prefs", + "//components/signin/core/browser", + "//google_apis", + "//jingle:notifier", + "//net:net", + + # TODO(sync): Remove this (http://crbug.com/133352); + "//third_party/protobuf:protobuf_lite", + ] + + if (!is_android) { + sources += [ + "gcm_invalidation_bridge.cc", + "gcm_invalidation_bridge.h", + "gcm_network_channel.cc", + "gcm_network_channel.h", + "gcm_network_channel_delegate.h", + "invalidation_notifier.cc", + "invalidation_notifier.h", + "non_blocking_invalidator.cc", + "non_blocking_invalidator.h", + "notifier_reason_util.cc", + "notifier_reason_util.h", + "p2p_invalidator.cc", + "p2p_invalidator.h", + "push_client_channel.cc", + "push_client_channel.h", + "registration_manager.cc", + "registration_manager.h", + "state_writer.h", + "sync_invalidation_listener.cc", + "sync_invalidation_listener.h", + "sync_system_resources.cc", + "sync_system_resources.h", + "ticl_invalidation_service.cc", + "ticl_invalidation_service.h", + "ticl_profile_settings_provider.cc", + "ticl_profile_settings_provider.h", + "ticl_settings_provider.cc", + "ticl_settings_provider.h", + ] + deps += [ "//components/gcm_driver/common" ] + } + + if (is_android) { + sources += [ + "android/component_jni_registrar.cc", + "android/component_jni_registrar.h", + "invalidation_service_android.cc", + "invalidation_service_android.h", + ] + deps += [ ":jni_headers" ] + } +} + +source_set("unit_tests") { + testonly = true + sources = [ + "invalidation_logger_unittest.cc", + ] + deps = [ + ":impl", + ":test_support", + "//base", + "//components/prefs", + "//testing/gmock", + "//testing/gtest", + ] + + if (is_android) { + sources += [ "invalidation_service_android_unittest.cc" ] + deps += [ ":jni_headers" ] + } else { + # Non-Android tests. + sources += [ + "fake_invalidator_unittest.cc", + "gcm_invalidation_bridge_unittest.cc", + "gcm_network_channel_unittest.cc", + "invalidation_notifier_unittest.cc", + "invalidator_registrar_unittest.cc", + "invalidator_storage_unittest.cc", + "non_blocking_invalidator_unittest.cc", + "object_id_invalidation_map_unittest.cc", + "p2p_invalidator_unittest.cc", + "push_client_channel_unittest.cc", + "registration_manager_unittest.cc", + "single_object_invalidation_set_unittest.cc", + "sync_invalidation_listener_unittest.cc", + "sync_system_resources_unittest.cc", + "ticl_invalidation_service_unittest.cc", + "ticl_profile_settings_provider_unittest.cc", + "unacked_invalidation_set_unittest.cc", + ] + deps += [ + "//components/gcm_driver:test_support", + "//components/pref_registry:test_support", + "//components/signin/core/browser:test_support", + "//google_apis:test_support", + "//net", + ] + } +} + +static_library("test_support") { + testonly = true + sources = [ + "fake_invalidation_handler.cc", + "fake_invalidation_handler.h", + "fake_invalidation_service.cc", + "fake_invalidation_service.h", + "fake_invalidation_state_tracker.cc", + "fake_invalidation_state_tracker.h", + "fake_invalidator.cc", + "fake_invalidator.h", + "invalidation_service_test_template.cc", + "invalidation_service_test_template.h", + "invalidation_test_util.cc", + "invalidation_test_util.h", + "invalidator_test_template.cc", + "invalidator_test_template.h", + "object_id_invalidation_map_test_util.cc", + "object_id_invalidation_map_test_util.h", + "unacked_invalidation_set_test_util.cc", + "unacked_invalidation_set_test_util.h", + ] + + public_deps = [ + ":impl", + "//jingle:notifier_test_util", + "//third_party/cacheinvalidation", + ] + deps = [ + "//base", + "//components/gcm_driver:test_support", + "//components/keyed_service/core", + "//components/signin/core/browser:test_support", + "//google_apis", + "//google_apis:test_support", + "//jingle:notifier", + "//net", + "//testing/gmock", + "//testing/gtest", + + # TODO(sync): Remove this (http://crbug.com/133352); + "//third_party/protobuf:protobuf_lite", + + # "//third_party/cacheinvalidation/src/google/cacheinvalidation:cacheinvalidation_proto_cpp", + ] + + if (is_android) { + deps += [ ":jni_headers" ] + } else { + sources += [ + "p2p_invalidation_service.cc", + "p2p_invalidation_service.h", + ] + } +} + +if (is_android) { + android_library("java") { + deps = [ + ":proto_java", + "//base:base_java", + "//sync/android:sync_java", + "//third_party/android_protobuf:protobuf_nano_javalib", + "//third_party/cacheinvalidation:cacheinvalidation_javalib", + "//third_party/cacheinvalidation:cacheinvalidation_proto_java", + "//third_party/jsr-305:jsr_305_javalib", + ] + java_files = [ + "android/java/src/org/chromium/components/invalidation/InvalidationClientService.java", + "android/java/src/org/chromium/components/invalidation/InvalidationService.java", + "android/java/src/org/chromium/components/invalidation/PendingInvalidation.java", + ] + } + proto_java_library("proto_java") { + proto_path = "android/proto" + sources = [ + "$proto_path/serialized_invalidation.proto", + ] + } + android_library("javatests") { + deps = [ + ":java", + "//base:base_java", + "//base:base_java_test_support", + "//sync/android:sync_java", + "//third_party/cacheinvalidation:cacheinvalidation_javalib", + "//third_party/cacheinvalidation:cacheinvalidation_proto_java", + ] + java_files = [ + "android/javatests/src/org/chromium/components/invalidation/InvalidationClientServiceTest.java", + "android/javatests/src/org/chromium/components/invalidation/TestableInvalidationClientService.java", + ] + } + junit_binary("components_invalidation_impl_junit_tests") { + java_files = [ "android/junit/src/org/chromium/components/invalidation/PendingInvalidationTest.java" ] + deps = [ + ":java", + "//base:base_java", + "//base:base_java_test_support", + ] + } + generate_jni("jni_headers") { + sources = [ + "android/java/src/org/chromium/components/invalidation/InvalidationService.java", + ] + jni_package = "components/invalidation" + } +} diff --git a/chromium/components/invalidation/public/BUILD.gn b/chromium/components/invalidation/public/BUILD.gn new file mode 100644 index 00000000000..8cee3149c32 --- /dev/null +++ b/chromium/components/invalidation/public/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("public") { + sources = [ + "ack_handle.cc", + "ack_handle.h", + "ack_handler.cc", + "ack_handler.h", + "invalidation.cc", + "invalidation.h", + "invalidation_export.h", + "invalidation_handler.cc", + "invalidation_handler.h", + "invalidation_service.h", + "invalidation_util.cc", + "invalidation_util.h", + "invalidator_state.cc", + "invalidator_state.h", + "object_id_invalidation_map.cc", + "object_id_invalidation_map.h", + "single_object_invalidation_set.cc", + "single_object_invalidation_set.h", + ] + public_deps = [ + "//third_party/cacheinvalidation", + ] + deps = [ + "//base", + ] +} diff --git a/chromium/components/mus/BUILD.gn b/chromium/components/mus/BUILD.gn new file mode 100644 index 00000000000..a1c52b86a91 --- /dev/null +++ b/chromium/components/mus/BUILD.gn @@ -0,0 +1,143 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//testing/test.gni") +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/mojo_constants.gni") +import("//tools/grit/repack.gni") + +group("all") { + testonly = true + deps = [ + ":mus", + "//components/mus/test_wm", + ] +} + +mojo_native_application("mus") { + sources = [ + "main.cc", + ] + + deps = [ + ":lib", + ":resources_100", + ":resources_200", + ":resources_strings", + "//services/shell/public/cpp:sources", + "//services/tracing/public/interfaces", + ] + + if (is_win) { + deps += [ ":copy_gl_libraries" ] + } + + data_deps = [ + ":manifest", + ] + + resources = [ + "$root_out_dir/mus_app_resources_strings.pak", + "$root_out_dir/mus_app_resources_100.pak", + "$root_out_dir/mus_app_resources_200.pak", + ] +} + +mojo_application_manifest("manifest") { + application_name = "mus" + source = "manifest.json" +} + +if (is_win) { + copy("copy_gl_libraries") { + deps = [ + "//third_party/angle:libEGL", + "//third_party/angle:libGLESv2", + ] + + sources = [ + "$root_shlib_dir/libEGL.dll", + "$root_shlib_dir/libGLESv2.dll", + ] + + outputs = [ + "$root_out_dir/$mojo_application_subdir/mus/{{source_file_part}}", + ] + } +} + +source_set("lib") { + sources = [ + "mus_app.cc", + "mus_app.h", + ] + + public_deps = [ + "//components/mus/common:mus_common", + ] + deps = [ + "//base", + "//cc", + "//cc/surfaces", + "//components/mus/clipboard:lib", + "//components/mus/gles2", + "//components/mus/gpu", + "//components/mus/gpu/display_compositor", + "//components/mus/input_devices", + "//components/mus/public/interfaces", + "//components/mus/surfaces", + "//components/mus/ws:lib", + "//components/mus/ws:test_interface", + "//mojo/common:common_base", + "//services/catalog/public/cpp", + "//services/shell/public/cpp", + "//services/tracing/public/cpp", + "//ui/events", + "//ui/events/ozone:events_ozone_layout", + "//ui/gl:gl", + "//ui/platform_window:platform_impls", + "//ui/platform_window:platform_window", + ] + + if (use_x11) { + public_configs = [ "//build/config/linux:x11" ] + public_deps += [ "//ui/events/platform/x11" ] + } + + if (use_ozone) { + deps += [ "//ui/ozone:ozone" ] + } +} + +repack("resources_strings") { + sources = [ + "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", + ] + output = "$root_out_dir/mus_app_resources_strings.pak" + deps = [ + "//ui/strings", + ] +} + +repack("resources_100") { + sources = [ + "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", + ] + output = "$root_out_dir/mus_app_resources_100.pak" + deps = [ + "//ui/resources", + ] +} + +repack("resources_200") { + sources = [ + "$root_gen_dir/ui/resources/ui_resources_200_percent.pak", + ] + output = "$root_out_dir/mus_app_resources_200.pak" + deps = [ + "//ui/resources", + ] +} diff --git a/chromium/components/mus/clipboard/BUILD.gn b/chromium/components/mus/clipboard/BUILD.gn new file mode 100644 index 00000000000..98f51966799 --- /dev/null +++ b/chromium/components/mus/clipboard/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//testing/test.gni") + +source_set("lib") { + sources = [ + "clipboard_impl.cc", + "clipboard_impl.h", + ] + + deps = [ + "//base", + "//components/mus/public/interfaces", + "//mojo/common", + "//mojo/public/cpp/bindings", + "//services/shell/public/cpp", + "//services/tracing/public/cpp", + ] +} + +group("tests") { + testonly = true + deps = [ + ":mus_clipboard_unittests", + ] +} + +test("mus_clipboard_unittests") { + sources = [ + "clipboard_unittest.cc", + ] + + deps = [ + "//base", + "//components/mus/public/interfaces", + "//mojo/common", + "//services/shell/public/cpp:shell_test_support", + "//services/shell/public/cpp:sources", + "//services/shell/public/cpp/test:run_all_shelltests", + ] + + data_deps = [ + ":test_manifest", + ":lib", + "//components/mus:mus", + ] +} + +mojo_application_manifest("test_manifest") { + type = "exe" + application_name = "mus_clipboard_unittests" + source = "test_manifest.json" +} diff --git a/chromium/components/mus/common/BUILD.gn b/chromium/components/mus/common/BUILD.gn new file mode 100644 index 00000000000..01db30922ed --- /dev/null +++ b/chromium/components/mus/common/BUILD.gn @@ -0,0 +1,100 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//testing/test.gni") + +component("mus_common") { + sources = [ + "event_matcher_util.cc", + "event_matcher_util.h", + "generic_shared_memory_id_generator.cc", + "generic_shared_memory_id_generator.h", + "gpu_memory_buffer_impl.cc", + "gpu_memory_buffer_impl.h", + "gpu_service.cc", + "gpu_service.h", + "gpu_type_converters.cc", + "gpu_type_converters.h", + "mojo_buffer_backing.cc", + "mojo_buffer_backing.h", + "mojo_gpu_memory_buffer.cc", + "mojo_gpu_memory_buffer.h", + "mojo_gpu_memory_buffer_manager.cc", + "mojo_gpu_memory_buffer_manager.h", + "mus_common_export.h", + "switches.cc", + "switches.h", + "transient_window_utils.h", + "types.h", + "util.h", + ] + + defines = [ "MUS_COMMON_IMPLEMENTATION" ] + + deps = [ + "//gpu/command_buffer/client", + "//gpu/config", + "//gpu/ipc/client", + "//gpu/ipc/common:command_buffer_traits", + "//ipc:ipc", + "//services/shell/public/cpp", + "//ui/events:events", + "//ui/gfx/ipc/geometry", + ] + + public_deps = [ + "//components/mus/public/interfaces", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//ui/base", + ] + + if (use_ozone) { + deps += [ "//ui/ozone" ] + } +} + +source_set("run_all_shelltests") { + testonly = true + + sources = [ + "run_all_shelltests.cc", + ] + + deps = [ + "//base/test:test_support", + "//mojo/edk/system", + "//services/shell/background:main", + ] + + if (use_ozone) { + deps += [ "//ui/ozone" ] + } +} + +test("mus_common_unittests") { + sources = [ + "gpu_type_converters_unittest.cc", + ] + public_deps = [ + ":mus_common", + ] + deps = [ + ":run_all_shelltests", + "//base", + "//base/test:test_config", + "//components/mus/public/interfaces", + "//ipc:ipc", + "//testing/gtest", + "//ui/gfx:test_support", + "//ui/gfx/ipc", + ] +} + +mojo_application_manifest("mus_common_unittests_app_manifest") { + application_name = "mus_common_unittests_app" + source = "mus_common_unittests_app_manifest.json" +} diff --git a/chromium/components/mus/demo/BUILD.gn b/chromium/components/mus/demo/BUILD.gn new file mode 100644 index 00000000000..8cabdfdb005 --- /dev/null +++ b/chromium/components/mus/demo/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") + +mojo_native_application("mus_demo") { + sources = [ + "main.cc", + "mus_demo.cc", + "mus_demo.h", + ] + + deps = [ + "//base", + "//components/bitmap_uploader", + "//components/mus/public/cpp", + "//components/mus/public/interfaces", + "//mojo/public/cpp/bindings", + "//services/shell/public/cpp", + "//services/shell/public/cpp:sources", + "//skia", + "//ui/gfx/geometry", + ] + + data_deps = [ + ":manifest", + "//components/mus", + ] +} + +mojo_application_manifest("manifest") { + application_name = "mus_demo" + source = "manifest.json" +} + +group("demo") { + deps = [ + ":mus_demo", + ] +} diff --git a/chromium/components/mus/gles2/BUILD.gn b/chromium/components/mus/gles2/BUILD.gn new file mode 100644 index 00000000000..57ef1b28d83 --- /dev/null +++ b/chromium/components/mus/gles2/BUILD.gn @@ -0,0 +1,89 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") + +source_set("gles2") { + visibility = [ + "//components/mus:*", + "//components/mus/ws:*", + "//components/mus/surfaces:*", + "//services/shell/standalone:lib", # For android + ] + + sources = [ + "command_buffer_driver.cc", + "command_buffer_driver.h", + "command_buffer_driver_manager.cc", + "command_buffer_driver_manager.h", + "command_buffer_impl.cc", + "command_buffer_impl.h", + "command_buffer_local.cc", + "command_buffer_local.h", + "command_buffer_local_client.h", + "command_buffer_task_runner.cc", + "command_buffer_task_runner.h", + "gl_surface_adapter.cc", + "gl_surface_adapter.h", + "gpu_impl.cc", + "gpu_impl.h", + "gpu_memory_tracker.cc", + "gpu_memory_tracker.h", + "gpu_state.cc", + "gpu_state.h", + ] + + public_deps = [ + ":lib", + ] + deps = [ + "//base", + "//components/mus/common:mus_common", + "//components/mus/public/interfaces", + "//gpu/command_buffer/client", + "//gpu/command_buffer/client:gles2_interface", + "//gpu/command_buffer/common:gles2_utils", + "//gpu/command_buffer/service", + "//gpu/config:config", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gfx/geometry/mojo", + "//ui/gl", + "//ui/gl/init", + ] + + if (use_ozone) { + deps += [ "//ui/ozone:ozone" ] + sources += [ + "ozone_gpu_memory_buffer.cc", + "ozone_gpu_memory_buffer.h", + ] + } + + include_dirs = [ "../.." ] +} + +source_set("lib") { + sources = [ + "raster_thread_helper.cc", + "raster_thread_helper.h", + ] + + deps = [ + "//base", + "//cc", + "//components/mus/public/interfaces", + "//gpu/command_buffer/client", + "//gpu/command_buffer/common", + "//gpu/config:config", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//ui/gfx", + "//ui/gfx/geometry", + ] + + include_dirs = [ "../.." ] +} diff --git a/chromium/components/mus/gpu/BUILD.gn b/chromium/components/mus/gpu/BUILD.gn new file mode 100644 index 00000000000..8ba5cabfd1e --- /dev/null +++ b/chromium/components/mus/gpu/BUILD.gn @@ -0,0 +1,65 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//testing/test.gni") + +source_set("gpu") { + output_name = "mus_gpu" + + sources = [ + "gpu_service_impl.cc", + "gpu_service_impl.h", + "gpu_service_mus.cc", + "gpu_service_mus.h", + "mus_gpu_memory_buffer_manager.cc", + "mus_gpu_memory_buffer_manager.h", + ] + + deps = [ + "//components/mus/common:mus_common", + "//components/mus/public/interfaces", + "//gpu/ipc/common", + "//gpu/ipc/service", + "//ipc", + "//media/gpu/ipc/service", + "//mojo/public/cpp/system", + "//services/shell/public/cpp", + "//ui/gfx:memory_buffer", + "//ui/gl/init", + ] + + if (use_ozone) { + deps += [ "//ui/ozone:ozone" ] + } +} + +group("tests") { + testonly = true + deps = [ + ":mus_gpu_unittests", + ] +} + +test("mus_gpu_unittests") { + deps = [ + ":gpu", + "//base", + "//components/mus/common:run_all_shelltests", + "//ipc", + "//testing/gtest", + "//ui/gfx:memory_buffer", + "//ui/gfx/geometry", + ] + + data_deps = [ + ":mus_gpu_unittests_app_manifest", + ] +} + +mojo_application_manifest("mus_gpu_unittests_app_manifest") { + application_name = "mus_gpu_unittests_app" + source = "mus_gpu_unittests_app_manifest.json" +} diff --git a/chromium/components/mus/gpu/display_compositor/BUILD.gn b/chromium/components/mus/gpu/display_compositor/BUILD.gn new file mode 100644 index 00000000000..a30b59f2c89 --- /dev/null +++ b/chromium/components/mus/gpu/display_compositor/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") + +source_set("display_compositor") { + sources = [ + "compositor_frame_sink_delegate.h", + "compositor_frame_sink_factory_impl.cc", + "compositor_frame_sink_factory_impl.h", + "compositor_frame_sink_impl.cc", + "compositor_frame_sink_impl.h", + "display_compositor_impl.cc", + "display_compositor_impl.h", + "display_impl.cc", + "display_impl.h", + ] + + deps = [ + "//base", + "//cc", + "//cc/surfaces", + "//cc/surfaces:surface_id", + "//components/mus/public/interfaces/gpu:interfaces", + + # TODO(fsamuel): Remove this dependency. + "//components/mus/surfaces", + ] +} diff --git a/chromium/components/mus/input_devices/BUILD.gn b/chromium/components/mus/input_devices/BUILD.gn new file mode 100644 index 00000000000..ad3b1d73031 --- /dev/null +++ b/chromium/components/mus/input_devices/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("input_devices") { + sources = [ + "input_device_server.cc", + "input_device_server.h", + ] + + deps = [ + "//base", + "//services/shell/public/cpp:sources", + "//skia", + "//ui/events/devices", + ] + + public_deps = [ + "//components/mus/public/interfaces/input_devices", + ] +} diff --git a/chromium/components/mus/public/cpp/BUILD.gn b/chromium/components/mus/public/cpp/BUILD.gn new file mode 100644 index 00000000000..1f70cf65159 --- /dev/null +++ b/chromium/components/mus/public/cpp/BUILD.gn @@ -0,0 +1,74 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("cpp") { + sources = [ + "context_provider.h", + "gles2_context.h", + "input_event_handler.h", + "lib/command_buffer_client_impl.cc", + "lib/command_buffer_client_impl.h", + "lib/context_provider.cc", + "lib/gles2_context.cc", + "lib/in_flight_change.cc", + "lib/in_flight_change.h", + "lib/output_surface.cc", + "lib/property_type_converters.cc", + "lib/scoped_window_ptr.cc", + "lib/window.cc", + "lib/window_observer.cc", + "lib/window_private.cc", + "lib/window_private.h", + "lib/window_surface.cc", + "lib/window_tree_client.cc", + "lib/window_tree_client_delegate.cc", + "lib/window_tree_host_factory.cc", + "output_surface.h", + "property_type_converters.h", + "scoped_window_ptr.h", + "window.h", + "window_manager_delegate.h", + "window_observer.h", + "window_property.h", + "window_surface.h", + "window_surface_client.h", + "window_tracker.h", + "window_tree_client.h", + "window_tree_client_delegate.h", + "window_tree_client_observer.h", + "window_tree_host_factory.h", + ] + + public_deps = [ + "//base", + "//cc", + "//cc/surfaces", + "//cc/surfaces:surface_id", + "//components/mus/common:mus_common", + "//components/mus/public/interfaces", + "//gpu/command_buffer/client", + "//gpu/command_buffer/client:gles2_implementation", + "//gpu/command_buffer/common", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//services/shell/public/interfaces", + ] + + deps = [ + "//components/mus/gles2:lib", + "//components/mus/public/interfaces", + "//gpu/command_buffer/client:gles2_cmd_helper", + "//gpu/command_buffer/client:gles2_interface", + "//gpu/ipc/client", + "//services/shell/public/cpp", + "//ui/display", + "//ui/display/mojo", + "//ui/events", + "//ui/gfx/geometry", + ] + + data_deps = [ + "//components/mus", + ] +} diff --git a/chromium/components/mus/public/cpp/input_devices/BUILD.gn b/chromium/components/mus/public/cpp/input_devices/BUILD.gn new file mode 100644 index 00000000000..c5c7734831a --- /dev/null +++ b/chromium/components/mus/public/cpp/input_devices/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("input_devices") { + sources = [ + "input_device_client.cc", + "input_device_client.h", + ] + + deps = [ + "//base", + "//services/shell/public/cpp:sources", + "//skia", + "//ui/events/devices", + ] + + public_deps = [ + "//components/mus/public/interfaces/input_devices", + ] +} diff --git a/chromium/components/mus/public/cpp/tests/BUILD.gn b/chromium/components/mus/public/cpp/tests/BUILD.gn new file mode 100644 index 00000000000..e5f756f0726 --- /dev/null +++ b/chromium/components/mus/public/cpp/tests/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//testing/test.gni") + +source_set("unittest_support") { + testonly = true + + sources = [ + "test_window.h", + "test_window_tree.cc", + "test_window_tree.h", + "test_window_tree_client_setup.cc", + "test_window_tree_client_setup.h", + "window_tree_client_private.cc", + "window_tree_client_private.h", + ] + + deps = [ + "//base", + "//components/mus/public/cpp", + "//testing/gtest", + "//ui/display", + "//ui/gfx/geometry/mojo", + ] +} + +source_set("test_support") { + testonly = true + + sources = [ + "window_server_shelltest_base.cc", + "window_server_shelltest_base.h", + "window_server_test_base.cc", + "window_server_test_base.h", + ] + + deps = [ + "//base", + "//base/test:test_config", + "//components/mus/common:mus_common", + "//components/mus/public/cpp", + "//services/shell/public/cpp:shell_test_support", + "//services/shell/public/cpp:sources", + "//testing/gtest", + "//ui/gl", + ] +} + +test("mus_public_unittests") { + sources = [ + "property_type_converters_unittest.cc", + "run_all_unittests.cc", + "window_server_test_suite.cc", + "window_server_test_suite.h", + "window_tree_client_unittest.cc", + "window_unittest.cc", + ] + + deps = [ + ":unittest_support", + "//base", + "//base/test:test_support", + "//components/mus/common:mus_common", + "//components/mus/public/cpp", + "//mojo/common:common_base", + "//mojo/edk/system", + "//mojo/public/cpp/system", + "//services/shell/public/cpp", + "//testing/gtest", + "//ui/events", + "//ui/gfx:test_support", + "//ui/gfx/geometry", + "//ui/gfx/geometry/mojo", + ] + + if (use_x11) { + deps += [ "//ui/gfx/x" ] + } +} diff --git a/chromium/components/mus/public/interfaces/BUILD.gn b/chromium/components/mus/public/interfaces/BUILD.gn new file mode 100644 index 00000000000..33a07da3831 --- /dev/null +++ b/chromium/components/mus/public/interfaces/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("interfaces") { + sources = [ + "accelerator_registrar.mojom", + "animations.mojom", + "channel_handle.mojom", + "clipboard.mojom", + "command_buffer.mojom", + "cursor.mojom", + "display.mojom", + "event_matcher.mojom", + "gpu.mojom", + "gpu_memory_buffer.mojom", + "gpu_service.mojom", + "mus_constants.mojom", + "surface.mojom", + "user_access_manager.mojom", + "user_activity_monitor.mojom", + "window_manager.mojom", + "window_manager_constants.mojom", + "window_manager_window_tree_factory.mojom", + "window_server_test.mojom", + "window_tree.mojom", + "window_tree_constants.mojom", + "window_tree_host.mojom", + ] + + import_dirs = [ + get_path_info("../../../..", "abspath"), + "//mojo/services", + ] + + public_deps = [ + "//cc/ipc:interfaces", + "//gpu/ipc/common:interfaces", + "//ui/events/mojo:interfaces", + "//ui/gfx/geometry/mojo", + "//ui/gfx/mojo", + "//ui/platform_window/mojo:interfaces", + ] +} diff --git a/chromium/components/mus/public/interfaces/accelerator_registrar.mojom b/chromium/components/mus/public/interfaces/accelerator_registrar.mojom new file mode 100644 index 00000000000..00948424eb3 --- /dev/null +++ b/chromium/components/mus/public/interfaces/accelerator_registrar.mojom @@ -0,0 +1,22 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "components/mus/public/interfaces/event_matcher.mojom"; +import "ui/events/mojo/event.mojom"; + +interface AcceleratorHandler { + OnAccelerator(uint32 id, ui.mojom.Event event); +}; + +interface AcceleratorRegistrar { + // The AcceleratorHandler is responsible for handling all the accelerators + // registered from this AcceleratorRegistrar connection. + SetHandler(AcceleratorHandler handler); + + // An AcceleratorHandler must be set before accelerators can be added. + AddAccelerator(uint32 id, EventMatcher matcher) => (bool success); + RemoveAccelerator(uint32 id); +}; diff --git a/chromium/components/mus/public/interfaces/animations.mojom b/chromium/components/mus/public/interfaces/animations.mojom new file mode 100644 index 00000000000..847b406ed0d --- /dev/null +++ b/chromium/components/mus/public/interfaces/animations.mojom @@ -0,0 +1,61 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "ui/gfx/mojo/transform.mojom"; + +enum AnimationTweenType { + LINEAR, + EASE_IN, + EASE_OUT, + EASE_IN_OUT, +}; + +enum AnimationProperty { + // Used for pausing. + NONE, + OPACITY, + TRANSFORM, +}; + +struct AnimationValue { + float float_value; + gfx.mojom.Transform? transform; +}; + +// Identifies how a particular property should be animated between a start and +// target value. +struct AnimationElement { + AnimationProperty property; + + // Duration is in microseconds. + int64 duration; + + AnimationTweenType tween_type; + + // If not specified the start value is taken from either the current value + // (for the first element) or the target_value of the previous element. + AnimationValue? start_value; + + // target_value may be null when property is NONE. + AnimationValue? target_value; +}; + +// An AnimationSequence consists of a number of AnimationElements to animate. +// Each element is animated serially. +struct AnimationSequence { + // Number of times to run the sequence. Value of 0 means run until + // explicitly stopped. + uint32 cycle_count; + + array<AnimationElement> elements; +}; + +// AnimationGroup identifies a window and a set of AnimationSequences to apply +// to the window. Each sequence is run in parallel. +struct AnimationGroup { + uint32 window_id; + array<AnimationSequence> sequences; +}; diff --git a/chromium/components/mus/public/interfaces/channel_handle.mojom b/chromium/components/mus/public/interfaces/channel_handle.mojom new file mode 100644 index 00000000000..d78a53f5977 --- /dev/null +++ b/chromium/components/mus/public/interfaces/channel_handle.mojom @@ -0,0 +1,13 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +// See IPC::ChannelHandle in src/ipc/ipc_channel_handle.h +struct ChannelHandle { + string name; + + // On POSIX, it is one endpoint of a socket pair. On Windows, it is not used. + handle socket; +}; diff --git a/chromium/components/mus/public/interfaces/clipboard.mojom b/chromium/components/mus/public/interfaces/clipboard.mojom new file mode 100644 index 00000000000..201a7c3dea5 --- /dev/null +++ b/chromium/components/mus/public/interfaces/clipboard.mojom @@ -0,0 +1,50 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +const string kMimeTypeHTML = "text/html"; +const string kMimeTypeMozillaURL = "text/x-moz-url"; +const string kMimeTypePNG = "image/png"; +const string kMimeTypeRTF = "text/rtf"; +const string kMimeTypeText = "text/plain"; +const string kMimeTypeURIList = "text/uri-list"; +const string kMimeTypeURL = "text/url"; + +interface Clipboard { + enum Type { + COPY_PASTE = 0, + SELECTION = 1, + DRAG = 2 + }; + + // Returns a sequence number which uniquely identifies clipboard state. + // Clients are able to assume that the clipboard contents are unchanged as + // long as this number has not changed. This number is monotonically + // increasing, is increased when the clipboard state changes, and is + // provided by Windows, Linux, and Mac. + [Sync] + GetSequenceNumber(Type clipboard_type) => (uint64 sequence); + + // Returns the available mime types, and the current sequence number. + [Sync] + GetAvailableMimeTypes(Type clipboard_types) + => (uint64 sequence, array<string> types); + + // Returns the current data associated with the requested Mime type. + // + // We don't want to provide one API to return the entire clipboard state + // because the combined size of the clipboard can be megabytes, especially + // when image data is involved. + [Sync] + ReadClipboardData(Type clipboard_type, string mime_type) + => (uint64 sequence, array<uint8>? data); + + // Writes a set of mime types to the clipboard. This will increment the + // sequence number and return that. In the case of an empty or null map, + // this will just clear the clipboard. + [Sync] + WriteClipboardData(Type clipboard_type, map<string, array<uint8>>? data) + => (uint64 sequence); +}; diff --git a/chromium/components/mus/public/interfaces/command_buffer.mojom b/chromium/components/mus/public/interfaces/command_buffer.mojom new file mode 100644 index 00000000000..f9a977135e7 --- /dev/null +++ b/chromium/components/mus/public/interfaces/command_buffer.mojom @@ -0,0 +1,62 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "gpu/ipc/common/capabilities.mojom"; +import "gpu/ipc/common/command_buffer.mojom"; +import "gpu/ipc/common/mailbox.mojom"; +import "gpu/ipc/common/sync_token.mojom"; +import "ui/gfx/geometry/mojo/geometry.mojom"; + +struct CommandBufferInitializeResult { + int32 command_buffer_namespace; + uint64 command_buffer_id; + gpu.mojom.Capabilities capabilities; +}; + +interface CommandBufferClient { + Destroyed(int32 context_lost_reason, + int32 error); + SignalAck(uint32 id); + // TODO(penghuang): support latency_info and use gfx::SwapResult for result. + SwapBuffersCompleted(/* array<ui.mojom.LatencyInfo> latency_info, */ + int32 result); + UpdateState(gpu.mojom.CommandBufferState state); + // TODO(penghuang): use base::TimeTicks & base::TimeDelta. + UpdateVSyncParameters(int64 timebase, int64 interval); +}; + +interface CommandBuffer { + // Initialize attempts to initialize the command buffer. + // If the context is lost after creation the LostContext method on the + // CommandBufferClient's will be called then this pipe will be + // closed. + Initialize(CommandBufferClient client, + handle<shared_buffer> shared_state, + array<int32> attribs) => (CommandBufferInitializeResult? result); + SetGetBuffer(int32 buffer); + Flush(int32 put_offset); + MakeProgress(int32 last_get_offset) => (gpu.mojom.CommandBufferState state); + RegisterTransferBuffer( + int32 id, handle<shared_buffer> transfer_buffer, uint32 size); + DestroyTransferBuffer(int32 id); + CreateImage(int32 id, + handle memory_handle, + int32 type, + gfx.mojom.Size size, + int32 format, + int32 internal_format); + DestroyImage(int32 id); + CreateStreamTexture(uint32 client_texture_id) + => (int32 stream_id, bool succeeded); + TakeFrontBuffer(gpu.mojom.Mailbox mailbox); + ReturnFrontBuffer(gpu.mojom.Mailbox mailbox, bool is_lost); + SignalQuery(uint32 query, uint32 signal_id); + SignalSyncToken(gpu.mojom.SyncToken sync_token, uint32 signal_id); + WaitForGetOffsetInRange(int32 start, int32 end) + => (gpu.mojom.CommandBufferState state); + WaitForTokenInRange(int32 start, int32 end) + => (gpu.mojom.CommandBufferState state); +}; diff --git a/chromium/components/mus/public/interfaces/cursor.mojom b/chromium/components/mus/public/interfaces/cursor.mojom new file mode 100644 index 00000000000..878cd0113cd --- /dev/null +++ b/chromium/components/mus/public/interfaces/cursor.mojom @@ -0,0 +1,57 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +// Standard Cursor numbers. These are the same as Chrome's ui::Cursor and +// blink's WebCursorInfo. +enum Cursor { + // NULL is kept for compatibility with chrome declarations. In chrome code, it + // is treated exactly like POINTER, the default pointer. + CURSOR_NULL = 0, + POINTER, + CROSS, + HAND, + IBEAM, + WAIT, + HELP, + EAST_RESIZE, + NORTH_RESIZE, + NORTH_EAST_RESIZE, + NORTH_WEST_RESIZE, + SOUTH_RESIZE, + SOUTH_EAST_RESIZE, + SOUTH_WEST_RESIZE, + WEST_RESIZE, + NORTH_SOUTH_RESIZE, + EAST_WEST_RESIZE, + NORTH_EAST_SOUTH_WEST_RESIZE, + NORTH_WEST_SOUTH_EAST_RESIZE, + COLUMN_RESIZE, + ROW_RESIZE, + MIDDLE_PANNING, + EAST_PANNING, + NORTH_PANNING, + NORTH_EAST_PANNING, + NORTH_WEST_PANNING, + SOUTH_PANNING, + SOUTH_EAST_PANNING, + SOUTH_WEST_PANNING, + WEST_PANNING, + MOVE, + VERTICAL_TEXT, + CELL, + CONTEXT_MENU, + ALIAS, + PROGRESS, + NO_DROP, + COPY, + NONE, + NOT_ALLOWED, + ZOOM_IN, + ZOOM_OUT, + GRAB, + GRABBING, + CUSTOM +}; diff --git a/chromium/components/mus/public/interfaces/display.mojom b/chromium/components/mus/public/interfaces/display.mojom new file mode 100644 index 00000000000..71364999b0a --- /dev/null +++ b/chromium/components/mus/public/interfaces/display.mojom @@ -0,0 +1,25 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "components/mus/public/interfaces/window_manager_constants.mojom"; + +interface DisplayManagerObserver { + // Sent when the observer is added. Gives the initial state. + OnDisplays(array<Display> displays); + + // The specified set of displays has changed in some way. This is used both + // when a new display is added, or when a property of a display changes. + // |displays| does not necessarily contain the complete set of displays, + // only those that changed. + OnDisplaysChanged(array<Display> displays); + + // An existing display was removed. + OnDisplayRemoved(int64 id); +}; + +interface DisplayManager { + AddObserver(DisplayManagerObserver observer); +}; diff --git a/chromium/components/mus/public/interfaces/event_matcher.mojom b/chromium/components/mus/public/interfaces/event_matcher.mojom new file mode 100644 index 00000000000..34ec670f00f --- /dev/null +++ b/chromium/components/mus/public/interfaces/event_matcher.mojom @@ -0,0 +1,55 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "ui/events/mojo/event_constants.mojom"; +import "ui/events/mojo/keyboard_codes.mojom"; +import "ui/gfx/geometry/mojo/geometry.mojom"; + +struct KeyEventMatcher { + ui.mojom.KeyboardCode keyboard_code; +}; + +struct PointerKindMatcher { + ui.mojom.PointerKind pointer_kind; +}; + +struct PointerLocationMatcher { + gfx.mojom.RectF region; +}; + +struct EventTypeMatcher { + ui.mojom.EventType type; +}; + +struct EventFlagsMatcher { + // A bitfield of kEventFlag* and kMouseEventFlag* values in + // input_event_constants.mojom. + int32 flags; +}; + +// If a specific matcher is missing, then an Event will match this EventMatcher +// (if relevant). For example, if |type_matcher| is missing, then events of all +// types will match this EventMatcher. Similarly, if |key_matcher| is missing, +// then all key-events will match. +// An example matcher to match the Ctrl+A accelerator would be: +// - |type_matcher.type| = ui::mojom::EventType::KEY_PRESSED +// - |flags_matcher.flags| = ui::mojom::kEventVlagControlDown +// - |key_matcher.keyboard_code| = ui::mojom::KeyboardCode::A +// +// A matcher to match any key-press event would be: +// - |type_matcher.type| = ui::mojom::EventType::KEY_PRESSED +struct EventMatcher { + // TODO(jamescook): Move this to somewhere accelerator-specific. + ui.mojom.AcceleratorPhase accelerator_phase; + EventTypeMatcher? type_matcher; + EventFlagsMatcher? flags_matcher; + // These flags will be stripped from incoming events' flags when comparing + // against |flags_matcher|. + EventFlagsMatcher? ignore_flags_matcher; + KeyEventMatcher? key_matcher; + PointerKindMatcher? pointer_kind_matcher; + PointerLocationMatcher? pointer_location_matcher; +}; diff --git a/chromium/components/mus/public/interfaces/gpu.mojom b/chromium/components/mus/public/interfaces/gpu.mojom new file mode 100644 index 00000000000..643443d2822 --- /dev/null +++ b/chromium/components/mus/public/interfaces/gpu.mojom @@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "components/mus/public/interfaces/command_buffer.mojom"; + +struct GpuInfo { + uint32 vendor_id; + uint32 device_id; + string vendor_info; + string renderer_info; + string driver_version; +}; + +interface Gpu { + // Creates a new offscreen OpenGL ES 2.0 context. + CreateOffscreenGLES2Context(CommandBuffer& gles2_client); + + // Query Gpu information + GetGpuInfo() => (GpuInfo gpu_info); +}; diff --git a/chromium/components/mus/public/interfaces/gpu/BUILD.gn b/chromium/components/mus/public/interfaces/gpu/BUILD.gn new file mode 100644 index 00000000000..6ac8f1c23d3 --- /dev/null +++ b/chromium/components/mus/public/interfaces/gpu/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("interfaces") { + sources = [ + "display_compositor.mojom", + "display_compositor_host.mojom", + ] + + public_deps = [ + "//components/mus/public/interfaces", + "//gpu/ipc/common:interfaces", + ] +} diff --git a/chromium/components/mus/public/interfaces/gpu/display_compositor.mojom b/chromium/components/mus/public/interfaces/gpu/display_compositor.mojom new file mode 100644 index 00000000000..f8460623ddf --- /dev/null +++ b/chromium/components/mus/public/interfaces/gpu/display_compositor.mojom @@ -0,0 +1,72 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.gpu.mojom; + +import "cc/ipc/compositor_frame.mojom"; +import "cc/ipc/returned_resource.mojom"; + + +// Indicates whether the submitted CompositorFrame has been drawn to the display +// or has been skipped (e.g. another frame may have been submitted before +// vblank). +enum CompositorFrameDrawStatus { + DRAW_SKIPPED, + DRAWN +}; + +// A CompositorFrameSinkFactory represents a single Display client. +// The client (a process) can use this interface to create +// CompositorFrameSinks. +// TODO(fsamuel): This needs a better name. +interface CompositorFrameSinkFactory { + // Requests a CompositorFrameSink interface from the display compositor. + // A CompositorFrameSink has an associated ID consisting of three components: + // 1. Namespace picked by the service associated with this + // CompositorFrameSinkFactory. + // 2. |local_id| which is a monotonically increasing ID allocated by the + // client. + // 3. |nonce| is a cryptographically secure random number making this Sink + // unguessable by other clients. + CreateCompositorFrameSink(uint32 local_id, + uint64 nonce, + CompositorFrameSink& sink, + CompositorFrameSinkClient client); +}; + +// A CompositorFrameSink is an interface for receiving CompositorFrame structs. +// A CompositorFrame contains the complete output meant for display. Each time a +// client has a graphical update, and receives an OnBeginFrame, it is +// responsible for creating a CompositorFrame to update its portion of the +// screen. +interface CompositorFrameSink { + // After the submitted frame is either drawn for the first time by the display + // compositor or discarded, the callback will be called with the status of the + // submitted frame. Clients should use this acknowledgement to ratelimit frame + // submissions. + // TODO(fsamuel): We should support identifying the CF in the callback. + SubmitCompositorFrame(cc.mojom.CompositorFrame frame) => + (CompositorFrameDrawStatus status); + + // Lets the display compositor know that the client wishes to receive the next + // BeginFrame event. + SetNeedsBeginFrame(bool needs_begin_frame); + + // TODO(fsamuel): ReadbackBitmap API would be useful here. +}; + +interface CompositorFrameSinkClient { + ReturnResources(array<cc.mojom.ReturnedResource> resources); +}; + +// This is a public interface implemented by Display clients. +// Each client implements a single instance of the DisplayClient interface. +interface DisplayClient { + // Clients can register CompositorFrameSinks via the provided |factory|. + OnClientCreated(uint32 client_id, CompositorFrameSinkFactory factory); + + // TODO(fsamuel): OnBeginFrame needs to take a BeginFrameArgs instance per + // cc/output/begin_frame_args.h. + OnBeginFrame(); +}; diff --git a/chromium/components/mus/public/interfaces/gpu/display_compositor_host.mojom b/chromium/components/mus/public/interfaces/gpu/display_compositor_host.mojom new file mode 100644 index 00000000000..3c7b6d402f2 --- /dev/null +++ b/chromium/components/mus/public/interfaces/gpu/display_compositor_host.mojom @@ -0,0 +1,32 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.gpu.mojom; + +import "components/mus/public/interfaces/gpu/display_compositor.mojom"; + +// This is a privileged API to be used only by the Mus Window Server. +// There is one Display per accelerated widget. This corresponds to a physical +// display on Chrome OS, and a window on other Chrome platforms. +interface Display { + // Each client (process) has a unique |client_id| and implements the + // DisplayClient interface. + CreateClient(uint32 client_id, DisplayClient& client); +}; + +interface DisplayHost { + // TODO(fsamuel): OnBeginFrame needs to take a BeginFrameArgs instance per + // cc/output/begin_frame_args.h. + OnBeginFrame(); +}; + +// This is a privileged API to be used only by the Mus Window Server. +// There should be only one DisplayCompositor connection. +interface DisplayCompositor { + CreateDisplay(int32 accelerated_widget, + Display& display, + DisplayHost display_host, + CompositorFrameSink& sink, + CompositorFrameSinkClient client); +}; diff --git a/chromium/components/mus/public/interfaces/gpu_memory_buffer.mojom b/chromium/components/mus/public/interfaces/gpu_memory_buffer.mojom new file mode 100644 index 00000000000..0cb6e19ee0a --- /dev/null +++ b/chromium/components/mus/public/interfaces/gpu_memory_buffer.mojom @@ -0,0 +1,63 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +enum BufferFormat { + ATC, + ATCIA, + DXT1, + DXT5, + ETC1, + R_8, + RGBA_4444, + RGBX_8888, + RGBA_8888, + BGRX_8888, + BGRA_8888, + YUV_420, + YUV_420_BIPLANAR, + UYVY_422, + LAST = UYVY_422 +}; + +enum BufferUsage { + GPU_READ, + SCANOUT, + GPU_READ_CPU_READ_WRITE, + GPU_READ_CPU_READ_WRITE_PERSISTENT, + LAST = GPU_READ_CPU_READ_WRITE_PERSISTENT +}; + +enum GpuMemoryBufferType { + EMPTY, + SHARED_MEMORY, + IO_SURFACE, + SURFACE_TEXTURE, + OZONE_NATIVE_PIXMAP, + LAST = OZONE_NATIVE_PIXMAP +}; + +struct GpuMemoryBufferId { + int32 id; +}; + +struct NativePixmapHandle { + // A file descriptor for the underlying memory object (usually dmabuf). + handle fd; + + // The stride used when accessing the buffer via a memory mapping. + int32 stride; +}; + + +struct GpuMemoryBufferHandle { + GpuMemoryBufferType type; + GpuMemoryBufferId id; + handle buffer_handle; + uint32 offset; + int32 stride; + NativePixmapHandle? native_pixmap_handle; + // TODO(fsamuel): Add support for Machports. +}; diff --git a/chromium/components/mus/public/interfaces/gpu_service.mojom b/chromium/components/mus/public/interfaces/gpu_service.mojom new file mode 100644 index 00000000000..64ad2d1b9f0 --- /dev/null +++ b/chromium/components/mus/public/interfaces/gpu_service.mojom @@ -0,0 +1,32 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "components/mus/public/interfaces/channel_handle.mojom"; +import "components/mus/public/interfaces/gpu.mojom"; +import "components/mus/public/interfaces/gpu_memory_buffer.mojom"; +import "gpu/ipc/common/sync_token.mojom"; +import "ui/gfx/geometry/mojo/geometry.mojom"; + +interface GpuService { + // Tells the GPU service to create a new channel for communication with a + // client. The GPU service responds with client ID, IPC handle and + // GPUInfo. + [Sync] + EstablishGpuChannel() + => (int32 client_id, ChannelHandle channel_handle, GpuInfo gpu_info); + + // Tells the GPU service to create a new GPU memory buffer. + CreateGpuMemoryBuffer(GpuMemoryBufferId id, + gfx.mojom.Size size, + BufferFormat format, + BufferUsage usage, + uint64 surface_id) + => (GpuMemoryBufferHandle buffer_handle); + + // Tells the GPU process to destroy GPU memory buffer. + DestroyGpuMemoryBuffer(GpuMemoryBufferId id, + gpu.mojom.SyncToken sync_token); +}; diff --git a/chromium/components/mus/public/interfaces/input_devices/BUILD.gn b/chromium/components/mus/public/interfaces/input_devices/BUILD.gn new file mode 100644 index 00000000000..f2de99d1ae1 --- /dev/null +++ b/chromium/components/mus/public/interfaces/input_devices/BUILD.gn @@ -0,0 +1,15 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("input_devices") { + sources = [ + "input_device_server.mojom", + ] + + public_deps = [ + "//ui/events/devices/mojo", + ] +} diff --git a/chromium/components/mus/public/interfaces/input_devices/input_device_server.mojom b/chromium/components/mus/public/interfaces/input_devices/input_device_server.mojom new file mode 100644 index 00000000000..b50f7d0a939 --- /dev/null +++ b/chromium/components/mus/public/interfaces/input_devices/input_device_server.mojom @@ -0,0 +1,43 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "ui/events/devices/mojo/input_devices.mojom"; + +// Receives updates about changes to input-devices. See InputDeviceServer for +// the expected behaviour. +interface InputDeviceObserverMojo { + // Is called when the list of keyboards changes. + OnKeyboardDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); + + // Is called when the list of touchscreens changes. + OnTouchscreenDeviceConfigurationChanged( + array<ui.mojom.TouchscreenDevice> devices); + + // Is called when the list of mice changes. + OnMouseDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); + + // Is called when the list of touchpads changes. + OnTouchpadDeviceConfigurationChanged(array<ui.mojom.InputDevice> devices); + + // Is called once all of the input-device lists are available. This will + // always be the first call that an observer receives. + OnDeviceListsComplete( + array<ui.mojom.InputDevice> keyboard_devices, + array<ui.mojom.TouchscreenDevice> touchscreen_devices, + array<ui.mojom.InputDevice> mouse_devices, + array<ui.mojom.InputDevice> touchpad_devices); +}; + +// Sends updates about input-devices to observers. +interface InputDeviceServer { + // Adds an InputDeviceObserverMojo in another process as an observer to get + // notified of changes to input-devices over Mojo IPC. If all input-device + // lists are complete when a new observer connects, the implementation will + // immediately call OnDeviceListsComplete() with the input-device lists. If + // not, the implementation will wait until all input-device lists are complete + // then call OnDeviceListsComplete() for all connected observers. + AddObserver(InputDeviceObserverMojo observer); +}; diff --git a/chromium/components/mus/public/interfaces/mus_constants.mojom b/chromium/components/mus/public/interfaces/mus_constants.mojom new file mode 100644 index 00000000000..91407a2c4eb --- /dev/null +++ b/chromium/components/mus/public/interfaces/mus_constants.mojom @@ -0,0 +1,15 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +enum OrderDirection { + ABOVE = 1, + BELOW, +}; + +// If this property is present on a window then the window is only shown once +// the underlay has been provided. This property is only checked once at +// construction time. +const string kWaitForUnderlay_Property = "property:wait-for-underlay"; diff --git a/chromium/components/mus/public/interfaces/surface.mojom b/chromium/components/mus/public/interfaces/surface.mojom new file mode 100644 index 00000000000..2c531d3729c --- /dev/null +++ b/chromium/components/mus/public/interfaces/surface.mojom @@ -0,0 +1,22 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "cc/ipc/compositor_frame.mojom"; +import "cc/ipc/returned_resource.mojom"; + +// A Surface is an interface for receiving CompositorFrame structs. This is a +// separate interface to allow CompositorFrames to be delivered from +// supplementary (not main) threads of a mojo app. +interface Surface { + // After the submitted frame is drawn for the first time, the receiver will + // respond to the SubmitFrame message. Clients should use this acknowledgement + // to ratelimit frame submissions. + SubmitCompositorFrame(cc.mojom.CompositorFrame frame) => (); +}; + +interface SurfaceClient { + ReturnResources(array<cc.mojom.ReturnedResource> resources); +}; diff --git a/chromium/components/mus/public/interfaces/user_access_manager.mojom b/chromium/components/mus/public/interfaces/user_access_manager.mojom new file mode 100644 index 00000000000..ad0eeed9311 --- /dev/null +++ b/chromium/components/mus/public/interfaces/user_access_manager.mojom @@ -0,0 +1,11 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +// Used to change the active user. +interface UserAccessManager { + // Sets the active user. By default the root user is the active user. + SetActiveUser(string user_id); +}; diff --git a/chromium/components/mus/public/interfaces/user_activity_monitor.mojom b/chromium/components/mus/public/interfaces/user_activity_monitor.mojom new file mode 100644 index 00000000000..9f9e75f7837 --- /dev/null +++ b/chromium/components/mus/public/interfaces/user_activity_monitor.mojom @@ -0,0 +1,31 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +interface UserActivityObserver { + OnUserActivity(); +}; + +interface UserIdleObserver { + enum IdleState { + ACTIVE, + IDLE, + }; + OnUserIdleStateChanged(IdleState new_state); +}; + +interface UserActivityMonitor { + // Notifies the observer of user activity at most once every + // |delay_between_notify_secs| seconds. + AddUserActivityObserver(uint32 delay_between_notify_secs, + UserActivityObserver observer); + + // Notifies the observer when user is idle for more than + // |idle_time_in_minutes| minutes. When the observer is first added, if the + // user has already been idle for |idle_time_in_minutes|, then + // OnUserIdleStateChanged(IDLE) is called on the observer, otherwise + // OnUserIdleStateChanged(ACTIVE) is called. + AddUserIdleObserver(uint32 idle_time_in_minutes, UserIdleObserver observer); +}; diff --git a/chromium/components/mus/public/interfaces/window_manager.mojom b/chromium/components/mus/public/interfaces/window_manager.mojom new file mode 100644 index 00000000000..ed0ffe172a1 --- /dev/null +++ b/chromium/components/mus/public/interfaces/window_manager.mojom @@ -0,0 +1,134 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "components/mus/public/interfaces/cursor.mojom"; +import "components/mus/public/interfaces/event_matcher.mojom"; +import "components/mus/public/interfaces/window_manager_constants.mojom"; +import "components/mus/public/interfaces/window_tree_constants.mojom"; +import "ui/events/mojo/event.mojom"; +import "ui/gfx/geometry/mojo/geometry.mojom"; + +// WindowManager is used when a WindowTreeClient attempts to modify +// a property of the embed root. When this happens WindowTree calls the +// appropriate function on WindowManager. For example, if a +// WindowTreeClient calls SetWindowBounds() on its embed root, WindowTree +// calls WmSetBounds(). WindowManager can then decide if it wants to +// change the bounds or not. +// +// This interface is only used as an associated interface and is associated +// with WindowTreeClient, further WindowTree requests this interface from +// WindowTreeClient supplied at the time the WindowTreeHost is created. +interface WindowManager { + // Whether the window is always on top. Type: bool. + const string kAlwaysOnTop_Property = "prop:always_on_top"; + // Initial bounds to create the window at. If empty the WindowManager decides + // the initial bounds. + const string kInitialBounds_Property = "prop:initial_bounds"; + // Internal window name. Useful for debugging. Type: mojom::String + const string kName_Property = "prop:name"; + // The window's preferred size as defined by its content. Type: gfx::Size. + const string kPreferredSize_Property = "prop:preferred-size"; + // The window's resize behavior. Type: ResizeBehavior. + const string kResizeBehavior_Property = "prop:resize-behavior"; + // Bounds the window is restored to. Type: gfx::Rect. + const string kRestoreBounds_Property = "prop:restore-bounds"; + // Shadow style for the window. Type: mojom::ShadowStyle. + const string kShadowStyle_Property = "prop:shadow-style"; + // The window's show state. Type: ShowState. + const string kShowState_Property = "prop:show-state"; + // The window bounds as set by user input. Type: gfx::Rect. + const string kUserSetBounds_Property = "prop:user-set-bounds"; + // The window's app icon. Type: SkBitmap + const string kWindowAppIcon_Property = "prop:window-app-icon"; + // The window type. Type: mojom::WindowType + const string kWindowType_Property = "prop:window-type"; + // The window's title. Type: mojom::String + const string kWindowTitle_Property = "prop:window-title"; + // A flag controlling the window's presence on the mash shelf. Type: bool + const string kWindowIgnoredByShelf_Property = "prop:window-ignored-by-shelf"; + // The application ID (eg. 'mojo:foo'). Type: mojom::String + const string kAppID_Property = "prop:app-id"; + // Specifies that the system default caption and icon should not be rendered, + // and the client area should be equivalent to the window area. Type: bool + const string kRemoveStandardFrame_Property = "prop:remove-standard-frame"; + + // Called immediately when the WindowManager is obtained. + OnConnect(uint16 client_id); + + // Called when a new display is added. |root| gives the root window specific + // to this WindowManager for |display|. + WmNewDisplayAdded(Display display, WindowData root, bool parent_drawn); + + // When the WindowManager completes a request it must call back to + // WindowManagerClient::WmResponse(). + WmSetBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds); + WmSetProperty(uint32 change_id, + uint32 window_id, + string name, + array<uint8>? value); + + // Asks the WindowManager to create a new window. + // |requesting_client_id| is the id of the client issuing the request. This + // allows the window manager to track top level windows by client. + WmCreateTopLevelWindow(uint32 change_id, + uint16 requesting_client_id, + map<string, array<uint8>> properties); + + // A WindowTreeClient is considered "janky" by Mus when it stops ACK'ing input + // events within a reasonable timeframe. When a client enters or exits this + // state, Mus will tell the window manager about it so that the window manager + // can update the UI for the janky windows. + WmClientJankinessChanged(uint16 client_id, bool janky); + + // An accelerator registered via AddAccelerator() has been triggered. + OnAccelerator(uint32 id, ui.mojom.Event event); +}; + +// This interface is only used as an associated interface and is associated +// with WindowTree. +interface WindowManagerClient { + // Enables (or disables) child windows of |window_id| to be activated. + AddActivationParent(uint32 window_id); + RemoveActivationParent(uint32 window_id); + + ActivateNextWindow(); + + // Sets the underlay surface offset for the specified window and additional + // hit area. The underlay surface is drawn at the bounds of the window minus + // the offset. The hit area is extended from the bounds of the window by + // |hit_area|. + SetUnderlaySurfaceOffsetAndExtendedHitArea(uint32 window_id, + int32 x_offset, + int32 y_offset, + gfx.mojom.Insets hit_area); + + // Add and remove accelerators. When accelerators are registered the + // WindowManager receives the event via OnAccelerator() rather than the + // target window. The id is defined by the client and can be used to more + // easily identify the accelerator's action. If an accelerator with the same + // id or the same matcher already exists, then the accelerator is not added. + // Accelerator ids 1 << 31 and above are reserved for internal use. + AddAccelerator(uint32 id, EventMatcher matcher) => (bool success); + RemoveAccelerator(uint32 id); + + // The window manager has completed a request with the specific change id. + WmResponse(uint32 change_id, bool response); + + // Calls WindowTreeClient::RequestClose() on the embedded app at the + // specified window. + WmRequestClose(uint32 window_id); + + // Sets the frame decoration constants of the display the window manager is + // associated with. + WmSetFrameDecorationValues(FrameDecorationValues values); + + // Sets the cursor that the non-client areas of the window should use. + WmSetNonClientCursor(uint32 window_id, Cursor cursor_id); + + // Response from WmCreateTopLevelWindow() informing the client of the id for + // the new window. + OnWmCreatedTopLevelWindow(uint32 change_id, uint32 window_id); +}; diff --git a/chromium/components/mus/public/interfaces/window_manager_constants.mojom b/chromium/components/mus/public/interfaces/window_manager_constants.mojom new file mode 100644 index 00000000000..acdf16b4478 --- /dev/null +++ b/chromium/components/mus/public/interfaces/window_manager_constants.mojom @@ -0,0 +1,78 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "ui/gfx/geometry/mojo/geometry.mojom"; + +enum WindowManagerErrorCode { + SUCCESS, + ACCESS_DENIED +}; + +// TODO(sky): seems like this should not be defined in mus, rather in mash. +// Only thing mus cares about is minimized and that should be expressed +// differently. +enum ShowState { + DEFAULT, + NORMAL, + MINIMIZED, + MAXIMIZED, + INACTIVE, + FULLSCREEN, + DOCKED, +}; + +enum Rotation { + VALUE_0, + VALUE_90, + VALUE_180, + VALUE_270, +}; + +const int32 kResizeBehaviorNone = 0; +const int32 kResizeBehaviorCanResize = 1; +const int32 kResizeBehaviorCanMaximize = 2; +const int32 kResizeBehaviorCanMinimize = 4; + +struct FrameDecorationValues { + gfx.mojom.Insets normal_client_area_insets; + gfx.mojom.Insets maximized_client_area_insets; + // Max width needed to display the buttons on the title bar. The buttons are + // aligned to the trailing edge of the titlebar. + // TODO(sky): this API is very narrow, and assumes a particular config. + uint32 max_title_bar_button_width; +}; + +enum TouchSupport { + UNKNOWN, + AVAILABLE, + UNAVAILABLE, +}; + +struct Display { + int64 id; + gfx.mojom.Rect bounds; + gfx.mojom.Rect work_area; + float device_pixel_ratio; + Rotation rotation; + TouchSupport touch_support; + bool is_primary; + FrameDecorationValues frame_decoration_values; +}; + +enum WindowType { + // These constants come from Widget::InitParams. See it for details. + // TODO: see if we can reduce this set. For example, why do we need both + // BUBBLE and POPUP. + WINDOW, + PANEL, + WINDOW_FRAMELESS, + CONTROL, + POPUP, + MENU, + TOOLTIP, + BUBBLE, + DRAG, +}; diff --git a/chromium/components/mus/public/interfaces/window_manager_window_tree_factory.mojom b/chromium/components/mus/public/interfaces/window_manager_window_tree_factory.mojom new file mode 100644 index 00000000000..7e875f4cf7b --- /dev/null +++ b/chromium/components/mus/public/interfaces/window_manager_window_tree_factory.mojom @@ -0,0 +1,16 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "components/mus/public/interfaces/window_manager_constants.mojom"; +import "components/mus/public/interfaces/window_tree.mojom"; + +// Interface used by the WindowManager to obtain a WindowTree. The +// WindowManager is informed of the roots (one per display) by way of +// WmNewDisplayAdded(). See it for details. +interface WindowManagerWindowTreeFactory { + // NOTE: it is expected this is called only once. + CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); +}; diff --git a/chromium/components/mus/public/interfaces/window_server_test.mojom b/chromium/components/mus/public/interfaces/window_server_test.mojom new file mode 100644 index 00000000000..6e03ab23780 --- /dev/null +++ b/chromium/components/mus/public/interfaces/window_server_test.mojom @@ -0,0 +1,9 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +interface WindowServerTest { + EnsureClientHasDrawnWindow(string client_name) => (bool success); +}; diff --git a/chromium/components/mus/public/interfaces/window_tree.mojom b/chromium/components/mus/public/interfaces/window_tree.mojom new file mode 100644 index 00000000000..96c2f73fe75 --- /dev/null +++ b/chromium/components/mus/public/interfaces/window_tree.mojom @@ -0,0 +1,378 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "cc/ipc/surface_id.mojom"; +import "components/mus/public/interfaces/cursor.mojom"; +import "components/mus/public/interfaces/event_matcher.mojom"; +import "components/mus/public/interfaces/mus_constants.mojom"; +import "components/mus/public/interfaces/surface.mojom"; +import "components/mus/public/interfaces/window_manager.mojom"; +import "components/mus/public/interfaces/window_manager_constants.mojom"; +import "components/mus/public/interfaces/window_tree_constants.mojom"; +import "ui/events/mojo/event.mojom"; +import "ui/gfx/geometry/mojo/geometry.mojom"; +import "ui/platform_window/mojo/text_input_state.mojom"; + +// Windows are identified by a uint32. The upper 16 bits are the connection id, +// and the lower 16 the id assigned by the client. +// +// The root window is identified with a connection id of 0, and value of 1. +// +// Most functions to the WindowTree take a change_id parameter. When +// WindowTree completes processing of a function WindowTree calls +// WindowTreeClient::OnChangeCompleted() with the change_id supplied by the +// client and the result of the function. This allows the client to track +// whether the call succeeded or not. Calls are done via the client interface +// rather than a callback to ensure ordering. The server does not interpret the +// change id in anyway, it is up to the client to assign a value and use it. +// Generally the change id is an ever increasing integer. +interface WindowTree { + // Creates a new window with the specified id. It is up to the client to + // ensure the id is unique to the connection (the id need not be globally + // unique). Additionally the connection id (embedded in |window_id|) must + // match that of the connection. + // Errors: + // ERROR_CODE_VALUE_IN_USE: a window already exists with the specified id. + // ERROR_CODE_ILLEGAL_ARGUMENT: The connection part of |window_id| does not + // match the connection id of the client. + NewWindow(uint32 change_id, + uint32 window_id, + map<string, array<uint8>>? properties); + + // Requests the WindowManager to create a new top level window. On success + // OnTopLevelCreated() is called with the WindowData for the new window. On + // failure OnChangeCompleted() is called. + // TODO(sky): this likely needs context, maybe in |properties|. + NewTopLevelWindow(uint32 change_id, + uint32 window_id, + map<string, array<uint8>> properties); + + // Deletes a window. This does not recurse. No hierarchy change notifications + // are sent as a result of this. Only the connection that created the window + // can delete it. + DeleteWindow(uint32 change_id, uint32 window_id); + + // Requests input event capture for the given |window_id|. Capture is only + // allowed if the window is processing an event. When a window gains capture, + // current input events are canceled. The given window will receive all + // subsequent input until an alternate window is set via SetCapture, or + // ReleaseCapture is called for |window_id|. OnLostCapture is called to notify + // of capture ending. + SetCapture(uint32 change_id, uint32 window_id); + + // Releases input event capture for the given |window_id|. This does nothing + // if |window_id| does not currently have capture. + ReleaseCapture(uint32 change_id, uint32 window_id); + + // Sets an observer that monitors all events, even if they are not targeted + // at a window in this tree. If an event matchs |matcher| the observer reports + // it to the WindowTreeClient via OnWindowInputEvent (if the event target is + // this window tree) or OnEventObserved (if the target is another tree). The + // client must supply a non-zero |observer_id|, which is reported back with + // observed events. Set the matcher to null to clear the observer. + SetEventObserver(EventMatcher? matcher, uint32 observer_id); + + // Sets the specified bounds of the specified window. + SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds); + + // Sets the client area of the specified window. The client area is specified + // by way of insets. Everything outside of the insets, and not in + // |additional_client_areas| is considered non-client area. + // TODO(sky): convert additional_client_areas to a path. + SetClientArea(uint32 window_id, + gfx.mojom.Insets insets, + array<gfx.mojom.Rect>? additional_client_areas); + + // Mouse events outside a hit test mask do not hit the window. The |mask| is + // in window local coordinates. Pass null to clear the mask. + // TODO(jamescook): Convert |mask| to a path. http://crbug.com/613210 + SetHitTestMask(uint32 window_id, gfx.mojom.Rect? mask); + + // Sets the visibility of the specified window to |visible|. Connections are + // allowed to change the visibility of any window they have created, as well + // as any of their roots. + SetWindowVisibility(uint32 change_id, uint32 window_id, bool visible); + + // Sets an individual named property. Setting an individual property to null + // deletes the property. + SetWindowProperty(uint32 change_id, + uint32 window_id, + string name, + array<uint8>? value); + + // Sets the opacity of the specified window to |opacity|. + SetWindowOpacity(uint32 change_id, uint32 window_id, float opacity); + + // Attaches a Surface to a particular window. + AttachSurface(uint32 window_id, + SurfaceType type, + Surface& surface, + SurfaceClient client); + + // Reparents a window. + // This fails for any of the following reasons: + // . |parent| or |child| does not identify a valid window. + // . |child| is an ancestor of |parent|. + // . |child| is already a child of |parent|. + // + // This may result in a connection getting OnWindowDeleted(). See + // RemoveWindowFromParent for details. + AddWindow(uint32 change_id, uint32 parent, uint32 child); + + // Removes a window from its current parent. This fails if the window is not + // valid or the window already has no parent. + // + // Removing a window from a parent may result in OnWindowDeleted() being sent + // to other connections. For example, connection A has windows 1 and 2, with 2 + // a child of 1. Connection B has a root 1. If 2 is removed from 1 then B gets + // OnWindowDeleted(). This is done as window 2 is effectively no longer + // visible to connection B. + RemoveWindowFromParent(uint32 change_id, uint32 window_id); + + // Ties the lifetime of |transient_window_id| to the lifetime of |window_id|. + // This also places |transient_window_id| on top of |window_id|. + // This fails for any of the following reasons: + // . |window_id| or |transient_window_id| does not identify a valid window. + // . |transient_window_id| is an ancestor of |window_id|. + // . |transient_window_id| is modal to system. + AddTransientWindow(uint32 change_id, + uint32 window_id, + uint32 transient_window_id); + + // Decouples the lifetime of |transient_window_id| from its transient parent. + // This does not change transient window's position in the window hierarchy. + RemoveTransientWindowFromParent(uint32 change_id, uint32 transient_window_id); + + // Sets |window_id| to be modal. If the window has a transient parent, then + // the window is modal to the transient parent. Otherwise, the window is modal + // to the system. This releases capture if necessary. + // This fails for any of the following reasons: + // . |window_id| does not identify a valid window. + // . Client does not have a valid user id (i.e., it is an embedded app). + SetModal(uint32 change_id, uint32 window_id); + + // Reorders a window in its parent, relative to |relative_window_id| according + // to |direction|. Only the connection that created the window's parent can + // reorder its children. + ReorderWindow(uint32 change_id, + uint32 window_id, + uint32 relative_window_id, + OrderDirection direction); + + // Returns the windows comprising the tree starting at |window_id|. + // |window_id| is the first result in the return value, unless |window_id| is + // invalid, in which case an empty vector is returned. The windows are visited + // using a depth first search (pre-order). + GetWindowTree(uint32 window_id) => (array<WindowData> windows); + + // A connection may grant access to another connection by way of Embed(). + // Embed() results in the supplied WindowTreeClient being configured with a + // root window of |window_id|. The supplied WindowTreeClient may create child + // windows and do other various tree operations (including Embed()), but does + // not see nor have access to any of the windows above the embed point. + // + // The caller must have created |window_id|. If not the request fails and the + // response is false. + // + // The embedder can dictate the behaviour of the embedded client by setting + // the appropriate embed flags (e.g. kEmbedFlagEmbedderInterceptsEvents). + // + // When a connection embeds a WindowTreeClient the originating connection no + // longer has privileges to access or see any of the children of the window. + // If the window had existing children the children are removed. The + // WindowManager gets to see the whole tree. + // + // A window may only have one embedding in it at a time. Subsequent calls to + // Embed() for the same window result in the currently embedded + // WindowTreeClient being removed. The embedded app is told this by way of + // OnUnembed(), which is followed by OnWindowDeleted() (as the connection no + // longer has access to the window). + // + // The embedder can detect when the embedded app disconnects by way of + // OnEmbeddedAppDisconnected(). + // + // The callback returns whether the embedding was successful. + Embed(uint32 window_id, WindowTreeClient client, uint32 embed_flags) + => (bool success); + + // Sets focus to the specified window, use 0 to clear focus. For a window to + // get focus the following has to happen: the window is drawn, the window has + // been marked as focusable (see SetCanFocus()) and the window is in a + // container the WindowManager has identified as allowing activation + // (see WindowManagerClient::AddActivationParent()). + SetFocus(uint32 change_id, uint32 window_id); + + // Marks the specified window as being able to receive focus. + SetCanFocus(uint32 window_id, bool can_focus); + + // Sets the cursor when the pointer is inside |window_id| to a system standard + // cursor provided by the window manager. + SetPredefinedCursor(uint32 change_id, uint32 window_id, Cursor cursor_id); + + // TODO(erg): Additional cursor methods. Image based cursors, visibility, + // and cursor locking. + + // Set text input state for the given window. + SetWindowTextInputState(uint32 window_id, mojo.TextInputState state); + + // Set the input method editor UI (software keyboard, etc) visibility. + // If state is non-null, the specified window's text input state is updated. + // Otherwise the existing state is used. + SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state); + + // See documentation for WindowTreeClient::OnWindowInputEvent(). + OnWindowInputEventAck(uint32 event_id, EventResult result); + + // See description of WindowManager for details. + GetWindowManagerClient(associated WindowManagerClient& internal); + + // Returns a shared memory segment that contains two 16-bit ints packed into a + // single Atomic32, which represent the current location of the mouse cursor + // where the location is (x << 16) | y. + GetCursorLocationMemory() => (handle<shared_buffer> cursor_buffer); +}; + +// Changes to windows are not sent to the connection that originated the +// change. For example, if connection 1 changes the bounds of a window by +// calling SetWindowBounds(), connection 1 does not receive +// OnWindowBoundsChanged(). +interface WindowTreeClient { + // Invoked when the client application has been embedded at |root|. + // See Embed() on WindowTree for more details. |tree| will be a handle back to + // the window manager service, unless the connection is to the root connection + // in which case it will be null. |parent_drawn| is true if roots parent is + // drawn, see OnParentDrawnStateChanged() for details. |display_id| identifies + // the display this root window is on. + OnEmbed(uint16 connection_id, + WindowData root, + WindowTree? tree, + int64 display_id, + uint32 focused_window, + bool parent_drawn); + + // Invoked when the application embedded at |window| is disconnected. In other + // words the embedded app closes the connection to the server. This is called + // on the connection that created |window| as well as any ancestors that have + // the embed root policy. + OnEmbeddedAppDisconnected(uint32 window); + + // Sent when another connection is embedded in the Window this connection was + // previously embedded in. See Embed() for more information. + OnUnembed(uint32 window); + + // Sent when a window loses capture. + OnLostCapture(uint32 window); + + // Called in response to NewTopLevelWindow() successfully completing. + // |parent_drawn| is true if the parent of the window is drawn, see + // OnDrawnStateChanged() for details. |display_id| identifies the display this + // window is on. + OnTopLevelCreated(uint32 change_id, + WindowData data, + int64 display_id, + bool parent_drawn); + + // Invoked when a window's bounds have changed. + OnWindowBoundsChanged(uint32 window, + gfx.mojom.Rect old_bounds, + gfx.mojom.Rect new_bounds); + + OnClientAreaChanged(uint32 window_id, + gfx.mojom.Insets new_client_area, + array<gfx.mojom.Rect> new_additional_client_areas); + + OnTransientWindowAdded(uint32 window_id, + uint32 transient_window_id); + + OnTransientWindowRemoved(uint32 window_id, + uint32 transient_window_id); + + // Invoked when a change is done to the hierarchy. A value of 0 is used to + // identify a null window. For example, if the old_parent is NULL, 0 is + // supplied. + // |windows| contains any windows that are that the client has not been told + // about. This is not sent for hierarchy changes of windows not known to this + // client or not attached to the tree. + OnWindowHierarchyChanged(uint32 window, + uint32 old_parent, + uint32 new_parent, + array<WindowData> windows); + + // Invoked when the order of windows within a parent changes. + OnWindowReordered(uint32 window_id, + uint32 relative_window_id, + OrderDirection direction); + + // Invoked when a window is deleted. + OnWindowDeleted(uint32 window); + + // Invoked when the visibility of the specified window changes. + OnWindowVisibilityChanged(uint32 window, bool visible); + + // Invoked when the opacity of the specified window has changed. + OnWindowOpacityChanged(uint32 window, float old_opacity, float new_opacity); + + // Invoked when the drawn state of |window|'s parent changes. The drawn state + // is determined by the visibility of a Window and the Windows ancestors. A + // Window is drawn if all ancestors are visible, not drawn if any ancestor is + // hidden. + // + // The initial drawn state is communicated by way of OnTopLevelCreated() or + // OnEmbed(). + // + // This function is only called for root Windows as the drawn state of all + // other windows can be determined from their parent. + OnWindowParentDrawnStateChanged(uint32 window, bool drawn); + + // Invoked when a window property is changed. If this change is a removal, + // |new_data| is null. + OnWindowSharedPropertyChanged(uint32 window, + string name, + array<uint8>? new_data); + + // Invoked when an event is targeted at the specified window. The client must + // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify + // that the event has been processed, and with an EventResult value to notify + // if the event was consumed. |event_observer_id| is non-zero if the event + // also matched the active event observer for this client. The client will not + // receive farther events until the event is ack'ed. + OnWindowInputEvent(uint32 event_id, + uint32 window, + ui.mojom.Event event, + uint32 event_observer_id); + + // Invoked when an |event| is sent via the EventObserver and not targeted at a + // specific window. The |event_observer_id| is the one supplied to + // SetEventObserver. The client should not acknowledge these events. + OnEventObserved(ui.mojom.Event event, uint32 event_observer_id); + + // Called in two distinct cases: when a window known to the connection gains + // focus, or when focus moves from a window known to the connection to a + // window not known to the connection. In the later case |focused_window_id| + // is 0. As with other functions this is only called if the client did not + // initiate the change. + OnWindowFocused(uint32 focused_window_id); + + OnWindowPredefinedCursorChanged(uint32 window_id, Cursor cursor_id); + + // A change initiated from the client has completed. See description of + // change ids for details. + OnChangeCompleted(uint32 change_id, bool success); + + // The WindowManager is requesting the specified window to close. If the + // client allows the change it should delete the window. + RequestClose(uint32 window_id); + + // See description of WindowManager for details. + GetWindowManager(associated WindowManager& internal); +}; + +// Mus provides this interface as a way for clients to connect and obtain a +// WindowTree handle with a supplied WindowTreeClient handle. The +// WindowTreeClient has no roots, use NewTopLevelWindow() to create one. +interface WindowTreeFactory { + CreateWindowTree(WindowTree& tree_request, WindowTreeClient client); +}; diff --git a/chromium/components/mus/public/interfaces/window_tree_constants.mojom b/chromium/components/mus/public/interfaces/window_tree_constants.mojom new file mode 100644 index 00000000000..c8e1c689510 --- /dev/null +++ b/chromium/components/mus/public/interfaces/window_tree_constants.mojom @@ -0,0 +1,57 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "ui/gfx/geometry/mojo/geometry.mojom"; + +// Contains state of a single window. +struct WindowData { + // Unique identifier of the parent. If the client can not see the parent an + // id of 0 is supplied. + uint32 parent_id; + + // Unique identifier of the window. + uint32 window_id; + + gfx.mojom.Rect bounds; + + // Arbitrary key/value pairs. The interpretation of these is left to the + // client. See SetWindowProperty() for more information. + map<string, array<uint8>> properties; + + // True if this window is visible. The window may not be drawn on screen (see + // OnWindowParentDrawnStateChanged() for details). + bool visible; +}; + +// Each Window has support for two surfaces. Generally the |DEFAULT| surface +// is used. The |UNDERLAY| surface is useful if the owner of a window wants to +// to Embed() another client and at the same time draw something under the +// embedded apps representation. +enum SurfaceType { + // Only the owner of a window may obtain this surface. + // The window manager can change the offset of this by way of + // SetUnderlaySurfaceOffsetAndExtendedHitArea(). + UNDERLAY, + + // Only the embedded app may obtain this surface. If an app is not embedded + // in the Window than the owner may also render to this surface as well. + DEFAULT, +}; + +// The result of an input event sent to a client app. +enum EventResult { + HANDLED, + UNHANDLED, +}; + +// When this flag is set in a call to Embed(), the embedder (i.e. the client +// that is making the call to Embed()) will receive events that are targeted to +// the embedded client. The embedded client will not receive any input events +// from the window server. However, the embedder can choose to dispatch events +// to the embedded client through other mechanism. +// TODO(sad): Provide an API in mus for the embedder to dispatch events to the +// embedded client. https://crbug.com/621085 +const uint32 kEmbedFlagEmbedderInterceptsEvents = 0x01; diff --git a/chromium/components/mus/public/interfaces/window_tree_host.mojom b/chromium/components/mus/public/interfaces/window_tree_host.mojom new file mode 100644 index 00000000000..4c61eb9a1ce --- /dev/null +++ b/chromium/components/mus/public/interfaces/window_tree_host.mojom @@ -0,0 +1,25 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mus.mojom; + +import "components/mus/public/interfaces/window_tree.mojom"; +import "ui/gfx/geometry/mojo/geometry.mojom"; + +// WindowTreeHost encapsulates a unique underlying platform window, with a tree +// of windows. +interface WindowTreeHost { + // Sets the size of the platform window. + SetSize(gfx.mojom.Size size); + + // Sets a title string to be displayed on the platform window. + SetTitle(string title); +}; + +interface WindowTreeHostFactory { + // Creates a new WindowTreeHost. |tree_client| is queried for the + // WindowManager. + CreateWindowTreeHost(WindowTreeHost& window_tree_host, + WindowTreeClient tree_client); +}; diff --git a/chromium/components/mus/surfaces/BUILD.gn b/chromium/components/mus/surfaces/BUILD.gn new file mode 100644 index 00000000000..95270535660 --- /dev/null +++ b/chromium/components/mus/surfaces/BUILD.gn @@ -0,0 +1,51 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") + +source_set("surfaces") { + sources = [ + "direct_output_surface.cc", + "direct_output_surface.h", + "display_compositor.cc", + "display_compositor.h", + "surfaces_context_provider.cc", + "surfaces_context_provider.h", + "surfaces_context_provider_delegate.h", + "surfaces_state.cc", + "surfaces_state.h", + ] + + deps = [ + "//base", + "//cc", + "//cc/surfaces", + "//cc/surfaces:surface_id", + "//components/display_compositor", + "//components/mus/common:mus_common", + "//components/mus/gles2", + "//components/mus/gpu", + "//components/mus/public/interfaces", + "//gpu/command_buffer/client", + "//gpu/command_buffer/client:gles2_cmd_helper", + "//gpu/command_buffer/client:gles2_implementation", + "//gpu/command_buffer/client:gles2_interface", + "//gpu/ipc/client", + "//services/shell/public/cpp", + "//services/tracing/public/cpp", + "//ui/gfx", + "//ui/gfx/geometry/mojo", + "//ui/gl", + ] + + if (use_ozone) { + sources += [ + "direct_output_surface_ozone.cc", + "direct_output_surface_ozone.h", + "ozone_gpu_memory_buffer_manager.cc", + "ozone_gpu_memory_buffer_manager.h", + ] + deps += [ "//gpu/command_buffer/common" ] + } +} diff --git a/chromium/components/mus/test_wm/BUILD.gn b/chromium/components/mus/test_wm/BUILD.gn new file mode 100644 index 00000000000..92c2c9292f8 --- /dev/null +++ b/chromium/components/mus/test_wm/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") + +mojo_native_application("test_wm") { + sources = [ + "test_wm.cc", + ] + + deps = [ + "//base", + "//components/mus/public/cpp", + "//components/mus/public/interfaces", + "//services/shell/public/cpp", + "//ui/display/mojo", + "//ui/gfx/geometry/mojo", + ] + + data_deps = [ + ":manifest", + "//components/mus", + ] +} + +mojo_application_manifest("manifest") { + application_name = "test_wm" + source = "manifest.json" +} diff --git a/chromium/components/mus/ws/BUILD.gn b/chromium/components/mus/ws/BUILD.gn new file mode 100644 index 00000000000..4a7ccd1063f --- /dev/null +++ b/chromium/components/mus/ws/BUILD.gn @@ -0,0 +1,254 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//testing/test.gni") +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") + +source_set("lib") { + sources = [ + "accelerator.cc", + "accelerator.h", + "access_policy.h", + "access_policy_delegate.h", + "animation_runner.cc", + "animation_runner.h", + "animation_runner_observer.h", + "default_access_policy.cc", + "default_access_policy.h", + "display.cc", + "display.h", + "display_binding.cc", + "display_binding.h", + "display_manager.cc", + "display_manager.h", + "display_manager_delegate.h", + "event_dispatcher.cc", + "event_dispatcher.h", + "event_dispatcher_delegate.h", + "event_matcher.cc", + "event_matcher.h", + "focus_controller.cc", + "focus_controller.h", + "focus_controller_delegate.h", + "focus_controller_observer.h", + "modal_window_controller.cc", + "modal_window_controller.h", + "operation.cc", + "operation.h", + "platform_display.cc", + "platform_display.h", + "platform_display_delegate.h", + "platform_display_factory.h", + "platform_display_init_params.cc", + "platform_display_init_params.h", + "platform_screen.h", + "platform_screen_impl.cc", + "platform_screen_impl.h", + "scheduled_animation_group.cc", + "scheduled_animation_group.h", + "server_window.cc", + "server_window.h", + "server_window_delegate.h", + "server_window_drawn_tracker.cc", + "server_window_drawn_tracker.h", + "server_window_drawn_tracker_observer.h", + "server_window_observer.h", + "server_window_surface.cc", + "server_window_surface.h", + "server_window_surface_manager.cc", + "server_window_surface_manager.h", + "server_window_tracker.h", + "touch_controller.cc", + "touch_controller.h", + "user_activity_monitor.cc", + "user_activity_monitor.h", + "user_display_manager.cc", + "user_display_manager.h", + "user_id.h", + "user_id_tracker.cc", + "user_id_tracker.h", + "user_id_tracker_observer.h", + "window_coordinate_conversions.cc", + "window_coordinate_conversions.h", + "window_finder.cc", + "window_finder.h", + "window_manager_access_policy.cc", + "window_manager_access_policy.h", + "window_manager_display_root.cc", + "window_manager_display_root.h", + "window_manager_state.cc", + "window_manager_state.h", + "window_manager_window_tree_factory.cc", + "window_manager_window_tree_factory.h", + "window_manager_window_tree_factory_set.cc", + "window_manager_window_tree_factory_set.h", + "window_manager_window_tree_factory_set_observer.h", + "window_server.cc", + "window_server.h", + "window_server_delegate.cc", + "window_server_delegate.h", + "window_tree.cc", + "window_tree.h", + "window_tree_binding.cc", + "window_tree_binding.h", + "window_tree_factory.cc", + "window_tree_factory.h", + "window_tree_host_factory.cc", + "window_tree_host_factory.h", + ] + + public_deps = [ + "//base", + "//cc", + "//cc/ipc:interfaces", + "//cc/surfaces", + "//cc/surfaces:surface_id", + "//components/mus/common:mus_common", + "//components/mus/gles2", + "//components/mus/public/interfaces", + "//components/mus/surfaces", + "//mojo/common:common_base", + "//mojo/public/cpp/bindings", + "//services/shell/public/cpp", + "//services/shell/public/interfaces", + "//services/tracing/public/cpp", + "//ui/base", + "//ui/display", + "//ui/events", + "//ui/events/devices", + "//ui/events/platform", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gfx/geometry/mojo", + "//ui/gl", + "//ui/platform_window", + "//ui/platform_window:platform_impls", + "//ui/platform_window/mojo", + ] + + if (use_ozone) { + sources -= [ + "platform_screen_impl.cc", + "platform_screen_impl.h", + ] + sources += [ + "platform_screen_impl_ozone.cc", + "platform_screen_impl_ozone.h", + ] + public_deps += [ "//ui/ozone:ozone" ] + } +} + +source_set("test_interface") { + sources = [ + "window_server_test_impl.cc", + "window_server_test_impl.h", + ] + + deps = [ + ":lib", + "//components/mus/public/interfaces", + "//mojo/public/cpp/bindings:bindings", + "//ui/gfx", + ] +} + +source_set("test_support") { + testonly = true + + sources = [ + "test_change_tracker.cc", + "test_change_tracker.h", + ] + + deps = [ + "//base", + "//components/mus/common:mus_common", + "//components/mus/public/cpp", + "//components/mus/public/interfaces", + "//mojo/common", + "//mojo/public/cpp/bindings:bindings", + "//ui/gfx/geometry/mojo", + ] +} + +group("tests") { + testonly = true + deps = [ + ":mus_ws_unittests", + ] + if (!is_android) { + deps += [ "//components/mus/public/cpp/tests:mus_public_unittests" ] + } +} + +test("mus_ws_unittests") { + sources = [ + "animation_runner_unittest.cc", + "cursor_unittest.cc", + "display_unittest.cc", + "event_dispatcher_unittest.cc", + "event_matcher_unittest.cc", + "focus_controller_unittest.cc", + "scheduled_animation_group_unittest.cc", + "server_window_drawn_tracker_unittest.cc", + "server_window_surface_manager_test_api.cc", + "server_window_surface_manager_test_api.h", + "test_server_window_delegate.cc", + "test_server_window_delegate.h", + "test_utils.cc", + "test_utils.h", + "transient_windows_unittest.cc", + "user_activity_monitor_unittest.cc", + "user_display_manager_unittest.cc", + "window_coordinate_conversions_unittest.cc", + "window_finder_unittest.cc", + "window_manager_client_unittest.cc", + "window_manager_state_unittest.cc", + "window_tree_client_unittest.cc", + "window_tree_unittest.cc", + ] + + deps = [ + ":lib", + ":test_support", + "//base", + "//base/test:test_config", + "//base/test:test_support", + "//cc:cc", + "//components/mus/common:mus_common", + "//components/mus/public/cpp", + "//components/mus/public/cpp/tests:test_support", + "//components/mus/public/interfaces", + "//components/mus/surfaces", + "//mojo/public/cpp/bindings:bindings", + "//services/shell/public/cpp:shell_test_support", + "//services/shell/public/cpp:sources", + "//services/shell/public/cpp/test:run_all_shelltests", + "//services/shell/public/interfaces", + "//testing/gtest", + "//third_party/mesa:osmesa", + "//ui/events", + "//ui/gfx", + "//ui/gfx:test_support", + "//ui/gfx/geometry", + "//ui/gfx/geometry/mojo", + "//ui/gl", + ] + + if (use_x11) { + deps += [ "//tools/xdisplaycheck" ] + } + + data_deps = [ + ":mus_ws_unittests_app_manifest", + ] +} + +mojo_application_manifest("mus_ws_unittests_app_manifest") { + application_name = "mus_ws_unittests_app" + source = "mus_ws_unittests_app_manifest.json" +} diff --git a/chromium/components/nacl/broker/BUILD.gn b/chromium/components/nacl/broker/BUILD.gn new file mode 100644 index 00000000000..a2fa9a670db --- /dev/null +++ b/chromium/components/nacl/broker/BUILD.gn @@ -0,0 +1,164 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +# This file builds nacl64.exe, which is a 64-bit x86 Windows executable +# used only in the 32-bit x86 Windows build. The :broker code runs both +# in nacl64.exe and in the 32-bit chrome executable, to launch +# nacl64.exe and communicate with it. + +assert(enable_nacl) +assert(is_win) +assert(target_cpu == "x86") + +source_set("broker") { + sources = [ + "nacl_broker_listener.cc", + "nacl_broker_listener.h", + ] + + deps = [ + "//base", + "//components/nacl/common:debug_exception_handler", + "//components/nacl/common:minimal", + "//components/nacl/common:switches", + "//content/public/common:static_switches", + "//ipc", + "//sandbox", + ] + + if (current_cpu == target_cpu) { + deps += [ "//content/public/common" ] + } else { + deps += [ ":content_dummy" ] + } +} + +# This exists just to make 'gn check' happy with :broker. It can't depend +# on //content/public/common or anything like that, because that would +# bring in lots more stuff that should not be in the nacl64.exe build. +source_set("content_dummy") { + check_includes = false + sources = [ + "//content/public/common/sandbox_init.h", + "//content/public/common/sandboxed_process_launcher_delegate.h", + ] +} + +if (current_cpu == "x86") { + # Tests, packaging rules, etc. will expect to find nacl64.exe in the root + # of the output directory. It gets built in a non-default toolchain and + # so will be delivered in the toolchain output subdirectory. So this + # just copies it to the expected place. Having this target also makes + # it simpler for things to depend on nacl64, since they don't have to + # use a toolchain qualifier. + copy("nacl64") { + # NOTE: This must match what //build/config/BUILDCONFIG.gn uses + # as default toolchain for the corresponding x64 build. + if (is_clang) { + x64_toolchain = "//build/toolchain/win:clang_nacl_win64" + } else { + x64_toolchain = "//build/toolchain/win:nacl_win64" + } + nacl64_label = ":nacl64($x64_toolchain)" + nacl64_out_dir = get_label_info(nacl64_label, "root_out_dir") + sources = [ + "$nacl64_out_dir/nacl64.exe", + ] + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] + deps = [ + nacl64_label, + ] + } +} else if (current_cpu == "x64") { + # In the x64 toolchain context, build nacl64.exe for real. + executable("nacl64") { + configs += [ "//build/config/win:windowed" ] + + # //build/config/compiler:optimize{,_max} adds this for official builds + # only, as it only reduces binary size and is not necessary for + # correctness. But for nacl64.exe, it makes more than a six-fold + # difference in the binary size, so always use it in release builds. + # Note that using this flag disables incremental linking. In debug + # builds, incremental rebuild time is usually of more concern than + # binary size, so incremental linking is preferable to size reduction. + if (!is_debug) { + ldflags = [ "/OPT:REF" ] + } + + sources = [ + "//chrome/nacl/nacl_exe_win_64.cc", + ] + + deps = [ + ":broker", + ":nacl64_content", + ":nacl64_crash_reporter_client", + "//base", + "//breakpad:breakpad_handler", + "//build/win:default_exe_manifest", + "//chrome:nacl64_exe_version", + "//components/crash/content/app:app_breakpad_mac_win_to_be_deleted", + "//components/nacl/loader:nacl_helper_win_64", + "//content/public/common:static_switches", + "//ppapi/proxy:ipc", + "//sandbox", + ] + } + + # This is a tiny subset of //content built specially for nacl64.exe. + # There are no subcomponents of //content small enough to get just + # what nacl64.exe needs without bringing in other stuff that causes + # problems for the build. + source_set("nacl64_content") { + sources = [ + "//content/app/sandbox_helper_win.cc", + "//content/common/sandbox_init_win.cc", + "//content/common/sandbox_win.cc", + "//content/public/common/sandboxed_process_launcher_delegate.cc", + ] + + defines = [ + "COMPILE_CONTENT_STATICALLY", + "NACL_WIN64", + ] + + # This defangs 'gn check', which does not like this cherry-picking. + # All the source files here are part of other proper components + # under //content, where their #include discipline will be checked. + check_includes = false + + deps = [ + "//base", + "//content/public/common:static_switches", + "//sandbox", + ] + } + + source_set("nacl64_crash_reporter_client") { + sources = [ + "//chrome/app/chrome_crash_reporter_client_win.cc", + "//chrome/common/crash_keys.cc", + ] + + defines = [ "NACL_WIN64" ] + + check_includes = false + + deps = [ + "//chrome/common:constants", + "//chrome/install_static:install_static_util", + "//chrome/installer/util:with_no_strings", + "//components/browser_watcher:browser_watcher_client", + "//components/flags_ui:switches", + "//components/policy", + "//content/public/common:static_switches", + "//ipc", + "//third_party/kasko", + ] + } +} diff --git a/chromium/components/nacl/browser/BUILD.gn b/chromium/components/nacl/browser/BUILD.gn new file mode 100644 index 00000000000..6336573e1ca --- /dev/null +++ b/chromium/components/nacl/browser/BUILD.gn @@ -0,0 +1,93 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +assert(enable_nacl) + +source_set("browser") { + sources = [ + "bad_message.cc", + "bad_message.h", + "nacl_broker_host_win.cc", + "nacl_broker_host_win.h", + "nacl_broker_service_win.cc", + "nacl_broker_service_win.h", + "nacl_browser.cc", + "nacl_browser.h", + "nacl_file_host.cc", + "nacl_file_host.h", + "nacl_host_message_filter.cc", + "nacl_host_message_filter.h", + "nacl_process_host.cc", + "nacl_process_host.h", + "nacl_validation_cache.cc", + "nacl_validation_cache.h", + "pnacl_host.cc", + "pnacl_host.h", + "pnacl_translation_cache.cc", + "pnacl_translation_cache.h", + ] + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//components/nacl/common", + "//components/nacl/common:debug_exception_handler", + "//components/url_formatter", + "//content/public/browser", + "//content/public/common", + "//ipc", + "//native_client/src/trusted/service_runtime:sel_main_chrome", + "//net", + "//ppapi/host", + "//ppapi/proxy:ipc", + "//ppapi/shared_impl", + ] + + data_deps = [] + + if (is_linux) { + sources += [ + "../zygote/nacl_fork_delegate_linux.cc", + "../zygote/nacl_fork_delegate_linux.h", + ] + + deps += [ + "//components/nacl/loader:nacl_helper_integration", + "//sandbox/linux:sandbox_services", + "//sandbox/linux:suid_sandbox_client", + ] + + data_deps += [ "//components/nacl/loader:helper_nonsfi" ] + } + + if (is_win && current_cpu == "x86") { + data_deps += [ "//components/nacl/broker:nacl64" ] + } +} + +source_set("unit_tests") { + testonly = true + sources = [ + "nacl_file_host_unittest.cc", + "nacl_process_host_unittest.cc", + "nacl_validation_cache_unittest.cc", + "pnacl_host_unittest.cc", + "pnacl_translation_cache_unittest.cc", + "test_nacl_browser_delegate.cc", + ] + + deps = [ + ":browser", + "//base", + "//components/nacl/common", + "//content/test:test_support", + "//net:test_support", + ] + + if (is_linux) { + sources += [ "../zygote/nacl_fork_delegate_linux_unittest.cc" ] + } +} diff --git a/chromium/components/nacl/common/BUILD.gn b/chromium/components/nacl/common/BUILD.gn new file mode 100644 index 00000000000..f1822b36782 --- /dev/null +++ b/chromium/components/nacl/common/BUILD.gn @@ -0,0 +1,113 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +if (enable_nacl) { + # This is separate so it can be used by ../broker:nacl64. + source_set("minimal") { + sources = [ + "nacl_cmd_line.cc", + "nacl_cmd_line.h", + "nacl_constants.cc", + "nacl_constants.h", + "nacl_messages.cc", + "nacl_messages.h", + "nacl_process_type.h", + "nacl_renderer_messages.cc", + "nacl_renderer_messages.h", + "nacl_sandbox_type.h", + "nacl_types.cc", + "nacl_types.h", + "nacl_types_param_traits.cc", + "nacl_types_param_traits.h", + ] + + public_deps = [ + ":switches", + ] + + deps = [ + ":minimal_content_dummy", + "//base", + "//base:base_static", + "//ipc", + ] + } + + # This exists just to make 'gn check' happy with :minimal. It can't + # depend on //content/public/common or anything like that, because that + # would bring in lots more than counts as "minimal" (stuff that should + # not be in the nacl64.exe build). + source_set("minimal_content_dummy") { + check_includes = false + sources = [ + "//content/public/common/content_switches.h", + "//content/public/common/process_type.h", + "//content/public/common/sandbox_type.h", + ] + } + + source_set("common") { + sources = [ + "nacl_host_messages.cc", + "nacl_host_messages.h", + "nacl_nonsfi_util.cc", + "nacl_nonsfi_util.h", + "pnacl_types.cc", + "pnacl_types.h", + ] + + public_deps = [ + ":minimal", + ":switches", + ] + + deps = [ + "//base", + "//content/public/common", + "//ipc", + "//url", + ] + + if (is_linux) { + sources += [ + "nacl_paths.cc", + "nacl_paths.h", + ] + + defines = [ "__STDC_LIMIT_MACROS=1" ] + } + } + + source_set("debug_exception_handler") { + sources = [ + "nacl_debug_exception_handler_win.cc", + "nacl_debug_exception_handler_win.h", + ] + + deps = [ + "//base", + ] + } +} + +# Depending on this allows targets to unconditionally include +# nacl_process_type.h without testing whether nacl is enabled. +source_set("process_type") { + public = [ + "nacl_process_type.h", + ] + + deps = [ + "//content/public/common", + ] +} + +source_set("switches") { + sources = [ + "nacl_switches.cc", + "nacl_switches.h", + ] +} diff --git a/chromium/components/nacl/loader/BUILD.gn b/chromium/components/nacl/loader/BUILD.gn new file mode 100644 index 00000000000..4f394d32586 --- /dev/null +++ b/chromium/components/nacl/loader/BUILD.gn @@ -0,0 +1,287 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/nacl/config.gni") +import("//testing/test.gni") + +assert(enable_nacl) + +# This is separate so it can be used by ../broker:nacl64. +source_set("minimal") { + sources = [ + "nacl_ipc_adapter.cc", + "nacl_ipc_adapter.h", + "nacl_listener.cc", + "nacl_listener.h", + "nacl_main.cc", + "nacl_main_platform_delegate.h", + "nacl_main_platform_delegate_linux.cc", + "nacl_main_platform_delegate_mac.mm", + "nacl_main_platform_delegate_win.cc", + "nacl_trusted_listener.cc", + "nacl_trusted_listener.h", + "nacl_validation_db.h", + "nacl_validation_query.cc", + "nacl_validation_query.h", + ] + + deps = [ + ":minimal_content_dummy", + "//base", + "//components/nacl/common:minimal", + "//crypto", + "//ipc", + "//mojo/edk/system", + "//native_client/src/trusted/service_runtime:sel_main_chrome", + "//ppapi/c", + "//ppapi/proxy:ipc", + "//sandbox", + ] +} + +# This exists just to make 'gn check' happy with :minimal and +# :nacl_helper_win_64 (below). They can't depend on //content/public/common +# or anything like that, because that would bring in lots more than counts +# as "minimal" (stuff that should not be in the nacl64.exe build). +source_set("minimal_content_dummy") { + check_includes = false + sources = [ + "//content/public/common/child_process_sandbox_support_linux.h", + "//content/public/common/content_switches.h", + "//content/public/common/main_function_params.h", + "//content/public/common/sandbox_init.h", + ] +} + +source_set("loader") { + public_deps = [ + ":minimal", + ] + deps = [ + "//components/nacl/common", + "//content/public/common", + "//ppapi/shared_impl", + ] + + data_deps = [ + "//ppapi/native_client:irt", + "//ppapi/native_client/src/untrusted/pnacl_support_extension", + ] +} + +test("nacl_loader_unittests") { + sources = [ + "nacl_ipc_adapter_unittest.cc", + "nacl_validation_query_unittest.cc", + "run_all_unittests.cc", + ] + + deps = [ + ":loader", + "//base/test:test_support", + "//ipc:test_support", + "//ppapi/c", + "//testing/gtest", + ] + + if (is_nacl_nonsfi) { + sources += [ + # TODO(hamaji): Currently, we build them twice. Stop building + # them for components_unittests. See crbug.com/364751 + "nonsfi/nonsfi_sandbox_sigsys_unittest.cc", + "nonsfi/nonsfi_sandbox_unittest.cc", + ] + + deps += [ + ":nacl_linux", + "//sandbox/linux:sandbox_linux_test_utils", + ] + } +} + +if (is_linux) { + executable("nacl_helper") { + sources = [ + "nacl_helper_linux.cc", + "nacl_helper_linux.h", + ] + + deps = [ + ":loader", + "//base", + "//build/config/sanitizers:deps_no_options", + "//components/nacl/common:switches", + "//components/nacl/loader/sandbox_linux", + "//content/public/common", + "//crypto", + "//ipc", + "//mojo/edk/system", + "//sandbox/linux:sandbox_services", + "//url/ipc:url_ipc", + ] + + cflags = [ "-fPIE" ] + + ldflags = [ "-pie" ] + + data_deps = [ + "//native_client/src/trusted/service_runtime/linux:bootstrap", + ] + } + + # For setting up nacl_helper. + source_set("nacl_helper_integration") { + public = [ + "nacl_helper_linux.h", + ] + data_deps = [ + ":nacl_helper", + ] + } + + test("nacl_helper_nonsfi_unittests") { + sources = [ + "nonsfi/nacl_helper_nonsfi_unittests.cc", + ] + deps = [ + "//base", + "//base/test:test_launcher_nacl_nonsfi", + ] + data_deps = [ + ":nacl_helper_nonsfi_unittests_main_copy(//build/toolchain/nacl:newlib_pnacl_nonsfi)", + ] + } + + group("helper_nonsfi") { + data_deps = [ + ":nacl_helper_nonsfi_copy(//build/toolchain/nacl:newlib_pnacl_nonsfi)", + ] + } +} + +if (is_win && target_cpu == "x86" && current_cpu == "x64") { + source_set("nacl_helper_win_64") { + sources = [ + "nacl_helper_win_64.cc", + "nacl_helper_win_64.h", + ] + + deps = [ + ":minimal", + ":minimal_content_dummy", + "//base", + "//components/nacl/broker", + "//components/nacl/common:switches", + "//content/public/common:static_switches", + "//sandbox", + ] + } +} + +if (is_nacl_nonsfi) { + executable("nacl_helper_nonsfi_nexe") { + output_name = "nacl_helper_nonsfi" + set_sources_assignment_filter([]) + sources = [ + # TODO(brettw) can this just depend on //components/nacl/common? + "../common/nacl_messages.cc", + "../common/nacl_messages.h", + "../common/nacl_types.cc", + "../common/nacl_types.h", + "../common/nacl_types_param_traits.cc", + "../common/nacl_types_param_traits.h", + "nacl_helper_linux.cc", + "nacl_helper_linux.h", + "nacl_trusted_listener.cc", + "nacl_trusted_listener.h", + "nonsfi/nonsfi_listener.cc", + "nonsfi/nonsfi_listener.h", + "nonsfi/nonsfi_main.cc", + "nonsfi/nonsfi_main.h", + ] + deps = [ + ":nacl_helper_nonsfi_sandbox", + "//base", + "//components/nacl/common:switches", + "//components/tracing", + "//content", + "//ipc", + "//mojo/edk/system", + "//native_client/src/nonsfi/irt:nacl_sys_private", + "//native_client/src/nonsfi/loader:elf_loader", + + # Normally libnacl is included implicitly by libc and is part of the + # toolchain. But //build/config/nacl:compiler uses -nodefaultlibs and so + # omits the default libnacl. When the nonsfi toolchain is more complete + # and that kludge is no longer required, this dependency should be + # removed. + "//native_client/src/untrusted/nacl", + "//ppapi/proxy", + "//sandbox/linux:sandbox", + ] + } + + source_set("nacl_helper_nonsfi_sandbox") { + set_sources_assignment_filter([]) + sources = [ + "nonsfi/nonsfi_sandbox.cc", + "nonsfi/nonsfi_sandbox.h", + "sandbox_linux/nacl_sandbox_linux.cc", + "sandbox_linux/nacl_sandbox_linux.h", + ] + deps = [ + "//base", + "//components/nacl/common:switches", + "//content", + "//sandbox/linux:sandbox", + "//sandbox/linux:sandbox_services_headers", + ] + } + + copy("nacl_helper_nonsfi_copy") { + sources = [ + "${root_out_dir}/nacl_helper_nonsfi", + ] + outputs = [ + "${root_build_dir}/{{source_file_part}}", + ] + deps = [ + ":nacl_helper_nonsfi_nexe", + ] + } + + test("nacl_helper_nonsfi_unittests_main") { + sources = [ + "nonsfi/nonsfi_sandbox_sigsys_unittest.cc", + "nonsfi/nonsfi_sandbox_unittest.cc", + "nonsfi/run_all_unittests.cc", + ] + deps = [ + ":nacl_helper_nonsfi_sandbox", + "//base", + "//base/test:test_support", + "//content", + "//native_client/src/nonsfi/irt:nacl_sys_private", + "//native_client/src/untrusted/nacl:nacl", + "//sandbox/linux:sandbox", + "//sandbox/linux:sandbox_linux_test_utils", + "//sandbox/linux:sandbox_services_headers", + "//testing/gtest", + ] + } + + copy("nacl_helper_nonsfi_unittests_main_copy") { + testonly = true + sources = [ + "${root_out_dir}/nacl_helper_nonsfi_unittests_main", + ] + outputs = [ + "${root_build_dir}/{{source_file_part}}", + ] + deps = [ + ":nacl_helper_nonsfi_unittests_main", + ] + } +} diff --git a/chromium/components/nacl/loader/sandbox_linux/BUILD.gn b/chromium/components/nacl/loader/sandbox_linux/BUILD.gn new file mode 100644 index 00000000000..ce1d40447ff --- /dev/null +++ b/chromium/components/nacl/loader/sandbox_linux/BUILD.gn @@ -0,0 +1,37 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") + +assert(is_linux) +assert(enable_nacl) + +source_set("sandbox_linux") { + sources = [ + "nacl_bpf_sandbox_linux.cc", + "nacl_sandbox_linux.cc", + ] + + defines = [ "IN_NACL_HELPER=1" ] + + deps = [ + "//base", + "//components/nacl/common", + "//components/nacl/loader", + "//content/public/common", + "//crypto", + "//ipc", + "//sandbox", + "//sandbox/linux:sandbox_services_headers", + ] + + if (use_glib) { + configs += [ "//build/config/linux:glib" ] + } + + if (use_seccomp_bpf) { + defines += [ "USE_SECCOMP_BPF" ] + } +} diff --git a/chromium/components/nacl/renderer/BUILD.gn b/chromium/components/nacl/renderer/BUILD.gn new file mode 100644 index 00000000000..9a1ac38a812 --- /dev/null +++ b/chromium/components/nacl/renderer/BUILD.gn @@ -0,0 +1,49 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +assert(enable_nacl) + +source_set("renderer") { + sources = [ + "file_downloader.cc", + "file_downloader.h", + "histogram.cc", + "histogram.h", + "json_manifest.cc", + "json_manifest.h", + "manifest_downloader.cc", + "manifest_downloader.h", + "manifest_service_channel.cc", + "manifest_service_channel.h", + "nacl_helper.cc", + "nacl_helper.h", + "nexe_load_manager.cc", + "nexe_load_manager.h", + "platform_info.cc", + "platform_info.h", + "pnacl_translation_resource_host.cc", + "pnacl_translation_resource_host.h", + "ppb_nacl_private_impl.cc", + "progress_event.cc", + "progress_event.h", + "trusted_plugin_channel.cc", + "trusted_plugin_channel.h", + ] + + deps = [ + "//base", + "//components/nacl/common", + "//components/nacl/renderer/plugin:nacl_trusted_plugin", + "//content/public/common", + "//content/public/renderer", + "//ipc", + "//net", + "//ppapi/c", + "//ppapi/proxy:ipc", + "//ppapi/shared_impl", + "//third_party/WebKit/public:blink", + ] +} diff --git a/chromium/components/nacl/renderer/plugin/BUILD.gn b/chromium/components/nacl/renderer/plugin/BUILD.gn new file mode 100644 index 00000000000..8f8d6206214 --- /dev/null +++ b/chromium/components/nacl/renderer/plugin/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("nacl_trusted_plugin") { + sources = [ + "module_ppapi.cc", + "nacl_subprocess.cc", + "plugin.cc", + "pnacl_coordinator.cc", + "pnacl_resources.cc", + "pnacl_translate_thread.cc", + "ppapi_entrypoints.cc", + "service_runtime.cc", + ] + + deps = [ + "//base", + "//content/public/common", + "//media:shared_memory_support", + "//ppapi/c", + "//ppapi/cpp:objects", + "//ppapi/cpp/private:internal_module", + "//ppapi/proxy:ipc", + ] +} diff --git a/chromium/components/omnibox/browser/BUILD.gn b/chromium/components/omnibox/browser/BUILD.gn new file mode 100644 index 00000000000..c5d59b1c643 --- /dev/null +++ b/chromium/components/omnibox/browser/BUILD.gn @@ -0,0 +1,264 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +if (is_android) { + import("//build/config/android/rules.gni") +} + +source_set("browser") { + sources = [ + "answers_cache.cc", + "answers_cache.h", + "autocomplete_classifier.cc", + "autocomplete_classifier.h", + "autocomplete_controller.cc", + "autocomplete_controller.h", + "autocomplete_controller_delegate.h", + "autocomplete_input.cc", + "autocomplete_input.h", + "autocomplete_match.cc", + "autocomplete_match.h", + "autocomplete_match_type.cc", + "autocomplete_match_type.h", + "autocomplete_provider.cc", + "autocomplete_provider.h", + "autocomplete_result.cc", + "autocomplete_result.h", + "autocomplete_scheme_classifier.h", + "base_search_provider.cc", + "base_search_provider.h", + "bookmark_provider.cc", + "bookmark_provider.h", + "builtin_provider.cc", + "builtin_provider.h", + "clipboard_url_provider.cc", + "clipboard_url_provider.h", + "history_provider.cc", + "history_provider.h", + "history_quick_provider.cc", + "history_quick_provider.h", + "history_url_provider.cc", + "history_url_provider.h", + "in_memory_url_index.cc", + "in_memory_url_index.h", + "in_memory_url_index_types.cc", + "in_memory_url_index_types.h", + "keyword_extensions_delegate.cc", + "keyword_extensions_delegate.h", + "keyword_provider.cc", + "keyword_provider.h", + "match_compare.h", + "omnibox_client.h", + "omnibox_controller.cc", + "omnibox_controller.h", + "omnibox_edit_controller.cc", + "omnibox_edit_controller.h", + "omnibox_edit_model.cc", + "omnibox_edit_model.h", + "omnibox_event_global_tracker.cc", + "omnibox_event_global_tracker.h", + "omnibox_field_trial.cc", + "omnibox_field_trial.h", + "omnibox_log.cc", + "omnibox_log.h", + "omnibox_metrics_provider.cc", + "omnibox_metrics_provider.h", + "omnibox_navigation_observer.h", + "omnibox_popup_model.cc", + "omnibox_popup_model.h", + "omnibox_popup_model_observer.h", + "omnibox_popup_view.h", + "omnibox_pref_names.cc", + "omnibox_pref_names.h", + "omnibox_switches.cc", + "omnibox_switches.h", + "omnibox_view.cc", + "omnibox_view.h", + "scored_history_match.cc", + "scored_history_match.h", + "search_provider.cc", + "search_provider.h", + "search_suggestion_parser.cc", + "search_suggestion_parser.h", + "shortcuts_backend.cc", + "shortcuts_backend.h", + "shortcuts_constants.cc", + "shortcuts_constants.h", + "shortcuts_database.cc", + "shortcuts_database.h", + "shortcuts_provider.cc", + "shortcuts_provider.h", + "suggestion_answer.cc", + "suggestion_answer.h", + "url_index_private_data.cc", + "url_index_private_data.h", + "url_prefix.cc", + "url_prefix.h", + "verbatim_match.cc", + "verbatim_match.h", + "zero_suggest_provider.cc", + "zero_suggest_provider.h", + ] + + public_deps = [ + "//components/history/core/browser", + "//components/metrics/proto", + "//components/omnibox/common", + ] + deps = [ + ":in_memory_url_index_cache_proto", + "//base", + "//base:i18n", + "//components/bookmarks/browser", + "//components/data_use_measurement/core", + "//components/keyed_service/core", + "//components/metrics", + "//components/open_from_clipboard", + "//components/pref_registry", + "//components/prefs", + "//components/query_parser", + "//components/resources", + "//components/search", + "//components/search_engines", + "//components/sessions", + "//components/strings", + "//components/toolbar", + "//components/url_formatter", + "//components/variations", + "//components/variations/net", + "//net", + "//skia", + "//sql", + "//third_party/protobuf:protobuf_lite", + "//ui/base", + "//ui/gfx", + "//url", + ] + + # TODO(brettw) Fix the include cycle and remove this line. + allow_circular_includes_from = [ "//components/search_engines" ] +} + +if (is_android) { + # GYP: //component/omnibox.gypi:autocomplete_match_java + java_cpp_enum("autocomplete_match_javagen") { + sources = [ + "autocomplete_match.h", + ] + } + + # GYP: //component/omnibox.gypi:autocomplete_match_type_java + java_cpp_enum("autocomplete_match_type_javagen") { + sources = [ + "autocomplete_match_type.h", + ] + } +} + +proto_library("in_memory_url_index_cache_proto") { + sources = [ + "in_memory_url_index_cache.proto", + ] +} + +static_library("test_support") { + testonly = true + sources = [ + "history_index_restore_observer.cc", + "history_index_restore_observer.h", + "in_memory_url_index_test_util.cc", + "in_memory_url_index_test_util.h", + "mock_autocomplete_provider_client.cc", + "mock_autocomplete_provider_client.h", + "shortcuts_provider_test_util.cc", + "shortcuts_provider_test_util.h", + "test_scheme_classifier.cc", + "test_scheme_classifier.h", + ] + + deps = [ + ":browser", + "//base", + "//components/history/core/browser", + "//components/metrics/proto", + "//components/search_engines", + "//net", + "//testing/gmock", + "//testing/gtest", + ] +} + +bundle_data("unit_tests_bundle_data") { + visibility = [ ":unit_tests" ] + testonly = true + sources = [ + "//components/test/data/omnibox/Shortcuts.no_fill_into_edit.sql", + "//components/test/data/omnibox/Shortcuts.v0.sql", + "//components/test/data/omnibox/in_memory_url_index_test.db.txt", + "//components/test/data/omnibox/in_memory_url_index_test_limited.db.txt", + ] + outputs = [ + "{{bundle_resources_dir}}/" + + "{{source_root_relative_dir}}/{{source_file_part}}", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "answers_cache_unittest.cc", + "autocomplete_input_unittest.cc", + "autocomplete_match_unittest.cc", + "autocomplete_provider_unittest.cc", + "autocomplete_result_unittest.cc", + "base_search_provider_unittest.cc", + "bookmark_provider_unittest.cc", + "builtin_provider_unittest.cc", + "clipboard_url_provider_unittest.cc", + "history_quick_provider_unittest.cc", + "history_url_provider_unittest.cc", + "in_memory_url_index_types_unittest.cc", + "in_memory_url_index_unittest.cc", + "keyword_provider_unittest.cc", + "omnibox_edit_unittest.cc", + "omnibox_field_trial_unittest.cc", + "omnibox_popup_model_unittest.cc", + "omnibox_view_unittest.cc", + "scored_history_match_unittest.cc", + "shortcuts_backend_unittest.cc", + "shortcuts_database_unittest.cc", + "shortcuts_provider_unittest.cc", + "suggestion_answer_unittest.cc", + "url_prefix_unittest.cc", + "zero_suggest_provider_unittest.cc", + ] + + deps = [ + ":browser", + ":test_support", + ":unit_tests_bundle_data", + "//base", + "//base/test:test_support", + "//components/bookmarks/browser", + "//components/bookmarks/test", + "//components/history/core/test", + "//components/open_from_clipboard:test_support", + "//components/prefs:test_support", + "//components/search", + "//components/search_engines", + "//components/sessions", + "//components/toolbar:test_support", + "//components/url_formatter", + "//components/variations", + "//net:test_support", + "//sql", + "//sql:test_support", + "//testing/gmock", + "//testing/gtest", + "//ui/base", + "//url", + ] +} diff --git a/chromium/components/omnibox/common/BUILD.gn b/chromium/components/omnibox/common/BUILD.gn new file mode 100644 index 00000000000..3e0af71eee4 --- /dev/null +++ b/chromium/components/omnibox/common/BUILD.gn @@ -0,0 +1,9 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("common") { + sources = [ + "omnibox_focus_state.h", + ] +} diff --git a/chromium/components/policy/BUILD.gn b/chromium/components/policy/BUILD.gn new file mode 100644 index 00000000000..c2c7ea51c8c --- /dev/null +++ b/chromium/components/policy/BUILD.gn @@ -0,0 +1,426 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//build/config/features.gni") +import("//components/policy/resources/policy_templates.gni") +import("//third_party/protobuf/proto_library.gni") +import("//tools/grit/grit_rule.gni") + +if (is_mac) { + import("//build/util/branding.gni") +} + +# About the policy component: +# +# There should really be two components. One called "policy" that includes all +# generated code, and one "policy/proto" like we have now. The proto needs to +# be separate for cases like SesssionManagerClient which uses the protos to +# communicate with the Chrome OS system layer, but doesn't need the rest of the +# policy stuff). +# +# The reason the rest of the targets exist are artifacts of the way the GYP +# build works. The current "policy" target which is really just some generated +# code (which should be folded into the new "policy" component described above) +# exists so code outside which depends on the generated headers can depend on +# the hard policy target without having to make all policy targets hard +# dependencies (GN will do the right thing without this extra target). +if (is_component_build) { + component("policy_component") { + public_deps = [ + "//components/policy/core/browser", + "//components/policy/core/common", + ] + } + group("policy_component_browser") { + public_deps = [ + ":policy_component", + ] + } + group("policy_component_common") { + public_deps = [ + ":policy_component", + ] + } +} else { # Compile to separate libraries. + group("policy_component") { + public_deps = [ + ":policy_component_browser", + ":policy_component_common", + ] + } + component("policy_component_browser") { + public_deps = [ + "//components/policy/core/browser", + ] + } + component("policy_component_common") { + public_deps = [ + "//components/policy/core/common", + ] + } +} + +if (enable_configuration_policy) { + # TODO(GYP_GONE) this component should use target_gen_dir instead but the GYP + # build puts everything into the following directory. We do the same for now. + # Fix when GYP is gone. + policy_gen_dir = "$root_gen_dir/policy" + + # This protobuf is equivalent to chrome_settings.proto but shares messages + # for policies of the same type, so that less classes have to be generated + # and compiled. + cloud_policy_proto_path = "$policy_gen_dir/cloud_policy.proto" + + # This is the "full" protobuf, which defines one protobuf message per + # policy. It is also the format currently used by the server. + chrome_settings_proto_path = "$policy_gen_dir/chrome_settings.proto" + + constants_header_path = "$policy_gen_dir/policy_constants.h" + constants_source_path = "$policy_gen_dir/policy_constants.cc" + protobuf_decoder_path = "$policy_gen_dir/cloud_policy_generated.cc" + app_restrictions_path = "$policy_gen_dir/app_restrictions.xml" + risk_tag_header_path = "$policy_gen_dir/risk_tag.h" + + action("cloud_policy_code_generate") { + script = "tools/generate_policy_source.py" + chrome_version_abspath = "//chrome/VERSION" + chrome_version_path = rebase_path(chrome_version_abspath, root_build_dir) + + if (is_chromeos) { + chromeos_flag = "1" + } else { + chromeos_flag = "0" + } + + inputs = [ + chrome_version_abspath, + "resources/policy_templates.json", + ] + outputs = [ + constants_header_path, + constants_source_path, + protobuf_decoder_path, + chrome_settings_proto_path, + cloud_policy_proto_path, + app_restrictions_path, + risk_tag_header_path, + ] + + if (target_os != "android") { + outputs -= [ app_restrictions_path ] + } + + args = [ + "--policy-constants-header=" + + rebase_path(constants_header_path, root_build_dir), + "--policy-constants-source=" + + rebase_path(constants_source_path, root_build_dir), + "--chrome-settings-protobuf=" + + rebase_path(chrome_settings_proto_path, root_build_dir), + "--cloud-policy-protobuf=" + + rebase_path(cloud_policy_proto_path, root_build_dir), + "--cloud-policy-decoder=" + + rebase_path(protobuf_decoder_path, root_build_dir), + "--app-restrictions-definition=" + + rebase_path(app_restrictions_path, root_build_dir), + "--risk-tag-header=" + rebase_path(risk_tag_header_path, root_build_dir), + chrome_version_path, + target_os, + chromeos_flag, + rebase_path("resources/policy_templates.json", root_build_dir), + ] + } + + policy_templates_grd_file = "resources/policy_templates.grd" + grit("policy_templates") { + source = policy_templates_grd_file + use_qualified_include = true + output_dir = "$root_gen_dir/chrome" + outputs = policy_templates_doc_outputs + if (is_android) { + outputs += policy_templates_android_outputs + } + if (is_linux) { + outputs += policy_templates_linux_outputs + } + if (is_mac) { + outputs += policy_templates_mac_outputs + + defines = [ "mac_bundle_id=$chrome_mac_bundle_id" ] + } + if (is_win) { + outputs += policy_templates_windows_outputs + } + } + + # Run the proto compiler over the generated file and make it a component. + component("cloud_policy_proto_generated_compile") { + public_deps = [ + ":cloud_policy_proto_generated_compile_proto", + ] + } + proto_library("cloud_policy_proto_generated_compile_proto") { + visibility = [ ":cloud_policy_proto_generated_compile" ] + sources = [ + cloud_policy_proto_path, + ] + + proto_out_dir = "policy/proto" + cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:" + cc_include = "components/policy/policy_proto_export.h" + component_build_force_source_set = true + defines = [ "POLICY_PROTO_COMPILATION" ] + + deps = [ + ":cloud_policy_code_generate", + ] + } + + # This target builds the "full" protobuf, used for tests only. + proto_library("chrome_settings_proto_generated_compile") { + sources = [ + chrome_settings_proto_path, + ] + proto_out_dir = "policy/proto" + + deps = [ + ":cloud_policy_code_generate", + ":cloud_policy_proto_generated_compile", + ] + } + + # The dependencies here are kind of messed up. + # + # //components/policy/core/browser and .../common depend on this target, + # and require it to be compiled with POLICY_COMPONENT_IMPLEMENTATION to + # export the necessary symbols in a component build. But other targets like + # //chrome/browser also depend on this target, which in component build + # ends up in another shared library, but with the IMPLEMENTATION flag set + # incorrectly. + # + # This only reason this works is that this target is a shared library and + # the compilation units that this depends on in policy/core/common happen to + # not be brought in in the "bad" case. This needs serious untangling, maybe + # these files can just be put into policy/core/common? + static_library("policy") { + sources = [ + constants_header_path, + constants_source_path, + protobuf_decoder_path, + risk_tag_header_path, + ] + + defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ] + + public_deps = [ + ":cloud_policy_code_generate", + ":cloud_policy_proto_generated_compile", + "//base", + "//third_party/protobuf:protobuf_lite", + ] + } + + group("test_support") { + public_deps = [ + ":chrome_settings_proto_generated_compile", + ":policy_component", + ] + } + + source_set("policy_component_test_support") { + testonly = true + sources = [ + "core/browser/configuration_policy_pref_store_test.cc", + "core/browser/configuration_policy_pref_store_test.h", + "core/common/cloud/mock_cloud_external_data_manager.cc", + "core/common/cloud/mock_cloud_external_data_manager.h", + "core/common/cloud/mock_cloud_policy_client.cc", + "core/common/cloud/mock_cloud_policy_client.h", + "core/common/cloud/mock_cloud_policy_store.cc", + "core/common/cloud/mock_cloud_policy_store.h", + "core/common/cloud/mock_device_management_service.cc", + "core/common/cloud/mock_device_management_service.h", + "core/common/cloud/mock_user_cloud_policy_store.cc", + "core/common/cloud/mock_user_cloud_policy_store.h", + "core/common/cloud/policy_builder.cc", + "core/common/cloud/policy_builder.h", + "core/common/configuration_policy_provider_test.cc", + "core/common/configuration_policy_provider_test.h", + "core/common/fake_async_policy_loader.cc", + "core/common/fake_async_policy_loader.h", + "core/common/mock_configuration_policy_provider.cc", + "core/common/mock_configuration_policy_provider.h", + "core/common/mock_policy_service.cc", + "core/common/mock_policy_service.h", + "core/common/policy_test_utils.cc", + "core/common/policy_test_utils.h", + "core/common/preferences_mock_mac.cc", + "core/common/preferences_mock_mac.h", + "core/common/remote_commands/test_remote_command_job.cc", + "core/common/remote_commands/test_remote_command_job.h", + "core/common/remote_commands/testing_remote_commands_server.cc", + "core/common/remote_commands/testing_remote_commands_server.h", + ] + + if (is_chromeos) { + sources -= [ + "core/common/cloud/mock_user_cloud_policy_store.cc", + "core/common/cloud/mock_user_cloud_policy_store.h", + ] + } + + public_deps = [ + ":policy", + ":policy_component", + ":test_support", + "//base", + "//components/policy/proto", + "//crypto", + "//net", + "//testing/gmock", + "//testing/gtest", + ] + } + + if (is_android) { + import("//build/config/android/rules.gni") + + _generated_resources_dir = "$root_gen_dir/chrome/app/policy/android" + + copy("app_restrictions_resources_copy") { + sources = [ + app_restrictions_path, + ] + outputs = [ + "$_generated_resources_dir/xml-v21/app_restrictions.xml", + ] + deps = [ + ":cloud_policy_code_generate", + ":policy_templates", + ] + } + + android_resources("app_restrictions_resources") { + resource_dirs = [] + generated_resource_dirs = [ + "$policy_templates_base_dir/android", + _generated_resources_dir, + ] + generated_resource_files = + policy_templates_android_outputs + + [ "$_generated_resources_dir/xml-v21/app_restrictions.xml" ] + deps = [ + ":app_restrictions_resources_copy", + ":policy_templates_grit", + ] + } + } else if (is_mac) { + action("convert_mcx_plist") { + script = "//build/config/mac/xcrun.py" + sources = [ + "$policy_templates_base_dir/mac/app-Manifest.plist", + ] + inputs = [ + script, + ] + outputs = [ + "$target_gen_dir/$chrome_mac_bundle_id.manifest", + ] + + args = [ + "xcrun", + "plutil", + "-convert", + "xml1", + ] + rebase_path(sources, root_out_dir) + [ "-o" ] + + rebase_path(outputs, root_out_dir) + + deps = [ + ":policy_templates", + ] + } + + bundle_data("manifest_bundle_data") { + sources = get_target_outputs(":convert_mcx_plist") + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + public_deps = [ + ":convert_mcx_plist", + ] + } + + # The reason we are not enumerating all the locales is that + # the translations would eat up 3.5MB disk space in the + # application bundle. + bundle_data("manifest_strings_bundle_data") { + sources = [ + "$policy_templates_base_dir/mac/strings/en.lproj/Localizable.strings", + ] + outputs = [ + "{{bundle_resources_dir}}/en.lproj/{{source_file_part}}", + ] + public_deps = [ + ":policy_templates", + ] + } + + create_bundle("chrome_manifest_bundle") { + bundle_root_dir = "$root_out_dir/$chrome_mac_bundle_id.manifest/Contents" + bundle_resources_dir = "$bundle_root_dir/Resources" + + deps = [ + ":manifest_bundle_data", + ":manifest_strings_bundle_data", + ] + } + } + + if (is_win) { + version_file = "VERSION" + version_path = "$policy_templates_base_dir/$version_file" + + copy("add_version") { + sources = [ + "//chrome/VERSION", + ] + outputs = [ + version_path, + ] + } + + action("pack_policy_templates") { + output_zip_file = "$root_out_dir/policy_templates.zip" + script = "tools/make_policy_zip.py" + inputs = + [ + version_path, + policy_templates_grd_file, + grit_info_script, + ] + policy_templates_windows_outputs + policy_templates_doc_outputs + outputs = [ + output_zip_file, + ] + args = [ + "--output", + rebase_path(output_zip_file, root_build_dir), + "--basedir", + rebase_path(policy_templates_base_dir, root_build_dir), + "--grd_input", + rebase_path(policy_templates_grd_file, root_build_dir), + "--grd_strip_path_prefix", + "app/policy", + "--extra_input", + version_file, + "--grit_info", + rebase_path(grit_info_script, root_build_dir), + ] + grit_defines + deps = [ + ":add_version", + ":policy_templates", + ] + } + } +} diff --git a/chromium/components/policy/android/BUILD.gn b/chromium/components/policy/android/BUILD.gn new file mode 100644 index 00000000000..7399ba209fc --- /dev/null +++ b/chromium/components/policy/android/BUILD.gn @@ -0,0 +1,59 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +_jni_sources = [ + "java/src/org/chromium/policy/PolicyConverter.java", + "java/src/org/chromium/policy/CombinedPolicyProvider.java", +] + +# GYP: //components/components.gyp:policy_java +android_library("policy_java") { + deps = [ + "//base:base_java", + ] + java_files = + _jni_sources + [ + "java/src/org/chromium/policy/AbstractAppRestrictionsProvider.java", + "java/src/org/chromium/policy/AppRestrictionsProvider.java", + "java/src/org/chromium/policy/PolicyProvider.java", + ] +} + +# GYP: //components/components.gyp:policy_test_support_java +android_library("policy_java_test_support") { + testonly = true + deps = [ + ":policy_java", + "//base:base_java", + "//base:base_java_test_support", + ] + java_files = [ + "javatests/src/org/chromium/policy/test/annotations/Policies.java", + "javatests/src/org/chromium/policy/test/PolicyData.java", + ] +} + +# GYP: //components/components.gyp:policy_jni_headers +generate_jni("jni_headers") { + visibility = [ "//components/policy/*" ] + sources = _jni_sources + jni_package = "policy" +} + +# GYP: //components/components_test.gyp:components_junit_tests +junit_binary("components_policy_junit_tests") { + java_files = [ + "junit/src/org/chromium/policy/AbstractAppRestrictionsProviderTest.java", + "junit/src/org/chromium/policy/CombinedPolicyProviderTest.java", + "junit/src/org/chromium/policy/test/annotations/PoliciesTest.java", + ] + deps = [ + ":policy_java", + ":policy_java_test_support", + "//base:base_java", + "//third_party/junit:hamcrest", + ] +} diff --git a/chromium/components/policy/core/browser/BUILD.gn b/chromium/components/policy/core/browser/BUILD.gn new file mode 100644 index 00000000000..6ca6451c922 --- /dev/null +++ b/chromium/components/policy/core/browser/BUILD.gn @@ -0,0 +1,112 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +# GYP version: components/policy.gypi:policy_component_core_browser +source_set("browser") { + visibility = [ "//components/policy/*" ] + sources = [ + # Note that these sources are always included, even for builds that disable + # policy. Most source files should go in the conditional sources list + # below. url_blacklist_manager.h is used by managed mode. + "url_blacklist_manager.cc", + "url_blacklist_manager.h", + ] + + defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ] + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//components/bookmarks/managed", + "//components/keyed_service/core", + "//components/policy/core/common", + "//components/pref_registry", + "//components/prefs", + "//components/strings", + "//components/url_matcher", + "//net", + "//ui/base", + ] + + if (is_android) { + sources += [ + "android/android_combined_policy_provider.cc", + "android/android_combined_policy_provider.h", + "android/component_jni_registrar.cc", + "android/component_jni_registrar.h", + "android/policy_converter.cc", + "android/policy_converter.h", + ] + deps += [ "//components/policy/android:jni_headers" ] + } + + if (enable_configuration_policy) { + sources += [ + "autofill_policy_handler.cc", + "autofill_policy_handler.h", + "browser_policy_connector.cc", + "browser_policy_connector.h", + "browser_policy_connector_base.cc", + "browser_policy_connector_base.h", + "browser_policy_connector_ios.h", + "browser_policy_connector_ios.mm", + "cloud/message_util.cc", + "cloud/message_util.h", + "configuration_policy_handler.cc", + "configuration_policy_handler.h", + "configuration_policy_handler_list.cc", + "configuration_policy_handler_list.h", + "configuration_policy_pref_store.cc", + "configuration_policy_pref_store.h", + "policy_error_map.cc", + "policy_error_map.h", + "proxy_policy_handler.cc", + "proxy_policy_handler.h", + "url_blacklist_policy_handler.cc", + "url_blacklist_policy_handler.h", + ] + + deps += [ + "//components/autofill/core/common", + "//components/policy", + "//components/policy/proto", + "//components/proxy_config", + "//google_apis", + "//net", + "//third_party/icu", + ] + } +} + +if (enable_configuration_policy) { + source_set("unit_tests") { + testonly = true + sources = [ + "android/android_combined_policy_provider_unittest.cc", + "android/policy_converter_unittest.cc", + "autofill_policy_handler_unittest.cc", + "browser_policy_connector_unittest.cc", + "configuration_policy_handler_unittest.cc", + "configuration_policy_pref_store_unittest.cc", + "proxy_policy_handler_unittest.cc", + "url_blacklist_manager_unittest.cc", + "url_blacklist_policy_handler_unittest.cc", + ] + deps = [ + "//base", + "//components/autofill/core/common", + "//components/policy", + "//components/policy:policy_component_test_support", + "//components/prefs:test_support", + "//components/proxy_config", + "//components/url_formatter", + "//google_apis", + "//net", + "//testing/gmock", + "//testing/gtest", + ] + } +} diff --git a/chromium/components/policy/core/common/BUILD.gn b/chromium/components/policy/core/common/BUILD.gn new file mode 100644 index 00000000000..76471377150 --- /dev/null +++ b/chromium/components/policy/core/common/BUILD.gn @@ -0,0 +1,299 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +source_set("common") { + visibility = [ + "//components/policy/*", + "//components/syncable_prefs/*", + ] + + defines = [ "POLICY_COMPONENT_IMPLEMENTATION" ] + + if (enable_configuration_policy) { + sources = [ + "../../policy_export.h", + "async_policy_loader.cc", + "async_policy_loader.h", + "async_policy_provider.cc", + "async_policy_provider.h", + "cloud/cloud_external_data_manager.cc", + "cloud/cloud_external_data_manager.h", + "cloud/cloud_policy_client.cc", + "cloud/cloud_policy_client.h", + "cloud/cloud_policy_client_registration_helper.cc", + "cloud/cloud_policy_client_registration_helper.h", + "cloud/cloud_policy_constants.cc", + "cloud/cloud_policy_constants.h", + "cloud/cloud_policy_core.cc", + "cloud/cloud_policy_core.h", + "cloud/cloud_policy_manager.cc", + "cloud/cloud_policy_manager.h", + "cloud/cloud_policy_refresh_scheduler.cc", + "cloud/cloud_policy_refresh_scheduler.h", + "cloud/cloud_policy_service.cc", + "cloud/cloud_policy_service.h", + "cloud/cloud_policy_store.cc", + "cloud/cloud_policy_store.h", + "cloud/cloud_policy_validator.cc", + "cloud/cloud_policy_validator.h", + "cloud/component_cloud_policy_service.cc", + "cloud/component_cloud_policy_service.h", + "cloud/component_cloud_policy_store.cc", + "cloud/component_cloud_policy_store.h", + "cloud/component_cloud_policy_updater.cc", + "cloud/component_cloud_policy_updater.h", + "cloud/device_management_service.cc", + "cloud/device_management_service.h", + "cloud/enterprise_metrics.cc", + "cloud/enterprise_metrics.h", + "cloud/external_policy_data_fetcher.cc", + "cloud/external_policy_data_fetcher.h", + "cloud/external_policy_data_updater.cc", + "cloud/external_policy_data_updater.h", + "cloud/policy_header_io_helper.cc", + "cloud/policy_header_io_helper.h", + "cloud/policy_header_service.cc", + "cloud/policy_header_service.h", + "cloud/resource_cache.cc", + "cloud/resource_cache.h", + "cloud/user_cloud_policy_manager.cc", + "cloud/user_cloud_policy_manager.h", + "cloud/user_cloud_policy_store.cc", + "cloud/user_cloud_policy_store.h", + "cloud/user_cloud_policy_store_base.cc", + "cloud/user_cloud_policy_store_base.h", + "cloud/user_info_fetcher.cc", + "cloud/user_info_fetcher.h", + "config_dir_policy_loader.cc", + "config_dir_policy_loader.h", + "configuration_policy_provider.cc", + "configuration_policy_provider.h", + "external_data_fetcher.cc", + "external_data_fetcher.h", + "external_data_manager.h", + "policy_bundle.cc", + "policy_bundle.h", + "policy_details.h", + "policy_load_status.cc", + "policy_load_status.h", + "policy_loader_ios.h", + "policy_loader_ios.mm", + "policy_loader_mac.h", + "policy_loader_mac.mm", + "policy_loader_win.cc", + "policy_loader_win.h", + "policy_map.cc", + "policy_map.h", + "policy_namespace.cc", + "policy_namespace.h", + "policy_pref_names.cc", + "policy_pref_names.h", + "policy_service.cc", + "policy_service.h", + "policy_service_impl.cc", + "policy_service_impl.h", + "policy_statistics_collector.cc", + "policy_statistics_collector.h", + "policy_switches.cc", + "policy_switches.h", + "policy_types.h", + "preferences_mac.cc", + "preferences_mac.h", + "preg_parser_win.cc", + "preg_parser_win.h", + "registry_dict_win.cc", + "registry_dict_win.h", + "remote_commands/remote_command_job.cc", + "remote_commands/remote_command_job.h", + "remote_commands/remote_commands_factory.cc", + "remote_commands/remote_commands_factory.h", + "remote_commands/remote_commands_queue.cc", + "remote_commands/remote_commands_queue.h", + "remote_commands/remote_commands_service.cc", + "remote_commands/remote_commands_service.h", + "schema.cc", + "schema.h", + "schema_internal.h", + "schema_map.cc", + "schema_map.h", + "schema_registry.cc", + "schema_registry.h", + "schema_registry_tracking_policy_provider.cc", + "schema_registry_tracking_policy_provider.h", + ] + + configs += [ "//build/config:precompiled_headers" ] + + public_deps = [ + "//components/policy/proto", + ] + deps = [ + "//base:i18n", + "//base/third_party/dynamic_annotations", + "//components/data_use_measurement/core", + "//components/json_schema", + "//components/policy", + "//components/prefs", + "//google_apis", + "//net", + "//third_party/re2", + "//url", + ] + + if (is_win) { + libs = [ + "shlwapi.lib", + "userenv.lib", + "ntdsapi.lib", + ] + } + if (is_android) { + sources += [ "cloud/component_cloud_policy_service_stub.cc" ] + sources -= [ + "cloud/component_cloud_policy_service.cc", + "cloud/component_cloud_policy_store.cc", + "cloud/component_cloud_policy_store.h", + "cloud/component_cloud_policy_updater.cc", + "cloud/component_cloud_policy_updater.h", + "cloud/external_policy_data_fetcher.cc", + "cloud/external_policy_data_fetcher.h", + "cloud/external_policy_data_updater.cc", + "cloud/external_policy_data_updater.h", + "cloud/resource_cache.cc", + "cloud/resource_cache.h", + "config_dir_policy_loader.cc", + "config_dir_policy_loader.h", + "policy_load_status.cc", + "policy_load_status.h", + ] + } + if (is_chromeos) { + sources += [ + "proxy_policy_provider.cc", + "proxy_policy_provider.h", + ] + sources -= [ + "cloud/cloud_policy_client_registration_helper.cc", + "cloud/cloud_policy_client_registration_helper.h", + "cloud/user_cloud_policy_manager.cc", + "cloud/user_cloud_policy_manager.h", + "cloud/user_cloud_policy_store.cc", + "cloud/user_cloud_policy_store.h", + ] + } + if (is_mac) { + libs = [ "CoreFoundation.framework" ] + } + if (is_ios || is_mac) { + sources += [ + "mac_util.cc", + "mac_util.h", + ] + } + } else { + # Some of the policy code is always enabled, so that other parts of Chrome + # can always interface with the PolicyService without having to #ifdef on + # ENABLE_CONFIGURATION_POLICY. + sources = [ + "external_data_fetcher.cc", + "external_data_fetcher.h", + "external_data_manager.h", + "policy_map.cc", + "policy_map.h", + "policy_namespace.cc", + "policy_namespace.h", + "policy_pref_names.cc", + "policy_pref_names.h", + "policy_service.cc", + "policy_service.h", + "policy_service_stub.cc", + "policy_service_stub.h", + ] + deps = [ + "//base", + ] + } +} + +if (enable_configuration_policy) { + source_set("unit_tests") { + testonly = true + sources = [ + "cloud/cloud_policy_client_unittest.cc", + "cloud/cloud_policy_constants_unittest.cc", + "cloud/cloud_policy_core_unittest.cc", + "cloud/cloud_policy_manager_unittest.cc", + "cloud/cloud_policy_refresh_scheduler_unittest.cc", + "cloud/cloud_policy_service_unittest.cc", + "cloud/cloud_policy_validator_unittest.cc", + "cloud/device_management_service_unittest.cc", + "cloud/policy_header_io_helper_unittest.cc", + "cloud/policy_header_service_unittest.cc", + "cloud/user_info_fetcher_unittest.cc", + "generate_policy_source_unittest.cc", + "policy_bundle_unittest.cc", + "policy_loader_ios_unittest.mm", + "policy_loader_mac_unittest.cc", + "policy_loader_win_unittest.cc", + "policy_map_unittest.cc", + "policy_service_impl_unittest.cc", + "policy_statistics_collector_unittest.cc", + "preg_parser_win_unittest.cc", + "registry_dict_win_unittest.cc", + "remote_commands/remote_commands_queue_unittest.cc", + "remote_commands/remote_commands_service_unittest.cc", + "schema_map_unittest.cc", + "schema_registry_tracking_policy_provider_unittest.cc", + "schema_registry_unittest.cc", + "schema_unittest.cc", + ] + if (is_chromeos) { + sources += [ "proxy_policy_provider_unittest.cc" ] + } else { + sources += [ + "cloud/user_cloud_policy_manager_unittest.cc", + "cloud/user_cloud_policy_store_unittest.cc", + ] + } + if (!is_android) { + sources += [ "async_policy_provider_unittest.cc" ] + } + if (!is_android && !is_ios) { + sources += [ + "cloud/component_cloud_policy_service_unittest.cc", + "cloud/component_cloud_policy_store_unittest.cc", + "cloud/component_cloud_policy_updater_unittest.cc", + "cloud/external_policy_data_fetcher_unittest.cc", + "cloud/external_policy_data_updater_unittest.cc", + "cloud/resource_cache_unittest.cc", + "config_dir_policy_loader_unittest.cc", + ] + } + if (is_mac || is_ios) { + sources += [ "mac_util_unittest.cc" ] + } + + if (is_win) { + # Needed by policy_loader_win_unittest.cc and preg_parser_win_unittest.cc + data = [ + "//chrome/test/data/policy/", + ] + } + + deps = [ + "//base", + "//base/test:test_support", + "//components/policy", + "//components/policy:policy_component_test_support", + "//components/prefs:test_support", + "//components/prefs:test_support", + "//google_apis", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + ] + } +} diff --git a/chromium/components/policy/proto/BUILD.gn b/chromium/components/policy/proto/BUILD.gn new file mode 100644 index 00000000000..c1b56c7798f --- /dev/null +++ b/chromium/components/policy/proto/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# The proto files need to be a component to avoid duplicate symbols the way the +# dependency structure is currently. Since proto_library generates a source +# set, here we link the result into a component. +component("proto") { + output_name = "policy_proto" + public_deps = [ + ":proto_internal", + ] +} + +proto_library("proto_internal") { + visibility = [ ":proto" ] + + sources = [ + "device_management_backend.proto", + "policy_signing_key.proto", + ] + if (!is_android && !is_ios) { + sources += [ "chrome_extension_policy.proto" ] + } + if (is_chromeos) { + sources += [ "device_management_local.proto" ] + } + + proto_out_dir = "policy/proto" + cc_generator_options = "dllexport_decl=POLICY_PROTO_EXPORT:" + cc_include = "components/policy/policy_proto_export.h" + component_build_force_source_set = true + defines = [ "POLICY_PROTO_COMPILATION" ] +} diff --git a/chromium/components/policy/resources/policy_templates.gni b/chromium/components/policy/resources/policy_templates.gni new file mode 100644 index 00000000000..b6a0c15bac1 --- /dev/null +++ b/chromium/components/policy/resources/policy_templates.gni @@ -0,0 +1,239 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file contains the list of outputs from policy_templates.grd +# for use within GN. It should always mirror the list in policy_templates.grd. + +policy_templates_base_dir = "$root_gen_dir/chrome/app/policy" + +policy_templates_android_outputs = + [ "$policy_templates_base_dir/android/values-v21/restriction_values.xml" ] + +policy_templates_doc_outputs = [ + "$policy_templates_base_dir/common/html/am/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ar/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/bg/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/bn/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ca/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/cs/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/da/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/de/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/el/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/en-GB/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/en-US/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/es-419/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/es/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/et/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/fa/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/fi/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/fil/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/fr/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/gu/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/he/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/hi/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/hr/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/hu/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/id/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/it/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ja/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/kn/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ko/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/lt/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/lv/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ml/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/mr/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ms/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/nb/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/nl/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/pl/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/pt-BR/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/pt-PT/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ro/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ru/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/sk/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/sl/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/sr/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/sv/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/sw/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/ta/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/te/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/th/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/tr/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/uk/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/vi/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/zh-CN/chrome_policy_list.html", + "$policy_templates_base_dir/common/html/zh-TW/chrome_policy_list.html", +] + +policy_templates_linux_outputs = + [ "$policy_templates_base_dir/linux/examples/chrome.json" ] + +policy_templates_mac_outputs = [ + "$policy_templates_base_dir/ios/chrome_policy.plist", + "$policy_templates_base_dir/mac/app-Manifest.plist", + "$policy_templates_base_dir/mac/strings/am.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ar.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/bg.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/bn.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ca.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/cs.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/da.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/de.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/el.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/en.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/en_GB.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/es.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/es_419.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/et.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/fa.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/fi.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/fil.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/fr.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/gu.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/he.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/hi.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/hr.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/hu.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/id.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/it.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ja.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/kn.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ko.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/lt.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/lv.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ml.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/mr.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ms.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/nb.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/nl.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/pl.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/pt_BR.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/pt_PT.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ro.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ru.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/sk.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/sl.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/sr.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/sv.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/sw.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/ta.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/te.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/th.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/tr.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/uk.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/vi.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/zh_CN.lproj/Localizable.strings", + "$policy_templates_base_dir/mac/strings/zh_TW.lproj/Localizable.strings", +] + +policy_templates_windows_outputs = [ + "$policy_templates_base_dir/windows/adm/am/chrome.adm", + "$policy_templates_base_dir/windows/adm/ar/chrome.adm", + "$policy_templates_base_dir/windows/adm/bg/chrome.adm", + "$policy_templates_base_dir/windows/adm/bn/chrome.adm", + "$policy_templates_base_dir/windows/adm/ca/chrome.adm", + "$policy_templates_base_dir/windows/adm/cs/chrome.adm", + "$policy_templates_base_dir/windows/adm/da/chrome.adm", + "$policy_templates_base_dir/windows/adm/de/chrome.adm", + "$policy_templates_base_dir/windows/adm/el/chrome.adm", + "$policy_templates_base_dir/windows/adm/en-GB/chrome.adm", + "$policy_templates_base_dir/windows/adm/en-US/chrome.adm", + "$policy_templates_base_dir/windows/adm/es-419/chrome.adm", + "$policy_templates_base_dir/windows/adm/es/chrome.adm", + "$policy_templates_base_dir/windows/adm/et/chrome.adm", + "$policy_templates_base_dir/windows/adm/fa/chrome.adm", + "$policy_templates_base_dir/windows/adm/fi/chrome.adm", + "$policy_templates_base_dir/windows/adm/fil/chrome.adm", + "$policy_templates_base_dir/windows/adm/fr/chrome.adm", + "$policy_templates_base_dir/windows/adm/gu/chrome.adm", + "$policy_templates_base_dir/windows/adm/he/chrome.adm", + "$policy_templates_base_dir/windows/adm/hi/chrome.adm", + "$policy_templates_base_dir/windows/adm/hr/chrome.adm", + "$policy_templates_base_dir/windows/adm/hu/chrome.adm", + "$policy_templates_base_dir/windows/adm/id/chrome.adm", + "$policy_templates_base_dir/windows/adm/it/chrome.adm", + "$policy_templates_base_dir/windows/adm/ja/chrome.adm", + "$policy_templates_base_dir/windows/adm/kn/chrome.adm", + "$policy_templates_base_dir/windows/adm/ko/chrome.adm", + "$policy_templates_base_dir/windows/adm/lt/chrome.adm", + "$policy_templates_base_dir/windows/adm/lv/chrome.adm", + "$policy_templates_base_dir/windows/adm/ml/chrome.adm", + "$policy_templates_base_dir/windows/adm/mr/chrome.adm", + "$policy_templates_base_dir/windows/adm/ms/chrome.adm", + "$policy_templates_base_dir/windows/adm/nb/chrome.adm", + "$policy_templates_base_dir/windows/adm/nl/chrome.adm", + "$policy_templates_base_dir/windows/adm/pl/chrome.adm", + "$policy_templates_base_dir/windows/adm/pt-BR/chrome.adm", + "$policy_templates_base_dir/windows/adm/pt-PT/chrome.adm", + "$policy_templates_base_dir/windows/adm/ro/chrome.adm", + "$policy_templates_base_dir/windows/adm/ru/chrome.adm", + "$policy_templates_base_dir/windows/adm/sk/chrome.adm", + "$policy_templates_base_dir/windows/adm/sl/chrome.adm", + "$policy_templates_base_dir/windows/adm/sr/chrome.adm", + "$policy_templates_base_dir/windows/adm/sv/chrome.adm", + "$policy_templates_base_dir/windows/adm/sw/chrome.adm", + "$policy_templates_base_dir/windows/adm/ta/chrome.adm", + "$policy_templates_base_dir/windows/adm/te/chrome.adm", + "$policy_templates_base_dir/windows/adm/th/chrome.adm", + "$policy_templates_base_dir/windows/adm/tr/chrome.adm", + "$policy_templates_base_dir/windows/adm/uk/chrome.adm", + "$policy_templates_base_dir/windows/adm/vi/chrome.adm", + "$policy_templates_base_dir/windows/adm/zh-CN/chrome.adm", + "$policy_templates_base_dir/windows/adm/zh-TW/chrome.adm", + "$policy_templates_base_dir/windows/admx/am/chrome.adml", + "$policy_templates_base_dir/windows/admx/ar/chrome.adml", + "$policy_templates_base_dir/windows/admx/bg/chrome.adml", + "$policy_templates_base_dir/windows/admx/bn/chrome.adml", + "$policy_templates_base_dir/windows/admx/ca/chrome.adml", + "$policy_templates_base_dir/windows/admx/chrome.admx", + "$policy_templates_base_dir/windows/admx/cs/chrome.adml", + "$policy_templates_base_dir/windows/admx/da/chrome.adml", + "$policy_templates_base_dir/windows/admx/de/chrome.adml", + "$policy_templates_base_dir/windows/admx/el/chrome.adml", + "$policy_templates_base_dir/windows/admx/en-GB/chrome.adml", + "$policy_templates_base_dir/windows/admx/en-US/chrome.adml", + "$policy_templates_base_dir/windows/admx/es-419/chrome.adml", + "$policy_templates_base_dir/windows/admx/es/chrome.adml", + "$policy_templates_base_dir/windows/admx/et/chrome.adml", + "$policy_templates_base_dir/windows/admx/fa/chrome.adml", + "$policy_templates_base_dir/windows/admx/fi/chrome.adml", + "$policy_templates_base_dir/windows/admx/fil/chrome.adml", + "$policy_templates_base_dir/windows/admx/fr/chrome.adml", + "$policy_templates_base_dir/windows/admx/gu/chrome.adml", + "$policy_templates_base_dir/windows/admx/he/chrome.adml", + "$policy_templates_base_dir/windows/admx/hi/chrome.adml", + "$policy_templates_base_dir/windows/admx/hr/chrome.adml", + "$policy_templates_base_dir/windows/admx/hu/chrome.adml", + "$policy_templates_base_dir/windows/admx/id/chrome.adml", + "$policy_templates_base_dir/windows/admx/it/chrome.adml", + "$policy_templates_base_dir/windows/admx/ja/chrome.adml", + "$policy_templates_base_dir/windows/admx/kn/chrome.adml", + "$policy_templates_base_dir/windows/admx/ko/chrome.adml", + "$policy_templates_base_dir/windows/admx/lt/chrome.adml", + "$policy_templates_base_dir/windows/admx/lv/chrome.adml", + "$policy_templates_base_dir/windows/admx/ml/chrome.adml", + "$policy_templates_base_dir/windows/admx/mr/chrome.adml", + "$policy_templates_base_dir/windows/admx/ms/chrome.adml", + "$policy_templates_base_dir/windows/admx/nb/chrome.adml", + "$policy_templates_base_dir/windows/admx/nl/chrome.adml", + "$policy_templates_base_dir/windows/admx/pl/chrome.adml", + "$policy_templates_base_dir/windows/admx/pt-BR/chrome.adml", + "$policy_templates_base_dir/windows/admx/pt-PT/chrome.adml", + "$policy_templates_base_dir/windows/admx/ro/chrome.adml", + "$policy_templates_base_dir/windows/admx/ru/chrome.adml", + "$policy_templates_base_dir/windows/admx/sk/chrome.adml", + "$policy_templates_base_dir/windows/admx/sl/chrome.adml", + "$policy_templates_base_dir/windows/admx/sr/chrome.adml", + "$policy_templates_base_dir/windows/admx/sv/chrome.adml", + "$policy_templates_base_dir/windows/admx/sw/chrome.adml", + "$policy_templates_base_dir/windows/admx/ta/chrome.adml", + "$policy_templates_base_dir/windows/admx/te/chrome.adml", + "$policy_templates_base_dir/windows/admx/th/chrome.adml", + "$policy_templates_base_dir/windows/admx/tr/chrome.adml", + "$policy_templates_base_dir/windows/admx/uk/chrome.adml", + "$policy_templates_base_dir/windows/admx/vi/chrome.adml", + "$policy_templates_base_dir/windows/admx/zh-CN/chrome.adml", + "$policy_templates_base_dir/windows/admx/zh-TW/chrome.adml", + "$policy_templates_base_dir/windows/examples/chrome.reg", +] diff --git a/chromium/components/printing/test/BUILD.gn b/chromium/components/printing/test/BUILD.gn new file mode 100644 index 00000000000..9b698386cd5 --- /dev/null +++ b/chromium/components/printing/test/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("test_support") { + testonly = true + + sources = [ + "mock_printer.cc", + "mock_printer.h", + "print_mock_render_thread.cc", + "print_mock_render_thread.h", + "print_test_content_renderer_client.cc", + "print_test_content_renderer_client.h", + ] + + public_deps = [ + "//base", + "//components/printing/common", + "//components/printing/renderer", + "//content/public/common", + "//content/public/renderer", + "//content/test:test_support", + "//ipc", + "//printing", + "//skia", + "//testing/gtest", + "//ui/gfx/geometry", + ] +} diff --git a/chromium/components/proximity_auth/BUILD.gn b/chromium/components/proximity_auth/BUILD.gn new file mode 100644 index 00000000000..a19418d88e6 --- /dev/null +++ b/chromium/components/proximity_auth/BUILD.gn @@ -0,0 +1,182 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +source_set("proximity_auth") { + sources = [ + "authenticator.h", + "bluetooth_connection.cc", + "bluetooth_connection.h", + "bluetooth_connection_finder.cc", + "bluetooth_connection_finder.h", + "bluetooth_throttler.h", + "bluetooth_throttler_impl.cc", + "bluetooth_throttler_impl.h", + "bluetooth_util.cc", + "bluetooth_util.h", + "bluetooth_util_chromeos.cc", + "connection.cc", + "connection.h", + "connection_finder.h", + "connection_observer.h", + "cryptauth_enroller_factory_impl.cc", + "cryptauth_enroller_factory_impl.h", + "device_to_device_authenticator.cc", + "device_to_device_authenticator.h", + "device_to_device_initiator_operations.cc", + "device_to_device_initiator_operations.h", + "device_to_device_secure_context.cc", + "device_to_device_secure_context.h", + "messenger.h", + "messenger_impl.cc", + "messenger_impl.h", + "messenger_observer.h", + "metrics.cc", + "metrics.h", + "proximity_auth_client.h", + "proximity_auth_pref_manager.cc", + "proximity_auth_pref_manager.h", + "proximity_auth_pref_names.cc", + "proximity_auth_pref_names.h", + "proximity_auth_system.cc", + "proximity_auth_system.h", + "proximity_monitor.h", + "proximity_monitor_impl.cc", + "proximity_monitor_impl.h", + "proximity_monitor_observer.h", + "remote_device.cc", + "remote_device.h", + "remote_device_life_cycle.h", + "remote_device_life_cycle_impl.cc", + "remote_device_life_cycle_impl.h", + "remote_device_loader.cc", + "remote_device_loader.h", + "remote_status_update.cc", + "remote_status_update.h", + "screenlock_bridge.cc", + "screenlock_bridge.h", + "screenlock_state.h", + "secure_context.h", + "switches.cc", + "switches.h", + "throttled_bluetooth_connection_finder.cc", + "throttled_bluetooth_connection_finder.h", + "unlock_manager.cc", + "unlock_manager.h", + "wire_message.cc", + "wire_message.h", + ] + + deps = [ + "//base", + "//components/prefs", + "//components/proximity_auth/ble", + "//components/proximity_auth/cryptauth", + "//components/proximity_auth/logging", + "//components/signin/core/account_id:account_id", + "//device/bluetooth", + "//net", + ] + + # TODO(https://crbug.com/562683): This whitelists a circular include + # dependency between this target and the following targets which should not + # exist. + allow_circular_includes_from = [ + "//components/proximity_auth/ble", + "//components/proximity_auth/cryptauth", + ] + + if (is_chromeos) { + deps += [ "//chromeos" ] + } +} + +source_set("test_support") { + testonly = true + + sources = [ + "device_to_device_responder_operations.cc", + "device_to_device_responder_operations.h", + "fake_connection.cc", + "fake_connection.h", + "fake_secure_context.cc", + "fake_secure_context.h", + "mock_proximity_auth_client.cc", + "mock_proximity_auth_client.h", + "proximity_auth_test_util.cc", + "proximity_auth_test_util.h", + ] + + public_deps = [ + ":proximity_auth", + ] + + deps = [ + "//base", + "//components/proximity_auth/cryptauth:test_support", + "//components/proximity_auth/logging", + "//testing/gmock", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "bluetooth_connection_finder_unittest.cc", + "bluetooth_connection_unittest.cc", + "bluetooth_throttler_impl_unittest.cc", + "connection_unittest.cc", + "device_to_device_authenticator_unittest.cc", + "device_to_device_operations_unittest.cc", + "device_to_device_secure_context_unittest.cc", + "messenger_impl_unittest.cc", + "proximity_auth_pref_manager_unittest.cc", + "proximity_auth_system_unittest.cc", + "proximity_monitor_impl_unittest.cc", + "remote_device_life_cycle_impl_unittest.cc", + "remote_device_loader_unittest.cc", + "remote_status_update_unittest.cc", + "throttled_bluetooth_connection_finder_unittest.cc", + "unlock_manager_unittest.cc", + "wire_message_unittest.cc", + ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":proximity_auth", + ":test_support", + "//base", + "//base/test:test_support", + "//components/prefs:test_support", + "//components/proximity_auth/ble:unit_tests", + "//components/proximity_auth/cryptauth:test_support", + "//components/proximity_auth/cryptauth:unit_tests", + "//components/proximity_auth/logging", + "//components/proximity_auth/logging:unit_tests", + "//device/bluetooth:mocks", + "//testing/gmock", + "//testing/gtest", + ] + + if (is_chromeos) { + deps += [ "//chromeos" ] + } +} + +# Note: This is a convenience target for ease of rapid iteration during +# development. It is not executed on any try or build bots. +if (!is_chromeos) { + test("proximity_auth_unittests") { + sources = [ + "run_all_unittests.cc", + ] + deps = [ + ":unit_tests", + "//base", + "//base/test:test_support", + ] + } +} diff --git a/chromium/components/proximity_auth/ble/BUILD.gn b/chromium/components/proximity_auth/ble/BUILD.gn new file mode 100644 index 00000000000..05e8bb3921d --- /dev/null +++ b/chromium/components/proximity_auth/ble/BUILD.gn @@ -0,0 +1,73 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +source_set("ble") { + sources = [ + "bluetooth_low_energy_characteristics_finder.cc", + "bluetooth_low_energy_characteristics_finder.h", + "bluetooth_low_energy_connection.cc", + "bluetooth_low_energy_connection.h", + "bluetooth_low_energy_connection_finder.cc", + "bluetooth_low_energy_connection_finder.h", + "bluetooth_low_energy_device_whitelist.cc", + "bluetooth_low_energy_device_whitelist.h", + "bluetooth_low_energy_weave_defines.h", + "bluetooth_low_energy_weave_packet_generator.cc", + "bluetooth_low_energy_weave_packet_generator.h", + "bluetooth_low_energy_weave_packet_receiver.cc", + "bluetooth_low_energy_weave_packet_receiver.h", + "fake_wire_message.cc", + "fake_wire_message.h", + "pref_names.cc", + "pref_names.h", + "remote_attribute.h", + ] + + deps = [ + "//base", + "//components/prefs", + "//components/proximity_auth/logging", + + # TODO(https://crbug.com/562683): This component has a circular dependency + # with the root proximity auth target. It is whitelisted in that target for + # includes. + #"//components/proximity_auth", + "//device/bluetooth", + "//net", + ] + + public_deps = [ + "//components/proximity_auth/cryptauth/proto", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "bluetooth_low_energy_characteristics_finder_unittest.cc", + "bluetooth_low_energy_connection_finder_unittest.cc", + "bluetooth_low_energy_connection_unittest.cc", + "bluetooth_low_energy_device_whitelist_unittest.cc", + "bluetooth_low_energy_weave_packet_generator_unittest.cc", + "bluetooth_low_energy_weave_packet_receiver_unittest.cc", + ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":ble", + "//base/test:test_support", + "//components/prefs:test_support", + "//components/proximity_auth:test_support", + "//device/bluetooth:mocks", + "//testing/gmock", + "//testing/gtest", + ] + + public_deps = [ + "//components/proximity_auth/cryptauth/proto", + ] +} diff --git a/chromium/components/proximity_auth/cryptauth/BUILD.gn b/chromium/components/proximity_auth/cryptauth/BUILD.gn new file mode 100644 index 00000000000..fc7d40e4731 --- /dev/null +++ b/chromium/components/proximity_auth/cryptauth/BUILD.gn @@ -0,0 +1,106 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("cryptauth") { + sources = [ + "cryptauth_access_token_fetcher.h", + "cryptauth_access_token_fetcher_impl.cc", + "cryptauth_access_token_fetcher_impl.h", + "cryptauth_api_call_flow.cc", + "cryptauth_api_call_flow.h", + "cryptauth_client.h", + "cryptauth_client_impl.cc", + "cryptauth_client_impl.h", + "cryptauth_device_manager.cc", + "cryptauth_device_manager.h", + "cryptauth_enroller.h", + "cryptauth_enroller_impl.cc", + "cryptauth_enroller_impl.h", + "cryptauth_enrollment_manager.cc", + "cryptauth_enrollment_manager.h", + "cryptauth_enrollment_utils.cc", + "cryptauth_enrollment_utils.h", + "cryptauth_gcm_manager.cc", + "cryptauth_gcm_manager.h", + "cryptauth_gcm_manager_impl.cc", + "cryptauth_gcm_manager_impl.h", + "pref_names.cc", + "pref_names.h", + "secure_message_delegate.cc", + "secure_message_delegate.h", + "switches.cc", + "switches.h", + "sync_scheduler.cc", + "sync_scheduler.h", + "sync_scheduler_impl.cc", + "sync_scheduler_impl.h", + ] + + deps = [ + "//base", + "//components/gcm_driver", + "//components/gcm_driver/common", + "//components/prefs", + "//components/proximity_auth/logging", + "//crypto", + "//google_apis", + "//net", + ] + + public_deps = [ + "//components/proximity_auth/cryptauth/proto", + ] +} + +source_set("test_support") { + testonly = true + + sources = [ + "fake_cryptauth_gcm_manager.cc", + "fake_cryptauth_gcm_manager.h", + "fake_secure_message_delegate.cc", + "fake_secure_message_delegate.h", + "mock_cryptauth_client.cc", + "mock_cryptauth_client.h", + "mock_sync_scheduler.cc", + "mock_sync_scheduler.h", + ] + + public_deps = [ + ":cryptauth", + "//components/proximity_auth/cryptauth/proto", + ] + + deps = [ + "//base", + "//testing/gmock", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "cryptauth_access_token_fetcher_impl_unittest.cc", + "cryptauth_api_call_flow_unittest.cc", + "cryptauth_client_impl_unittest.cc", + "cryptauth_device_manager_unittest.cc", + "cryptauth_enroller_impl_unittest.cc", + "cryptauth_enrollment_manager_unittest.cc", + "cryptauth_gcm_manager_impl_unittest.cc", + "fake_secure_message_delegate_unittest.cc", + "sync_scheduler_impl_unittest.cc", + ] + + deps = [ + ":cryptauth", + ":test_support", + "//base/test:test_support", + "//components/gcm_driver:test_support", + "//components/prefs:test_support", + "//components/proximity_auth", + "//google_apis:test_support", + "//net:test_support", + "//testing/gtest", + ] +} diff --git a/chromium/components/proximity_auth/cryptauth/proto/BUILD.gn b/chromium/components/proximity_auth/cryptauth/proto/BUILD.gn new file mode 100644 index 00000000000..813d594ed47 --- /dev/null +++ b/chromium/components/proximity_auth/cryptauth/proto/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: //components/proximity_auth.gypi:cryptauth_proto +proto_library("proto") { + sources = [ + "cryptauth_api.proto", + "securemessage.proto", + ] +} diff --git a/chromium/components/proximity_auth/logging/BUILD.gn b/chromium/components/proximity_auth/logging/BUILD.gn new file mode 100644 index 00000000000..6a3233e2609 --- /dev/null +++ b/chromium/components/proximity_auth/logging/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("logging") { + sources = [ + "log_buffer.cc", + "log_buffer.h", + "logging.cc", + "logging.h", + ] + + deps = [ + "//base", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "logging_unittest.cc", + ] + + deps = [ + ":logging", + "//base/test:test_support", + "//testing/gtest", + ] +} diff --git a/chromium/components/proximity_auth/webui/BUILD.gn b/chromium/components/proximity_auth/webui/BUILD.gn new file mode 100644 index 00000000000..e3cb0b6ea04 --- /dev/null +++ b/chromium/components/proximity_auth/webui/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# GYP version: components/proximity_auth.gypi:proximity_auth_webui +static_library("webui") { + sources = [ + "proximity_auth_ui.cc", + "proximity_auth_ui.h", + "proximity_auth_webui_handler.cc", + "proximity_auth_webui_handler.h", + "reachable_phone_flow.cc", + "reachable_phone_flow.h", + "url_constants.cc", + "url_constants.h", + ] + + deps = [ + "//base", + "//base:i18n", + "//components/prefs", + "//components/proximity_auth", + "//components/proximity_auth/ble", + "//components/proximity_auth/cryptauth", + "//components/proximity_auth/logging", + "//components/resources", + "//content/public/browser", + "//device/bluetooth", + "//ui/resources", + ] +} diff --git a/chromium/components/rlz/BUILD.gn b/chromium/components/rlz/BUILD.gn new file mode 100644 index 00000000000..72e0efb6ab5 --- /dev/null +++ b/chromium/components/rlz/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("rlz") { + sources = [ + "rlz_tracker.cc", + "rlz_tracker.h", + "rlz_tracker_chromeos.cc", + "rlz_tracker_delegate.h", + "rlz_tracker_ios.cc", + "rlz_tracker_mac.cc", + "rlz_tracker_win.cc", + ] + + deps = [ + "//base", + "//components/google/core/browser", + "//net", + "//rlz:rlz_lib", + ] + + if (is_ios) { + deps += [ "//ui/base" ] + } +} + +source_set("unit_tests") { + testonly = true + sources = [ + "rlz_tracker_unittest.cc", + ] + + deps = [ + ":rlz", + "//net:test_support", + "//rlz:test_support", + "//ui/base", + ] +} diff --git a/chromium/components/sync_driver/BUILD.gn b/chromium/components/sync_driver/BUILD.gn new file mode 100644 index 00000000000..4717d29133e --- /dev/null +++ b/chromium/components/sync_driver/BUILD.gn @@ -0,0 +1,265 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/buildflag_header.gni") +import("//build/config/features.gni") + +source_set("sync_driver") { + sources = [ + "about_sync_util.cc", + "about_sync_util.h", + "backend_data_type_configurer.cc", + "backend_data_type_configurer.h", + "backend_migrator.cc", + "backend_migrator.h", + "change_processor.cc", + "change_processor.h", + "data_type_controller.cc", + "data_type_controller.h", + "data_type_encryption_handler.cc", + "data_type_encryption_handler.h", + "data_type_manager.cc", + "data_type_manager.h", + "data_type_manager_impl.cc", + "data_type_manager_impl.h", + "data_type_manager_observer.h", + "data_type_status_table.cc", + "data_type_status_table.h", + "device_count_metrics_provider.cc", + "device_count_metrics_provider.h", + "device_info.cc", + "device_info.h", + "device_info_data_type_controller.cc", + "device_info_data_type_controller.h", + "device_info_service.cc", + "device_info_service.h", + "device_info_sync_service.cc", + "device_info_sync_service.h", + "device_info_tracker.h", + "device_info_util.cc", + "device_info_util.h", + "directory_data_type_controller.cc", + "directory_data_type_controller.h", + "frontend_data_type_controller.cc", + "frontend_data_type_controller.h", + "generic_change_processor.cc", + "generic_change_processor.h", + "generic_change_processor_factory.cc", + "generic_change_processor_factory.h", + "glue/browser_thread_model_worker.cc", + "glue/browser_thread_model_worker.h", + "glue/chrome_report_unrecoverable_error.cc", + "glue/chrome_report_unrecoverable_error.h", + "glue/sync_backend_host.cc", + "glue/sync_backend_host.h", + "glue/sync_backend_host_core.cc", + "glue/sync_backend_host_core.h", + "glue/sync_backend_host_impl.cc", + "glue/sync_backend_host_impl.h", + "glue/sync_backend_registrar.cc", + "glue/sync_backend_registrar.h", + "glue/ui_model_worker.cc", + "glue/ui_model_worker.h", + "invalidation_adapter.cc", + "invalidation_adapter.h", + "invalidation_helper.cc", + "invalidation_helper.h", + "local_device_info_provider.h", + "local_device_info_provider_impl.cc", + "local_device_info_provider_impl.h", + "model_association_manager.cc", + "model_association_manager.h", + "model_associator.h", + "non_blocking_data_type_controller.cc", + "non_blocking_data_type_controller.h", + "non_ui_data_type_controller.cc", + "non_ui_data_type_controller.h", + "non_ui_model_type_controller.cc", + "non_ui_model_type_controller.h", + "pref_names.cc", + "pref_names.h", + "profile_sync_auth_provider.cc", + "profile_sync_auth_provider.h", + "protocol_event_observer.cc", + "protocol_event_observer.h", + "proxy_data_type_controller.cc", + "proxy_data_type_controller.h", + "shared_change_processor.cc", + "shared_change_processor.h", + "shared_change_processor_ref.cc", + "shared_change_processor_ref.h", + "signin_manager_wrapper.cc", + "signin_manager_wrapper.h", + "startup_controller.cc", + "startup_controller.h", + "sync_api_component_factory.h", + "sync_client.cc", + "sync_client.h", + "sync_driver_switches.cc", + "sync_driver_switches.h", + "sync_error_controller.cc", + "sync_error_controller.h", + "sync_frontend.cc", + "sync_frontend.h", + "sync_prefs.cc", + "sync_prefs.h", + "sync_service.cc", + "sync_service.h", + "sync_service_observer.cc", + "sync_service_observer.h", + "sync_service_utils.cc", + "sync_service_utils.h", + "sync_stopped_reporter.cc", + "sync_stopped_reporter.h", + "sync_type_preference_provider.h", + "sync_util.cc", + "sync_util.h", + "system_encryptor.cc", + "system_encryptor.h", + "ui_data_type_controller.cc", + "ui_data_type_controller.h", + "ui_model_type_controller.cc", + "ui_model_type_controller.h", + "user_selectable_sync_type.h", + ] + + public_deps = [ + "//sync", + "//third_party/cacheinvalidation", + ] + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//components/data_use_measurement/core", + "//components/invalidation/public", + "//components/metrics", + "//components/os_crypt", + "//components/pref_registry", + "//components/prefs", + "//components/signin/core/browser", + "//components/version_info", + "//google_apis", + "//net", + ] + + if (enable_configuration_policy) { + sources += [ + "sync_policy_handler.cc", + "sync_policy_handler.h", + ] + deps += [ + "//components/policy", + "//components/policy:policy_component", + ] + } +} + +source_set("test_support") { + testonly = true + sources = [ + "change_processor_mock.cc", + "change_processor_mock.h", + "data_type_controller_mock.cc", + "data_type_controller_mock.h", + "data_type_manager_mock.cc", + "data_type_manager_mock.h", + "fake_data_type_controller.cc", + "fake_data_type_controller.h", + "fake_generic_change_processor.cc", + "fake_generic_change_processor.h", + "fake_sync_client.cc", + "fake_sync_client.h", + "fake_sync_service.cc", + "fake_sync_service.h", + "frontend_data_type_controller_mock.cc", + "frontend_data_type_controller_mock.h", + "glue/sync_backend_host_mock.cc", + "glue/sync_backend_host_mock.h", + "local_device_info_provider_mock.cc", + "local_device_info_provider_mock.h", + "model_associator_mock.cc", + "model_associator_mock.h", + "non_ui_data_type_controller_mock.cc", + "non_ui_data_type_controller_mock.h", + "sync_api_component_factory_mock.cc", + "sync_api_component_factory_mock.h", + ] + + public_deps = [ + ":sync_driver", + "//sync", + ] + + deps = [ + "//base", + "//components/syncable_prefs:test_support", + "//components/version_info", + "//google_apis", + "//sync:test_support_sync_internal_api", + "//testing/gmock", + "//testing/gtest", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "about_sync_util_unittest.cc", + "backend_migrator_unittest.cc", + "data_type_manager_impl_unittest.cc", + "device_count_metrics_provider_unittest.cc", + "device_info_data_type_controller_unittest.cc", + "device_info_service_unittest.cc", + "device_info_sync_service_unittest.cc", + "device_info_util_unittest.cc", + "frontend_data_type_controller_unittest.cc", + "generic_change_processor_unittest.cc", + "glue/browser_thread_model_worker_unittest.cc", + "glue/sync_backend_host_impl_unittest.cc", + "glue/sync_backend_registrar_unittest.cc", + "glue/ui_model_worker_unittest.cc", + "local_device_info_provider_unittest.cc", + "model_association_manager_unittest.cc", + "non_blocking_data_type_controller_unittest.cc", + "non_ui_data_type_controller_unittest.cc", + "non_ui_model_type_controller_unittest.cc", + "profile_sync_auth_provider_unittest.cc", + "shared_change_processor_unittest.cc", + "startup_controller_unittest.cc", + "sync_prefs_unittest.cc", + "sync_stopped_reporter_unittest.cc", + "sync_util_unittest.cc", + "system_encryptor_unittest.cc", + "ui_data_type_controller_unittest.cc", + "ui_model_type_controller_unittest.cc", + ] + deps = [ + ":test_support", + "//base", + "//base/test:test_support", + "//components/invalidation/impl", + "//components/os_crypt:test_support", + "//components/pref_registry:test_support", + "//components/prefs:test_support", + "//components/signin/core/browser:test_support", + "//components/syncable_prefs", + "//components/syncable_prefs:test_support", + "//components/version_info", + "//net:test_support", + "//sync:test_support_sync_api", + "//sync:test_support_sync_internal_api", + "//testing/gmock", + "//testing/gtest", + "//url", + ] + + if (enable_configuration_policy) { + sources += [ "sync_policy_handler_unittest.cc" ] + deps += [ + "//components/policy", + "//components/policy:policy_component", + ] + } +} diff --git a/chromium/components/test_runner/BUILD.gn b/chromium/components/test_runner/BUILD.gn new file mode 100644 index 00000000000..283dacc96bb --- /dev/null +++ b/chromium/components/test_runner/BUILD.gn @@ -0,0 +1,220 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") +if (is_android) { + import("//build/config/android/config.gni") +} + +component("test_runner") { + testonly = true + + defines = [ "TEST_RUNNER_IMPLEMENTATION" ] + + sources = [ + "accessibility_controller.cc", + "accessibility_controller.h", + "app_banner_client.cc", + "app_banner_client.h", + "event_sender.cc", + "event_sender.h", + "gamepad_controller.cc", + "gamepad_controller.h", + "gc_controller.cc", + "gc_controller.h", + "layout_and_paint_async_then.cc", + "layout_and_paint_async_then.h", + "layout_dump.cc", + "layout_dump.h", + "layout_test_runtime_flags.cc", + "layout_test_runtime_flags.h", + "mock_color_chooser.cc", + "mock_color_chooser.h", + "mock_content_settings_client.cc", + "mock_content_settings_client.h", + "mock_credential_manager_client.cc", + "mock_credential_manager_client.h", + "mock_grammar_check.cc", + "mock_grammar_check.h", + "mock_screen_orientation_client.cc", + "mock_screen_orientation_client.h", + "mock_spell_check.cc", + "mock_spell_check.h", + "mock_web_audio_device.cc", + "mock_web_audio_device.h", + "mock_web_document_subresource_filter.cc", + "mock_web_document_subresource_filter.h", + "mock_web_media_stream_center.cc", + "mock_web_media_stream_center.h", + "mock_web_midi_accessor.cc", + "mock_web_midi_accessor.h", + "mock_web_speech_recognizer.cc", + "mock_web_speech_recognizer.h", + "mock_web_theme_engine.cc", + "mock_web_theme_engine.h", + "mock_web_user_media_client.cc", + "mock_web_user_media_client.h", + "mock_webrtc_data_channel_handler.cc", + "mock_webrtc_data_channel_handler.h", + "mock_webrtc_dtmf_sender_handler.cc", + "mock_webrtc_dtmf_sender_handler.h", + "mock_webrtc_peer_connection_handler.cc", + "mock_webrtc_peer_connection_handler.h", + "pixel_dump.cc", + "pixel_dump.h", + "spell_check_client.cc", + "spell_check_client.h", + "test_common.cc", + "test_common.h", + "test_interfaces.cc", + "test_interfaces.h", + "test_plugin.cc", + "test_plugin.h", + "test_preferences.cc", + "test_preferences.h", + "test_runner.cc", + "test_runner.h", + "test_runner_export.h", + "test_runner_for_specific_view.cc", + "test_runner_for_specific_view.h", + "text_input_controller.cc", + "text_input_controller.h", + "tracked_dictionary.cc", + "tracked_dictionary.h", + "web_ax_object_proxy.cc", + "web_ax_object_proxy.h", + "web_frame_test_client.cc", + "web_frame_test_client.h", + "web_frame_test_proxy.cc", + "web_frame_test_proxy.h", + "web_task.cc", + "web_task.h", + "web_test_delegate.h", + "web_test_interfaces.cc", + "web_test_interfaces.h", + "web_test_proxy.cc", + "web_test_proxy.h", + "web_test_runner.h", + "web_view_test_client.cc", + "web_view_test_client.h", + "web_widget_test_client.cc", + "web_widget_test_client.h", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":resources", + "//base:base", + "//base:i18n", + "//cc", + "//cc/blink", + "//gin", + "//gpu", + "//net", + "//skia", + "//third_party/WebKit/public:blink", + "//ui/display", + "//ui/events:dom_keycode_converter", + "//ui/events:events_base", + "//ui/events/blink", + "//ui/gfx", + "//ui/gfx:test_support", + "//ui/gfx/geometry", + "//url", + "//v8", + ] + + if (is_mac) { + libs = [ "AppKit.framework" ] + } +} + +# Font copies. +if (!is_mac) { + copy("copy_ahem") { + visibility = [ ":*" ] + sources = [ + "resources/fonts/AHEM____.TTF", + ] + outputs = [ + "$root_out_dir/AHEM____.TTF", + ] + } +} +if (use_x11) { + copy("copy_x11_fonts") { + visibility = [ ":*" ] + sources = [ + "//third_party/gardiner_mod/GardinerModBug.ttf", + "//third_party/gardiner_mod/GardinerModCat.ttf", + "resources/fonts/fonts.conf", + ] + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] + } +} +if (is_android) { + copy("copy_android_fonts") { + visibility = [ ":*" ] + sources = [ + "resources/fonts/android_fallback_fonts.xml", + "resources/fonts/android_main_fonts.xml", + ] + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] + } +} +if (is_mac) { + bundle_data("test_runner_bundle_data") { + sources = [ + "resources/fonts/AHEM____.TTF", + "resources/fonts/ChromiumAATTest.ttf", + ] + + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } +} + +group("resources") { + deps = [] + + if (is_mac) { + deps += [ ":test_runner_bundle_data" ] + } else { + deps += [ ":copy_ahem" ] + } + + if (use_x11) { + deps += [ ":copy_x11_fonts" ] + } + if (is_android) { + deps += [ ":copy_android_fonts" ] + } +} + +if (is_mac || is_win) { + # GYP version: components/test_runner/test_runner.gyp:layout_test_helper + executable("layout_test_helper") { + sources = [ + "helper/layout_test_helper_mac.mm", + "helper/layout_test_helper_win.cc", + ] + + if (is_mac) { + libs = [ "AppKit.framework" ] + } + + deps = [ + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + } +} diff --git a/chromium/components/translate/content/browser/BUILD.gn b/chromium/components/translate/content/browser/BUILD.gn new file mode 100644 index 00000000000..1a4b1d8e526 --- /dev/null +++ b/chromium/components/translate/content/browser/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +source_set("browser") { + sources = [ + "content_translate_driver.cc", + "content_translate_driver.h", + ] + + deps = [ + "//base", + "//components/translate/content/common", + "//components/translate/core/browser", + "//components/translate/core/common", + "//content/public/browser", + "//content/public/common", + "//ipc", + "//net", + ] +} diff --git a/chromium/components/translate/content/common/BUILD.gn b/chromium/components/translate/content/common/BUILD.gn new file mode 100644 index 00000000000..37e271535ad --- /dev/null +++ b/chromium/components/translate/content/common/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +static_library("common") { + sources = [ + "translate_messages.cc", + "translate_messages.h", + ] + + deps = [ + "//base", + "//components/translate/core/common", + "//components/translate/core/language_detection", + "//content/public/common", + "//ipc", + ] +} diff --git a/chromium/components/translate/content/renderer/BUILD.gn b/chromium/components/translate/content/renderer/BUILD.gn new file mode 100644 index 00000000000..03dba499b77 --- /dev/null +++ b/chromium/components/translate/content/renderer/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +static_library("renderer") { + sources = [ + "translate_helper.cc", + "translate_helper.h", + ] + + deps = [ + "//base", + "//components/translate/content/common", + "//components/translate/core/common", + "//components/translate/core/language_detection", + "//content/public/common", + "//content/public/renderer", + "//ipc", + "//third_party/WebKit/public:blink", + "//third_party/cld_2", + "//url", + "//v8", + ] +} diff --git a/chromium/components/translate/core/browser/BUILD.gn b/chromium/components/translate/core/browser/BUILD.gn new file mode 100644 index 00000000000..5efd47f223a --- /dev/null +++ b/chromium/components/translate/core/browser/BUILD.gn @@ -0,0 +1,100 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") + +source_set("browser") { + sources = [ + "language_state.cc", + "language_state.h", + "page_translated_details.h", + "translate_accept_languages.cc", + "translate_accept_languages.h", + "translate_browser_metrics.cc", + "translate_browser_metrics.h", + "translate_client.h", + "translate_download_manager.cc", + "translate_download_manager.h", + "translate_driver.h", + "translate_error_details.h", + "translate_event_details.cc", + "translate_event_details.h", + "translate_experiment.cc", + "translate_experiment.h", + "translate_language_list.cc", + "translate_language_list.h", + "translate_manager.cc", + "translate_manager.h", + "translate_prefs.cc", + "translate_prefs.h", + "translate_script.cc", + "translate_script.h", + "translate_step.h", + "translate_ui_delegate.cc", + "translate_ui_delegate.h", + "translate_url_fetcher.cc", + "translate_url_fetcher.h", + "translate_url_util.cc", + "translate_url_util.h", + ] + + deps = [ + "//base", + "//base:i18n", + "//components/data_use_measurement/core", + "//components/language_usage_metrics", + "//components/pref_registry", + "//components/prefs", + "//components/resources:components_resources", + "//components/strings", + "//components/translate/core/common", + "//components/variations", + "//google_apis", + "//net", + "//third_party/icu", + "//ui/base", + "//url", + ] + + if (!use_aura) { + sources += [ + "translate_infobar_delegate.cc", + "translate_infobar_delegate.h", + ] + deps += [ "//components/infobars/core" ] + } + + if (is_mac) { + sources += [ + "options_menu_model.cc", + "options_menu_model.h", + ] + } +} + +source_set("unit_tests") { + testonly = true + sources = [ + "language_state_unittest.cc", + "mock_translate_driver.cc", + "mock_translate_driver.h", + "translate_browser_metrics_unittest.cc", + "translate_language_list_unittest.cc", + "translate_manager_unittest.cc", + "translate_prefs_unittest.cc", + "translate_script_unittest.cc", + "translate_ui_delegate_unittest.cc", + ] + deps = [ + ":browser", + "//base", + "//components/infobars/core", + "//components/pref_registry:test_support", + "//components/prefs", + "//components/translate/core/common", + "//components/variations", + "//net:test_support", + "//testing/gtest", + ] +} diff --git a/chromium/components/translate/core/common/BUILD.gn b/chromium/components/translate/core/common/BUILD.gn new file mode 100644 index 00000000000..f4d461ffdc5 --- /dev/null +++ b/chromium/components/translate/core/common/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("common") { + sources = [ + "language_detection_details.cc", + "language_detection_details.h", + "translate_constants.cc", + "translate_constants.h", + "translate_errors.h", + "translate_metrics.cc", + "translate_metrics.h", + "translate_pref_names.cc", + "translate_pref_names.h", + "translate_switches.cc", + "translate_switches.h", + "translate_util.cc", + "translate_util.h", + ] + + deps = [ + "//base", + "//url", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "translate_metrics_unittest.cc", + "translate_util_unittest.cc", + ] + deps = [ + ":common", + "//base", + "//testing/gtest", + "//url", + ] +} diff --git a/chromium/components/translate/core/language_detection/BUILD.gn b/chromium/components/translate/core/language_detection/BUILD.gn new file mode 100644 index 00000000000..98f4d1f4749 --- /dev/null +++ b/chromium/components/translate/core/language_detection/BUILD.gn @@ -0,0 +1,33 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +source_set("language_detection") { + sources = [ + "language_detection_util.cc", + "language_detection_util.h", + ] + + deps = [ + "//base", + "//components/translate/core/common", + "//third_party/cld_2", + "//url", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "language_detection_util_unittest.cc", + ] + deps = [ + ":language_detection", + "//base", + "//components/translate/core/common", + "//testing/gtest", + "//url", + ] +} diff --git a/chromium/components/translate/ios/browser/BUILD.gn b/chromium/components/translate/ios/browser/BUILD.gn new file mode 100644 index 00000000000..1eefbb02408 --- /dev/null +++ b/chromium/components/translate/ios/browser/BUILD.gn @@ -0,0 +1,62 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//ios/web/js_compile.gni") + +source_set("browser") { + sources = [ + "ios_translate_driver.h", + "ios_translate_driver.mm", + "js_language_detection_manager.h", + "js_language_detection_manager.mm", + "js_translate_manager.h", + "js_translate_manager.mm", + "language_detection_controller.h", + "language_detection_controller.mm", + "translate_controller.h", + "translate_controller.mm", + ] + + deps = [ + ":injected_js", + "//base", + "//components/prefs", + "//components/translate/core/browser", + "//components/translate/core/common", + "//components/translate/core/language_detection", + "//ios/web", + "//ui/base", + "//url", + ] +} + +js_compile_checked("injected_js") { + visibility = [ ":browser" ] + sources = [ + "resources/language_detection.js", + "resources/translate_ios.js", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "js_translate_manager_unittest.mm", + "language_detection_controller_unittest.mm", + "translate_controller_unittest.mm", + ] + + deps = [ + ":browser", + "//base", + "//components/prefs:test_support", + "//components/resources", + "//components/translate/core/common", + "//ios/web:test_support", + "//testing/gtest", + "//third_party/ocmock", + "//ui/base", + "//url", + ] +} diff --git a/chromium/components/visitedlink/test/BUILD.gn b/chromium/components/visitedlink/test/BUILD.gn new file mode 100644 index 00000000000..e74cacada78 --- /dev/null +++ b/chromium/components/visitedlink/test/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("unit_tests") { + testonly = true + sources = [ + "visitedlink_unittest.cc", + ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + "//base", + "//components/visitedlink/browser", + "//components/visitedlink/common", + "//components/visitedlink/renderer", + "//content/test:test_support", + "//testing/gtest", + ] +} diff --git a/chromium/content/public/test/android/BUILD.gn b/chromium/content/public/test/android/BUILD.gn new file mode 100644 index 00000000000..618ab392c30 --- /dev/null +++ b/chromium/content/public/test/android/BUILD.gn @@ -0,0 +1,52 @@ +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +# GYP: //content/content_tests.gypi:test_support_content_jni_headers +generate_jni("test_support_content_jni_headers") { + jni_package = "content/public/test" + sources = [ + "javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java", + ] +} + +android_library("layouttest_java_support") { + testonly = true + deps = [ + "//base:base_java", + ] + java_files = [ "javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java" ] +} + +# GYP: //content/content_tests.gypi:content_java_test_support +android_library("content_java_test_support") { + testonly = true + deps = [ + ":layouttest_java_support", + "//base:base_java", + "//base:base_java_test_support", + "//content/public/android:content_java", + ] + java_files = [ + "javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java", + "javatests/src/org/chromium/content/browser/test/util/ApplicationUtils.java", + "javatests/src/org/chromium/content/browser/test/util/CallbackHelper.java", + "javatests/src/org/chromium/content/browser/test/util/Criteria.java", + "javatests/src/org/chromium/content/browser/test/util/CriteriaHelper.java", + "javatests/src/org/chromium/content/browser/test/util/DOMUtils.java", + "javatests/src/org/chromium/content/browser/test/util/EqualityCriteria.java", + "javatests/src/org/chromium/content/browser/test/util/HistoryUtils.java", + "javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java", + "javatests/src/org/chromium/content/browser/test/util/KeyUtils.java", + "javatests/src/org/chromium/content/browser/test/util/MockLocationProvider.java", + "javatests/src/org/chromium/content/browser/test/util/MockOrientationObserver.java", + "javatests/src/org/chromium/content/browser/test/util/OrientationChangeObserverCriteria.java", + "javatests/src/org/chromium/content/browser/test/util/RenderProcessLimit.java", + "javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java", + "javatests/src/org/chromium/content/browser/test/util/TestContentViewClient.java", + "javatests/src/org/chromium/content/browser/test/util/TestInputMethodManagerWrapper.java", + "javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java", + "javatests/src/org/chromium/content/browser/test/util/TestWebContentsObserver.java", + "javatests/src/org/chromium/content/browser/test/util/TouchCommon.java", + "javatests/src/org/chromium/content/browser/test/util/UiUtils.java", + ] +} diff --git a/chromium/content/public/test/test_mojo_service.mojom b/chromium/content/public/test/test_mojo_service.mojom new file mode 100644 index 00000000000..06760f13202 --- /dev/null +++ b/chromium/content/public/test/test_mojo_service.mojom @@ -0,0 +1,20 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module content.mojom; + +interface TestMojoService { + // Doesn't actually do anything, just responds. + DoSomething() => (); + + // Terminates the current process to cause a connection error. Meant to test + // a connection error for the utility process. + DoTerminateProcess() => (); + + // Tries to create a temporary folder. Requires a sandbox to succeed. + CreateFolder() => (bool succeeded); + + // Retrieve the requestor name as seen by the test app providing this service. + GetRequestorName() => (string name); +}; diff --git a/chromium/content/shell/BUILD.gn b/chromium/content/shell/BUILD.gn new file mode 100644 index 00000000000..8804c4a0090 --- /dev/null +++ b/chromium/content/shell/BUILD.gn @@ -0,0 +1,719 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/sanitizers/sanitizers.gni") +import("//build/config/ui.gni") +import("//build/config/win/console_app.gni") +import("//build/config/win/manifest.gni") +import("//media/media_options.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//tools/grit/repack.gni") +import("//tools/grit/grit_rule.gni") +if (is_android) { + import("//build/config/android/config.gni") +} else if (is_mac) { + import("//build/config/mac/rules.gni") + import("//build_overrides/v8.gni") + import("//build/mac/tweak_info_plist.gni") +} + +declare_args() { + content_shell_product_name = "Content Shell" + content_shell_version = "99.77.34.5" +} + +config("content_shell_lib_warnings") { + if (is_clang) { + # TODO(thakis): Remove this once http://crbug.com/383820 is figured out + cflags = [ "-Wno-nonnull" ] + } +} + +static_library("content_shell_lib") { + testonly = true + sources = [ + "android/shell_descriptors.h", + "android/shell_jni_registrar.cc", + "android/shell_jni_registrar.h", + "android/shell_manager.cc", + "android/shell_manager.h", + "app/blink_test_platform_support.h", + "app/blink_test_platform_support_android.cc", + "app/blink_test_platform_support_linux.cc", + "app/blink_test_platform_support_mac.mm", + "app/blink_test_platform_support_win.cc", + "app/paths_mac.h", + "app/paths_mac.mm", + "app/shell_crash_reporter_client.cc", + "app/shell_crash_reporter_client.h", + "app/shell_main_delegate.cc", + "app/shell_main_delegate.h", + "app/shell_main_delegate_mac.h", + "app/shell_main_delegate_mac.mm", + "browser/layout_test/blink_test_controller.cc", + "browser/layout_test/blink_test_controller.h", + "browser/layout_test/layout_test_android.cc", + "browser/layout_test/layout_test_android.h", + "browser/layout_test/layout_test_bluetooth_adapter_provider.cc", + "browser/layout_test/layout_test_bluetooth_adapter_provider.h", + "browser/layout_test/layout_test_bluetooth_chooser_factory.cc", + "browser/layout_test/layout_test_bluetooth_chooser_factory.h", + "browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc", + "browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.h", + "browser/layout_test/layout_test_browser_context.cc", + "browser/layout_test/layout_test_browser_context.h", + "browser/layout_test/layout_test_browser_main.cc", + "browser/layout_test/layout_test_browser_main.h", + "browser/layout_test/layout_test_browser_main_parts.cc", + "browser/layout_test/layout_test_browser_main_parts.h", + "browser/layout_test/layout_test_content_browser_client.cc", + "browser/layout_test/layout_test_content_browser_client.h", + "browser/layout_test/layout_test_devtools_frontend.cc", + "browser/layout_test/layout_test_devtools_frontend.h", + "browser/layout_test/layout_test_download_manager_delegate.cc", + "browser/layout_test/layout_test_download_manager_delegate.h", + "browser/layout_test/layout_test_first_device_bluetooth_chooser.cc", + "browser/layout_test/layout_test_first_device_bluetooth_chooser.h", + "browser/layout_test/layout_test_javascript_dialog_manager.cc", + "browser/layout_test/layout_test_javascript_dialog_manager.h", + "browser/layout_test/layout_test_message_filter.cc", + "browser/layout_test/layout_test_message_filter.h", + "browser/layout_test/layout_test_notification_manager.cc", + "browser/layout_test/layout_test_notification_manager.h", + "browser/layout_test/layout_test_permission_manager.cc", + "browser/layout_test/layout_test_permission_manager.h", + "browser/layout_test/layout_test_push_messaging_service.cc", + "browser/layout_test/layout_test_push_messaging_service.h", + "browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc", + "browser/layout_test/layout_test_resource_dispatcher_host_delegate.h", + "browser/layout_test/layout_test_url_request_context_getter.cc", + "browser/layout_test/layout_test_url_request_context_getter.h", + "browser/layout_test/secondary_test_window_observer.cc", + "browser/layout_test/secondary_test_window_observer.h", + "browser/layout_test/test_info_extractor.cc", + "browser/layout_test/test_info_extractor.h", + "browser/shell.cc", + "browser/shell.h", + "browser/shell_access_token_store.cc", + "browser/shell_access_token_store.h", + "browser/shell_android.cc", + "browser/shell_application_mac.h", + "browser/shell_application_mac.mm", + "browser/shell_browser_context.cc", + "browser/shell_browser_context.h", + "browser/shell_browser_main.cc", + "browser/shell_browser_main.h", + "browser/shell_browser_main_parts.cc", + "browser/shell_browser_main_parts.h", + "browser/shell_browser_main_parts_mac.mm", + "browser/shell_content_browser_client.cc", + "browser/shell_content_browser_client.h", + "browser/shell_devtools_frontend.cc", + "browser/shell_devtools_frontend.h", + "browser/shell_devtools_manager_delegate.cc", + "browser/shell_devtools_manager_delegate.h", + "browser/shell_download_manager_delegate.cc", + "browser/shell_download_manager_delegate.h", + "browser/shell_javascript_dialog.h", + "browser/shell_javascript_dialog_mac.mm", + "browser/shell_javascript_dialog_manager.cc", + "browser/shell_javascript_dialog_manager.h", + "browser/shell_javascript_dialog_win.cc", + "browser/shell_login_dialog.cc", + "browser/shell_login_dialog.h", + "browser/shell_login_dialog_mac.mm", + "browser/shell_mac.mm", + "browser/shell_mojo_test_utils_android.cc", + "browser/shell_mojo_test_utils_android.h", + "browser/shell_net_log.cc", + "browser/shell_net_log.h", + "browser/shell_network_delegate.cc", + "browser/shell_network_delegate.h", + "browser/shell_permission_manager.cc", + "browser/shell_permission_manager.h", + "browser/shell_platform_data_aura.cc", + "browser/shell_platform_data_aura.h", + "browser/shell_plugin_service_filter.cc", + "browser/shell_plugin_service_filter.h", + "browser/shell_quota_permission_context.cc", + "browser/shell_quota_permission_context.h", + "browser/shell_resource_dispatcher_host_delegate.cc", + "browser/shell_resource_dispatcher_host_delegate.h", + "browser/shell_speech_recognition_manager_delegate.cc", + "browser/shell_speech_recognition_manager_delegate.h", + "browser/shell_url_request_context_getter.cc", + "browser/shell_url_request_context_getter.h", + "browser/shell_web_contents_view_delegate.h", + "browser/shell_web_contents_view_delegate_android.cc", + "browser/shell_web_contents_view_delegate_creator.h", + "browser/shell_web_contents_view_delegate_mac.mm", + "browser/shell_web_contents_view_delegate_win.cc", + "common/layout_test/layout_test_content_client.cc", + "common/layout_test/layout_test_content_client.h", + "common/layout_test/layout_test_messages.cc", + "common/layout_test/layout_test_messages.h", + "common/layout_test/layout_test_switches.cc", + "common/layout_test/layout_test_switches.h", + "common/leak_detection_result.h", + "common/shell_content_client.cc", + "common/shell_content_client.h", + "common/shell_messages.cc", + "common/shell_messages.h", + "common/shell_origin_trial_policy.cc", + "common/shell_origin_trial_policy.h", + "common/shell_switches.cc", + "common/shell_switches.h", + "common/shell_test_configuration.cc", + "common/shell_test_configuration.h", + "renderer/layout_test/blink_test_helpers.cc", + "renderer/layout_test/blink_test_helpers.h", + "renderer/layout_test/blink_test_runner.cc", + "renderer/layout_test/blink_test_runner.h", + "renderer/layout_test/layout_test_content_renderer_client.cc", + "renderer/layout_test/layout_test_content_renderer_client.h", + "renderer/layout_test/layout_test_render_frame_observer.cc", + "renderer/layout_test/layout_test_render_frame_observer.h", + "renderer/layout_test/layout_test_render_thread_observer.cc", + "renderer/layout_test/layout_test_render_thread_observer.h", + "renderer/layout_test/leak_detector.cc", + "renderer/layout_test/leak_detector.h", + "renderer/layout_test/test_media_stream_renderer_factory.cc", + "renderer/layout_test/test_media_stream_renderer_factory.h", + "renderer/layout_test/test_media_stream_video_renderer.cc", + "renderer/layout_test/test_media_stream_video_renderer.h", + "renderer/shell_content_renderer_client.cc", + "renderer/shell_content_renderer_client.h", + "renderer/shell_render_view_observer.cc", + "renderer/shell_render_view_observer.h", + "utility/shell_content_utility_client.cc", + "utility/shell_content_utility_client.h", + ] + + configs += [ + ":content_shell_lib_warnings", + "//build/config:precompiled_headers", + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "//build/config/compiler:no_size_t_to_int_warning", + + "//third_party/WebKit/public:debug_devtools", + ] + + defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ] + + public_deps = [ + # This exposes all public content APIs. + "//content/public/app:both", + "//content/public/browser", + "//content/public/common", + "//content/public/renderer", + "//content/public/utility", + ] + deps = [ + ":mojo_bindings", + ":resources", + "//base", + "//base:base_static", + "//base/third_party/dynamic_annotations", + "//cc", + "//components/crash/content/app:app_breakpad_mac_win_to_be_deleted", + "//components/devtools_discovery", + "//components/devtools_http_handler", + "//components/network_session_configurator:switches", + "//components/plugins/renderer", + "//components/test_runner:test_runner", + "//components/url_formatter", + "//components/web_cache/renderer", + "//content:resources", + "//content/app/resources", + "//content/app/strings", + "//content/gpu", + "//content/test:layouttest_support", + "//content/test:test_support", + "//device/bluetooth", + "//device/bluetooth:mocks", + "//gin", + "//gpu", + "//ipc", + "//media", + "//net", + "//net:net_resources", + "//skia", + "//storage/browser", + "//testing/gmock", + "//testing/gtest", + "//third_party/WebKit/public:blink", + "//third_party/WebKit/public:image_resources", + "//third_party/WebKit/public:resources", + "//third_party/WebKit/public:test_support", + "//third_party/icu", + "//ui/base", + "//ui/base/ime", + "//ui/events:events_base", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gfx/ipc", + "//ui/gfx/ipc/geometry", + "//ui/gfx/ipc/skia", + "//ui/gl", + "//url", + "//v8", + ] + if (enable_plugins) { + deps += [ + "//content/ppapi_plugin", + "//ppapi:blink_deprecated_test_plugin", + "//ppapi:blink_test_plugin", + "//ppapi/shared_impl", + ] + } + if (mojo_media_host == "browser") { + deps += [ "//media/mojo/services" ] + } + + if (is_win) { + sources += [ + "common/v8_breakpad_support_win.cc", + "common/v8_breakpad_support_win.h", + ] + } + + if (is_linux) { + deps += [ + "//build/linux:fontconfig", + "//ui/gfx:test_support", + ] + } + + if (use_x11) { + # Some tests rely on this tool at runtime. Note: it might be better if + # the tests that needed it had this as a dep instead of adding it here. + data_deps = [ + "//tools/xdisplaycheck", + ] + + deps += [ "//ui/events/devices/x11" ] + } + + if (is_android) { + deps += [ "//content/shell/android:content_shell_jni_headers" ] + } + + if (is_posix && !is_mac) { + deps += [ + "//components/crash/content/app", + "//components/crash/content/browser", + ] + } + + if (use_aura) { + deps += [ + "//ui/aura", + "//ui/aura:test_support", + "//ui/events", + "//ui/strings", + "//ui/wm", + ] + + if (toolkit_views) { + sources += [ "browser/shell_views.cc" ] + deps += [ + "//ui/resources", + "//ui/views", + "//ui/views:test_support", + "//ui/views/controls/webview", + "//ui/wm:test_support", + ] + } else { + sources += [ "browser/shell_aura.cc" ] + } + } else { + sources -= [ + "browser/shell_platform_data_aura.cc", + "browser/shell_platform_data_aura.h", + ] + } + + if (is_chromeos) { + deps += [ + "//chromeos", + "//ui/wm:test_support", + ] + } + + if (is_linux) { + deps += [ "//third_party/freetype2" ] + } + + if (!enable_plugins) { + sources -= [ + "browser/shell_plugin_service_filter.cc", + "browser/shell_plugin_service_filter.h", + ] + } +} + +grit("content_shell_resources_grit") { + # External code should depend on ":resources" instead. + visibility = [ ":*" ] + source = "shell_resources.grd" + outputs = [ + "grit/shell_resources.h", + "shell_resources.pak", + ] +} + +copy("copy_shell_resources") { + sources = [ + "$target_gen_dir/shell_resources.pak", + ] + outputs = [ + "$root_out_dir/shell_resources.pak", + ] + + public_deps = [ + ":content_shell_resources_grit", + ] +} + +group("resources") { + public_deps = [ + ":copy_shell_resources", + ] + deps = [ + "//components/test_runner:resources", + ] +} + +repack("pak") { + sources = [ + "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak", + "$root_gen_dir/blink/public/resources/blink_resources.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", + "$root_gen_dir/content/app/strings/content_strings_en-US.pak", + "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/shell/shell_resources.pak", + "$root_gen_dir/net/net_resources.pak", + "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", + "$root_gen_dir/ui/resources/webui_resources.pak", + "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", + "$root_gen_dir/ui/strings/ui_strings_en-US.pak", + ] + + deps = [ + ":resources", + "//content:resources", + "//content/app/resources", + "//content/app/strings", + "//content/browser/tracing:resources", + "//net:net_resources", + "//third_party/WebKit/public:image_resources", + "//third_party/WebKit/public:resources", + "//ui/resources", + "//ui/strings", + ] + + if (toolkit_views) { + deps += [ "//ui/views/resources" ] + sources += + [ "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak" ] + } + + sources += [ "$root_gen_dir/blink/devtools_resources.pak" ] + deps += [ "//content/browser/devtools:resources" ] + output = "$root_out_dir/content_shell.pak" +} + +if (is_android) { + group("content_shell") { + testonly = true + deps = [ + "//content/shell/android:content_shell_apk", + ] + } +} else if (is_mac) { + tweak_info_plist("content_shell_plist") { + testonly = true + info_plist = "app/app-Info.plist" + args = [ + "--scm=1", + "--version", + content_shell_version, + ] + } + mac_app_bundle("content_shell") { + testonly = true + output_name = content_shell_product_name + sources = [ + "app/shell_main.cc", + ] + deps = [ + ":content_shell_framework_bundle_data", + ":content_shell_resources_bundle_data", + + # TODO(rsesek): Remove this after GYP is gone, since it only needs to + # be here per the comment in blink_test_platform_support_mac.mm about + # the bundle structure. + "//components/test_runner:resources", + ] + ldflags = [ + # The main app is at Content Shell.app/Contents/MacOS/Content Shell + # so set the rpath up to Contents/ so that the loader can find + # Framworks/. + "-rpath", + "@executable_path/../", + ] + info_plist_target = ":content_shell_plist" + } +} else { + # TODO(brettw) when GYP is no longer necessary, delete + # content/shell/app/shell.exe.manifest. This file is not used in GN. + executable("content_shell") { + testonly = true + + # TODO(GYP) mac resource bundle stuff for this target. + sources = [ + "app/shell_main.cc", + ] + + if (is_win) { + sources += [ "app/shell.rc" ] + } + + defines = [] + + deps = [ + ":content_shell_lib", + ":pak", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (is_win) { + deps += [ "//sandbox" ] + + # This is a large module that can't do incremental linking in some cases. + configs -= [ "//build/config/win:default_incremental_linking" ] + configs += + [ "//build/config/win:default_large_module_incremental_linking" ] + if (win_console_app) { + defines += [ "WIN_CONSOLE_APP" ] + } else { + # Set /SUBSYSTEM:WINDOWS unless a console build has been requested. + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + } + } + + if (is_linux && !is_component_build) { + # Set rpath to find our own libfreetype even in a non-component build. + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + } +} + +if (is_win) { + # GYP version: content/content_shell_and_tests.gyp:content_shell_crash_service + executable("content_shell_crash_service") { + sources = [ + "tools/content_shell_crash_service.cc", + ] + + deps = [ + "//base", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//components/crash/content/tools:crash_service", + ] + + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + } +} + +if (is_mac) { + mac_xib_bundle_data("content_shell_framework_xibs") { + sources = [ + "app/English.lproj/HttpAuth.xib", + "app/English.lproj/MainMenu.xib", + ] + output_path = "{{bundle_resources_dir}}/English.lproj" + } + + bundle_data("content_shell_framework_resources") { + sources = [ + "$root_out_dir/content_shell.pak", + "$root_out_dir/icudtl.dat", + "resources/missingImage.png", + "resources/textAreaResizeCorner.png", + ] + + public_deps = [ + ":pak", + ] + + deps = [ + "//third_party/icu:icudata", + ] + + if (v8_use_external_startup_data) { + sources += [ + "$root_out_dir/natives_blob.bin", + "$root_out_dir/snapshot_blob.bin", + ] + public_deps += [ "//v8" ] + } + + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } + + if (enable_plugins) { + bundle_data("content_shell_framework_plugins") { + sources = [ + "$root_out_dir/blink_deprecated_test_plugin.plugin", + "$root_out_dir/blink_test_plugin.plugin", + ] + + outputs = [ + "{{bundle_root_dir}}/{{source_file_part}}", + ] + + public_deps = [ + "//ppapi:blink_deprecated_test_plugin", + "//ppapi:blink_test_plugin", + ] + } + } + + content_shell_framework_name = "$content_shell_product_name Framework" + content_shell_helper_name = "$content_shell_product_name Helper" + + tweak_info_plist("content_shell_framework_plist") { + testonly = true + info_plist = "app/framework-Info.plist" + args = [ + "--breakpad=1", + "--keystone=0", + "--scm=1", + "--version", + content_shell_version, + "--branding", + content_shell_product_name, + ] + } + + mac_framework_bundle("content_shell_framework") { + testonly = true + + output_name = content_shell_framework_name + + sources = [ + "app/shell_content_main.cc", + "app/shell_content_main.h", + ] + + # TODO(rsesek): Handle these missing pieces: + # - crash_inspector + # - crash_report_sender.app + + deps = [ + ":content_shell_framework_resources", + ":content_shell_framework_xibs", + ":content_shell_lib", + "//third_party/icu:icudata", + ] + + if (enable_plugins) { + deps += [ ":content_shell_framework_plugins" ] + } + + # Both the main :content_shell and :content_shell_helper_app executables + # need to link the framework. Because they are at different directory + # depths, using @executable_path as the install_name would require using + # install_name_tool on one of the executables. However install_name_tool + # only operates in-place, which is problematic to express in GN. Instead, + # use rpath-based loading. + # TODO(rsesek): After GYP is gone, re-write content_shell_main to be like + # chrome_main and use dlopen() instead of a linked framework. + ldflags = [ "-Wl,-install_name,@rpath/Frameworks/$output_name.framework/$output_name" ] + + if (is_component_build) { + # Set up the rpath for the framework so that it can find dylibs in the + # root output directory. The framework is at + # Content Shell.app/Contents/Frameworks/Content Shell Framework.framework/Content Shell Framework + # so use loader_path to go back to the root output directory. + ldflags += [ + "-rpath", + "@loader_path/../../../..", + ] + } + + info_plist_target = ":content_shell_framework_plist" + } + + tweak_info_plist("content_shell_helper_plist") { + testonly = true + info_plist = "app/helper-Info.plist" + args = [ + "--breakpad=0", + "--keystone=0", + "--scm=0", + "--version", + content_shell_version, + ] + } + + mac_app_bundle("content_shell_helper_app") { + testonly = true + output_name = content_shell_helper_name + sources = [ + "app/shell_main.cc", + ] + deps = [ + ":content_shell_framework+link", + ] + ldflags = [ + # The helper is in Content Shell.app/Contents/Frameworks/Content Shell Helper.app/Contents/MacOS/ + # so set rpath up to Contents/ so that the loader can find Frameworks/. + "-rpath", + "@executable_path/../../../..", + ] + info_plist_target = ":content_shell_helper_plist" + } + + bundle_data("content_shell_framework_bundle_data") { + testonly = true + sources = [ + "$root_out_dir/$content_shell_framework_name.framework", + "$root_out_dir/$content_shell_helper_name.app", + ] + outputs = [ + "{{bundle_root_dir}}/Frameworks/{{source_file_part}}", + ] + public_deps = [ + ":content_shell_framework+link", + ":content_shell_helper_app", + ] + } + + bundle_data("content_shell_resources_bundle_data") { + testonly = true + sources = [ + "app/app.icns", + ] + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } +} + +mojom("mojo_bindings") { + sources = [ + "common/layout_test/layout_test_bluetooth_fake_adapter_setter.mojom", + ] +} diff --git a/chromium/content/shell/android/BUILD.gn b/chromium/content/shell/android/BUILD.gn new file mode 100644 index 00000000000..b3393463a17 --- /dev/null +++ b/chromium/content/shell/android/BUILD.gn @@ -0,0 +1,247 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") +import("//build_overrides/v8.gni") +import("//third_party/icu/config.gni") + +generate_jni("content_shell_jni_headers") { + jni_package = "content/shell" + sources = [ + "java/src/org/chromium/content_shell/Shell.java", + "java/src/org/chromium/content_shell/ShellLayoutTestUtils.java", + "java/src/org/chromium/content_shell/ShellManager.java", + "java/src/org/chromium/content_shell/ShellMojoTestUtils.java", + ] +} + +shared_library("libcontent_shell_content_view") { + testonly = true + deps = [ + ":content_shell_jni_headers", + "//build/config/sanitizers:deps", + "//components/crash/content/browser", + "//content/shell:content_shell_lib", + "//content/shell:pak", + "//media/base/android", + "//skia", + ] + sources = [ + "shell_library_loader.cc", + ] +} + +android_resources("content_shell_java_resources") { + testonly = true + resource_dirs = [ "java/res" ] + custom_package = "org.chromium.content_shell" +} + +android_library("content_shell_java") { + testonly = true + deps = [ + ":content_shell_java_resources", + "//base:base_java", + "//content/public/android:content_java", + "//media/base/android:media_java", + "//media/capture/video/android:capture_java", + "//mojo/public/java:system", + "//net/android:net_java", + "//ui/android:ui_java", + ] + java_files = [ + "java/src/org/chromium/content_shell/Shell.java", + "java/src/org/chromium/content_shell/ShellLayoutTestUtils.java", + "java/src/org/chromium/content_shell/ShellManager.java", + "java/src/org/chromium/content_shell/ShellMojoTestUtils.java", + ] +} + +content_shell_manifest = + "$target_gen_dir/content_shell_manifest/AndroidManifest.xml" + +jinja_template("content_shell_manifest") { + testonly = true + input = "shell_apk/AndroidManifest.xml.jinja2" + output = content_shell_manifest +} + +android_resources("content_shell_apk_resources") { + testonly = true + resource_dirs = [ "shell_apk/res" ] + deps = [ + ":content_shell_java_resources", + ] + android_manifest = content_shell_manifest + android_manifest_dep = ":content_shell_manifest" +} + +android_library("content_shell_apk_java") { + testonly = true + deps = [ + ":content_shell_apk_resources", + ":content_shell_java", + "//base:base_java", + "//content/public/android:content_java", + "//media/capture/video/android:capture_java", + "//net/android:net_java", + "//ui/android:ui_java", + ] + java_files = [ + "shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java", + "shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java", + ] +} + +android_assets("content_shell_assets") { + sources = [ + "$root_out_dir/content_shell.pak", + ] + disable_compression = true + deps = [ + "//content/shell:pak", + "//third_party/icu:icu_assets", + "//v8:v8_external_startup_data_assets", + ] +} + +android_apk("content_shell_apk") { + testonly = true + deps = [ + ":content_shell_apk_java", + ":content_shell_assets", + ":content_shell_java", + "//base:base_java", + "//content/public/android:content_java", + "//content/public/test/android:layouttest_java_support", + "//media/capture/video/android:capture_java", + "//net/android:net_java", + "//third_party/mesa:osmesa", + "//ui/android:ui_java", + ] + apk_name = "ContentShell" + android_manifest = content_shell_manifest + android_manifest_dep = ":content_shell_manifest" + shared_libraries = [ ":libcontent_shell_content_view" ] + loadable_modules = [ "$root_out_dir/libosmesa.so" ] +} + +android_library("content_shell_test_java") { + testonly = true + deps = [ + ":content_shell_apk_java", + ":content_shell_java", + "//base:base_java", + "//base:base_java_test_support", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//content/shell/android:content_shell_java", + ] + java_files = [ + "javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java", + "javatests/src/org/chromium/content_shell_apk/ContentShellShellManagementTest.java", + "javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java", + "javatests/src/org/chromium/content_shell_apk/ContentShellUrlTest.java", + ] +} + +instrumentation_test_apk("content_shell_test_apk") { + deps = [ + "//base:base_javatests", + "//content/public/android:content_javatests", + "//net/android:net_javatests", + ] + data_deps = [ + ":content_shell_apk", + ] + apk_under_test = ":content_shell_apk" + apk_name = "ContentShellTest" + android_manifest = "javatests/AndroidManifest.xml" + isolate_file = "../../content_shell_test_data.isolate" +} + +if (current_cpu != "x64") { + chromium_linker_test_manifest = + "$target_gen_dir/linker_test_apk/AndroidManifest.xml" + + jinja_template("chromium_linker_test_manifest") { + testonly = true + input = "linker_test_apk/AndroidManifest.xml.jinja2" + output = chromium_linker_test_manifest + } + + android_resources("linker_resources") { + testonly = true + resource_dirs = [ "linker_test_apk/res" ] + android_manifest = chromium_linker_test_manifest + android_manifest_dep = ":chromium_linker_test_manifest" + } + + # GYP: //content/content_tests.gypi:chromium_linker_test_apk + android_apk("chromium_linker_test_apk") { + testonly = true + deps = [ + ":content_shell_assets", + ":content_shell_java", + ":linker_resources", + "//base:base_java", + "//content/public/android:content_java", + "//ui/android:ui_java", + ] + android_manifest = chromium_linker_test_manifest + android_manifest_dep = ":chromium_linker_test_manifest" + apk_name = "ChromiumLinkerTest" + java_files = [ + "linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestActivity.java", + "linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestApplication.java", + "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java", + ] + shared_libraries = [ ":linker_test" ] + use_chromium_linker = true + enable_chromium_linker_tests = true + } + + # GYP: //content/content_tests.gypi:chromium_android_linker_test + shared_library("linker_test") { + testonly = true + sources = [ + "linker_test_apk/chromium_linker_test_android.cc", + "linker_test_apk/chromium_linker_test_linker_tests.cc", + ] + + deps = [ + ":linker_test_jni_headers", + "//build/config/sanitizers:deps", + "//content/shell:content_shell_lib", + + # Required to include "content/public/browser/android/compositor.h" + # in chromium_linker_test_android.cc :-( + "//skia", + "//third_party/re2", + ] + } + + # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers + generate_jni("linker_test_jni_headers") { + testonly = true + jni_package = "content/shell" + sources = [ + "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java", + ] + } +} + +# GYP: //content/content_tests.gypi:content_shell_browsertests_java" +android_library("content_shell_browsertests_java") { + testonly = true + deps = [ + ":content_shell_java", + "//base:base_java", + "//content/public/android:content_java", + "//testing/android/native_test:native_test_java", + "//ui/android:ui_java", + ] + java_files = [ "browsertests/src/org/chromium/content_shell/browsertests/ContentShellBrowserTestActivity.java" ] +} diff --git a/chromium/content/test/BUILD.gn b/chromium/content/test/BUILD.gn new file mode 100644 index 00000000000..2f0d2f9d34e --- /dev/null +++ b/chromium/content/test/BUILD.gn @@ -0,0 +1,931 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") +import("//build/config/compiler/compiler.gni") +import("//build/config/crypto.gni") +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//build_overrides/v8.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/libfuzzer/fuzzer_test.gni") +import("//testing/test.gni") + +content_tests_gypi_values = + exec_script("//build/gypi_to_gn.py", + [ + rebase_path("../content_tests.gypi"), + "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir", + ], + "scope", + [ "../content_tests.gypi" ]) + +# GYP version //content/content_tests.gypi:test_support_content +# +# Use a static library here because many test binaries depend on this but don't +# require many files from it. This makes linking more efficient. +static_library("test_support") { + testonly = true + + # See comment at the top of //content/BUILD.gn for why this is disabled in + # component builds. + if (is_component_build) { + check_includes = false + } + + configs += [ + "//build/config:precompiled_headers", + "//v8:external_startup_data", + ] + + public_deps = [ + "//content/public/app:both", + "//content/public/browser", + "//content/public/common", + "//third_party/WebKit/public:blink", + "//third_party/WebKit/public:test_support", + ] + deps = [ + ":browsertest_base", + ":content_test_mojo_bindings", + "//base/third_party/dynamic_annotations", + "//cc", + "//cc:test_support", + "//cc/blink", + "//cc/ipc", + "//cc/surfaces", + "//components/display_compositor", + "//components/scheduler:scheduler", + "//components/scheduler:test_support", + "//content/app:both_for_content_tests", + "//content/browser:for_content_tests", + "//content/browser/speech/proto", + "//content/child:for_content_tests", + "//content/gpu", + "//content/public/browser", + "//content/public/child", + "//content/public/renderer", + "//content/public/utility", + "//content/renderer:for_content_tests", + "//content/shell:pak", + "//content/utility:for_content_tests", + "//device/nfc:mojo_bindings", + "//ipc:test_support", + "//media", + "//media/capture", + "//media/mojo/interfaces:image_capture", + "//mojo/edk/system", + "//mojo/edk/test:test_support", + "//net:test_support", + "//services/shell/public/cpp", + "//skia", + "//storage/browser", + "//storage/common", + "//testing/gmock", + "//testing/gtest", + "//ui/accessibility:ax_gen", + "//ui/base", + "//ui/base:test_support", + "//ui/base:ui_data_pack", + "//ui/base/ime", + "//ui/compositor:test_support", + "//ui/display", + "//ui/events:dom_keycode_converter", + "//ui/events:events_base", + "//ui/events:gesture_detection", + "//ui/events:test_support", + "//ui/gfx:test_support", + "//ui/gl", + "//ui/gl:test_support", + "//ui/resources", + "//ui/surface", + "//url", + "//v8", + ] + + sources = rebase_path(content_tests_gypi_values.test_support_content_sources, + ".", + "//content") + + if (is_android) { + sources -= [ + "mock_google_streaming_server.cc", + "mock_google_streaming_server.h", + ] + } + + if (enable_plugins) { + deps += [ + "//content/ppapi_plugin", + "//ppapi/host", + "//ppapi/proxy", + "//ppapi/proxy:test_support", + "//ppapi/shared_impl", + "//ppapi/shared_impl:test_support", + ] + } else { + sources -= [ "ppapi_unittest.cc" ] + } + + if (enable_webrtc) { + sources += [ + "../renderer/media/mock_data_channel_impl.cc", + "../renderer/media/mock_data_channel_impl.h", + "../renderer/media/mock_media_stream_dispatcher.cc", + "../renderer/media/mock_media_stream_dispatcher.h", + "../renderer/media/mock_peer_connection_impl.cc", + "../renderer/media/mock_peer_connection_impl.h", + "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc", + "../renderer/media/mock_web_rtc_peer_connection_handler_client.h", + "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc", + "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h", + ] + + deps += [ + "//third_party/libjingle:libjingle_webrtc", + "//third_party/webrtc/base:rtc_base", + "//third_party/webrtc/modules/video_capture", + ] + } + + if (use_glib) { + configs += [ "//build/config/linux:glib" ] + } + + if (use_aura) { + deps += [ + "//ui/aura:test_support", + "//ui/resources:ui_test_pak", + "//ui/wm", + ] + } + + if (use_aura || is_mac) { + deps += [ + "//third_party/libvpx", + "//ui/compositor", + ] + + sources += [ + "../browser/compositor/test/no_transport_image_transport_factory.cc", + "../browser/compositor/test/no_transport_image_transport_factory.h", + ] + } + + if (use_ozone) { + deps += [ "//ui/ozone" ] + } + + if (is_win) { + deps += [ + "//content:sandbox_helper_win", + "//third_party/iaccessible2", + ] + } + + if (is_android) { + deps += [ + "//media/capture/video/android:android", + "//ui/android", + "//ui/shell_dialogs", + ] + } + + if (is_win) { + deps += [ "//sandbox" ] + } + + if (v8_use_external_startup_data) { + deps += [ "//gin:gin" ] + } + + if (is_mac) { + deps += [ "//ui/accelerated_widget_mac" ] + } +} + +# browsertest_support can be used by targets that run content_shell based +# browser tests. +source_set("browsertest_support") { + testonly = true + + # See comment at the top of //content/BUILD.gn for why this is disabled in + # component builds. + if (is_component_build) { + check_includes = false + } + + sources = [ + "../public/test/content_browser_test.cc", + "../public/test/content_browser_test.h", + "../public/test/content_browser_test_utils.cc", + "../public/test/content_browser_test_utils.h", + "../public/test/content_browser_test_utils_mac.mm", + "content_browser_test_utils_internal.cc", + "content_browser_test_utils_internal.h", + "content_test_launcher.cc", + ] + + deps = [ + ":browsertest_base", + ":test_support", + "//base", + "//base:i18n", + "//base/test:test_config", + "//base/test:test_support", + "//cc/surfaces", + "//content/app:both_for_content_tests", + "//content/browser:for_content_tests", + "//content/shell:content_shell_lib", + "//gin", + "//media", + "//net", + "//skia", + "//testing/gtest", + "//ui/accessibility:ax_gen", + "//ui/base", + "//ui/base/ime", + ] + + if (is_android) { + deps += [ "//content/public/app:both" ] + } else { + deps += [ "//content/public/browser" ] + } + + configs += [ "//v8:external_startup_data" ] +} + +# browsertest_base can be used by any browser test target. +source_set("browsertest_base") { + testonly = true + + sources = [ + "../public/test/browser_test.h", + "../public/test/browser_test_base.cc", + "../public/test/browser_test_base.h", + "../public/test/browser_test_utils.cc", + "../public/test/browser_test_utils.h", + ] + + public_deps = [ + "//content/browser:for_content_tests", + "//content/public/browser", + "//content/public/common", + "//third_party/WebKit/public:blink", + ] + deps = [ + "//base:base", + "//content/public/app:both", + "//net:test_support", + "//testing/gtest", + "//ui/accessibility", + "//ui/base", + "//ui/base:test_support", + "//ui/base/ime", + "//ui/events:dom_keycode_converter", + "//ui/events:events_base", + "//ui/events:gesture_detection", + "//ui/resources", + ] +} + +mojom("content_test_mojo_bindings") { + sources = [ + "../public/test/test_mojo_service.mojom", + ] +} + +mojom("web_ui_test_mojo_bindings") { + sources = [ + "data/web_ui_test_mojo_bindings.mojom", + ] +} + +# GYP version //content/content_tests.gypi:layouttest_support_content +static_library("layouttest_support") { + testonly = true + + # See comment at the top of //content/BUILD.gn for why this is disabled in + # component builds. + if (is_component_build) { + check_includes = false + } + + sources = + rebase_path(content_tests_gypi_values.layouttest_support_content_sources, + ".", + "//content") + + deps = [ + ":test_support", + "//cc", + "//cc/blink", + "//components/scheduler:test_support", + "//components/test_runner:test_runner", + "//content/browser:for_content_tests", + "//content/public/common", + + #"//content/shell:content_shell_lib", + "//content/renderer:for_content_tests", + "//skia", + "//ui/accessibility:ax_gen", + "//v8", + ] + + if (is_android) { + deps += [ "//content/public/test/android:test_support_content_jni_headers" ] + } +} + +if (is_android) { + import("//build/config/android/rules.gni") + + jinja_template("content_browsertests_manifest") { + testonly = true + input = + "//content/shell/android/browsertests_apk/AndroidManifest.xml.jinja2" + output = + "${target_gen_dir}/content_browsertests_manifest/AndroidManifest.xml" + } + + android_library("content_browsertests_java") { + testonly = true + java_files = [ + "../shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java", + "../shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java", + ] + deps = [ + ":content_browsertests_resources", + "//base:base_java", + "//base:base_java_test_support", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//content/shell/android:content_shell_browsertests_java", + "//testing/android/native_test:native_test_java", + "//ui/android:ui_java", + ] + } + + android_resources("content_browsertests_resources") { + testonly = true + resource_dirs = [ "//content/shell/android/browsertests_apk/res" ] + custom_package = "org.chromium.content_browsertests_apk" + } +} + +# TODO(GYP_GONE): Delete this after we've converted everything to GN. +# The _run targets exist only for compatibility w/ GYP. +group("content_site_isolation_browsertests_run") { + testonly = true + deps = [ + ":content_browsertests", + ] +} + +group("content_site_isolation_browsertests") { + testonly = true + data = [ + "//testing/buildbot/filters/site-per-process.content_browsertests.filter", + ] + data_deps = [ + ":content_browsertests", + ] +} + +test("content_browsertests") { + # See comment at the top of //content/BUILD.gn for why this is disabled in + # component builds. + if (is_component_build) { + check_includes = false + } + + sources = rebase_path(content_tests_gypi_values.content_browsertests_sources, + ".", + "//content") + + if (is_android || is_linux || is_mac || is_win) { + data = [ + "$root_out_dir/content_shell.pak", + "data/", + "//media/test/data/", + ] + + if (!is_android) { + data += [ + "//net/tools/testserver/", + "//ppapi/tests/test_case.html", + "//ppapi/tests/test_page.css", + "//third_party/pyftpdlib/", + "//third_party/pywebsocket/", + "//third_party/tlslite/", + ] + + if (is_mac) { + data += [ "$root_out_dir/Content Shell.app/" ] + } + if (is_win) { + if (symbol_level != 0) { + data += [ "$root_out_dir/content_browsertests.exe.pdb" ] + } + } + if (is_linux) { + data += [ "//testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter" ] + } + } + } + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + configs += [ + "//build/config:precompiled_headers", + "//build/config/compiler:no_size_t_to_int_warning", + ] + + deps = [ + ":browsertest_base", + ":browsertest_support", + ":content_test_mojo_bindings", + ":web_ui_test_mojo_bindings", + "//base/test:test_support", + "//components/scheduler", + "//content:resources", + "//content/app:both_for_content_tests", + "//content/browser:for_content_tests", + "//content/browser/background_sync:background_sync_proto", + "//content/common:mojo_bindings", + "//content/gpu", + "//content/public/browser", + "//content/public/child", + "//content/public/common", + "//content/public/renderer", + "//content/renderer:for_content_tests", + "//content/shell:content_shell_lib", + "//content/shell:pak", + "//content/test:test_support", + "//device/battery", + "//device/battery:mojo_bindings", + "//device/power_save_blocker", + "//device/vibration:mojo_bindings", + "//gin", + "//gpu", + "//ipc:test_support", + "//media", + "//media:test_support", + "//media/audio:test_support", + "//media/base:test_support", + "//mojo/public/cpp/bindings", + "//mojo/public/js", + "//net:test_support", + "//services/shell/public/cpp", + "//storage/browser", + "//testing/gmock", + "//testing/gtest", + "//third_party/WebKit/public:blink", + "//third_party/leveldatabase", + "//third_party/mesa:osmesa", + "//third_party/zlib", + "//ui/accessibility", + "//ui/accessibility:ax_gen", + "//ui/base:test_support", + "//ui/base/ime", + "//ui/compositor", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gl", + "//ui/gl:test_support", + "//ui/resources", + "//ui/shell_dialogs", + "//ui/snapshot", + ] + + data_deps = [ + "//third_party/mesa:osmesa", + ] + + if (enable_plugins) { + deps += [ + "//ppapi/host", + "//ppapi/proxy", + "//ppapi/proxy:ipc", + "//ppapi/shared_impl:test_support", + ] + data_deps += [ "//ppapi:ppapi_tests" ] + if (is_mac) { + data += [ "$root_out_dir/ppapi_tests.plugin/" ] + } + } + + if (is_win) { + sources += + rebase_path(content_tests_gypi_values.content_browsertests_win_sources, + ".", + "//content") + + deps += [ + "//content/app/strings", + "//net:net_resources", + "//third_party/WebKit/public:resources", + "//third_party/iaccessible2", + "//third_party/isimpledom", + ] + + libs = [ "oleacc.lib" ] + } + + if (is_android) { + sources += rebase_path( + content_tests_gypi_values.content_browsertests_android_sources, + ".", + "//content") + sources -= [ + "../browser/battery_status/battery_monitor_impl_browsertest.cc", + "../browser/media/session/media_session_delegate_default_browsertest.cc", + ] + deps += [ + ":content_browsertests_java", + "//content/shell:content_shell_lib", + "//content/shell/android:content_shell_assets", + "//content/shell/android:content_shell_jni_headers", + "//testing/android/native_test:native_test_support", + ] + deps -= [ "//device/battery" ] + android_manifest = + "${target_gen_dir}/content_browsertests_manifest/AndroidManifest.xml" + android_manifest_dep = ":content_browsertests_manifest" + use_default_launcher = false + } + + if (is_mac) { + sources += [ "../renderer/external_popup_menu_browsertest.cc" ] + deps += [ "//content/shell:content_shell" ] + } + + if (use_aura && !is_win) { + deps += [ "//ui/events:test_support" ] + } + + if (!use_aura && !is_mac) { + sources -= + [ "../browser/compositor/image_transport_factory_browsertest.cc" ] + } + + if (enable_webrtc) { + sources += rebase_path( + content_tests_gypi_values.content_browsertests_webrtc_sources, + ".", + "//content") + deps += [ "//testing/perf" ] + } + + if (enable_plugins) { + sources += rebase_path( + content_tests_gypi_values.content_browsertests_plugins_sources, + ".", + "//content") + deps += [ "//ppapi/proxy:test_support" ] + data_deps += [ "//ppapi:ppapi_tests" ] + } + + if (enable_web_speech) { + sources += rebase_path( + content_tests_gypi_values.content_browsertests_speech_sources, + ".", + "//content") + } + + if (!is_chrome_branded) { + sources += rebase_path( + content_tests_gypi_values.content_browsertests_unofficial_build_sources, + ".", + "//content") + } + + if (use_aura) { + deps += [ + "//ui/aura", + "//ui/touch_selection:test_support", + "//ui/touch_selection:touch_selection", + ] + } else { + sources -= [ + "../browser/accessibility/touch_accessibility_aura_browsertest.cc", + "../browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc", + "../browser/web_contents/web_contents_view_aura_browsertest.cc", + ] + } +} + +test("content_unittests") { + # See comment at the top of //content/BUILD.gn for why this is disabled in + # component builds. + if (is_component_build) { + check_includes = false + } + + defines = [] + sources = rebase_path(content_tests_gypi_values.content_unittests_sources, + ".", + "//content") + + if (is_android || is_linux || is_mac || is_win) { + data = [ + "$root_out_dir/content_shell.pak", + "data/", + "//media/test/data/", + ] + } + + configs += [ "//build/config:precompiled_headers" ] + + deps = [ + ":content_test_mojo_bindings", + ":test_support", + "//base/test:test_support", + "//base/third_party/dynamic_annotations", + "//cc", + "//cc:test_support", + "//cc/ipc", + "//cc/surfaces", + "//components/display_compositor", + "//components/scheduler", + "//content:resources", + "//content/app:both_for_content_tests", + "//content/browser:for_content_tests", + "//content/browser/cache_storage:cache_storage_proto", + "//content/browser/notifications:notification_proto", + "//content/browser/service_worker:service_worker_proto", + "//content/browser/speech/proto", + "//content/child:for_content_tests", + "//content/common:mojo_bindings", + "//content/gpu", + "//content/public/browser", + "//content/public/child", + "//content/public/common", + "//content/public/renderer", + "//content/renderer:for_content_tests", + "//crypto", + "//device/battery", + "//device/battery:mojo_bindings", + "//device/bluetooth", + "//device/bluetooth:mocks", + "//device/gamepad", + "//device/gamepad:test_helpers", + "//gin", + "//gpu", + "//gpu:test_support", + "//ipc:test_support", + "//media:shared_memory_support", + "//media:test_support", + "//media/audio:test_support", + "//media/base:test_support", + "//media/capture", + "//media/midi:midi", + "//mojo/edk/test:test_support", + "//mojo/public/cpp/bindings", + "//net:extras", + "//net:test_support", + "//ppapi/c", + "//printing", + "//skia", + "//sql", + "//sql:test_support", + "//storage/browser", + "//storage/common", + "//testing/gmock", + "//testing/gtest", + "//third_party/WebKit/public:blink", + "//third_party/WebKit/public:mojo_bindings", + "//third_party/icu", + "//third_party/leveldatabase", + "//third_party/libjingle", + "//third_party/re2", + "//third_party/widevine/cdm:version_h", + "//ui/accessibility", + "//ui/base:test_support", + "//ui/compositor:test_support", + "//ui/display", + "//ui/display:test_support", + "//ui/events/blink", + "//ui/gfx:test_support", + "//ui/gfx/geometry", + "//ui/gfx/ipc", + "//ui/gfx/ipc/skia", + "//ui/gl", + "//ui/gl:test_support", + ] + + data_deps = [ + "//third_party/mesa:osmesa", + ] + + if (!is_win) { + sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ] + } + + if (enable_plugins) { + sources += + rebase_path(content_tests_gypi_values.content_unittests_plugins_sources, + ".", + "//content") + deps += [ + "//ppapi/host", + "//ppapi/proxy:test_support", + "//ppapi/shared_impl:test_support", + ] + } + + if (enable_webrtc) { + sources += + rebase_path(content_tests_gypi_values.content_unittests_webrtc_sources, + ".", + "//content") + deps += [ + "//media/blink", + "//third_party/libjingle:libjingle_webrtc", + "//third_party/webrtc/base:rtc_base", + "//third_party/webrtc/modules/desktop_capture:primitives", + "//third_party/webrtc/modules/video_capture", + "//ui/shell_dialogs:shell_dialogs", + ] + + if (is_linux || is_mac || is_win) { + sources += + [ "../browser/media/capture/desktop_capture_device_unittest.cc" ] + deps += [ "//third_party/webrtc/modules/desktop_capture" ] + } + + if (is_chromeos) { + sources += + [ "../browser/media/capture/desktop_capture_device_aura_unittest.cc" ] + } + + if (is_android || is_chromecast) { + sources -= [ + "../renderer/media/audio_track_recorder_unittest.cc", + "../renderer/media/media_recorder_handler_unittest.cc", + "../renderer/media/video_track_recorder_unittest.cc", + ] + } + } + + if (enable_webrtc && enable_plugins) { + sources += rebase_path( + content_tests_gypi_values.content_unittests_plugin_webrtc_sources, + ".", + "//content") + } + + if (enable_web_speech) { + sources += + rebase_path(content_tests_gypi_values.content_unittests_speech_sources, + ".", + "//content") + } + + if (is_linux) { + if (use_dbus) { + deps += [ "//dbus:test_support" ] + } else { + sources -= + [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ] + } + } + if (is_win) { + deps += [ "//third_party/iaccessible2" ] + } + if (is_mac) { + # These flags are needed to run the test on Mac. + # Search for comments about "xcode_settings" in chrome_tests.gypi. + ldflags = [ "-Wl,-ObjC" ] + + deps += [ + "//third_party/mozilla", + "//third_party/ocmock", + "//ui/accelerated_widget_mac", + ] + } + if (is_chromeos) { + sources -= [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ] + deps += [ "//chromeos" ] + } + if (is_android) { + sources += + rebase_path(content_tests_gypi_values.content_unittests_android_sources, + ".", + "//content") + sources -= [ + "../browser/geolocation/network_location_provider_unittest.cc", + "../browser/geolocation/wifi_data_provider_common_unittest.cc", + "../browser/power_usage_monitor_impl_unittest.cc", + "../browser/webui/url_data_manager_backend_unittest.cc", + ] + deps -= [ "//device/battery" ] + + deps += [ + "//base:base_java_unittest_support", + "//content/public/android:content_java", + "//v8:v8_external_startup_data_assets", + ] + + defines += [ "APPCACHE_USE_SIMPLE_CACHE" ] + } + if (!is_android) { + deps += [ "//third_party/libvpx" ] + } + + if (use_aura) { + deps += [ + "//components/mus/public/cpp/tests:unittest_support", + "//ui/aura:test_support", + "//ui/aura_extra", + "//ui/wm", + ] + sources += [ "../renderer/mus/compositor_mus_connection_unittest.cc" ] + } else { + sources -= [ + "../browser/renderer_host/render_widget_host_view_aura_unittest.cc", + "../browser/renderer_host/web_input_event_aura_unittest.cc", + "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc", + "../browser/web_contents/aura/overscroll_window_animation_unittest.cc", + "../browser/web_contents/aura/overscroll_window_delegate_unittest.cc", + "../browser/web_contents/web_contents_view_aura_unittest.cc", + ] + } + + # Avoid windows due to non-availability of cursor resources in test. + if (!use_aura || is_win) { + sources -= [ "../browser/media/capture/cursor_renderer_aura_unittest.cc" ] + } + if (use_aura || toolkit_views) { + deps += [ "//ui/events:test_support" ] + } + if (!use_aura && !is_mac) { + sources -= [ + "../browser/compositor/reflector_impl_unittest.cc", + "../browser/compositor/software_browser_compositor_output_surface_unittest.cc", + ] + } + + if (!is_win && !is_mac) { + sources -= [ "../common/plugin_list_unittest.cc" ] + } + + if (use_ozone) { + deps += [ "//ui/ozone" ] + } else { + sources -= + [ "../browser/compositor/software_output_device_ozone_unittest.cc" ] + } + + if (is_mac) { + deps += [ "//third_party/boringssl" ] + } + + if (use_x11) { + deps += [ "//ui/gfx/x" ] + } +} + +test("content_perftests") { + # See comment at the top of //content/BUILD.gn for why this is disabled in + # component builds. + if (is_component_build) { + check_includes = false + } + + sources = [ + "../browser/renderer_host/input/input_router_impl_perftest.cc", + "../common/discardable_shared_memory_heap_perftest.cc", + "../test/run_all_perftests.cc", + ] + deps = [ + "//base/test:test_support", + "//cc", + "//cc/ipc", + "//content/browser:for_content_tests", + "//content/public/browser", + "//content/public/common", + "//content/test:test_support", + "//skia", + "//testing/gtest", + "//testing/perf", + "//ui/gfx", + "//ui/gfx/geometry", + ] + + if (is_android) { + deps += [ "//testing/android/native_test:native_test_native_code" ] + } +} + +fuzzer_test("renderer_fuzzer") { + sources = [ + "renderer_fuzzer.cc", + ] + deps = [ + ":test_support", + "//content/shell:content_shell_lib", + ] +} diff --git a/chromium/content/test/data/web_ui_test_mojo_bindings.mojom b/chromium/content/test/data/web_ui_test_mojo_bindings.mojom new file mode 100644 index 00000000000..c5893828dd2 --- /dev/null +++ b/chromium/content/test/data/web_ui_test_mojo_bindings.mojom @@ -0,0 +1,10 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module content.mojom; + +interface BrowserTarget { + Start() => (); + Stop(); +}; diff --git a/chromium/courgette/BUILD.gn b/chromium/courgette/BUILD.gn new file mode 100644 index 00000000000..33c7e3a832c --- /dev/null +++ b/chromium/courgette/BUILD.gn @@ -0,0 +1,169 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +static_library("courgette_lib") { + sources = [ + "adjustment_method.cc", + "adjustment_method.h", + "adjustment_method_2.cc", + "assembly_program.cc", + "assembly_program.h", + "consecutive_range_visitor.h", + "courgette.h", + "crc.cc", + "crc.h", + "difference_estimator.cc", + "difference_estimator.h", + "disassembler.cc", + "disassembler.h", + "disassembler_elf_32.cc", + "disassembler_elf_32.h", + "disassembler_elf_32_arm.cc", + "disassembler_elf_32_arm.h", + "disassembler_elf_32_x86.cc", + "disassembler_elf_32_x86.h", + "disassembler_win32.cc", + "disassembler_win32.h", + "disassembler_win32_x64.cc", + "disassembler_win32_x64.h", + "disassembler_win32_x86.cc", + "disassembler_win32_x86.h", + "encoded_program.cc", + "encoded_program.h", + "ensemble.cc", + "ensemble.h", + "ensemble_apply.cc", + "ensemble_create.cc", + "image_utils.h", + "label_manager.cc", + "label_manager.h", + "memory_allocator.cc", + "memory_allocator.h", + "patch_generator_x86_32.h", + "patcher_x86_32.h", + "program_detector.cc", + "program_detector.h", + "region.h", + "rel32_finder.cc", + "rel32_finder.h", + "rel32_finder_x64.cc", + "rel32_finder_x64.h", + "rel32_finder_x86.cc", + "rel32_finder_x86.h", + "simple_delta.cc", + "simple_delta.h", + "streams.cc", + "streams.h", + "third_party/bsdiff/bsdiff.h", + "third_party/bsdiff/bsdiff_apply.cc", + "third_party/bsdiff/bsdiff_create.cc", + "third_party/bsdiff/bsdiff_search.h", + "third_party/bsdiff/paged_array.h", + "third_party/bsdiff/qsufsort.h", + "types_elf.h", + "types_win_pe.h", + ] + + deps = [ + "//base", + "//third_party/lzma_sdk", + ] +} + +if (!is_ios) { + executable("courgette") { + if (is_win && current_cpu == "x64") { + # The build infrastructure needs courgette to be named courgette64. + output_name = "courgette64" + } + + sources = [ + "courgette_tool.cc", + ] + + if (is_win) { + ldflags = [ "/LARGEADDRESSAWARE" ] + } + + deps = [ + ":courgette_lib", + "//base", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + } + + executable("courgette_minimal_tool") { + sources = [ + "courgette_minimal_tool.cc", + ] + + deps = [ + ":courgette_lib", + "//base", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + } +} + +test("courgette_unittests") { + sources = [ + "adjustment_method_unittest.cc", + "base_test_unittest.cc", + "base_test_unittest.h", + "bsdiff_memory_unittest.cc", + "consecutive_range_visitor_unittest.cc", + "difference_estimator_unittest.cc", + "disassembler_elf_32_x86_unittest.cc", + "disassembler_win32_x64_unittest.cc", + "disassembler_win32_x86_unittest.cc", + "encode_decode_unittest.cc", + "encoded_program_unittest.cc", + "ensemble_unittest.cc", + "image_utils_unittest.cc", + "label_manager_unittest.cc", + "memory_allocator_unittest.cc", + "rel32_finder_unittest.cc", + "streams_unittest.cc", + "third_party/bsdiff/bsdiff_search_unittest.cc", + "third_party/bsdiff/paged_array_unittest.cc", + "third_party/bsdiff/qsufsort_unittest.cc", + "typedrva_unittest.cc", + "versioning_unittest.cc", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":courgette_lib", + "//base", + "//base:i18n", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//testing/gtest", + ] + + data = [ + "testdata/", + ] +} + +test("courgette_fuzz") { + sources = [ + "base_test_unittest.cc", + "base_test_unittest.h", + "encoded_program_fuzz_unittest.cc", + ] + deps = [ + ":courgette_lib", + "//base", + "//base:i18n", + "//base/test:test_support", + "//testing/gtest", + ] +} diff --git a/chromium/google_update/BUILD.gn b/chromium/google_update/BUILD.gn new file mode 100644 index 00000000000..6c8539ad2aa --- /dev/null +++ b/chromium/google_update/BUILD.gn @@ -0,0 +1,11 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/toolchain/win/midl.gni") + +midl("google_update") { + sources = [ + "google_update_idl.idl", + ] +} diff --git a/chromium/ios/BUILD.gn b/chromium/ios/BUILD.gn new file mode 100644 index 00000000000..e6150df50c5 --- /dev/null +++ b/chromium/ios/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This list all targets that needs to be build as part of "gn_all" on iOS. +# This list should generally only include executables, but since some code +# has not yet been upstreamed it will sometimes also include targets that +# are not used upstream to ensure they are not broken inadvertently. +group("all") { + testonly = true + deps = [ + "//ios/chrome:ios_chrome_unittests", + "//ios/chrome/app", + "//ios/chrome/browser", + "//ios/chrome/common", + "//ios/chrome/common/physical_web", + "//ios/chrome/share_extension:packed_resources", + "//ios/chrome/today_extension:packed_resources", + "//ios/net:ios_net_unittests", + "//ios/public/provider/chrome/browser", + "//ios/public/provider/web", + "//ios/testing:ocmock_support_unittest", + "//ios/third_party/earl_grey", + "//ios/web:ios_web_inttests", + "//ios/web:ios_web_unittests", + "//ios/web/shell:ios_web_shell", + ] + + if (!is_component_build) { + deps += [ "//components/cronet/ios:cronet_package" ] + } +} diff --git a/chromium/ios/build/config.gni b/chromium/ios/build/config.gni new file mode 100644 index 00000000000..e486e6e3b06 --- /dev/null +++ b/chromium/ios/build/config.gni @@ -0,0 +1,25 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Global list of dependencies that are conceptually bad on iOS and should +# never be added (they will never be supported). +_ios_conceptually_bad_dependencies = [ + "//cc/*", + "//content/*", + "//dbus/*", + "//jingle:jingle", + "//media/*", + "//third_party/ffmpeg/*", + "//third_party/hunspell_dictionaries/*", + "//third_party/webgl/*", + "//third_party/WebKit/*", + "//third_party/webrtc:webrtc", +] + +# Global list of conceptually fine dependencies but currently unsupported +# on iOS. Exclusions will be removed when the dependencies are fixed. +_ios_transient_bad_dependencies = [] + +ios_assert_no_deps = + _ios_conceptually_bad_dependencies + _ios_transient_bad_dependencies diff --git a/chromium/ios/chrome/BUILD.gn b/chromium/ios/chrome/BUILD.gn new file mode 100644 index 00000000000..8b1238e2342 --- /dev/null +++ b/chromium/ios/chrome/BUILD.gn @@ -0,0 +1,109 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/rules.gni") +import("//ios/build/config.gni") +import("//testing/test.gni") + +bundle_data("ios_chrome_unittests_bundle_data") { + testonly = true + sources = [ + "test/data/webdata/bookmarkimages/image.jpg", + "test/data/webdata/bookmarkimages/index.html", + ] + outputs = [ + "{{bundle_resources_dir}}/{{source_root_relative_dir}}/" + + "{{source_file_part}}", + ] +} + +bundle_data_xib("native_content_controller_test_xib") { + testonly = true + source = "browser/ui/native_content_controller_test.xib" +} + +test("ios_chrome_unittests") { + sources = [ + "app/application_delegate/memory_warning_helper_unittest.mm", + "app/safe_mode_util_unittest.cc", + "browser/chrome_url_util_unittest.mm", + "browser/crash_loop_detection_util_unittest.mm", + "browser/favicon/large_icon_cache_unittest.cc", + "browser/geolocation/CLLocation+XGeoHeaderTest.mm", + "browser/geolocation/location_manager_unittest.mm", + "browser/geolocation/omnibox_geolocation_local_state_unittest.mm", + "browser/install_time_util_unittest.mm", + "browser/installation_notifier_unittest.mm", + "browser/metrics/ios_chrome_metrics_service_accessor_unittest.cc", + "browser/metrics/ios_chrome_stability_metrics_provider_unittest.cc", + "browser/metrics/mobile_session_shutdown_metrics_provider_unittest.mm", + "browser/metrics/previous_session_info_unittest.mm", + "browser/net/cookie_util_unittest.mm", + "browser/net/image_fetcher_unittest.mm", + "browser/net/metrics_network_client_unittest.mm", + "browser/net/retryable_url_fetcher_unittest.mm", + "browser/passwords/password_controller_unittest.mm", + "browser/reading_list/reading_list_entry_unittest.cc", + "browser/reading_list/reading_list_model_unittest.cc", + "browser/signin/chrome_identity_service_observer_bridge_unittest.mm", + "browser/signin/gaia_auth_fetcher_ios_unittest.mm", + "browser/snapshots/lru_cache_unittest.mm", + "browser/snapshots/snapshot_cache_unittest.mm", + "browser/snapshots/snapshots_util_unittest.mm", + "browser/ssl/ios_ssl_error_handler_unittest.mm", + "browser/translate/translate_service_ios_unittest.cc", + "browser/ui/commands/set_up_for_testing_command_unittest.mm", + "browser/ui/context_menu/context_menu_coordinator_unittest.mm", + "browser/ui/keyboard/UIKeyCommand+ChromeTest.mm", + "browser/ui/keyboard/hardware_keyboard_watcher_unittest.mm", + "browser/ui/native_content_controller_unittest.mm", + "browser/ui/ui_util_unittest.mm", + "browser/ui/uikit_ui_util_unittest.mm", + "browser/update_client/ios_chrome_update_query_params_delegate_unittest.cc", + "browser/web_resource/web_resource_util_unittest.cc", + "common/string_util_unittest.mm", + "test/google_toolbox_unittest.mm", + ] + + deps = [ + ":ios_chrome_unittests_bundle_data", + ":native_content_controller_test_xib", + "//base", + "//base/test:test_support", + "//components/bookmarks/test", + "//components/favicon_base", + "//components/metrics", + "//components/metrics:test_support", + "//components/password_manager/core/browser", + "//components/password_manager/core/browser:test_support", + "//components/password_manager/core/common", + "//components/prefs:test_support", + "//components/signin/core/browser:test_support", + "//components/signin/ios/browser:test_support", + "//components/sync_driver:test_support", + "//components/syncable_prefs:test_support", + "//components/update_client", + "//components/version_info", + "//ios/chrome/app", + "//ios/chrome/app/resources:packed_resources", + "//ios/chrome/browser", + "//ios/chrome/browser:test_support", + "//ios/chrome/common", + "//ios/chrome/test", + "//ios/chrome/test:run_all_unittests", + "//ios/public/provider/chrome/browser", + "//ios/public/provider/chrome/browser:test_support", + "//ios/web", + "//ios/web:test_support", + "//net:test_support", + "//skia", + "//testing/gmock", + "//testing/gtest", + "//third_party/google_toolbox_for_mac", + "//third_party/ocmock", + "//ui/gfx:test_support", + ] + + assert_no_deps = ios_assert_no_deps +} diff --git a/chromium/ios/chrome/app/BUILD.gn b/chromium/ios/chrome/app/BUILD.gn new file mode 100644 index 00000000000..9f281b90c4b --- /dev/null +++ b/chromium/ios/chrome/app/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("app") { + sources = [ + "UIApplication+ExitsOnSuspend.h", + "UIApplication+ExitsOnSuspend.mm", + "application_delegate/memory_warning_helper.h", + "application_delegate/memory_warning_helper.mm", + "deferred_initialization_runner.h", + "deferred_initialization_runner.mm", + "safe_mode_crashing_modules_config.h", + "safe_mode_crashing_modules_config.mm", + "safe_mode_util.cc", + "safe_mode_util.h", + ] + + deps = [ + "//base", + "//ios/chrome/browser", + ] + + libs = [ + "Foundation.framework", + "UIKit.framework", + ] +} diff --git a/chromium/ios/chrome/app/resources/BUILD.gn b/chromium/ios/chrome/app/resources/BUILD.gn new file mode 100644 index 00000000000..fd4da5c45b4 --- /dev/null +++ b/chromium/ios/chrome/app/resources/BUILD.gn @@ -0,0 +1,60 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/locales.gni") +import("//tools/grit/grit_rule.gni") +import("//ios/chrome/app/resources/ios_chrome_repack.gni") + +grit("resources") { + source = "ios_resources.grd" + output_dir = "$root_gen_dir/ios/chrome" + use_qualified_include = true + outputs = [ + "grit/ios_resources.h", + "ios_resources.pak", + ] +} + +group("packed_resources") { + public_deps = [ + ":repack_locales", + ":repack_scalable_resources", + ":repack_unscaled_resources", + ] +} + +ios_chrome_repack_locales("repack_locales") { + visibility = [ ":packed_resources" ] + input_locales = ios_packed_locales + output_locales = ios_packed_locales_as_mac_outputs +} + +ios_chrome_repack_all_scales("repack_scalable_resources") { + visibility = [ ":packed_resources" ] + scales = [ + "100", + "200", + "300", + ] +} + +ios_repack("repack_unscaled_resources") { + visibility = [ ":packed_resources" ] + sources = [ + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/ios/chrome/ios_resources.pak", + "$root_gen_dir/ios/web/ios_web_resources.pak", + "$root_gen_dir/net/net_resources.pak", + "$root_gen_dir/ui/resources/webui_resources.pak", + ] + deps = [ + ":resources", + "//components/resources", + "//ios/web:resources", + "//net:net_resources", + "//ui/resources", + ] + output = "$target_gen_dir/resources.pak" + bundle_output = "{{bundle_resources_dir}}/{{source_file_part}}" +} diff --git a/chromium/ios/chrome/app/resources/ios_chrome_repack.gni b/chromium/ios/chrome/app/resources/ios_chrome_repack.gni new file mode 100644 index 00000000000..225a88ea6d1 --- /dev/null +++ b/chromium/ios/chrome/app/resources/ios_chrome_repack.gni @@ -0,0 +1,230 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/repack.gni") +import("//build/config/chrome_build.gni") + +# Template to repack resources and copy them to the application bundles. +# +# Arguments +# +# deps +# list of strings corresponding to target labels. +# +# sources +# list of strings corresponding to path to resources pak to pack. +# +# output +# string, path of the packed resources. +# +# bundle_output +# string, path of the packed resources in the bundle. +# +# Generates a bundle_data target for convenience. +template("ios_repack") { + assert(defined(invoker.deps), "deps must be defined for $target_name") + assert(defined(invoker.sources), "sources must be defined for $target_name") + assert(defined(invoker.output), "output must be defined for $target_name") + assert(defined(invoker.bundle_output), + "bundle_output must be defined for $target_name") + + _target_name = target_name + + repack("${_target_name}_pack") { + forward_variables_from(invoker, [ "testonly" ]) + + visibility = [ ":${_target_name}" ] + sources = invoker.sources + output = invoker.output + deps = invoker.deps + } + + bundle_data(_target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + public_deps = [ + ":${_target_name}_pack", + ] + sources = [ + invoker.output, + ] + outputs = [ + invoker.bundle_output, + ] + } +} + +# Template to repack all resources for a given locale. +# +# Arguments +# +# input_locale +# string, name of the locale to pack. +# +# output_locale +# string, name of the locale (may be different from input_locale +# as iOS and Chrome not use the same convention for naming locales +# with country variant). +# +# Generates a bundle_data target for convenience. +template("_ios_chrome_repack_one_locale") { + assert(defined(invoker.input_locale), + "input_locale must be defined for ${target_name}") + assert(defined(invoker.output_locale), + "output_locale must be defined for ${target_name}") + + ios_repack(target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + + sources = [ + "${root_gen_dir}/components/strings/components_${branding_path_component}_strings_${invoker.input_locale}.pak", + "${root_gen_dir}/components/strings/components_locale_settings_${invoker.input_locale}.pak", + "${root_gen_dir}/components/strings/components_strings_${invoker.input_locale}.pak", + "${root_gen_dir}/ios/chrome/ios_${branding_path_component}_strings_${invoker.input_locale}.pak", + "${root_gen_dir}/ios/chrome/ios_strings_${invoker.input_locale}.pak", + "${root_gen_dir}/ui/strings/app_locale_settings_${invoker.input_locale}.pak", + "${root_gen_dir}/ui/strings/ui_strings_${invoker.input_locale}.pak", + ] + + deps = [ + "//components/strings:components_${branding_path_component}_strings", + "//components/strings:components_locale_settings", + "//components/strings:components_strings", + "//ios/chrome/app/strings:ios_${branding_path_component}_strings", + "//ios/chrome/app/strings:ios_strings", + "//ui/strings:app_locale_settings", + "//ui/strings:ui_strings", + ] + + output = "${target_gen_dir}/${invoker.output_locale}.lproj/locale.pak" + bundle_output = "{{bundle_resources_dir}}/${invoker.output_locale}.lproj" + + "/{{source_file_part}}" + } +} + +# Template to repack all resources for all locales. +# +# Arguments +# +# input_locales +# list of strings corresponding to all locales to pack. +# +# output_locales +# list of strings corresponding to all locales to pack (may be +# different from input_locales as iOS and Chrome do not use the +# same convention for naming locales with country variant). +# +# Must be the same length as input_locales. +# +# Generates a collection of bundle_data targets for convenience. +template("ios_chrome_repack_locales") { + assert(defined(invoker.input_locales), + "input_locales must be defined for ${target_name}") + assert(defined(invoker.output_locales), + "output_locales must be defined for ${target_name}") + + _target_name = target_name + + _locale_targets = [] + _output_locales = invoker.output_locales + + _current_index = 0 + foreach(_input_locale, invoker.input_locales) { + _output_locale = _output_locales[_current_index] + _locale_targets += [ ":${_target_name}_${_input_locale}" ] + + _ios_chrome_repack_one_locale("${_target_name}_${_input_locale}") { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ ":${_target_name}" ] + input_locale = _input_locale + output_locale = _output_locale + } + + _current_index = _current_index + 1 + } + + group(_target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + public_deps = _locale_targets + } +} + +# Template to repack all scalable resources at a given scale. +# +# Arguments +# +# scale +# string, scale as a percentage, e.g. "200" corresponds to @2x scale. +# +# Generates a bundle_data target for convenience. +template("_ios_chrome_repack_one_scale") { + assert(defined(invoker.scale), "scale must be defined for ${target_name}") + + ios_repack(target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + + sources = [ + "${root_gen_dir}/components/components_resources_${invoker.scale}_percent.pak", + "${root_gen_dir}/ios/chrome/ios_theme_resources_${invoker.scale}_percent.pak", + "${root_gen_dir}/ui/resources/ui_resources_${invoker.scale}_percent.pak", + ] + deps = [ + "//components/resources", + "//ios/chrome/app/theme", + "//ui/resources", + ] + + output = "$target_gen_dir/chrome_${invoker.scale}_percent.pak" + bundle_output = "{{bundle_resources_dir}}/{{source_file_part}}" + } +} + +# Template to repack all scalable resources at all scales. +# +# Arguments +# +# scales +# list of strings corresponding to scales as percentage, e.g. "200" +# corresponds to @2x scale. +# +# Generates a collection of bundle_data targets for convenience. +template("ios_chrome_repack_all_scales") { + assert(defined(invoker.scales), "scales must be defined for ${target_name}") + + _scale_targets = [] + _target_name = target_name + + foreach(_scale, invoker.scales) { + _scale_targets += [ ":${_target_name}_${_scale}_percent" ] + _ios_chrome_repack_one_scale("${_target_name}_${_scale}_percent") { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ ":${_target_name}" ] + scale = _scale + } + } + + group(_target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + public_deps = _scale_targets + } +} diff --git a/chromium/ios/chrome/app/strings/BUILD.gn b/chromium/ios/chrome/app/strings/BUILD.gn new file mode 100644 index 00000000000..6d0e504ae76 --- /dev/null +++ b/chromium/ios/chrome/app/strings/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/locales.gni") +import("//tools/grit/grit_rule.gni") + +group("strings") { + public_deps = [ + ":ios_chromium_strings", + ":ios_google_chrome_strings", + ":ios_strings", + ] +} + +grit("ios_strings") { + source = "ios_strings.grd" + output_dir = "$root_gen_dir/ios/chrome" + use_qualified_include = true + outputs = [ + "grit/ios_strings.h", + ] + foreach(locale, locales_with_fake_bidi) { + outputs += [ "ios_strings_$locale.pak" ] + } +} + +grit("ios_chromium_strings") { + source = "ios_chromium_strings.grd" + output_dir = "$root_gen_dir/ios/chrome" + use_qualified_include = true + outputs = [ + "grit/ios_chromium_strings.h", + ] + foreach(locale, locales_with_fake_bidi) { + outputs += [ "ios_chromium_strings_$locale.pak" ] + } +} + +grit("ios_google_chrome_strings") { + source = "ios_google_chrome_strings.grd" + output_dir = "$root_gen_dir/ios/chrome" + use_qualified_include = true + outputs = [ + "grit/ios_google_chrome_strings.h", + ] + foreach(locale, locales_with_fake_bidi) { + outputs += [ "ios_google_chrome_strings_$locale.pak" ] + } +} diff --git a/chromium/ios/chrome/app/theme/BUILD.gn b/chromium/ios/chrome/app/theme/BUILD.gn new file mode 100644 index 00000000000..23834adca5c --- /dev/null +++ b/chromium/ios/chrome/app/theme/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +grit("theme") { + source = "ios_theme_resources.grd" + output_dir = "$root_gen_dir/ios/chrome" + outputs = [ + "grit/ios_theme_resources.h", + "grit/ios_theme_resources_map.cc", + "grit/ios_theme_resources_map.h", + "ios_theme_resources_100_percent.pak", + "ios_theme_resources_200_percent.pak", + "ios_theme_resources_300_percent.pak", + ] +} diff --git a/chromium/ios/chrome/browser/BUILD.gn b/chromium/ios/chrome/browser/BUILD.gn new file mode 100644 index 00000000000..6e528c69027 --- /dev/null +++ b/chromium/ios/chrome/browser/BUILD.gn @@ -0,0 +1,831 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//ios/web/js_compile.gni") +import("//third_party/protobuf/proto_library.gni") + +declare_args() { + google_test_gaia_client_id = "" + google_test_gaia_client_secret = "" + google_staging_api_url = "" + google_staging_lso_url = "" + google_test_api_url = "" + google_test_lso_url = "" + google_test_oauth_client_id = "" + google_test_oauth_client_secret = "" + google_test_oauth_url = "" + google_test_sync_url = "" +} + +source_set("browser") { + sources = [ + "app_startup_parameters.h", + "app_startup_parameters.mm", + "application_context.cc", + "application_context.h", + "application_context_impl.cc", + "application_context_impl.h", + "arch_util.cc", + "arch_util.h", + "autocomplete/autocomplete_classifier_factory.cc", + "autocomplete/autocomplete_classifier_factory.h", + "autocomplete/autocomplete_provider_client_impl.cc", + "autocomplete/autocomplete_provider_client_impl.h", + "autocomplete/autocomplete_scheme_classifier_impl.h", + "autocomplete/autocomplete_scheme_classifier_impl.mm", + "autocomplete/in_memory_url_index_factory.cc", + "autocomplete/in_memory_url_index_factory.h", + "autocomplete/shortcuts_backend_factory.h", + "autocomplete/shortcuts_backend_factory.mm", + "autofill/form_input_accessory_view.h", + "autofill/form_input_accessory_view.mm", + "autofill/form_input_accessory_view_controller.h", + "autofill/form_input_accessory_view_controller.mm", + "autofill/form_input_accessory_view_delegate.h", + "autofill/form_suggestion_controller.h", + "autofill/form_suggestion_controller.mm", + "autofill/form_suggestion_label.h", + "autofill/form_suggestion_label.mm", + "autofill/form_suggestion_provider.h", + "autofill/form_suggestion_view.h", + "autofill/form_suggestion_view.mm", + "autofill/form_suggestion_view_client.h", + "autofill/personal_data_manager_factory.cc", + "autofill/personal_data_manager_factory.h", + "bookmarks/bookmark_client_impl.cc", + "bookmarks/bookmark_client_impl.h", + "bookmarks/bookmark_model_factory.cc", + "bookmarks/bookmark_model_factory.h", + "bookmarks/bookmarks_utils.cc", + "bookmarks/bookmarks_utils.h", + "bookmarks/startup_task_runner_service_factory.cc", + "bookmarks/startup_task_runner_service_factory.h", + "browser_state/bookmark_model_loaded_observer.cc", + "browser_state/bookmark_model_loaded_observer.h", + "browser_state/browser_state_info_cache.cc", + "browser_state/browser_state_info_cache.h", + "browser_state/browser_state_info_cache_observer.h", + "browser_state/browser_state_keyed_service_factories.h", + "browser_state/browser_state_keyed_service_factories.mm", + "browser_state/browser_state_otr_helper.cc", + "browser_state/browser_state_otr_helper.h", + "browser_state/chrome_browser_state.h", + "browser_state/chrome_browser_state.mm", + "browser_state/chrome_browser_state_impl.cc", + "browser_state/chrome_browser_state_impl.h", + "browser_state/chrome_browser_state_impl_io_data.h", + "browser_state/chrome_browser_state_impl_io_data.mm", + "browser_state/chrome_browser_state_io_data.cc", + "browser_state/chrome_browser_state_io_data.h", + "browser_state/chrome_browser_state_manager.h", + "browser_state/chrome_browser_state_manager_impl.cc", + "browser_state/chrome_browser_state_manager_impl.h", + "browser_state/chrome_browser_state_removal_controller.h", + "browser_state/chrome_browser_state_removal_controller.mm", + "browser_state/off_the_record_chrome_browser_state_impl.cc", + "browser_state/off_the_record_chrome_browser_state_impl.h", + "browser_state/off_the_record_chrome_browser_state_io_data.h", + "browser_state/off_the_record_chrome_browser_state_io_data.mm", + "browser_state_metrics/browser_state_metrics.cc", + "browser_state_metrics/browser_state_metrics.h", + "browsing_data/browsing_data_change_listening.h", + "browsing_data/browsing_data_remover_helper.cc", + "browsing_data/browsing_data_remover_helper.h", + "browsing_data/ios_chrome_browsing_data_remover.h", + "browsing_data/ios_chrome_browsing_data_remover.mm", + "chrome_constants.cc", + "chrome_constants.h", + "chrome_paths.h", + "chrome_paths.mm", + "chrome_paths_internal.h", + "chrome_switches.cc", + "chrome_switches.h", + "chrome_url_constants.cc", + "chrome_url_constants.h", + "chrome_url_util.h", + "chrome_url_util.mm", + "component_updater/ios_component_updater_configurator.cc", + "component_updater/ios_component_updater_configurator.h", + "content_settings/cookie_settings_factory.cc", + "content_settings/cookie_settings_factory.h", + "content_settings/host_content_settings_map_factory.cc", + "content_settings/host_content_settings_map_factory.h", + "crash_loop_detection_util.h", + "crash_loop_detection_util.mm", + "crash_report/breakpad_helper.h", + "crash_report/breakpad_helper.mm", + "crash_report/crash_keys.cc", + "crash_report/crash_keys.h", + "crash_report/crash_report_background_uploader.h", + "crash_report/crash_report_background_uploader.mm", + "crash_report/crash_report_multi_parameter.h", + "crash_report/crash_report_multi_parameter.mm", + "crash_report/crash_report_user_application_state.h", + "crash_report/crash_report_user_application_state.mm", + "crash_report/crash_upload_list.cc", + "crash_report/crash_upload_list.h", + "dom_distiller/distiller_viewer.cc", + "dom_distiller/distiller_viewer.h", + "dom_distiller/dom_distiller_service_factory.cc", + "dom_distiller/dom_distiller_service_factory.h", + "experimental_flags.h", + "experimental_flags.mm", + "favicon/favicon_client_impl.h", + "favicon/favicon_client_impl.mm", + "favicon/favicon_loader.h", + "favicon/favicon_loader.mm", + "favicon/favicon_service_factory.cc", + "favicon/favicon_service_factory.h", + "favicon/ios_chrome_favicon_loader_factory.h", + "favicon/ios_chrome_favicon_loader_factory.mm", + "favicon/ios_chrome_large_icon_cache_factory.cc", + "favicon/ios_chrome_large_icon_cache_factory.h", + "favicon/ios_chrome_large_icon_service_factory.cc", + "favicon/ios_chrome_large_icon_service_factory.h", + "favicon/large_icon_cache.cc", + "favicon/large_icon_cache.h", + "file_metadata_util.h", + "file_metadata_util.mm", + "find_in_page/find_in_page_controller.h", + "find_in_page/find_in_page_controller.mm", + "find_in_page/find_in_page_model.h", + "find_in_page/find_in_page_model.mm", + "find_in_page/js_findinpage_manager.h", + "find_in_page/js_findinpage_manager.mm", + "first_run/first_run.h", + "first_run/first_run.mm", + "first_run/first_run_configuration.h", + "first_run/first_run_configuration.mm", + "first_run/first_run_metrics.h", + "geolocation/CLLocation+OmniboxGeolocation.h", + "geolocation/CLLocation+OmniboxGeolocation.mm", + "geolocation/CLLocation+XGeoHeader.h", + "geolocation/CLLocation+XGeoHeader.mm", + "geolocation/location_manager+Testing.h", + "geolocation/location_manager.h", + "geolocation/location_manager.mm", + "geolocation/omnibox_geolocation_authorization_alert.h", + "geolocation/omnibox_geolocation_authorization_alert.mm", + "geolocation/omnibox_geolocation_config.h", + "geolocation/omnibox_geolocation_config.mm", + "geolocation/omnibox_geolocation_local_state.h", + "geolocation/omnibox_geolocation_local_state.mm", + "google/google_brand.h", + "google/google_brand.mm", + "google/google_url_tracker_client_impl.cc", + "google/google_url_tracker_client_impl.h", + "google/google_url_tracker_factory.cc", + "google/google_url_tracker_factory.h", + "history/history_backend_client_impl.cc", + "history/history_backend_client_impl.h", + "history/history_client_impl.cc", + "history/history_client_impl.h", + "history/history_service_factory.cc", + "history/history_service_factory.h", + "history/history_utils.cc", + "history/history_utils.h", + "history/top_sites_factory.cc", + "history/top_sites_factory.h", + "history/web_history_service_factory.cc", + "history/web_history_service_factory.h", + "infobars/confirm_infobar_controller.h", + "infobars/confirm_infobar_controller.mm", + "infobars/infobar.h", + "infobars/infobar.mm", + "infobars/infobar_container_ios.h", + "infobars/infobar_container_ios.mm", + "infobars/infobar_container_view.h", + "infobars/infobar_container_view.mm", + "infobars/infobar_controller.h", + "infobars/infobar_controller.mm", + "infobars/infobar_manager_impl.h", + "infobars/infobar_manager_impl.mm", + "infobars/infobar_utils.h", + "infobars/infobar_utils.mm", + "install_time_util.h", + "install_time_util.mm", + "installation_notifier.h", + "installation_notifier.mm", + "interstitials/ios_chrome_controller_client.h", + "interstitials/ios_chrome_controller_client.mm", + "interstitials/ios_chrome_metrics_helper.h", + "interstitials/ios_chrome_metrics_helper.mm", + "interstitials/ios_security_interstitial_page.h", + "interstitials/ios_security_interstitial_page.mm", + "invalidation/ios_chrome_profile_invalidation_provider_factory.h", + "invalidation/ios_chrome_profile_invalidation_provider_factory.mm", + "ios_chrome_field_trials.cc", + "ios_chrome_field_trials.h", + "ios_chrome_io_thread.h", + "ios_chrome_io_thread.mm", + "ios_chrome_main_parts.h", + "ios_chrome_main_parts.mm", + "memory/memory_debugger.h", + "memory/memory_debugger.mm", + "memory/memory_debugger_manager.h", + "memory/memory_debugger_manager.mm", + "memory/memory_metrics.cc", + "memory/memory_metrics.h", + "metrics/field_trial_synchronizer.cc", + "metrics/field_trial_synchronizer.h", + "metrics/ios_chrome_metrics_service_accessor.cc", + "metrics/ios_chrome_metrics_service_accessor.h", + "metrics/ios_chrome_metrics_service_client.cc", + "metrics/ios_chrome_metrics_service_client.h", + "metrics/ios_chrome_metrics_services_manager_client.h", + "metrics/ios_chrome_metrics_services_manager_client.mm", + "metrics/ios_chrome_origins_seen_service_factory.cc", + "metrics/ios_chrome_origins_seen_service_factory.h", + "metrics/ios_chrome_stability_metrics_provider.cc", + "metrics/ios_chrome_stability_metrics_provider.h", + "metrics/mobile_session_shutdown_metrics_provider.h", + "metrics/mobile_session_shutdown_metrics_provider.mm", + "metrics/previous_session_info.h", + "metrics/previous_session_info.mm", + "metrics/previous_session_info_private.h", + "net/chrome_cookie_store_ios_client.h", + "net/chrome_cookie_store_ios_client.mm", + "net/connection_type_observer_bridge.h", + "net/connection_type_observer_bridge.mm", + "net/cookie_util.h", + "net/cookie_util.mm", + "net/crl_set_fetcher.cc", + "net/crl_set_fetcher.h", + "net/http_server_properties_manager_factory.cc", + "net/http_server_properties_manager_factory.h", + "net/image_fetcher.h", + "net/image_fetcher.mm", + "net/ios_chrome_http_user_agent_settings.h", + "net/ios_chrome_http_user_agent_settings.mm", + "net/ios_chrome_network_delegate.cc", + "net/ios_chrome_network_delegate.h", + "net/ios_chrome_url_request_context_getter.cc", + "net/ios_chrome_url_request_context_getter.h", + "net/metrics_network_client.h", + "net/metrics_network_client.mm", + "net/metrics_network_client_manager.h", + "net/metrics_network_client_manager.mm", + "net/net_types.h", + "net/proxy_service_factory.cc", + "net/proxy_service_factory.h", + "net/retryable_url_fetcher.h", + "net/retryable_url_fetcher.mm", + "notification_promo.cc", + "notification_promo.h", + "ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc", + "ntp_snippets/ios_chrome_ntp_snippets_service_factory.h", + "open_from_clipboard/create_clipboard_recent_content.h", + "open_from_clipboard/create_clipboard_recent_content.mm", + "passwords/credential_manager.h", + "passwords/credential_manager.mm", + "passwords/ios_chrome_password_manager_client.h", + "passwords/ios_chrome_password_manager_client.mm", + "passwords/ios_chrome_password_manager_driver.h", + "passwords/ios_chrome_password_manager_driver.mm", + "passwords/ios_chrome_password_manager_infobar_delegate.h", + "passwords/ios_chrome_password_manager_infobar_delegate.mm", + "passwords/ios_chrome_password_manager_setting_migrator_service_factory.cc", + "passwords/ios_chrome_password_manager_setting_migrator_service_factory.h", + "passwords/ios_chrome_password_store_factory.cc", + "passwords/ios_chrome_password_store_factory.h", + "passwords/ios_chrome_save_password_infobar_delegate.h", + "passwords/ios_chrome_save_password_infobar_delegate.mm", + "passwords/js_credential_manager.h", + "passwords/js_credential_manager.mm", + "passwords/js_password_manager.h", + "passwords/js_password_manager.mm", + "passwords/password_controller.h", + "passwords/password_controller.mm", + "passwords/password_generation_agent.h", + "passwords/password_generation_agent.mm", + "passwords/password_generation_edit_view.h", + "passwords/password_generation_edit_view.mm", + "passwords/password_generation_offer_view.h", + "passwords/password_generation_offer_view.mm", + "passwords/password_generation_prompt_delegate.h", + "passwords/password_generation_utils.h", + "passwords/password_generation_utils.mm", + "passwords/passwords_ui_delegate.h", + "pref_names.cc", + "pref_names.h", + "prefs/browser_prefs.h", + "prefs/browser_prefs.mm", + "prefs/ios_chrome_pref_model_associator_client.cc", + "prefs/ios_chrome_pref_model_associator_client.h", + "prefs/ios_chrome_pref_service_factory.cc", + "prefs/ios_chrome_pref_service_factory.h", + "prefs/pref_observer_bridge.h", + "prefs/pref_observer_bridge.mm", + "procedural_block_types.h", + "reading_list/reading_list_entry.cc", + "reading_list/reading_list_entry.h", + "reading_list/reading_list_model.cc", + "reading_list/reading_list_model.h", + "reading_list/reading_list_model_factory.cc", + "reading_list/reading_list_model_factory.h", + "reading_list/reading_list_model_impl.cc", + "reading_list/reading_list_model_impl.h", + "reading_list/reading_list_model_observer.h", + "reading_list/reading_list_model_observer.h", + "reading_list/reading_list_model_storage.h", + "reading_list/reading_list_model_storage_defaults.h", + "reading_list/reading_list_model_storage_defaults.mm", + "search/search_util.h", + "search/search_util.mm", + "search_engines/search_engines_util.cc", + "search_engines/search_engines_util.h", + "search_engines/template_url_service_client_impl.cc", + "search_engines/template_url_service_client_impl.h", + "search_engines/template_url_service_factory.cc", + "search_engines/template_url_service_factory.h", + "search_engines/ui_thread_search_terms_data.cc", + "search_engines/ui_thread_search_terms_data.h", + "services/gcm/ios_chrome_gcm_profile_service_factory.cc", + "services/gcm/ios_chrome_gcm_profile_service_factory.h", + "sessions/ios_chrome_session_tab_helper.h", + "sessions/ios_chrome_session_tab_helper.mm", + "sessions/ios_chrome_tab_restore_service_client.h", + "sessions/ios_chrome_tab_restore_service_client.mm", + "sessions/ios_chrome_tab_restore_service_factory.cc", + "sessions/ios_chrome_tab_restore_service_factory.h", + "share_extension/share_extension_item_receiver.h", + "share_extension/share_extension_item_receiver.mm", + "share_extension/share_extension_service.h", + "share_extension/share_extension_service.mm", + "share_extension/share_extension_service_factory.cc", + "share_extension/share_extension_service_factory.h", + "signin/about_signin_internals_factory.cc", + "signin/about_signin_internals_factory.h", + "signin/account_consistency_service_factory.h", + "signin/account_consistency_service_factory.mm", + "signin/account_fetcher_service_factory.cc", + "signin/account_fetcher_service_factory.h", + "signin/account_reconcilor_factory.cc", + "signin/account_reconcilor_factory.h", + "signin/account_tracker_service_factory.cc", + "signin/account_tracker_service_factory.h", + "signin/browser_state_data_remover.h", + "signin/browser_state_data_remover.mm", + "signin/chrome_identity_service_observer_bridge.h", + "signin/chrome_identity_service_observer_bridge.mm", + "signin/constants.h", + "signin/constants.mm", + "signin/gaia_auth_fetcher_ios.h", + "signin/gaia_auth_fetcher_ios.mm", + "signin/gaia_auth_fetcher_ios_private.h", + "signin/gaia_cookie_manager_service_factory.cc", + "signin/gaia_cookie_manager_service_factory.h", + "signin/ios_chrome_signin_status_metrics_provider_delegate.cc", + "signin/ios_chrome_signin_status_metrics_provider_delegate.h", + "signin/oauth2_token_service_factory.h", + "signin/oauth2_token_service_factory.mm", + "signin/signin_client_factory.cc", + "signin/signin_client_factory.h", + "signin/signin_client_impl.h", + "signin/signin_client_impl.mm", + "signin/signin_error_controller_factory.cc", + "signin/signin_error_controller_factory.h", + "signin/signin_manager_factory.cc", + "signin/signin_manager_factory.h", + "signin/signin_manager_factory_observer.h", + "signin/signin_util.h", + "signin/signin_util.mm", + "snapshots/lru_cache.h", + "snapshots/lru_cache.mm", + "snapshots/snapshot_cache.h", + "snapshots/snapshot_cache.mm", + "snapshots/snapshot_manager.h", + "snapshots/snapshot_manager.mm", + "snapshots/snapshot_overlay.h", + "snapshots/snapshot_overlay.mm", + "snapshots/snapshots_util.h", + "snapshots/snapshots_util.mm", + "ssl/ios_chrome_security_state_model_client.h", + "ssl/ios_chrome_security_state_model_client.mm", + "ssl/ios_ssl_blocking_page.h", + "ssl/ios_ssl_blocking_page.mm", + "ssl/ios_ssl_error_handler.h", + "ssl/ios_ssl_error_handler.mm", + "suggestions/image_fetcher_impl.h", + "suggestions/image_fetcher_impl.mm", + "suggestions/ios_image_decoder_impl.h", + "suggestions/ios_image_decoder_impl.mm", + "suggestions/suggestions_service_factory.h", + "suggestions/suggestions_service_factory.mm", + "sync/glue/sync_start_util.cc", + "sync/glue/sync_start_util.h", + "sync/ios_chrome_profile_sync_service_factory.cc", + "sync/ios_chrome_profile_sync_service_factory.h", + "sync/ios_chrome_sync_client.h", + "sync/ios_chrome_sync_client.mm", + "sync/ios_chrome_synced_tab_delegate.h", + "sync/ios_chrome_synced_tab_delegate.mm", + "sync/sessions/ios_chrome_local_session_event_router.h", + "sync/sessions/ios_chrome_local_session_event_router.mm", + "sync/sync_observer_bridge.h", + "sync/sync_observer_bridge.mm", + "sync/sync_setup_service.cc", + "sync/sync_setup_service.h", + "sync/sync_setup_service_factory.cc", + "sync/sync_setup_service_factory.h", + "tab_parenting_global_observer.cc", + "tab_parenting_global_observer.h", + "translate/after_translate_infobar_controller.h", + "translate/after_translate_infobar_controller.mm", + "translate/before_translate_infobar_controller.h", + "translate/before_translate_infobar_controller.mm", + "translate/chrome_ios_translate_client.h", + "translate/chrome_ios_translate_client.mm", + "translate/never_translate_infobar_controller.h", + "translate/never_translate_infobar_controller.mm", + "translate/translate_accept_languages_factory.cc", + "translate/translate_accept_languages_factory.h", + "translate/translate_infobar_tags.h", + "translate/translate_message_infobar_controller.h", + "translate/translate_message_infobar_controller.mm", + "translate/translate_service_ios.cc", + "translate/translate_service_ios.h", + "ui/UIView+SizeClassSupport.h", + "ui/UIView+SizeClassSupport.mm", + "ui/animation_util.h", + "ui/animation_util.mm", + "ui/autofill/autofill_client_ios.h", + "ui/autofill/autofill_client_ios.mm", + "ui/autofill/autofill_save_card_infobar.mm", + "ui/background_generator.h", + "ui/background_generator.mm", + "ui/browser_otr_state.h", + "ui/browser_otr_state.mm", + "ui/commands/UIKit+ChromeExecuteCommand.h", + "ui/commands/UIKit+ChromeExecuteCommand.mm", + "ui/commands/clear_browsing_data_command.h", + "ui/commands/clear_browsing_data_command.mm", + "ui/commands/generic_chrome_command.h", + "ui/commands/generic_chrome_command.mm", + "ui/commands/ios_command_ids.h", + "ui/commands/open_url_command.h", + "ui/commands/open_url_command.mm", + "ui/commands/reading_list_add_command.h", + "ui/commands/reading_list_add_command.mm", + "ui/commands/set_up_for_testing_command.h", + "ui/commands/set_up_for_testing_command.mm", + "ui/commands/show_mail_composer_command.h", + "ui/commands/show_mail_composer_command.mm", + "ui/commands/show_signin_command.h", + "ui/commands/show_signin_command.mm", + "ui/context_menu/context_menu_coordinator.h", + "ui/context_menu/context_menu_coordinator.mm", + "ui/file_locations.h", + "ui/file_locations.mm", + "ui/image_util.h", + "ui/image_util.mm", + "ui/keyboard/UIKeyCommand+Chrome.h", + "ui/keyboard/UIKeyCommand+Chrome.mm", + "ui/keyboard/hardware_keyboard_watcher.h", + "ui/keyboard/hardware_keyboard_watcher.mm", + "ui/native_content_controller.h", + "ui/native_content_controller.mm", + "ui/omnibox/web_omnibox_edit_controller.cc", + "ui/omnibox/web_omnibox_edit_controller.h", + "ui/orientation_limiting_navigation_controller.h", + "ui/orientation_limiting_navigation_controller.mm", + "ui/prerender_final_status.h", + "ui/reversed_animation.h", + "ui/reversed_animation.mm", + "ui/rtl_geometry.h", + "ui/rtl_geometry.mm", + "ui/show_mail_composer_util.h", + "ui/show_mail_composer_util.mm", + "ui/show_privacy_settings_util.h", + "ui/show_privacy_settings_util.mm", + "ui/side_swipe_gesture_recognizer.h", + "ui/side_swipe_gesture_recognizer.mm", + "ui/size_class_support_util.h", + "ui/size_class_support_util.mm", + "ui/ui_util.h", + "ui/ui_util.mm", + "ui/uikit_ui_util.h", + "ui/uikit_ui_util.mm", + "ui/url_loader.h", + "ui/webui/about_ui.cc", + "ui/webui/about_ui.h", + "ui/webui/crashes_ui.cc", + "ui/webui/crashes_ui.h", + "ui/webui/flags_ui.cc", + "ui/webui/flags_ui.h", + "ui/webui/gcm/gcm_internals_ui.cc", + "ui/webui/gcm/gcm_internals_ui.h", + "ui/webui/history/browsing_history_handler.cc", + "ui/webui/history/browsing_history_handler.h", + "ui/webui/history/favicon_source.cc", + "ui/webui/history/favicon_source.h", + "ui/webui/history/history_ui.h", + "ui/webui/history/history_ui.mm", + "ui/webui/history/metrics_handler.cc", + "ui/webui/history/metrics_handler.h", + "ui/webui/mojo_web_ui_ios_controller.h", + "ui/webui/net_export/net_export_ui.cc", + "ui/webui/net_export/net_export_ui.h", + "ui/webui/sync_internals/sync_internals_message_handler.cc", + "ui/webui/sync_internals/sync_internals_message_handler.h", + "ui/webui/sync_internals/sync_internals_ui.cc", + "ui/webui/sync_internals/sync_internals_ui.h", + "ui/webui/version_handler.cc", + "ui/webui/version_handler.h", + "ui/webui/version_ui.h", + "ui/webui/version_ui.mm", + "undo/bookmark_undo_service_factory.cc", + "undo/bookmark_undo_service_factory.h", + "updatable_config/updatable_array.h", + "updatable_config/updatable_array.mm", + "updatable_config/updatable_config_base.h", + "updatable_config/updatable_config_base.mm", + "updatable_config/updatable_dictionary.h", + "updatable_config/updatable_dictionary.mm", + "update_client/ios_chrome_update_query_params_delegate.cc", + "update_client/ios_chrome_update_query_params_delegate.h", + "variations/ios_chrome_variations_service_client.cc", + "variations/ios_chrome_variations_service_client.h", + "web/dom_altering_lock.h", + "web/dom_altering_lock.mm", + "web/resubmit_data_controller.h", + "web/resubmit_data_controller.mm", + "web_data_service_factory.cc", + "web_data_service_factory.h", + "web_resource/web_resource_util.cc", + "web_resource/web_resource_util.h", + "xcallback_parameters.h", + "xcallback_parameters.mm", + ] + + deps = [ + ":about_flags", + ":injected_js", + "//base", + "//base:i18n", + "//breakpad:client", + "//components/about_handler", + "//components/autofill/core/browser", + "//components/autofill/core/common", + "//components/autofill/ios/browser", + "//components/bookmarks/browser", + "//components/browser_sync/browser", + "//components/browser_sync/common", + "//components/browsing_data_ui", + "//components/certificate_reporting", + "//components/component_updater", + "//components/content_settings/core/browser", + "//components/content_settings/core/common", + "//components/cookie_config", + "//components/crash/core/browser", + "//components/crash/core/common", + "//components/data_reduction_proxy/core/common", + "//components/dom_distiller/core", + "//components/dom_distiller/ios", + "//components/favicon/core", + "//components/favicon_base", + "//components/flags_ui", + "//components/gcm_driver", + "//components/google/core/browser", + "//components/history/core/browser", + "//components/history/ios/browser", + "//components/image_fetcher", + "//components/infobars/core", + "//components/invalidation/impl", + "//components/invalidation/public", + "//components/keyed_service/core", + "//components/keyed_service/ios", + "//components/language_usage_metrics", + "//components/leveldb_proto", + "//components/metrics", + "//components/metrics:net", + "//components/metrics:profiler", + "//components/metrics:profiler_ios", + "//components/metrics:ui", + "//components/metrics_services_manager", + "//components/navigation_metrics", + "//components/net_log", + "//components/network_session_configurator", + "//components/network_time", + "//components/ntp_snippets", + "//components/omnibox/browser", + "//components/open_from_clipboard", + "//components/password_manager/core/browser", + "//components/password_manager/core/common", + "//components/password_manager/sync/browser", + "//components/policy:policy_component_common", + "//components/pref_registry", + "//components/prefs", + "//components/profile_metrics", + "//components/proxy_config", + "//components/rappor", + "//components/resources", + "//components/search", + "//components/search_engines", + "//components/security_interstitials/core", + "//components/security_state", + "//components/sessions", + "//components/signin/core/browser", + "//components/signin/core/common", + "//components/signin/ios/browser", + "//components/ssl_config", + "//components/strings", + "//components/suggestions", + "//components/sync_driver", + "//components/sync_sessions", + "//components/syncable_prefs", + "//components/translate/core/browser", + "//components/translate/core/common", + "//components/translate/ios/browser", + "//components/undo", + "//components/update_client", + "//components/upload_list", + "//components/url_formatter", + "//components/user_prefs", + "//components/variations", + "//components/variations/service", + "//components/version_info", + "//components/version_ui", + "//components/web_resource", + "//components/webdata_services", + "//components/webp_transcode", + "//google_apis", + "//ios/chrome/browser/variations:ios_chrome_ui_string_overrider_factory", + "//ios/chrome/common", + "//ios/chrome/common/app_group", + "//ios/net", + "//ios/public/provider/chrome/browser", + "//ios/public/provider/web", + "//ios/web", + "//ios/web:user_agent", + "//ios/web/public/app", + "//net", + "//net:extras", + "//services/shell/public/cpp", + "//skia", + "//sync", + "//third_party/brotli", + "//third_party/google_toolbox_for_mac", + "//ui/base", + "//ui/gfx", + "//ui/resources", + "//ui/strings", + "//url", + + # TODO(crbug.com/459705): add support for resource packing and change the + # dependency to be on the packed resources instead of the unpacked ones. + "//ios/chrome/app/resources", + "//ios/chrome/app/strings", + "//ios/chrome/app/theme", + ] + + allow_circular_includes_from = [ ":about_flags" ] + + libs = [ + "Accelerate.framework", + "CoreGraphics.framework", + "CoreLocation.framework", + "Foundation.framework", + "QuartzCore.framework", + "UIKit.framework", + ] + + if (enable_rlz) { + sources += [ + "rlz/rlz_tracker_delegate_impl.cc", + "rlz/rlz_tracker_delegate_impl.h", + ] + + deps += [ + "//components/rlz", + "//rlz:rlz_lib", + ] + } +} + +# This is a separate target so that the 'defines' does not leak to the +# other files (which would increase the compilation time when changing +# the value). +source_set("about_flags") { + visibility = [ ":browser" ] + + sources = [ + "about_flags.h", + "about_flags.mm", + ] + + deps = [ + "//base", + "//components/autofill/core/common", + "//components/dom_distiller/core", + "//components/flags_ui", + "//components/flags_ui:switches", + "//components/strings", + "//components/sync_driver", + "//components/variations", + "//google_apis", + "//ios/chrome/app/strings", + "//ios/web", + "//ios/web:user_agent", + ] + + defines = [ + "GOOGLE_STAGING_API_URL=\"$google_staging_api_url\"", + "GOOGLE_STAGING_LSO_URL=\"$google_staging_lso_url\"", + "GOOGLE_TEST_API_URL=\"$google_test_api_url\"", + "GOOGLE_TEST_LSO_URL=\"$google_test_lso_url\"", + "GOOGLE_TEST_OAUTH_CLIENT_ID=\"$google_test_oauth_client_id\"", + "GOOGLE_TEST_OAUTH_CLIENT_SECRET=\"$google_test_oauth_client_secret\"", + "GOOGLE_TEST_OAUTH_URL=\"$google_test_oauth_url\"", + "GOOGLE_TEST_SYNC_URL=\"$google_test_sync_url\"", + ] +} + +# Temporary target while moving coordinator classes upstream. +source_set("chrome_coordinators") { + sources = [ + "chrome_coordinator.h", + "chrome_coordinator.mm", + "root_coordinator.h", + "root_coordinator.mm", + ] + + deps = [ + "//base", + ] +} + +# TODO(crbug.com/487804): use js_compile_checked instead once the errors have +# been fixed. +js_compile_unchecked("injected_js") { + visibility = [ ":browser" ] + sources = [ + "find_in_page/resources/find_in_page.js", + "passwords/resources/credential_manager.js", + "passwords/resources/password_controller.js", + ] +} + +source_set("test_support") { + testonly = true + sources = [ + "browser_state/test_chrome_browser_state.h", + "browser_state/test_chrome_browser_state.mm", + "browser_state/test_chrome_browser_state_isolated_context.h", + "browser_state/test_chrome_browser_state_isolated_context.mm", + "browser_state/test_chrome_browser_state_manager.cc", + "browser_state/test_chrome_browser_state_manager.h", + "geolocation/test_location_manager.h", + "geolocation/test_location_manager.mm", + "net/mock_image_fetcher.h", + "net/mock_image_fetcher.mm", + "signin/fake_oauth2_token_service_builder.h", + "signin/fake_oauth2_token_service_builder.mm", + "signin/fake_signin_manager_builder.cc", + "signin/fake_signin_manager_builder.h", + "sync/fake_sync_service_factory.cc", + "sync/fake_sync_service_factory.h", + "sync/ios_chrome_profile_sync_test_util.cc", + "sync/ios_chrome_profile_sync_test_util.h", + "sync/sync_setup_service_mock.cc", + "sync/sync_setup_service_mock.h", + ] + + deps = [ + ":browser", + "//base", + "//components/bookmarks/browser", + "//components/browser_sync/browser", + "//components/browser_sync/browser:test_support", + "//components/history/core/browser", + "//components/history/ios/browser", + "//components/keyed_service/core", + "//components/keyed_service/ios", + "//components/pref_registry:test_support", + "//components/signin/core/browser", + "//components/signin/core/browser", + "//components/signin/core/browser:test_support", + "//components/signin/ios/browser", + "//components/signin/ios/browser:test_support", + "//components/sync_driver", + "//components/sync_driver:test_support", + "//components/syncable_prefs", + "//components/syncable_prefs:test_support", + "//components/user_prefs", + "//components/webdata_services", + "//ios/chrome/browser", + "//ios/chrome/common", + "//ios/chrome/test", + "//ios/public/provider/chrome/browser", + "//ios/public/provider/chrome/browser:test_support", + "//ios/web", + "//net:test_support", + "//sync", + "//testing/gmock", + "//testing/gtest", + "//ui/base", + "//url", + ] +} diff --git a/chromium/ios/chrome/browser/variations/BUILD.gn b/chromium/ios/chrome/browser/variations/BUILD.gn new file mode 100644 index 00000000000..7b4ce3ee66d --- /dev/null +++ b/chromium/ios/chrome/browser/variations/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//components/variations/service/generate_ui_string_overrider.gni") + +generate_ui_string_overrider("ios_chrome_ui_string_overrider_factory") { + inputs = [ + "$root_gen_dir/components/strings/grit/components_chromium_strings.h", + "$root_gen_dir/components/strings/grit/components_google_chrome_strings.h", + "$root_gen_dir/components/strings/grit/components_locale_settings.h", + "$root_gen_dir/components/strings/grit/components_strings.h", + "$root_gen_dir/ios/chrome/grit/ios_chromium_strings.h", + "$root_gen_dir/ios/chrome/grit/ios_google_chrome_strings.h", + "$root_gen_dir/ios/chrome/grit/ios_strings.h", + ] + deps = [ + "//components/strings:components_chromium_strings", + "//components/strings:components_google_chrome_strings", + "//components/strings:components_locale_settings", + "//components/strings:components_strings", + "//ios/chrome/app/strings:ios_chromium_strings", + "//ios/chrome/app/strings:ios_google_chrome_strings", + "//ios/chrome/app/strings:ios_strings", + ] + namespace = "" # Put the functions in the global namespace on iOS. + header_filename = "ios_ui_string_overrider_factory.h" + source_filename = "ios_ui_string_overrider_factory.cc" +} diff --git a/chromium/ios/chrome/common/BUILD.gn b/chromium/ios/chrome/common/BUILD.gn new file mode 100644 index 00000000000..126dea6c04c --- /dev/null +++ b/chromium/ios/chrome/common/BUILD.gn @@ -0,0 +1,25 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("common") { + sources = [ + "channel_info.h", + "channel_info.mm", + "material_timing.h", + "material_timing.mm", + "string_util.h", + "string_util.mm", + ] + + deps = [ + "//base", + "//components/version_info", + "//ios/chrome/common/app_group:main_app", + ] + + libs = [ + "CoreGraphics.framework", + "Foundation.framework", + ] +} diff --git a/chromium/ios/chrome/common/app_group/BUILD.gn b/chromium/ios/chrome/common/app_group/BUILD.gn new file mode 100644 index 00000000000..5309f414463 --- /dev/null +++ b/chromium/ios/chrome/common/app_group/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("app_group") { + sources = [ + "app_group_constants.h", + "app_group_constants.mm", + "app_group_metrics.h", + "app_group_metrics.mm", + ] + + deps = [ + "//base", + "//components/version_info", + ] + + libs = [ + "CoreGraphics.framework", + "Foundation.framework", + ] +} + +# This target will be included into application extensions and the list +# of its dependencies must be kept as short as possible. +source_set("client") { + sources = [ + "app_group_metrics_client.h", + "app_group_metrics_client.mm", + ] + + deps = [ + ":app_group", + "//base", + ] +} + +source_set("main_app") { + sources = [ + "app_group_metrics_mainapp.h", + "app_group_metrics_mainapp.mm", + ] + + deps = [ + ":app_group", + "//base", + ] +} diff --git a/chromium/ios/chrome/common/physical_web/BUILD.gn b/chromium/ios/chrome/common/physical_web/BUILD.gn new file mode 100644 index 00000000000..52cec635053 --- /dev/null +++ b/chromium/ios/chrome/common/physical_web/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("physical_web") { + sources = [ + "physical_web_device.h", + "physical_web_device.mm", + "physical_web_request.h", + "physical_web_request.mm", + "physical_web_scanner.h", + "physical_web_scanner.mm", + "physical_web_types.h", + "physical_web_types.mm", + ] + + deps = [ + "//base", + "//components/version_info", + "//device/bluetooth/uribeacon", + "//google_apis", + "//ios/web:user_agent", + ] + + libs = [ + "CoreBluetooth.framework", + "Foundation.framework", + ] +} diff --git a/chromium/ios/chrome/extension_repack.gni b/chromium/ios/chrome/extension_repack.gni new file mode 100644 index 00000000000..aa71bcdaa50 --- /dev/null +++ b/chromium/ios/chrome/extension_repack.gni @@ -0,0 +1,103 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/repack.gni") + +# Pack all resources for an application extension for a given locale. +# +# Arguments: +# +# extension [required] +# name of the application extension. +# +# input_locale [required] +# name of the locale to pack. +# +# output_locale [required] +# name of the locale (may be different from input_locale as iOS +# and Chrome does not use the same convention for naming locales +# with country variants). +# +# visibility [optional] +# usual meaning. +# +template("_extension_repack_one_locale") { + assert(defined(invoker.extension), "Need extension for $target_name") + assert(defined(invoker.input_locale), "Need input_locale for $target_name") + assert(defined(invoker.output_locale), "Need output_locale for $target_name") + + repack_and_bundle(target_name) { + forward_variables_from(invoker, [ "visibility" ]) + + deps = [ + "//ios/chrome/${invoker.extension}/strings", + ] + + sources = [ + "$root_gen_dir/ios/${invoker.extension}/" + + "ios_${invoker.extension}_strings_${invoker.input_locale}.pak", + ] + + output = "$target_gen_dir/${invoker.output_locale}.lproj/locale.pak" + bundle_output = "{{bundle_resources_dir}}/" + + "${invoker.output_locale}.lproj/locale.pak" + } +} + +# Pack all resoruces for an application extension for all locales. +# +# Arguments: +# +# extension [required] +# name of the application extension. +# +# input_locales [required] +# list of all locales to pack. +# +# output_locales [required] +# list of all locales in application bundle (may differ from input +# locales as iOS and Chrome does not use the same convention for +# naming locales with country variants). +# +# Must be the same length as input_locales. +# +# visibility [optional] +# usual meaning. +# +template("extension_repack_all_locales") { + assert(defined(invoker.extension), "Need extension for $target_name") + assert(defined(invoker.input_locales), "Need input_locales for $target_name") + assert(defined(invoker.output_locales), + "Need output_locales for $target_name") + + _target_name = target_name + + # TODO(614747): GN parser does not grok invoker.output_locales[foo]. Use a + # local variables to workaround this issue until the issue is fixed. + _current_locale = 0 + _output_locales = invoker.output_locales + + # Collect all locale targets to avoid looping twice over the locales. + _locale_targets = [] + + foreach(_input_locale, invoker.input_locales) { + _output_locale = _output_locales[_current_locale] + + _locale_target = _target_name + "_$_input_locale" + _extension_repack_one_locale(_locale_target) { + visibility = [ ":$_target_name" ] + input_locale = _input_locale + output_locale = _output_locale + extension = invoker.extension + } + + _locale_targets += [ ":$_locale_target" ] + _current_locale = _current_locale + 1 + } + + group(_target_name) { + forward_variables_from(invoker, [ "visibility" ]) + public_deps = _locale_targets + } +} diff --git a/chromium/ios/chrome/share_extension/BUILD.gn b/chromium/ios/chrome/share_extension/BUILD.gn new file mode 100644 index 00000000000..148827185b6 --- /dev/null +++ b/chromium/ios/chrome/share_extension/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/locales.gni") +import("//ios/chrome/extension_repack.gni") + +group("resources") { + deps = [ + "//ios/chrome/share_extension/strings", + ] +} + +extension_repack_all_locales("packed_resources") { + extension = "share_extension" + input_locales = ios_packed_locales + output_locales = ios_packed_locales_as_mac_outputs +} diff --git a/chromium/ios/chrome/share_extension/strings/BUILD.gn b/chromium/ios/chrome/share_extension/strings/BUILD.gn new file mode 100644 index 00000000000..6c66a02246b --- /dev/null +++ b/chromium/ios/chrome/share_extension/strings/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/locales.gni") +import("//tools/grit/grit_rule.gni") + +grit("strings") { + source = "ios_share_extension_strings.grd" + output_dir = "$root_gen_dir/ios/share_extension" + use_qualified_include = true + outputs = [ + "grit/ios_share_extension_strings.h", + ] + foreach(locale, locales_with_fake_bidi) { + outputs += [ "ios_share_extension_strings_$locale.pak" ] + } +} diff --git a/chromium/ios/chrome/test/BUILD.gn b/chromium/ios/chrome/test/BUILD.gn new file mode 100644 index 00000000000..f0148cb870d --- /dev/null +++ b/chromium/ios/chrome/test/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("test") { + testonly = true + sources = [ + "block_cleanup_test.h", + "block_cleanup_test.mm", + "ios_chrome_scoped_testing_chrome_browser_provider.h", + "ios_chrome_scoped_testing_chrome_browser_provider.mm", + "ios_chrome_scoped_testing_local_state.cc", + "ios_chrome_scoped_testing_local_state.h", + "ios_chrome_unit_test_suite.h", + "ios_chrome_unit_test_suite.mm", + "testing_application_context.h", + "testing_application_context.mm", + ] + + deps = [ + "//base", + "//base/test:test_support", + "//components/network_time", + "//components/prefs", + "//components/prefs:test_support", + "//ios/chrome/browser", + "//ios/public/provider/chrome/browser", + "//ios/public/provider/chrome/browser:test_support", + "//ios/web", + "//net", + "//testing/gmock", + "//testing/gtest", + "//ui/base", + "//url", + ] +} + +source_set("run_all_unittests") { + testonly = true + sources = [ + "run_all_unittests.cc", + ] + deps = [ + ":test", + "//base", + "//base/test:test_support", + ] +} diff --git a/chromium/ios/chrome/today_extension/BUILD.gn b/chromium/ios/chrome/today_extension/BUILD.gn new file mode 100644 index 00000000000..ffa17a9af7a --- /dev/null +++ b/chromium/ios/chrome/today_extension/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/locales.gni") +import("//ios/chrome/extension_repack.gni") + +group("resources") { + deps = [ + "//ios/chrome/today_extension/strings", + ] +} + +extension_repack_all_locales("packed_resources") { + extension = "today_extension" + input_locales = ios_packed_locales + output_locales = ios_packed_locales_as_mac_outputs +} diff --git a/chromium/ios/chrome/today_extension/strings/BUILD.gn b/chromium/ios/chrome/today_extension/strings/BUILD.gn new file mode 100644 index 00000000000..99fa95471ed --- /dev/null +++ b/chromium/ios/chrome/today_extension/strings/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/locales.gni") +import("//tools/grit/grit_rule.gni") + +grit("strings") { + source = "ios_today_extension_strings.grd" + output_dir = "$root_gen_dir/ios/today_extension" + use_qualified_include = true + outputs = [ + "grit/ios_today_extension_strings.h", + ] + foreach(locale, locales_with_fake_bidi) { + outputs += [ "ios_today_extension_strings_$locale.pak" ] + } +} diff --git a/chromium/ios/chrome/tools/strings/BUILD.gn b/chromium/ios/chrome/tools/strings/BUILD.gn new file mode 100644 index 00000000000..be879ccc0c7 --- /dev/null +++ b/chromium/ios/chrome/tools/strings/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("generate_localizable_strings") { + sources = [ + "generate_localizable_strings.mm", + ] + deps = [ + "//base", + "//ui/base:ui_data_pack", + ] + libs = [ "Foundation.framework" ] +} diff --git a/chromium/ios/chrome/tools/strings/generate_localizable_strings.gni b/chromium/ios/chrome/tools/strings/generate_localizable_strings.gni new file mode 100644 index 00000000000..dd85a2d1f72 --- /dev/null +++ b/chromium/ios/chrome/tools/strings/generate_localizable_strings.gni @@ -0,0 +1,104 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/compiled_action.gni") + +# Help template to define a data_bundle with localized strings for use by +# the iOS system from packed locale.pak files. +# +# Arguments +# config_file +# string, path to the property list file containing the configuration +# parameters for the invocation of generate_localizable_strings tool. +# +# datapack_dir +# string, path to the directory containing the packed locale.pak files +# in use for the generate_localizable_strings tool. +# +# locales +# list of strings corresponding to all the locales that should be +# generated and packed. +# +# output_filenames +# list of strings corresponding to the basename of the files generated +# by the generate_localizable_strings tool (i.e. if it contains ["a"] +# then the tool will generate ["$locale.lproj/a"] for each locale set +# in locales argument). +# +# deps +# list of target labels. +# +template("generate_localizable_strings") { + assert(defined(invoker.config_file), + "config_file needs to be defined for ${target_name}") + assert(defined(invoker.datapack_dir), + "datapack_dir needs to be defined for ${target_name}") + assert(defined(invoker.output_filenames), + "output_filenames needs to be defined for ${target_name}") + assert(defined(invoker.packed_locales), + "packed_locales needs to be defined for ${target_name}") + + _target_name = target_name + + _bundle_targets = [] + foreach(locale, invoker.packed_locales) { + _bundle_targets += [ ":${_target_name}_${locale}" ] + + bundle_data("${_target_name}_${locale}") { + forward_variables_from(invoker, [ "testonly" ]) + + visibility = [ ":${_target_name}" ] + public_deps = [ + ":${_target_name}_generate", + ] + sources = [] + foreach(filename, invoker.output_filenames) { + sources += [ "${target_gen_dir}/${locale}.lproj/$filename" ] + } + outputs = [ + "{{bundle_resources_dir}}/${locale}.lproj/{{source_file_part}}", + ] + } + } + + compiled_action("${_target_name}_generate") { + forward_variables_from(invoker, [ "testonly" ]) + + visibility = _bundle_targets + deps = invoker.deps + tool = "//ios/chrome/tools/strings:generate_localizable_strings" + + outputs = [] + inputs = [ + invoker.config_file, + ] + + foreach(locale, invoker.packed_locales) { + inputs += [ "${invoker.datapack_dir}/${locale}.lproj/locale.pak" ] + foreach(filename, invoker.output_filenames) { + outputs += [ "${target_gen_dir}/${locale}.lproj/$filename" ] + } + } + + args = [ + "-c", + rebase_path(invoker.config_file, root_build_dir), + "-I", + rebase_path(root_gen_dir, root_build_dir), + "-p", + rebase_path(invoker.datapack_dir, root_build_dir), + "-o", + rebase_path(target_gen_dir, root_build_dir), + ] + invoker.packed_locales + } + + group(_target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + deps = _bundle_targets + } +} diff --git a/chromium/ios/net/BUILD.gn b/chromium/ios/net/BUILD.gn new file mode 100644 index 00000000000..65c9eac43a2 --- /dev/null +++ b/chromium/ios/net/BUILD.gn @@ -0,0 +1,83 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") +import("//testing/test.gni") + +source_set("net") { + deps = [ + "//base", + "//base:i18n", + "//net", + "//url:url_features", + ] + + sources = [ + "clients/crn_forwarding_network_client.h", + "clients/crn_forwarding_network_client.mm", + "clients/crn_forwarding_network_client_factory.h", + "clients/crn_forwarding_network_client_factory.mm", + "clients/crn_network_client_protocol.h", + "clients/crn_simple_network_client_factory.h", + "clients/crn_simple_network_client_factory.mm", + "cookies/cookie_cache.cc", + "cookies/cookie_cache.h", + "cookies/cookie_creation_time_manager.h", + "cookies/cookie_creation_time_manager.mm", + "cookies/cookie_store_ios.h", + "cookies/cookie_store_ios.mm", + "cookies/cookie_store_ios_client.h", + "cookies/cookie_store_ios_client.mm", + "cookies/system_cookie_util.h", + "cookies/system_cookie_util.mm", + "crn_http_protocol_handler.h", + "crn_http_protocol_handler.mm", + "crn_http_protocol_handler_proxy.h", + "crn_http_protocol_handler_proxy_with_client_thread.h", + "crn_http_protocol_handler_proxy_with_client_thread.mm", + "crn_http_url_response.h", + "crn_http_url_response.mm", + "empty_nsurlcache.h", + "empty_nsurlcache.mm", + "http_cache_helper.cc", + "http_cache_helper.h", + "http_protocol_logging.h", + "http_protocol_logging.mm", + "http_response_headers_util.h", + "http_response_headers_util.mm", + "nsurlrequest_util.h", + "nsurlrequest_util.mm", + "protocol_handler_util.h", + "protocol_handler_util.mm", + "request_tracker.h", + "request_tracker.mm", + "url_scheme_util.h", + "url_scheme_util.mm", + ] +} + +test("ios_net_unittests") { + deps = [ + ":net", + "//base", + "//base/test:run_all_unittests", + "//net:test_support", + "//testing/gtest", + "//url", + ] + + sources = [ + "clients/crn_forwarding_network_client_factory_unittest.mm", + "cookies/cookie_cache_unittest.cc", + "cookies/cookie_creation_time_manager_unittest.mm", + "cookies/cookie_store_ios_unittest.mm", + "cookies/system_cookie_util_unittest.mm", + "http_response_headers_util_unittest.mm", + "nsurlrequest_util_unittest.mm", + "protocol_handler_util_unittest.mm", + "url_scheme_util_unittest.mm", + ] + + assert_no_deps = ios_assert_no_deps +} diff --git a/chromium/ios/public/consumer/base/BUILD.gn b/chromium/ios/public/consumer/base/BUILD.gn new file mode 100644 index 00000000000..eb83ba22b1a --- /dev/null +++ b/chromium/ios/public/consumer/base/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("base") { + sources = [ + "//ios/consumer/base/debugger.mm", + "//ios/public/consumer/base/debugger.h", + ] + deps = [ + "//base", + ] +} diff --git a/chromium/ios/public/provider/chrome/browser/BUILD.gn b/chromium/ios/public/provider/chrome/browser/BUILD.gn new file mode 100644 index 00000000000..2d00dce3064 --- /dev/null +++ b/chromium/ios/public/provider/chrome/browser/BUILD.gn @@ -0,0 +1,60 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("browser") { + sources = [ + "browser_constants.cc", + "browser_constants.h", + "chrome_browser_provider.h", + "chrome_browser_provider.mm", + "geolocation_updater_provider.h", + "geolocation_updater_provider.mm", + "signin/chrome_identity.h", + "signin/chrome_identity.mm", + "signin/chrome_identity_interaction_manager.h", + "signin/chrome_identity_interaction_manager.mm", + "signin/chrome_identity_service.h", + "signin/chrome_identity_service.mm", + "signin/signin_error_provider.h", + "signin/signin_error_provider.mm", + "signin/signin_resources_provider.h", + "signin/signin_resources_provider.mm", + "ui/default_ios_web_view_factory.h", + "ui/default_ios_web_view_factory.mm", + "ui/infobar_view_delegate.h", + "ui/infobar_view_protocol.h", + "updatable_resource_provider.h", + "updatable_resource_provider.mm", + ] + + deps = [ + "//base", + "//components/autofill/core/browser", + "//components/favicon_base", + "//components/metrics", + "//components/sync_sessions", + "//ios/public/provider/web", + "//ios/web", + ] +} + +source_set("test_support") { + testonly = true + + sources = [ + "test_chrome_browser_provider.h", + "test_chrome_browser_provider.mm", + "test_chrome_provider_initializer.h", + "test_chrome_provider_initializer.mm", + "test_updatable_resource_provider.h", + "test_updatable_resource_provider.mm", + ] + + deps = [ + ":browser", + "//base", + "//components/signin/ios/browser:test_support", + "//testing/gtest", + ] +} diff --git a/chromium/ios/public/provider/web/BUILD.gn b/chromium/ios/public/provider/web/BUILD.gn new file mode 100644 index 00000000000..f9334fc27a9 --- /dev/null +++ b/chromium/ios/public/provider/web/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("web") { + sources = [ + "web_controller_provider.h", + "web_controller_provider.mm", + "web_ui_ios.h", + "web_ui_ios_controller.cc", + "web_ui_ios_controller.h", + "web_ui_ios_controller_factory.h", + "web_ui_ios_message_handler.cc", + "web_ui_ios_message_handler.h", + ] + + deps = [ + "//base", + "//ios/web", + "//url", + ] + + allow_circular_includes_from = [ "//ios/web" ] +} diff --git a/chromium/ios/testing/BUILD.gn b/chromium/ios/testing/BUILD.gn new file mode 100644 index 00000000000..754d27163a8 --- /dev/null +++ b/chromium/ios/testing/BUILD.gn @@ -0,0 +1,37 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") +import("//testing/test.gni") + +source_set("ocmock_support") { + testonly = true + + deps = [ + "//base", + ] + + public_deps = [ + "//third_party/google_toolbox_for_mac", + "//third_party/ocmock", + ] + + sources = [ + "ocmock_complex_type_helper.h", + "ocmock_complex_type_helper.mm", + ] +} + +test("ocmock_support_unittest") { + deps = [ + ":ocmock_support", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/ocmock", + ] + + assert_no_deps = ios_assert_no_deps +} diff --git a/chromium/ios/testing/earl_grey/BUILD.gn b/chromium/ios/testing/earl_grey/BUILD.gn new file mode 100644 index 00000000000..7c7eeb41a7c --- /dev/null +++ b/chromium/ios/testing/earl_grey/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("earl_grey_support_config") { + include_dirs = [ "." ] + visibility = [ ":earl_grey_support" ] +} + +source_set("earl_grey_support") { + testonly = true + + deps = [ + "//ios/third_party/earl_grey", + ] + + sources = [ + "wait_util.h", + "wait_util.mm", + ] + + public_configs = [ ":earl_grey_support_config" ] + configs += [ ":earl_grey_support_config" ] +} diff --git a/chromium/ios/third_party/blink/BUILD.gn b/chromium/ios/third_party/blink/BUILD.gn new file mode 100644 index 00000000000..83e0e7a9c31 --- /dev/null +++ b/chromium/ios/third_party/blink/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("html_tokenizer") { + deps = [ + "//base", + ] + + sources = [ + "src/html_character_provider.h", + "src/html_input_stream_preprocessor.h", + "src/html_markup_tokenizer_inlines.h", + "src/html_token.h", + "src/html_token.mm", + "src/html_tokenizer.h", + "src/html_tokenizer.mm", + "src/html_tokenizer_adapter.h", + ] +} diff --git a/chromium/ios/third_party/earl_grey/BUILD.gn b/chromium/ios/third_party/earl_grey/BUILD.gn new file mode 100644 index 00000000000..2e1f7e6f050 --- /dev/null +++ b/chromium/ios/third_party/earl_grey/BUILD.gn @@ -0,0 +1,262 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/ios_sdk.gni") +import("//build/config/ios/rules.gni") + +config("config") { + include_dirs = [ "src/EarlGrey" ] + + # EarlGrey and its dependencies need to link to XCTest.framework + # that is not under $ios_sdk_path. + common_flags = [ "-F$ios_sdk_path/../../Library/Frameworks" ] + cflags_objc = common_flags + cflags_objcc = common_flags + ldflags = common_flags +} + +ios_framework_bundle("earl_grey") { + output_name = "EarlGrey" + + testonly = true + sources = [ + "src/EarlGrey/Action/GREYAction.h", + "src/EarlGrey/Action/GREYActionBlock.h", + "src/EarlGrey/Action/GREYActionBlock.m", + "src/EarlGrey/Action/GREYActions.h", + "src/EarlGrey/Action/GREYActions.m", + "src/EarlGrey/Action/GREYBaseAction.h", + "src/EarlGrey/Action/GREYBaseAction.m", + "src/EarlGrey/Action/GREYChangeStepperAction.h", + "src/EarlGrey/Action/GREYChangeStepperAction.m", + "src/EarlGrey/Action/GREYPathGestureUtils.h", + "src/EarlGrey/Action/GREYPathGestureUtils.m", + "src/EarlGrey/Action/GREYPickerAction.h", + "src/EarlGrey/Action/GREYPickerAction.m", + "src/EarlGrey/Action/GREYScrollAction.h", + "src/EarlGrey/Action/GREYScrollAction.m", + "src/EarlGrey/Action/GREYScrollActionError.h", + "src/EarlGrey/Action/GREYScrollActionError.m", + "src/EarlGrey/Action/GREYScrollToContentEdgeAction.h", + "src/EarlGrey/Action/GREYScrollToContentEdgeAction.m", + "src/EarlGrey/Action/GREYSlideAction.h", + "src/EarlGrey/Action/GREYSlideAction.m", + "src/EarlGrey/Action/GREYSwipeAction.h", + "src/EarlGrey/Action/GREYSwipeAction.m", + "src/EarlGrey/Action/GREYTapAction.h", + "src/EarlGrey/Action/GREYTapAction.m", + "src/EarlGrey/Action/GREYTapper.h", + "src/EarlGrey/Action/GREYTapper.m", + "src/EarlGrey/Additions/CAAnimation+GREYAdditions.h", + "src/EarlGrey/Additions/CAAnimation+GREYAdditions.m", + "src/EarlGrey/Additions/CALayer+GREYAdditions.h", + "src/EarlGrey/Additions/CALayer+GREYAdditions.m", + "src/EarlGrey/Additions/CGGeometry+GREYAdditions.h", + "src/EarlGrey/Additions/CGGeometry+GREYAdditions.m", + "src/EarlGrey/Additions/NSError+GREYAdditions.h", + "src/EarlGrey/Additions/NSError+GREYAdditions.m", + "src/EarlGrey/Additions/NSObject+GREYAdditions.h", + "src/EarlGrey/Additions/NSObject+GREYAdditions.m", + "src/EarlGrey/Additions/NSRunLoop+GREYAdditions.h", + "src/EarlGrey/Additions/NSRunLoop+GREYAdditions.m", + "src/EarlGrey/Additions/NSString+GREYAdditions.h", + "src/EarlGrey/Additions/NSString+GREYAdditions.m", + "src/EarlGrey/Additions/NSTimer+GREYAdditions.h", + "src/EarlGrey/Additions/NSTimer+GREYAdditions.m", + "src/EarlGrey/Additions/NSURL+GREYAdditions.h", + "src/EarlGrey/Additions/NSURL+GREYAdditions.m", + "src/EarlGrey/Additions/NSURLConnection+GREYAdditions.h", + "src/EarlGrey/Additions/NSURLConnection+GREYAdditions.m", + "src/EarlGrey/Additions/UIAnimation+GREYAdditions.h", + "src/EarlGrey/Additions/UIAnimation+GREYAdditions.m", + "src/EarlGrey/Additions/UIApplication+GREYAdditions.h", + "src/EarlGrey/Additions/UIApplication+GREYAdditions.m", + "src/EarlGrey/Additions/UIScrollView+GREYAdditions.h", + "src/EarlGrey/Additions/UIScrollView+GREYAdditions.m", + "src/EarlGrey/Additions/UISwitch+GREYAdditions.h", + "src/EarlGrey/Additions/UISwitch+GREYAdditions.m", + "src/EarlGrey/Additions/UITouch+GREYAdditions.h", + "src/EarlGrey/Additions/UITouch+GREYAdditions.m", + "src/EarlGrey/Additions/UIView+GREYAdditions.h", + "src/EarlGrey/Additions/UIView+GREYAdditions.m", + "src/EarlGrey/Additions/UIViewController+GREYAdditions.h", + "src/EarlGrey/Additions/UIViewController+GREYAdditions.m", + "src/EarlGrey/Additions/UIWebView+GREYAdditions.h", + "src/EarlGrey/Additions/UIWebView+GREYAdditions.m", + "src/EarlGrey/Additions/UIWindow+GREYAdditions.h", + "src/EarlGrey/Additions/UIWindow+GREYAdditions.m", + "src/EarlGrey/Additions/XCTestCase+GREYAdditions.h", + "src/EarlGrey/Additions/XCTestCase+GREYAdditions.m", + "src/EarlGrey/Additions/_UIGestureRecognizerFailureMap_GREYAdditions.h", + "src/EarlGrey/Additions/_UIGestureRecognizerFailureMap_GREYAdditions.m", + "src/EarlGrey/Additions/_UIModalItemsPresentingViewController_GREYAdditions.h", + "src/EarlGrey/Additions/_UIModalItemsPresentingViewController_GREYAdditions.m", + "src/EarlGrey/Additions/__NSCFLocalDataTask_GREYAdditions.h", + "src/EarlGrey/Additions/__NSCFLocalDataTask_GREYAdditions.m", + "src/EarlGrey/AppSupport/GREYIdlingResource.h", + "src/EarlGrey/Assertion/GREYAssertion.h", + "src/EarlGrey/Assertion/GREYAssertionBlock.h", + "src/EarlGrey/Assertion/GREYAssertionBlock.m", + "src/EarlGrey/Assertion/GREYAssertionDefines.h", + "src/EarlGrey/Assertion/GREYAssertions.h", + "src/EarlGrey/Assertion/GREYAssertions.m", + "src/EarlGrey/Common/GREYAnalytics.h", + "src/EarlGrey/Common/GREYAnalytics.m", + "src/EarlGrey/Common/GREYConfiguration.h", + "src/EarlGrey/Common/GREYConfiguration.m", + "src/EarlGrey/Common/GREYConstants.h", + "src/EarlGrey/Common/GREYConstants.m", + "src/EarlGrey/Common/GREYDefines.h", + "src/EarlGrey/Common/GREYElementHierarchy.h", + "src/EarlGrey/Common/GREYElementHierarchy.m", + "src/EarlGrey/Common/GREYExposed.h", + "src/EarlGrey/Common/GREYPrivate.h", + "src/EarlGrey/Common/GREYScreenshotUtil.h", + "src/EarlGrey/Common/GREYScreenshotUtil.m", + "src/EarlGrey/Common/GREYSwizzler.h", + "src/EarlGrey/Common/GREYSwizzler.m", + "src/EarlGrey/Common/GREYTestHelper.h", + "src/EarlGrey/Common/GREYTestHelper.m", + "src/EarlGrey/Common/GREYVisibilityChecker.h", + "src/EarlGrey/Common/GREYVisibilityChecker.m", + "src/EarlGrey/Core/GREYAutomationSetup.h", + "src/EarlGrey/Core/GREYAutomationSetup.m", + "src/EarlGrey/Core/GREYElementFinder.h", + "src/EarlGrey/Core/GREYElementFinder.m", + "src/EarlGrey/Core/GREYElementInteraction.h", + "src/EarlGrey/Core/GREYElementInteraction.m", + "src/EarlGrey/Core/GREYInteraction.h", + "src/EarlGrey/Core/GREYInteractionDataSource.h", + "src/EarlGrey/Core/GREYKeyboard.h", + "src/EarlGrey/Core/GREYKeyboard.m", + "src/EarlGrey/Delegate/GREYCAAnimationDelegate.h", + "src/EarlGrey/Delegate/GREYCAAnimationDelegate.m", + "src/EarlGrey/Delegate/GREYNSURLConnectionDelegate.h", + "src/EarlGrey/Delegate/GREYNSURLConnectionDelegate.m", + "src/EarlGrey/Delegate/GREYSurrogateDelegate.h", + "src/EarlGrey/Delegate/GREYSurrogateDelegate.m", + "src/EarlGrey/Delegate/GREYUIWebViewDelegate.h", + "src/EarlGrey/Delegate/GREYUIWebViewDelegate.m", + "src/EarlGrey/EarlGrey.h", + "src/EarlGrey/EarlGrey.m", + "src/EarlGrey/Event/GREYSingleSequenceTouchInjector.h", + "src/EarlGrey/Event/GREYSingleSequenceTouchInjector.m", + "src/EarlGrey/Event/GREYSyntheticEvents.h", + "src/EarlGrey/Event/GREYSyntheticEvents.m", + "src/EarlGrey/Exception/GREYDefaultFailureHandler.h", + "src/EarlGrey/Exception/GREYDefaultFailureHandler.m", + "src/EarlGrey/Exception/GREYFailureHandler.h", + "src/EarlGrey/Exception/GREYFrameworkException.h", + "src/EarlGrey/Exception/GREYFrameworkException.m", + "src/EarlGrey/Matcher/GREYAllOf.h", + "src/EarlGrey/Matcher/GREYAllOf.m", + "src/EarlGrey/Matcher/GREYAnyOf.h", + "src/EarlGrey/Matcher/GREYAnyOf.m", + "src/EarlGrey/Matcher/GREYBaseMatcher.h", + "src/EarlGrey/Matcher/GREYBaseMatcher.m", + "src/EarlGrey/Matcher/GREYDescription.h", + "src/EarlGrey/Matcher/GREYElementMatcherBlock.h", + "src/EarlGrey/Matcher/GREYElementMatcherBlock.m", + "src/EarlGrey/Matcher/GREYHCMatcher.h", + "src/EarlGrey/Matcher/GREYHCMatcher.m", + "src/EarlGrey/Matcher/GREYLayoutConstraint.h", + "src/EarlGrey/Matcher/GREYLayoutConstraint.m", + "src/EarlGrey/Matcher/GREYMatcher.h", + "src/EarlGrey/Matcher/GREYMatchers.h", + "src/EarlGrey/Matcher/GREYMatchers.m", + "src/EarlGrey/Matcher/GREYNot.h", + "src/EarlGrey/Matcher/GREYNot.m", + "src/EarlGrey/Matcher/GREYStringDescription.h", + "src/EarlGrey/Matcher/GREYStringDescription.m", + "src/EarlGrey/Provider/GREYDataEnumerator.h", + "src/EarlGrey/Provider/GREYDataEnumerator.m", + "src/EarlGrey/Provider/GREYElementProvider.h", + "src/EarlGrey/Provider/GREYElementProvider.m", + "src/EarlGrey/Provider/GREYProvider.h", + "src/EarlGrey/Provider/GREYUIWindowProvider.h", + "src/EarlGrey/Provider/GREYUIWindowProvider.m", + "src/EarlGrey/Synchronization/GREYAppStateTracker.h", + "src/EarlGrey/Synchronization/GREYAppStateTracker.m", + "src/EarlGrey/Synchronization/GREYCondition.h", + "src/EarlGrey/Synchronization/GREYCondition.m", + "src/EarlGrey/Synchronization/GREYDispatchQueueIdlingResource.h", + "src/EarlGrey/Synchronization/GREYDispatchQueueIdlingResource.m", + "src/EarlGrey/Synchronization/GREYNSTimerIdlingResource.h", + "src/EarlGrey/Synchronization/GREYNSTimerIdlingResource.m", + "src/EarlGrey/Synchronization/GREYOperationQueueIdlingResource.h", + "src/EarlGrey/Synchronization/GREYOperationQueueIdlingResource.m", + "src/EarlGrey/Synchronization/GREYSyncAPI.h", + "src/EarlGrey/Synchronization/GREYSyncAPI.m", + "src/EarlGrey/Synchronization/GREYTimedIdlingResource.h", + "src/EarlGrey/Synchronization/GREYTimedIdlingResource.m", + "src/EarlGrey/Synchronization/GREYUIThreadExecutor.h", + "src/EarlGrey/Synchronization/GREYUIThreadExecutor.m", + "src/EarlGrey/Synchronization/GREYUIWebViewIdlingResource.h", + "src/EarlGrey/Synchronization/GREYUIWebViewIdlingResource.m", + ] + public_headers = [ + "src/EarlGrey/EarlGrey.h", + "src/EarlGrey/Action/GREYAction.h", + "src/EarlGrey/Action/GREYActionBlock.h", + "src/EarlGrey/Action/GREYActions.h", + "src/EarlGrey/Action/GREYBaseAction.h", + "src/EarlGrey/Action/GREYScrollActionError.h", + "src/EarlGrey/AppSupport/GREYIdlingResource.h", + "src/EarlGrey/Assertion/GREYAssertion.h", + "src/EarlGrey/Assertion/GREYAssertionBlock.h", + "src/EarlGrey/Assertion/GREYAssertionDefines.h", + "src/EarlGrey/Assertion/GREYAssertions.h", + "src/EarlGrey/Common/GREYConfiguration.h", + "src/EarlGrey/Common/GREYConstants.h", + "src/EarlGrey/Common/GREYDefines.h", + "src/EarlGrey/Common/GREYElementHierarchy.h", + "src/EarlGrey/Common/GREYScreenshotUtil.h", + "src/EarlGrey/Common/GREYTestHelper.h", + "src/EarlGrey/Core/GREYElementFinder.h", + "src/EarlGrey/Core/GREYElementInteraction.h", + "src/EarlGrey/Core/GREYInteraction.h", + "src/EarlGrey/Exception/GREYFailureHandler.h", + "src/EarlGrey/Exception/GREYFrameworkException.h", + "src/EarlGrey/Matcher/GREYAllOf.h", + "src/EarlGrey/Matcher/GREYAnyOf.h", + "src/EarlGrey/Matcher/GREYBaseMatcher.h", + "src/EarlGrey/Matcher/GREYDescription.h", + "src/EarlGrey/Matcher/GREYElementMatcherBlock.h", + "src/EarlGrey/Matcher/GREYLayoutConstraint.h", + "src/EarlGrey/Matcher/GREYMatcher.h", + "src/EarlGrey/Matcher/GREYMatchers.h", + "src/EarlGrey/Matcher/GREYNot.h", + "src/EarlGrey/Provider/GREYDataEnumerator.h", + "src/EarlGrey/Provider/GREYProvider.h", + "src/EarlGrey/Synchronization/GREYNSTimerIdlingResource.h", + "src/EarlGrey/Synchronization/GREYOperationQueueIdlingResource.h", + "src/EarlGrey/Synchronization/GREYDispatchQueueIdlingResource.h", + "src/EarlGrey/Synchronization/GREYSyncAPI.h", + "src/EarlGrey/Synchronization/GREYCondition.h", + "src/EarlGrey/Synchronization/GREYUIThreadExecutor.h", + ] + deps = [ + "//ios/third_party/fishhook", + "//third_party/google_toolbox_for_mac", + ] + public_deps = [ + "//ios/third_party/ochamcrest:ochamcrest+link", + ] + precompiled_header = "src/EarlGrey.pch" + precompiled_source = "src/EarlGrey.pch" + + libs = [ + "CoreGraphics.framework", + "Foundation.framework", + "IOKit.framework", + "QuartzCore.framework", + "UIKit.framework", + "XCTest.framework", + ] + + public_configs = [ ":config" ] + configs += [ "//build/config/compiler:enable_arc" ] + configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] + configs += [ "//build/config/gcc:symbol_visibility_default" ] +} diff --git a/chromium/ios/third_party/fishhook/BUILD.gn b/chromium/ios/third_party/fishhook/BUILD.gn new file mode 100644 index 00000000000..00cdfaad61e --- /dev/null +++ b/chromium/ios/third_party/fishhook/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("fishhook_config") { + include_dirs = [ "src" ] + visibility = [ ":fishhook" ] +} + +source_set("fishhook") { + testonly = true + sources = [ + "src/fishhook.c", + "src/fishhook.h", + ] + + public_configs = [ ":fishhook_config" ] + configs += [ ":fishhook_config" ] +} diff --git a/chromium/ios/third_party/gcdwebserver/BUILD.gn b/chromium/ios/third_party/gcdwebserver/BUILD.gn new file mode 100644 index 00000000000..5207f75b5d0 --- /dev/null +++ b/chromium/ios/third_party/gcdwebserver/BUILD.gn @@ -0,0 +1,68 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("config") { + visibility = [ ":gcdwebserver" ] + libs = [ + "CFNetwork.framework", + "MobileCoreServices.framework", + "z", + ] + + include_dirs = [ + "src/GCDWebServer/Core", + "src/GCDWebServer/Requests", + "src/GCDWebServer/Responses", + ] +} + +config("private_config") { + visibility = [ ":gcdwebserver" ] + + # TODO(crbug.com/569158): Suppresses warnings that are treated as errors + # when minimum iOS version support is increased to iOS 9 and up. + # This should be removed once all deprecation violations have been fixed. + cflags = [ "-Wno-deprecated-declarations" ] +} + +source_set("gcdwebserver") { + testonly = true + + sources = [ + "src/GCDWebServer/Core/GCDWebServer.h", + "src/GCDWebServer/Core/GCDWebServer.m", + "src/GCDWebServer/Core/GCDWebServerConnection.h", + "src/GCDWebServer/Core/GCDWebServerConnection.m", + "src/GCDWebServer/Core/GCDWebServerFunctions.h", + "src/GCDWebServer/Core/GCDWebServerFunctions.m", + "src/GCDWebServer/Core/GCDWebServerHTTPStatusCodes.h", + "src/GCDWebServer/Core/GCDWebServerPrivate.h", + "src/GCDWebServer/Core/GCDWebServerRequest.h", + "src/GCDWebServer/Core/GCDWebServerRequest.m", + "src/GCDWebServer/Core/GCDWebServerResponse.h", + "src/GCDWebServer/Core/GCDWebServerResponse.m", + "src/GCDWebServer/Requests/GCDWebServerDataRequest.h", + "src/GCDWebServer/Requests/GCDWebServerDataRequest.m", + "src/GCDWebServer/Requests/GCDWebServerFileRequest.h", + "src/GCDWebServer/Requests/GCDWebServerFileRequest.m", + "src/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h", + "src/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.m", + "src/GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.h", + "src/GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.m", + "src/GCDWebServer/Responses/GCDWebServerDataResponse.h", + "src/GCDWebServer/Responses/GCDWebServerDataResponse.m", + "src/GCDWebServer/Responses/GCDWebServerErrorResponse.h", + "src/GCDWebServer/Responses/GCDWebServerErrorResponse.m", + "src/GCDWebServer/Responses/GCDWebServerFileResponse.h", + "src/GCDWebServer/Responses/GCDWebServerFileResponse.m", + "src/GCDWebServer/Responses/GCDWebServerStreamedResponse.h", + "src/GCDWebServer/Responses/GCDWebServerStreamedResponse.m", + ] + + public_configs = [ ":config" ] + configs += [ + ":private_config", + "//build/config/compiler:enable_arc", + ] +} diff --git a/chromium/ios/third_party/ochamcrest/BUILD.gn b/chromium/ios/third_party/ochamcrest/BUILD.gn new file mode 100644 index 00000000000..4994658711a --- /dev/null +++ b/chromium/ios/third_party/ochamcrest/BUILD.gn @@ -0,0 +1,234 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/rules.gni") + +ios_framework_bundle("ochamcrest") { + output_name = "OCHamcrest" + + testonly = true + sources = [ + "src/Source/Core/HCAssertThat.h", + "src/Source/Core/HCAssertThat.m", + "src/Source/Core/HCBaseDescription.h", + "src/Source/Core/HCBaseDescription.m", + "src/Source/Core/HCBaseMatcher.h", + "src/Source/Core/HCBaseMatcher.m", + "src/Source/Core/HCDescription.h", + "src/Source/Core/HCDiagnosingMatcher.h", + "src/Source/Core/HCDiagnosingMatcher.m", + "src/Source/Core/HCMatcher.h", + "src/Source/Core/HCSelfDescribing.h", + "src/Source/Core/HCStringDescription.h", + "src/Source/Core/HCStringDescription.m", + "src/Source/Core/Helpers/HCCollect.h", + "src/Source/Core/Helpers/HCCollect.m", + "src/Source/Core/Helpers/HCInvocationMatcher.h", + "src/Source/Core/Helpers/HCInvocationMatcher.m", + "src/Source/Core/Helpers/HCRequireNonNilObject.h", + "src/Source/Core/Helpers/HCRequireNonNilObject.m", + "src/Source/Core/Helpers/HCWrapInMatcher.h", + "src/Source/Core/Helpers/HCWrapInMatcher.m", + "src/Source/Core/Helpers/NSInvocation+OCHamcrest.h", + "src/Source/Core/Helpers/NSInvocation+OCHamcrest.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCBoolReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCBoolReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCCharReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCCharReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCDoubleReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCDoubleReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCFloatReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCFloatReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCIntReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCIntReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCLongLongReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCLongLongReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCLongReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCLongReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCObjectReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCObjectReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCReturnTypeHandlerChain.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCReturnTypeHandlerChain.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCReturnValueGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCReturnValueGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCShortReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCShortReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedCharReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedCharReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedIntReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedIntReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedLongLongReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedLongLongReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedLongReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedLongReturnGetter.m", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedShortReturnGetter.h", + "src/Source/Core/Helpers/ReturnValueGetters/HCUnsignedShortReturnGetter.m", + "src/Source/Core/Helpers/TestFailureReporters/HCGenericTestFailureReporter.h", + "src/Source/Core/Helpers/TestFailureReporters/HCGenericTestFailureReporter.m", + "src/Source/Core/Helpers/TestFailureReporters/HCSenTestFailureReporter.h", + "src/Source/Core/Helpers/TestFailureReporters/HCSenTestFailureReporter.m", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailure.h", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailure.m", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporter.h", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporter.m", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporterChain.h", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporterChain.m", + "src/Source/Core/Helpers/TestFailureReporters/HCXCTestFailureReporter.h", + "src/Source/Core/Helpers/TestFailureReporters/HCXCTestFailureReporter.m", + "src/Source/Library/Collection/HCEvery.h", + "src/Source/Library/Collection/HCEvery.m", + "src/Source/Library/Collection/HCHasCount.h", + "src/Source/Library/Collection/HCHasCount.m", + "src/Source/Library/Collection/HCIsCollectionContaining.h", + "src/Source/Library/Collection/HCIsCollectionContaining.m", + "src/Source/Library/Collection/HCIsCollectionContainingInAnyOrder.h", + "src/Source/Library/Collection/HCIsCollectionContainingInAnyOrder.m", + "src/Source/Library/Collection/HCIsCollectionContainingInOrder.h", + "src/Source/Library/Collection/HCIsCollectionContainingInOrder.m", + "src/Source/Library/Collection/HCIsCollectionContainingInRelativeOrder.h", + "src/Source/Library/Collection/HCIsCollectionContainingInRelativeOrder.m", + "src/Source/Library/Collection/HCIsCollectionOnlyContaining.h", + "src/Source/Library/Collection/HCIsCollectionOnlyContaining.m", + "src/Source/Library/Collection/HCIsDictionaryContaining.h", + "src/Source/Library/Collection/HCIsDictionaryContaining.m", + "src/Source/Library/Collection/HCIsDictionaryContainingEntries.h", + "src/Source/Library/Collection/HCIsDictionaryContainingEntries.m", + "src/Source/Library/Collection/HCIsDictionaryContainingKey.h", + "src/Source/Library/Collection/HCIsDictionaryContainingKey.m", + "src/Source/Library/Collection/HCIsDictionaryContainingValue.h", + "src/Source/Library/Collection/HCIsDictionaryContainingValue.m", + "src/Source/Library/Collection/HCIsEmptyCollection.h", + "src/Source/Library/Collection/HCIsEmptyCollection.m", + "src/Source/Library/Collection/HCIsIn.h", + "src/Source/Library/Collection/HCIsIn.m", + "src/Source/Library/Decorator/HCDescribedAs.h", + "src/Source/Library/Decorator/HCDescribedAs.m", + "src/Source/Library/Decorator/HCIs.h", + "src/Source/Library/Decorator/HCIs.m", + "src/Source/Library/Logical/HCAllOf.h", + "src/Source/Library/Logical/HCAllOf.m", + "src/Source/Library/Logical/HCAnyOf.h", + "src/Source/Library/Logical/HCAnyOf.m", + "src/Source/Library/Logical/HCIsAnything.h", + "src/Source/Library/Logical/HCIsAnything.m", + "src/Source/Library/Logical/HCIsNot.h", + "src/Source/Library/Logical/HCIsNot.m", + "src/Source/Library/Number/HCIsCloseTo.h", + "src/Source/Library/Number/HCIsCloseTo.m", + "src/Source/Library/Number/HCIsEqualToNumber.h", + "src/Source/Library/Number/HCIsEqualToNumber.m", + "src/Source/Library/Number/HCIsTrueFalse.h", + "src/Source/Library/Number/HCIsTrueFalse.m", + "src/Source/Library/Number/HCNumberAssert.h", + "src/Source/Library/Number/HCNumberAssert.m", + "src/Source/Library/Number/HCOrderingComparison.h", + "src/Source/Library/Number/HCOrderingComparison.m", + "src/Source/Library/Object/HCArgumentCaptor.h", + "src/Source/Library/Object/HCArgumentCaptor.m", + "src/Source/Library/Object/HCClassMatcher.h", + "src/Source/Library/Object/HCClassMatcher.m", + "src/Source/Library/Object/HCConformsToProtocol.h", + "src/Source/Library/Object/HCConformsToProtocol.m", + "src/Source/Library/Object/HCHasDescription.h", + "src/Source/Library/Object/HCHasDescription.m", + "src/Source/Library/Object/HCHasProperty.h", + "src/Source/Library/Object/HCHasProperty.m", + "src/Source/Library/Object/HCIsEqual.h", + "src/Source/Library/Object/HCIsEqual.m", + "src/Source/Library/Object/HCIsInstanceOf.h", + "src/Source/Library/Object/HCIsInstanceOf.m", + "src/Source/Library/Object/HCIsNil.h", + "src/Source/Library/Object/HCIsNil.m", + "src/Source/Library/Object/HCIsSame.h", + "src/Source/Library/Object/HCIsSame.m", + "src/Source/Library/Object/HCIsTypeOf.h", + "src/Source/Library/Object/HCIsTypeOf.m", + "src/Source/Library/Object/HCThrowsException.h", + "src/Source/Library/Object/HCThrowsException.m", + "src/Source/Library/Text/HCIsEqualIgnoringCase.h", + "src/Source/Library/Text/HCIsEqualIgnoringCase.m", + "src/Source/Library/Text/HCIsEqualIgnoringWhiteSpace.h", + "src/Source/Library/Text/HCIsEqualIgnoringWhiteSpace.m", + "src/Source/Library/Text/HCStringContains.h", + "src/Source/Library/Text/HCStringContains.m", + "src/Source/Library/Text/HCStringContainsInOrder.h", + "src/Source/Library/Text/HCStringContainsInOrder.m", + "src/Source/Library/Text/HCStringEndsWith.h", + "src/Source/Library/Text/HCStringEndsWith.m", + "src/Source/Library/Text/HCStringStartsWith.h", + "src/Source/Library/Text/HCStringStartsWith.m", + "src/Source/Library/Text/HCSubstringMatcher.h", + "src/Source/Library/Text/HCSubstringMatcher.m", + "src/Source/OCHamcrest.h", + ] + public_headers = [ + "src/Source/Core/HCAssertThat.h", + "src/Source/Core/HCBaseDescription.h", + "src/Source/Core/HCBaseMatcher.h", + "src/Source/Core/HCDescription.h", + "src/Source/Core/HCDiagnosingMatcher.h", + "src/Source/Core/HCMatcher.h", + "src/Source/Core/HCSelfDescribing.h", + "src/Source/Core/HCStringDescription.h", + "src/Source/Core/Helpers/HCCollect.h", + "src/Source/Core/Helpers/HCInvocationMatcher.h", + "src/Source/Core/Helpers/HCRequireNonNilObject.h", + "src/Source/Core/Helpers/HCWrapInMatcher.h", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailure.h", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporter.h", + "src/Source/Core/Helpers/TestFailureReporters/HCTestFailureReporterChain.h", + "src/Source/Library/Collection/HCEvery.h", + "src/Source/Library/Collection/HCHasCount.h", + "src/Source/Library/Collection/HCIsCollectionContaining.h", + "src/Source/Library/Collection/HCIsCollectionContainingInAnyOrder.h", + "src/Source/Library/Collection/HCIsCollectionContainingInOrder.h", + "src/Source/Library/Collection/HCIsCollectionContainingInRelativeOrder.h", + "src/Source/Library/Collection/HCIsCollectionOnlyContaining.h", + "src/Source/Library/Collection/HCIsDictionaryContaining.h", + "src/Source/Library/Collection/HCIsDictionaryContainingEntries.h", + "src/Source/Library/Collection/HCIsDictionaryContainingKey.h", + "src/Source/Library/Collection/HCIsDictionaryContainingValue.h", + "src/Source/Library/Collection/HCIsEmptyCollection.h", + "src/Source/Library/Collection/HCIsIn.h", + "src/Source/Library/Decorator/HCDescribedAs.h", + "src/Source/Library/Decorator/HCIs.h", + "src/Source/Library/Logical/HCAllOf.h", + "src/Source/Library/Logical/HCAnyOf.h", + "src/Source/Library/Logical/HCIsAnything.h", + "src/Source/Library/Logical/HCIsNot.h", + "src/Source/Library/Number/HCIsCloseTo.h", + "src/Source/Library/Number/HCIsEqualToNumber.h", + "src/Source/Library/Number/HCIsTrueFalse.h", + "src/Source/Library/Number/HCNumberAssert.h", + "src/Source/Library/Number/HCOrderingComparison.h", + "src/Source/Library/Object/HCArgumentCaptor.h", + "src/Source/Library/Object/HCClassMatcher.h", + "src/Source/Library/Object/HCConformsToProtocol.h", + "src/Source/Library/Object/HCHasDescription.h", + "src/Source/Library/Object/HCHasProperty.h", + "src/Source/Library/Object/HCIsEqual.h", + "src/Source/Library/Object/HCIsInstanceOf.h", + "src/Source/Library/Object/HCIsNil.h", + "src/Source/Library/Object/HCIsSame.h", + "src/Source/Library/Object/HCIsTypeOf.h", + "src/Source/Library/Object/HCThrowsException.h", + "src/Source/Library/Text/HCIsEqualIgnoringCase.h", + "src/Source/Library/Text/HCIsEqualIgnoringWhiteSpace.h", + "src/Source/Library/Text/HCStringContains.h", + "src/Source/Library/Text/HCStringContainsInOrder.h", + "src/Source/Library/Text/HCStringEndsWith.h", + "src/Source/Library/Text/HCStringStartsWith.h", + "src/Source/Library/Text/HCSubstringMatcher.h", + "src/Source/OCHamcrest.h", + ] + + libs = [ + "Foundation.framework", + "UIKit.framework", + ] + + configs += [ "//build/config/compiler:enable_arc" ] + configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] + configs += [ "//build/config/gcc:symbol_visibility_default" ] +} diff --git a/chromium/ios/web/BUILD.gn b/chromium/ios/web/BUILD.gn new file mode 100644 index 00000000000..045e41f0426 --- /dev/null +++ b/chromium/ios/web/BUILD.gn @@ -0,0 +1,568 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") +import("//ios/web/js_compile.gni") +import("//testing/test.gni") +import("//tools/grit/grit_rule.gni") + +source_set("web") { + deps = [ + ":core", + ":js_resources", + ":resources", + ":user_agent", + "//base", + "//components/url_formatter", + "//ios/net", + "//ios/third_party/blink:html_tokenizer", + "//mojo/public/cpp/system", + "//mojo/public/js", + "//net", + "//services/shell/public/cpp", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry:geometry", + "//ui/resources", + "//url", + ] + + sources = [ + "active_state_manager_impl.h", + "active_state_manager_impl.mm", + "alloc_with_zone_interceptor.h", + "alloc_with_zone_interceptor.mm", + "browser_state.mm", + "browser_url_rewriter_impl.h", + "browser_url_rewriter_impl.mm", + "interstitials/html_web_interstitial_impl.h", + "interstitials/html_web_interstitial_impl.mm", + "interstitials/native_web_interstitial_impl.h", + "interstitials/native_web_interstitial_impl.mm", + "interstitials/web_interstitial_facade_delegate.h", + "interstitials/web_interstitial_impl.h", + "interstitials/web_interstitial_impl.mm", + "load_committed_details.cc", + "navigation/crw_session_certificate_policy_manager.h", + "navigation/crw_session_certificate_policy_manager.mm", + "navigation/crw_session_controller+private_constructors.h", + "navigation/crw_session_controller.h", + "navigation/crw_session_controller.mm", + "navigation/crw_session_entry.h", + "navigation/crw_session_entry.mm", + "navigation/navigation_item_facade_delegate.h", + "navigation/navigation_item_impl.h", + "navigation/navigation_item_impl.mm", + "navigation/navigation_manager_delegate.h", + "navigation/navigation_manager_facade_delegate.h", + "navigation/navigation_manager_impl.h", + "navigation/navigation_manager_impl.mm", + "navigation/nscoder_util.h", + "navigation/nscoder_util.mm", + "navigation/time_smoother.cc", + "navigation/time_smoother.h", + "net/cert_host_pair.cc", + "net/cert_host_pair.h", + "net/cert_policy.cc", + "net/cert_store_impl.cc", + "net/cert_store_impl.h", + "net/cert_verifier_block_adapter.cc", + "net/cert_verifier_block_adapter.h", + "net/certificate_policy_cache.cc", + "net/clients/crw_js_injection_network_client.h", + "net/clients/crw_js_injection_network_client.mm", + "net/clients/crw_js_injection_network_client_factory.h", + "net/clients/crw_js_injection_network_client_factory.mm", + "net/clients/crw_redirect_network_client.h", + "net/clients/crw_redirect_network_client.mm", + "net/clients/crw_redirect_network_client_factory.h", + "net/clients/crw_redirect_network_client_factory.mm", + "net/cookie_notification_bridge.h", + "net/cookie_notification_bridge.mm", + "net/crw_cert_verification_controller.h", + "net/crw_cert_verification_controller.mm", + "net/crw_request_tracker_delegate.h", + "net/crw_ssl_status_updater.h", + "net/crw_ssl_status_updater.mm", + "net/request_group_util.h", + "net/request_group_util.mm", + "net/request_tracker_data_memoizing_store.h", + "net/request_tracker_factory_impl.h", + "net/request_tracker_factory_impl.mm", + "net/request_tracker_impl.h", + "net/request_tracker_impl.mm", + "net/web_http_protocol_handler_delegate.h", + "net/web_http_protocol_handler_delegate.mm", + "public/active_state_manager.h", + "public/block_types.h", + "public/browser_state.h", + "public/browser_url_rewriter.h", + "public/cert_policy.h", + "public/cert_store.h", + "public/certificate_policy_cache.h", + "public/favicon_status.cc", + "public/favicon_status.h", + "public/favicon_url.cc", + "public/favicon_url.h", + "public/interstitials/web_interstitial.h", + "public/interstitials/web_interstitial_delegate.h", + "public/java_script_dialog_callback.h", + "public/java_script_dialog_presenter.h", + "public/java_script_dialog_type.h", + "public/load_committed_details.h", + "public/navigation_item.h", + "public/navigation_manager.h", + "public/origin_util.h", + "public/origin_util.mm", + "public/referrer.h", + "public/referrer_util.cc", + "public/referrer_util.h", + "public/security_style.h", + "public/ssl_status.cc", + "public/ssl_status.h", + "public/string_util.h", + "public/url_data_source_ios.h", + "public/url_scheme_util.h", + "public/url_schemes.h", + "public/url_schemes.mm", + "public/url_util.h", + "public/web_capabilities.cc", + "public/web_capabilities.h", + "public/web_client.h", + "public/web_client.mm", + "public/web_kit_constants.h", + "public/web_state/context_menu_params.h", + "public/web_state/credential.h", + "public/web_state/crw_web_controller_observer.h", + "public/web_state/crw_web_user_interface_delegate.h", + "public/web_state/crw_web_view_proxy.h", + "public/web_state/crw_web_view_scroll_view_proxy.h", + "public/web_state/global_web_state_observer.h", + "public/web_state/js/credential_util.h", + "public/web_state/js/crw_js_injection_evaluator.h", + "public/web_state/js/crw_js_injection_manager.h", + "public/web_state/js/crw_js_injection_receiver.h", + "public/web_state/page_display_state.h", + "public/web_state/page_display_state.mm", + "public/web_state/ui/crw_content_view.h", + "public/web_state/ui/crw_generic_content_view.h", + "public/web_state/ui/crw_native_content.h", + "public/web_state/ui/crw_native_content_provider.h", + "public/web_state/ui/crw_web_delegate.h", + "public/web_state/ui/crw_web_view_content_view.h", + "public/web_state/url_verification_constants.h", + "public/web_state/web_state.h", + "public/web_state/web_state_delegate.h", + "public/web_state/web_state_delegate_bridge.h", + "public/web_state/web_state_observer.h", + "public/web_state/web_state_observer_bridge.h", + "public/web_state/web_state_policy_decider.h", + "public/web_state/web_state_user_data.h", + "public/web_thread.h", + "public/web_thread_delegate.h", + "public/web_ui_ios_data_source.h", + "public/web_view_creation_util.h", + "string_util.cc", + "url_scheme_util.mm", + "url_util.cc", + "web_kit_constants.cc", + "web_state/blocked_popup_info.h", + "web_state/blocked_popup_info.mm", + "web_state/context_menu_params.mm", + "web_state/credential.cc", + "web_state/crw_pass_kit_downloader.h", + "web_state/crw_pass_kit_downloader.mm", + "web_state/crw_web_view_proxy_impl.h", + "web_state/crw_web_view_proxy_impl.mm", + "web_state/crw_web_view_scroll_view_proxy.mm", + "web_state/error_translation_util.h", + "web_state/error_translation_util.mm", + "web_state/global_web_state_event_tracker.h", + "web_state/global_web_state_event_tracker.mm", + "web_state/global_web_state_observer.cc", + "web_state/js/credential_util.mm", + "web_state/js/crw_js_injection_manager.mm", + "web_state/js/crw_js_injection_receiver.mm", + "web_state/js/crw_js_invoke_parameter_queue.h", + "web_state/js/crw_js_invoke_parameter_queue.mm", + "web_state/js/crw_js_plugin_placeholder_manager.h", + "web_state/js/crw_js_plugin_placeholder_manager.mm", + "web_state/js/crw_js_post_request_loader.h", + "web_state/js/crw_js_post_request_loader.mm", + "web_state/js/crw_js_window_id_manager.h", + "web_state/js/crw_js_window_id_manager.mm", + "web_state/js/page_script_util.h", + "web_state/js/page_script_util.mm", + "web_state/page_viewport_state.h", + "web_state/page_viewport_state.mm", + "web_state/ui/crw_generic_content_view.mm", + "web_state/ui/crw_swipe_recognizer_provider.h", + "web_state/ui/crw_touch_tracking_recognizer.h", + "web_state/ui/crw_touch_tracking_recognizer.mm", + "web_state/ui/crw_web_controller.h", + "web_state/ui/crw_web_controller.mm", + "web_state/ui/crw_web_controller_container_view.h", + "web_state/ui/crw_web_controller_container_view.mm", + "web_state/ui/crw_web_view_content_view.mm", + "web_state/ui/crw_wk_script_message_router.h", + "web_state/ui/crw_wk_script_message_router.mm", + "web_state/ui/web_view_js_utils.h", + "web_state/ui/web_view_js_utils.mm", + "web_state/ui/wk_back_forward_list_item_holder.h", + "web_state/ui/wk_back_forward_list_item_holder.mm", + "web_state/ui/wk_web_view_configuration_provider.h", + "web_state/ui/wk_web_view_configuration_provider.mm", + "web_state/web_controller_observer_bridge.h", + "web_state/web_controller_observer_bridge.mm", + "web_state/web_state.mm", + "web_state/web_state_delegate.mm", + "web_state/web_state_delegate_bridge.mm", + "web_state/web_state_facade_delegate.h", + "web_state/web_state_impl.h", + "web_state/web_state_impl.mm", + "web_state/web_state_observer.mm", + "web_state/web_state_observer_bridge.mm", + "web_state/web_state_policy_decider.mm", + "web_state/web_state_weak_ptr_factory.h", + "web_state/web_state_weak_ptr_factory.mm", + "web_state/web_view_internal_creation_util.h", + "web_state/web_view_internal_creation_util.mm", + "web_state/wk_web_view_security_util.h", + "web_state/wk_web_view_security_util.mm", + "web_thread_impl.cc", + "web_thread_impl.h", + "web_view_creation_util.mm", + "webui/crw_web_ui_manager.h", + "webui/crw_web_ui_manager.mm", + "webui/crw_web_ui_page_builder.h", + "webui/crw_web_ui_page_builder.mm", + "webui/mojo_facade.h", + "webui/mojo_facade.mm", + "webui/mojo_js_constants.cc", + "webui/mojo_js_constants.h", + "webui/shared_resources_data_source_ios.h", + "webui/shared_resources_data_source_ios.mm", + "webui/url_data_manager_ios.cc", + "webui/url_data_manager_ios.h", + "webui/url_data_manager_ios_backend.h", + "webui/url_data_manager_ios_backend.mm", + "webui/url_data_source_ios.mm", + "webui/url_data_source_ios_impl.cc", + "webui/url_data_source_ios_impl.h", + "webui/url_fetcher_block_adapter.h", + "webui/url_fetcher_block_adapter.mm", + "webui/web_ui_ios_controller_factory_registry.cc", + "webui/web_ui_ios_controller_factory_registry.h", + "webui/web_ui_ios_data_source_impl.h", + "webui/web_ui_ios_data_source_impl.mm", + "webui/web_ui_ios_impl.h", + "webui/web_ui_ios_impl.mm", + ] + + libs = [ "WebKit.framework" ] +} + +source_set("core") { + deps = [ + "//base", + "//url", + ] + + sources = [ + "crw_network_activity_indicator_manager.h", + "crw_network_activity_indicator_manager.mm", + "history_state_util.h", + "history_state_util.mm", + ] +} + +source_set("user_agent") { + deps = [ + "//base", + ] + + sources = [ + "public/user_agent.h", + "public/user_agent.mm", + ] +} + +source_set("earl_grey_test_support") { + testonly = true + + deps = [ + ":test_support", + ":web", + "//base", + "//base/test:test_support", + "//ios/third_party/earl_grey", + ] + + sources = [ + "public/test/earl_grey/web_view_matchers.h", + "public/test/earl_grey/web_view_matchers.mm", + "public/test/web_view_interaction_test_util.h", + "public/test/web_view_interaction_test_util.mm", + ] +} + +source_set("test_support") { + testonly = true + + deps = [ + ":web", + "//base/test:test_support", + "//ios/testing:ocmock_support", + "//ios/third_party/gcdwebserver", + "//ios/web/test:mojo_bindings", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/ocmock", + "//ui/base:base", + ] + + sources = [ + "public/test/crw_test_js_injection_receiver.h", + "public/test/crw_test_js_injection_receiver.mm", + "public/test/http_server.h", + "public/test/http_server.mm", + "public/test/http_server_util.h", + "public/test/http_server_util.mm", + "public/test/js_test_util.h", + "public/test/js_test_util.mm", + "public/test/navigation_test_util.h", + "public/test/navigation_test_util.mm", + "public/test/response_providers/data_response_provider.h", + "public/test/response_providers/data_response_provider.mm", + "public/test/response_providers/file_based_response_provider.h", + "public/test/response_providers/file_based_response_provider.mm", + "public/test/response_providers/file_based_response_provider_impl.h", + "public/test/response_providers/file_based_response_provider_impl.mm", + "public/test/response_providers/html_response_provider.h", + "public/test/response_providers/html_response_provider.mm", + "public/test/response_providers/html_response_provider_impl.h", + "public/test/response_providers/html_response_provider_impl.mm", + "public/test/response_providers/response_provider.h", + "public/test/response_providers/response_provider.mm", + "public/test/response_providers/string_response_provider.h", + "public/test/response_providers/string_response_provider.mm", + "public/test/scoped_testing_web_client.h", + "public/test/scoped_testing_web_client.mm", + "public/test/test_browser_state.cc", + "public/test/test_browser_state.h", + "public/test/test_redirect_observer.h", + "public/test/test_redirect_observer.mm", + "public/test/test_web_client.h", + "public/test/test_web_client.mm", + "public/test/test_web_state.h", + "public/test/test_web_state.mm", + "public/test/test_web_thread.h", + "public/test/test_web_thread_bundle.h", + "public/test/test_web_view_content_view.h", + "public/test/test_web_view_content_view.mm", + "public/test/web_test.h", + "public/test/web_test.mm", + "public/test/web_test_suite.h", + "public/test/web_test_with_web_state.h", + "public/test/web_test_with_web_state.mm", + "test/crw_fake_web_controller_observer.h", + "test/crw_fake_web_controller_observer.mm", + "test/test_url_constants.cc", + "test/test_url_constants.h", + "test/test_web_thread.cc", + "test/test_web_thread_bundle.cc", + "test/web_int_test.h", + "test/web_int_test.mm", + "test/web_test_suite.mm", + "test/web_test_with_web_controller.h", + "test/web_test_with_web_controller.mm", + "test/wk_web_view_crash_utils.h", + "test/wk_web_view_crash_utils.mm", + ] +} + +source_set("run_all_unittests") { + testonly = true + sources = [ + "test/run_all_unittests.cc", + ] + deps = [ + ":test_support", + "//base", + "//base/test:test_support", + "//mojo/edk/system", + ] +} + +bundle_data("ios_web_unittests_bundle_data") { + testonly = true + sources = [ + "test/data/chrome.html", + "test/data/testbadpass.pkpass", + "test/data/testfavicon.png", + "test/data/testpass.pkpass", + ] + outputs = [ + "{{bundle_resources_dir}}/{{source_root_relative_dir}}/" + + "{{source_file_part}}", + ] +} + +test("ios_web_unittests") { + deps = [ + ":core", + ":ios_web_unittests_bundle_data", + ":run_all_unittests", + ":test_support", + ":web", + "//base", + "//base/test:test_support", + "//ios/net", + "//ios/testing:ocmock_support", + "//ios/web/test:mojo_bindings", + "//net:test_support", + "//services/shell/public/cpp", + "//testing/gmock", + "//testing/gtest", + "//third_party/ocmock", + "//ui/base:test_support", + ] + + sources = [ + "active_state_manager_impl_unittest.mm", + "alloc_with_zone_interceptor_unittest.mm", + "browser_state_unittest.cc", + "crw_network_activity_indicator_manager_unittest.mm", + "history_state_util_unittest.mm", + "navigation/crw_session_controller_unittest.mm", + "navigation/crw_session_entry_unittest.mm", + "navigation/navigation_item_impl_unittest.mm", + "navigation/navigation_manager_impl_unittest.mm", + "navigation/nscoder_util_unittest.mm", + "net/cert_host_pair_unittest.cc", + "net/cert_policy_unittest.cc", + "net/cert_verifier_block_adapter_unittest.cc", + "net/clients/crw_js_injection_network_client_unittest.mm", + "net/crw_cert_verification_controller_unittest.mm", + "net/crw_ssl_status_updater_unittest.mm", + "net/request_group_util_unittest.mm", + "net/request_tracker_impl_unittest.mm", + "net/web_http_protocol_handler_delegate_unittest.mm", + "public/origin_util_unittest.mm", + "public/referrer_util_unittest.cc", + "public/web_state/page_viewport_state_unittest.mm", + "string_util_unittest.cc", + "test/crw_fake_web_controller_observer_unittest.mm", + "url_scheme_util_unittest.mm", + "url_util_unittest.cc", + "web_state/crw_pass_kit_downloader_unittest.mm", + "web_state/crw_web_view_scroll_view_proxy_unittest.mm", + "web_state/error_translation_util_unittest.mm", + "web_state/js/common_js_unittest.mm", + "web_state/js/core_js_unittest.mm", + "web_state/js/credential_util_unittest.mm", + "web_state/js/crw_js_injection_manager_unittest.mm", + "web_state/js/crw_js_invoke_parameter_queue_unittest.mm", + "web_state/js/crw_js_post_request_loader_unittest.mm", + "web_state/js/crw_js_window_id_manager_unittest.mm", + "web_state/js/page_script_util_unittest.mm", + "web_state/ui/crw_web_controller_container_view_unittest.mm", + "web_state/ui/crw_web_controller_observer_unittest.mm", + "web_state/ui/crw_web_controller_unittest.mm", + "web_state/ui/crw_wk_script_message_router_unittest.mm", + "web_state/ui/web_view_js_utils_unittest.mm", + "web_state/ui/wk_back_forward_list_item_holder_unittest.mm", + "web_state/ui/wk_web_view_configuration_provider_unittest.mm", + "web_state/web_state_delegate_bridge_unittest.mm", + "web_state/web_state_delegate_stub.h", + "web_state/web_state_delegate_stub.mm", + "web_state/web_state_impl_unittest.mm", + "web_state/web_view_internal_creation_util_unittest.mm", + "web_state/wk_web_view_security_util_unittest.mm", + "webui/crw_web_ui_manager_unittest.mm", + "webui/crw_web_ui_page_builder_unittest.mm", + "webui/mojo_facade_unittest.mm", + "webui/url_fetcher_block_adapter_unittest.mm", + ] + + assert_no_deps = ios_assert_no_deps +} + +test("ios_web_inttests") { + deps = [ + ":test_support", + ":web", + "//base/test:test_support", + "//ios/public/provider/web", + "//ios/web/test:mojo_bindings", + "//ios/web/test:packed_resources", + "//ios/web/test:resources", + "//mojo/edk/system", + "//net:test_support", + "//services/shell/public/cpp", + "//testing/gtest", + "//ui/base:test_support", + ] + sources = [ + "browser_state_web_view_partition_inttest.mm", + "public/test/http_server_inttest.mm", + "test/run_all_unittests.cc", + "webui/web_ui_mojo_inttest.mm", + ] + + assert_no_deps = ios_assert_no_deps +} + +js_compile_bundle("web_ui_bundle") { + visibility = [ ":js_resources" ] + closure_entry_point = "__crWeb.webUIBundle" + + sources = [ + "../third_party/requirejs/require.js", + "webui/resources/web_ui_base.js", + "webui/resources/web_ui_bind.js", + "webui/resources/web_ui_bundle.js", + "webui/resources/web_ui_favicons.js", + "webui/resources/web_ui_module_load_notifier.js", + "webui/resources/web_ui_send.js", + ] +} + +js_compile_bundle("web_bundle") { + visibility = [ ":js_resources" ] + closure_entry_point = "__crWeb.webBundle" + + sources = [ + "web_state/js/resources/base.js", + "web_state/js/resources/common.js", + "web_state/js/resources/console.js", + "web_state/js/resources/core.js", + "web_state/js/resources/dialog_overrides.js", + "web_state/js/resources/message.js", + "web_state/js/resources/web_bundle.js", + ] +} + +js_compile_checked("js_resources") { + public_deps = [ + ":web_bundle", + ":web_ui_bundle", + ] + + sources = [ + "web_state/js/resources/plugin_placeholder.js", + "web_state/js/resources/post_request.js", + "web_state/js/resources/window_id.js", + ] +} + +grit("resources") { + source = "ios_web_resources.grd" + use_qualified_include = true + outputs = [ + "grit/ios_web_resources.h", + "ios_web_resources.pak", + ] +} diff --git a/chromium/ios/web/app/BUILD.gn b/chromium/ios/web/app/BUILD.gn new file mode 100644 index 00000000000..7599a96ad82 --- /dev/null +++ b/chromium/ios/web/app/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("app") { + visibility = [ "//ios/web/public/app" ] + + sources = [ + "web_main.mm", + "web_main_loop.h", + "web_main_loop.mm", + "web_main_runner.h", + "web_main_runner.mm", + ] + + deps = [ + "//base", + "//base:i18n", + "//crypto", + "//ios/web", + "//net", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry", + ] + + libs = [ + "Foundation.framework", + "UIKit.framework", + ] +} diff --git a/chromium/ios/web/js_compile.gni b/chromium/ios/web/js_compile.gni new file mode 100644 index 00000000000..317d4469868 --- /dev/null +++ b/chromium/ios/web/js_compile.gni @@ -0,0 +1,258 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/util/java_action.gni") + +declare_args() { + # Control whether the JavaScript files shipped with Chrome on iOS are + # compiled with closure_compiler or not. Useful for debugging. + compile_javascript = true +} + +closure_compiler_path = "//third_party/closure_compiler/compiler/compiler.jar" + +# Defines a target that create a JavaScript bundle using the closure compiler. +# +# Variables +# sources: +# List of JavaScript files to compile into the bundle. +# +# closure_entry_point: +# Name of the entry point closure module. +# +# deps (optional) +# List of targets required by this target. +# +# visibility (optional) +# Visibility restrictions. +# +# Generates a single JavaScript bundle file that can be put in the application +# bundle. +# +# TODO(crbug.com/487804): once all errors have been fixed, sync with the flags +# from third_party/closure_compiler/closure_args.gni. +template("js_compile_bundle") { + assert(defined(invoker.sources), + "Need sources in $target_name listing the js files.") + + assert(defined(invoker.closure_entry_point), + "Need closure_entry_point in $target_name for generated js file.") + + _target_name = target_name + compile_js_target_name = target_name + "_compile_js" + + java_action(compile_js_target_name) { + visibility = [ ":$_target_name" ] + script = closure_compiler_path + sources = invoker.sources + outputs = [ + "$target_gen_dir/$_target_name.js", + ] + + args = [ + "--compilation_level", + "SIMPLE_OPTIMIZATIONS", + "--js_output_file", + rebase_path("$target_gen_dir/$_target_name.js", root_build_dir), + "--only_closure_dependencies", + "--closure_entry_point", + invoker.closure_entry_point, + "--js", + ] + rebase_path(sources, root_build_dir) + } + + bundle_data(target_name) { + forward_variables_from(invoker, + [ + "data_deps", + "deps", + "public_deps", + "visibility", + ]) + + if (!defined(public_deps)) { + public_deps = [] + } + public_deps += [ ":$compile_js_target_name" ] + sources = get_target_outputs(":$compile_js_target_name") + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } +} + +# Defines a target that compile JavaScript files with error checking using the +# closure compiler. +# +# Variables +# sources: +# List of JavaScript files to compile. +# +# deps (optional) +# List of targets required by this target. +# +# visibility (optional) +# Visibility restrictions. +# +# TODO(crbug.com/487804): once all errors have been fixed, sync with the flags +# from third_party/closure_compiler/closure_args.gni. +template("js_compile_checked") { + assert(defined(invoker.sources), + "Need sources in $target_name listing the js files.") + + if (compile_javascript) { + _target_name = target_name + compile_js_target_name = target_name + "_compile_js" + + java_action_foreach(compile_js_target_name) { + visibility = [ ":$_target_name" ] + script = closure_compiler_path + sources = invoker.sources + outputs = [ + "$target_gen_dir/{{source_file_part}}", + ] + + # TODO(crbug.com/487804): need to enable the following compilation checks + # once the corresponding errors have been fixed: + # --jscomp_error=checkTypes + # --jscomp_error=checkVars + # --jscomp_error=missingProperties + # --jscomp_error=missingReturn + # --jscomp_error=undefinedVars + + args = [ + "--compilation_level", + "SIMPLE_OPTIMIZATIONS", + "--jscomp_error=accessControls", + "--jscomp_error=ambiguousFunctionDecl", + "--jscomp_error=constantProperty", + "--jscomp_error=deprecated", + "--jscomp_error=externsValidation", + "--jscomp_error=globalThis", + "--jscomp_error=invalidCasts", + "--jscomp_error=nonStandardJsDocs", + "--jscomp_error=suspiciousCode", + "--jscomp_error=undefinedNames", + "--jscomp_error=unknownDefines", + "--jscomp_error=uselessCode", + "--jscomp_error=visibility", + "--js", + "{{source}}", + "--js_output_file", + rebase_path("$target_gen_dir/{{source_file_part}}", root_build_dir), + ] + } + + bundle_data(target_name) { + forward_variables_from(invoker, + [ + "data_deps", + "deps", + "public_deps", + "visibility", + ]) + + if (!defined(public_deps)) { + public_deps = [] + } + public_deps += [ ":$compile_js_target_name" ] + sources = get_target_outputs(":$compile_js_target_name") + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } + } else { + bundle_data(target_name) { + forward_variables_from(invoker, + [ + "data_deps", + "deps", + "public_deps", + "visibility", + ]) + + sources = invoker.sources + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } + } +} + +# Defines a target that compile JavaScript files without error checking using +# the closure compiler. +# +# Variables +# sources: +# List of JavaScript files to compile. +# +# deps (optional) +# List of targets required by this target. +# +# visibility (optional) +# Visibility restrictions. +# +# TODO(crbug.com/487804): once all errors have been fixed, remove this template +# and port all code to use js_compile_checked instead. +template("js_compile_unchecked") { + assert(defined(invoker.sources), + "Need sources in $target_name listing the js files.") + + if (compile_javascript) { + _target_name = target_name + compile_js_target_name = target_name + "_compile_js" + + java_action_foreach(compile_js_target_name) { + visibility = [ ":$_target_name" ] + script = closure_compiler_path + sources = invoker.sources + outputs = [ + "$target_gen_dir/{{source_file_part}}", + ] + + args = [ + "--compilation_level", + "SIMPLE_OPTIMIZATIONS", + "--js", + "{{source}}", + "--js_output_file", + rebase_path("$target_gen_dir/{{source_file_part}}", root_build_dir), + ] + } + + bundle_data(target_name) { + forward_variables_from(invoker, + [ + "data_deps", + "deps", + "public_deps", + "visibility", + ]) + + if (!defined(public_deps)) { + public_deps = [] + } + public_deps += [ ":$compile_js_target_name" ] + sources = get_target_outputs(":$compile_js_target_name") + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } + } else { + bundle_data(target_name) { + forward_variables_from(invoker, + [ + "data_deps", + "deps", + "public_deps", + "visibility", + ]) + + sources = invoker.sources + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } + } +} diff --git a/chromium/ios/web/public/app/BUILD.gn b/chromium/ios/web/public/app/BUILD.gn new file mode 100644 index 00000000000..e55a118d5eb --- /dev/null +++ b/chromium/ios/web/public/app/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("app") { + sources = [ + "web_main.h", + "web_main_delegate.h", + "web_main_parts.h", + ] + + public_deps = [ + "//ios/web/app", + ] + + deps = [ + "//base", + ] + + allow_circular_includes_from = [ "//ios/web/app" ] +} diff --git a/chromium/ios/web/shell/BUILD.gn b/chromium/ios/web/shell/BUILD.gn new file mode 100644 index 00000000000..0d7a0645ef2 --- /dev/null +++ b/chromium/ios/web/shell/BUILD.gn @@ -0,0 +1,88 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ios/rules.gni") +import("//ios/build/config.gni") + +ios_app_bundle("ios_web_shell") { + info_plist = "Info.plist" + + sources = [ + "web_exe_main.mm", + ] + + deps = [ + ":shell", + + # All shared libraries must have the sanitizer deps to properly link in + # asan mode (this target will be empty in other cases). + "//build/config/sanitizers:deps", + ] + + ldflags = [ + "-Xlinker", + "-objc_abi_version", + "-Xlinker", + "2", + ] + + configs += [ "//build/config/compiler:enable_arc" ] + + assert_no_deps = ios_assert_no_deps +} + +bundle_data("shell_bundle_data") { + visibility = [ ":shell" ] + sources = [ + "Default.png", + "textfield_background@2x.png", + "toolbar_back@2x.png", + "toolbar_forward@2x.png", + ] + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] +} + +source_set("shell") { + sources = [ + "app_delegate.h", + "app_delegate.mm", + "shell_browser_state.h", + "shell_browser_state.mm", + "shell_main_delegate.h", + "shell_main_delegate.mm", + "shell_network_delegate.cc", + "shell_network_delegate.h", + "shell_url_request_context_getter.h", + "shell_url_request_context_getter.mm", + "shell_web_client.h", + "shell_web_client.mm", + "shell_web_main_parts.h", + "shell_web_main_parts.mm", + "view_controller.h", + "view_controller.mm", + ] + + deps = [ + ":shell_bundle_data", + "//base", + "//ios/net", + "//ios/web", + "//ios/web:user_agent", + "//ios/web/public/app", + "//net", + "//net:extras", + "//ui/base", + ] + + libs = [ + "CoreGraphics.framework", + "CoreFoundation.framework", + "Foundation.framework", + "UIKit.framework", + ] + + configs += [ "//build/config/compiler:enable_arc" ] +} diff --git a/chromium/ios/web/test/BUILD.gn b/chromium/ios/web/test/BUILD.gn new file mode 100644 index 00000000000..2e1ed6b953f --- /dev/null +++ b/chromium/ios/web/test/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") +import("//tools/grit/grit_rule.gni") +import("//tools/grit/repack.gni") + +mojom("mojo_bindings") { + sources = [ + "mojo_test.mojom", + ] +} + +repack_and_bundle("packed_resources") { + testonly = true + sources = [ + "$root_gen_dir/ios/web/ios_web_resources.pak", + "$root_gen_dir/ios/web/test/test_resources.pak", + ] + deps = [ + ":resources", + "//ios/web:resources", + ] + output = "$target_gen_dir/resources.pak" + bundle_output = "{{bundle_resources_dir}}/{{source_file_part}}" +} + +grit("resources") { + source = "test_resources.grd" + use_qualified_include = true + inputs = [ + "${root_gen_dir}/ios/web/test/mojo_test.mojom.js", + ] + deps = [ + ":mojo_bindings", + ] + outputs = [ + "grit/test_resources.h", + "test_resources.pak", + ] + grit_flags = [ + "-E", + "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir), + ] +} diff --git a/chromium/ios/web/test/mojo_test.mojom b/chromium/ios/web/test/mojo_test.mojom new file mode 100644 index 00000000000..69105fe258e --- /dev/null +++ b/chromium/ios/web/test/mojo_test.mojom @@ -0,0 +1,16 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +struct NativeMessageResultMojo { + string message; +}; + +interface TestUIHandlerMojo { + SetClientPage(TestPage page); + HandleJsMessage(string message); +}; + +interface TestPage { + HandleNativeMessage(NativeMessageResultMojo result); +}; diff --git a/chromium/media/cast/test/proto/BUILD.gn b/chromium/media/cast/test/proto/BUILD.gn new file mode 100644 index 00000000000..54ce2d9da74 --- /dev/null +++ b/chromium/media/cast/test/proto/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +# GYP version: media/cast/cast.gyp:cast_logging_proto +source_set("proto") { + public_deps = [ + ":cast_network_simulation_proto", + ] + public_configs = [ "//third_party/protobuf:protobuf_config" ] +} + +proto_library("cast_network_simulation_proto") { + visibility = [ ":proto" ] + sources = [ + "network_simulation_model.proto", + ] +} diff --git a/chromium/media/test/BUILD.gn b/chromium/media/test/BUILD.gn new file mode 100644 index 00000000000..1bedb1fbcb4 --- /dev/null +++ b/chromium/media/test/BUILD.gn @@ -0,0 +1,133 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//media/media_options.gni") +import("//testing/libfuzzer/fuzzer_test.gni") + +source_set("pipeline_integration_test_base") { + testonly = true + + if (media_use_ffmpeg) { + sources = [ + "pipeline_integration_test_base.cc", + "pipeline_integration_test_base.h", + ] + + public_deps = [ + "//media", + ] + + deps = [ + "//base", + "//media:test_support", + "//media/audio:test_support", + "//media/base:test_support", + "//testing/gmock", + "//testing/gtest", + ] + } +} + +source_set("pipeline_integration_tests") { + testonly = true + + # Even if FFmpeg is enabled on Android we don't want these. + # TODO(watk): Refactor tests that could be made to run on Android. See + # http://crbug.com/570762 + if (media_use_ffmpeg && !is_android) { + sources = [ + "pipeline_integration_test.cc", + ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":pipeline_integration_test_base", + "//url", + + # TODO(dalecurtis): Required since the gmock header is included in the + # header for pipeline_integration_test_base.h. This should be moved into + # the .cc file to avoid the extra dependency here. + "//testing/gmock", + ] + } +} + +source_set("pipeline_integration_perftests") { + testonly = true + + if (media_use_ffmpeg) { + sources = [ + "pipeline_integration_perftest.cc", + ] + + deps = [ + ":pipeline_integration_test_base", + "//media/base:test_support", + "//testing/gtest", + "//testing/perf", + + # TODO(dalecurtis): Required since the gmock header is included in the + # header for pipeline_integration_test_base.h. This should be moved into + # the .cc file to avoid the extra dependency here. + "//testing/gmock", + ] + } +} + +source_set("mojo_pipeline_integration_tests") { + testonly = true + + if (media_use_ffmpeg && !is_android) { + sources = [ + "pipeline_integration_test.cc", + ] + + defines = [ "MOJO_RENDERER" ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":pipeline_integration_test_base", + "//base", + "//base/test:test_support", + "//media", + "//media:test_support", + "//media/audio:test_support", + "//media/base:test_support", + "//media/mojo/clients", + "//media/mojo/interfaces", + "//media/mojo/services", + "//services/shell/public/cpp:shell_test_support", + "//testing/gtest", + "//ui/gfx:test_support", + "//ui/gfx/geometry", + + # TODO(dalecurtis): Required since the gmock header is included in the + # header for pipeline_integration_test_base.h. This should be moved + # into the .cc file to avoid the extra dependency here. + "//testing/gmock", + ] + } +} + +fuzzer_test("media_pipeline_integration_fuzzer") { + sources = [ + "pipeline_integration_fuzzertest.cc", + ] + deps = [ + "//base", + "//media", + "//media/test:pipeline_integration_test_base", + + # TODO(dalecurtis): Required since the gmock header is included in the + # header for pipeline_integration_test_base.h. This should be + # moved into the .cc file to avoid the extra dependency here. + "//testing/gmock", + "//ui/gfx:test_support", + ] + + # This is done to avoid DEATH of ASan with "Thread limit exceeded" error. + libfuzzer_options = [ "runs=500000" ] +} diff --git a/chromium/mojo/edk/js/test/BUILD.gn b/chromium/mojo/edk/js/test/BUILD.gn new file mode 100644 index 00000000000..c5a78c35056 --- /dev/null +++ b/chromium/mojo/edk/js/test/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +test("js_unittests") { + output_name = "mojo_js_unittests" + + deps = [ + "//base", + "//gin:gin_test", + "//mojo/edk/js", + "//mojo/edk/test:run_all_unittests", + "//mojo/edk/test:test_support", + "//mojo/public/cpp/system", + "//mojo/public/interfaces/bindings/tests:test_interfaces", + "//mojo/public/interfaces/bindings/tests:test_interfaces_experimental", + "//mojo/public/js:tests", + ] + + sources = [ + "//mojo/edk/js/handle_unittest.cc", + "run_js_tests.cc", + ] +} + +test("js_integration_tests") { + output_name = "mojo_js_integration_tests" + + deps = [ + "//base", + "//gin:gin_test", + "//mojo/edk/js", + "//mojo/edk/js/tests:js_to_cpp_tests", + "//mojo/edk/test:run_all_unittests", + "//mojo/edk/test:test_support", + "//mojo/public/cpp/bindings", + "//mojo/public/interfaces/bindings/tests:test_interfaces", + "//mojo/public/js:bindings", + ] + + sources = [ + "run_js_integration_tests.cc", + ] +} diff --git a/chromium/mojo/edk/js/tests/BUILD.gn b/chromium/mojo/edk/js/tests/BUILD.gn new file mode 100644 index 00000000000..b21cdbc40b8 --- /dev/null +++ b/chromium/mojo/edk/js/tests/BUILD.gn @@ -0,0 +1,39 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../../../../mojo/public/tools/bindings/mojom.gni") + +source_set("js_to_cpp_tests") { + testonly = true + + deps = [ + ":js_to_cpp_bindings", + "//gin:gin_test", + "//mojo/common", + "//mojo/edk/js", + "//mojo/edk/test:test_support", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//mojo/public/interfaces/bindings/tests:test_interfaces", + "//mojo/public/interfaces/bindings/tests:test_interfaces_experimental", + ] + + sources = [ + "js_to_cpp_tests.cc", + ] + + data = [ + "connection_tests.js", + "js_to_cpp_tests.js", + "sample_service_tests.js", + ] + + configs += [ "//v8:external_startup_data" ] +} + +mojom("js_to_cpp_bindings") { + sources = [ + "js_to_cpp.mojom", + ] +} diff --git a/chromium/mojo/edk/js/tests/js_to_cpp.mojom b/chromium/mojo/edk/js/tests/js_to_cpp.mojom new file mode 100644 index 00000000000..688b22b3dea --- /dev/null +++ b/chromium/mojo/edk/js/tests/js_to_cpp.mojom @@ -0,0 +1,54 @@ +module js_to_cpp; + +// This struct encompasses all of the basic types, so that they +// may be sent from C++ to JS and back for validation. +struct EchoArgs { + int64 si64; + int32 si32; + int16 si16; + int8 si8; + uint64 ui64; + uint32 ui32; + uint16 ui16; + uint8 ui8; + float float_val; + float float_inf; + float float_nan; + double double_val; + double double_inf; + double double_nan; + string? name; + array<string>? string_array; + handle<message_pipe>? message_handle; + handle<data_pipe_consumer>? data_handle; +}; + +struct EchoArgsList { + EchoArgsList? next; + EchoArgs? item; +}; + +// Note: For messages which control test flow, pick numbers that are unlikely +// to be hit as a result of our deliberate corruption of response messages. +interface CppSide { + // Sent for all tests to notify that the JS side is now ready. + StartTest@88888888(); + + // Indicates end for echo, bit-flip, and back-pointer tests. + TestFinished@99999999(); + + // Responses from specific tests. + PingResponse(); + EchoResponse(EchoArgsList list); + BitFlipResponse(EchoArgsList arg); + BackPointerResponse(EchoArgsList arg); +}; + +interface JsSide { + SetCppSide(CppSide cpp); + + Ping(); + Echo(int32 numIterations, EchoArgs arg); + BitFlip(EchoArgs arg); + BackPointer(EchoArgs arg); +}; diff --git a/chromium/mojo/edk/test/BUILD.gn b/chromium/mojo/edk/test/BUILD.gn new file mode 100644 index 00000000000..cd56fb8e398 --- /dev/null +++ b/chromium/mojo/edk/test/BUILD.gn @@ -0,0 +1,133 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +source_set("test_support") { + testonly = true + sources = [ + "mojo_test_base.cc", + "mojo_test_base.h", + "scoped_ipc_support.cc", + "scoped_ipc_support.h", + "test_utils.h", + "test_utils_posix.cc", + "test_utils_win.cc", + ] + + if (!is_ios) { + sources += [ + "multiprocess_test_helper.cc", + "multiprocess_test_helper.h", + ] + } + + deps = [ + "//base", + "//base/test:test_support", + "//mojo/edk/system", + "//mojo/public/cpp/system", + "//testing/gtest", + ] +} + +source_set("run_all_unittests") { + testonly = true + sources = [ + "run_all_unittests.cc", + ] + + deps = [ + ":test_support", + ":test_support_impl", + "//base", + "//base/test:test_support", + "//mojo/edk/system", + "//mojo/public/c/test_support", + "//testing/gtest", + ] + + if (is_linux && !is_component_build) { + public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } +} + +source_set("run_all_perftests") { + testonly = true + deps = [ + ":test_support_impl", + "//base", + "//base/test:test_support", + "//mojo/edk/system", + "//mojo/edk/test:test_support", + "//mojo/public/c/test_support", + ] + + sources = [ + "run_all_perftests.cc", + ] + + if (is_linux && !is_component_build) { + public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } +} + +source_set("test_support_impl") { + testonly = true + deps = [ + "//base", + "//base/test:test_support", + "//mojo/public/c/test_support", + "//mojo/public/cpp/system", + ] + + sources = [ + "test_support_impl.cc", + "test_support_impl.h", + ] +} + +# Public SDK test targets follow. These targets are not defined within the +# public SDK itself as running the unittests requires the EDK. +# TODO(vtl): These don't really belong here. (They should be converted to +# apptests, but even apart from that these targets belong somewhere else.) + +group("public_tests") { + testonly = true + deps = [ + ":mojo_public_bindings_unittests", + ":mojo_public_system_perftests", + ":mojo_public_system_unittests", + ] +} + +test("mojo_public_bindings_perftests") { + deps = [ + ":run_all_perftests", + "//mojo/edk/test:test_support", + "//mojo/public/cpp/bindings/tests:perftests", + ] +} + +test("mojo_public_bindings_unittests") { + deps = [ + ":run_all_unittests", + "//mojo/edk/test:test_support", + "//mojo/public/cpp/bindings/tests", + ] +} + +test("mojo_public_system_perftests") { + deps = [ + ":run_all_perftests", + "//mojo/public/c/system/tests:perftests", + ] +} + +test("mojo_public_system_unittests") { + deps = [ + ":run_all_unittests", + "//mojo/public/cpp/system/tests", + ] +} diff --git a/chromium/mojo/public/c/system/tests/BUILD.gn b/chromium/mojo/public/c/system/tests/BUILD.gn new file mode 100644 index 00000000000..0dd70529cef --- /dev/null +++ b/chromium/mojo/public/c/system/tests/BUILD.gn @@ -0,0 +1,37 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("tests") { + testonly = true + + visibility = [ + "//mojo/public/cpp/system/tests:mojo_public_system_unittests", + "//mojo/public/cpp/system/tests:tests", + ] + + sources = [ + "core_unittest.cc", + "core_unittest_pure_c.c", + "macros_unittest.cc", + ] + + deps = [ + "//mojo/public/c/system", + "//testing/gtest", + ] +} + +source_set("perftests") { + testonly = true + + sources = [ + "core_perftest.cc", + ] + + deps = [ + "//mojo/public/cpp/system", + "//mojo/public/cpp/test_support:test_utils", + "//testing/gtest", + ] +} diff --git a/chromium/mojo/public/cpp/bindings/tests/BUILD.gn b/chromium/mojo/public/cpp/bindings/tests/BUILD.gn new file mode 100644 index 00000000000..4e38f15032a --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/BUILD.gn @@ -0,0 +1,144 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../../../mojo_application.gni") + +source_set("tests") { + testonly = true + + sources = [ + "array_common_test.h", + "array_unittest.cc", + "associated_interface_unittest.cc", + "bind_task_runner_unittest.cc", + "binding_callback_unittest.cc", + "binding_unittest.cc", + "buffer_unittest.cc", + "connector_unittest.cc", + "constant_unittest.cc", + "container_test_util.cc", + "container_test_util.h", + "equals_unittest.cc", + "handle_passing_unittest.cc", + "interface_ptr_unittest.cc", + "map_common_test.h", + "map_unittest.cc", + "message_queue.cc", + "message_queue.h", + "multiplex_router_unittest.cc", + "request_response_unittest.cc", + "router_test_util.cc", + "router_test_util.h", + "router_unittest.cc", + "sample_service_unittest.cc", + "serialization_warning_unittest.cc", + "stl_converters_unittest.cc", + "string_unittest.cc", + "struct_unittest.cc", + "sync_method_unittest.cc", + "type_conversion_unittest.cc", + "union_unittest.cc", + "validation_context_unittest.cc", + "validation_unittest.cc", + "variant_test_util.h", + ] + + deps = [ + ":mojo_public_bindings_test_utils", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//mojo/public/cpp/test_support:test_utils", + "//mojo/public/interfaces/bindings/tests:test_associated_interfaces", + "//mojo/public/interfaces/bindings/tests:test_interfaces", + "//mojo/public/interfaces/bindings/tests:test_interfaces_experimental", + "//mojo/public/interfaces/bindings/tests:test_struct_traits_interfaces", + "//testing/gtest", + ] + + data = [ + "//mojo/public/interfaces/bindings/tests/data/validation/", + ] + + if (is_ios) { + assert_no_deps = [ "//third_party/WebKit/*" ] + } else { + sources += [ + "pickle_unittest.cc", + "struct_traits_unittest.cc", + ] + + deps += [ "//mojo/public/interfaces/bindings/tests:test_interfaces_blink" ] + } +} + +if (!is_ios) { + source_set("for_blink_tests") { + testonly = true + + sources = [ + "array_common_test.h", + "container_test_util.cc", + "container_test_util.h", + "map_common_test.h", + "variant_test_util.h", + "wtf_array_unittest.cc", + "wtf_map_unittest.cc", + "wtf_types_unittest.cc", + ] + + deps = [ + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//mojo/public/interfaces/bindings/tests:test_interfaces", + "//mojo/public/interfaces/bindings/tests:test_wtf_types", + "//mojo/public/interfaces/bindings/tests:test_wtf_types_blink", + "//testing/gtest", + ] + } +} + +source_set("struct_with_traits_impl") { + sources = [ + "struct_with_traits_impl.cc", + "struct_with_traits_impl.h", + ] + + deps = [ + "//base", + "//mojo/public/cpp/system:system", + ] +} + +source_set("perftests") { + testonly = true + + sources = [ + "bindings_perftest.cc", + ] + + if (!is_ios) { + sources += [ "e2e_perftest.cc" ] + } + + deps = [ + "//base/test:test_support", + "//mojo/edk/test:test_support", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//mojo/public/cpp/test_support:test_utils", + "//mojo/public/interfaces/bindings/tests:test_interfaces", + "//testing/gtest", + ] +} + +source_set("mojo_public_bindings_test_utils") { + sources = [ + "validation_test_input_parser.cc", + "validation_test_input_parser.h", + ] + + deps = [ + "//mojo/public/c/system", + ] +} diff --git a/chromium/mojo/public/cpp/bindings/tests/blink_typemaps.gni b/chromium/mojo/public/cpp/bindings/tests/blink_typemaps.gni new file mode 100644 index 00000000000..b71dcf8d469 --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/blink_typemaps.gni @@ -0,0 +1,8 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +typemaps = [ + "//mojo/public/cpp/bindings/tests/rect_blink.typemap", + "//mojo/public/cpp/bindings/tests/test_native_types_blink.typemap", +] diff --git a/chromium/mojo/public/cpp/bindings/tests/chromium_typemaps.gni b/chromium/mojo/public/cpp/bindings/tests/chromium_typemaps.gni new file mode 100644 index 00000000000..1da7cbfa3ef --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/chromium_typemaps.gni @@ -0,0 +1,9 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +typemaps = [ + "//mojo/public/cpp/bindings/tests/rect_chromium.typemap", + "//mojo/public/cpp/bindings/tests/struct_with_traits.typemap", + "//mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap", +] diff --git a/chromium/mojo/public/cpp/bindings/tests/rect_blink.typemap b/chromium/mojo/public/cpp/bindings/tests/rect_blink.typemap new file mode 100644 index 00000000000..37ee409edf1 --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/rect_blink.typemap @@ -0,0 +1,9 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mojom = "//mojo/public/interfaces/bindings/tests/rect.mojom" +public_headers = [ "//mojo/public/cpp/bindings/tests/rect_blink.h" ] +traits_headers = [ "//mojo/public/cpp/bindings/tests/rect_blink_traits.h" ] + +type_mappings = [ "mojo.test.TypemappedRect=mojo::test::RectBlink" ] diff --git a/chromium/mojo/public/cpp/bindings/tests/rect_chromium.typemap b/chromium/mojo/public/cpp/bindings/tests/rect_chromium.typemap new file mode 100644 index 00000000000..0da40211a49 --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/rect_chromium.typemap @@ -0,0 +1,9 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mojom = "//mojo/public/interfaces/bindings/tests/rect.mojom" +public_headers = [ "//mojo/public/cpp/bindings/tests/rect_chromium.h" ] +traits_headers = [ "//mojo/public/cpp/bindings/tests/rect_chromium_traits.h" ] + +type_mappings = [ "mojo.test.TypemappedRect=mojo::test::RectChromium" ] diff --git a/chromium/mojo/public/cpp/bindings/tests/struct_with_traits.typemap b/chromium/mojo/public/cpp/bindings/tests/struct_with_traits.typemap new file mode 100644 index 00000000000..fb9d01d38a1 --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/struct_with_traits.typemap @@ -0,0 +1,24 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mojom = "//mojo/public/interfaces/bindings/tests/struct_with_traits.mojom" +public_headers = + [ "//mojo/public/cpp/bindings/tests/struct_with_traits_impl.h" ] +traits_headers = + [ "//mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h" ] +sources = [ + "//mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc", +] +deps = [ + "//mojo/public/cpp/bindings/tests:struct_with_traits_impl", + "//mojo/public/cpp/system:system", +] + +type_mappings = [ + "mojo.test.EnumWithTraits=mojo::test::EnumWithTraitsImpl", + "mojo.test.StructWithTraits=mojo::test::StructWithTraitsImpl", + "mojo.test.NestedStructWithTraits=mojo::test::NestedStructWithTraitsImpl", + "mojo.test.PassByValueStructWithTraits=mojo::test::PassByValueStructWithTraitsImpl[pass_by_value]", + "mojo.test.StructWithTraitsForUniquePtrTest=std::unique_ptr<int>[pass_by_value]", +] diff --git a/chromium/mojo/public/cpp/bindings/tests/test_native_types_blink.typemap b/chromium/mojo/public/cpp/bindings/tests/test_native_types_blink.typemap new file mode 100644 index 00000000000..258acd570fd --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/test_native_types_blink.typemap @@ -0,0 +1,17 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mojom = "//mojo/public/interfaces/bindings/tests/test_native_types.mojom" +public_headers = [ "//mojo/public/cpp/bindings/tests/pickled_types_blink.h" ] +sources = [ + "//mojo/public/cpp/bindings/tests/pickled_types_blink.cc", +] +deps = [ + "//ipc", +] + +type_mappings = [ + "mojo.test.PickledEnum=mojo::test::PickledEnumBlink", + "mojo.test.PickledStruct=mojo::test::PickledStructBlink" +] diff --git a/chromium/mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap b/chromium/mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap new file mode 100644 index 00000000000..a4c0f5ac4ac --- /dev/null +++ b/chromium/mojo/public/cpp/bindings/tests/test_native_types_chromium.typemap @@ -0,0 +1,18 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mojom = "//mojo/public/interfaces/bindings/tests/test_native_types.mojom" +public_headers = + [ "//mojo/public/cpp/bindings/tests/pickled_types_chromium.h" ] +sources = [ + "//mojo/public/cpp/bindings/tests/pickled_types_chromium.cc", +] +deps = [ + "//ipc", +] + +type_mappings = [ + "mojo.test.PickledEnum=mojo::test::PickledEnumChromium", + "mojo.test.PickledStruct=mojo::test::PickledStructChromium" +] diff --git a/chromium/mojo/public/cpp/system/tests/BUILD.gn b/chromium/mojo/public/cpp/system/tests/BUILD.gn new file mode 100644 index 00000000000..8f98b921a0e --- /dev/null +++ b/chromium/mojo/public/cpp/system/tests/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("tests") { + testonly = true + + sources = [ + "core_unittest.cc", + "watcher_unittest.cc", + ] + + deps = [ + "//base", + "//mojo/public/c/system/tests", + "//mojo/public/cpp/system", + "//mojo/public/cpp/test_support:test_utils", + "//testing/gtest", + ] +} diff --git a/chromium/mojo/public/interfaces/bindings/tests/BUILD.gn b/chromium/mojo/public/interfaces/bindings/tests/BUILD.gn new file mode 100644 index 00000000000..635b615f70e --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/BUILD.gn @@ -0,0 +1,116 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../../../tools/bindings/mojom.gni") + +mojom("test_interfaces") { + testonly = true + sources = [ + "math_calculator.mojom", + "no_module.mojom", + "ping_service.mojom", + "rect.mojom", + "regression_tests.mojom", + "sample_factory.mojom", + "sample_interfaces.mojom", + "sample_service.mojom", + "scoping.mojom", + "serialization_test_structs.mojom", + "test_constants.mojom", + "test_native_types.mojom", + "test_structs.mojom", + "test_sync_methods.mojom", + "validation_test_interfaces.mojom", + ] + public_deps = [ + ":test_mojom_import", + ":test_mojom_import2", + ] +} + +mojom("test_mojom_import") { + testonly = true + sources = [ + "sample_import.mojom", + ] +} + +mojom("test_mojom_import_wrapper") { + testonly = true + public_deps = [ + ":test_mojom_import", + ] +} + +mojom("test_mojom_import_wrapper_wrapper") { + testonly = true + public_deps = [ + ":test_mojom_import_wrapper", + ] +} + +mojom("test_mojom_import2") { + testonly = true + sources = [ + "sample_import2.mojom", + ] + public_deps = [ + ":test_mojom_import", + ":test_mojom_import_wrapper_wrapper", + ] +} + +mojom("test_struct_traits_interfaces") { + testonly = true + sources = [ + "struct_with_traits.mojom", + ] +} + +mojom("test_interfaces_experimental") { + testonly = true + sources = [ + "test_unions.mojom", + ] +} + +mojom("test_associated_interfaces") { + # These files are not included in the test_interfaces target because + # associated interfaces are not supported by all bindings languages yet. + testonly = true + sources = [ + "test_associated_interfaces.mojom", + "validation_test_associated_interfaces.mojom", + ] +} + +mojom("versioning_test_service_interfaces") { + testonly = true + sources = [ + "versioning_test_service.mojom", + ] +} + +mojom("versioning_test_client_interfaces") { + testonly = true + sources = [ + "versioning_test_client.mojom", + ] +} + +mojom("test_wtf_types") { + testonly = true + + sources = [ + "test_wtf_types.mojom", + ] +} + +mojom("test_no_sources") { + testonly = true + + public_deps = [ + ":test_interfaces", + ] +} diff --git a/chromium/mojo/public/interfaces/bindings/tests/math_calculator.mojom b/chromium/mojo/public/interfaces/bindings/tests/math_calculator.mojom new file mode 100644 index 00000000000..7d1b171e1a9 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/math_calculator.mojom @@ -0,0 +1,12 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.math"] +module math; + +interface Calculator { + Clear@0() => (double value@0); + Add@1(double value@0) => (double value@0); + Multiply@2(double value@0) => (double value@0); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/no_module.mojom b/chromium/mojo/public/interfaces/bindings/tests/no_module.mojom new file mode 100644 index 00000000000..f3800112904 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/no_module.mojom @@ -0,0 +1,9 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Entities without module + +enum EnumWithoutModule { + A +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/ping_service.mojom b/chromium/mojo/public/interfaces/bindings/tests/ping_service.mojom new file mode 100644 index 00000000000..ba6ad3d66a4 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/ping_service.mojom @@ -0,0 +1,14 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.ping"] +module mojo.test; + +interface PingService { + Ping() => (); +}; + +interface EchoService { + Echo(string test_data) => (string echo_data); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/rect.mojom b/chromium/mojo/public/interfaces/bindings/tests/rect.mojom new file mode 100644 index 00000000000..833c76bb2a4 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/rect.mojom @@ -0,0 +1,22 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.test_structs"] +module mojo.test; + +struct Rect { + int32 x; + int32 y; + int32 width; + int32 height; +}; + +// A copy of Rect that can be typemapped. Arrays of Rect are currently used, +// which do not support typemapping. +struct TypemappedRect { + int32 x; + int32 y; + int32 width; + int32 height; +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/regression_tests.mojom b/chromium/mojo/public/interfaces/bindings/tests/regression_tests.mojom new file mode 100644 index 00000000000..d87a3ad65f3 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/regression_tests.mojom @@ -0,0 +1,76 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Module containing entities for regression tests of the generator. Entities +// must never be modified, instead new entity must be added to add new tests. +[JavaPackage="org.chromium.mojo.bindings.test.mojom.regression_tests"] +module regression_tests; + +interface CheckMethodWithEmptyResponse { +WithouParameterAndEmptyResponse() => (); +WithParameterAndEmptyResponse(bool b) => (); +}; + +interface CheckNameCollision { +WithNameCollision(bool message, bool response) => (bool message, bool response); +}; + +enum EnumWithReference { + k_STEREO_AND_KEYBOARD_MIC = 30, + k_MAX = k_STEREO_AND_KEYBOARD_MIC +}; + +enum EnumWithLowercase { + PlanarF16, + PlanarF32 +}; + +enum EnumWithNumbers { + k_2_1 = 4 +}; + +enum EnumWithK { + K = 0 +}; + +struct Edge { + Vertex? v; +}; + +struct Vertex { + EmptyStruct? e; +}; + +struct EmptyStruct { +}; + +struct A { + B? b; +}; + +struct B { + A? a; +}; + +// Previously, a field or parameter called |handles| would be shadowed by a +// method parameter in generated C++ bindings code. +struct HandlesNameCollisionStruct { + EmptyStruct handles; +}; + +struct HandlesHandleNameCollisionStruct { + handle handles; +}; + +union HandlesNameCollisionUnion { + int32 handles; +}; + +struct HandlesUnionNameCollisionStruct { + HandlesNameCollisionUnion handles; +}; + +interface HandlesNameCollisionInterface { + Method(EmptyStruct handles) => (handle handles); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/sample_factory.mojom b/chromium/mojo/public/interfaces/bindings/tests/sample_factory.mojom new file mode 100644 index 00000000000..ade3bf37d65 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/sample_factory.mojom @@ -0,0 +1,41 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] +module sample; + +import "sample_import.mojom"; + +// This sample shows how handles to MessagePipes can be sent as both parameters +// to methods as well as fields on structs. + +struct Request { + int32 x; + handle<message_pipe>? pipe; + array<handle<message_pipe>>? more_pipes; + + // Interfaces can be used as members. + imported.ImportedInterface? obj; +}; + +struct Response { + int32 x; + handle<message_pipe>? pipe; +}; + +interface NamedObject { + SetName(string name); + GetName() => (string name); +}; + +interface Factory { + DoStuff(Request request, handle<message_pipe>? pipe) => + (Response response, string text); + DoStuff2(handle<data_pipe_consumer> pipe) => (string text); + CreateNamedObject(NamedObject& obj); + RequestImportedInterface( + imported.ImportedInterface& obj) => (imported.ImportedInterface& obj); + TakeImportedInterface( + imported.ImportedInterface obj) => (imported.ImportedInterface obj); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/sample_import.mojom b/chromium/mojo/public/interfaces/bindings/tests/sample_import.mojom new file mode 100644 index 00000000000..d28cb7b4db8 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/sample_import.mojom @@ -0,0 +1,38 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.imported"] +module imported; + +// This sample just defines some types that are imported into +// sample_service.mojom, to show how import works. + +enum Shape { + RECTANGLE = 1, + CIRCLE, + TRIANGLE, + LAST = TRIANGLE, +}; + +// These enum values should not interfere with those of Shape above. +enum AnotherShape { + RECTANGLE = 10, + CIRCLE, + TRIANGLE, +}; + +enum YetAnotherShape { + RECTANGLE = 20, + CIRCLE, + TRIANGLE, +}; + +struct Point { + int32 x; + int32 y; +}; + +interface ImportedInterface { + DoSomething(); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/sample_import2.mojom b/chromium/mojo/public/interfaces/bindings/tests/sample_import2.mojom new file mode 100644 index 00000000000..ca4e81c0bb6 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/sample_import2.mojom @@ -0,0 +1,28 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.imported"] +module imported; + +import "sample_import.mojom"; + +// This sample adds more types and constants to the "imported" namespace, +// to test a bug with importing multiple modules with the same namespace. + +enum Color { + RED, + BLACK, +}; + +struct Size { + int32 width; + int32 height; +}; + +struct Thing { + imported.Shape shape = RECTANGLE; + imported.Color color = Color.BLACK; + Point location; + Size size; +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/sample_interfaces.mojom b/chromium/mojo/public/interfaces/bindings/tests/sample_interfaces.mojom new file mode 100644 index 00000000000..5960d756657 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/sample_interfaces.mojom @@ -0,0 +1,32 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.sample", + JavaConstantsClassName="InterfaceConstants", + Foo = "hello world"] +module sample; + +const uint64 kLong = 4405; + +enum Enum { + VALUE +}; + +interface PingTest { + Ping() => (); +}; + +interface Provider { + EchoString(string a) => (string a); + EchoStrings(string a, string b) => (string a, string b); + EchoMessagePipeHandle(handle<message_pipe> a) => (handle<message_pipe> a); + EchoEnum(Enum a) => (Enum a); + EchoInt(int32 a) => (int32 a); +}; + +interface IntegerAccessor { + GetInteger() => (int64 data, [MinVersion=2] Enum type); + [MinVersion=1] + SetInteger(int64 data, [MinVersion=3] Enum type); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/sample_service.mojom b/chromium/mojo/public/interfaces/bindings/tests/sample_service.mojom new file mode 100644 index 00000000000..761cb91a9b5 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/sample_service.mojom @@ -0,0 +1,112 @@ + +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] +module sample; + +import "sample_import.mojom"; +import "sample_import2.mojom"; + +const uint8 kTwelve = 12; + +struct Bar { + enum Type { + VERTICAL = 1, + HORIZONTAL, + BOTH, + INVALID + }; + uint8 alpha@0 = 0xff; + uint8 beta@1; + uint8 gamma@2; + Type type@3 = sample.Bar.Type.VERTICAL; +}; + +struct Foo { + const string kFooby = "Fooby"; + string name@8 = kFooby; + int32 x@0; + int32 y@1; + bool a@2 = true; + bool b@3; + bool c@4; + Bar? bar@5; + array<Bar>? extra_bars@7; + array<uint8>? data@6; + handle<message_pipe>? source@9; + array<handle<data_pipe_consumer>>? input_streams@10; + array<handle<data_pipe_producer>>? output_streams@11; + array<array<bool>>? array_of_array_of_bools@12; + array<array<array<string>>>? multi_array_of_strings@13; + array<bool>? array_of_bools@14; +}; + +struct DefaultsTest { + int8 a0@0 = -12; + uint8 a1@1 = sample.kTwelve; + int16 a2@2 = 1234; + uint16 a3@3 = 34567; + int32 a4@4 = 123456; + uint32 a5@5 = 3456789012; + int64 a6@6 = -111111111111; + uint64 a7@7 = 9999999999999999999; + int32 a8@8 = 0x12345; + int32 a9@9 = -0x12345; + int32 a10@10 = +1234; + bool a11@11 = true; + bool a12@12 = false; + float a13@13 = 123.25; + double a14@14 = 1234567890.123; + double a15@15 = 1E10; + double a16@16 = -1.2E+20; + double a17@17 = +1.23E-20; + + // TODO(vtl): Add tests for default vs null when those are implemented (for + // structs, arrays, and strings). + array<uint8> a18@18; + string a19@19; + + Bar.Type a20@20 = BOTH; + imported.Point a21@21; + imported.Thing a22@22 = default; + + uint64 a23@23 = 0xFFFFFFFFFFFFFFFF; + int64 a24@24 = 0x123456789; + int64 a25@25 = -0x123456789; + + double a26@26 = double.INFINITY; + double a27@27 = double.NEGATIVE_INFINITY; + double a28@28 = double.NAN; + float a29@29 = float.INFINITY; + float a30@30 = float.NEGATIVE_INFINITY; + float a31@31 = float.NAN; +}; + +struct StructWithHoleV1 { + int32 v1 = 1; + int64 v2 = 2; +}; + +struct StructWithHoleV2 { + int32 v1 = 1; + int64 v2 = 2; + int32 v3 = 3; +}; + +interface Service { + enum BazOptions { + REGULAR = 0, + EXTRA + }; + const uint8 kFavoriteBaz = 1; + Frobinate@0(Foo? foo@0, BazOptions baz@1, Port? port@2) => (int32 result@0); + GetPort@1(Port& port @0); +}; + +// This interface is referenced above where it is defined. It also refers to +// itself from a method. +interface Port { + PostMessageToPort@0(string message_text@0, Port port@1); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/scoping.mojom b/chromium/mojo/public/interfaces/bindings/tests/scoping.mojom new file mode 100644 index 00000000000..2e9edb10b4e --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/scoping.mojom @@ -0,0 +1,17 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +interface A { + GetB(B& b); +}; + +interface B { + GetC(C& c); +}; + +interface C { + D(); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom b/chromium/mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom new file mode 100644 index 00000000000..1239e163cb8 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom @@ -0,0 +1,36 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.mojo"] +module mojo.test; + +struct Struct1 { + uint8 i; +}; + +struct Struct2 { + handle hdl; +}; + +struct Struct3 { + Struct1 struct_1; +}; + +struct Struct4 { + array<Struct1> data; +}; + +struct Struct5 { + array<Struct1, 2> pair; +}; + +struct Struct6 { + string str; +}; + +struct StructOfNullables { + handle? hdl; + Struct1? struct_1; + string? str; +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/struct_with_traits.mojom b/chromium/mojo/public/interfaces/bindings/tests/struct_with_traits.mojom new file mode 100644 index 00000000000..b1b7437e89c --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/struct_with_traits.mojom @@ -0,0 +1,60 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +// TODO(yzshen): Rename *WithTraits* types to something more readable. + +struct NestedStructWithTraits { + int32 value; +}; + +enum EnumWithTraits { + VALUE_0, + VALUE_1 +}; + +struct StructWithTraits { + EnumWithTraits f_enum; + bool f_bool; + uint32 f_uint32; + uint64 f_uint64; + string f_string; + string f_string2; + array<string> f_string_array; + NestedStructWithTraits f_struct; + array<NestedStructWithTraits> f_struct_array; + map<string, NestedStructWithTraits> f_struct_map; +}; + +// Test that this container can be cloned. +struct StructWithTraitsContainer { + StructWithTraits f_struct; +}; + +struct PassByValueStructWithTraits { + handle f_handle; +}; + +// The custom type for PassByValueStructWithTraits is not clonable. Test that +// this container can compile as long as Clone() is not used. +struct PassByValueStructWithTraitsContainer { + PassByValueStructWithTraits f_struct; +}; + +struct StructWithTraitsForUniquePtrTest { + int32 f_int32; +}; + +interface TraitsTestService { + EchoStructWithTraits(StructWithTraits s) => (StructWithTraits passed); + + EchoPassByValueStructWithTraits(PassByValueStructWithTraits s) => + (PassByValueStructWithTraits passed); + + EchoEnumWithTraits(EnumWithTraits e) => (EnumWithTraits passed); + + EchoStructWithTraitsForUniquePtrTest(StructWithTraitsForUniquePtrTest e) => ( + StructWithTraitsForUniquePtrTest passed); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/test_associated_interfaces.mojom b/chromium/mojo/public/interfaces/bindings/tests/test_associated_interfaces.mojom new file mode 100644 index 00000000000..534cfd8d81e --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/test_associated_interfaces.mojom @@ -0,0 +1,44 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +interface FooInterface {}; + +struct StructContainsAssociated { + associated FooInterface? foo_interface; + associated FooInterface& foo_request; + array<associated FooInterface> foo_interfaces; + array<associated FooInterface&> foo_requests; +}; + +union UnionContainsAssociated { + associated FooInterface foo_interface; + associated FooInterface& foo_request; + array<associated FooInterface> foo_interfaces; + array<associated FooInterface&> foo_requests; +}; + +interface InterfacePassesAssociated { + PassFoo(associated FooInterface foo_interface, + associated FooInterface& foo_request) => + (associated FooInterface foo_interface, + associated FooInterface& foo_request); + + PassStruct(StructContainsAssociated foo_struct) => + (StructContainsAssociated foo_struct); + + PassUnion(UnionContainsAssociated foo_union) => + (UnionContainsAssociated foo_union); +}; + +interface IntegerSender { + Echo(int32 value) => (int32 value); + Send(int32 value); +}; + +interface IntegerSenderConnection { + GetSender(associated IntegerSender& sender); + AsyncGetSender() => (associated IntegerSender sender); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/test_constants.mojom b/chromium/mojo/public/interfaces/bindings/tests/test_constants.mojom new file mode 100644 index 00000000000..462d5126a5a --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/test_constants.mojom @@ -0,0 +1,53 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.test_constants"] +module mojo.test; + +// Integral types. +const bool kBoolValue = true; + +const int8 kInt8Value = -2; + +// In the range of (MAX_INT8, MAX_UINT8]. +const uint8 kUint8Value = 128; + +// In the range of [MIN_INT16, MIN_INT8). +const int16 kInt16Value = -233; + +// In the range of (MAX_INT16, MAX_UINT16]. +const uint16 kUint16Value = 44204; + +// In the range of [MIN_INT32, MIN_INT16). +const int32 kInt32Value = -44204; + +// In the range of (MAX_INT32, MAX_UINT32]. +const uint32 kUint32Value = 4294967295; + +// In the range of [MIN_INT64, MIN_INT32). +const int64 kInt64Value = -9223372036854775807; + +// In the range of (MAX_INT64, MAX_UINT64]. +const uint64 kUint64Value = 9999999999999999999; + +// Floating point types. +const double kDoubleValue = 3.14159; +const double kDoubleInfinity = double.INFINITY; +const double kDoubleNegativeInfinity = double.NEGATIVE_INFINITY; +const double kDoubleNaN = double.NAN; + +const float kFloatValue = 2.71828; +const float kFloatInfinity = float.INFINITY; +const float kFloatNegativeInfinity = float.NEGATIVE_INFINITY; +const float kFloatNaN = float.NAN; + +struct StructWithConstants { + const int8 kInt8Value = 5; + const float kFloatValue = 765.432; +}; + +interface InterfaceWithConstants { + const uint32 kUint32Value = 20100722; + const double kDoubleValue = 12.34567; +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/test_native_types.mojom b/chromium/mojo/public/interfaces/bindings/tests/test_native_types.mojom new file mode 100644 index 00000000000..46c6f694ce0 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/test_native_types.mojom @@ -0,0 +1,37 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +import "mojo/public/interfaces/bindings/tests/rect.mojom"; + +// Used to verify that structs can be declared with no body in mojom. + +[Native] +struct PickledStruct; + +[Native] +enum PickledEnum; + +struct PickleContainer { + PickledStruct f_struct; + PickledEnum f_enum; +}; + +interface PicklePasser { + PassPickledStruct(PickledStruct pickle) => (PickledStruct passed); + PassPickledEnum(PickledEnum pickle) => (PickledEnum passed); + PassPickleContainer(PickleContainer container) => (PickleContainer passed); + PassPickles(array<PickledStruct> pickles) => (array<PickledStruct> passed); + PassPickleArrays(array<array<PickledStruct>> pickle_arrays) + => (array<array<PickledStruct>> passed); +}; + +// Used to verify support for native serialization of mojom-defined structs +// using StrucTraits with different variants of the Rect type from rect.mojom. + +interface RectService { + AddRect(TypemappedRect r); + GetLargestRect() => (TypemappedRect largest); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/test_structs.mojom b/chromium/mojo/public/interfaces/bindings/tests/test_structs.mojom new file mode 100644 index 00000000000..2709d4923ff --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/test_structs.mojom @@ -0,0 +1,382 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.test_structs"] +module mojo.test; + +import "mojo/public/interfaces/bindings/tests/rect.mojom"; + +struct NamedRegion { + string? name; + array<Rect>? rects; +}; + +struct RectPair { + Rect? first; + Rect? second; +}; + +struct EmptyStruct { +}; + +[Native] +struct UnmappedNativeStruct; + +// Used to verify that struct fields which don't specify a default are +// initialized to: false for bool, 0 for numbers, and null for strings, +// handles, and structs. The "?" nullable suffix shouldn't have any +// impact on initial field values. + +struct NoDefaultFieldValues { + bool f0; + int8 f1; + uint8 f2; + int16 f3; + uint16 f4; + int32 f5; + uint32 f6; + int64 f7; + uint64 f8; + float f9; + double f10; + string f11; + string? f12; + handle<message_pipe> f13; + handle<data_pipe_consumer> f14; + handle<data_pipe_producer> f15; + handle<message_pipe>? f16; + handle<data_pipe_consumer>? f17; + handle<data_pipe_producer>? f18; + handle f19; + handle? f20; + handle<shared_buffer> f21; + handle<shared_buffer>? f22; + array<string> f23; + array<string?> f24; + array<string>? f25; + array<string?>? f26; + EmptyStruct f27; + EmptyStruct? f28; +}; + +// Used to verify that struct fields with an explicit default value +// are initialized correctly. The "?" nullable suffix shouldn't have any +// impact on initial field values. + +struct DefaultFieldValues { + const string kFoo = "foo"; + bool f0 = true; + int8 f1 = 100; + uint8 f2 = 100; + int16 f3 = 100; + uint16 f4 = 100; + int32 f5 = 100; + uint32 f6 = 100; + int64 f7 = 100; + uint64 f8 = 100; + float f9 = 100; + float f10 = 100.0; + double f11 = 100; + double f12 = 100.0; + string f13 = kFoo; + string? f14 = kFoo; + Rect f15 = default; + Rect? f16 = default; +}; + +// Used to verify that the code generated for enum and const values defined +// within a struct is correct. Assuming that a constant's value can be a literal +// or another constant and that enum values can either be an integer constant or +// another value from the same enum type. + +struct ScopedConstants { + const int32 TEN = 10; + const int32 ALSO_TEN = TEN; + enum EType { + E0, + E1, + E2 = 10, + E3 = E2, + E4, + }; + EType f0 = E0; // 0 + EType f1 = E1; // 1 + EType f2 = E2; // 10 + EType f3 = E3; // 10 + EType f4 = E4; // 11 + int32 f5 = TEN; + int32 f6 = ALSO_TEN; +}; + +// Used to verify that all possible Map key field types can be encoded and +// decoded successfully. + +struct MapKeyTypes { + // TODO(yzshen): WTF::HashMap doesn't support bool as key. + // map<bool, bool> f0; + map<int8, int8> f1; + map<uint8, uint8> f2; + map<int16, int16> f3; + map<uint16, uint16> f4; + map<int32, int32> f5; + map<uint32, uint32> f6; + map<int64, int64> f7; + map<uint64, uint64> f8; + map<float, float> f9; + map<double, double> f10; + map<string, string> f11; +}; + +// Used to verify that various map value types can be encoded and decoded +// successfully. + +struct MapValueTypes { + map<string, array<string>> f0; + map<string, array<string>?> f1; + map<string, array<string?>> f2; + map<string, array<string, 2>> f3; + map<string, array<array<string, 2>?>> f4; + map<string, array<array<string, 2>, 1>> f5; + map<string, Rect?> f6; + map<string, map<string, string>> f7; + map<string, array<map<string, string>>> f8; + map<string, handle> f9; + map<string, array<handle>> f10; + map<string, map<string, handle>> f11; +}; + +// Used to verify that various array types can be encoded and decoded +// successfully. + +struct ArrayValueTypes { + array<int8> f0; + array<int16> f1; + array<int32> f2; + array<int64> f3; + array<float> f4; + array<double> f5; + array<SomeInterface> f6; + array<SomeInterface&> f7; +}; + +// Used to verify that various float and double values can be encoded and +// decoded correctly. + +struct FloatNumberValues { + const double V0 = double.INFINITY; + const double V1 = double.NEGATIVE_INFINITY; + const double V2 = double.NAN; + const float V3 = float.INFINITY; + const float V4 = float.NEGATIVE_INFINITY; + const float V5 = float.NAN; + const float V6 = 0; + const double V7 = 1234567890.123; + const double V8 = 1.2E+20; + const double V9 = -1.2E+20; + + double f0 = V0; + double f1 = V1; + double f2 = V2; + float f3 = V3; + float f4 = V4; + float f5 = V5; + float f6 = V6; + double f7 = V7; + double f8 = V8; + double f9 = V9; +}; + +// Used to verify that various signed integer values can be encoded and +// decoded correctly. + +struct IntegerNumberValues { + const int8 V0 = -128; // Minimum + const int8 V1 = -1; // -1 + const int8 V2 = 0; // 0 + const int8 V3 = 42; // An arbitrary valid value. + const int8 V4 = 127; // Maximum + + const int16 V5 = -32768; // ... + const int16 V6 = -1; + const int16 V7 = 0; + const int16 V8 = 12345; + const int16 V9 = 32767; + + const int32 V10 = -2147483648; + const int32 V11 = -1; + const int32 V12 = 0; + const int32 V13 = 1234567890; + const int32 V14 = 2147483647; + + // The limits for JavaScript integers are +/- (2^53 - 1). + const int64 V15 = -9007199254740991; // Number.MIN_SAFE_INTEGER + const int64 V16 = -1; + const int64 V17 = 0; + const int64 V18 = 1234567890123456; + const int64 V19 = 9007199254740991; // Number.MAX_SAFE_INTEGER + + int8 f0 = V0; + int8 f1 = V1; + int8 f2 = V2; + int8 f3 = V3; + int8 f4 = V4; + + int16 f5 = V5; + int16 f6 = V6; + int16 f7 = V7; + int16 f8 = V8; + int16 f9 = V9; + + int32 f10 = V10; + int32 f11 = V11; + int32 f12 = V12; + int32 f13 = V13; + int32 f14 = V14; + + int64 f15 = V15; + int64 f16 = V16; + int64 f17 = V17; + int64 f18 = V18; + int64 f19 = V19; +}; + +// Used to verify that various unsigned integer values can be encoded and +// decoded correctly. + +struct UnsignedNumberValues { + const uint8 V0 = 0; // Minimum = 0. + const uint8 V1 = 42; // An arbitrary valid value. + const uint8 V2 = 0xFF; // Maximum + + const uint16 V3 = 0; // ... + const uint16 V4 = 12345; + const uint16 V5 = 0xFFFF; + + const uint32 V6 = 0; + const uint32 V7 = 1234567890; + const uint32 V8 = 0xFFFFFFFF; + + // The limits for JavaScript integers are +/- (2^53 - 1). + const uint64 V9 = 0; + const uint64 V10 = 1234567890123456; + const uint64 V11 = 9007199254740991; // Number.MAX_SAFE_INTEGER + + uint8 f0 = V0; + uint8 f1 = V1; + uint8 f2 = V2; + + uint16 f3 = V3; + uint16 f4 = V4; + uint16 f5 = V5; + + uint32 f6 = V6; + uint32 f7 = V7; + uint32 f8 = V8; + + uint64 f9 = V9; + uint64 f10 = V10; + uint64 f11 = V11; +}; + +// Used to verify that various (packed) boolean array values can be encoded +// and decoded correctly. + +struct BitArrayValues { + array<bool, 1> f0; + array<bool, 7> f1; + array<bool, 9> f2; + array<bool> f3; + array<array<bool>> f4; + array<array<bool>?> f5; + array<array<bool, 2>?> f6; +}; + +// Used to verify that different versions can be decoded correctly. + +struct MultiVersionStruct { + [MinVersion=0] + int32 f_int32; + [MinVersion=1] + Rect? f_rect; + [MinVersion=3] + string? f_string; + [MinVersion=5] + array<int8>? f_array; + [MinVersion=7] + handle<message_pipe>? f_message_pipe; + [MinVersion=7] + bool f_bool; + [MinVersion=9] + int16 f_int16; +}; + +struct MultiVersionStructV0 { + [MinVersion=0] + int32 f_int32; +}; + +struct MultiVersionStructV1 { + [MinVersion=0] + int32 f_int32; + [MinVersion=1] + Rect? f_rect; +}; + +struct MultiVersionStructV3 { + [MinVersion=0] + int32 f_int32; + [MinVersion=1] + Rect? f_rect; + [MinVersion=3] + string? f_string; +}; + +struct MultiVersionStructV5 { + [MinVersion=0] + int32 f_int32; + [MinVersion=1] + Rect? f_rect; + [MinVersion=3] + string? f_string; + [MinVersion=5] + array<int8>? f_array; +}; + +struct MultiVersionStructV7 { + [MinVersion=0] + int32 f_int32; + [MinVersion=1] + Rect? f_rect; + [MinVersion=3] + string? f_string; + [MinVersion=5] + array<int8>? f_array; + [MinVersion=7] + handle<message_pipe>? f_message_pipe; + [MinVersion=7] + bool f_bool; +}; + +// Used to verify that interfaces that are struct members can be defined in the +// same file. + +interface SomeInterface { + SomeMethod(RectPair pair) => (RectPair other_pair); +}; + +struct ContainsInterface { + SomeInterface some_interface; +}; + +// Verify that a field can be called |other|. + +struct ContainsOther { + int32 other; +}; + +// Used to verify that structs can contain interface requests. + +struct ContainsInterfaceRequest { + SomeInterface& request; +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/test_sync_methods.mojom b/chromium/mojo/public/interfaces/bindings/tests/test_sync_methods.mojom new file mode 100644 index 00000000000..3b8cfe63882 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/test_sync_methods.mojom @@ -0,0 +1,44 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +interface TestSyncCodeGeneration { + [Sync] + NoInput() => (int32 result); + + [Sync] + NoOutput(int32 value) => (); + + [Sync] + NoInOut() => (); + + [Sync] + HaveInOut(int32 value1, int32 value2) => (int32 result1, int32 result2); +}; + +interface TestSync { + [Sync] + Ping() => (); + + [Sync] + Echo(int32 value) => (int32 result); + + AsyncEcho(int32 value) => (int32 result); +}; + +// Test sync method support with associated interfaces. +interface TestSyncMaster { + [Sync] + Ping() => (); + + [Sync] + Echo(int32 value) => (int32 result); + + AsyncEcho(int32 value) => (int32 result); + + SendInterface(associated TestSync ptr); + + SendRequest(associated TestSync& request); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/test_unions.mojom b/chromium/mojo/public/interfaces/bindings/tests/test_unions.mojom new file mode 100644 index 00000000000..41e1ed6ace0 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/test_unions.mojom @@ -0,0 +1,105 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +enum AnEnum { + FIRST, SECOND +}; + +[Extensible] +enum AnExtensibleEnum { + FIRST, SECOND, THIRD +}; + +union PodUnion { + int8 f_int8; + int8 f_int8_other; + uint8 f_uint8; + int16 f_int16; + uint16 f_uint16; + int32 f_int32; + uint32 f_uint32; + int64 f_int64; + uint64 f_uint64; + float f_float; + double f_double; + bool f_bool; + AnEnum f_enum; + AnExtensibleEnum f_extensible_enum; +}; + +union ObjectUnion { + int8 f_int8; + string f_string; + DummyStruct f_dummy; + DummyStruct? f_nullable; + array<int8> f_array_int8; + map<string, int8> f_map_int8; + PodUnion f_pod_union; + // Test that Clone() is defined after SmallStruct is declared. + array<SmallStruct> f_small_structs; +}; + +union HandleUnion { + handle f_handle; + handle<message_pipe> f_message_pipe; + handle<data_pipe_consumer> f_data_pipe_consumer; + handle<data_pipe_producer> f_data_pipe_producer; + handle<shared_buffer> f_shared_buffer; + SmallCache f_small_cache; + SmallCache& f_small_cache_request; +}; + +struct WrapperStruct { + ObjectUnion? object_union; + PodUnion? pod_union; + HandleUnion? handle_union; +}; + +struct DummyStruct { + int8 f_int8; +}; + +struct SmallStruct { + DummyStruct? dummy_struct; + PodUnion? pod_union; + array<PodUnion>? pod_union_array; + array<PodUnion?>? nullable_pod_union_array; + array<DummyStruct>? s_array; + map<string, PodUnion>? pod_union_map; + map<string, PodUnion?>? nullable_pod_union_map; +}; + +struct SmallStructNonNullableUnion { + PodUnion pod_union; +}; + +struct SmallObjStruct { + ObjectUnion obj_union; + int8 f_int8; +}; + +interface SmallCache { + SetIntValue(int64 int_value); + GetIntValue() => (int64 int_value); +}; + +interface UnionInterface { + Echo(PodUnion in_val) => (PodUnion out_val); +}; + +struct TryNonNullStruct { + DummyStruct? nullable; + DummyStruct non_nullable; +}; + +union OldUnion { + int8 f_int8; +}; + +union NewUnion { + int8 f_int8; + int16 f_int16; +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom b/chromium/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom new file mode 100644 index 00000000000..2fdbea80b66 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/test_wtf_types.mojom @@ -0,0 +1,37 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +struct TestWTFCodeGeneration { + string str; + string? nullable_str; + array<string> strs; + array<string?> nullable_strs; + array<array<int32>> arrays; + array<bool> bools; + array<handle<message_pipe>> handles; + map<string, string?> str_map; + map<int32, array<int32>> array_map; + map<int32, handle<message_pipe>> handle_map; + array<map<string, string?>> str_maps; +}; + +union TestWTFCodeGeneration2 { + string str; + array<string> strs; + map<string, string?> str_map; +}; + +struct TestWTFStruct { + string str; + int32 integer; +}; + +interface TestWTF { + EchoString(string? str) => (string? str); + EchoStringArray(array<string?>? arr) => (array<string?>? arr); + EchoStringMap(map<string, string?>? str_map) + => (map<string, string?>? str_map); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/validation_test_associated_interfaces.mojom b/chromium/mojo/public/interfaces/bindings/tests/validation_test_associated_interfaces.mojom new file mode 100644 index 00000000000..2fa77ffc9d4 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/validation_test_associated_interfaces.mojom @@ -0,0 +1,18 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test; + +// Associated interfaces are not supported by all language bindings yet. +// Eventually these definitions should live in validation_test_interfaces.mojom. + +interface InterfaceX {}; + +interface AssociatedConformanceTestInterface { + Method0(associated InterfaceX param0); + Method1(associated InterfaceX& param0); + Method2(associated InterfaceX? param0); + Method3(array<associated InterfaceX> param0); +}; + diff --git a/chromium/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom b/chromium/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom new file mode 100644 index 00000000000..c46c0a5a403 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom @@ -0,0 +1,113 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + + +[JavaPackage="org.chromium.mojo.bindings.test.mojom.mojo"] +module mojo.test; + +struct StructA { + uint64 i; +}; + +struct StructB { + StructA struct_a; +}; + +struct StructC { + array<uint8> data; +}; + +struct StructD { + array<handle<message_pipe>> message_pipes; +}; + +struct StructE { + StructD struct_d; + handle<data_pipe_consumer> data_pipe_consumer; +}; + +struct StructF { + array<uint8, 3> fixed_size_array; +}; + +struct StructG { + int32 i; + [MinVersion=1] + StructA? struct_a; + [MinVersion=3] + string? str; + [MinVersion=3] + bool b; +}; + +interface InterfaceA { +}; + +enum EnumA { + ENUM_A_0, + ENUM_A_1 +}; + +[Extensible] +enum EnumB { + ENUM_B_0, + ENUM_B_1, + ENUM_B_2 +}; + +// This interface is used for testing bounds-checking in the mojom +// binding code. If you add a method please update the files +// ./data/validation/boundscheck_*. If you add a response please update +// ./data/validation/resp_boundscheck_*. +interface BoundsCheckTestInterface { + Method0(uint8 param0) => (uint8 param0); + Method1(uint8 param0); +}; + +interface ConformanceTestInterface { + Method0(float param0); + Method1(StructA param0); + Method2(StructB param0, StructA param1); + Method3(array<bool> param0); + Method4(StructC param0, array<uint8> param1); + Method5(StructE param0, handle<data_pipe_producer> param1); + Method6(array<array<uint8>> param0); + Method7(StructF param0, array<array<uint8, 3>?, 2> param1); + Method8(array<array<string>?> param0); + Method9(array<array<handle?>>? param0); + Method10(map<string, uint8> param0); + Method11(StructG param0); + Method12(float param0) => (float param0); + Method13(InterfaceA? param0, uint32 param1, InterfaceA? param2); + Method14(EnumA param0, EnumB param1); + Method15(array<EnumA>? param0, array<EnumB>? param1); + Method16(map<EnumA, EnumA>? param0); + Method17(array<InterfaceA> param0); +}; + +struct BasicStruct { + int32 a; +}; + +interface IntegrationTestInterface { + Method0(BasicStruct param0) => (array<uint8> param0); +}; + +// An enum generates a enum-value validation function, so we want to test it. +// E.g., valid enum values for this enum should be: -3, 0, 1, 10 +enum BasicEnum { + A, + B, + C = A, + D = -3, + E = 0xA +}; + +// The enum validation function should be generated within the scope of this +// struct. +struct StructWithEnum { + enum EnumWithin { + A, B, C, D + }; +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/versioning_test_client.mojom b/chromium/mojo/public/interfaces/bindings/tests/versioning_test_client.mojom new file mode 100644 index 00000000000..f0136db9b54 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/versioning_test_client.mojom @@ -0,0 +1,34 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test.versioning; + +// versioning_test_service.mojom and versioning_test_client.mojom contain +// different versions of Mojom definitions for a fictitious human resource +// management system. They are used to test the versioning mechanism. + +enum Department { + SALES, + DEV +}; + +struct Employee { + uint64 employee_id; + string name; + Department department; +}; + +interface HumanResourceDatabase { + AddEmployee(Employee employee) => (bool success); + + QueryEmployee(uint64 id, [MinVersion=1] bool retrieve_finger_print) + => (Employee? employee, [MinVersion=1] array<uint8>? finger_print); + + [MinVersion=1] + AttachFingerPrint(uint64 id, array<uint8> finger_print) + => (bool success); + + [MinVersion=2] + ListEmployeeIds() => (array<uint64>? ids); +}; diff --git a/chromium/mojo/public/interfaces/bindings/tests/versioning_test_service.mojom b/chromium/mojo/public/interfaces/bindings/tests/versioning_test_service.mojom new file mode 100644 index 00000000000..59b38324a69 --- /dev/null +++ b/chromium/mojo/public/interfaces/bindings/tests/versioning_test_service.mojom @@ -0,0 +1,38 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test.versioning; + +// versioning_test_service.mojom and versioning_test_client.mojom contain +// different versions of Mojom definitions for a fictitious human resource +// management system. They are used to test the versioning mechanism. + +enum Department { + SALES, + DEV +}; + +struct Date { + uint16 year; + uint8 month; + uint8 day; +}; + +struct Employee { + uint64 employee_id; + string name; + Department department; + [MinVersion=1] Date? birthday; +}; + +interface HumanResourceDatabase { + AddEmployee(Employee employee) => (bool success); + + QueryEmployee(uint64 id, [MinVersion=1] bool retrieve_finger_print) + => (Employee? employee, [MinVersion=1] array<uint8>? finger_print); + + [MinVersion=1] + AttachFingerPrint(uint64 id, array<uint8> finger_print) + => (bool success); +}; diff --git a/chromium/native_client/.gn b/chromium/native_client/.gn new file mode 100644 index 00000000000..b3c25adec42 --- /dev/null +++ b/chromium/native_client/.gn @@ -0,0 +1,17 @@ +# Copyright (c) 2014 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file is used by the experimental meta-buildsystem in native_client to +# find the root of the source tree and to set startup options. + +# The location of the top of the build (BUILD.gn). +root = "//native_client" + +# The location of the build configuration file. +buildconfig = "//build/config/BUILDCONFIG.gn" + +# The secondary source root is a parallel directory tree where +# GN build files are placed when they can not be placed directly +# in the source tree, e.g. for third party source trees. +secondary_source = "//build/secondary/" diff --git a/chromium/native_client/BUILD.gn b/chromium/native_client/BUILD.gn new file mode 100644 index 00000000000..27e0e75c38c --- /dev/null +++ b/chromium/native_client/BUILD.gn @@ -0,0 +1,33 @@ +# Copyright (c) 2014 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This is the root build file for GN. GN will start processing by loading this +# file, and recursively load all dependencies until all dependencies are either +# resolved or known not to exist (which will cause the build to fail). So if +# you add a new build file, there must be some path of dependencies from this +# file to your new one or GN won't know about it. +# +# All targets in this file file are built by default. +# +# Here we declare the meta targets which pull in the various architecture +# combinations of the real targets. +# + +import("config.gni") + +group("trusted") { + deps = [ + "//native_client/src:trusted_targets", + ] +} + +# +# This is the root untrusted target which will build all trusted components +# +group("untrusted") { + deps = [ + "//native_client/src/:irt_targets($toolchain_irt)", + "//native_client/src/:untrusted_targets($toolchain_untrusted)", + ] +} diff --git a/chromium/native_client/config.gni b/chromium/native_client/config.gni new file mode 100644 index 00000000000..076e7c75f0e --- /dev/null +++ b/chromium/native_client/config.gni @@ -0,0 +1,42 @@ +# Copyright 2016 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Untrusted architecture + use_nacl_x86 = target_cpu == "x86" + use_nacl_x64 = target_cpu == "x64" || target_os == "win" + use_nacl_arm = target_cpu == "arm" + + # Untrusted libc + use_gcc_glibc = false + use_clang_newlib = true + + if (use_nacl_x86) { + if (use_gcc_glibc) { + toolchain_untrusted = "//build/toolchain/nacl:glibc_x86" + } + if (use_clang_newlib) { + toolchain_untrusted = "//build/toolchain/nacl:clang_newlib_x86" + } + toolchain_irt = "//build/toolchain/nacl:irt_x86" + } + if (use_nacl_x64) { + if (use_gcc_glibc) { + toolchain_untrusted = "//build/toolchain/nacl:glibc_x64" + } + if (use_clang_newlib) { + toolchain_untrusted = "//build/toolchain/nacl:clang_newlib_x64" + } + toolchain_irt = "//build/toolchain/nacl:irt_x64" + } + if (use_nacl_arm) { + if (use_gcc_glibc) { + toolchain_untrusted = "//build/toolchain/nacl:glibc_arm" + } + if (use_clang_newlib) { + toolchain_untrusted = "//build/toolchain/nacl:clang_newlib_arm" + } + toolchain_irt = "//build/toolchain/nacl:irt_arm" + } +} diff --git a/chromium/native_client/src/BUILD.gn b/chromium/native_client/src/BUILD.gn new file mode 100644 index 00000000000..e6920cf03df --- /dev/null +++ b/chromium/native_client/src/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright (c) 2014 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("trusted_targets") { + deps = [ + "//native_client/src/shared/imc:imc", + "//native_client/src/shared/platform:platform", + "//native_client/src/trusted/cpu_features:all_cpu_features", + "//native_client/src/trusted/debug_stub:debug_stub", + "//native_client/src/trusted/desc:nrd_xfer", + "//native_client/src/trusted/desc:nrd_xfer", + "//native_client/src/trusted/fault_injection:nacl_fault_inject", + "//native_client/src/trusted/interval_multiset:nacl_interval", + "//native_client/src/trusted/nacl_base:nacl_base", + "//native_client/src/trusted/perf_counter:nacl_perf_counter", + "//native_client/src/trusted/platform_qualify:platform_qual_lib", + "//native_client/src/trusted/service_runtime:env_cleanser", + "//native_client/src/trusted/service_runtime:nacl_error_code", + "//native_client/src/trusted/service_runtime:sel", + "//native_client/src/trusted/service_runtime:sel_ldr", + "//native_client/src/trusted/service_runtime:sel_main", + "//native_client/src/trusted/validator/driver:elf_load", + "//native_client/src/trusted/validator/driver:ncval_new", + "//native_client/src/trusted/validator_ragel:rdfa_validator", + ] + if (is_linux) { + deps += [ "//native_client/src/nonsfi/loader:nonsfi_loader" ] + } +} + +group("tests") { + testonly = true + deps = [ + "//native_client/tests:large_tests", + "//native_client/tests:medium_tests", + "//native_client/tests:small_tests", + ] +} + +if (is_nacl) { + group("untrusted_targets") { + deps = [ + "//native_client/src/shared/gio:gio", + "//native_client/src/shared/platform:platform", + "//native_client/src/untrusted/elf_loader:elf_loader", + "//native_client/src/untrusted/nacl:imc_syscalls", + "//native_client/tests/hello_world:hello_world", + ] + } + + group("irt_targets") { + deps = [ + "//native_client/src/untrusted/irt:irt_core", + ] + } +} diff --git a/chromium/native_client/src/nonsfi/irt/BUILD.gn b/chromium/native_client/src/nonsfi/irt/BUILD.gn new file mode 100644 index 00000000000..1e0d65011cd --- /dev/null +++ b/chromium/native_client/src/nonsfi/irt/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright 2015 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("irt_interfaces") { + sources = [ + "../../untrusted/irt/irt_query_list.c", + "irt_interfaces.c", + "irt_random.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + ] +} + +if (is_nacl) { + static_library("nacl_sys_private") { + cflags = [ "-fgnu-inline-asm" ] + + # We reset sources_assignment_filter in order to explicitly include + # the Linux files (which could otherwise be filtered out). + set_sources_assignment_filter([]) + sources = [ + "../../untrusted/irt/irt_query_list.c", + "../../untrusted/pthread/nc_condvar.c", + "../../untrusted/pthread/nc_mutex.c", + "../../untrusted/pthread/nc_thread.c", + "../../untrusted/pthread/stack_end.c", + "../../untrusted/valgrind/dynamic_annotations.c", + "../linux/directory.c", + "../linux/irt_signal_handling.c", + "../linux/linux_futex.c", + "../linux/linux_pthread_private.c", + "../linux/linux_sys_private.c", + "irt_icache.c", + "irt_interfaces.c", + "irt_random.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + ] + } +} diff --git a/chromium/native_client/src/nonsfi/loader/BUILD.gn b/chromium/native_client/src/nonsfi/loader/BUILD.gn new file mode 100644 index 00000000000..d3fc3e2f12b --- /dev/null +++ b/chromium/native_client/src/nonsfi/loader/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright 2015 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("elf_loader") { + sources = [ + "elf_loader.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/platform:platform", + ] +} + +if (is_linux || is_nacl) { + executable("nonsfi_loader") { + sources = [ + "elf_loader_main.c", + ] + + deps = [ + ":elf_loader", + "//native_client/src/nonsfi/irt:irt_interfaces", + "//native_client/src/shared/platform", + ] + if (is_nacl) { + deps += [ + "//native_client/src/nonsfi/irt:nacl_sys_private", + "//native_client/src/untrusted/nacl", + ] + } + } +} diff --git a/chromium/native_client/src/shared/gio/BUILD.gn b/chromium/native_client/src/shared/gio/BUILD.gn new file mode 100644 index 00000000000..02fc1342645 --- /dev/null +++ b/chromium/native_client/src/shared/gio/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("gio") { + sources = [ + "gio.c", + "gprintf.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + ] +} diff --git a/chromium/native_client/src/shared/imc/BUILD.gn b/chromium/native_client/src/shared/imc/BUILD.gn new file mode 100644 index 00000000000..ba3bad2a1e5 --- /dev/null +++ b/chromium/native_client/src/shared/imc/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("imc") { + sources = [ + "nacl_imc_common.cc", + ] + + if (current_os == "nacl") { + sources += [ "nacl/nacl_imc.cc" ] + } + + if (current_os == "mac") { + sources += [ + "osx/nacl_imc.cc", + "posix/nacl_imc_posix.cc", + ] + } + + if (is_linux) { + sources += [ + "linux/nacl_imc.cc", + "posix/nacl_imc_posix.cc", + ] + + libs = [ "rt" ] + } + + if (current_os == "win") { + sources += [ + "win/nacl_imc.cc", + "win/nacl_shm.cc", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/platform:platform", + ] +} diff --git a/chromium/native_client/src/shared/platform/BUILD.gn b/chromium/native_client/src/shared/platform/BUILD.gn new file mode 100644 index 00000000000..f6c4d791a30 --- /dev/null +++ b/chromium/native_client/src/shared/platform/BUILD.gn @@ -0,0 +1,107 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autogenerated from src/shared/platform/build.scons. + +static_library("platform") { + if (current_os == "nacl") { + sources = [ + "nacl_check.c", + "nacl_log.c", + "posix/condition_variable.c", + "posix/lock.c", + "posix/nacl_error.c", + "posix/nacl_exit.c", + "posix/nacl_thread_id.c", + "posix/nacl_threads.c", + "posix/nacl_timestamp.c", + "nacl_sync_checked.c", + "refcount_base.cc", + ] + } else { + sources = [ + "nacl_check.c", + "nacl_global_secure_random.c", + "nacl_host_desc_common.c", + "nacl_interruptible_condvar.c", + "nacl_interruptible_mutex.c", + "nacl_log.c", + "nacl_secure_random_common.c", + "nacl_sync_checked.c", + "nacl_time_common.c", + "platform_init.c", + "refcount_base.cc", + ] + if (current_os != "win") { + sources += [ + "posix/aligned_malloc.c", + "posix/condition_variable.c", + "posix/lock.c", + "posix/nacl_error.c", + "posix/nacl_exit.c", + "posix/nacl_fast_mutex.c", + "posix/nacl_file_lock.c", + "posix/nacl_find_addrsp.c", + "posix/nacl_host_desc.c", + "posix/nacl_secure_random.c", + "posix/nacl_thread_id.c", + "posix/nacl_threads.c", + "posix/nacl_time.c", + "posix/nacl_timestamp.c", + ] + } + + if (current_os == "win") { + sources += [ + "win/aligned_malloc.c", + "win/condition_variable.cc", + "win/lock.cc", + "win/lock_impl_win.cc", + "win/nacl_clock.c", + "win/nacl_error.c", + "win/nacl_exit.c", + "win/nacl_fast_mutex.c", + "win/nacl_find_addrsp.c", + "win/nacl_host_desc.c", + "win/nacl_host_dir.c", + "win/nacl_secure_random.c", + "win/nacl_semaphore.c", + "win/nacl_sync_win.cc", + "win/nacl_threads.c", + "win/nacl_time.c", + "win/nacl_timestamp.c", + "win/port_win.c", + "win/xlate_system_error.c", + ] + } + + if (current_os == "mac") { + sources += [ + "osx/nacl_clock.c", + "osx/nacl_host_dir.c", + "osx/nacl_semaphore.c", + ] + } + + if (is_linux) { + sources += [ + "linux/nacl_clock.c", + "linux/nacl_host_dir.c", + "linux/nacl_semaphore.c", + ] + } + + if (current_os == "win") { + cflags_c = [ + "/DUNICODE", + "/D_CRT_RAND_S", + "/D_UNICODE", + ] + } + } + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/gio:gio", + ] +} diff --git a/chromium/native_client/src/tools/tls_edit/BUILD.gn b/chromium/native_client/src/tools/tls_edit/BUILD.gn new file mode 100644 index 00000000000..cffb0c9eeca --- /dev/null +++ b/chromium/native_client/src/tools/tls_edit/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("tls_edit") { + sources = [ + "tls_edit.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//native_client/src/shared/platform:platform", + "//native_client/src/trusted/validator_ragel:rdfa_validator", + ] +} diff --git a/chromium/native_client/src/trusted/asm.gni b/chromium/native_client/src/trusted/asm.gni new file mode 100644 index 00000000000..1bf66627b54 --- /dev/null +++ b/chromium/native_client/src/trusted/asm.gni @@ -0,0 +1,19 @@ +# Copyright (c) 2015 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Almost all of the x86 assembly code in src/trusted is written using +# GNU/AT&T syntax. On Windows, this means it has to be built using a +# nonstandard toolchain (GNU binutils rather than MSVC). Each place in +# src/trusted where there is some assembly code puts the assembly code into +# a separate source_set and then pulls that into a larger source_set using +# deps = [ ":foo_asm($nacl_asm_toolchain)" ]. On Windows, this will get a +# special toolchain for running the GNU assembler. On non-Windows, this is +# just the regular toolchain. + +if (is_win) { + nacl_asm_toolchain = + "//native_client/src/trusted/win:nacl_win_as_$current_cpu" +} else { + nacl_asm_toolchain = current_toolchain +} diff --git a/chromium/native_client/src/trusted/cpu_features/BUILD.gn b/chromium/native_client/src/trusted/cpu_features/BUILD.gn new file mode 100644 index 00000000000..b557a116845 --- /dev/null +++ b/chromium/native_client/src/trusted/cpu_features/BUILD.gn @@ -0,0 +1,43 @@ +# Copyright 2014 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//native_client/src/trusted/asm.gni") + +group("all_cpu_features") { + deps = [ + ":cpu_features", + ] +} + +if (current_toolchain == nacl_asm_toolchain) { + source_set("cpu_features_asm") { + if (current_cpu == "x64" || current_cpu == "x86") { + sources = [ + "arch/x86/cpu_xgetbv.S", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] + } +} + +source_set("cpu_features") { + include_dirs = [ "." ] + sources = [ + "arch/arm/cpu_arm.c", + "arch/mips/cpu_mips.c", + ] + + if (current_cpu == "x64" || current_cpu == "x86") { + sources += [ + "arch/x86/cpu_x86.c", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ":cpu_features_asm($nacl_asm_toolchain)", + ] +} diff --git a/chromium/native_client/src/trusted/debug_stub/BUILD.gn b/chromium/native_client/src/trusted/debug_stub/BUILD.gn new file mode 100644 index 00000000000..c24839ce015 --- /dev/null +++ b/chromium/native_client/src/trusted/debug_stub/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +import("//build/config/sanitizers/sanitizers.gni") + +static_library("debug_stub") { + sources = [ + "abi.cc", + "debug_stub.cc", + "nacl_debug.cc", + "packet.cc", + "session.cc", + "target.cc", + "thread_common.cc", + "transport_common.cc", + "transport_ipc.cc", + "util.cc", + ] + if (current_os != "win") { + sources += [ + "posix/debug_stub_posix.cc", + "posix/platform_impl.cc", + "posix/thread_impl.cc", + ] + } + if (current_os == "win") { + sources += [ + "win/debug_stub_win.cc", + "win/platform_impl.cc", + "win/thread_impl.cc", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/platform:platform", + ] +} + +executable("gdb_rsp_unittest") { + sources = [ + "abi_test.cc", + "packet_test.cc", + "session_test.cc", + "test.cc", + "util_test.cc", + ] + + deps = [ + ":debug_stub", + "//build/config/nacl:nacl_base", + + # All executables must have the sanitizer deps to properly link in + # asan mode (this target will be empty in other cases). + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} diff --git a/chromium/native_client/src/trusted/desc/BUILD.gn b/chromium/native_client/src/trusted/desc/BUILD.gn new file mode 100644 index 00000000000..6e53f02b001 --- /dev/null +++ b/chromium/native_client/src/trusted/desc/BUILD.gn @@ -0,0 +1,52 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("nrd_xfer") { + sources = [ + "nacl_desc_base.c", + "nacl_desc_cond.c", + "nacl_desc_custom.c", + "nacl_desc_dir.c", + "nacl_desc_effector_trusted_mem.c", + "nacl_desc_imc.c", + "nacl_desc_imc_shm.c", + "nacl_desc_invalid.c", + "nacl_desc_io.c", + "nacl_desc_mutex.c", + "nacl_desc_null.c", + "nacl_desc_quota.c", + "nacl_desc_quota_interface.c", + "nacl_desc_semaphore.c", + "nacl_desc_sync_socket.c", + "nrd_all_modules.c", + "nrd_xfer.c", + ] + if (current_os != "win") { + sources += [ + "posix/nacl_desc.c", + "posix/nacl_desc_conn_cap.c", + "posix/nacl_desc_imc_bound_desc.c", + "posix/nacl_makeboundsock.c", + ] + } else { + sources += [ + "win/nacl_desc.c", + "nacl_desc_conn_cap.c", + "nacl_desc_imc_bound_desc.c", + "nacl_makeboundsock.c", + ] + } + + if (current_os == "mac") { + sources += [ + "osx/nacl_desc_imc_shm_mach.c", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/imc:imc", + "//native_client/src/trusted/nacl_base:nacl_base", + ] +} diff --git a/chromium/native_client/src/trusted/fault_injection/BUILD.gn b/chromium/native_client/src/trusted/fault_injection/BUILD.gn new file mode 100644 index 00000000000..092581aad80 --- /dev/null +++ b/chromium/native_client/src/trusted/fault_injection/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autogenerated from src/trusted/fault_injection/build.scons. + +static_library("nacl_fault_inject") { + sources = [ + "fault_injection.c", + "test_injection.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/platform:platform", + ] +} diff --git a/chromium/native_client/src/trusted/interval_multiset/BUILD.gn b/chromium/native_client/src/trusted/interval_multiset/BUILD.gn new file mode 100644 index 00000000000..8a67493fbd6 --- /dev/null +++ b/chromium/native_client/src/trusted/interval_multiset/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autogenerated from src/trusted/interval_multiset/build.scons. + +static_library("nacl_interval") { + sources = [ + "nacl_interval_list.c", + "nacl_interval_multiset_delete.c", + "nacl_interval_multiset_factory.c", + "nacl_interval_range_tree.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} diff --git a/chromium/native_client/src/trusted/nacl_base/BUILD.gn b/chromium/native_client/src/trusted/nacl_base/BUILD.gn new file mode 100644 index 00000000000..cf2de2857f8 --- /dev/null +++ b/chromium/native_client/src/trusted/nacl_base/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autogenerated from src/trusted/nacl_base/build.scons. + +static_library("nacl_base") { + sources = [ + "nacl_refcount.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/platform:platform", + ] +} diff --git a/chromium/native_client/src/trusted/perf_counter/BUILD.gn b/chromium/native_client/src/trusted/perf_counter/BUILD.gn new file mode 100644 index 00000000000..ac63a83d9dc --- /dev/null +++ b/chromium/native_client/src/trusted/perf_counter/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autogenerated from src/trusted/perf_counter/build.scons. + +static_library("nacl_perf_counter") { + sources = [ + "nacl_perf_counter.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} diff --git a/chromium/native_client/src/trusted/platform_qualify/BUILD.gn b/chromium/native_client/src/trusted/platform_qualify/BUILD.gn new file mode 100644 index 00000000000..85ce266bad9 --- /dev/null +++ b/chromium/native_client/src/trusted/platform_qualify/BUILD.gn @@ -0,0 +1,74 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autogenerated from src/trusted/platform_qualify/build.scons. + +static_library("platform_qual_lib") { + sources = [] + if (current_os != "win") { + sources += [ "posix/nacl_dep_qualify.c" ] + } + + if (current_cpu != "arm") { + sources += [ "arch/x86/nacl_cpuwhitelist.c" ] + } + + if (current_cpu == "x86") { + sources += [ "arch/x86_32/nacl_dep_qualify_arch.c" ] + } + + if (current_cpu == "x64") { + sources += [ "arch/x86_64/nacl_dep_qualify_arch.c" ] + } + + if (current_cpu == "arm") { + sources += [ + "arch/arm/nacl_dep_qualify_arch.c", + "arch/arm/nacl_qualify_fpu.c", + "arch/arm/nacl_qualify_sandbox_instrs.c", + "arch/arm/nacl_qualify_unaligned.c", + ] + } + + if (current_os == "win") { + sources += [ + "win/nacl_dep_qualify.c", + "win/nacl_os_qualify.c", + ] + } + + if (current_os == "mac") { + sources += [ "osx/nacl_os_qualify.c" ] + } + + if (is_linux) { + sources += [ "linux/nacl_os_qualify.c" ] + } + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/trusted/cpu_features:cpu_features", + ] +} + +if (current_cpu != "arm") { + static_library("vcpuid") { + cflags_c = [] + sources = [ + "arch/x86/vcpuid.c", + ] + + if (current_os == "linux") { + cflags_c += [ "-msse3" ] + } + + if (current_os == "mac") { + cflags_c += [ "-mdynamic-no-pic" ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ] + } +} diff --git a/chromium/native_client/src/trusted/service_runtime/BUILD.gn b/chromium/native_client/src/trusted/service_runtime/BUILD.gn new file mode 100644 index 00000000000..268ca8940de --- /dev/null +++ b/chromium/native_client/src/trusted/service_runtime/BUILD.gn @@ -0,0 +1,355 @@ +# Copyright (c) 2014 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//native_client/src/trusted/asm.gni") + +source_set("sel_main") { + sources = [ + "sel_main.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/trusted/debug_stub:debug_stub", + ":sel", + ] +} + +source_set("sel_main_chrome") { + sources = [ + "sel_main_chrome.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/trusted/debug_stub:debug_stub", + ":sel", + ] +} + +source_set("env_cleanser") { + sources = [ + "env_cleanser.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} + +source_set("nacl_error_code") { + sources = [ + "nacl_error_code.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} + +if (current_toolchain == nacl_asm_toolchain) { + source_set("sel_asm") { + if (current_cpu == "x86") { + sources = [ + "arch/x86_32/nacl_switch_32.S", + "arch/x86_32/nacl_switch_all_regs_asm_32.S", + "arch/x86_32/nacl_syscall_32.S", + "arch/x86_32/springboard.S", + "arch/x86_32/tramp_32.S", + ] + } else if (current_cpu == "x64") { + sources = [ + "arch/x86_64/nacl_switch_64.S", + "arch/x86_64/nacl_syscall_64.S", + "arch/x86_64/tramp_64.S", + ] + if (is_win) { + sources += [ + "arch/x86_64/fnstcw.S", + "arch/x86_64/fxsaverstor.S", + "win/exception_patch/exit_fast.S", + "win/exception_patch/intercept.S", + ] + } + } else if (current_cpu == "arm") { + sources = [ + "arch/arm/nacl_switch.S", + "arch/arm/nacl_syscall.S", + "arch/arm/tramp_arm.S", + ] + } else if (current_cpu == "mipsel") { + sources = [ + "arch/mips/nacl_switch.S", + "arch/mips/nacl_syscall.S", + "arch/mips/tramp_mips.S", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] + } +} + +source_set("sel") { + sources = [ + "dyn_array.c", + "elf_util.c", + "filename_util.cc", + "load_file.c", + "nacl_all_modules.c", + "nacl_app_thread.c", + "nacl_copy.c", + "nacl_desc_effector_ldr.c", + "nacl_error_gio.c", + "nacl_error_log_hook.c", + "nacl_globals.c", + "nacl_resource.c", + "nacl_signal_common.c", + "nacl_stack_safety.c", + "nacl_syscall_common.c", + "nacl_syscall_hook.c", + "nacl_syscall_list.c", + "nacl_text.c", + "nacl_valgrind_hooks.c", + "sel_addrspace.c", + "sel_ldr.c", + "sel_ldr_filename.cc", + "sel_ldr_standard.c", + "sel_main_common.c", + "sel_mem.c", + "sel_qualify.c", + "sel_validate_image.c", + "sys_clock.c", + "sys_exception.c", + "sys_fdio.c", + "sys_filename.c", + "sys_futex.c", + "sys_imc.c", + "sys_list_mappings.c", + "sys_memory.c", + "sys_parallel_io.c", + "sys_random.c", + "thread_suspension_common.c", + "thread_suspension_unwind.c", + ] + + if (is_linux) { + sources += [ "linux/nacl_signal.c" ] + } + + if (is_mac) { + sources += [ + "osx/crash_filter.c", + "osx/mach_exception_handler.c", + "osx/mach_thread_map.c", + "osx/nacl_ldt.c", + "osx/nacl_thread_nice.c", + "osx/thread_suspension.c", + "posix/addrspace_teardown.c", + "posix/sel_memory.c", + "posix/x86/sel_segments.c", + ] + } + + if (is_win) { + sources += [ + "win/addrspace_teardown.c", + "win/debug_exception_handler.c", + "win/debug_exception_handler_standalone.c", + "win/nacl_ldt.c", + "win/nacl_thread_nice.c", + "win/sel_memory.c", + "win/sel_segments.c", + "win/thread_handle_map.c", + ] + } + + if (current_cpu == "arm") { + sources += [ + "arch/arm/nacl_app.c", + "arch/arm/nacl_switch_to_app_arm.c", + "arch/arm/nacl_tls.c", + "arch/arm/sel_addrspace_arm.c", + "arch/arm/sel_ldr_arm.c", + "arch/arm/sel_rt.c", + "linux/nacl_signal_arm.c", + ] + } + + if (current_cpu == "mipsel") { + sources += [ + "arch/mips/nacl_app.c", + "arch/mips/nacl_switch_to_app_mips.c", + "arch/mips/nacl_tls.c", + "arch/mips/sel_addrspace_mips.c", + "arch/mips/sel_ldr_mips.c", + "arch/mips/sel_rt.c", + "linux/nacl_signal_mips.c", + ] + } + + if (is_linux || is_android) { + sources += [ + "linux/nacl_bootstrap_args.c", + "linux/nacl_thread_nice.c", + "linux/r_debug.c", + "linux/reserved_at_zero.c", + "linux/thread_suspension.c", + "posix/addrspace_teardown.c", + "posix/sel_memory.c", + ] + if (current_cpu == "x86" || current_cpu == "x64") { + sources += [ + "linux/x86/nacl_ldt.c", + "posix/x86/sel_segments.c", + ] + } + if (current_cpu == "arm") { + sources += [ "linux/arm/sel_segments.c" ] + } + if (current_cpu == "mipsel") { + sources += [ "linux/mips/sel_segments.c" ] + } + } + + if (is_posix) { + sources += [ + "posix/nacl_signal_stack.c", + "posix/sel_addrspace_posix.c", + ] + } + + if (is_win) { + sources += [ + "win/nacl_signal_stack.c", + "win/sel_addrspace_win.c", + "win/thread_suspension.c", + "win/vm_hole.c", + ] + } else { + sources += [ "generic/vm_hole.c" ] + } + + if (current_cpu == "x86" || current_cpu == "x64") { + sources += [ + "arch/x86/nacl_ldt_x86.c", + ] + } + + if (current_cpu == "x86") { + sources += [ + "arch/x86_32/nacl_app_32.c", + "arch/x86_32/nacl_switch_all_regs_32.c", + "arch/x86_32/nacl_switch_to_app_32.c", + "arch/x86_32/nacl_tls_32.c", + "arch/x86_32/sel_addrspace_x86_32.c", + "arch/x86_32/sel_ldr_x86_32.c", + "arch/x86_32/sel_rt_32.c", + ] + if (is_mac) { + sources += [ "osx/nacl_signal_32.c" ] + } + if (is_linux) { + sources += [ "linux/nacl_signal_32.c" ] + } + if (is_win) { + sources += [ "win/nacl_signal_32.c" ] + } + } + + if (current_cpu == "x64") { + sources += [ + "arch/x86_64/nacl_app_64.c", + "arch/x86_64/nacl_switch_to_app_64.c", + "arch/x86_64/nacl_tls_64.c", + "arch/x86_64/sel_ldr_x86_64.c", + "arch/x86_64/sel_rt_64.c", + ] + if (is_mac) { + sources += [ + "osx/nacl_signal_64.c", + "arch/x86_64/sel_addrspace_posix_x86_64.c", + ] + } + if (is_linux) { + sources += [ + "linux/nacl_signal_64.c", + "arch/x86_64/sel_addrspace_posix_x86_64.c", + ] + } + if (is_win) { + sources += [ + "win/exception_patch/ntdll_patch.c", + "win/nacl_signal_64.c", + # We assemble the .asm assembly file with the Microsoft assembler + # because we need to generate x86-64 Windows unwind info, which the + # GNU assembler we use elsewhere does not support. + "arch/x86_64/nacl_switch_unwind_win.asm", + "arch/x86_64/sel_addrspace_win_x86_64.c", + ] + } + defines = [ "NACL_X86_64_ZERO_BASED_SANDBOX=0" ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ":sel_asm($nacl_asm_toolchain)", + ":nacl_error_code", + ":env_cleanser", + "//native_client/src/trusted/desc:nrd_xfer", + "//native_client/src/trusted/perf_counter:nacl_perf_counter", + "//native_client/src/trusted/nacl_base:nacl_base", + "//native_client/src/shared/imc:imc", + "//native_client/src/trusted/fault_injection:nacl_fault_inject", + "//native_client/src/trusted/interval_multiset:nacl_interval", + "//native_client/src/shared/platform:platform", + "//native_client/src/trusted/platform_qualify:platform_qual_lib", + "//native_client/src/shared/gio:gio", + "//native_client/src/trusted/validator:validation_cache", + "//native_client/src/trusted/validator:validators", + ] + + if (current_os == "mac") { + deps += [ ":nacl_exc" ] + sources += [ "$target_gen_dir/nacl_exc_server.c" ] + } +} + +if (current_os == "mac") { + import("//build/config/mac/mac_sdk.gni") + + action("nacl_exc") { + script = "osx/run_mig.py" + sources = [ + mac_sdk_path + "/usr/include/mach/exc.defs", + ] + outputs = [ + "$target_gen_dir/nacl_exc.h", + "$target_gen_dir/nacl_exc_server.c", + ] + args = rebase_path(sources, root_build_dir) + + rebase_path(outputs, root_build_dir) + } +} + +executable("sel_ldr") { + sources = [ + "nacl_test_injection_main.c", + ] + deps = [ + ":sel_main", + + # All executables must have the sanitizer deps to properly link in + # asan mode (this target will be empty in other cases). + "//build/config/sanitizers:deps", + + "//build/win:default_exe_manifest", + ] + if (is_linux) { + configs -= [ "//build/config:default_libs" ] + libs = [ "rt" ] + ldflags = [ "-pie" ] + } + if (is_linux) { + data_deps = [ + "linux:bootstrap", + ] + } +} diff --git a/chromium/native_client/src/trusted/service_runtime/linux/BUILD.gn b/chromium/native_client/src/trusted/service_runtime/linux/BUILD.gn new file mode 100644 index 00000000000..37cc61fa105 --- /dev/null +++ b/chromium/native_client/src/trusted/service_runtime/linux/BUILD.gn @@ -0,0 +1,169 @@ +# Copyright (c) 2014 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# We use a special toolchain to build nacl_helper_bootstrap. This +# seems a bit excessive for compiling one source file. But it is +# the most reasonable way to instantiate the configs with different +# settings such as use_gold=false. The minimal set of configs used +# for that file (see below) will sometimes try to use the switch +# -gsplit-dwarf under use_gold=true. But without some other configs +# that add a -B option pointing at a custom-built binutils, on some +# builders (e.g. on older bots) Clang will fail with -gsplit-dwarf. +# Fortunately, -gsplit-dwarf is pointless for this build anyway +# since there is just one small file. And we're not actually using +# Gold for the link, so use_gold=true is a false statement and might +# cause other problems. + +here = get_label_info(".", "dir") +bootstrap_toolchain = here + "/toolchain:nacl_bootstrap_" + target_cpu + +if (current_toolchain == bootstrap_toolchain) { + bootstrap_lib_path = "$target_out_dir/libnacl_bootstrap_lib.a" + bootstrap_raw_path = "$target_out_dir/nacl_bootstrap_raw" + bootstrap_exe_path = "$root_out_dir/nacl_helper_bootstrap" + + linker_script_path = rebase_path("nacl_bootstrap.x") + + if (current_cpu == "x64") { + nacl_reserve_top = "0x0" + linker_emulation = "elf_x86_64" + } + if (current_cpu == "x86") { + nacl_reserve_top = "0x40000000" + linker_emulation = "elf_i386" + } + if (current_cpu == "arm") { + nacl_reserve_top = "0x40002000" + linker_emulation = "armelf_linux_eabi" + } + if (current_cpu == "mipsel") { + nacl_reserve_top = "0x40008000" + linker_emulation = "elf32ltsmip" + } + + if (is_android) { + compiler = "g++" + } else if (current_cpu == "arm") { + compiler = "arm-linux-gnueabihf-g++" + } else { + compiler = "g++" + } + + if (target_os == "chromeos" && defined(cros_target_cxx) && + cros_target_cxx != "") { + compiler = cros_target_cxx + } + + static_library("nacl_bootstrap_lib") { + # This code has very specific requirements related to its static + # linking and minimal libc use. It cannot support the normal variety + # of build configs that the rest of the code is built with. So it + # resets the list of configsto empty, and then builds up from scratch + # using only the basics that work here. + configs = [] + configs += [ + "//build/config/compiler:compiler_cpu_abi", + "//build/config/compiler:runtime_library", + "//build/config/compiler:chromium_code", + "//build/config/compiler:default_optimization", + "//build/config/compiler:default_symbols", + ] + + include_dirs = [ "//" ] + + cflags = [ + "-fno-builtin", + # These might be the defaults in the compiler configuration, + # but we want them all disabled for this build. + "-fno-stack-protector", + "-fno-pic", + "-fno-PIC", + "-fno-pie", + "-fno-PIE", + ] + + sources = [ + "nacl_bootstrap.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + ] + } + + action("nacl_bootstrap_raw") { + deps = [ + ":nacl_bootstrap_lib", + ] + script = "ld_bfd.py" + + sources = [ + linker_script_path, + bootstrap_lib_path, + ] + outputs = [ + bootstrap_raw_path, + ] + args = [ + "--compiler", + compiler, + "-m", + linker_emulation, + "--build-id", + + # This program is (almost) entirely + # standalone. It has its own startup code, so + # no crt1.o for it. It is statically linked, + # and on x86 it does not use libc at all. + # However, on ARM it needs a few (safe) things + # from libc. + "-static", + + # On x86-64, the default page size with some linkers is 2M + # rather than the real Linux page size of 4K. And on ARM, the + # default page size is 32K. A larger page size is + # incompatible with our custom linker script's special layout. + # NOTE: It's important that this option come before --script! + "-z", + "max-page-size=0x1000", + + # Link with custom linker script for special + # layout. The script uses the symbol RESERVE_TOP. + "--defsym", + "RESERVE_TOP=" + nacl_reserve_top, + "--script=" + rebase_path(linker_script_path), + "-o", + rebase_path(bootstrap_raw_path), + + "--whole-archive", + rebase_path(bootstrap_lib_path), + "--no-whole-archive", + ] + } + + action("munge_nacl_helper_bootstrap") { + deps = [ + ":nacl_bootstrap_raw", + ] + + script = "nacl_bootstrap_munge_phdr.py" + inputs = [ + bootstrap_raw_path, + ] + outputs = [ + bootstrap_exe_path, + ] + args = rebase_path(inputs + outputs) + } +} else if (is_linux) { + copy("bootstrap") { + bootstrap = ":munge_nacl_helper_bootstrap($bootstrap_toolchain)" + + bootstrap_out_dir = get_label_info(bootstrap, "root_out_dir") + + deps = [ bootstrap ] + sources = [ "$bootstrap_out_dir/nacl_helper_bootstrap" ] + outputs = [ "$root_out_dir/nacl_helper_bootstrap" ] + } +} diff --git a/chromium/native_client/src/trusted/service_runtime/linux/toolchain/BUILD.gn b/chromium/native_client/src/trusted/service_runtime/linux/toolchain/BUILD.gn new file mode 100644 index 00000000000..bbe9e531f88 --- /dev/null +++ b/chromium/native_client/src/trusted/service_runtime/linux/toolchain/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2015 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/toolchain/gcc_toolchain.gni") + +# This toolchain's sole purpose is to compile nacl_helper_bootstrap.c. +# That requires a separate toolchain because that's the most reasonable way +# to instantiate the standard configs in a context where use_gold=false +# and use_debug_fission=false when the main build is using either +# use_gold=true or use_debug_fission=true. See ../BUILD.gn for details. + +template("nacl_bootstrap_toolchain") { + clang_toolchain(target_name) { + toolchain_cpu = invoker.toolchain_cpu + toolchain_os = target_os + use_debug_fission = false + use_gold = false + } +} + +nacl_bootstrap_toolchain("nacl_bootstrap_x64") { + toolchain_cpu = "x64" +} + +nacl_bootstrap_toolchain("nacl_bootstrap_x86") { + toolchain_cpu = "x86" +} + +nacl_bootstrap_toolchain("nacl_bootstrap_arm") { + toolchain_cpu = "arm" +} diff --git a/chromium/native_client/src/trusted/validator/BUILD.gn b/chromium/native_client/src/trusted/validator/BUILD.gn new file mode 100644 index 00000000000..5d253ec745d --- /dev/null +++ b/chromium/native_client/src/trusted/validator/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("validators") { + sources = [ + "validator_init.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] + + if (current_cpu == "arm") { + deps += [ "//native_client/src/trusted/validator_arm:ncvalidate_arm_v2" ] + } + if (current_cpu == "mips") { + deps += [ "//native_client/src/trusted/validator_mips:ncvalidate_mips" ] + } + if (current_cpu == "x86") { + deps += [ "//native_client/src/trusted/validator_ragel:dfa_validate" ] + } + if (current_cpu == "x64") { + deps += [ "//native_client/src/trusted/validator_ragel:dfa_validate" ] + } +} + +static_library("validation_cache") { + sources = [ + "validation_cache.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/platform:platform", + ] +} diff --git a/chromium/native_client/src/trusted/validator/driver/BUILD.gn b/chromium/native_client/src/trusted/validator/driver/BUILD.gn new file mode 100644 index 00000000000..0af4ce3a916 --- /dev/null +++ b/chromium/native_client/src/trusted/validator/driver/BUILD.gn @@ -0,0 +1,37 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Autogenerated from src/trusted/validator/driver/build.scons. + +static_library("elf_load") { + sources = [ + "elf_load.cc", + ] + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/platform:platform", + ] +} +executable("ncval_new") { + sources = [ + "ncval.cc", + ] + + deps = [ + "//build/config/nacl:nacl_base", + + # All executables must have the sanitizer deps to properly link in + # asan mode (this target will be empty in other cases). + "//build/config/sanitizers:deps", + + "//build/win:default_exe_manifest", + ":elf_load", + "//native_client/src/shared/platform:platform", + "//native_client/src/trusted/cpu_features:cpu_features", + "//native_client/src/trusted/validator_arm:arm_validator_core", + "//native_client/src/trusted/validator_arm:arm_validator_reporters", + "//native_client/src/trusted/validator_ragel:rdfa_validator", + ] +} diff --git a/chromium/native_client/src/trusted/validator_arm/BUILD.gn b/chromium/native_client/src/trusted/validator_arm/BUILD.gn new file mode 100644 index 00000000000..9b0839e6a0f --- /dev/null +++ b/chromium/native_client/src/trusted/validator_arm/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Generated from GYP + +static_library("arm_validator_core") { + sources = [ + "address_set.cc", + "inst_classes.cc", + "model.cc", + "arm_helpers.cc", + "validator.cc", + "gen/arm32_decode.cc", + "gen/arm32_decode_actuals_1.cc", + "gen/arm32_decode_actuals_2.cc", + ] + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/trusted/cpu_features:cpu_features", + ] +} + +static_library("ncvalidate_arm_v2") { + sources = [ + "ncvalidate.cc", + ] + deps = [ + "//build/config/nacl:nacl_base", + ":arm_validator_core", + "//native_client/src/trusted/validator:validation_cache", + ] +} + +static_library("arm_validator_reporters") { + sources = [ + "problem_reporter.cc", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} diff --git a/chromium/native_client/src/trusted/validator_ragel/BUILD.gn b/chromium/native_client/src/trusted/validator_ragel/BUILD.gn new file mode 100644 index 00000000000..6b4ac284c0e --- /dev/null +++ b/chromium/native_client/src/trusted/validator_ragel/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# These objects are included in both dfa_validate_x86_xx and rdfa_validator +# libraries, so we have to introduce intermediate scons nodes. +validator32 = "gen/validator_x86_32.c" +validator64 = "gen/validator_x86_64.c" + +if (current_cpu == "x86" || current_cpu == "x64") { + static_library("dfa_validate") { + sources = [ + "validator_features_all.c", + "validator_features_validator.c", + "dfa_validate_common.c", + ] + if (current_cpu == "x86") { + sources += [ + validator32, + "dfa_validate_32.c", + ] + } else { + sources += [ + validator64, + "dfa_validate_64.c", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/trusted/cpu_features:cpu_features", + "//native_client/src/trusted/validator:validation_cache", + "//native_client/src/trusted/validator_x86:nccopy", + ] + } +} + +# Low-level platform-independent interface supporting both 32 and 64 bit, +# used in ncval and in validator_benchmark. +static_library("rdfa_validator") { + sources = [ + validator32, + validator64, + "validator_features_all.c", + "validator_features_validator.c", + ] + defines = [ "VALIDATOR_EXPORT=DLLEXPORT" ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} diff --git a/chromium/native_client/src/trusted/validator_x86/BUILD.gn b/chromium/native_client/src/trusted/validator_x86/BUILD.gn new file mode 100644 index 00000000000..ebfc56dca71 --- /dev/null +++ b/chromium/native_client/src/trusted/validator_x86/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//native_client/src/trusted/asm.gni") + +if (current_cpu == "x86" || current_cpu == "x64") { + if (current_toolchain == nacl_asm_toolchain) { + source_set("nccopy_asm") { + sources = [ + "nccopycode_stores.S", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] + } + } + + source_set("nccopy") { + sources = [ + "nccopycode.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ":nccopy_asm($nacl_asm_toolchain)", + ] + } +} diff --git a/chromium/native_client/src/trusted/win/BUILD.gn b/chromium/native_client/src/trusted/win/BUILD.gn new file mode 100644 index 00000000000..cd52e3954e2 --- /dev/null +++ b/chromium/native_client/src/trusted/win/BUILD.gn @@ -0,0 +1,72 @@ +# Copyright (c) 2015 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/toolchain/toolchain.gni") + +# This is a special toolchain used solely for building GNU/AT&T-syntax +# assembly files on Windows. See src/trusted/asm.gni for more details. + +template("nacl_win_as_toolchain") { + toolchain(target_name) { + tool("asm") { + # For GCC we can just use the C compiler to compile assembly. + win_as_script = + rebase_path("//native_client/tools/win_as.py", root_build_dir) + if (invoker.toolchain_cpu == "x86") { + env = "environment.x86" + win_as_arch = "Win32" + } else { + env = "environment.x64" + win_as_arch = invoker.toolchain_cpu + } + top_srcdir = rebase_path("//", root_build_dir) + rspfile = "{{output}}.rsp" + rspfile_content = "$python_path $win_as_script -a $win_as_arch -p $top_srcdir -o {{output}} {{source}}" + command = "$python_path gyp-win-tool action-wrapper $env $rspfile" + depsformat = "msvc" + description = "GNU ASM {{output}}" + outputs = [ + "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.obj", + ] + } + + # These two are really entirely generic, but have to be repeated in + # each toolchain because GN doesn't allow a template to be used here. + # See //build/toolchain/toolchain.gni for details. + tool("stamp") { + command = stamp_command + description = stamp_description + } + tool("copy") { + command = copy_command + description = copy_description + } + + # This is necessary so that certain .gn files with static_libraries (e.g. + # //build/config/sanitizers/BUILD.gn) can be loaded in the context of this + # toolchain. + tool("alink") { + command = "fake" + outputs = ["fake"] + } + + toolchain_args() { + current_os = "win" + current_cpu = invoker.toolchain_cpu + + # These values need to be passed through unchanged. + host_toolchain = host_toolchain + target_os = target_os + target_cpu = target_cpu + } + } +} + +nacl_win_as_toolchain("nacl_win_as_x86") { + toolchain_cpu = "x86" +} + +nacl_win_as_toolchain("nacl_win_as_x64") { + toolchain_cpu = "x64" +} diff --git a/chromium/native_client/src/untrusted/elf_loader/BUILD.gn b/chromium/native_client/src/untrusted/elf_loader/BUILD.gn new file mode 100644 index 00000000000..f922d2324e8 --- /dev/null +++ b/chromium/native_client/src/untrusted/elf_loader/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2015 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(current_os == "nacl", "This file contains untrusted code only.") + +import("//build/config/nacl/config.gni") + +if (current_cpu != "pnacl" && !is_nacl_glibc) { + executable("elf_loader") { + sources = [ + "elf_loader.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + ] + } +} + +if (is_nacl_glibc) { + # The elf_loader nexe can only be built with the newlib toolchain, + # but it's needed for things built in the glibc toolchain. To + # keep things simpler for users of it, copy it into the glibc + # $root_out_dir and give it the name used in GYP (and expected by + # the SDK's create_nmf.py): elf_loader_<CPU>.nexe. + copy("elf_loader") { + here = get_label_info(".", "dir") + newlib_tc = "//build/toolchain/nacl:clang_newlib_" + current_cpu + elf_loader_label = here + ":elf_loader" + "(" + newlib_tc + ")" + newlib_out_dir = get_label_info(elf_loader_label, "root_out_dir") + deps = [ + elf_loader_label, + ] + sources = [ + newlib_out_dir + "/elf_loader.nexe", + ] + outputs = [ + "$root_out_dir/elf_loader_" + current_cpu + ".nexe", + ] + } +} diff --git a/chromium/native_client/src/untrusted/irt/BUILD.gn b/chromium/native_client/src/untrusted/irt/BUILD.gn new file mode 100644 index 00000000000..da6a0c14f7a --- /dev/null +++ b/chromium/native_client/src/untrusted/irt/BUILD.gn @@ -0,0 +1,61 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("irt_core") { + cflags_c = [ "-std=gnu99" ] + + sources = [ + "irt_core_resource.c", + "irt_entry_core.c", + "irt_pnacl_translator_common.c", + "irt_pnacl_translator_compile.c", + "irt_pnacl_translator_link.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ":irt_core_lib", + ] +} + +static_library("irt_core_lib") { + cflags_c = [ "-std=c99" ] + + sources = [ + "../../untrusted/pthread/nc_condvar.c", + "../../untrusted/pthread/nc_mutex.c", + "../../untrusted/nacl/sys_private.c", + "../../untrusted/valgrind/dynamic_annotations.c", + "irt_basic.c", + "irt_blockhook.c", + "irt_clock.c", + "irt_code_data_alloc.c", + "irt_cond.c", + "irt_dev_getpid.c", + "irt_dev_list_mappings.c", + "irt_dyncode.c", + "irt_entry.c", + "irt_exception_handling.c", + "irt_fdio.c", + "irt_filename.c", + "irt_futex.c", + "irt_interfaces.c", + "irt_malloc.c", + "irt_memory.c", + "irt_mutex.c", + "irt_private_pthread.c", + "irt_private_tls.c", + "irt_query_list.c", + "irt_random.c", + "irt_sem.c", + "irt_thread.c", + "irt_tls.c", + ] + + deps = [ + "//build/config/nacl:nacl_base", + "//native_client/src/shared/gio:gio", + "//native_client/src/shared/platform:platform", + "//native_client/src/untrusted/nacl:imc_syscalls", + ] +} diff --git a/chromium/native_client/src/untrusted/nacl/BUILD.gn b/chromium/native_client/src/untrusted/nacl/BUILD.gn new file mode 100644 index 00000000000..aaa4c907c9a --- /dev/null +++ b/chromium/native_client/src/untrusted/nacl/BUILD.gn @@ -0,0 +1,449 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(current_os == "nacl", "This file contains untrusted code only.") + +static_library("nacl_dyncode_private") { + cflags_c = [] + sources = [ + "dyncode_private.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl_random_private") { + cflags_c = [] + sources = [ + "irt_random", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl_sys_private") { + cflags_c = [] + sources = [ + "null.c", + "sysbrk.c", + ] + + if (current_os != "glibc") { + sources += [ + "None", + "private_blockhook", + ] + } + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("imc_syscalls") { + cflags_c = [] + sources = [ + "imc_accept.c", + "imc_connect.c", + "imc_makeboundsock.c", + "imc_mem_obj_create.c", + "imc_recvmsg.c", + "imc_sendmsg.c", + "imc_socketpair.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl_exception_private") { + cflags_c = [] + sources = [ + "nacl_exception_private.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl_list_mappings_private") { + cflags_c = [] + sources = [ + "list_mappings_private.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl_dyncode") { + cflags_c = [] + sources = [ + "dyncode.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl") { + cflags_c = [ "-std=c99" ] + sources = [ + "gc_hooks.c", + "nacl_irt.c", + "nacl_irt_init.c", + "nacl_random.c", + "nacl_tls_get.c", + "nacl_tls_init.c", + ] + + if (current_os != "glibc") { + sources += [ + "_exit.c", + "abort.c", + "access.c", + "chdir.c", + "chmod.c", + "clock.c", + "clock_getres.c", + "clock_gettime.c", + "close.c", + "dup.c", + "eaccess.c", + "fchdir.c", + "fchmod.c", + "fdatasync.c", + "fstat.c", + "fsync.c", + "ftruncate.c", + "getcwd.c", + "getcwd_without_malloc.c", + "getdents.c", + "gethostname.c", + "getpagesize.c", + "getpid.c", + "gettimeofday.c", + "htonl.c", + "htons.c", + "isatty.c", + "link.c", + "lock.c", + "lseek.c", + "lstat.c", + "malloc.c", + "mkdir.c", + "mmap.c", + "mprotect.c", + "munmap.c", + "nacl_add_tp.c", + "nacl_ext_supply.c", + "nacl_interface_query.c", + "nacl_irt_fdio.c", + "nacl_irt_filename.c", + "nacl_read_tp.c", + "nanosleep.c", + "ntohl.c", + "ntohs.c", + "open.c", + "pthread_initialize_minimal.c", + "pthread_stubs.c", + "random.c", + "read.c", + "readlink.c", + "rename.c", + "rmdir.c", + "sbrk.c", + "sched_yield.c", + "sigblock.c", + "siggetmask.c", + "sigmask.c", + "sigprocmask.c", + "sigsetmask.c", + "srandom.c", + "stacktrace.c", + "start.c", + "stat.c", + "stubs/_execve.c", + "stubs/accept.c", + "stubs/addmntent.c", + "stubs/bind.c", + "stubs/chown.c", + "stubs/closelog.c", + "stubs/connect.c", + "stubs/endgrent.c", + "stubs/endmntent.c", + "stubs/endpwent.c", + "stubs/environ.c", + "stubs/execvpe.c", + "stubs/fchown.c", + "stubs/fcntl.c", + "stubs/fork.c", + "stubs/freeaddrinfo.c", + "stubs/fstatvfs.c", + "stubs/gai_strerror.c", + "stubs/get_current_dir_name.c", + "stubs/getaddrinfo.c", + "stubs/getdtablesize.c", + "stubs/getegid.c", + "stubs/geteuid.c", + "stubs/getgid.c", + "stubs/getgrent.c", + "stubs/getgrgid.c", + "stubs/getgrgid_r.c", + "stubs/getgrnam.c", + "stubs/getgroups.c", + "stubs/gethostbyaddr.c", + "stubs/gethostbyname.c", + "stubs/getlogin.c", + "stubs/getmntent.c", + "stubs/getnameinfo.c", + "stubs/getpeername.c", + "stubs/getpgrp.c", + "stubs/getppid.c", + "stubs/getpwent.c", + "stubs/getpwnam.c", + "stubs/getpwnam_r.c", + "stubs/getpwuid.c", + "stubs/getpwuid_r.c", + "stubs/getrlimit.c", + "stubs/getrusage.c", + "stubs/getservbyname.c", + "stubs/getservbyport.c", + "stubs/getsockname.c", + "stubs/getsockopt.c", + "stubs/getuid.c", + "stubs/getwd.c", + "stubs/hasmntopt.c", + "stubs/if_freenameindex.c", + "stubs/if_indextoname.c", + "stubs/if_nameindex.c", + "stubs/if_nametoindex.c", + "stubs/inet_ntoa.c", + "stubs/inet_ntop.c", + "stubs/initgroups.c", + "stubs/ioctl.c", + "stubs/issetugid.c", + "stubs/kill.c", + "stubs/lchown.c", + "stubs/listen.c", + "stubs/llseek.c", + "stubs/major.c", + "stubs/makedev.c", + "stubs/minor.c", + "stubs/mkfifo.c", + "stubs/mknod.c", + "stubs/msync.c", + "stubs/openlog.c", + "stubs/pipe.c", + "stubs/poll.c", + "stubs/pselect.c", + "stubs/pthread_sigmask.c", + "stubs/readv.c", + "stubs/recv.c", + "stubs/recvfrom.c", + "stubs/recvmsg.c", + "stubs/sched_get_priority_max.c", + "stubs/sched_get_priority_min.c", + "stubs/sched_setparam.c", + "stubs/sched_setscheduler.c", + "stubs/select.c", + "stubs/send.c", + "stubs/sendmsg.c", + "stubs/sendto.c", + "stubs/setegid.c", + "stubs/seteuid.c", + "stubs/setgid.c", + "stubs/setgrent.c", + "stubs/setgroups.c", + "stubs/setmntent.c", + "stubs/setpgid.c", + "stubs/setpwent.c", + "stubs/setrlimit.c", + "stubs/setsid.c", + "stubs/setsockopt.c", + "stubs/settimeofday.c", + "stubs/setuid.c", + "stubs/shutdown.c", + "stubs/sigaction.c", + "stubs/signal.c", + "stubs/sigsuspend.c", + "stubs/sigvec.c", + "stubs/socket.c", + "stubs/socketpair.c", + "stubs/statvfs.c", + "stubs/syslog.c", + "stubs/tcdrain.c", + "stubs/tcflow.c", + "stubs/tcflush.c", + "stubs/tcgetattr.c", + "stubs/tcsendbreak.c", + "stubs/tcsetattr.c", + "stubs/times.c", + "stubs/ttyname.c", + "stubs/ttyname_r.c", + "stubs/umask.c", + "stubs/vfork.c", + "stubs/wait.c", + "stubs/waitpid.c", + "symlink.c", + "sysconf.c", + "tls.c", + "truncate.c", + "uname.c", + "unlink.c", + "utime.c", + "utimes.c", + "write.c", + ] + } + + if (current_os != "glibc" && current_cpu == "arm") { + sources += [ "aeabi_read_tp.S" ] + } + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ] +} + +source_set("irt_random") { + cflags_c = [] + sources = [ + "../../untrusted/irt/irt_random.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl_exception") { + cflags_c = [] + sources = [ + "nacl_exception.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ] +} +static_library("nacl_list_mappings") { + cflags_c = [] + sources = [ + "list_mappings.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ] +} + +if (current_os != "glibc") { + source_set("sys_private") { + cflags_c = [] + sources = [ + "sys_private.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ] + } + source_set("gc_hooks_private") { + cflags_c = [] + sources = [ + "gc_hooks_private.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + deps = [ + "//build/config/nacl:nacl_base", + ] + } + source_set("private_blockhook") { + cflags_c = [] + sources = [ + "../../untrusted/irt/irt_blockhook.c", + ] + + if (current_cpu == "pnacl") { + cflags_c += [ + "-Wno-self-assign", + ] + } + + deps = [ + "//build/config/nacl:nacl_base", + ] + } +} diff --git a/chromium/native_client/src/untrusted/pthread/BUILD.gn b/chromium/native_client/src/untrusted/pthread/BUILD.gn new file mode 100644 index 00000000000..013f129db6c --- /dev/null +++ b/chromium/native_client/src/untrusted/pthread/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright (c) 2014 The Native ClientAuthors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("pthread") { + cflags_c = [ "-std=c99" ] + sources = [ + "nc_thread.c", + "nc_mutex.c", + "nc_condvar.c", + "nc_rwlock.c", + "nc_semaphore.c", + "nc_init_irt.c", + "stack_end.c", + "../valgrind/dynamic_annotations.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} diff --git a/chromium/native_client/tests/BUILD.gn b/chromium/native_client/tests/BUILD.gn new file mode 100644 index 00000000000..de1abb24dad --- /dev/null +++ b/chromium/native_client/tests/BUILD.gn @@ -0,0 +1,33 @@ +# Copyright 2016 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//native_client/tests/test.gni") + +source_set("test_utils") { + testonly = true + sources = [ + "test_runner.cc", + ] + deps = [ + "//testing/gtest", + ] +} + +test("small_tests") { + deps = [ + ":test_utils", + ] +} + +test("medium_tests") { + deps = [ + ":test_utils", + ] +} + +test("large_tests") { + deps = [ + ":test_utils", + ] +} diff --git a/chromium/native_client/tests/hello_world/BUILD.gn b/chromium/native_client/tests/hello_world/BUILD.gn new file mode 100644 index 00000000000..27c58999842 --- /dev/null +++ b/chromium/native_client/tests/hello_world/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright (c) 2014 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("hello_world") { + sources = [ + "hello_world.c", + ] + deps = [ + "//build/config/nacl:nacl_base", + ] +} diff --git a/chromium/native_client/tests/test.gni b/chromium/native_client/tests/test.gni new file mode 100644 index 00000000000..8e75e9b876c --- /dev/null +++ b/chromium/native_client/tests/test.gni @@ -0,0 +1,11 @@ +# Copyright 2016 The Native Client Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Define a test as an executable. +template("test") { + executable(target_name) { + forward_variables_from(invoker, "*") + testonly = true + } +} diff --git a/chromium/native_client_sdk/src/BUILD.gn b/chromium/native_client_sdk/src/BUILD.gn new file mode 100644 index 00000000000..9b33bed569c --- /dev/null +++ b/chromium/native_client_sdk/src/BUILD.gn @@ -0,0 +1,65 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +declare_args() { + # Set to true if cross compiling trusted (e.g. building sel_ldr_arm on x86) + # binaries is supported. + enable_cross_trusted = is_linux + + # Build the nacl SDK untrusted components. This is disabled by default since + # not all NaCl untrusted compilers are in goma (e.g arm-nacl-glibc) + nacl_sdk_untrusted = false +} + +if (enable_nacl) { + group("nacl_core_sdk") { + # Targets that get included in the NaCl SDK + # See: native_client_sdk/src/build_tools/build_sdk.py + deps = [] + if (enable_cross_trusted || + (target_cpu != "arm" && target_cpu != "mipsel")) { + # cross compiling trusted binaries such as sel_ldr is only currently + # supported on linux, and requires specific cross compilers to be + # installed. It can be disabled with 'disable_cross_trusted=1' + deps = [ + "//native_client/src/trusted/service_runtime:sel_ldr", + "//native_client/src/trusted/validator/driver:ncval_new", + ] + if (is_linux) { + deps += [ "//native_client/src/nonsfi/loader:nonsfi_loader" ] + } + } + if (nacl_sdk_untrusted) { + deps += [ + # elf_loader is only used on ARM + "//native_client/src/untrusted/elf_loader:elf_loader(//build/toolchain/nacl:clang_newlib_arm)", + "//native_client/src/untrusted/irt:irt_core(//build/toolchain/nacl:irt_arm)", + "//native_client/src/untrusted/irt:irt_core(//build/toolchain/nacl:irt_x64)", + "//native_client/src/untrusted/irt:irt_core(//build/toolchain/nacl:irt_x86)", + "//ppapi/native_client:ppapi_lib(//build/toolchain/nacl:clang_newlib_arm)", + "//ppapi/native_client:ppapi_lib(//build/toolchain/nacl:clang_newlib_x64)", + "//ppapi/native_client:ppapi_lib(//build/toolchain/nacl:clang_newlib_x86)", + "//ppapi/native_client:ppapi_lib(//build/toolchain/nacl:glibc_arm)", + "//ppapi/native_client:ppapi_lib(//build/toolchain/nacl:glibc_x64)", + "//ppapi/native_client:ppapi_lib(//build/toolchain/nacl:glibc_x86)", + "//ppapi/native_client:ppapi_lib(//build/toolchain/nacl:newlib_pnacl)", + "//ppapi/native_client/src/untrusted/pnacl_irt_shim:aot(//build/toolchain/nacl:clang_newlib_arm)", + "//ppapi/native_client/src/untrusted/pnacl_irt_shim:aot(//build/toolchain/nacl:clang_newlib_x64)", + "//ppapi/native_client/src/untrusted/pnacl_irt_shim:aot(//build/toolchain/nacl:clang_newlib_x86)", + ] + } + + # TODO(binji): dump_syms doesn't currently build on Windows. See + # http://crbug.com/245456 + if (!is_win && target_cpu == "x64") { + deps += [ + "//breakpad:dump_syms($host_toolchain)", + "//breakpad:minidump_dump($host_toolchain)", + "//breakpad:minidump_stackwalk($host_toolchain)", + ] + } + } +} diff --git a/chromium/native_client_sdk/src/libraries/nacl_io/BUILD.gn b/chromium/native_client_sdk/src/libraries/nacl_io/BUILD.gn new file mode 100644 index 00000000000..7b401f82f57 --- /dev/null +++ b/chromium/native_client_sdk/src/libraries/nacl_io/BUILD.gn @@ -0,0 +1,156 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_nacl, + "These targets must only be built using the untrusted NaCl toolchains.") + +config("nacl_io_config") { + cflags = [ "-Wno-sign-compare" ] +} + +config("nacl_io_include_dirs") { + include_dirs = [ + "..", + "include", + "../third_party/newlib-extras", + ] +} + +source_set("nacl_io") { + sources = [ + "devfs/dev_fs.cc", + "devfs/jspipe_event_emitter.cc", + "devfs/jspipe_node.cc", + "devfs/tty_node.cc", + "dir_node.cc", + "event_emitter.cc", + "event_listener.cc", + "fifo_char.cc", + "filesystem.cc", + "fusefs/fuse_fs.cc", + "fusefs/fuse_fs_factory.cc", + "getdents_helper.cc", + "h_errno.c", + "host_resolver.cc", + "html5fs/html5_fs.cc", + "html5fs/html5_fs_node.cc", + "httpfs/http_fs.cc", + "httpfs/http_fs_node.cc", + "in6_addr.c", + "jsfs/js_fs.cc", + "jsfs/js_fs_node.cc", + "kernel_handle.cc", + "kernel_intercept.cc", + "kernel_object.cc", + "kernel_proxy.cc", + "kernel_wrap_dummy.cc", + "kernel_wrap_glibc.cc", + "kernel_wrap_irt_ext.c", + "kernel_wrap_newlib.cc", + "kernel_wrap_win.cc", + "log.c", + "memfs/mem_fs.cc", + "memfs/mem_fs_node.cc", + "nacl_io.cc", + "node.cc", + "passthroughfs/passthrough_fs.cc", + "passthroughfs/real_node.cc", + "path.cc", + "pepper_interface.cc", + "pepper_interface_delegate.cc", + "pipe/pipe_event_emitter.cc", + "pipe/pipe_node.cc", + "real_pepper_interface.cc", + "socket/fifo_packet.cc", + "socket/packet.cc", + "socket/socket_node.cc", + "socket/tcp_event_emitter.cc", + "socket/tcp_node.cc", + "socket/udp_event_emitter.cc", + "socket/udp_node.cc", + "socket/unix_event_emitter.cc", + "socket/unix_node.cc", + "stream/stream_event_emitter.cc", + "stream/stream_fs.cc", + "stream/stream_node.cc", + "syscalls/access.c", + "syscalls/chown.c", + "syscalls/fchown.c", + "syscalls/fcntl.c", + "syscalls/ftruncate.c", + "syscalls/futimes.c", + "syscalls/getwd.c", + "syscalls/ioctl.c", + "syscalls/isatty.c", + "syscalls/kill.c", + "syscalls/killpg.c", + "syscalls/lchown.c", + "syscalls/mount.c", + "syscalls/pipe.c", + "syscalls/poll.c", + "syscalls/realpath.c", + "syscalls/select.c", + "syscalls/sigaction.c", + "syscalls/signal.c", + "syscalls/sigpause.c", + "syscalls/sigpending.c", + "syscalls/sigset.c", + "syscalls/sigsuspend.c", + "syscalls/socket/accept.c", + "syscalls/socket/bind.c", + "syscalls/socket/connect.c", + "syscalls/socket/freeaddrinfo.c", + "syscalls/socket/gai_strerror.c", + "syscalls/socket/getaddrinfo.c", + "syscalls/socket/gethostbyname.c", + "syscalls/socket/getnameinfo.c", + "syscalls/socket/getpeername.c", + "syscalls/socket/getsockname.c", + "syscalls/socket/getsockopt.c", + "syscalls/socket/herror.c", + "syscalls/socket/hstrerror.c", + "syscalls/socket/htonl.c", + "syscalls/socket/htons.c", + "syscalls/socket/inet_addr.c", + "syscalls/socket/inet_aton.c", + "syscalls/socket/inet_ntoa.c", + "syscalls/socket/inet_ntop.cc", + "syscalls/socket/inet_pton.c", + "syscalls/socket/listen.c", + "syscalls/socket/ntohl.c", + "syscalls/socket/ntohs.c", + "syscalls/socket/recv.c", + "syscalls/socket/recvfrom.c", + "syscalls/socket/recvmsg.c", + "syscalls/socket/send.c", + "syscalls/socket/sendmsg.c", + "syscalls/socket/sendto.c", + "syscalls/socket/setsockopt.c", + "syscalls/socket/shutdown.c", + "syscalls/socket/socket.c", + "syscalls/socket/socketpair.c", + "syscalls/symlink.c", + "syscalls/termios/cfgetispeed.c", + "syscalls/termios/cfgetospeed.c", + "syscalls/termios/cfsetispeed.c", + "syscalls/termios/cfsetospeed.c", + "syscalls/termios/cfsetspeed.c", + "syscalls/termios/tcdrain.c", + "syscalls/termios/tcflow.c", + "syscalls/termios/tcflush.c", + "syscalls/termios/tcgetattr.c", + "syscalls/termios/tcsendbreak.c", + "syscalls/termios/tcsetattr.c", + "syscalls/truncate.c", + "syscalls/umask.c", + "syscalls/umount.c", + "syscalls/uname.c", + "syscalls/utime.c", + ] + + include_dirs = [ ".." ] + configs += [ ":nacl_io_config" ] + + public_configs = [ ":nacl_io_include_dirs" ] +} diff --git a/chromium/ppapi/tests/extensions/BUILD.gn b/chromium/ppapi/tests/extensions/BUILD.gn new file mode 100644 index 00000000000..3d700654149 --- /dev/null +++ b/chromium/ppapi/tests/extensions/BUILD.gn @@ -0,0 +1,293 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/nacl/config.gni") +import("//ppapi/native_client/nacl_test_data.gni") + +group("extensions") { + newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}" + pnacl = "//build/toolchain/nacl:newlib_pnacl" + data_deps = [ + ":ppapi_tests_extensions_background_keepalive($newlib)", + ":ppapi_tests_extensions_load_unload($newlib)", + ":ppapi_tests_extensions_media_galleries($newlib)", + ":ppapi_tests_extensions_multicast_permissions($newlib)", + ":ppapi_tests_extensions_no_socket_permissions($newlib)", + ":ppapi_tests_extensions_packaged_app($newlib)", + ":ppapi_tests_extensions_packaged_app($pnacl)", + ":ppapi_tests_extensions_popup($newlib)", + ":ppapi_tests_extensions_socket_permissions($newlib)", + ] + if ((target_cpu == "x86" || target_cpu == "x64") && is_linux) { + nonsfi = "//build/toolchain/nacl:newlib_pnacl_nonsfi" + data_deps += [ ":ppapi_tests_extensions_packaged_app($nonsfi)" ] + } +} + +if (is_nacl && !is_nacl_nonsfi) { + nacl_test_data("ppapi_tests_extensions_background_keepalive") { + sources = [ + "background_keepalive/background.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/background_keepalive" + test_files = [ + "background_keepalive/background.js", + "background_keepalive/manifest.json", + ] + } + + nacl_test_data("ppapi_tests_extensions_load_unload") { + sources = [ + "load_unload/load_unload.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/load_unload" + test_files = [ + "load_unload/background.js", + "load_unload/ext_icon.png", + "load_unload/manifest.json", + ] + } + + nacl_test_data("ppapi_tests_extensions_media_galleries") { + sources = [ + "//ppapi/tests/test_utils.cc", + "//ppapi/tests/test_utils.h", + "media_galleries/test_galleries.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/media_galleries" + test_files = [ + "media_galleries/background.js", + "media_galleries/index.html", + "media_galleries/manifest.json", + "media_galleries/test.js", + ] + } + + nacl_test_data("ppapi_tests_extensions_multicast_permissions") { + sources = [ + "multicast_permissions/test_multicast_permissions.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/multicast_permissions" + test_files = [ + "multicast_permissions/controller.js", + "multicast_permissions/index.html", + "multicast_permissions/main.js", + "multicast_permissions/manifest.json", + ] + } + + nacl_test_data("ppapi_tests_extensions_no_socket_permissions") { + sources = [ + "no_socket_permissions/test_no_socket_permissions.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/no_socket_permissions" + test_files = [ + "no_socket_permissions/controller.js", + "no_socket_permissions/index.html", + "no_socket_permissions/main.js", + "no_socket_permissions/manifest.json", + ] + } + + nacl_test_data("ppapi_tests_extensions_popup") { + sources = [ + "popup/module.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/popup" + test_files = [ + "popup/background.js", + "popup/popup.html", + "popup/popup.js", + "popup/manifest.json", + ] + } + + nacl_test_data("ppapi_tests_extensions_socket_permissions") { + sources = [ + "socket_permissions/test_socket_permissions.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/socket_permissions" + test_files = [ + "socket_permissions/controller.js", + "socket_permissions/index.html", + "socket_permissions/main.js", + "socket_permissions/manifest.json", + ] + } +} + +if (is_nacl) { + nacl_test_data("ppapi_tests_extensions_packaged_app") { + sources = [ + "packaged_app/test_packaged_app.cc", + ] + deps = [ + "//ppapi:ppapi_cpp_lib", + ] + destination_dir = "test_data/ppapi/tests/extensions/packaged_app" + test_files = [ + "packaged_app/controller.js", + "packaged_app/index.html", + "packaged_app/main.js", + "packaged_app/manifest.json", + "packaged_app/test_file.txt", + "packaged_app/test_file2.txt", + ] + nmfflags = [ + # Add 129 "files" entries to make sure that open_resource can handle + # more files than IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage + # which is currently 128. + "-xtest_file0:test_file.txt", + "-xtest_file1:test_file2.txt", + "-xtest_file2:test_file.txt", + "-xtest_file3:test_file2.txt", + "-xtest_file4:test_file.txt", + "-xtest_file5:test_file2.txt", + "-xtest_file6:test_file.txt", + "-xtest_file7:test_file2.txt", + "-xtest_file8:test_file.txt", + "-xtest_file9:test_file2.txt", + "-xtest_file10:test_file.txt", + "-xtest_file11:test_file2.txt", + "-xtest_file12:test_file.txt", + "-xtest_file13:test_file2.txt", + "-xtest_file14:test_file.txt", + "-xtest_file15:test_file2.txt", + "-xtest_file16:test_file.txt", + "-xtest_file17:test_file2.txt", + "-xtest_file18:test_file.txt", + "-xtest_file19:test_file2.txt", + "-xtest_file20:test_file.txt", + "-xtest_file21:test_file2.txt", + "-xtest_file22:test_file.txt", + "-xtest_file23:test_file2.txt", + "-xtest_file24:test_file.txt", + "-xtest_file25:test_file2.txt", + "-xtest_file26:test_file.txt", + "-xtest_file27:test_file2.txt", + "-xtest_file28:test_file.txt", + "-xtest_file29:test_file2.txt", + "-xtest_file30:test_file.txt", + "-xtest_file31:test_file2.txt", + "-xtest_file32:test_file.txt", + "-xtest_file33:test_file2.txt", + "-xtest_file34:test_file.txt", + "-xtest_file35:test_file2.txt", + "-xtest_file36:test_file.txt", + "-xtest_file37:test_file2.txt", + "-xtest_file38:test_file.txt", + "-xtest_file39:test_file2.txt", + "-xtest_file40:test_file.txt", + "-xtest_file41:test_file2.txt", + "-xtest_file42:test_file.txt", + "-xtest_file43:test_file2.txt", + "-xtest_file44:test_file.txt", + "-xtest_file45:test_file2.txt", + "-xtest_file46:test_file.txt", + "-xtest_file47:test_file2.txt", + "-xtest_file48:test_file.txt", + "-xtest_file49:test_file2.txt", + "-xtest_file50:test_file.txt", + "-xtest_file51:test_file2.txt", + "-xtest_file52:test_file.txt", + "-xtest_file53:test_file2.txt", + "-xtest_file54:test_file.txt", + "-xtest_file55:test_file2.txt", + "-xtest_file56:test_file.txt", + "-xtest_file57:test_file2.txt", + "-xtest_file58:test_file.txt", + "-xtest_file59:test_file2.txt", + "-xtest_file60:test_file.txt", + "-xtest_file61:test_file2.txt", + "-xtest_file62:test_file.txt", + "-xtest_file63:test_file2.txt", + "-xtest_file64:test_file.txt", + "-xtest_file65:test_file2.txt", + "-xtest_file66:test_file.txt", + "-xtest_file67:test_file2.txt", + "-xtest_file68:test_file.txt", + "-xtest_file69:test_file2.txt", + "-xtest_file70:test_file.txt", + "-xtest_file71:test_file2.txt", + "-xtest_file72:test_file.txt", + "-xtest_file73:test_file2.txt", + "-xtest_file74:test_file.txt", + "-xtest_file75:test_file2.txt", + "-xtest_file76:test_file.txt", + "-xtest_file77:test_file2.txt", + "-xtest_file78:test_file.txt", + "-xtest_file79:test_file2.txt", + "-xtest_file80:test_file.txt", + "-xtest_file81:test_file2.txt", + "-xtest_file82:test_file.txt", + "-xtest_file83:test_file2.txt", + "-xtest_file84:test_file.txt", + "-xtest_file85:test_file2.txt", + "-xtest_file86:test_file.txt", + "-xtest_file87:test_file2.txt", + "-xtest_file88:test_file.txt", + "-xtest_file89:test_file2.txt", + "-xtest_file90:test_file.txt", + "-xtest_file91:test_file2.txt", + "-xtest_file92:test_file.txt", + "-xtest_file93:test_file2.txt", + "-xtest_file94:test_file.txt", + "-xtest_file95:test_file2.txt", + "-xtest_file96:test_file.txt", + "-xtest_file97:test_file2.txt", + "-xtest_file98:test_file.txt", + "-xtest_file99:test_file2.txt", + "-xtest_file100:test_file.txt", + "-xtest_file101:test_file2.txt", + "-xtest_file102:test_file.txt", + "-xtest_file103:test_file2.txt", + "-xtest_file104:test_file.txt", + "-xtest_file105:test_file2.txt", + "-xtest_file106:test_file.txt", + "-xtest_file107:test_file2.txt", + "-xtest_file108:test_file.txt", + "-xtest_file109:test_file2.txt", + "-xtest_file110:test_file.txt", + "-xtest_file111:test_file2.txt", + "-xtest_file112:test_file.txt", + "-xtest_file113:test_file2.txt", + "-xtest_file114:test_file.txt", + "-xtest_file115:test_file2.txt", + "-xtest_file116:test_file.txt", + "-xtest_file117:test_file2.txt", + "-xtest_file118:test_file.txt", + "-xtest_file119:test_file2.txt", + "-xtest_file120:test_file.txt", + "-xtest_file121:test_file2.txt", + "-xtest_file122:test_file.txt", + "-xtest_file123:test_file2.txt", + "-xtest_file124:test_file.txt", + "-xtest_file125:test_file2.txt", + "-xtest_file126:test_file.txt", + "-xtest_file127:test_file2.txt", + "-xtest_file128:test_file.txt", + ] + } +} diff --git a/chromium/remoting/BUILD.gn b/chromium/remoting/BUILD.gn new file mode 100644 index 00000000000..010ac717e45 --- /dev/null +++ b/chromium/remoting/BUILD.gn @@ -0,0 +1,227 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//build/util/version.gni") +import("//remoting/remoting_enable.gni") +import("//remoting/remoting_options.gni") +import("//remoting/remoting_version.gni") +import("//testing/test.gni") + +# TODO(nicholss): Move this and other defines to version.h.in. +# Various remoting targets need this version definition. +config("version") { + defines = [ "VERSION=$chrome_version_full" ] +} + +config("enable_webrtc_remoting_client") { + if (!is_official_build && !is_nacl) { + defines = [ "ENABLE_WEBRTC_REMOTING_CLIENT=1" ] + } +} + +group("remoting_all") { + testonly = true + + deps = [ + "//remoting:remoting_unittests", + "//remoting/test:chromoting_test_driver", + "//remoting/webapp:browser_test_resources", + "//remoting/webapp:unit_tests", + ] + + if ((is_linux && !is_chromeos) || is_win || is_mac) { + deps += [ "//remoting/webapp" ] + } + + if (is_win) { + deps += [ + "//remoting:remoting_breakpad_tester", + "//remoting/host:remoting_console", + "//remoting/host:remoting_desktop", + ] + + if (is_chrome_branded) { + deps += [ "//remoting/host:remoting_host_installation" ] + } + } + + if (is_android) { + deps += [ + "//remoting/android:remoting_apk", + "//remoting/android:remoting_test_apk", + ] + } + + if (enable_remoting_host) { + deps += [ + "//remoting:remoting_perftests", + "//remoting/host", + ] + + if (!is_chromeos && !is_android) { + deps += [ + "//remoting/host:remoting_native_messaging_manifests", + "//remoting/host:remoting_start_host", + "//remoting/host/it2me:remote_assistance_host", + ] + } + + # The same target is called differently on Linux. + # TODO(sergeyu): Rename it to remoting_native_messaging_host on all + # platforms. + if (is_win) { + deps += [ "//remoting/host:remoting_native_messaging_host" ] + } else if (!is_chromeos && !is_android) { + deps += [ "//remoting/host:native_messaging_host" ] + } + + if (is_linux && !is_chromeos) { + deps += [ "//remoting/host:remoting_dev_me2me_host" ] + } + } + + if (enable_me2me_host) { + deps += [ "//remoting/host:remoting_me2me_host" ] + if (is_chrome_branded) { + deps += [ "//remoting/host:remoting_me2me_host_archive" ] + } + } + + if (enable_nacl) { + deps += [ "//remoting/tools/javascript_key_tester" ] + } +} + +if (is_win) { + # GYP version: remoting/remoting_host_win.gypi:remoting_breakpad_tester + executable("remoting_breakpad_tester") { + deps = [ + "//base", + "//build/win:default_exe_manifest", + "//remoting/host", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + sources = [ + "tools/breakpad_tester_win.cc", + ] + } +} + +# GYP version: remoting/remoting_test.gypi:remoting_test_support +source_set("test_support") { + testonly = true + + deps = [ + "//base", + "//net", + "//remoting/base", + "//remoting/client", + "//remoting/codec", + "//remoting/protocol:test_support", + "//remoting/resources", + "//remoting/signaling:test_support", + "//remoting/test:test_support", + "//testing/gmock", + "//testing/gtest", + ] + + if (enable_configuration_policy) { + deps += [ + "//components/policy:test_support", + + # TODO(zijiehe): This should belong to //components/policy:test_support + "//components/prefs", + ] + } + + if (enable_remoting_host) { + deps += [ "//remoting/host:test_support" ] + } +} + +test("remoting_unittests") { + defines = [] + libs = [] + + configs += [ + ":version", + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "//build/config/compiler:no_size_t_to_int_warning", + ] + + deps = [ + ":test_support", + "//base", + "//google_apis", + "//remoting/base:unit_tests", + "//remoting/client:unit_tests", + "//remoting/protocol:unit_tests", + "//remoting/signaling:unit_tests", + "//remoting/test:unit_tests", + "//testing/gmock", + "//testing/gtest", + "//third_party/webrtc", + ] + + if (enable_remoting_host) { + deps += [ + "//remoting/codec:unit_tests", + "//remoting/host:unit_tests", + "//ui/gfx", + ] + } + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } + + if (is_android) { + deps += [ "//net/android:net_java" ] + } + + if (is_win) { + defines += [ "_ALT_NO_EXCEPTIONS" ] + + libs += [ + "rpcrt4.lib", + "wtsapi32.lib", + ] + } + + if (enable_configuration_policy) { + deps += [ "//components/policy:policy_component_test_support" ] + } +} + +if (enable_remoting_host) { + test("remoting_perftests") { + sources = [ + "test/codec_perftest.cc", + "test/protocol_perftest.cc", + ] + + configs += [ ":version" ] + + deps = [ + ":test_support", + "//base", + "//base/test:run_all_unittests", + "//base/test:test_support", + "//net:test_support", + "//remoting/base", + "//testing/gtest", + "//third_party/libjingle", + "//third_party/webrtc/modules/desktop_capture", + ] + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } + } +} diff --git a/chromium/remoting/android/BUILD.gn b/chromium/remoting/android/BUILD.gn new file mode 100644 index 00000000000..45a184b84a3 --- /dev/null +++ b/chromium/remoting/android/BUILD.gn @@ -0,0 +1,221 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") +import("//remoting/android/client_java_tmpl.gni") +import("//remoting/android/remoting_apk_tmpl.gni") +import("//remoting/remoting_options.gni") +import("//remoting/tools/build/remoting_localize.gni") + +generate_jni("jni_headers") { + sources = [ + "host/src/org/chromium/chromoting/host/jni/Host.java", + "java/src/org/chromium/chromoting/jni/Client.java", + "java/src/org/chromium/chromoting/jni/Display.java", + "java/src/org/chromium/chromoting/jni/JniInterface.java", + "java/src/org/chromium/chromoting/jni/TouchEventData.java", + ] + jni_package = "remoting" +} + +shared_library("remoting_client_jni") { + deps = [ + "//remoting/android:jni_headers", + "//remoting/base", + "//remoting/client", + "//remoting/protocol", + "//ui/events:dom_keycode_converter", + "//ui/gfx", + ] + sources = [ + "//remoting/client/audio_player_android.cc", + "//remoting/client/audio_player_android.h", + "//remoting/client/jni/android_keymap.cc", + "//remoting/client/jni/android_keymap.h", + "//remoting/client/jni/chromoting_jni_instance.cc", + "//remoting/client/jni/chromoting_jni_instance.h", + "//remoting/client/jni/chromoting_jni_runtime.cc", + "//remoting/client/jni/chromoting_jni_runtime.h", + "//remoting/client/jni/display_updater_factory.h", + "//remoting/client/jni/egl_thread_context.cc", + "//remoting/client/jni/egl_thread_context.h", + "//remoting/client/jni/jni_client.cc", + "//remoting/client/jni/jni_client.h", + "//remoting/client/jni/jni_display_handler.cc", + "//remoting/client/jni/jni_display_handler.h", + "//remoting/client/jni/jni_gl_display_handler.cc", + "//remoting/client/jni/jni_gl_display_handler.h", + "//remoting/client/jni/jni_pairing_secret_fetcher.cc", + "//remoting/client/jni/jni_pairing_secret_fetcher.h", + "//remoting/client/jni/jni_touch_event_data.cc", + "//remoting/client/jni/jni_touch_event_data.h", + "//remoting/client/jni/jni_video_renderer.cc", + "//remoting/client/jni/jni_video_renderer.h", + "//remoting/client/jni/remoting_jni_onload.cc", + "//remoting/client/jni/remoting_jni_registrar.cc", + "//remoting/client/jni/remoting_jni_registrar.h", + ] + libs = [ + "OpenSLES", + "EGL", + ] + configs += [ "//remoting:enable_webrtc_remoting_client" ] +} + +_raw_resources_base_dir = "$target_gen_dir/remoting_android_raw_resources/res" +copy("remoting_android_raw_resources") { + _credits_html = get_label_info("//remoting/webapp:credits", + "target_gen_dir") + "/credits.html" + sources = [ + "//remoting/webapp/base/html/credits_css.css", + "//remoting/webapp/base/html/main.css", + "//remoting/webapp/base/js/credits_js.js", + _credits_html, + ] + outputs = [ + "$_raw_resources_base_dir/raw/{{source_file_part}}", + ] + deps = [ + "//remoting/webapp:credits", + ] +} + +remoting_localize("remoting_apk_manifest") { + sources = [ + "java/AndroidManifest.xml.jinja2", + ] + locales = [ "en" ] + if (remoting_enable_cardboard) { + defines = [ "ENABLE_CARDBOARD=1" ] + } else { + defines = [ "ENABLE_CARDBOARD=0" ] + } + variables = [ rebase_path(branding_path) ] + output = "$root_gen_dir/remoting/android/{{source_name_part}}" +} + +android_resources("remoting_android_client_java_resources") { + custom_package = "org.chromium.chromoting" + resource_dirs = [ "java/res" ] + generated_resource_dirs = [ _raw_resources_base_dir ] + generated_resource_files = + get_target_outputs(":remoting_android_raw_resources") + + deps = [ + ":remoting_android_raw_resources", + "//remoting/resources:strings_java", + "//third_party/android_tools:android_support_v7_appcompat_resources", + ] +} + +remoting_android_client_java_tmpl("remoting_android_client_java") { + remoting_google_play_services_library = google_play_services_library +} + +if (current_cpu == "arm") { + action("remoting_cardboard_extract_native_lib") { + script = "//remoting/tools/extract_android_native_lib.py" + sources = [ + "//third_party/cardboard-java/src/CardboardSample/libs/cardboard.jar", + ] + outputs = [ + "$root_out_dir/libvrtoolkit.so", + ] + args = [ android_app_abi ] + args += rebase_path(sources, root_build_dir) + args += rebase_path(outputs, root_build_dir) + } +} + +remoting_apk_tmpl("remoting_apk") { + apk_name = "Chromoting" + java_files = [ "//remoting/android/apk/src/org/chromium/chromoting/RemotingApplication.java" ] + deps = [ + ":remoting_android_client_java", + "//base:base_java", + "//net/android:net_java", + ] +} + +remoting_localize("remoting_test_apk_manifest") { + sources = [ + "javatests/AndroidManifest.xml.jinja2", + ] + locales = [ "en" ] + variables = [ rebase_path(branding_path) ] + output = "$root_gen_dir/remoting/android_test/{{source_name_part}}" +} + +instrumentation_test_apk("remoting_test_apk") { + android_manifest = "$root_gen_dir/remoting/android_test/AndroidManifest.xml" + android_manifest_dep = ":remoting_test_apk_manifest" + apk_name = "ChromotingTest" + apk_under_test = ":remoting_apk" + java_files = [ + "javatests/src/org/chromium/chromoting/EventTest.java", + "javatests/src/org/chromium/chromoting/MockInputStub.java", + "javatests/src/org/chromium/chromoting/SwipePinchDetectorTest.java", + "javatests/src/org/chromium/chromoting/TapGestureDetectorTest.java", + "javatests/src/org/chromium/chromoting/TouchEventBuilder.java", + "javatests/src/org/chromium/chromoting/TouchEventGenerator.java", + "javatests/src/org/chromium/chromoting/TouchInputStrategyTest.java", + "javatests/src/org/chromium/chromoting/test/util/MutableReference.java", + ] + deps = [ + ":remoting_android_client_java", + "//base:base_java", + "//base:base_java_test_support", + ] +} + +shared_library("remoting_host_jni") { + deps = [ + ":jni_headers", + "//google_apis", + "//remoting/base", + "//remoting/host", + "//remoting/host/it2me:common", + "//remoting/protocol", + ] + sources = [ + "//remoting/host/android/jni_host.cc", + "//remoting/host/android/jni_host.h", + "//remoting/host/android/remoting_host_jni_onload.cc", + "//remoting/host/android/remoting_host_jni_registrar.cc", + "//remoting/host/android/remoting_host_jni_registrar.h", + ] +} + +android_resources("remoting_host_apk_resources") { + custom_package = "org.chromium.chromoting.host" + resource_dirs = [ "host/res" ] + deps = [ + "//third_party/android_tools:android_support_v7_appcompat_resources", + ] +} + +android_apk("remoting_host_apk") { + apk_name = "ChromotingHost" + android_manifest = "host/AndroidManifest.xml" + shared_libraries = [ ":remoting_host_jni" ] + _java_file_prefix = "host/src/org/chromium/chromoting/host" + _java_files = [ + "MainActivity.java", + "RemotingApplication.java", + "jni/Host.java", + "jni/It2MeHostObserver.java", + ] + java_files = rebase_path(_java_files, ".", _java_file_prefix) + java_files += + [ "java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java" ] + deps = [ + ":remoting_host_apk_resources", + "//base:base_java", + "//net/android:net_java", + "//third_party/android_tools:android_support_v13_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + google_play_services_library, + ] +} diff --git a/chromium/remoting/android/client_java_tmpl.gni b/chromium/remoting/android/client_java_tmpl.gni new file mode 100644 index 00000000000..f4cb6d72875 --- /dev/null +++ b/chromium/remoting/android/client_java_tmpl.gni @@ -0,0 +1,99 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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("//remoting/remoting_options.gni") + +template("remoting_android_client_java_tmpl") { + android_library(target_name) { + _java_file_prefix = "//remoting/android/java/src/org/chromium/chromoting" + _java_files = [ + "AccountsAdapter.java", + "ActivityLifecycleListener.java", + "AnimationJob.java", + "Capabilities.java", + "CapabilityManager.java", + "Chromoting.java", + "ChromotingDownloadManager.java", + "ChromotingUtil.java", + "ClientExtension.java", + "Desktop.java", + "DesktopCanvas.java", + "DesktopView.java", + "DesktopViewInterface.java", + "DummyActivityLifecycleListener.java", + "DummyClientExtension.java", + "Event.java", + "FeedbackAnimator.java", + "FlingAnimationJob.java", + "HostInfo.java", + "HostListAdapter.java", + "HostListManager.java", + "InputEventSender.java", + "InputModeChangedEventParameter.java", + "InputStrategyInterface.java", + "InputStub.java", + "NavigationMenuAdapter.java", + "OAuthTokenConsumer.java", + "PaintEventParameter.java", + "Preconditions.java", + "RenderData.java", + "ScaleEventParameter.java", + "SessionAuthenticator.java", + "SessionConnector.java", + "SimulatedTouchInputStrategy.java", + "SizeChangedEventParameter.java", + "SwipePinchDetector.java", + "SystemUiVisibilityChangedEventParameter.java", + "TapGestureDetector.java", + "ThirdPartyTokenFetcher.java", + "TouchEventParameter.java", + "TouchInputHandler.java", + "TouchInputStrategy.java", + "TrackpadInputStrategy.java", + "TapEventParameter.java", + "TwoPointsEventParameter.java", + "accountswitcher/AccountSwitcher.java", + "accountswitcher/AccountSwitcherBase.java", + "accountswitcher/AccountSwitcherBasic.java", + "accountswitcher/AccountSwitcherFactory.java", + "base/OAuthTokenFetcher.java", + "cardboard/CardboardRenderer.java", + "cardboard/CardboardUtil.java", + "cardboard/Cursor.java", + "cardboard/Desktop.java", + "cardboard/DesktopActivity.java", + "cardboard/MenuBar.java", + "cardboard/MenuItem.java", + "cardboard/Photosphere.java", + "cardboard/ShaderHelper.java", + "cardboard/TextureHelper.java", + "help/CreditsActivity.java", + "help/HelpActivity.java", + "help/HelpAndFeedback.java", + "help/HelpAndFeedbackBasic.java", + "help/HelpContext.java", + "help/HelpSingleton.java", + "jni/Client.java", + "jni/ConnectionListener.java", + "jni/Display.java", + "jni/JniInterface.java", + "jni/TouchEventData.java", + ] + + java_files = rebase_path(_java_files, ".", _java_file_prefix) + + deps = [ + "//base:base_java", + "//remoting/android:remoting_android_client_java_resources", + "//third_party/android_tools:android_support_v13_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + "//third_party/android_tools:android_support_v7_mediarouter_java", + "//third_party/cardboard-java", + "//ui/android:ui_java", + ] + + deps += [ invoker.remoting_google_play_services_library ] + } +} diff --git a/chromium/remoting/android/remoting_apk_tmpl.gni b/chromium/remoting/android/remoting_apk_tmpl.gni new file mode 100644 index 00000000000..0cc28b49290 --- /dev/null +++ b/chromium/remoting/android/remoting_apk_tmpl.gni @@ -0,0 +1,21 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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("//remoting/remoting_options.gni") + +template("remoting_apk_tmpl") { + android_apk(target_name) { + forward_variables_from(invoker, "*") + + android_manifest = "$root_gen_dir/remoting/android/AndroidManifest.xml" + android_manifest_dep = "//remoting/android:remoting_apk_manifest" + shared_libraries = [ "//remoting/android:remoting_client_jni" ] + + if (remoting_enable_cardboard && current_cpu == "arm") { + deps += [ "//remoting/android:remoting_cardboard_extract_native_lib" ] + loadable_modules = [ "$root_out_dir/libvrtoolkit.so" ] + } + } +} diff --git a/chromium/remoting/base/BUILD.gn b/chromium/remoting/base/BUILD.gn new file mode 100644 index 00000000000..ff2b38f1b0d --- /dev/null +++ b/chromium/remoting/base/BUILD.gn @@ -0,0 +1,96 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_srcs.gni") + +source_set("base") { + sources = rebase_path(remoting_srcs_gypi_values.remoting_base_sources, + ".", + "//remoting") + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + public_deps = [ + "//base", + "//net", + "//remoting/proto", + "//third_party/protobuf:protobuf_lite", + ] + deps = [ + "//base/third_party/dynamic_annotations", + "//third_party/libvpx", + "//third_party/libyuv", + "//third_party/webrtc/modules/desktop_capture:primitives", + "//url", + ] + if (is_nacl) { + sources -= [ + "chromium_url_request.cc", + "chromoting_event.cc", + "telemetry_log_writer.cc", + "url_request_context_getter.cc", + ] + } +} + +source_set("breakpad") { + sources = [ + "breakpad.h", + "breakpad_linux.cc", + "breakpad_mac.mm", + "breakpad_win.cc", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//base", + ] + + if (is_mac) { + deps += [ "//breakpad" ] + } else if (is_win) { + deps += [ "//breakpad:breakpad_handler" ] + } +} + +source_set("unit_tests") { + testonly = true + + sources = [ + "auto_thread_task_runner_unittest.cc", + "auto_thread_unittest.cc", + "breakpad_win_unittest.cc", + "buffered_socket_writer_unittest.cc", + "capabilities_unittest.cc", + "compound_buffer_unittest.cc", + "rate_counter_unittest.cc", + "rsa_key_pair_unittest.cc", + "run_all_unittests.cc", + "running_samples_unittest.cc", + "telemetry_log_writer_unittest.cc", + "test_rsa_key_pair.h", + "typed_buffer_unittest.cc", + "util_unittest.cc", + ] + + deps = [ + ":base", + ":breakpad", + "//base", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/libyuv", + "//third_party/webrtc/modules/desktop_capture:primitives", + ] + + if (is_win || is_mac || is_chromeos) { + deps += [ "//breakpad:client" ] + } + + if (is_win) { + libs = [ "rpcrt4.lib" ] # For UuidCreate in breakpad_win_unittest.cc. + } +} diff --git a/chromium/remoting/client/BUILD.gn b/chromium/remoting/client/BUILD.gn new file mode 100644 index 00000000000..d549eee9e12 --- /dev/null +++ b/chromium/remoting/client/BUILD.gn @@ -0,0 +1,95 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_srcs.gni") + +source_set("client") { + # Disabled the source filters because there are _mac files that need to + # be compiled on all platforms. + set_sources_assignment_filter([]) + sources = rebase_path(remoting_srcs_gypi_values.remoting_client_sources, + ".", + "//remoting") + set_sources_assignment_filter(sources_assignment_filter) + + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//remoting:version", + "//remoting:enable_webrtc_remoting_client", + ] + + deps = [ + "//remoting/base", + "//remoting/codec", + "//remoting/protocol", + "//third_party/libyuv", + "//third_party/webrtc/modules/desktop_capture:primitives", + ] + + if (is_nacl) { + sources -= [ + "client_status_logger.cc", + "client_telemetry_logger.cc", + "server_log_entry_client.cc", + ] + } else { + sources += rebase_path( + remoting_srcs_gypi_values.remoting_client_standalone_sources, + ".", + "//remoting") + } +} + +source_set("test_support") { + testonly = true + + sources = [ + "fake_audio_consumer.cc", + "fake_audio_consumer.h", + ] + + public_deps = [ + "//remoting/protocol:test_support", + "//testing/gmock", + "//third_party/protobuf:protobuf_lite", + ] +} + +source_set("unit_tests") { + testonly = true + + # Disabled the source filters because there are _mac files that need to + # be compiled on all platforms. + set_sources_assignment_filter([]) + sources = [ + "audio_decode_scheduler_unittest.cc", + "audio_player_unittest.cc", + "chromoting_client_runtime_unittest.cc", + "client_status_logger_unittest.cc", + "client_telemetry_logger_unittest.cc", + "empty_cursor_filter_unittest.cc", + "key_event_mapper_unittest.cc", + "normalizing_input_filter_cros_unittest.cc", + "normalizing_input_filter_mac_unittest.cc", + "normalizing_input_filter_win_unittest.cc", + "server_log_entry_client_unittest.cc", + "software_video_renderer_unittest.cc", + "touch_input_scaler_unittest.cc", + ] + set_sources_assignment_filter(sources_assignment_filter) + + configs += [ + "//remoting:version", + "//remoting:enable_webrtc_remoting_client", + ] + + deps = [ + ":client", + ":test_support", + "//remoting/proto", + "//testing/gmock", + "//testing/gtest", + "//third_party/webrtc", + ] +} diff --git a/chromium/remoting/client/opengl/BUILD.gn b/chromium/remoting/client/opengl/BUILD.gn new file mode 100644 index 00000000000..0a9d785d605 --- /dev/null +++ b/chromium/remoting/client/opengl/BUILD.gn @@ -0,0 +1,14 @@ +shaders = [ + "tex_coord_to_view.vert", + "draw_tex.frag", +] + +action("inline_shaders") { + script = "../../tools/build/shader_to_header.py" + out_path = "${root_gen_dir}/remoting/client/opengl/shaders.h" + inputs = shaders + outputs = [ + out_path, + ] + args = [ rebase_path(out_path) ] + rebase_path(shaders) +} diff --git a/chromium/remoting/client/plugin/BUILD.gn b/chromium/remoting/client/plugin/BUILD.gn new file mode 100644 index 00000000000..109a859b340 --- /dev/null +++ b/chromium/remoting/client/plugin/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_nacl, + "These targets must only be built using the untrusted NaCl toolchains.") + +import("//build/config/features.gni") +import("//remoting/remoting_srcs.gni") + +config("enable_linker_optimization") { + ldflags = [ "-Wl,-O1" ] +} + +executable("remoting_client_plugin_newlib") { + sources = + rebase_path(remoting_srcs_gypi_values.remoting_client_plugin_sources, + ".", + "//remoting") + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + if (is_debug) { + # Always enable link-time optimization in debug builds to workaround + # crbug.com/538243 . + configs += [ ":enable_linker_optimization" ] + } + + deps = [ + "//net", + "//ppapi/cpp", + "//ppapi/native_client:ppapi_lib", + "//remoting/base", + "//remoting/client", + "//remoting/codec", + "//remoting/protocol", + "//third_party/libyuv", + "//third_party/webrtc/modules/desktop_capture:primitives", + "//ui/events:dom_keycode_converter", + ] + + include_dirs = [ "//ppapi/lib/gl/include" ] +} + +if (enable_nacl && is_debug) { + copy("remoting_client_plugin_newlib_debug") { + public_deps = [ + ":remoting_client_plugin_newlib", + ] + sources = [ + "$root_out_dir/exe.unstripped/remoting_client_plugin_newlib.pexe", + ] + outputs = [ + "$root_out_dir/remoting_client_plugin_newlib.pexe.debug", + ] + } +} diff --git a/chromium/remoting/codec/BUILD.gn b/chromium/remoting/codec/BUILD.gn new file mode 100644 index 00000000000..1cde72da41e --- /dev/null +++ b/chromium/remoting/codec/BUILD.gn @@ -0,0 +1,70 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_srcs.gni") + +source_set("codec") { + sources = rebase_path(remoting_srcs_gypi_values.remoting_codec_sources, + ".", + "//remoting") + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//base/third_party/dynamic_annotations", + "//media", + "//media:shared_memory_support", + "//remoting/proto", + "//third_party/libvpx", + "//third_party/libyuv", + "//third_party/opus", + "//third_party/webrtc/modules/desktop_capture:primitives", + ] + + if (is_nacl) { + deps -= [ + "//media", + "//media:shared_memory_support", + ] + sources -= [ + "audio_encoder.h", + "audio_encoder_opus.cc", + "audio_encoder_opus.h", + "audio_encoder_verbatim.cc", + "audio_encoder_verbatim.h", + "video_encoder.cc", + "video_encoder.h", + "video_encoder_helper.cc", + "video_encoder_helper.h", + "video_encoder_verbatim.cc", + "video_encoder_verbatim.h", + "video_encoder_vpx.cc", + "video_encoder_vpx.h", + "webrtc_video_encoder_vpx.cc", + "webrtc_video_encoder_vpx.h", + ] + } +} + +source_set("unit_tests") { + testonly = true + + sources = [ + "audio_encoder_opus_unittest.cc", + "codec_test.cc", + "codec_test.h", + "video_decoder_vpx_unittest.cc", + "video_encoder_helper_unittest.cc", + "video_encoder_verbatim_unittest.cc", + "video_encoder_vpx_unittest.cc", + ] + + deps = [ + ":codec", + "//base", + "//remoting/proto", + "//testing/gtest", + "//third_party/webrtc/modules/desktop_capture", + ] +} diff --git a/chromium/remoting/host/BUILD.gn b/chromium/remoting/host/BUILD.gn new file mode 100644 index 00000000000..e85af02ada4 --- /dev/null +++ b/chromium/remoting/host/BUILD.gn @@ -0,0 +1,1561 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//build/config/win/manifest.gni") +import("//build/util/version.gni") +import("//chrome/version.gni") +import("//remoting/remoting_enable.gni") +import("//remoting/remoting_locales.gni") +import("//remoting/remoting_options.gni") +import("//remoting/remoting_srcs.gni") +import("//remoting/remoting_version.gni") +import("//remoting/tools/build/remoting_localize.gni") + +process_version("remoting_version") { + template_file = "//remoting/host/version.h.in" + sources = [ + branding_path, + ] + output = "$target_gen_dir/version.h" +} + +if (is_win) { + import("//remoting/host/predefines_win.gni") +} else if (is_mac) { + import("//build/config/mac/rules.gni") +} + +# Reference this manifest to indicate that a process is per-monitor DPI aware. +dpi_aware_manifest = "//remoting/host/win/dpi_aware.manifest" + +# Depending on this target gives a default executable manifest with the addition +# of the DPI aware tag. +windows_manifest("dpi_aware_exe_manifest") { + sources = [ + as_invoker_manifest, + common_controls_manifest, + default_compatibility_manifest, + dpi_aware_manifest, + ] + type = "exe" +} + +# Depending on this target gives a default executable manifest with the addition +# of the DPI aware tag and a requestedExecutionLevel of requireAdministrator. +windows_manifest("dpi_aware_elevated_exe_manifest") { + sources = [ + common_controls_manifest, + default_compatibility_manifest, + dpi_aware_manifest, + require_administrator_manifest, + ] + type = "exe" +} + +# GYP version: remoting/remoting_host:remoting_host_credits +action("credits") { + # We put this in $root_build_dir/gen/remoting instead of + # $root_build_dir/gen/remoting/host (target_gen_dir) for + # compatibility w/ GYP, since the installer needs the file to + # be at the same location. + about_credits_file = "$root_build_dir/gen/remoting/CREDITS.txt" + script = "//tools/licenses.py" + + inputs = [ + "installer/credits.tmpl", + "installer/credits_entry.tmpl", + ] + + outputs = [ + about_credits_file, + ] + + args = [ + "credits", + rebase_path(about_credits_file, root_build_dir), + "--file-template", + rebase_path("installer/credits.tmpl", root_build_dir), + "--entry-template", + rebase_path("installer/credits_entry.tmpl", root_build_dir), + ] +} + +# This must be a static library instead of a source set because +# remoting_unittests requires that remoting_me2me_host.cc not be pulled in, +# which in turn depends on remoting_me2me_host_static which isn't part of that +# build. +# +# TODO fix this, successful builds should not depend on static libraries +# stripping code. +static_library("host") { + sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources, + ".", + "//remoting") + + libs = [] + + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//remoting:version", + ] + + defines = [ "WEBRTC_CHROMIUM_BUILD" ] + + deps = [ + "//base:i18n", + "//components/policy:policy_component_common", + "//crypto", + "//google_apis", + "//ipc", + "//remoting/base", + "//remoting/protocol", + "//remoting/resources", + "//ui/base", + "//ui/events:dom_keycode_converter", + "//ui/events/platform", + ] + + if (enable_configuration_policy) { + deps += [ "//components/policy:policy" ] + } + + if (is_linux && !is_chromeos) { + libs += [ "pam" ] + } + + if (use_x11) { + configs += [ + "//build/config/linux:x11", + "//build/config/linux:xrandr", + ] + if (is_desktop_linux) { + deps += [ "//build/config/linux/gtk2" ] + } + } else { + sources -= [ + "clipboard_x11.cc", + "desktop_resizer_x11.cc", + "input_injector_x11.cc", + "local_input_monitor_x11.cc", + ] + if (is_linux) { + # These will already be filtered out on non-Linux. + sources -= [ + "linux/unicode_to_keysym.cc", + "linux/x11_util.cc", + "linux/x_server_clipboard.cc", + "linux/x_server_clipboard.h", + ] + } + } + + if (!use_ozone) { + sources -= [ "desktop_resizer_ozone.cc" ] + } + + if (is_chromeos) { + # TODO(GYP): crbug.com/481627. These should only be included + # when enable_me2me_host is true. + sources -= [ + "me2me_desktop_environment.cc", + "me2me_desktop_environment.h", + ] + deps += [ + "//cc", + "//gpu/command_buffer/common", + "//ppapi/host", + "//skia", + "//ui/aura", + "//ui/compositor", + "//ui/events", + "//ui/views", + ] + + if (use_ash) { + deps += [ "//ash" ] + } + + if (use_ozone) { + deps += [ "//ui/ozone" ] + sources -= [ "desktop_resizer_ozone.cc" ] + } else { + sources -= [ + "clipboard_x11.cc", + "desktop_resizer_x11.cc", + "input_injector_chromeos.cc", + "input_injector_chromeos.h", + "linux/x_server_clipboard.cc", + "linux/x_server_clipboard.h", + "local_input_monitor_x11.cc", + ] + } + + sources -= [ + "continue_window_linux.cc", + "curtain_mode_linux.cc", + "disconnect_window_linux.cc", + ] + } + + if (is_mac) { + libs += [ + "Accelerate.framework", + "Carbon.framework", + ] + + # TODO(nicholss): When we can delete GYP builds, + # this flag and usage can be removed. + defines += [ "GN_BUILD=1" ] + deps += [ + ":remoting_version", + "//third_party/google_toolbox_for_mac", + ] + } + + if (is_win) { + deps += [ + ":messages", + ":remoting_lib_idl", + ] + } + + if (enable_webrtc) { + deps += [ "//third_party/webrtc/modules/desktop_capture" ] + } + + if (is_android) { + sources -= [ + "single_window_desktop_environment.cc", + "single_window_desktop_environment.h", + ] + } +} + +source_set("test_support") { + testonly = true + + sources = [ + "fake_desktop_environment.cc", + "fake_desktop_environment.h", + "fake_host_extension.cc", + "fake_host_extension.h", + "fake_host_status_monitor.h", + "fake_host_status_monitor.h", + "fake_mouse_cursor_monitor.cc", + "fake_mouse_cursor_monitor.h", + "fake_oauth_token_getter.cc", + "fake_oauth_token_getter.h", + "host_mock_objects.cc", + "host_mock_objects.h", + "security_key/fake_ipc_gnubby_auth_handler.cc", + "security_key/fake_ipc_gnubby_auth_handler.h", + "security_key/fake_remote_security_key_ipc_client.cc", + "security_key/fake_remote_security_key_ipc_client.h", + "security_key/fake_remote_security_key_ipc_server.cc", + "security_key/fake_remote_security_key_ipc_server.h", + "security_key/fake_remote_security_key_message_reader.cc", + "security_key/fake_remote_security_key_message_reader.h", + "security_key/fake_remote_security_key_message_writer.cc", + "security_key/fake_remote_security_key_message_writer.h", + "setup/mock_oauth_client.cc", + "setup/mock_oauth_client.h", + ] + + configs += [ "//remoting:version" ] + + deps = [ + "//remoting/proto", + "//testing/gmock", + "//testing/gtest", + ] + public_deps = [ + ":host", + "//third_party/protobuf:protobuf_lite", + ] + + if (enable_webrtc) { + public_deps += [ + "//third_party/libjingle:libjingle_webrtc", + "//third_party/webrtc/modules/desktop_capture", + ] + } +} + +# The host portions of the remoting unit tests. +source_set("unit_tests") { + testonly = true + + sources = [ + "audio_pump_unittest.cc", + "audio_silence_detector_unittest.cc", + "backoff_timer_unittest.cc", + "chromeos/aura_desktop_capturer_unittest.cc", + "chromeos/clipboard_aura_unittest.cc", + "chromoting_host_context_unittest.cc", + "chromoting_host_unittest.cc", + "client_session_unittest.cc", + "config_file_watcher_unittest.cc", + "daemon_process_unittest.cc", + "desktop_process_unittest.cc", + "gcd_rest_client_unittest.cc", + "gcd_state_updater_unittest.cc", + "heartbeat_sender_unittest.cc", + "host_change_notification_listener_unittest.cc", + "host_config_unittest.cc", + "host_extension_session_manager_unittest.cc", + "host_status_logger_unittest.cc", + "ipc_desktop_environment_unittest.cc", + "it2me/it2me_confirmation_dialog_proxy_unittest.cc", + "it2me/it2me_native_messaging_host_unittest.cc", + "linux/audio_pipe_reader_unittest.cc", + "linux/certificate_watcher_unittest.cc", + "linux/unicode_to_keysym_unittest.cc", + "linux/x_server_clipboard_unittest.cc", + "local_input_monitor_unittest.cc", + "mouse_cursor_monitor_proxy_unittest.cc", + "mouse_shape_pump_unittest.cc", + "native_messaging/native_messaging_reader_unittest.cc", + "native_messaging/native_messaging_writer_unittest.cc", + "pairing_registry_delegate_linux_unittest.cc", + "pairing_registry_delegate_win_unittest.cc", + "pin_hash_unittest.cc", + "policy_watcher_unittest.cc", + "register_support_host_request_unittest.cc", + "remote_input_filter_unittest.cc", + "resizing_host_observer_unittest.cc", + "resources_unittest.cc", + "screen_resolution_unittest.cc", + "security_key/gnubby_auth_handler_linux_unittest.cc", + "security_key/gnubby_auth_handler_win_unittest.cc", + "security_key/gnubby_extension_session_unittest.cc", + "security_key/remote_security_key_ipc_client_unittest.cc", + "security_key/remote_security_key_ipc_server_unittest.cc", + "security_key/remote_security_key_message_handler_unittest.cc", + "security_key/remote_security_key_message_reader_impl_unittest.cc", + "security_key/remote_security_key_message_writer_impl_unittest.cc", + "server_log_entry_host_unittest.cc", + "setup/me2me_native_messaging_host_unittest.cc", + "setup/oauth_helper_unittest.cc", + "setup/pin_validator_unittest.cc", + "third_party_auth_config_unittest.cc", + "token_validator_factory_impl_unittest.cc", + "touch_injector_win_unittest.cc", + "win/rdp_client_unittest.cc", + "win/worker_process_launcher_unittest.cc", + ] + + if (!use_x11 && is_linux) { + sources -= [ "linux/unicode_to_keysym_unittest.cc" ] + } + if (use_ozone || is_chromeos) { + sources -= [ "local_input_monitor_unittest.cc" ] + } + if (is_chromeos) { + sources -= [ "linux/x_server_clipboard_unittest.cc" ] + } + if (is_android) { + sources -= [ "it2me/it2me_native_messaging_host_unittest.cc" ] + } + + configs += [ "//remoting:version" ] + + deps = [ + ":host", + ":test_support", + "//remoting/host/it2me:common", + "//remoting/host/native_messaging", + "//remoting/host/setup", + "//remoting/proto", + "//skia", + "//testing/gmock", + "//testing/gtest", + ] + + if (enable_configuration_policy) { + deps += [ "//components/policy:policy_component_test_support" ] + } +} + +if (is_win) { + import("//build/toolchain/win/midl.gni") + import("//build/win/message_compiler.gni") + + # TODO(brettw) these should not be generated via exec_script. This should be + # part of the build process rather than the metabuild. Instead, a script + # should generate a header containing the #defines for this as well as the + # IDL file with the values. + clsids = exec_script("win/get_clsids.py", + [ + remoting_srcs_gypi_values.daemon_controller_guid, + remoting_srcs_gypi_values.rdp_desktop_session_guid, + chrome_version_full, + ], + "value") + daemon_controller_clsid = clsids[0] + rdp_desktop_session_clsid = clsids[1] + + action("generate_idl") { + script = "//build/util/version.py" + + inputs = [ + "win/chromoting_lib_idl.templ", + ] + outputs = [ + "$target_gen_dir/chromoting_lib.idl", + ] + + args = [ + "-e", + "DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'", + "-e", + "RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'", + rebase_path(inputs[0], root_build_dir), + rebase_path(outputs[0], root_build_dir), + ] + } + + midl("remoting_lib_idl") { + sources = get_target_outputs(":generate_idl") + deps = [ + ":generate_idl", + ] + } + + config("MIDL_config") { + if (is_clang) { + cflags = [ + # MIDL generated code has a habit of omitting optional braces. + "-Wno-missing-braces", + + # Source files generated by the MIDL compiler trigger warnings with + # -Wincompatible-pointer-types enabled. + "-Wno-incompatible-pointer-types", + + # Generated code contains unused variables. + "-Wno-unused-variable", + + # PROXYFILE_LIST_START is an extern with initializer. + "-Wno-extern-initializer", + ] + } + } + + # GYP version: remoting/remoting_host_win.gypi:remoting_lib_ps + static_library("remoting_lib_ps") { + configs += [ ":MIDL_config" ] + + defines = [ + "ENTRY_PREFIX=Ps", + "REGISTER_PROXY_DLL", + ] + + deps = [ + ":remoting_lib_idl", + ] + + sources = [ + "$root_gen_dir/remoting/host/chromoting_lib.dlldata.c", + "$root_gen_dir/remoting/host/chromoting_lib_p.c", + ] + } + + # Makes the .mc file from the .mc.jinja file. + remoting_localize("messages_localizing") { + sources = [ + "win/host_messages.mc.jinja2", + ] + locales = remoting_locales + locale_dir = webapp_locale_dir + encoding = "utf-16" + + # This target is funny. It only produces one file and the output doesn't + # match the input. We want to generate remoting_host_messages.mc from + # host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the + # output, so the following pattern produces the name we want with a template + # based on the input. + # + # TODO: This is for GYP compat. We should just make the names match instead. + output = "$target_gen_dir/remoting_{{source_name_part}}" + } + + # Makes the .h/.rc files from the .mc file. + message_compiler("messages") { + compile_generated_code = false + sources = get_target_outputs(":messages_localizing") + deps = [ + ":messages_localizing", + ] + } + + # GYP version: remoting/remoting_host_win.gypi:remoting_console + executable("remoting_console") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = host_predefines + [ "BINARY=BINARY_HOST_ME2ME" ] + + deps = [ + ":dpi_aware_exe_manifest", + ":remoting_core", + ":remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "win/entry_point.cc", + ] + + ldflags = [ + "/ENTRY:HostEntryPoint", + # "/NODEFAULTLIB", + ] + } + + # GYP version: //remoting/remoting_host_win.gypi:remoting_core + shared_library("remoting_core") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = host_predefines + [ + "_ATL_APARTMENT_THREADED", + "_ATL_CSTRING_EXPLICIT_CONSTRUCTORS", + "_ATL_NO_AUTOMATIC_NAMESPACE", + "_ATL_NO_EXCEPTIONS", + "BINARY=BINARY_CORE", + "DAEMON_CONTROLLER_CLSID=\"$daemon_controller_clsid\"", + "RDP_DESKTOP_SESSION_CLSID=\"$rdp_desktop_session_clsid\"", + "HOST_IMPLEMENTATION", + "ISOLATION_AWARE_ENABLED=1", + "STRICT", + "VERSION=$chrome_version_full", + ] + + if (remoting_multi_process != 0 && remoting_rdp_session != 0) { + defines += [ "REMOTING_RDP_SESSION" ] + } + + if (remoting_multi_process != 0) { + defines += [ "REMOTING_MULTI_PROCESS" ] + } + + deps = [ + ":host", + ":messages", + ":remoting_lib_idl", + ":remoting_lib_ps", + ":remoting_me2me_host_static", + ":remoting_windows_resources", + "//base", + "//base:base_static", + "//base/allocator", + "//base/third_party/dynamic_annotations", + "//build/win:default_exe_manifest", + "//ipc", + "//net", + "//remoting/base", + "//remoting/base:breakpad", + "//remoting/codec", + "//remoting/host/it2me:common", + "//remoting/host/native_messaging", + "//remoting/host/setup", + "//remoting/protocol", + "//sandbox/win:sandbox", # Should always use Windows version + "//third_party/webrtc/modules/desktop_capture", + ] + + sources = [ + "$root_gen_dir/remoting/core.rc", + "$root_gen_dir/remoting/host/remoting_host_messages.rc", + "$root_gen_dir/remoting/version.rc", + "desktop_process_main.cc", + "host_main.cc", + "host_main.h", + "it2me/it2me_native_messaging_host_main.cc", + "it2me/it2me_native_messaging_host_main.h", + "security_key/remote_security_key_main.cc", + "security_key/remote_security_key_main.h", + "setup/host_starter.cc", + "setup/host_starter.h", + "setup/me2me_native_messaging_host_main.cc", + "setup/me2me_native_messaging_host_main.h", + "setup/start_host_main.cc", + "setup/start_host_main.h", + "win/chromoting_lib.rc", + "win/chromoting_module.cc", + "win/chromoting_module.h", + "win/core.cc", + "win/core_resource.h", + "win/host_service.cc", + "win/host_service.h", + "win/omaha.cc", + "win/omaha.h", + "win/rdp_desktop_session.cc", + "win/rdp_desktop_session.h", + "win/unprivileged_process_delegate.cc", + "win/unprivileged_process_delegate.h", + "win/wts_session_process_delegate.cc", + "win/wts_session_process_delegate.h", + "worker_process_ipc_delegate.h", + ] + + ldflags = [ + "/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE", + "/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE", + "/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE", + "/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE", + ] + + libs = [ + "comctl32.lib", + "rpcns4.lib", + "rpcrt4.lib", + "sas.lib", + "uuid.lib", + "wtsapi32.lib", + ] + + if (is_clang) { + cflags = [ "-Wno-header-hygiene" ] + } + } + + # GYP version: //remoting/remoting_host_win.gypi:remoting_desktop + executable("remoting_desktop") { + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//build/config/win:windowed", + ] + + defines = host_predefines + [ "BINARY=BINARY_DESKTOP" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + ] + + if (is_official_build) { + deps += [ ":dpi_aware_elevated_exe_manifest" ] + } else { + deps += [ ":dpi_aware_exe_manifest" ] + } + + sources = [ + "$root_gen_dir/remoting/version.rc", + "win/entry_point.cc", + ] + + ldflags = [ + "/ENTRY:HostEntryPoint", + # "/NODEFAULTLIB", + ] + } + + # GYP version: //remoting/remoting_host_win.gypi:remote_security_key + executable("remote_security_key") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = host_predefines + [ "BINARY=BINARY_REMOTE_SECURITY_KEY" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + "//build/win:default_exe_manifest", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "security_key/remote_security_key_entry_point.cc", + ] + } + + # GYP version: + # //remoting/remoting_host_win.gypi:remoting_me2me_native_messaging_host + executable("remoting_native_messaging_host") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = host_predefines + [ "BINARY=BINARY_NATIVE_MESSAGING_HOST" ] + + deps = [ + ":remoting_core", + ":remoting_windows_resources", + "//build/win:default_exe_manifest", + ] + + if (is_mac) { + foreach(locale, remoting_locales_with_underscores) { + deps += [ + ":native_messaging_host_strings_${locale}_bundle_data", + ":remoting_host_locale_${locale}_bundle_data", + ] + } + deps += [ + ":remoting_infoplist_strings", + "//remoting/resources:copy_locales", + ] + } + + sources = [ + "$root_gen_dir/remoting/version.rc", + "setup/me2me_native_messaging_host_entry_point.cc", + ] + } + + # GYP version: //remoting/remoting_host_win.gypi:remoting_windows_resources + remoting_localize("remoting_windows_resources") { + deps = [ + "//remoting/resources", + ] + + sources = [ + "win/core.rc.jinja2", + "win/version.rc.jinja2", + ] + + # TODO(zijiehe): Export lastchange_path from + # //chrome/version.gni:process_version + variables = [ + rebase_path(chrome_version_file), + rebase_path(remoting_version_file), + rebase_path("//build/util/LASTCHANGE"), + ] + + output = "$root_gen_dir/remoting/{{source_name_part}}" + + locale_dir = webapp_locale_dir + + encoding = "utf-16" + + locales = remoting_locales + } + + # TODO(GYP) More Windows remoting targets from remoting_host_win.gypi +} + +if (enable_remoting_host && !is_android) { + executable("remoting_start_host") { + sources = [ + "setup/start_host_entry_point.cc", + ] + + deps = [ + "//build/config/sanitizers:deps", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + if (is_win) { + defines = host_predefines + [ "BINARY=BINARY_REMOTING_START_HOST" ] + + deps += [ + ":remoting_core", + ":remoting_windows_resources", + "//build/win:default_exe_manifest", + ] + } else { + sources += [ + "setup/host_starter.cc", + "setup/host_starter.h", + "setup/start_host_main.cc", + "setup/start_host_main.h", + ] + + deps += [ "//remoting/host/setup" ] + } + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } + } + + action_foreach("remoting_native_messaging_manifests") { + if (is_mac) { + me2me_host_path = "/Library/PrivilegedHelperTools/$me2me_host_bundle_name/Contents/MacOS/$native_messaging_host_bundle_name/Contents/MacOS/native_messaging_host" + it2me_host_path = "/Library/PrivilegedHelperTools/$me2me_host_bundle_name/Contents/MacOS/$remote_assistance_host_bundle_name/Contents/MacOS/remote_assistance_host" + } else if (is_win) { + me2me_host_path = "remoting_native_messaging_host.exe" + it2me_host_path = "remote_assistance_host.exe" + } else { + me2me_host_path = + "/opt/google/chrome-remote-desktop/native-messaging-host" + it2me_host_path = + "/opt/google/chrome-remote-desktop/remote-assistance-host" + } + + script = "../tools/build/remoting_localize.py" + + sources = [ + "it2me/com.google.chrome.remote_assistance.json.jinja2", + "setup/com.google.chrome.remote_desktop.json.jinja2", + ] + + inputs = [ + branding_path, + ] + + outputs = [ + "$root_build_dir/remoting/{{source_name_part}}", + ] + + args = [ + "--define", + "ME2ME_HOST_PATH=$me2me_host_path", + "--define", + "IT2ME_HOST_PATH=$it2me_host_path", + "--variables", + rebase_path(branding_path), + "--template", + "{{source}}", + "--output", + "remoting/{{source_name_part}}", + "en", + ] + } + + if (is_mac) { + foreach(locale, remoting_locales_with_underscores) { + bundle_data("remoting_host_locale_${locale}_bundle_data") { + sources = [ + "$root_build_dir/remoting/resources/$locale.lproj/locale.pak", + ] + outputs = [ + "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}", + ] + deps = [ + "//remoting/resources:copy_locales", + ] + } + } + } + + action_foreach("remoting_infoplist_strings") { + sources = [ + "installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2", + "it2me/remote_assistance_host-InfoPlist.strings.jinja2", + "mac/me2me_preference_pane-InfoPlist.strings.jinja2", + "remoting_me2me_host-InfoPlist.strings.jinja2", + "setup/native_messaging_host-InfoPlist.strings.jinja2", + ] + + script = "//remoting/tools/build/remoting_localize.py" + args = [ + "--locale_dir", + rebase_path(webapp_locale_dir, root_build_dir), + "--variables", + rebase_path(branding_path), + "--template", + "{{source}}", + "--locale_output", + rebase_path( + "$root_gen_dir/remoting/host/{{source_name_part}}/@{json_suffix}.lproj/InfoPlist.strings", + root_build_dir), + ] + remoting_locales_with_underscores + + outputs = [] + foreach(locale, remoting_locales_with_underscores) { + outputs += [ "$root_gen_dir/remoting/host/{{source_name_part}}/$locale.lproj/InfoPlist.strings" ] + } + + deps = [ + "//remoting/resources", + "//remoting/resources:strings", + ] + } +} + +if (enable_me2me_host) { + source_set("remoting_me2me_host_static") { + sources = [ + "pam_authorization_factory_posix.cc", + "pam_authorization_factory_posix.h", + "remoting_me2me_host.cc", + ] + defines = [] + + configs += [ "//remoting:version" ] + + deps = [ + "//base", + "//base:i18n", + "//components/policy:policy_component_common", + "//net", + "//remoting/base", + "//remoting/host", + "//remoting/proto", + "//third_party/webrtc/modules/desktop_capture", + ] + + if (enable_configuration_policy) { + deps += [ "//components/policy" ] + } + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } + + if (is_desktop_linux) { + deps += [ "//build/config/linux/gtk2" ] + } + if ((is_linux && !is_chromeos) || is_mac) { + libs = [ "pam" ] + } + + if (is_mac && is_official_build) { + sources += [ "internal/internal_mac-inl.h" ] + defines += [ "USE_REMOTING_MACOSX_INTERNAL" ] + } + + if (is_win && remoting_multi_process != 0 && remoting_rdp_session != 0) { + defines += [ "REMOTING_RDP_SESSION" ] + } + + if (remoting_multi_process != 0) { + defines += [ "REMOTING_MULTI_PROCESS" ] + } + } + + if (is_win) { + # GYP version: //remoting/remoting_host_win.gypi:remoting_me2me_host + executable("remoting_me2me_host") { + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//build/config/win:windowed", + ] + + defines = host_predefines + [ "BINARY=BINARY_HOST_ME2ME" ] + + deps = [ + ":dpi_aware_exe_manifest", + ":remoting_core", + ":remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "win/entry_point.cc", + ] + + output_name = "remoting_host" + + ldflags = [ + "/ENTRY:HostEntryPoint", + # "/NODEFAULTLIB", + ] + } + } else { + if (is_mac) { + app_target_type = "mac_app_bundle" + } else { + app_target_type = "executable" + } + + if (is_mac) { + # remoting_me2me_host-InfoPlist.strings + foreach(locale, remoting_locales_with_underscores) { + bundle_data("remoting_me2me_host_strings_${locale}_bundle_data") { + sources = [ + "$root_gen_dir/remoting/host/remoting_me2me_host-InfoPlist.strings/$locale.lproj/InfoPlist.strings", + ] + outputs = [ + "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}", + ] + deps = [ + ":remoting_infoplist_strings", + ] + } + } + } + + target(app_target_type, "remoting_me2me_host") { + if (is_mac) { + extra_configs = [ "//remoting:version" ] + info_plist = "remoting_me2me_host-Info.plist" + } else { + configs += [ "//remoting:version" ] + } + + sources = [ + "host_main.cc", + "host_main.h", + ] + + if (is_mac && is_chrome_branded && is_official_build) { + defines = [ "REMOTING_ENABLE_BREAKPAD" ] + } + + deps = [ + ":credits", + ":remoting_me2me_host_static", + "//build/config/sanitizers:deps", + "//remoting/resources", + ] + if (is_mac) { + foreach(locale, remoting_locales_with_underscores) { + deps += [ + ":remoting_host_locale_${locale}_bundle_data", + ":remoting_me2me_host_strings_${locale}_bundle_data", + ] + } + deps += [ + ":remoting_infoplist_strings", + "//remoting/resources:copy_locales", + ] + } + } + + if (is_linux) { + copy("remoting_me2me_host_copy_script") { + sources = [ + "linux/linux_me2me_host.py", + ] + outputs = [ + "$root_build_dir/remoting/chrome-remote-desktop", + ] + } + copy("remoting_me2me_host_copy_host") { + sources = [ + "linux/remoting_me2me_host_wrapper.sh", + ] + outputs = [ + "$root_build_dir/remoting/chrome-remote-desktop-host", + ] + deps = [ + ":remoting_me2me_host", + ] + } + group("remoting_dev_me2me_host") { + deps = [ + ":remoting_me2me_host", + ":remoting_me2me_host_copy_host", + ":remoting_me2me_host_copy_script", + ] + } + } + + if (is_mac) { + # native_messaging_host-InfoPlist.strings + foreach(locale, remoting_locales_with_underscores) { + bundle_data("native_messaging_host_strings_${locale}_bundle_data") { + sources = [ + "$root_gen_dir/remoting/host/native_messaging_host-InfoPlist.strings/$locale.lproj/InfoPlist.strings", + ] + outputs = [ + "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}", + ] + deps = [ + ":remoting_infoplist_strings", + ] + } + } + } + + target(app_target_type, "native_messaging_host") { + if (is_mac) { + info_plist = "setup/native_messaging_host-Info.plist" + extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] + } else { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + } + + sources = [ + "setup/me2me_native_messaging_host_entry_point.cc", + "setup/me2me_native_messaging_host_main.cc", + "setup/me2me_native_messaging_host_main.h", + ] + + deps = [ + ":remoting_infoplist_strings", + "//base", + "//remoting/base:breakpad", + "//remoting/host", + "//remoting/host/native_messaging", + "//remoting/host/setup", + ] + + if (is_mac) { + foreach(locale, remoting_locales_with_underscores) { + deps += [ + ":native_messaging_host_strings_${locale}_bundle_data", + ":remoting_host_locale_${locale}_bundle_data", + ] + } + deps += [ "//remoting/resources:copy_locales" ] + } + + # The |major|, |build| and |patch| versions are inherited from Chrome. + # Since Chrome's |minor| version is always '0', we replace it with a + # Chromoting-specific patch version. + defines = [ "VERSION=" + "$chrome_version_major" + "." + + "$remoting_version_patch" + "." + "$chrome_version_build" + + "." + "$chrome_version_patch" ] + } + } + + if (is_chrome_branded && enable_me2me_host && is_linux && !is_chromeos) { + # TODO(GYP): add support for archive_chromoting_tests variable? + + import("//build/config/zip.gni") + + build_deb_script = "installer/linux/build_deb.py" + deb_filename = + "$root_build_dir/" + exec_script(build_deb_script, + [ + "-p", + "-s", + rebase_path("//"), + ], + "string", + [ "installer/linux/build-deb.sh" ]) + changes_filename = + "$root_build_dir/" + get_path_info(deb_filename, "name") + ".changes" + + packaging_outputs = [ + deb_filename, + changes_filename, + + # TODO(GYP): Check that these are generated by build_deb.py. + #"$root_build_dir/remoting_me2me_host.debug", + #"$root_build_dir/remoting_start_host.debug", + #"$root_build_dir/native_messaging_host.debug", + #"$root_build_dir/remote_assistance_host.debug", + ] + + zip("remoting_me2me_host_archive") { + # Store the installer package(s) into a zip file so there is a + # consistent filename to reference for build archiving (i.e. in + # FILES.cfg). This also avoids possible conflicts with "wildcard" + # package handling in other build/signing scripts. + inputs = packaging_outputs + output = "$root_build_dir/remoting-me2me-host-linux.zip" + deps = [ + ":remoting_me2me_host_copy", + ] + } + + copy("remoting_me2me_host_copy") { + # Copy the debian package file, which has version info in it, + # to a consistewnt filename for use on Chromoting swarming bots. + sources = [ + deb_filename, + ] + outputs = [ + "$root_build_dir/remoting-me2me-host.deb", + ] + public_deps = [ + ":remoting_me2me_host_deb_installer", + ] + } + + action("remoting_me2me_host_deb_installer") { + script = build_deb_script + inputs = [ + build_deb_script, + "installer/linux/Makefile", + "installer/linux/debian/chrome-remote-desktop.init", + "installer/linux/debian/chrome-remote-desktop.pam", + "installer/linux/debian/compat", + "installer/linux/debian/control", + "installer/linux/debian/copyright", + "installer/linux/debian/postinst", + "installer/linux/debian/preinst", + "installer/linux/debian/rules", + ] + outputs = packaging_outputs + sources = [ + "installer/linux/build-deb.sh", + ] + args = [ + "-s", + rebase_path("//"), + "-o", + rebase_path("$root_build_dir"), + ] + + deps = [ + ":native_messaging_host", + ":remoting_me2me_host", + ":remoting_native_messaging_manifests", + ":remoting_start_host", + "//remoting/host/it2me:remote_assistance_host", + "//remoting/resources", + "//third_party/icu:icudata", + ] + } + } else if (is_win) { + # GYP version: //remoting/remoting_host_win.gypi:remoting_me2me_host_archive + action("remoting_me2me_host_archive") { + script = "//remoting/host/installer/build-installer-archive.py" + + deps = [ + ":credits", + ":remote_security_key", + ":remoting_core", + ":remoting_desktop", + ":remoting_me2me_host", + ":remoting_native_messaging_host", + ":remoting_native_messaging_manifests", + ":remoting_start_host", + "it2me:remote_assistance_host", + "//third_party/icu:icudata", + ] + + _output = "$root_out_dir/remoting-me2me-host-$target_os.zip" + + outputs = [ + _output, + ] + if (is_chrome_branded) { + _branding = "Chrome" + } else { + _branding = "Chromium" + } + + if (is_official_build) { + _official_build = "1" + } else { + _official_build = "0" + } + + _generated_files = rebase_path( + [ + "$root_out_dir/remote_assistance_host.exe", + "$root_out_dir/remote_security_key.exe", + "$root_out_dir/remoting_core.dll", + "$root_out_dir/remoting_desktop.exe", + "$root_out_dir/remoting_host.exe", + "$root_out_dir/remoting_native_messaging_host.exe", + "$root_out_dir/remoting_start_host.exe", + "$root_gen_dir/remoting/CREDITS.txt", + "$root_out_dir/remoting/com.google.chrome.remote_assistance.json", + "$root_out_dir/remoting/com.google.chrome.remote_desktop.json", + "$root_out_dir/icudtl.dat", + ], + root_build_dir) + _extra_files = [] + + args = [ + rebase_path("$root_gen_dir/installation", root_build_dir), + rebase_path(_output, root_build_dir), + "--source-file-roots", + rebase_path("//remoting/host/installer/win"), + "--source-files", + rebase_path("//remoting/host/installer/win/chromoting.wxs"), + rebase_path("//remoting/host/installer/win/parameters.json"), + + # Input files + "--generated-files", + ] + _generated_files + + [ + rebase_path("//remoting/resources/chromoting.ico"), + + # Position of files in zip file + "--generated-files-dst", + "files/remote_assistance_host.exe", + "files/remote_security_key.exe", + "files/remoting_core.dll", + "files/remoting_desktop.exe", + "files/remoting_host.exe", + "files/remoting_native_messaging_host.exe", + "files/remoting_start_host.exe", + "files/CREDITS.txt", + "files/com.google.chrome.remote_assistance.json", + "files/com.google.chrome.remote_desktop.json", + "files/chromoting.ico", + "files/icudtl.dat", + ] + _extra_files + # Defs + [ + "--defs", + "BRANDING=$_branding", + "DAEMON_CONTROLLER_CLSID={$daemon_controller_clsid}", + "RDP_DESKTOP_SESSION_CLSID={$rdp_desktop_session_clsid}", + "VERSION=$chrome_version_full", + "OFFICIAL_BUILD=$_official_build", + ] + } + } else if (is_mac) { + import("//build/config/zip.gni") + + action("remoting_me2me_host_archive") { + # TODO(GYP) TODO(crbug.com/622415) This needs work and testing. + + # TODO(GYP) At the very least, we need to add in the localized strings. + + _installer_mac_files = [ + "installer/mac/do_signing.sh", + "installer/mac/do_signing.props", + "installer/mac/ChromotingHost.pkgproj", + "installer/mac/ChromotingHostService.pkgproj", + "installer/mac/ChromotingHostUninstaller.pkgproj", + "installer/mac/LaunchAgents/org.chromium.chromoting.plist", + "installer/mac/PrivilegedHelperTools/org.chromium.chromoting.me2me.sh", + "installer/mac/Scripts/keystone_install.sh", + "installer/mac/Scripts/remoting_postflight.sh", + "installer/mac/Scripts/remoting_preflight.sh", + "installer/mac/Keystone/GoogleSoftwareUpdate.pkg", + "//chrome/installer/mac/pkg-dmg", + ] + + inputs = _installer_mac_files + + zip_path = "$root_build_dir/remoting-me2me-host-mac.zip" + + outputs = [ + "$root_build_dir/remoting-me2me-host-mac.zip", + ] + + script = "installer/build-installer-archive.py" + + # TODO(GYP) TODO(crbug.com/622415): Fill these in. + host_name_nospace = host_name + host_service_name_nospace = host_service_name + host_uninstaller_name_nospace = host_uninstaller_name + + args = [ + rebase_path(target_gen_dir, root_build_dir), + rebase_path(zip_path, root_build_dir), + "--source-file-roots", + rebase_path("installer/mac/", root_build_dir), + rebase_path("//chrome/installer/mac", root_build_dir), + "--source-files", + ] + rebase_path(_installer_mac_files, root_build_dir) + [ + "--generated-files", + "remoting_host_prefpane.prefPane", + "remoting_me2me_host.app", + "native_messaging_host.app", + "remote_assistance_host.app", + "remoting_host_uninstaller.app", + "remoting/com.google.chrome.remote_desktop.json", + "remoting/com.google.chrome.remote_assistance.json", + "--generated-files-dst", + "PreferencePanes/$prefpane_bundle_name", + "PrivilegedHelperTools/$host_bundle_name", + "PrivilegedHelperTools/$host_bundle_name/Contents/MacOS/$native_messaging_host_bundle_name", + "PrivilegedHelperTools/$host_bundle_name/Contents/MacOS/$remote_assistance_host_bundle_name", + "Applications/$host_uninstaller_name.app", + "Config/com.google.chrome.remote_desktop.json", + "Config/com.google.chrome.remote_assistance.json", + "--defs", + "VERSION=$chrome_version_full", + "VERSION_SHORT=$chrome_version_major.$chrome_version_minor.$chrome_version_build", + "VERSION_MAJOR=$chrome_version_major", + "VERSION_MINOR=$chrome_version_minor", + "HOST_NAME=$host_name", + "HOST_BUNDLE_NAME=$me2me_host_bundle_name", + "HOST_SERVICE_NAME=$host_service_name", + "HOST_UNINSTALLER_NAME=$host_uninstaller_name", + "HOST_PKG=$host_name", + "HOST_SERVICE_PKG=$host_service_name_nospace", + "HOST_UNINSTALLER_PKG=$host_uninstaller_name_nospace", + "BUNDLE_ID_HOST=$bundle_prefix.$host_name_nospace", + "BUNDLE_ID_HOST_SERVICE=$bundle_prefix.$host_service_name_nospace", + "BUNDLE_ID_HOST_UNINSTALLER=$bundle_prefix.$host_uninstaller_name_nospace", + "DMG_VOLUME_NAME=$host_name $chrome_version_full", + "DMG_FILE_NAME=$host_name_nospace-$chrome_version_full", + "NATIVE_MESSAGING_HOST_BUNDLE_NAME=$native_messaging_host_bundle_name", + "REMOTE_ASSISTANCE_HOST_BUNDLE_NAME=$remote_assistance_host_bundle_name", + "PREFPANE_BUNDLE_NAME=$prefpane_bundle_name", + ] + + deps = [ + ":native_messaging_host", + ":remoting_host_prefpane.prefPane", + ":remoting_host_uninstaller", + ":remoting_me2me_host", + ":remoting_native_messaging_manifests", + "//remoting/host/it2me:remote_assistance_host", + ] + } + + _uninstaller_plist = + "installer/mac/uninstaller/remoting_uninstaller-Info.plist" + + # remoting_uninstaller-InfoPlist.strings + foreach(locale, remoting_locales_with_underscores) { + bundle_data("remoting_uninstaller_strings_${locale}_bundle_data") { + sources = [ + "$root_gen_dir/remoting/host/remoting_uninstaller-InfoPlist.strings/$locale.lproj/InfoPlist.strings", + ] + outputs = [ + "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}", + ] + deps = [ + ":remoting_infoplist_strings", + ] + } + } + + mac_app_bundle("remoting_host_uninstaller") { + info_plist = _uninstaller_plist + + defines = [ + "HOST_BUNDLE_NAME=\"" + host_bundle_name + "\"", + "PREFPANE_BUNDLE_NAME=\"" + prefpane_bundle_name + "\"", + ] + + sources = [ + "constants_mac.cc", + "constants_mac.h", + "installer/mac/uninstaller/remoting_uninstaller.h", + "installer/mac/uninstaller/remoting_uninstaller.mm", + "installer/mac/uninstaller/remoting_uninstaller_app.h", + "installer/mac/uninstaller/remoting_uninstaller_app.mm", + ] + + libs = [ + "Cocoa.framework", + "CoreFoundation.framework", + "Security.framework", + ] + + deps = [ + ":remoting_host_uninstaller_xibs", + ":remoting_infoplist_strings", + "//base", + ] + foreach(locale, remoting_locales_with_underscores) { + deps += [ ":remoting_uninstaller_strings_${locale}_bundle_data" ] + } + } + + mac_xib_bundle_data("remoting_host_uninstaller_xibs") { + sources = [ + #"installer/mac/uninstaller/remoting_uninstaller.icns", + "installer/mac/uninstaller/remoting_uninstaller.xib", + #_uninstaller_plist + ] + } + + create_bundle("remoting_host_prefpane.prefPane") { + bundle_root_dir = "$root_build_dir/$target_name/Contents" + bundle_resources_dir = bundle_root_dir + "/Resources" + bundle_executable_dir = bundle_root_dir + "/MacOS" + + deps = [ + ":remoting_host_prefpane", + ":remoting_host_prefpane_bundle_data", + ":remoting_host_prefpane_plist", + ":remoting_host_prefpane_xibs", + ":remoting_infoplist_strings", + ] + + foreach(locale, remoting_locales_with_underscores) { + deps += [ ":remoting_host_prefpane_strings_${locale}_bundle_data" ] + } + } + + bundle_data("remoting_host_prefpane_bundle_data") { + deps = [ + ":remoting_host_prefpane", + ] + sources = [ + "$root_build_dir/gen/remoting/host/remoting_host_prefpane", + ] + outputs = [ + "{{bundle_executable_dir}}/remoting_host_prefname", + ] + } + + loadable_module("remoting_host_prefpane") { + output_dir = "$root_out_dir/gen/remoting/host" + output_extension = "" + + sources = [ + "mac/me2me_preference_pane.h", + "mac/me2me_preference_pane.mm", + "mac/me2me_preference_pane_confirm_pin.h", + "mac/me2me_preference_pane_confirm_pin.mm", + "mac/me2me_preference_pane_disable.h", + "mac/me2me_preference_pane_disable.mm", + ] + + libs = [ + "Cocoa.framework", + "CoreFoundation.framework", + "PreferencePanes.framework", + "Security.framework", + ] + + deps = [ + ":host", + ":remoting_host_prefpane_xibs", + ":remoting_infoplist_strings", + "//remoting/base", + "//remoting/resources:copy_locales", + "//third_party/jsoncpp", + ] + foreach(locale, remoting_locales_with_underscores) { + deps += [ ":remoting_host_prefpane_strings_${locale}_bundle_data" ] + } + } + + bundle_data("remoting_host_prefpane_plist") { + sources = [ + "mac/me2me_preference_pane-Info.plist", + ] + outputs = [ + "{{bundle_root_dir}}/Info.plist", + ] + } + + foreach(locale, remoting_locales_with_underscores) { + bundle_data("remoting_host_prefpane_strings_${locale}_bundle_data") { + sources = [ + "$root_gen_dir/remoting/host/me2me_preference_pane-InfoPlist.strings/$locale.lproj/InfoPlist.strings", + ] + outputs = [ + "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}", + ] + deps = [ + ":remoting_infoplist_strings", + ] + } + } + + mac_xib_bundle_data("remoting_host_prefpane_xibs") { + sources = [ + "mac/me2me_preference_pane.xib", + #"mac/me2me_preference_pane_confirm_pin.xib", + #"mac/me2me_preference_pane_disable.xib", + #"mac/me2me_preference_pane-Info.plist", + #"//remoting/resources/chromoting128.png", + ] + } + } else { + group("remoting_me2me_host_archive") { + } + } + + if (is_win && is_chrome_branded) { + # We do not release a 64 bits binary. So to avoid any potential + # misunderstanding, we only build 32 bits MSI file. + if (target_cpu == "x86") { + # The script uses "ia32" instead of "x86". + msi_script_arch = "ia32" + + # GYP version: remoting/remoting_host_win.gyp:remoting_host_installation + action("remoting_host_installation") { + deps = [ + "//remoting/host:remoting_me2me_host_archive", + ] + script = "../tools/zip2msi.py" + outputs = [ + "$root_out_dir/chromoting.msi", + ] + args = [ + "--wix_path", + rebase_path("//third_party/wix"), + "--intermediate_dir", + rebase_path("$root_gen_dir/installation", root_build_dir), + "--target_arch", + msi_script_arch, + rebase_path("$root_out_dir/remoting-me2me-host-$current_os.zip", + root_build_dir), + rebase_path(outputs[0], root_build_dir), + ] + } + } else { + group("remoting_host_installation") { + } + } + } +} diff --git a/chromium/remoting/host/it2me/BUILD.gn b/chromium/remoting/host/it2me/BUILD.gn new file mode 100644 index 00000000000..04c84884a4b --- /dev/null +++ b/chromium/remoting/host/it2me/BUILD.gn @@ -0,0 +1,149 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//remoting/remoting_enable.gni") +import("//remoting/remoting_srcs.gni") +import("//remoting/remoting_locales.gni") + +if (is_win) { + import("//remoting/host/predefines_win.gni") +} +if (is_mac) { + import("//build/config/mac/rules.gni") +} + +source_set("common") { + sources = rebase_path( + remoting_host_srcs_gypi_values.remoting_it2me_host_static_sources, + ".", + "//remoting") + + if (is_android) { + sources -= [ + "it2me_native_messaging_host.cc", + "it2me_native_messaging_host.h", + ] + } + + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//remoting:version", + ] + + deps = [ + "//base:i18n", + "//net:net", + "//remoting/base", + "//remoting/host", + "//remoting/protocol", + "//remoting/resources", + ] +} + +if (!is_chromeos && !is_android && enable_remoting_host) { + if (is_win) { + # GYP version: + # //remoting/remoting_host_win.gypi:remoting_it2me_native_messaging_host + executable("remote_assistance_host") { + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//base/allocator", + "//remoting/host:remoting_core", + "//remoting/host:remoting_windows_resources", + ] + + sources = [ + "$root_gen_dir/remoting/version.rc", + "it2me_native_messaging_host_entry_point.cc", + ] + + defines = host_predefines + [ "BINARY=BINARY_REMOTE_ASSISTANCE_HOST" ] + + ldflags = [ + "/MANIFEST:EMBED", + "/MANIFESTINPUT:" + + rebase_path("../win/common-controls.manifest", root_build_dir), + "/MANIFESTINPUT:" + + rebase_path("../win/dpi_aware.manifest", root_build_dir), + + # "/NODEFAULTLIB", TODO(zijiehe): Why IgnoreAllDefaultLibraries: true in + # GYP does not take effect? + "comctl32.lib", + ] + } + } else { + if (is_mac) { + app_target_type = "mac_app_bundle" + + # remote_assistance_host-InfoPlist.strings + foreach(locale, remoting_locales_with_underscores) { + bundle_data("remote_assistance_host_strings_${locale}_bundle_data") { + sources = [ + "$root_gen_dir/remoting/host/remote_assistance_host-InfoPlist.strings/$locale.lproj/InfoPlist.strings", + ] + outputs = [ + "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}", + ] + deps = [ + "//remoting/host:remoting_infoplist_strings", + ] + } + } + } else { + app_target_type = "executable" + } + + target(app_target_type, "remote_assistance_host") { + if (is_mac) { + info_plist = "remote_assistance_host-Info.plist" + extra_configs = [ + "//build/config/compiler:wexit_time_destructors", + "//remoting:version", + ] + } else { + configs += [ + "//build/config/compiler:wexit_time_destructors", + "//remoting:version", + ] + } + + sources = [ + "it2me_native_messaging_host_entry_point.cc", + "it2me_native_messaging_host_main.cc", + "it2me_native_messaging_host_main.h", + ] + + deps = [ + ":common", + "//build/config/sanitizers:deps", + "//remoting/host", + "//remoting/host/native_messaging", + "//remoting/proto", + "//ui/gfx", + ] + if (is_mac) { + foreach(locale, remoting_locales_with_underscores) { + deps += [ + ":remote_assistance_host_strings_${locale}_bundle_data", + "//remoting/host:remoting_host_locale_${locale}_bundle_data", + ] + } + deps += [ + "//remoting/host:remoting_infoplist_strings", + "//remoting/resources:copy_locales", + ] + } + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } + + if (is_desktop_linux) { + deps += [ "//build/config/linux/gtk2" ] + } + } + } +} diff --git a/chromium/remoting/host/native_messaging/BUILD.gn b/chromium/remoting/host/native_messaging/BUILD.gn new file mode 100644 index 00000000000..afefee11de6 --- /dev/null +++ b/chromium/remoting/host/native_messaging/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_srcs.gni") + +# GYP version: remoting/remoting_host.gypi:remoting_native_messaging_base +source_set("native_messaging") { + sources = rebase_path( + remoting_host_srcs_gypi_values.remoting_host_native_messaging_sources, + ".", + "//remoting") + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//base", + ] +} diff --git a/chromium/remoting/host/predefines_win.gni b/chromium/remoting/host/predefines_win.gni new file mode 100644 index 00000000000..34e934034c5 --- /dev/null +++ b/chromium/remoting/host/predefines_win.gni @@ -0,0 +1,20 @@ +# In Windows, we use the following defines to make sure certain resources are +# embedded into one binary only. + +# GN config is always executed after defines, so if we would like to generate +# defines ordered as +# #define BINARY_CORE=1 +# #define BINARY=BINARY_CORE +# we need to set these predefines as a list, and append others after it. + +assert(is_win) + +host_predefines = [ + "BINARY_CORE=1", # For remoting_core + "BINARY_DESKTOP=2", # For remoting_desktop + "BINARY_HOST_ME2ME=3", # For remoting_console + "BINARY_NATIVE_MESSAGING_HOST=4", # For remoting_native_messaging_host + "BINARY_REMOTE_ASSISTANCE_HOST=5", # For remote_assistance_host + "BINARY_REMOTE_SECURITY_KEY=6", # For remote_security_key + "BINARY_REMOTING_START_HOST=7", # For remoting_start_host +] diff --git a/chromium/remoting/host/setup/BUILD.gn b/chromium/remoting/host/setup/BUILD.gn new file mode 100644 index 00000000000..f43fe7b0920 --- /dev/null +++ b/chromium/remoting/host/setup/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_srcs.gni") + +source_set("setup") { + sources = + rebase_path(remoting_host_srcs_gypi_values.remoting_host_setup_sources, + ".", + "//remoting") + + configs += [ + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "//build/config/compiler:no_size_t_to_int_warning", + "//build/config/compiler:wexit_time_destructors", + "//remoting:version", + ] + + deps = [ + "//base", + "//google_apis", + "//remoting/host", + "//remoting/host/native_messaging", + ] + + if (is_win) { + deps += [ "//remoting/host:remoting_lib_idl" ] + } +} diff --git a/chromium/remoting/proto/BUILD.gn b/chromium/remoting/proto/BUILD.gn new file mode 100644 index 00000000000..268b6239498 --- /dev/null +++ b/chromium/remoting/proto/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +proto_library("proto") { + sources = [ + "audio.proto", + "control.proto", + "event.proto", + "internal.proto", + "mux.proto", + "video.proto", + ] +} diff --git a/chromium/remoting/protocol/BUILD.gn b/chromium/remoting/protocol/BUILD.gn new file mode 100644 index 00000000000..50f686e3627 --- /dev/null +++ b/chromium/remoting/protocol/BUILD.gn @@ -0,0 +1,130 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//remoting/remoting_srcs.gni") + +source_set("protocol") { + sources = rebase_path(remoting_srcs_gypi_values.remoting_protocol_sources, + ".", + "//remoting") + + configs += [ + "//build/config:precompiled_headers", + "//build/config/compiler:no_size_t_to_int_warning", + "//build/config/compiler:wexit_time_destructors", + ] + + public_deps = [ + "//remoting/proto", + "//third_party/libjingle", + ] + deps = [ + "//base", + "//crypto", + "//jingle:jingle_glue", + "//net", + "//remoting/base", + "//remoting/codec", + "//remoting/signaling", + "//third_party/boringssl", + "//third_party/libyuv", + ] + + if (!is_nacl) { + sources += + rebase_path(remoting_srcs_gypi_values.remoting_protocol_nonnacl_sources, + ".", + "//remoting") + + if (enable_webrtc) { + deps += [ "//third_party/libjingle:libjingle_webrtc" ] + } else { + sources -= [ + "webrtc_connection_to_client.cc", + "webrtc_transport.cc", + "webrtc_video_stream.cc", + ] + } + } +} + +source_set("test_support") { + testonly = true + + sources = [ + "fake_authenticator.cc", + "fake_authenticator.h", + "fake_connection_to_client.cc", + "fake_connection_to_client.h", + "fake_connection_to_host.cc", + "fake_connection_to_host.h", + "fake_datagram_socket.cc", + "fake_datagram_socket.h", + "fake_desktop_capturer.cc", + "fake_desktop_capturer.h", + "fake_session.cc", + "fake_session.h", + "fake_stream_socket.cc", + "fake_stream_socket.h", + "fake_video_renderer.cc", + "fake_video_renderer.h", + "protocol_mock_objects.cc", + "protocol_mock_objects.h", + ] + + public_deps = [ + ":protocol", + "//testing/gmock", + ] +} + +source_set("unit_tests") { + testonly = true + + sources = [ + "authenticator_test_base.cc", + "authenticator_test_base.h", + "capture_scheduler_unittest.cc", + "channel_multiplexer_unittest.cc", + "channel_socket_adapter_unittest.cc", + "chromium_socket_factory_unittest.cc", + "client_video_dispatcher_unittest.cc", + "clipboard_echo_filter_unittest.cc", + "clipboard_filter_unittest.cc", + "connection_tester.cc", + "connection_tester.h", + "connection_unittest.cc", + "content_description_unittest.cc", + "http_ice_config_request_unittest.cc", + "ice_transport_unittest.cc", + "input_event_tracker_unittest.cc", + "input_filter_unittest.cc", + "jingle_messages_unittest.cc", + "jingle_session_unittest.cc", + "message_decoder_unittest.cc", + "message_reader_unittest.cc", + "monitored_video_stub_unittest.cc", + "mouse_input_filter_unittest.cc", + "negotiating_authenticator_unittest.cc", + "pairing_registry_unittest.cc", + "port_range_unittest.cc", + "ppapi_module_stub.cc", + "pseudotcp_adapter_unittest.cc", + "session_config_unittest.cc", + "spake2_authenticator_unittest.cc", + "ssl_hmac_channel_authenticator_unittest.cc", + "third_party_authenticator_unittest.cc", + "v2_authenticator_unittest.cc", + "video_frame_pump_unittest.cc", + "webrtc_transport_unittest.cc", + ] + + deps = [ + ":test_support", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + ] +} diff --git a/chromium/remoting/remoting_enable.gni b/chromium/remoting/remoting_enable.gni new file mode 100644 index 00000000000..d42a2e33338 --- /dev/null +++ b/chromium/remoting/remoting_enable.gni @@ -0,0 +1,23 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Keep in sync with remoting/remoting_enable.gypi. + +import("//build/config/ui.gni") + +enable_remoting_host = false +enable_me2me_host = false + +if (is_win || (is_linux && !is_chromeos && use_x11) || is_mac) { + enable_remoting_host = true + enable_me2me_host = true +} + +if (is_linux && is_chromeos) { + enable_remoting_host = true +} + +if (is_android) { + enable_remoting_host = true +} diff --git a/chromium/remoting/remoting_locales.gni b/chromium/remoting/remoting_locales.gni new file mode 100644 index 00000000000..a9702de66ef --- /dev/null +++ b/chromium/remoting/remoting_locales.gni @@ -0,0 +1,158 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +webapp_locale_dir = "$root_gen_dir/remoting/webapp/_locales" + +# See also remoting_locales_with_underscores below. +remoting_locales = [ + "am", + "ar", + "bg", + + "bn", + "ca", + "cs", + "da", + "de", + "el", + "en", + "en-GB", + "es", + "es-419", + "et", + + "fa", + "fake-bidi", + "fi", + "fil", + "fr", + + "gu", + "he", + "hi", + "hr", + "hu", + "id", + "it", + "ja", + + "kn", + "ko", + "lt", + "lv", + + "ml", + "mr", + "ms", + "nb", + "nl", + "pl", + "pt-BR", + "pt-PT", + "ro", + "ru", + "sk", + "sl", + "sr", + "sv", + + "sw", + "ta", + "te", + "th", + "tr", + "uk", + "vi", + "zh-CN", + "zh-TW", +] + +# Some locales have hyphens in the names but for some uses underscores are +# needed. +remoting_locales_with_underscores = remoting_locales +remoting_locales_with_underscores -= [ + "en-GB", + "es-419", + + "fake-bidi", + "pt-BR", + "pt-PT", + "zh-CN", + "zh-TW", +] +remoting_locales_with_underscores += [ + "en_GB", + "es_419", + + "fake_bidi", + "pt_BR", + "pt_PT", + "zh_CN", + "zh_TW", +] + +if (is_chromeos) { + remoting_locales += [ "en-US" ] + remoting_locales_with_underscores += [ "en_US" ] +} + +messages_locales = remoting_locales_with_underscores +if (!is_chromeos) { + # The messages output includes a separate one for en-US that the pak ones + # don't have. We don't need to do this on ChromeOS since en_US is in the + # locales list be default there. + messages_locales += [ "en_US" ] +} + +remoting_android_locales = [ + "am", + "ar", + "bg", + "ca", + "cs", + "da", + "de", + "el", + "en-rGB", + "es", + "es-rUS", + "fa", + "fi", + "fr", + "hi", + "hr", + "hu", + "in", + "it", + "iw", + "ja", + "ko", + "lt", + "lv", + "nb", + "nl", + "pl", + "pt-rBR", + "pt-rPT", + "ro", + "ru", + "sk", + "sl", + "sr", + "sv", + "sw", + "th", + "tl", + "tr", + "uk", + "vi", + "zh-rCN", + "zh-rTW", +] + +# The list of .json files generated by remoting_strings.grd. +remoting_webapp_locale_files = + process_file_template( + messages_locales, + [ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ]) diff --git a/chromium/remoting/remoting_options.gni b/chromium/remoting/remoting_options.gni new file mode 100644 index 00000000000..f16cbd37252 --- /dev/null +++ b/chromium/remoting/remoting_options.gni @@ -0,0 +1,45 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") + +# These arguments can be overridden from the command line (see "gn help args"). +declare_args() { + # Set this to run the jscompile checks after building the webapp. + enable_remoting_jscompile = false + + # Set this to enable building internal AppRemoting apps. + enable_internal_app_remoting_targets = false + + # Set this to enable Android Chromoting Cardboard Activity. + remoting_enable_cardboard = false +} + +# Set this to use GCD instead of the remoting directory service. +remoting_use_gcd = 0 + +# Enable the multi-process host on Windows by default. +if (is_win) { + remoting_multi_process = 1 +} else { + remoting_multi_process = 0 +} + +remoting_rdp_session = 1 + +if (is_chrome_branded) { + branding_path = "//remoting/branding_Chrome" +} else { + branding_path = "//remoting/branding_Chromium" +} + +# The ar_service_environment variable is used to define the target +# environment for the app being built. +# The allowed values are dev and prod. +if (is_debug) { + ar_service_environment = "dev" +} else { + # Non-dev builds should default to 'prod'. + ar_service_environment = "prod" +} diff --git a/chromium/remoting/remoting_srcs.gni b/chromium/remoting/remoting_srcs.gni new file mode 100644 index 00000000000..fe87adf61af --- /dev/null +++ b/chromium/remoting/remoting_srcs.gni @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +remoting_srcs_gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("remoting_srcs.gypi") ], + "scope", + [ "remoting_srcs.gypi" ]) + +remoting_host_srcs_gypi_values = + exec_script("//build/gypi_to_gn.py", + [ rebase_path("remoting_host_srcs.gypi") ], + "scope", + [ "remoting_host_srcs.gypi" ]) diff --git a/chromium/remoting/remoting_version.gni b/chromium/remoting/remoting_version.gni new file mode 100644 index 00000000000..13e5162bfbb --- /dev/null +++ b/chromium/remoting/remoting_version.gni @@ -0,0 +1,46 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chrome_build.gni") + +_version_py_abspath = "//build/util/version.py" +_remoting_version_abspath = "//remoting/VERSION" +if (is_chrome_branded) { + _remoting_branding_abspath = "//remoting/branding_Chrome" +} else { + _remoting_branding_abspath = "//remoting/branding_Chromium" +} + +# Set these files as being input dependencies to the scripts, so the build will +# be re-run if the files change. +remoting_version_files = [ + _remoting_version_abspath, + _remoting_branding_abspath, +] + +_remoting_version_path = rebase_path(_remoting_version_abspath, root_build_dir) +_remoting_branding_path = + rebase_path(_remoting_branding_abspath, root_build_dir) + +_branding_dictionary_template = "mac_host_bundle = \"@MAC_HOST_BUNDLE_NAME@\" " + "mac_native_messaging_bundle = \"@MAC_NATIVE_MESSAGING_HOST_BUNDLE_NAME@\" " + "mac_remote_assistance_bundle = \"@MAC_REMOTE_ASSISTANCE_HOST_BUNDLE_NAME@\" " + "prefpane_bundle_name = \"@MAC_PREFPANE_BUNDLE_NAME@\" " + "host_bundle_name = \"@MAC_HOST_BUNDLE_NAME@\" " + "host_name= \"@MAC_HOST_PACKAGE_NAME@\" " + "host_service_name = \"@DAEMON_FILE_NAME@\" " + "bundle_prefix = \"@MAC_UNINSTALLER_BUNDLE_PREFIX@\" " + "host_uninstaller_name = \"@MAC_UNINSTALLER_NAME@\"" + +_result = exec_script(_version_py_abspath, + [ + "-f", + _remoting_branding_path, + "-t", + _branding_dictionary_template, + ], + "scope", + remoting_version_files) + +prefpane_bundle_name = _result.prefpane_bundle_name +host_bundle_name = _result.host_bundle_name +host_name = _result.host_name +host_service_name = _result.host_service_name +bundle_prefix = _result.bundle_prefix +host_uninstaller_name = _result.host_uninstaller_name +me2me_host_bundle_name = _result.mac_host_bundle +native_messaging_host_bundle_name = _result.mac_native_messaging_bundle +remote_assistance_host_bundle_name = _result.mac_remote_assistance_bundle diff --git a/chromium/remoting/resources/BUILD.gn b/chromium/remoting/resources/BUILD.gn new file mode 100644 index 00000000000..3cc91d80167 --- /dev/null +++ b/chromium/remoting/resources/BUILD.gn @@ -0,0 +1,146 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_locales.gni") +import("//tools/grit/grit_rule.gni") + +if (is_android) { + import("//build/config/android/rules.gni") +} + +group("resources") { + public_deps = [ + ":copy_locales", + ":strings", + ":verify_resources", + ] +} + +# TODO(GYP) enable verify_resources. The bots are complaining about +# gen/main.html not being found but this doesn't seems to reproduce locally. + +action("verify_resources") { + script = "//remoting/tools/verify_resources.py" + + sources_to_verify = [ + # "$root_gen_dir/main.html", + "../host/continue_window_mac.mm", + "../host/disconnect_window_mac.mm", + "../host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2", + "../host/mac/me2me_preference_pane-InfoPlist.strings.jinja2", + "../host/win/core.rc.jinja2", + "../host/win/host_messages.mc.jinja2", + "../host/win/version.rc.jinja2", + "../resources/play_store_resources.cc", + "../webapp/crd/js/background.js", + "../webapp/crd/js/butter_bar.js", + "../webapp/base/js/error.js", + "../webapp/crd/js/host_list.js", + "../webapp/crd/js/host_setup_dialog.js", + "../webapp/crd/js/host_table_entry.js", + "../webapp/crd/manifest.json.jinja2", + "../webapp/crd/js/paired_client_manager.js", + "../webapp/crd/js/desktop_remoting.js", + "../webapp/crd/js/window_frame.js", + ] + + inputs = [ "remoting_strings.grd" ] + sources_to_verify + + stampfile = "$root_build_dir/remoting_resources_verified_stamp" + outputs = [ + stampfile, + ] + + args = [ + "-t", + rebase_path(stampfile, root_build_dir), + "-r", + rebase_path("remoting_strings.grd", root_build_dir), + ] + rebase_path(sources_to_verify, root_build_dir) + + deps = [ + # "//remoting/webapp:webapp", + ] # Generates main.html. +} + +if (is_android) { + android_string_outputs = + [ "remoting/android/res/values/remoting_strings.xml" ] + android_string_outputs += process_file_template( + remoting_android_locales, + [ "remoting/android/res/values-{{source_name_part}}/remoting_strings.xml" ]) +} + +grit("strings") { + source = "remoting_strings.grd" + output_name = "remoting_strings" + + # The grd file encodes "remoting/..." in the name, so root everything in the + # generated file root. + output_dir = root_gen_dir + + outputs = [ + "remoting/base/string_resources.h", + ] + + # The grd produces a *.pak file and a messages.json file (this one uses + # underscores instead of hyphens) for each locale. + outputs += + process_file_template(remoting_locales, + [ "remoting/resources/{{source_name_part}}.pak" ]) + + outputs += remoting_webapp_locale_files + + if (is_android) { + outputs += android_string_outputs + } +} + +if (is_android) { + java_strings_grd_prebuilt("strings_java") { + grit_output_dir = "$root_gen_dir/remoting/android/res" + generated_files = + rebase_path(android_string_outputs, "remoting/android/res", ".") + deps = [ + ":strings", + ] + } +} + +action("copy_locales") { + script = "../tools/build/remoting_copy_locales.py" + + # The gyp build calls out to Python, but the Python just computes a simple + # replacement over the locales. Here, we can do this in GN script by + # pretending the locale list is a list of files. The {{source_name_part}} + # will just expand to the locale name. + inputs = process_file_template(remoting_locales, + [ "$target_gen_dir/{{source_name_part}}.pak" ]) + + # Likewise, process the outputs in the same way as the inputs. + if (is_mac || is_ios) { + # On mac, use underscores instead of hyphens and put the files in a + # different place. + outputs = process_file_template( + remoting_locales_with_underscores, + [ "$root_build_dir/remoting/resources/{{source_name_part}}.lproj/locale.pak" ]) + } else { + outputs = process_file_template( + remoting_locales, + [ "$root_build_dir/remoting_locales/{{source_name_part}}.pak" ]) + } + + args = [ + "-p", + current_os, + "-g", + rebase_path(root_gen_dir, root_build_dir), + "-x", + rebase_path(root_out_dir, root_build_dir), + ] + remoting_locales + + deps = [ + ":strings", + ] +} diff --git a/chromium/remoting/signaling/BUILD.gn b/chromium/remoting/signaling/BUILD.gn new file mode 100644 index 00000000000..db2cf9820be --- /dev/null +++ b/chromium/remoting/signaling/BUILD.gn @@ -0,0 +1,75 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_srcs.gni") + +source_set("signaling") { + sources = rebase_path(remoting_srcs_gypi_values.remoting_signaling_sources, + ".", + "//remoting") + + configs += [ + "//build/config/compiler:no_size_t_to_int_warning", + "//build/config/compiler:wexit_time_destructors", + ] + + public_deps = [ + "//remoting/proto", + "//third_party/libjingle", + ] + + deps = [ + "//base", + "//crypto", + "//jingle:jingle_glue", + "//net", + "//remoting/base", + ] + + if (is_nacl) { + sources -= [ + "log_to_server.cc", + "server_log_entry.cc", + "xmpp_signal_strategy.cc", + ] + } +} + +source_set("test_support") { + testonly = true + + sources = [ + "fake_signal_strategy.cc", + "fake_signal_strategy.h", + "mock_signal_strategy.cc", + "mock_signal_strategy.h", + ] + + public_deps = [ + ":signaling", + "//testing/gmock", + ] +} + +source_set("unit_tests") { + testonly = true + + sources = [ + "iq_sender_unittest.cc", + "jid_util_unittest.cc", + "log_to_server_unittest.cc", + "push_notification_subscriber_unittest.cc", + "server_log_entry_unittest.cc", + "server_log_entry_unittest.h", + "xmpp_login_handler_unittest.cc", + "xmpp_signal_strategy_unittest.cc", + "xmpp_stream_parser_unittest.cc", + ] + + deps = [ + ":test_support", + "//testing/gmock", + "//testing/gtest", + ] +} diff --git a/chromium/remoting/test/BUILD.gn b/chromium/remoting/test/BUILD.gn new file mode 100644 index 00000000000..ef371e640ab --- /dev/null +++ b/chromium/remoting/test/BUILD.gn @@ -0,0 +1,225 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//remoting/remoting_enable.gni") + +source_set("test_support") { + testonly = true + + sources = [ + "access_token_fetcher.cc", + "access_token_fetcher.h", + "app_remoting_report_issue_request.cc", + "app_remoting_report_issue_request.h", + "app_remoting_service_urls.cc", + "app_remoting_service_urls.h", + "chromoting_test_driver_environment.cc", + "chromoting_test_driver_environment.h", + "connection_setup_info.cc", + "connection_setup_info.h", + "connection_time_observer.cc", + "connection_time_observer.h", + "cyclic_frame_generator.cc", + "cyclic_frame_generator.h", + "fake_access_token_fetcher.cc", + "fake_access_token_fetcher.h", + "fake_app_remoting_report_issue_request.cc", + "fake_app_remoting_report_issue_request.h", + "fake_host_list_fetcher.cc", + "fake_host_list_fetcher.h", + "fake_network_dispatcher.cc", + "fake_network_dispatcher.h", + "fake_network_manager.cc", + "fake_network_manager.h", + "fake_port_allocator.cc", + "fake_port_allocator.h", + "fake_refresh_token_store.cc", + "fake_refresh_token_store.h", + "fake_remote_host_info_fetcher.cc", + "fake_remote_host_info_fetcher.h", + "fake_socket_factory.cc", + "fake_socket_factory.h", + "host_info.cc", + "host_info.h", + "host_list_fetcher.cc", + "host_list_fetcher.h", + "leaky_bucket.cc", + "leaky_bucket.h", + "mock_access_token_fetcher.cc", + "mock_access_token_fetcher.h", + "refresh_token_store.cc", + "refresh_token_store.h", + "remote_application_details.h", + "remote_connection_observer.h", + "remote_host_info.cc", + "remote_host_info.h", + "remote_host_info_fetcher.cc", + "remote_host_info_fetcher.h", + "rgb_value.cc", + "rgb_value.h", + "test_chromoting_client.cc", + "test_chromoting_client.h", + "test_video_renderer.cc", + "test_video_renderer.h", + "video_frame_writer.cc", + "video_frame_writer.h", + ] + + public_deps = [ + "//base", + "//net", + "//remoting/base", + "//remoting/client", + "//remoting/codec", + "//remoting/protocol", + "//remoting/signaling", + "//third_party/webrtc/modules/desktop_capture", + "//ui/gfx", + ] + + deps = [ + "//google_apis", + "//skia", + "//testing/gmock", + "//testing/gtest", + "//third_party/libjingle", + ] +} + +executable("chromoting_test_driver") { + testonly = true + + sources = [ + "chromoting_test_driver.cc", + "chromoting_test_driver_tests.cc", + "chromoting_test_fixture.cc", + "chromoting_test_fixture.h", + ] + + deps = [ + ":test_support", + "//base/test:test_support", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//testing/gtest", + ] +} + +source_set("ar_test_driver_common") { + testonly = true + + sources = [ + "app_remoting_connected_client_fixture.cc", + "app_remoting_connected_client_fixture.h", + "app_remoting_connection_helper.cc", + "app_remoting_connection_helper.h", + "app_remoting_latency_test_fixture.cc", + "app_remoting_latency_test_fixture.h", + "app_remoting_test_driver_environment.cc", + "app_remoting_test_driver_environment.h", + ] + + deps = [ + ":test_support", + "//testing/gtest", + "//third_party/webrtc/modules/desktop_capture", + ] +} + +# An external version of the test driver tool which includes minimal tests +executable("ar_sample_test_driver") { + testonly = true + + sources = [ + "app_remoting_sample_test_driver_environment.cc", + "app_remoting_test_driver.cc", + ] + + deps = [ + ":ar_test_driver_common", + "//base/test:test_support", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//testing/gtest", + ] +} + +if (enable_remoting_host && !is_android && !is_chromeos) { + static_library("fake_connection_event_logger") { + testonly = true + + sources = [ + "fake_connection_event_logger.cc", + "fake_connection_event_logger.h", + ] + + deps = [ + "//remoting/host", + "//remoting/protocol:test_support", + ] + } + + static_library("it2me_standalone_host") { + testonly = true + + sources = [ + "it2me_standalone_host.cc", + "it2me_standalone_host.h", + ] + + deps = [ + ":fake_connection_event_logger", + "//third_party/webrtc/modules/desktop_capture", + ] + + public_deps = [ + "//remoting/host:test_support", + "//testing/gmock", + ] + } + + executable("it2me_standalone_host_main") { + testonly = true + + sources = [ + "it2me_standalone_host_main.cc", + ] + + deps = [ + ":it2me_standalone_host", + "//build/win:default_exe_manifest", + ] + + if (is_desktop_linux) { + deps += [ "//build/config/linux/gtk2" ] + } + } +} + +source_set("unit_tests") { + testonly = true + + sources = [ + "access_token_fetcher_unittest.cc", + "app_remoting_report_issue_request_unittest.cc", + "app_remoting_test_driver_environment_unittest.cc", + "chromoting_test_driver_environment_unittest.cc", + "connection_time_observer_unittest.cc", + "host_list_fetcher_unittest.cc", + "remote_host_info_fetcher_unittest.cc", + "test_chromoting_client_unittest.cc", + "test_video_renderer_unittest.cc", + ] + + deps = [ + ":ar_test_driver_common", + ":test_support", + "//base", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/libyuv", + "//third_party/webrtc/modules/desktop_capture", + ] +} diff --git a/chromium/remoting/tools/build/remoting_localize.gni b/chromium/remoting/tools/build/remoting_localize.gni new file mode 100644 index 00000000000..54ff46e27f8 --- /dev/null +++ b/chromium/remoting/tools/build/remoting_localize.gni @@ -0,0 +1,113 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Calls the remoting_localize script with a jinja2 template. +# +# Arguments +# +# sources (required) +# List of jinja2 files to load. This is the template. +# +# locales (required) +# List of locales. +# +# locale_dir (optional) +# +# defines (optional) +# List of defines to pass to script. +# Example: defines = [ "FOO_HOST_PATH=bar" ] +# +# variables (optional) +# List of variables to pass to script. +# +# output (optiona) +# Substitution pattern for the output. Defaults to a file in the target +# gen dir with the extension stripped (normally the extension is ".jinja2" +# which then leaves the non-tempaltized file name). +# TODO(brettw) Need locale_output. This is a per-locale output file. +# +# encoding (optional) +# String. +# +# deps (optional) +# visibility (optional) +template("remoting_localize") { + action_foreach(target_name) { + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + + script = "//remoting/tools/build/remoting_localize.py" + + sources = invoker.sources + + if (defined(invoker.output)) { + outputs = [ + invoker.output, + ] + } else { + outputs = [ + "$target_gen_dir/{{source_name_part}}", + ] + } + + args = [] + + if (defined(invoker.locale_dir)) { + args += [ + "--locale_dir", + rebase_path(invoker.locale_dir, root_build_dir), + ] + } + + # Add defines to command line. + if (defined(invoker.defines)) { + foreach(i, invoker.defines) { + args += [ + "--define", + i, + ] + } + } + + # Add variables to command line. + if (defined(invoker.variables)) { + foreach(i, invoker.variables) { + args += [ + "--variables", + i, + ] + } + } + + # The template file is required. + args += [ + "--template", + "{{source}}", + ] + + args += [ + "--output", + rebase_path(outputs[0], root_build_dir), + ] + + if (defined(invoker.encoding)) { + args += [ + "--encoding", + invoker.encoding, + ] + } + + args += invoker.locales + + if (defined(invoker.deps)) { + deps = invoker.deps + } else { + deps = [] + } + + # This script reads the messages strings from the generated resource files. + deps += [ "//remoting/resources:strings" ] + } +} diff --git a/chromium/remoting/tools/javascript_key_tester/BUILD.gn b/chromium/remoting/tools/javascript_key_tester/BUILD.gn new file mode 100644 index 00000000000..3fea7683921 --- /dev/null +++ b/chromium/remoting/tools/javascript_key_tester/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +if (enable_nacl) { + group("javascript_key_tester") { + deps = [ + ":javascript_key_tester_copies", + ] + } + + copy("javascript_key_tester_copies") { + pexe_dir = get_label_info( + "pnacl:remoting_key_tester_newlib(//build/toolchain/nacl:newlib_pnacl)", + "root_out_dir") + + sources = [ + "$pexe_dir/remoting_key_tester_newlib.pexe", + "background.js", + "chord_tracker.js", + "event_listeners.js", + "icon_128.png", + "main.css", + "main.html", + "main.js", + "manifest.json", + "pnacl/remoting_key_tester.nmf", + ] + + outputs = [ + "$target_out_dir/remoting/key_tester/{{source_file_part}}", + ] + + deps = [ + ":javascript_key_tester_jscompile", + "pnacl:remoting_key_tester_newlib(//build/toolchain/nacl:newlib_pnacl)", + ] + } + + group("javascript_key_tester_jscompile") { + # TODO(GYP): crbug.com/471926 add support for run_jscompile=true. + run_jscompile = false + if (run_jscompile) { + } + } +} diff --git a/chromium/remoting/tools/javascript_key_tester/pnacl/BUILD.gn b/chromium/remoting/tools/javascript_key_tester/pnacl/BUILD.gn new file mode 100644 index 00000000000..fbd8935123f --- /dev/null +++ b/chromium/remoting/tools/javascript_key_tester/pnacl/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_nacl, + "These targets must only be built using the untrusted NaCl toolchains.") + +executable("remoting_key_tester_newlib") { + sources = [ + "remoting_key_tester.cc", + ] + + deps = [ + "//build/config/sanitizers:deps", + "//ppapi/cpp", + "//ppapi/native_client:ppapi_lib", + ] +} diff --git a/chromium/remoting/webapp/BUILD.gn b/chromium/remoting/webapp/BUILD.gn new file mode 100644 index 00000000000..bbc36635d29 --- /dev/null +++ b/chromium/remoting/webapp/BUILD.gn @@ -0,0 +1,108 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Keep in sync with targets in remoting/remoting_client.gypi. + +import("//build/config/features.gni") +import("//remoting/webapp/build_template.gni") +import("//remoting/webapp/files.gni") + +# GYP version: remoting/remoting_client:remoting_credits +action("credits") { + about_credits_file = "$target_gen_dir/credits.html" + script = "//tools/licenses.py" + + inputs = [ + "base/html/credits.tmpl", + "base/html/credits_entry.tmpl", + ] + + outputs = [ + about_credits_file, + ] + + args = [ + "credits", + rebase_path(about_credits_file, root_build_dir), + "--file-template", + rebase_path("base/html/credits.tmpl", root_build_dir), + "--entry-template", + rebase_path("base/html/credits_entry.tmpl", root_build_dir), + ] +} + +desktop_remoting_webapp("webapp") { + output_dir = "$root_build_dir/remoting/remoting-webapp.v2" + zip_path = "$root_build_dir/remoting-webapp.v2.zip" + extra_files = [ "crd/remoting_client_pnacl.nmf.jinja2" ] +} + +# GYP version: remoting/remoting_tests.gypi:remoting_browser_test_resources +copy("browser_test_resources") { + sources = remoting_webapp_browsertest_main_html_extra_files + outputs = [ + "$root_out_dir/remoting/browser_test_resources/{{source_file_part}}", + ] +} + +remoting_unit_test_out_dir = "$root_out_dir/remoting/unittests" + +group("unit_tests") { + data_deps = [ + ":blanketjs", + ":unittest_html", + ":js_files", + ":qunit", + ":sinonjs", + ] +} + +copy("js_files") { + # This list corresponds to webapp_js_files in remoting_webapp_unittests + # target in GYP. + sources = webapp_js_files + remoting_webapp_unittests_all_files + outputs = [ + "$remoting_unit_test_out_dir/{{source_file_part}}", + ] +} + +copy("blanketjs") { + sources = [ + "//third_party/blanketjs/src/blanket.js", + "//third_party/blanketjs/src/qunit_adapter.js", + ] + outputs = [ + "$remoting_unit_test_out_dir/blanketjs/{{source_file_part}}", + ] +} + +copy("sinonjs") { + sources = [ + "//third_party/sinonjs/src/sinon-qunit.js", + "//third_party/sinonjs/src/sinon.js", + ] + outputs = [ + "$remoting_unit_test_out_dir/sinonjs/{{source_file_part}}", + ] +} + +copy("qunit") { + sources = [ + "//third_party/qunit/src/browser_test_harness.js", + "//third_party/qunit/src/qunit.css", + "//third_party/qunit/src/qunit.js", + ] + outputs = [ + "$remoting_unit_test_out_dir/qunit/{{source_file_part}}", + ] +} + +build_webapp_html("unittest_html") { + html_template_file = remoting_webapp_unittests_template_main + html_template_include_files = [] + js_files = remoting_webapp_unittests_all_js_files + html_output = "$remoting_unit_test_out_dir/unittests.html" + exclude_js = remoting_webapp_unittests_exclude_js_files + instrument_js = webapp_js_files +} diff --git a/chromium/remoting/webapp/build_template.gni b/chromium/remoting/webapp/build_template.gni new file mode 100644 index 00000000000..df443fb5c0c --- /dev/null +++ b/chromium/remoting/webapp/build_template.gni @@ -0,0 +1,299 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Keep in sync with 'remoting_webapp' target in remoting/remoting_client.gypi. + +import("//build/config/chrome_build.gni") +import("//build/config/features.gni") +import("//build/util/version.gni") +import("//remoting/remoting_locales.gni") +import("//remoting/remoting_options.gni") +import("//remoting/remoting_version.gni") +import("//remoting/webapp/files.gni") +import("//third_party/closure_compiler/closure_args.gni") + +# The base remoting directory that is used as the root directory for file +# references. Many of the scripts rely on the files being specified relative +# to this directory. +remoting_dir = "//remoting" + +buildtype = "Dev" +if (!is_debug) { + if (is_official_build) { + buildtype = "Official" + } else { + buildtype = "Release" + } +} + +template("build_locales_listfile") { + action(target_name) { + locales_listfile_output = invoker.locales_listfile_output + + script = "../tools/build/remoting_localize.py" + + inputs = [] + outputs = [ + locales_listfile_output, + ] + + args = [ + "--locale_output", + rebase_path(webapp_locale_dir, root_build_dir) + + "/@{json_suffix}/messages.json", + "--locales_listfile", + rebase_path(locales_listfile_output, root_build_dir), + ] + args += remoting_locales + } +} + +template("build_webapp_html") { + target_jscompile = "" + + # Do not enable JSCompile on instrumented builds. + if (enable_remoting_jscompile && invoker.instrument_js == []) { + target_jscompile = "${target_name}_jscompile" + target_jscompile_stamp = "$target_gen_dir/${target_jscompile}.stamp" + action(target_jscompile) { + js_files = remoting_webapp_js_proto_files + invoker.js_files + externs = + remoting_webapp_js_externs_files + [ + "../../third_party/closure_compiler/externs/chrome_extensions.js", + "../../third_party/closure_compiler/externs/metrics_private.js", + ] + + script = "../../third_party/closure_compiler/compile.py" + inputs = js_files + outputs = [ + target_jscompile_stamp, + ] + + extra_closure_args = [ + "jscomp_error=reportUnknownTypes", + "jscomp_error=duplicate", + "jscomp_error=misplacedTypeAnnotation", + ] + + args = rebase_path(js_files, root_build_dir) + args += [ + "--no-single-file", + "--out-file", + rebase_path(target_jscompile_stamp, root_build_dir), + "--closure-args", + ] + closure_args + extra_closure_args + args += [ "--externs" ] + rebase_path(externs, root_build_dir) + } + } + + action(target_name) { + html_template_file = invoker.html_template_file + html_template_include_files = invoker.html_template_include_files + js_files = invoker.js_files + html_output = invoker.html_output + exclude_js = invoker.exclude_js + instrument_js = invoker.instrument_js + + script = rebase_path("//remoting/webapp/build-html.py") + + # Create a file that contains a list of all the JavaScript files needed + # to build the unit test page. This is needed to avoid problems on platforms + # that limit the size of a command line. + file_list = "$target_gen_dir/${target_name}_files.txt" + files = rebase_path(js_files, root_build_dir) + write_file(file_list, files) + + inputs = [ html_template_file ] + html_template_include_files + js_files + + outputs = [ + html_output, + ] + + if (target_jscompile != "") { + deps = [ + ":$target_jscompile", + ] + } + + args = [ + rebase_path(html_output, root_build_dir), + rebase_path(html_template_file, root_build_dir), + ] + args += [ + "--template-dir", + rebase_path(remoting_dir, root_build_dir), + ] + args += [ "--templates" ] + html_template_include_files + args += [ + "--js-list-file", + rebase_path(file_list, root_build_dir), + ] + args += [ "--templates" ] + html_template_include_files + args += [ + "--js-list-file", + rebase_path(file_list, root_build_dir), + ] + args += [ "--exclude-js" ] + rebase_path(exclude_js, root_build_dir) + args += [ "--instrument-js" ] + rebase_path(instrument_js, root_build_dir) + } +} + +template("desktop_remoting_webapp") { + locales_listfile = target_name + "_locales" + locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" + + build_locales_listfile(locales_listfile) { + # Template uses locales_listfile_output from outer scope. + } + + background_html = target_name + "_background_html" + background_html_output = "$target_gen_dir/html/$target_name/background.html" + + build_webapp_html(background_html) { + html_template_file = remoting_webapp_template_background + html_template_include_files = [] + js_files = remoting_webapp_background_html_all_js_files + html_output = background_html_output + exclude_js = [] + instrument_js = [] + } + + message_window_html = target_name + "_message_window_html" + message_window_html_output = + "$target_gen_dir/html/$target_name/message_window.html" + + build_webapp_html(message_window_html) { + html_template_file = remoting_webapp_template_message_window + html_template_include_files = [] + js_files = remoting_webapp_message_window_html_all_js_files + html_output = message_window_html_output + exclude_js = [] + instrument_js = [] + } + + wcs_sandbox_html = target_name + "_wcs_sandbox_html" + wcs_sandbox_html_output = "$target_gen_dir/html/$target_name/wcs_sandbox.html" + + build_webapp_html(wcs_sandbox_html) { + html_template_file = remoting_webapp_template_wcs_sandbox + html_template_include_files = [] + js_files = remoting_webapp_wcs_sandbox_html_all_js_files + html_output = wcs_sandbox_html_output + exclude_js = [] + instrument_js = [] + } + + main_html = target_name + "_main_html" + main_html_output = "$target_gen_dir/html/$target_name/main.html" + + build_webapp_html(main_html) { + html_template_file = remoting_webapp_template_main + html_template_include_files = remoting_webapp_template_files + js_files = remoting_webapp_crd_main_html_all_js_files + html_output = main_html_output + exclude_js = [] + instrument_js = [] + } + + public_session_html = target_name + "_public_session_html" + public_session_html_output = + "$target_gen_dir/html/$target_name/public_session.html" + + build_webapp_html(public_session_html) { + html_template_file = remoting_webapp_template_public_session + html_template_include_files = remoting_webapp_public_session_template_files + js_files = remoting_webapp_public_session_html_all_js_files + html_output = public_session_html_output + exclude_js = [] + instrument_js = [] + } + + action(target_name) { + script = "//remoting/webapp/build-webapp.py" + + output_dir = invoker.output_dir + zip_path = invoker.zip_path + extra_files = invoker.extra_files + + dr_generated_html_files = [ + background_html_output, + message_window_html_output, + wcs_sandbox_html_output, + main_html_output, + public_session_html_output, + "$target_gen_dir/credits.html", + ] + + # Windows debug builds of remoting_client_plugin_newlib.pexe trigger OOM in + # arm-nacl-ld.gold.exe - enable for release builds only on Windows. + if (enable_nacl && (!is_win || !is_debug)) { + pnacl_tc = "//build/toolchain/nacl:newlib_pnacl" + pexe_label = "//remoting/client/plugin:remoting_client_plugin_newlib" + pexe_dir = get_label_info("${pexe_label}($pnacl_tc)", "root_out_dir") + + extra_files += [ "$pexe_dir/remoting_client_plugin_newlib.pexe" ] + if (is_debug) { + extra_files += [ "$pexe_dir/remoting_client_plugin_newlib.pexe.debug" ] + } + } + + inputs = [ rebase_path("crd/manifest.json.jinja2") ] + + remoting_version_files + rebase_path(remoting_webapp_crd_files) + + extra_files + dr_generated_html_files + + outputs = [ + zip_path, + ] + + deps = [ + ":$background_html", + ":$locales_listfile", + ":$main_html", + ":$message_window_html", + ":$public_session_html", + ":$wcs_sandbox_html", + "//remoting/resources", + "//remoting/webapp:credits", + ] + + # Windows debug builds of remoting_client_plugin_newlib.pexe trigger OOM in + # arm-nacl-ld.gold.exe - enable for release builds only on Windows. + if (enable_nacl && (!is_win || !is_debug)) { + deps += [ "${pexe_label}($pnacl_tc)" ] + if (is_debug) { + deps += [ "${pexe_label}_debug($pnacl_tc)" ] + } + } + + # Create a file that contains a list of all the resource files needed + # to build the webapp. This is needed to avoid problems on platforms that + # limit the size of a command line. + file_list = "$target_gen_dir/${target_name}_files.txt" + files = [] + files += rebase_path(dr_generated_html_files, root_build_dir) + files += rebase_path(remoting_webapp_crd_files, root_build_dir) + files += rebase_path(extra_files, root_build_dir) + write_file(file_list, files) + + args = [ + buildtype, + chrome_version_full, + rebase_path(output_dir, root_build_dir), + rebase_path(zip_path, root_build_dir), + rebase_path("crd/manifest.json.jinja2", root_build_dir), + ] + args += [ + "--files_listfile", + rebase_path(file_list, root_build_dir), + ] + args += [ + "--locales_listfile", + rebase_path(locales_listfile_output, root_build_dir), + ] + args += [ + "--use_gcd", + "$remoting_use_gcd", + ] + } +} diff --git a/chromium/remoting/webapp/files.gni b/chromium/remoting/webapp/files.gni new file mode 100644 index 00000000000..abb6b280a8f --- /dev/null +++ b/chromium/remoting/webapp/files.gni @@ -0,0 +1,572 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# `7MM"""Mq. `7MM +# MM `MM. MM +# MM ,M9 .gP"Ya ,6"Yb. ,M""bMM `7MMpMMMb.pMMMb. .gP"Ya +# MMmmdM9 ,M' Yb 8) MM ,AP MM MM MM MM ,M' Yb +# MM YM. 8M"""""" ,pm9MM 8MI MM MM MM MM 8M"""""" +# MM `Mb.YM. , 8M MM `Mb MM MM MM MM YM. , +# .JMML. .JMM.`Mbmmd' `Moo9^Yo.`Wbmd"MML..JMML JMML JMML.`Mbmmd' +# +# Please keep this file in sync with remoting/remoting_webapp_files.gypi . + +# JSCompiler externs. +remoting_webapp_js_externs_files = [ "externs/qunit.js" ] + +# Jscompile proto files. +# These provide type information for jscompile. +remoting_webapp_js_proto_files = [ + "js_proto/chrome_proto.js", + "js_proto/dom_proto.js", + "js_proto/remoting_proto.js", +] + +# +# Webapp browsertest JavaScript files. +# + +# Browser test files. +remoting_webapp_browsertest_js_files = [ + "browser_test/browser_test.js", + "browser_test/bump_scroll_browser_test.js", + "browser_test/cancel_pin_browser_test.js", + "browser_test/invalid_pin_browser_test.js", + "browser_test/it2me_browser_test.js", + "browser_test/me2me_browser_test.js", + "browser_test/scrollbar_browser_test.js", + "browser_test/timeout_waiter.js", + "browser_test/unauthenticated_browser_test.js", + "browser_test/update_pin_browser_test.js", +] + +# Browser test files. +remoting_webapp_browsertest_js_mock_files = [ + "crd/js/mock_client_plugin.js", + "crd/js/mock_host_list_api.js", + "crd/js/mock_identity.js", + "crd/js/mock_oauth2_api.js", + "crd/js/mock_signal_strategy.js", +] +remoting_webapp_browsertest_js_proto_files = [ + "js_proto/sinon_proto.js", + "js_proto/test_proto.js", + ] + remoting_webapp_js_proto_files + +remoting_webapp_browsertest_all_js_files = + remoting_webapp_browsertest_js_files + + remoting_webapp_browsertest_js_mock_files + +remoting_webapp_browsertest_main_html_extra_files = + remoting_webapp_browsertest_all_js_files + + [ "//third_party/sinonjs/src/sinon.js" ] + +# +# Webapp unittest JavaScript files. +# + +# These product files are excluded from our JavaScript unittest +remoting_webapp_unittests_exclude_js_files = [ + # background.js is where the onLoad handler is defined, which + # makes it the entry point of the background page. + "crd/js/background.js", +] + +# The unit test cases for the webapp +remoting_webapp_unittests_js_files = [ + "base/js/base_unittest.js", + "base/js/base_event_hook_unittest.js", + "base/js/base_inherits_unittest.js", + "base/js/callstack_unittest.js", + "base/js/client_session_unittest.js", + "base/js/client_session_factory_unittest.js", + "base/js/console_wrapper_unittest.js", + "base/js/dns_blackhole_checker_unittest.js", + "base/js/error_unittest.js", + "base/js/fallback_signal_strategy_unittest.js", + "base/js/host_options_unittest.js", + "base/js/identity_unittest.js", + "base/js/ipc_unittest.js", + "base/js/l10n_unittest.js", + "base/js/network_connectivity_detector_unittest.js", + "base/js/platform_unittest.js", + "base/js/protocol_extension_manager_unittest.js", + "base/js/session_logger_unittest.js", + "base/js/telemetry_event_writer_unittest.js", + "base/js/typecheck_unittest.js", + "base/js/viewport_unittest.js", + "base/js/window_shape_unittest.js", + "base/js/window_message_dispatcher_unittest.js", + "base/js/xhr_event_writer_unittest.js", + "base/js/xhr_unittest.js", + "base/js/xmpp_connection_unittest.js", + "base/js/xmpp_error_cache_unittest.js", + "base/js/xmpp_login_handler_unittest.js", + "base/js/xmpp_stream_parser_unittest.js", + "crd/js/apps_v2_migration_unittest.js", + "crd/js/combined_host_list_api_unittest.js", + "crd/js/gcd_client_unittest.js", + "crd/js/gcd_client_with_mock_xhr_unittest.js", + "crd/js/gnubby_auth_handler_unittest.js", + "crd/js/host_controller_unittest.js", + "crd/js/host_daemon_facade_unittest.js", + "crd/js/host_table_entry_unittest.js", + "crd/js/legacy_host_list_api_unittest.js", + "crd/js/menu_button_unittest.js", + "crd/js/mock_xhr_unittest.js", +] +remoting_webapp_unittests_js_mock_files = [ + "crd/js/mock_client_plugin.js", + "crd/js/mock_host_daemon_facade.js", + "crd/js/mock_host_list_api.js", + "crd/js/mock_identity.js", + "crd/js/mock_signal_strategy.js", + "js_proto/chrome_mocks.js", + "unittests/sinon_helpers.js", + "crd/js/mock_xhr.js", +] + +# Prototypes for objects that are not mocked. +remoting_webapp_unittests_js_proto_files = [ + "js_proto/chrome_proto.js", + "js_proto/dom_proto.js", + "js_proto/remoting_proto.js", + "js_proto/sinon_proto.js", +] +remoting_webapp_unittests_all_js_files = + remoting_webapp_unittests_js_files + + remoting_webapp_unittests_js_mock_files + [ "unittests/qunit_callbacks.js" ] + +# All the files needed to run the unittests. +remoting_webapp_unittests_all_files = + [ "crd/html/menu_button.css" ] + remoting_webapp_unittests_all_js_files +remoting_webapp_unittests_template_main = "crd/html/template_unittests.html" + +# +# Shared webapp JavaScript file groups. +# + +# Auth (Google account) JavaScript files. +remoting_webapp_shared_js_auth_google_files = [ + "base/js/auth_init.js", + "base/js/identity.js", + "base/js/oauth2.js", + "base/js/oauth2_api.js", + "base/js/oauth2_api_impl.js", +] + +# Client JavaScript files. +remoting_webapp_shared_js_client_files = [ + "base/js/activity.js", + "base/js/client_plugin.js", + "base/js/client_plugin_host_desktop_impl.js", + "base/js/client_plugin_impl.js", + "base/js/client_session.js", + "base/js/client_session_factory.js", + "base/js/clipboard.js", + "base/js/connected_view.js", + "base/js/connection_info.js", + "base/js/credentials_provider.js", + "base/js/experiments.js", + "base/js/host_desktop.js", + "base/js/telemetry_event_writer.js", + "base/js/xmpp_error_cache.js", +] + +# Remoting core JavaScript files. +remoting_webapp_shared_js_core_files = [ + "base/js/application.js", + "base/js/base.js", + "base/js/callstack.js", + "base/js/chromoting_event.js", + "base/js/console_wrapper.js", + "base/js/ipc.js", + "base/js/modal_dialogs.js", + "base/js/platform.js", + "base/js/protocol_extension_manager.js", + "base/js/protocol_extension.js", + "base/js/error.js", + "base/js/network_connectivity_detector.js", + "base/js/plugin_settings.js", + "base/js/suspend_detector.js", + "base/js/typecheck.js", + "base/js/window_message_dispatcher.js", + "base/js/xhr.js", + "base/js/xhr_event_writer.js", +] + +# Host JavaScript files. +remoting_webapp_shared_js_host_files = [ + "base/js/host.js", + "base/js/host_options.js", +] + +# Logging and stats JavaScript files. +remoting_webapp_shared_js_logging_files = [ + "base/js/format_iq.js", + "base/js/session_logger.js", + "base/js/stats_accumulator.js", +] + +# Remoting signaling files. +remoting_webapp_shared_js_signaling_files = [ + "base/js/dns_blackhole_checker.js", + "base/js/fallback_signal_strategy.js", + "base/js/signal_strategy.js", + "base/js/tcp_socket.js", + "base/js/wcs_adapter.js", + "base/js/wcs_sandbox_container.js", + "base/js/xmpp_connection.js", + "base/js/xmpp_login_handler.js", + "base/js/xmpp_stream_parser.js", +] + +# UI JavaScript files. +remoting_webapp_shared_js_ui_files = [ + "base/js/connection_dropped_dialog.js", + "base/js/connection_stats.js", + "base/js/l10n.js", + "base/js/ui_mode.js", + "base/js/viewport.js", + "base/js/window_shape.js", +] + +# +# DesktopRemoting webapp JavaScript file groups. +# + +# Auth (apps v1) JavaScript files. +# These files aren"t included directly from main.html. They are +# referenced from the manifest.json file (appsv1 only). +remoting_webapp_js_auth_v1_files = [ + "crd/js/cs_third_party_auth_trampoline.js", # client to host + "crd/js/cs_oauth2_trampoline.js", # Google account +] + +# Auth (client to host) JavaScript files. +remoting_webapp_js_auth_client2host_files = [ + "crd/js/third_party_host_permissions.js", + "crd/js/third_party_token_fetcher.js", +] + +# Client JavaScript files. +remoting_webapp_js_client_files = [ + "crd/js/apps_v2_migration.js", + "crd/js/event_handlers.js", + "crd/js/gcd_client.js", +] + +# Gnubby authentication JavaScript files. +remoting_webapp_js_gnubby_auth_files = [ "crd/js/gnubby_auth_handler.js" ] + +# Files for controlling the local machine as a host. +# Includes both it2me and me2me files. +remoting_webapp_js_host_control_files = [ + "crd/js/host_controller.js", + "crd/js/host_daemon_facade.js", + "crd/js/host_screen.js", + "crd/js/host_session.js", + "crd/js/host_setup_dialog.js", + "crd/js/host_install_dialog.js", + "crd/js/host_installer.js", + "crd/js/it2me_host_facade.js", + "crd/js/native_message_host_log_message_handler.js", + "crd/js/paired_client_manager.js", +] + +# Files for controlling the local it2me host. +# Included by public_session.html. +remoting_webapp_js_it2me_host_control_files = [ + "crd/js/host_screen.js", + "crd/js/host_session.js", + "crd/js/host_install_dialog.js", + "crd/js/host_installer.js", + "crd/js/it2me_host_facade.js", + "crd/js/native_message_host_log_message_handler.js", +] + +# Files for displaying (in the client) info about available hosts. +remoting_webapp_js_host_display_files = [ + "crd/js/host_list.js", + "crd/js/host_list_api.js", + "crd/js/host_table_entry.js", + "crd/js/local_host_section.js", + + # Must come after host_list_api.js because of an issue with + # JSCompiler. If an implementation of an interface occurs in a + # file processed before the interface itself, the @override tag + # doesn't always work correctly. + "crd/js/combined_host_list_api.js", + "crd/js/gcd_host_list_api.js", + "crd/js/legacy_host_list_api.js", +] + +# The CRD-specific JavaScript files required by main.html. +remoting_webapp_crd_js_ui_files = [ + "crd/js/bump_scroller.js", + "crd/js/butter_bar.js", + "crd/js/crd_auth_dialog.js", + "crd/js/crd_event_handlers.js", + "crd/js/crd_experimental.js", + "crd/js/desktop_connected_view.js", + "crd/js/desktop_remoting.js", + "crd/js/desktop_remoting_activity.js", + "crd/js/desktop_viewport.js", + "crd/js/feedback.js", + "crd/js/fullscreen.js", + "crd/js/fullscreen_v1.js", + "crd/js/fullscreen_v2.js", + "crd/js/it2me_activity.js", + "crd/js/me2me_activity.js", + "crd/js/menu_button.js", + "crd/js/options_menu.js", + "crd/js/toolbar.js", + "crd/js/window_frame.js", +] + +# +# DesktopRemoting main.html generation files. +# + +remoting_webapp_template_main = "crd/html/template_main.html" + +# The shared JavaScript files required by main.html. +remoting_webapp_shared_main_html_js_files = + # Include the core files first as it is required by the other files. + # Otherwise, Jscompile will complain. + remoting_webapp_shared_js_core_files + + remoting_webapp_shared_js_auth_google_files + + remoting_webapp_shared_js_client_files + + remoting_webapp_shared_js_host_files + + remoting_webapp_shared_js_logging_files + + remoting_webapp_shared_js_ui_files + + remoting_webapp_shared_js_signaling_files + + remoting_webapp_js_auth_client2host_files + + remoting_webapp_js_client_files + remoting_webapp_js_gnubby_auth_files + + remoting_webapp_js_host_control_files + + remoting_webapp_js_host_display_files + +# Uncomment this line to include browser test files in the web app +# to expedite debugging or local development. +#+ remoting_webapp_browsertest_all_js_files + +remoting_webapp_unittest_html_all_js_files = + remoting_webapp_shared_main_html_js_files + remoting_webapp_crd_js_ui_files + +# The CRD-specific JavaScript files required by main.html. +remoting_webapp_crd_main_html_all_js_files = + remoting_webapp_shared_main_html_js_files + + remoting_webapp_crd_js_ui_files + [ "crd/js/crd_main.js" ] + +# These template files are used to construct main.html. +remoting_webapp_template_files = [ + "base/html/client_plugin.html", + "crd/html/butter_bar.html", + "crd/html/dialog_auth.html", + "crd/html/dialog_client_connect_failed.html", + "crd/html/dialog_client_connecting.html", + "crd/html/dialog_client_host_needs_upgrade.html", + "crd/html/dialog_client_pin_prompt.html", + "crd/html/dialog_client_session_finished.html", + "crd/html/dialog_client_third_party_auth.html", + "crd/html/dialog_client_unconnected.html", + "crd/html/dialog_confirm_host_delete.html", + "crd/html/dialog_connection_history.html", + "crd/html/dialog_host.html", + "crd/html/dialog_host_install.html", + "crd/html/dialog_host_setup.html", + "crd/html/dialog_manage_pairings.html", + "crd/html/dialog_token_refresh_failed.html", + "crd/html/toolbar.html", + "crd/html/ui_header.html", + "crd/html/ui_it2me.html", + "crd/html/ui_me2me.html", + "crd/html/window_frame.html", +] + +# +# DesktopRemoting public_session.html generation files. +# +remoting_webapp_template_public_session = + "crd/html/template_public_session.html" + +# The shared JavaScript files required by public_session.html. +remoting_webapp_public_session_html_all_js_files = + # Include the core files first as it is required by the other files. + # Otherwise, Jscompile will complain. + remoting_webapp_shared_js_core_files + + remoting_webapp_shared_js_auth_google_files + + remoting_webapp_shared_js_client_files + + remoting_webapp_shared_js_host_files + + remoting_webapp_shared_js_logging_files + + remoting_webapp_shared_js_ui_files + + remoting_webapp_shared_js_signaling_files + + remoting_webapp_js_it2me_host_control_files + + [ + "crd/js/crd_auth_dialog.js", + "crd/js/public_session_main.js", + ] + +# These template files are used to construct public_session.html. +remoting_webapp_public_session_template_files = [ "crd/html/dialog_host.html" ] + +# +# DesktopRemoting background.html generation files. +# + +remoting_webapp_template_background = "crd/html/template_background.html" + +# These JS files are specific to the background page and are not part of +# the main JS files. +remoting_webapp_background_html_js_files = [ + "crd/js/activation_handler.js", + "crd/js/app_launcher.js", + "crd/js/background.js", +] + +# All the JavaScript files required by background.html. +remoting_webapp_background_html_all_js_files = + remoting_webapp_background_html_js_files +remoting_webapp_background_html_all_js_files += [ + "base/js/base.js", + "base/js/chromoting_event.js", + "base/js/error.js", + "base/js/identity.js", + "base/js/ipc.js", + "base/js/l10n.js", + "base/js/oauth2.js", + "base/js/oauth2_api.js", + "base/js/oauth2_api_impl.js", + "base/js/platform.js", + "base/js/plugin_settings.js", + "base/js/telemetry_event_writer.js", + "base/js/typecheck.js", + "base/js/xhr.js", + "base/js/xhr_event_writer.js", +] + +# +# DesktopRemoting wcs_sandbox.html generation files. +# + +remoting_webapp_template_wcs_sandbox = "base/html/template_wcs_sandbox.html" + +# These JS files are specific to the WCS sandbox page and are not part of +# the main JS files. +remoting_webapp_wcs_sandbox_html_js_files = [ + "crd/js/wcs.js", + "crd/js/wcs_loader.js", + "crd/js/wcs_sandbox_content.js", + "crd/js/xhr_proxy.js", +] + +# All the JavaScript files required by wcs_sandbox.html. +remoting_webapp_wcs_sandbox_html_all_js_files = + remoting_webapp_wcs_sandbox_html_js_files +remoting_webapp_wcs_sandbox_html_all_js_files += [ + "base/js/chromoting_event.js", + "base/js/error.js", + "base/js/platform.js", + "base/js/plugin_settings.js", +] + +# +# DesktopRemoting message_window.html generation files. +# + +remoting_webapp_template_message_window = + "base/html/template_message_window.html" + +# These JS files are specific to the message window page and are not part of +# the main JS files. +remoting_webapp_message_window_html_js_files = [ "base/js/message_window.js" ] + +# All the JavaScript files required by message_window.html. +remoting_webapp_message_window_html_all_js_files = + remoting_webapp_message_window_html_js_files + [ "base/js/base.js" ] + +# +# All the JavaScript files required by credits.html +# + +remoting_webapp_credits_html_all_js_files = [ "base/js/credits_js.js" ] + +# +# DesktopRemoting webapp JS and resource files. +# + +# All the JavaScript files that are shared by webapps. +remoting_webapp_shared_js_files = remoting_webapp_shared_main_html_js_files + + remoting_webapp_background_html_js_files + + remoting_webapp_credits_html_all_js_files + + remoting_webapp_message_window_html_js_files + + remoting_webapp_wcs_sandbox_html_js_files + + # JS files referenced in manifest.json. + remoting_webapp_js_auth_v1_files + +# All the JavaScript files required by DesktopRemoting. +remoting_webapp_crd_js_files = + remoting_webapp_shared_js_files + remoting_webapp_crd_main_html_all_js_files + +remoting_webapp_info_files = [ + "../resources/chromoting16.webp", + "../resources/chromoting48.webp", + "../resources/chromoting128.webp", +] + +# All the resource files required by DesktopRemoting. +remoting_webapp_resource_files = [ + "../resources/disclosure_arrow_down.webp", + "../resources/disclosure_arrow_right.webp", + "../resources/drag.webp", + "../resources/host_setup_instructions.webp", + "../resources/icon_close.webp", + "../resources/icon_cross.webp", + "../resources/icon_disconnect.webp", + "../resources/icon_fullscreen.webp", + "../resources/icon_host.webp", + "../resources/icon_maximize_restore.webp", + "../resources/icon_minimize.webp", + "../resources/icon_options.webp", + "../resources/icon_pencil.webp", + "../resources/icon_warning.webp", + "../resources/infographic_my_computers.webp", + "../resources/infographic_remote_assistance.webp", + "../resources/plus.webp", + "../resources/reload.webp", + "../resources/tick.webp", + "base/html/connection_stats.css", + "base/html/credits_css.css", + "base/html/main.css", + "base/html/message_window.css", + "base/resources/open_sans.css", + "base/resources/open_sans.woff", + "base/resources/spinner.gif", + "crd/html/butter_bar.css", + "crd/html/crd_main.css", + "crd/html/toolbar.css", + "crd/html/menu_button.css", + "crd/html/public_session.css", + "crd/html/window_frame.css", + "crd/resources/scale-to-fit.webp", +] + +remoting_webapp_crd_files = + remoting_webapp_info_files + remoting_webapp_crd_js_files + + remoting_webapp_resource_files + + remoting_webapp_public_session_html_all_js_files + +# Files that contain localizable strings. +desktop_remoting_webapp_localizable_files = + [ + "webapp/crd/manifest.json.jinja2", + remoting_webapp_template_background, + remoting_webapp_template_main, + remoting_webapp_template_message_window, + remoting_webapp_template_wcs_sandbox, + ] + remoting_webapp_template_files + remoting_webapp_crd_js_files + +webapp_js_files = remoting_webapp_unittest_html_all_js_files + + remoting_webapp_wcs_sandbox_html_js_files + + remoting_webapp_background_html_js_files diff --git a/chromium/rlz/BUILD.gn b/chromium/rlz/BUILD.gn new file mode 100644 index 00000000000..969e3fa9bd1 --- /dev/null +++ b/chromium/rlz/BUILD.gn @@ -0,0 +1,155 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Note that this build file assumes rlz_use_chrome_net which is a condition in +# the GYP file, but is always true for Chrome builds. + +import("//testing/test.gni") + +config("rlz_config") { + defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ] +} + +source_set("rlz_lib") { + sources = [ + "chromeos/lib/machine_id_chromeos.cc", + "chromeos/lib/rlz_value_store_chromeos.cc", + "chromeos/lib/rlz_value_store_chromeos.h", + "ios/lib/machine_id_ios.cc", + "lib/assert.cc", + "lib/assert.h", + "lib/crc32.h", + "lib/crc32_wrapper.cc", + "lib/crc8.cc", + "lib/crc8.h", + "lib/financial_ping.cc", + "lib/financial_ping.h", + "lib/lib_values.cc", + "lib/lib_values.h", + "lib/machine_id.cc", + "lib/machine_id.h", + "lib/recursive_cross_process_lock_posix.cc", + "lib/recursive_cross_process_lock_posix.h", + "lib/rlz_enums.h", + "lib/rlz_lib.cc", + "lib/rlz_lib.h", + "lib/rlz_lib_clear.cc", + "lib/rlz_value_store.h", + "lib/string_utils.cc", + "lib/string_utils.h", + "mac/lib/machine_id_mac.cc", + "mac/lib/rlz_value_store_mac.h", + "mac/lib/rlz_value_store_mac.mm", + "win/lib/lib_mutex.cc", + "win/lib/lib_mutex.h", + "win/lib/machine_deal.cc", + "win/lib/machine_deal.h", + "win/lib/machine_id_win.cc", + "win/lib/process_info.cc", + "win/lib/process_info.h", + "win/lib/registry_util.cc", + "win/lib/registry_util.h", + "win/lib/rlz_lib_win.cc", + "win/lib/rlz_value_store_registry.cc", + "win/lib/rlz_value_store_registry.h", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + public_configs = [ ":rlz_config" ] + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//net", + "//third_party/zlib", + "//url", + ] + + if (is_mac) { + libs = [ + "Foundation.framework", + "IOKit.framework", + ] + } + + if (is_ios) { + # These _mac files are also used on iOS. + set_sources_assignment_filter([]) + sources += [ + "mac/lib/rlz_value_store_mac.h", + "mac/lib/rlz_value_store_mac.mm", + ] + set_sources_assignment_filter(sources_assignment_filter) + } +} + +source_set("test_support") { + testonly = true + sources = [ + "test/rlz_test_helpers.cc", + "test/rlz_test_helpers.h", + ] + deps = [ + ":rlz_lib", + "//base", + "//base/test:test_support", + "//testing/gtest", + ] +} + +test("rlz_unittests") { + sources = [ + "lib/crc32_unittest.cc", + "lib/crc8_unittest.cc", + "lib/financial_ping_test.cc", + "lib/lib_values_unittest.cc", + "lib/machine_id_unittest.cc", + "lib/rlz_lib_test.cc", + "lib/string_utils_unittest.cc", + "test/rlz_unittest_main.cc", + "win/lib/machine_deal_test.cc", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":rlz_lib", + ":test_support", + "//base", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/zlib", + ] +} + +if (!is_ios) { + executable("rlz_id") { + sources = [ + "examples/rlz_id.cc", + ] + deps = [ + ":rlz_lib", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + } +} + +if (is_win) { + shared_library("rlz") { + sources = [ + "win/dll/dll_main.cc", + "win/dll/exports.cc", + ] + deps = [ + ":rlz_lib", + "//build/config/sanitizers:deps", + "//third_party/zlib", + ] + } +} diff --git a/chromium/services/shell/background/tests/BUILD.gn b/chromium/services/shell/background/tests/BUILD.gn new file mode 100644 index 00000000000..eaf84694253 --- /dev/null +++ b/chromium/services/shell/background/tests/BUILD.gn @@ -0,0 +1,63 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +source_set("test_support") { + sources = [ + "test_catalog_store.cc", + "test_catalog_store.h", + ] + + deps = [ + "//base", + "//services/catalog:lib", + "//url", + ] +} + +source_set("unittests") { + testonly = true + sources = [ + "background_shell_unittest.cc", + ] + + deps = [ + ":test_app_bindings", + ":test_support", + "//base", + "//services/shell/background:lib", + "//services/shell/background:main", + "//services/shell/public/cpp:sources", + "//testing/gtest", + "//url", + ] + + data_deps = [ + ":test_app", + ] +} + +mojom("test_app_bindings") { + sources = [ + "test.mojom", + ] +} + +mojo_native_application("test_app") { + output_name = "background_shell_test_app" + + sources = [ + "test_service.cc", + ] + + deps = [ + ":test_app_bindings", + "//base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] +} diff --git a/chromium/services/shell/background/tests/test.mojom b/chromium/services/shell/background/tests/test.mojom new file mode 100644 index 00000000000..18a92ec2634 --- /dev/null +++ b/chromium/services/shell/background/tests/test.mojom @@ -0,0 +1,9 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module shell.mojom; + +interface TestService { + Test() => (); +}; diff --git a/chromium/services/shell/public/cpp/test/BUILD.gn b/chromium/services/shell/public/cpp/test/BUILD.gn new file mode 100644 index 00000000000..48bf72b8a86 --- /dev/null +++ b/chromium/services/shell/public/cpp/test/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +group("test") { + testonly = true + deps = [ + ":run_all_shelltests", + ] +} + +source_set("run_all_shelltests") { + testonly = true + + sources = [ + "run_all_shelltests.cc", + ] + + deps = [ + "//base", + "//base/test:test_support", + "//mojo/edk/system", + "//services/shell/background:lib", + "//services/shell/background:main", + ] +} diff --git a/chromium/services/shell/public/cpp/tests/BUILD.gn b/chromium/services/shell/public/cpp/tests/BUILD.gn new file mode 100644 index 00000000000..368874210b6 --- /dev/null +++ b/chromium/services/shell/public/cpp/tests/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +test("mojo_public_application_unittests") { + sources = [ + "interface_registry_unittest.cc", + ] + + deps = [ + "//base", + "//mojo/edk/test:run_all_unittests", + "//services/shell/public/cpp", + "//testing/gtest", + ] +} diff --git a/chromium/services/shell/tests/BUILD.gn b/chromium/services/shell/tests/BUILD.gn new file mode 100644 index 00000000000..7c8bd210772 --- /dev/null +++ b/chromium/services/shell/tests/BUILD.gn @@ -0,0 +1,58 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +group("tests") { + testonly = true + deps = [ + ":mojo_shell_unittests", + ] +} + +test("mojo_shell_unittests") { + deps = [ + ":interfaces", + "//base", + "//base/test:test_support", + "//mojo/public/cpp/bindings", + "//mojo/public/cpp/system", + "//services/catalog:unittests", + "//services/shell", + "//services/shell/background:lib", + "//services/shell/background:main", + "//services/shell/background/tests:unittests", + "//services/shell/public/cpp", + "//services/shell/public/cpp/test:run_all_shelltests", + "//services/shell/public/interfaces", + "//services/shell/tests/connect", + "//services/shell/tests/lifecycle", + "//services/shell/tests/shell", + "//services/shell/tests/shutdown", + "//testing/gtest", + ] +} + +mojom("interfaces") { + sources = [ + "test.mojom", + ] +} + +source_set("util") { + sources = [ + "util.cc", + "util.h", + ] + deps = [ + "//base", + "//base:base_static", + "//mojo/edk/system", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + "//services/shell/runner/common", + ] +} diff --git a/chromium/services/shell/tests/connect/BUILD.gn b/chromium/services/shell/tests/connect/BUILD.gn new file mode 100644 index 00000000000..00bf94408e6 --- /dev/null +++ b/chromium/services/shell/tests/connect/BUILD.gn @@ -0,0 +1,204 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +source_set("connect") { + testonly = true + sources = [ + "connect_unittest.cc", + ] + deps = [ + ":interfaces", + "//base", + "//base/test:test_support", + "//services/shell/public/cpp:shell_test_support", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + + data_deps = [ + ":connect_test_app", + ":connect_test_class_app", + ":connect_test_singleton_app", + ":connect_test_driver", + ":connect_test_exe", + ":connect_test_package", + ":manifest", + ] +} + +mojom("interfaces") { + sources = [ + "connect_test.mojom", + ] + deps = [ + "//services/shell/public/interfaces", + ] +} + +mojo_application_manifest("manifest") { + application_name = "connect_unittests" + source = "connect_unittests_manifest.json" +} + +mojo_application_manifest("connect_test_a_manifest") { + application_name = "connect_test_a" + source = "connect_test_app_a_manifest.json" +} + +mojo_application_manifest("connect_test_b_manifest") { + application_name = "connect_test_b" + source = "connect_test_app_b_manifest.json" +} + +mojo_native_application("connect_test_package") { + testonly = true + sources = [ + "connect_test_package.cc", + ] + deps = [ + ":interfaces", + "//base", + "//mojo/common:common_base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + data_deps = [ + ":connect_test_package_manifest", + ] +} + +mojo_application_manifest("connect_test_package_manifest") { + application_name = "connect_test_package" + source = "connect_test_package_manifest.json" + deps = [ + ":connect_test_a_manifest", + ":connect_test_b_manifest", + ] + packaged_applications = [ + "connect_test_a", + "connect_test_b", + ] +} + +mojo_native_application("connect_test_app") { + testonly = true + sources = [ + "connect_test_app.cc", + ] + deps = [ + ":interfaces", + "//base", + "//mojo/common:common_base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + data_deps = [ + ":connect_test_app_manifest", + ] +} + +mojo_application_manifest("connect_test_app_manifest") { + application_name = "connect_test_app" + source = "connect_test_app_manifest.json" +} + +mojo_native_application("connect_test_class_app") { + testonly = true + sources = [ + "connect_test_class_app.cc", + ] + deps = [ + ":interfaces", + "//base", + "//mojo/common:common_base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + data_deps = [ + ":connect_test_class_app_manifest", + ] +} + +mojo_application_manifest("connect_test_class_app_manifest") { + application_name = "connect_test_class_app" + source = "connect_test_class_app_manifest.json" +} + +mojo_native_application("connect_test_singleton_app") { + testonly = true + sources = [ + "connect_test_singleton_app.cc", + ] + deps = [ + "//base", + "//mojo/common:common_base", + "//services/shell/public/cpp:sources", + ] + data_deps = [ + ":connect_test_singleton_app_manifest", + ] +} + +mojo_application_manifest("connect_test_singleton_app_manifest") { + application_name = "connect_test_singleton_app" + source = "connect_test_singleton_app_manifest.json" +} + +executable("connect_test_driver") { + testonly = true + + sources = [ + "connect_test_driver.cc", + ] + + deps = [ + ":interfaces", + "//base", + "//build/win:default_exe_manifest", + "//services/shell/public/cpp", + "//services/shell/runner/child:test_native_main", + "//services/shell/tests:util", + ] + + data_deps = [ + ":connect_test_driver_manifest", + ] +} + +mojo_application_manifest("connect_test_driver_manifest") { + type = "exe" + application_name = "connect_test_driver" + source = "connect_test_driver_manifest.json" +} + +executable("connect_test_exe") { + testonly = true + + sources = [ + "connect_test_exe.cc", + ] + + deps = [ + ":interfaces", + "//base", + "//build/win:default_exe_manifest", + "//services/shell/public/cpp", + "//services/shell/runner/child:test_native_main", + ] + + data_deps = [ + ":connect_test_exe_manifest", + ] +} + +mojo_application_manifest("connect_test_exe_manifest") { + type = "exe" + application_name = "connect_test_exe" + source = "connect_test_exe_manifest.json" +} diff --git a/chromium/services/shell/tests/connect/connect_test.mojom b/chromium/services/shell/tests/connect/connect_test.mojom new file mode 100644 index 00000000000..5a9efcda41d --- /dev/null +++ b/chromium/services/shell/tests/connect/connect_test.mojom @@ -0,0 +1,68 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module shell.test.mojom; + +import "services/shell/public/interfaces/connector.mojom"; + +interface ConnectTestService { + GetTitle() => (string title); + GetInstance() => (string instance); +}; + +interface ClassInterface { + Ping() => (string response); +}; + +// Interface implemented by a standalone (non-package) app, +// mojo:connect_test_app. +interface StandaloneApp { + // Attempts to connect to an application whose name is explicitly allowed by + // the standalone app's CapabilitySpec, but whose enclosing package is not. + // The connection should succeed anyway. + ConnectToAllowedAppInBlockedPackage() => (string title); + + // Connects to mojo:connect_test_class_app & requests ClassInterface from it. + // This should be permitted because mojo:connect_test_app requests class + // "class" from mojo:connect_test_class_app, which mojo:connect_test_class_app + // defines as including ClassInterface. + // The response contains the response from ClassInterface::Ping() and + // ConnectTestService::GetTitle(). + ConnectToClassInterface() => (string class_interface_response, string title); +}; + +interface UserIdTest { + // Attempts to connect to mojo:connect_test_class_app as |user_id|. + // The callback takes the connection response result, and the identity + // mojo:connect_test_class_app was run as, which should match |user_id|. + ConnectToClassAppAsDifferentUser(shell.mojom.Identity target) => + (int32 connection_result, shell.mojom.Identity target); +}; + +interface ClientProcessTest { + // Attempts to launch a bare exe and connect to it using the + // ClientProcessConnection param to Connector::Connect(). The callback takes + // the result of the connection, and the identity of the app that the caller + // can use to connect to this app as well. + LaunchAndConnectToProcess() => + (int32 connection_result, shell.mojom.Identity target); +}; + +struct ConnectionState { + string connection_local_name; + string connection_remote_name; + string connection_remote_userid; + uint32 connection_remote_id; + string initialize_local_name; + string initialize_userid; + uint32 initialize_id; +}; + +interface ExposedInterface { + ConnectionAccepted(ConnectionState state); +}; + +interface BlockedInterface { + GetTitleBlocked() => (string blocked_title); +}; diff --git a/chromium/services/shell/tests/lifecycle/BUILD.gn b/chromium/services/shell/tests/lifecycle/BUILD.gn new file mode 100644 index 00000000000..3e002e70a7b --- /dev/null +++ b/chromium/services/shell/tests/lifecycle/BUILD.gn @@ -0,0 +1,164 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +source_set("lifecycle") { + testonly = true + sources = [ + "lifecycle_unittest.cc", + ] + deps = [ + ":interfaces", + "//base", + "//base/test:test_support", + "//services/shell/public/cpp:shell_test_support", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + "//services/shell/runner/common", + "//services/shell/tests:util", + ] + + data_deps = [ + ":lifecycle_unittest_app", + ":lifecycle_unittest_parent", + ":lifecycle_unittest_exe", + ":lifecycle_unittest_package", + ":manifest", + ] +} + +mojom("interfaces") { + sources = [ + "lifecycle_unittest.mojom", + ] +} + +mojo_application_manifest("manifest") { + application_name = "lifecycle_unittest" + source = "lifecycle_unittest_manifest.json" +} + +mojo_application_manifest("lifecycle_unittest_package_app_a_manifest") { + application_name = "lifecycle_unittest_package_app_a" + source = "package_app_a_manifest.json" +} + +mojo_application_manifest("lifecycle_unittest_package_app_b_manifest") { + application_name = "lifecycle_unittest_package_app_b" + source = "package_app_b_manifest.json" +} + +source_set("app_client") { + sources = [ + "app_client.cc", + "app_client.h", + ] + deps = [ + ":interfaces", + "//base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] +} + +mojo_native_application("lifecycle_unittest_package") { + testonly = true + sources = [ + "package.cc", + ] + deps = [ + ":app_client", + ":interfaces", + "//base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + data_deps = [ + ":lifecycle_unittest_package_manifest", + ] +} + +mojo_application_manifest("lifecycle_unittest_package_manifest") { + application_name = "lifecycle_unittest_package" + source = "package_manifest.json" + deps = [ + ":lifecycle_unittest_package_app_a_manifest", + ":lifecycle_unittest_package_app_b_manifest", + ] + packaged_applications = [ + "lifecycle_unittest_package_app_a", + "lifecycle_unittest_package_app_b", + ] +} + +mojo_native_application("lifecycle_unittest_app") { + testonly = true + sources = [ + "app.cc", + ] + deps = [ + ":app_client", + ":interfaces", + "//base", + "//services/shell/public/cpp:sources", + ] + + data_deps = [ + ":lifecycle_unittest_app_manifest", + ] +} + +mojo_application_manifest("lifecycle_unittest_app_manifest") { + application_name = "lifecycle_unittest_app" + source = "app_manifest.json" +} + +mojo_native_application("lifecycle_unittest_parent") { + testonly = true + sources = [ + "parent.cc", + ] + deps = [ + ":interfaces", + "//base", + "//services/shell/public/cpp:sources", + ] + + data_deps = [ + ":lifecycle_unittest_parent_manifest", + ] +} + +mojo_application_manifest("lifecycle_unittest_parent_manifest") { + application_name = "lifecycle_unittest_parent" + source = "parent_manifest.json" +} + +executable("lifecycle_unittest_exe") { + testonly = true + sources = [ + "lifecycle_exe.cc", + ] + deps = [ + ":app_client", + "//base", + "//build/win:default_exe_manifest", + "//services/shell/public/cpp:sources", + "//services/shell/runner/child:test_native_main", + ] + + data_deps = [ + ":lifecycle_unittest_exe_manifest", + ] +} + +mojo_application_manifest("lifecycle_unittest_exe_manifest") { + type = "exe" + application_name = "lifecycle_unittest_exe" + source = "exe_manifest.json" +} diff --git a/chromium/services/shell/tests/lifecycle/lifecycle_unittest.mojom b/chromium/services/shell/tests/lifecycle/lifecycle_unittest.mojom new file mode 100644 index 00000000000..212398c8167 --- /dev/null +++ b/chromium/services/shell/tests/lifecycle/lifecycle_unittest.mojom @@ -0,0 +1,32 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module shell.test.mojom; + +// An interface implemented by an application exposing different ways for the +// application to "shut down" from the caller and shell's perspective. +interface LifecycleControl { + // Method for ping-pong acknowledgement. + Ping() => (); + + // Perform any normal cleanup and shut down normally. + GracefulQuit(); + + // Crash immediately and leave the shell and clients to deal with the + // consequences. + Crash(); + + // Not actually a shutdown from the client's perspective, but the Shell is no + // longer tracking this application. + CloseShellConnection(); +}; + +// Implemented by an app that connects to another app, thereby creating an +// instance for it in the shell. +interface Parent { + // Connects to another app and runs the callback when that app has acked a + // Ping. + ConnectToChild() => (); + Quit(); +}; diff --git a/chromium/services/shell/tests/shell/BUILD.gn b/chromium/services/shell/tests/shell/BUILD.gn new file mode 100644 index 00000000000..d26ff7c1af3 --- /dev/null +++ b/chromium/services/shell/tests/shell/BUILD.gn @@ -0,0 +1,98 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +source_set("shell") { + testonly = true + sources = [ + "shell_unittest.cc", + ] + + deps = [ + ":interfaces", + "//base", + "//base/test:test_config", + "//mojo/common:common_base", + "//services/shell/public/cpp:shell_test_support", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + + data_deps = [ + ":manifest", + ":shell_unittest_driver", + ":shell_unittest_target", + ] +} + +mojom("interfaces") { + sources = [ + "shell_unittest.mojom", + ] +} + +mojo_application_manifest("manifest") { + application_name = "shell_unittest" + source = "shell_unittest_manifest.json" +} + +executable("shell_unittest_driver") { + testonly = true + + sources = [ + "driver.cc", + ] + + deps = [ + ":interfaces", + "//base", + "//build/win:default_exe_manifest", + "//mojo/edk/system", + "//services/shell/public/cpp", + "//services/shell/public/interfaces", + "//services/shell/runner:init", + "//services/shell/runner/child:test_native_main", + "//services/shell/runner/common", + ] + + data_deps = [ + ":driver_manifest", + ] +} + +mojo_application_manifest("driver_manifest") { + type = "exe" + application_name = "shell_unittest_driver" + source = "driver_manifest.json" +} + +executable("shell_unittest_target") { + testonly = true + + sources = [ + "target.cc", + ] + + deps = [ + ":interfaces", + "//base", + "//build/win:default_exe_manifest", + "//services/shell/public/cpp", + "//services/shell/runner/child:test_native_main", + ] + + data_deps = [ + ":target_manifest", + ] +} + +mojo_application_manifest("target_manifest") { + type = "exe" + application_name = "shell_unittest_target" + source = "target_manifest.json" +} diff --git a/chromium/services/shell/tests/shell/shell_unittest.mojom b/chromium/services/shell/tests/shell/shell_unittest.mojom new file mode 100644 index 00000000000..5b514181092 --- /dev/null +++ b/chromium/services/shell/tests/shell/shell_unittest.mojom @@ -0,0 +1,13 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module shell.test.mojom; + +interface CreateInstanceTest { + SetTargetID(uint32 target_id); +}; + +interface Driver { + QuitDriver(); +}; diff --git a/chromium/services/shell/tests/shutdown/BUILD.gn b/chromium/services/shell/tests/shutdown/BUILD.gn new file mode 100644 index 00000000000..be1661c59d1 --- /dev/null +++ b/chromium/services/shell/tests/shutdown/BUILD.gn @@ -0,0 +1,85 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//mojo/public/mojo_application.gni") +import("//mojo/public/mojo_application_manifest.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +source_set("shutdown") { + testonly = true + sources = [ + "shutdown_unittest.cc", + ] + + deps = [ + ":interfaces", + ":shutdown_client", + ":shutdown_service", + "//base", + "//base/test:test_config", + "//services/shell/public/cpp:shell_test_support", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + + data_deps = [ + ":shutdown_client", + ":shutdown_service", + ":shutdown_unittest_manifest", + ] +} + +mojom("interfaces") { + sources = [ + "shutdown_unittest.mojom", + ] +} + +mojo_application_manifest("shutdown_unittest_manifest") { + application_name = "shutdown_unittest" + source = "shutdown_unittest_manifest.json" +} + +mojo_application_manifest("shutdown_service_manifest") { + application_name = "shutdown_service" + source = "shutdown_service_manifest.json" +} + +mojo_native_application("shutdown_service") { + testonly = true + sources = [ + "shutdown_service_app.cc", + ] + deps = [ + ":interfaces", + "//base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + data_deps = [ + ":shutdown_service_manifest", + ] +} + +mojo_application_manifest("shutdown_client_manifest") { + application_name = "shutdown_client" + source = "shutdown_client_manifest.json" +} + +mojo_native_application("shutdown_client") { + testonly = true + sources = [ + "shutdown_client_app.cc", + ] + deps = [ + ":interfaces", + "//base", + "//services/shell/public/cpp:sources", + "//services/shell/public/interfaces", + ] + data_deps = [ + ":shutdown_client_manifest", + ] +} diff --git a/chromium/services/shell/tests/shutdown/shutdown_unittest.mojom b/chromium/services/shell/tests/shutdown/shutdown_unittest.mojom new file mode 100644 index 00000000000..003fdfcc4c2 --- /dev/null +++ b/chromium/services/shell/tests/shutdown/shutdown_unittest.mojom @@ -0,0 +1,16 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module shell.mojom; + +interface ShutdownTestService { + SetClient(ShutdownTestClient client); + ShutDown(); +}; + +interface ShutdownTestClient {}; + +interface ShutdownTestClientController { + ConnectAndWait() => (); +}; diff --git a/chromium/services/shell/tests/test.mojom b/chromium/services/shell/tests/test.mojom new file mode 100644 index 00000000000..f5a45a8125a --- /dev/null +++ b/chromium/services/shell/tests/test.mojom @@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module shell; + +interface TestService { + Test(string test_string) => (); +}; + +interface TestA { + CallB(); + CallCFromB(); +}; + +interface TestB { + B() => (); + CallC() => (); +}; + +interface TestC { + C() => (); +}; diff --git a/chromium/skia/public/interfaces/test/traits_test_service.mojom b/chromium/skia/public/interfaces/test/traits_test_service.mojom new file mode 100644 index 00000000000..eaa829e8163 --- /dev/null +++ b/chromium/skia/public/interfaces/test/traits_test_service.mojom @@ -0,0 +1,18 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module skia.mojom; + +import "skia/public/interfaces/bitmap.mojom"; +import "skia/public/interfaces/image_filter.mojom"; + +// All functions on this interface echo their arguments to test StructTraits +// serialization and deserialization. +interface TraitsTestService { + [Sync] + EchoBitmap(Bitmap b) => (Bitmap pass); + + [Sync] + EchoImageFilter(ImageFilter i) => (ImageFilter pass); +}; diff --git a/chromium/sync/BUILD.gn b/chromium/sync/BUILD.gn new file mode 100644 index 00000000000..a406b374298 --- /dev/null +++ b/chromium/sync/BUILD.gn @@ -0,0 +1,899 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//sync/protocol/protocol_sources.gni") +import("//testing/test.gni") + +component("sync") { + public_deps = [ + ":sync_core", + "//sync/protocol", + ] +} + +# GYP version: sync/sync.gyp:sync_core +source_set("sync_core") { + sources = [ + "api/attachments/attachment.cc", + "api/attachments/attachment.h", + "api/attachments/attachment_id.cc", + "api/attachments/attachment_id.h", + "api/attachments/attachment_metadata.cc", + "api/attachments/attachment_metadata.h", + "api/attachments/attachment_store.cc", + "api/attachments/attachment_store.h", + "api/attachments/attachment_store_backend.cc", + "api/attachments/attachment_store_backend.h", + "api/conflict_resolution.cc", + "api/conflict_resolution.h", + "api/data_batch.h", + "api/entity_change.cc", + "api/entity_change.h", + "api/entity_data.cc", + "api/entity_data.h", + "api/metadata_batch.cc", + "api/metadata_batch.h", + "api/metadata_change_list.h", + "api/model_type_change_processor.cc", + "api/model_type_change_processor.h", + "api/model_type_service.cc", + "api/model_type_service.h", + "api/model_type_store.cc", + "api/model_type_store.h", + "api/string_ordinal.h", + "api/sync_change.cc", + "api/sync_change.h", + "api/sync_change_processor.cc", + "api/sync_change_processor.h", + "api/sync_data.cc", + "api/sync_data.h", + "api/sync_error.cc", + "api/sync_error.h", + "api/sync_error_factory.cc", + "api/sync_error_factory.h", + "api/sync_merge_result.cc", + "api/sync_merge_result.h", + "api/syncable_service.cc", + "api/syncable_service.h", + "api/time.h", + "base/sync_export.h", + "engine/all_status.cc", + "engine/all_status.h", + "engine/apply_control_data_updates.cc", + "engine/apply_control_data_updates.h", + "engine/backoff_delay_provider.cc", + "engine/backoff_delay_provider.h", + "engine/clear_server_data.cc", + "engine/clear_server_data.h", + "engine/commit.cc", + "engine/commit.h", + "engine/commit_contribution.cc", + "engine/commit_contribution.h", + "engine/commit_contributor.cc", + "engine/commit_contributor.h", + "engine/commit_processor.cc", + "engine/commit_processor.h", + "engine/commit_queue.cc", + "engine/commit_queue.h", + "engine/commit_util.cc", + "engine/commit_util.h", + "engine/conflict_resolver.cc", + "engine/conflict_resolver.h", + "engine/conflict_util.cc", + "engine/conflict_util.h", + "engine/directory_commit_contribution.cc", + "engine/directory_commit_contribution.h", + "engine/directory_commit_contributor.cc", + "engine/directory_commit_contributor.h", + "engine/directory_update_handler.cc", + "engine/directory_update_handler.h", + "engine/get_commit_ids.cc", + "engine/get_commit_ids.h", + "engine/get_updates_delegate.cc", + "engine/get_updates_delegate.h", + "engine/get_updates_processor.cc", + "engine/get_updates_processor.h", + "engine/model_type_worker.cc", + "engine/model_type_worker.h", + "engine/net/server_connection_manager.cc", + "engine/net/server_connection_manager.h", + "engine/net/url_translator.cc", + "engine/net/url_translator.h", + "engine/non_blocking_type_commit_contribution.cc", + "engine/non_blocking_type_commit_contribution.h", + "engine/nudge_handler.cc", + "engine/nudge_handler.h", + "engine/nudge_source.cc", + "engine/nudge_source.h", + "engine/process_updates_util.cc", + "engine/process_updates_util.h", + "engine/sync_cycle_event.cc", + "engine/sync_cycle_event.h", + "engine/sync_engine_event_listener.cc", + "engine/sync_engine_event_listener.h", + "engine/sync_scheduler.cc", + "engine/sync_scheduler.h", + "engine/sync_scheduler_impl.cc", + "engine/sync_scheduler_impl.h", + "engine/syncer.cc", + "engine/syncer.h", + "engine/syncer_proto_util.cc", + "engine/syncer_proto_util.h", + "engine/syncer_types.h", + "engine/syncer_util.cc", + "engine/syncer_util.h", + "engine/traffic_logger.cc", + "engine/traffic_logger.h", + "engine/update_applicator.cc", + "engine/update_applicator.h", + "engine/update_handler.cc", + "engine/update_handler.h", + "engine/worker_entity_tracker.cc", + "engine/worker_entity_tracker.h", + "internal_api/activation_context.cc", + "internal_api/attachments/attachment_downloader.cc", + "internal_api/attachments/attachment_downloader_impl.cc", + "internal_api/attachments/attachment_service.cc", + "internal_api/attachments/attachment_service_impl.cc", + "internal_api/attachments/attachment_service_proxy.cc", + "internal_api/attachments/attachment_service_proxy_for_test.cc", + "internal_api/attachments/attachment_store_frontend.cc", + "internal_api/attachments/attachment_uploader.cc", + "internal_api/attachments/attachment_uploader_impl.cc", + "internal_api/attachments/attachment_util.cc", + "internal_api/attachments/fake_attachment_downloader.cc", + "internal_api/attachments/fake_attachment_uploader.cc", + "internal_api/attachments/in_memory_attachment_store.cc", + "internal_api/attachments/on_disk_attachment_store.cc", + "internal_api/attachments/task_queue.cc", + "internal_api/base_node.cc", + "internal_api/base_transaction.cc", + "internal_api/change_record.cc", + "internal_api/change_reorder_buffer.cc", + "internal_api/change_reorder_buffer.h", + "internal_api/debug_info_event_listener.cc", + "internal_api/debug_info_event_listener.h", + "internal_api/delete_journal.cc", + "internal_api/events/clear_server_data_request_event.cc", + "internal_api/events/clear_server_data_response_event.cc", + "internal_api/events/commit_request_event.cc", + "internal_api/events/commit_response_event.cc", + "internal_api/events/configure_get_updates_request_event.cc", + "internal_api/events/get_updates_response_event.cc", + "internal_api/events/normal_get_updates_request_event.cc", + "internal_api/events/poll_get_updates_request_event.cc", + "internal_api/events/protocol_event.cc", + "internal_api/http_bridge.cc", + "internal_api/http_bridge_network_resources.cc", + "internal_api/internal_components_factory_impl.cc", + "internal_api/js_mutation_event_observer.cc", + "internal_api/js_mutation_event_observer.h", + "internal_api/js_sync_encryption_handler_observer.cc", + "internal_api/js_sync_encryption_handler_observer.h", + "internal_api/js_sync_manager_observer.cc", + "internal_api/js_sync_manager_observer.h", + "internal_api/model_type_connector.cc", + "internal_api/model_type_connector_proxy.cc", + "internal_api/model_type_connector_proxy.h", + "internal_api/model_type_store_backend.cc", + "internal_api/model_type_store_impl.cc", + "internal_api/processor_entity_tracker.cc", + "internal_api/protocol_event_buffer.cc", + "internal_api/protocol_event_buffer.h", + "internal_api/public/activation_context.h", + "internal_api/public/attachments/attachment_downloader.h", + "internal_api/public/attachments/attachment_downloader_impl.h", + "internal_api/public/attachments/attachment_service.h", + "internal_api/public/attachments/attachment_service_impl.h", + "internal_api/public/attachments/attachment_service_proxy.h", + "internal_api/public/attachments/attachment_service_proxy_for_test.h", + "internal_api/public/attachments/attachment_store_frontend.h", + "internal_api/public/attachments/attachment_uploader.h", + "internal_api/public/attachments/attachment_uploader_impl.h", + "internal_api/public/attachments/attachment_util.h", + "internal_api/public/attachments/fake_attachment_downloader.h", + "internal_api/public/attachments/fake_attachment_uploader.h", + "internal_api/public/attachments/in_memory_attachment_store.h", + "internal_api/public/attachments/on_disk_attachment_store.h", + "internal_api/public/base/attachment_id_proto.cc", + "internal_api/public/base/attachment_id_proto.h", + "internal_api/public/base/cancelation_observer.cc", + "internal_api/public/base/cancelation_observer.h", + "internal_api/public/base/cancelation_signal.cc", + "internal_api/public/base/cancelation_signal.h", + "internal_api/public/base/enum_set.h", + "internal_api/public/base/invalidation_interface.cc", + "internal_api/public/base/invalidation_interface.h", + "internal_api/public/base/model_type.h", + "internal_api/public/base/node_ordinal.cc", + "internal_api/public/base/node_ordinal.h", + "internal_api/public/base/ordinal.h", + "internal_api/public/base/progress_marker_map.cc", + "internal_api/public/base/progress_marker_map.h", + "internal_api/public/base/stop_source.h", + "internal_api/public/base/unique_position.cc", + "internal_api/public/base/unique_position.h", + "internal_api/public/base_node.h", + "internal_api/public/base_transaction.h", + "internal_api/public/change_record.h", + "internal_api/public/configure_reason.h", + "internal_api/public/data_batch_impl.cc", + "internal_api/public/data_batch_impl.h", + "internal_api/public/data_type_association_stats.cc", + "internal_api/public/data_type_association_stats.h", + "internal_api/public/data_type_debug_info_listener.cc", + "internal_api/public/data_type_debug_info_listener.h", + "internal_api/public/data_type_error_handler.h", + "internal_api/public/delete_journal.h", + "internal_api/public/engine/model_safe_worker.cc", + "internal_api/public/engine/model_safe_worker.h", + "internal_api/public/engine/passive_model_worker.cc", + "internal_api/public/engine/passive_model_worker.h", + "internal_api/public/engine/polling_constants.cc", + "internal_api/public/engine/polling_constants.h", + "internal_api/public/engine/sync_status.cc", + "internal_api/public/engine/sync_status.h", + "internal_api/public/events/clear_server_data_request_event.h", + "internal_api/public/events/clear_server_data_response_event.h", + "internal_api/public/events/commit_request_event.h", + "internal_api/public/events/commit_response_event.h", + "internal_api/public/events/configure_get_updates_request_event.h", + "internal_api/public/events/get_updates_response_event.h", + "internal_api/public/events/normal_get_updates_request_event.h", + "internal_api/public/events/poll_get_updates_request_event.h", + "internal_api/public/events/protocol_event.h", + "internal_api/public/http_bridge.h", + "internal_api/public/http_bridge_network_resources.h", + "internal_api/public/http_post_provider_factory.h", + "internal_api/public/http_post_provider_interface.h", + "internal_api/public/internal_components_factory.h", + "internal_api/public/internal_components_factory_impl.h", + "internal_api/public/model_type_connector.h", + "internal_api/public/model_type_processor.cc", + "internal_api/public/model_type_processor.h", + "internal_api/public/model_type_store_backend.h", + "internal_api/public/model_type_store_impl.h", + "internal_api/public/network_resources.h", + "internal_api/public/non_blocking_sync_common.cc", + "internal_api/public/non_blocking_sync_common.h", + "internal_api/public/processor_entity_tracker.h", + "internal_api/public/read_node.h", + "internal_api/public/read_transaction.h", + "internal_api/public/sessions/commit_counters.cc", + "internal_api/public/sessions/commit_counters.h", + "internal_api/public/sessions/model_neutral_state.cc", + "internal_api/public/sessions/model_neutral_state.h", + "internal_api/public/sessions/status_counters.cc", + "internal_api/public/sessions/status_counters.h", + "internal_api/public/sessions/sync_session_snapshot.cc", + "internal_api/public/sessions/sync_session_snapshot.h", + "internal_api/public/sessions/type_debug_info_observer.cc", + "internal_api/public/sessions/type_debug_info_observer.h", + "internal_api/public/sessions/update_counters.cc", + "internal_api/public/sessions/update_counters.h", + "internal_api/public/shared_model_type_processor.h", + "internal_api/public/shutdown_reason.h", + "internal_api/public/simple_metadata_change_list.cc", + "internal_api/public/simple_metadata_change_list.h", + "internal_api/public/sync_auth_provider.h", + "internal_api/public/sync_encryption_handler.cc", + "internal_api/public/sync_encryption_handler.h", + "internal_api/public/sync_manager.cc", + "internal_api/public/sync_manager.h", + "internal_api/public/sync_manager_factory.h", + "internal_api/public/user_share.h", + "internal_api/public/util/experiments.h", + "internal_api/public/util/immutable.h", + "internal_api/public/util/proto_value_ptr.h", + "internal_api/public/util/sync_db_util.h", + "internal_api/public/util/sync_string_conversions.cc", + "internal_api/public/util/sync_string_conversions.h", + "internal_api/public/util/syncer_error.cc", + "internal_api/public/util/syncer_error.h", + "internal_api/public/util/unrecoverable_error_handler.h", + "internal_api/public/util/unrecoverable_error_info.cc", + "internal_api/public/util/unrecoverable_error_info.h", + "internal_api/public/util/weak_handle.cc", + "internal_api/public/util/weak_handle.h", + "internal_api/public/write_node.h", + "internal_api/public/write_transaction.h", + "internal_api/read_node.cc", + "internal_api/read_transaction.cc", + "internal_api/shared_model_type_processor.cc", + "internal_api/sync_db_util.cc", + "internal_api/sync_encryption_handler_impl.cc", + "internal_api/sync_encryption_handler_impl.h", + "internal_api/sync_manager_factory.cc", + "internal_api/sync_manager_impl.cc", + "internal_api/sync_manager_impl.h", + "internal_api/syncapi_internal.cc", + "internal_api/syncapi_internal.h", + "internal_api/syncapi_server_connection_manager.cc", + "internal_api/syncapi_server_connection_manager.h", + "internal_api/user_share.cc", + "internal_api/write_node.cc", + "internal_api/write_transaction.cc", + "js/js_backend.h", + "js/js_controller.h", + "js/js_event_details.cc", + "js/js_event_details.h", + "js/js_event_handler.h", + "js/sync_js_controller.cc", + "js/sync_js_controller.h", + "protocol/proto_enum_conversions.cc", + "protocol/proto_enum_conversions.h", + "protocol/proto_value_conversions.cc", + "protocol/proto_value_conversions.h", + "protocol/sync_protocol_error.cc", + "protocol/sync_protocol_error.h", + "sessions/data_type_tracker.cc", + "sessions/data_type_tracker.h", + "sessions/debug_info_getter.h", + "sessions/directory_type_debug_info_emitter.cc", + "sessions/directory_type_debug_info_emitter.h", + "sessions/model_type_registry.cc", + "sessions/model_type_registry.h", + "sessions/nudge_tracker.cc", + "sessions/nudge_tracker.h", + "sessions/status_controller.cc", + "sessions/status_controller.h", + "sessions/sync_session.cc", + "sessions/sync_session.h", + "sessions/sync_session_context.cc", + "sessions/sync_session_context.h", + "syncable/dir_open_result.h", + "syncable/directory.cc", + "syncable/directory.h", + "syncable/directory_backing_store.cc", + "syncable/directory_backing_store.h", + "syncable/directory_change_delegate.h", + "syncable/entry.cc", + "syncable/entry.h", + "syncable/entry_kernel.cc", + "syncable/entry_kernel.h", + "syncable/in_memory_directory_backing_store.cc", + "syncable/in_memory_directory_backing_store.h", + "syncable/invalid_directory_backing_store.cc", + "syncable/invalid_directory_backing_store.h", + "syncable/metahandle_set.h", + "syncable/model_neutral_mutable_entry.cc", + "syncable/model_neutral_mutable_entry.h", + "syncable/model_type.cc", + "syncable/mutable_entry.cc", + "syncable/mutable_entry.h", + "syncable/nigori_handler.cc", + "syncable/nigori_handler.h", + "syncable/nigori_util.cc", + "syncable/nigori_util.h", + "syncable/on_disk_directory_backing_store.cc", + "syncable/on_disk_directory_backing_store.h", + "syncable/parent_child_index.cc", + "syncable/parent_child_index.h", + "syncable/scoped_kernel_lock.cc", + "syncable/scoped_kernel_lock.h", + "syncable/scoped_parent_child_index_updater.cc", + "syncable/scoped_parent_child_index_updater.h", + "syncable/syncable-inl.h", + "syncable/syncable_base_transaction.cc", + "syncable/syncable_base_transaction.h", + "syncable/syncable_base_write_transaction.cc", + "syncable/syncable_base_write_transaction.h", + "syncable/syncable_changes_version.h", + "syncable/syncable_columns.h", + "syncable/syncable_delete_journal.cc", + "syncable/syncable_delete_journal.h", + "syncable/syncable_enum_conversions.cc", + "syncable/syncable_enum_conversions.h", + "syncable/syncable_id.cc", + "syncable/syncable_id.h", + "syncable/syncable_model_neutral_write_transaction.cc", + "syncable/syncable_model_neutral_write_transaction.h", + "syncable/syncable_proto_util.cc", + "syncable/syncable_proto_util.h", + "syncable/syncable_read_transaction.cc", + "syncable/syncable_read_transaction.h", + "syncable/syncable_util.cc", + "syncable/syncable_util.h", + "syncable/syncable_write_transaction.cc", + "syncable/syncable_write_transaction.h", + "syncable/transaction_observer.h", + "syncable/write_transaction_info.cc", + "syncable/write_transaction_info.h", + "util/cryptographer.cc", + "util/cryptographer.h", + "util/data_type_histogram.cc", + "util/data_type_histogram.h", + "util/encryptor.h", + "util/extensions_activity.cc", + "util/extensions_activity.h", + "util/get_session_name.cc", + "util/get_session_name.h", + "util/get_session_name_ios.h", + "util/get_session_name_ios.mm", + "util/get_session_name_linux.cc", + "util/get_session_name_linux.h", + "util/get_session_name_mac.h", + "util/get_session_name_mac.mm", + "util/get_session_name_win.cc", + "util/get_session_name_win.h", + "util/logging.cc", + "util/logging.h", + "util/nigori.cc", + "util/nigori.h", + "util/time.cc", + "util/time.h", + ] + + configs += [ "//build/config:precompiled_headers" ] + + public_deps = [ + "//net", + "//sync/internal_api/attachments/proto", + ] + deps = [ + "//base", + "//base:i18n", + "//base/third_party/dynamic_annotations", + "//crypto", + "//google_apis", + "//sql", + "//sync/protocol", + "//third_party/leveldatabase", + "//third_party/zlib", + "//url", + ] + + if (is_android) { + deps += [ "//sync/android:jni_headers" ] + sources += [ + "android/model_type_helper.cc", + "android/model_type_helper.h", + "android/sync_jni_registrar.cc", + "android/sync_jni_registrar.h", + ] + } + + if (is_chromeos) { + # Required by get_session_name.cc on Chrome OS. + deps += [ "//chromeos" ] + } + + if (is_mac) { + libs = [ + "CoreFoundation.framework", + "SystemConfiguration.framework", # Required by get_session_name_mac.mm. + ] + } + + defines = [ "SYNC_IMPLEMENTATION" ] + configs += [ "//build/config/compiler:wexit_time_destructors" ] +} + +# GYP version: sync/sync_tests.gypi:test_support_sync_core +static_library("test_support_sync_core") { + testonly = true + sources = [ + "internal_api/public/base/model_type_test_util.cc", + "internal_api/public/base/model_type_test_util.h", + "js/js_test_util.cc", + "js/js_test_util.h", + "sessions/test_util.cc", + "sessions/test_util.h", + "test/callback_counter.h", + "test/directory_backing_store_corruption_testing.cc", + "test/directory_backing_store_corruption_testing.h", + "test/engine/fake_model_worker.cc", + "test/engine/fake_model_worker.h", + "test/engine/fake_sync_scheduler.cc", + "test/engine/fake_sync_scheduler.h", + "test/engine/mock_connection_manager.cc", + "test/engine/mock_connection_manager.h", + "test/engine/mock_model_type_processor.cc", + "test/engine/mock_model_type_processor.h", + "test/engine/mock_model_type_worker.cc", + "test/engine/mock_model_type_worker.h", + "test/engine/mock_nudge_handler.cc", + "test/engine/mock_nudge_handler.h", + "test/engine/mock_update_handler.cc", + "test/engine/mock_update_handler.h", + "test/engine/single_type_mock_server.cc", + "test/engine/single_type_mock_server.h", + "test/engine/test_directory_setter_upper.cc", + "test/engine/test_directory_setter_upper.h", + "test/engine/test_id_factory.h", + "test/engine/test_syncable_utils.cc", + "test/engine/test_syncable_utils.h", + "test/fake_encryptor.cc", + "test/fake_encryptor.h", + "test/fake_sync_encryption_handler.cc", + "test/fake_sync_encryption_handler.h", + "test/mock_invalidation.cc", + "test/mock_invalidation.h", + "test/mock_invalidation_tracker.cc", + "test/mock_invalidation_tracker.h", + "test/null_directory_change_delegate.cc", + "test/null_directory_change_delegate.h", + "test/null_transaction_observer.cc", + "test/null_transaction_observer.h", + "test/sessions/mock_debug_info_getter.cc", + "test/sessions/mock_debug_info_getter.h", + "test/sessions/test_scoped_session_event_listener.h", + "test/test_directory_backing_store.cc", + "test/test_directory_backing_store.h", + "test/test_transaction_observer.cc", + "test/test_transaction_observer.h", + "test/trackable_mock_invalidation.cc", + "test/trackable_mock_invalidation.h", + "util/mock_unrecoverable_error_handler.cc", + "util/mock_unrecoverable_error_handler.h", + "util/test_unrecoverable_error_handler.cc", + "util/test_unrecoverable_error_handler.h", + ] + + public_deps = [ + "//base", + "//sync", + "//testing/gmock", + "//testing/gtest", + ] + + defines = [ "SYNC_TEST" ] + configs += [ "//build/config/compiler:wexit_time_destructors" ] +} + +# GYP version: sync/sync_tests.gypi:test_support_sync_internal_api +static_library("test_support_sync_internal_api") { + testonly = true + sources = [ + "internal_api/public/test/data_type_error_handler_mock.h", + "internal_api/public/test/fake_model_type_connector.h", + "internal_api/public/test/fake_model_type_processor.h", + "internal_api/public/test/fake_sync_manager.h", + "internal_api/public/test/model_type_store_test_util.h", + "internal_api/public/test/sync_manager_factory_for_profile_sync_test.h", + "internal_api/public/test/test_entry_factory.h", + "internal_api/public/test/test_internal_components_factory.h", + "internal_api/public/test/test_user_share.h", + "internal_api/test/data_type_error_handler_mock.cc", + "internal_api/test/fake_model_type_connector.cc", + "internal_api/test/fake_model_type_processor.cc", + "internal_api/test/fake_sync_manager.cc", + "internal_api/test/model_type_store_test_util.cc", + "internal_api/test/sync_manager_factory_for_profile_sync_test.cc", + "internal_api/test/sync_manager_for_profile_sync_test.cc", + "internal_api/test/sync_manager_for_profile_sync_test.h", + "internal_api/test/test_entry_factory.cc", + "internal_api/test/test_internal_components_factory.cc", + "internal_api/test/test_user_share.cc", + ] + + public_deps = [ + ":test_support_sync_core", + "//base", + "//sync", + "//testing/gtest", + ] + + defines = [ "SYNC_TEST" ] + configs += [ "//build/config/compiler:wexit_time_destructors" ] +} + +# GYP version: sync/sync_tests.gypi:test_support_sync_api +static_library("test_support_sync_api") { + testonly = true + sources = [ + "api/fake_model_type_change_processor.cc", + "api/fake_model_type_change_processor.h", + "api/fake_model_type_service.cc", + "api/fake_model_type_service.h", + "api/fake_sync_change_processor.cc", + "api/fake_sync_change_processor.h", + "api/fake_syncable_service.cc", + "api/fake_syncable_service.h", + "api/mock_model_type_store.cc", + "api/mock_model_type_store.h", + "api/sync_change_processor_wrapper_for_test.cc", + "api/sync_change_processor_wrapper_for_test.h", + "api/sync_error_factory_mock.cc", + "api/sync_error_factory_mock.h", + ] + + defines = [ "SYNC_TEST" ] + + public_deps = [ + "//base", + "//sync", + "//testing/gmock", + ] +} + +# GYP version: sync/sync_tests.gypi:sync_unit_tests +test("sync_unit_tests") { + sources = [ + "api/attachments/attachment_id_unittest.cc", + "api/attachments/attachment_metadata_unittest.cc", + "api/attachments/attachment_unittest.cc", + "api/entity_data_unittest.cc", + "api/model_type_service_unittest.cc", + "api/sync_change_unittest.cc", + "api/sync_data_unittest.cc", + "api/sync_error_unittest.cc", + "api/sync_merge_result_unittest.cc", + "engine/apply_control_data_updates_unittest.cc", + "engine/backoff_delay_provider_unittest.cc", + "engine/directory_commit_contribution_unittest.cc", + "engine/directory_update_handler_unittest.cc", + "engine/get_updates_processor_unittest.cc", + "engine/model_type_worker_unittest.cc", + "engine/sync_scheduler_unittest.cc", + "engine/syncer_proto_util_unittest.cc", + "engine/syncer_unittest.cc", + "engine/syncer_util_unittest.cc", + "engine/worker_entity_tracker_unittest.cc", + "internal_api/attachments/attachment_downloader_impl_unittest.cc", + "internal_api/attachments/attachment_service_impl_unittest.cc", + "internal_api/attachments/attachment_service_proxy_unittest.cc", + "internal_api/attachments/attachment_store_frontend_unittest.cc", + "internal_api/attachments/attachment_store_test_template.h", + "internal_api/attachments/attachment_uploader_impl_unittest.cc", + "internal_api/attachments/fake_attachment_downloader_unittest.cc", + "internal_api/attachments/fake_attachment_uploader_unittest.cc", + "internal_api/attachments/in_memory_attachment_store_unittest.cc", + "internal_api/attachments/on_disk_attachment_store_unittest.cc", + "internal_api/attachments/task_queue_unittest.cc", + "internal_api/debug_info_event_listener_unittest.cc", + "internal_api/http_bridge_unittest.cc", + "internal_api/js_mutation_event_observer_unittest.cc", + "internal_api/js_sync_encryption_handler_observer_unittest.cc", + "internal_api/js_sync_manager_observer_unittest.cc", + "internal_api/model_type_connector_proxy_unittest.cc", + "internal_api/model_type_store_backend_unittest.cc", + "internal_api/model_type_store_impl_unittest.cc", + "internal_api/processor_entity_tracker_unittest.cc", + "internal_api/protocol_event_buffer_unittest.cc", + "internal_api/public/base/attachment_id_proto_unittest.cc", + "internal_api/public/base/cancelation_signal_unittest.cc", + "internal_api/public/base/enum_set_unittest.cc", + "internal_api/public/base/node_ordinal_unittest.cc", + "internal_api/public/base/ordinal_unittest.cc", + "internal_api/public/base/unique_position_unittest.cc", + "internal_api/public/change_record_unittest.cc", + "internal_api/public/data_batch_impl_unittest.cc", + "internal_api/public/engine/model_safe_worker_unittest.cc", + "internal_api/public/sessions/sync_session_snapshot_unittest.cc", + "internal_api/public/simple_metadata_change_list_unittest.cc", + "internal_api/public/util/immutable_unittest.cc", + "internal_api/public/util/proto_value_ptr_unittest.cc", + "internal_api/public/util/weak_handle_unittest.cc", + "internal_api/shared_model_type_processor_unittest.cc", + "internal_api/sync_encryption_handler_impl_unittest.cc", + "internal_api/sync_manager_impl_unittest.cc", + "internal_api/syncapi_server_connection_manager_unittest.cc", + "js/js_event_details_unittest.cc", + "js/sync_js_controller_unittest.cc", + "protocol/proto_enum_conversions_unittest.cc", + "protocol/proto_value_conversions_unittest.cc", + "sessions/model_type_registry_unittest.cc", + "sessions/nudge_tracker_unittest.cc", + "sessions/status_controller_unittest.cc", + "syncable/directory_backing_store_unittest.cc", + "syncable/directory_unittest.cc", + "syncable/directory_unittest.h", + "syncable/entry_kernel_unittest.cc", + "syncable/model_type_unittest.cc", + "syncable/nigori_util_unittest.cc", + "syncable/parent_child_index_unittest.cc", + "syncable/syncable_enum_conversions_unittest.cc", + "syncable/syncable_id_unittest.cc", + "syncable/syncable_unittest.cc", + "syncable/syncable_util_unittest.cc", + "util/cryptographer_unittest.cc", + "util/data_type_histogram_unittest.cc", + "util/get_session_name_unittest.cc", + "util/nigori_unittest.cc", + "util/protobuf_unittest.cc", + ] + + configs += [ "//build/config:precompiled_headers" ] + + data = [ + "//chrome/test/data/sync/", + "//net/tools/testserver/", + "//third_party/pyftpdlib/", + "//third_party/pywebsocket/", + "//third_party/tlslite/", + "$root_out_dir/pyproto/google/", + ] + + deps = [ + ":test_support_sync_api", + ":test_support_sync_core", + ":test_support_sync_internal_api", + "//base", + "//base/test:run_all_unittests", + "//google_apis", + "//google_apis:test_support", + "//net", + "//net:test_support", + "//sql", + "//sql:test_support", + "//sync", + "//sync/protocol", + "//testing/gmock", + "//testing/gtest", + "//third_party/leveldatabase", + "//third_party/protobuf:protobuf_lite", + ] + + if (is_chromeos) { + # Required by get_session_name_unittest.cc on Chrome OS. + deps += [ "//chromeos" ] + } + + if (is_ios) { + sources -= [ "internal_api/http_bridge_unittest.cc" ] + } + + defines = [ "SYNC_TEST" ] +} + +# GYP version: sync/sync_tests.gypi:test_support_sync_fake_server +static_library("test_support_sync_fake_server") { + testonly = true + sources = [ + "test/fake_server/bookmark_entity.cc", + "test/fake_server/bookmark_entity.h", + "test/fake_server/bookmark_entity_builder.cc", + "test/fake_server/bookmark_entity_builder.h", + "test/fake_server/entity_builder_factory.cc", + "test/fake_server/entity_builder_factory.h", + "test/fake_server/fake_server.cc", + "test/fake_server/fake_server.h", + "test/fake_server/fake_server_entity.cc", + "test/fake_server/fake_server_entity.h", + "test/fake_server/fake_server_http_post_provider.cc", + "test/fake_server/fake_server_http_post_provider.h", + "test/fake_server/fake_server_network_resources.cc", + "test/fake_server/fake_server_network_resources.h", + "test/fake_server/fake_server_verifier.cc", + "test/fake_server/fake_server_verifier.h", + "test/fake_server/permanent_entity.cc", + "test/fake_server/permanent_entity.h", + "test/fake_server/sessions_hierarchy.cc", + "test/fake_server/sessions_hierarchy.h", + "test/fake_server/tombstone_entity.cc", + "test/fake_server/tombstone_entity.h", + "test/fake_server/unique_client_entity.cc", + "test/fake_server/unique_client_entity.h", + ] + + deps = [ + "//base", + "//net", + "//sync", + "//testing/gtest", + "//url", + ] + + public_deps = [ + "//third_party/protobuf:protobuf_lite", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] +} + +# GYP version: sync/sync_tests.gypi:test_support_sync_testserver +static_library("test_support_sync_testserver") { + testonly = true + sources = [ + "test/local_sync_test_server.cc", + "test/local_sync_test_server.h", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + public_deps = [ + "//base", + "//net:test_support", + ] + deps = [ + ":sync", + + # The sync test server uses Python modules generated by the sync protos. + "//third_party/protobuf:py_proto", + ] +} + +if (!is_ios) { + # GYP version: sync/sync_tests.gypi:run_sync_testserver + executable("run_sync_testserver") { + testonly = true + sources = [ + "tools/testserver/run_sync_testserver.cc", + ] + + deps = [ + ":test_support_sync_testserver", + "//base", + "//base/test:test_support", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//net:test_support", + "//testing/gtest", + ] + } +} + +if (is_android) { + import("//build/config/android/rules.gni") + + # GYP: //sync/sync_tests.gypi:fake_server_jni + generate_jni("fake_server_jni") { + testonly = true + jni_package = "sync/test/fake_server" + sources = [ + "//chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FakeServerHelper.java", + ] + } + + _test_support_sync_prepared_protos_dir = + "$root_gen_dir/test_support_sync_proto_java_prepare/" + action("test_support_sync_proto_java_prepare") { + script = "//sync/protocol/prepare_protos_for_java_tests.py" + inputs = sync_protocol_sources + outputs = process_file_template( + sync_protocol_sources, + [ "$_test_support_sync_prepared_protos_dir/{{source_file_part}}" ]) + args = [ + "--output_dir", + rebase_path(_test_support_sync_prepared_protos_dir, root_build_dir), + ] + args += rebase_path(sync_protocol_sources, root_build_dir) + } + + # GYP: //sync/sync_tests.gypi:test_support_sync_proto_java + proto_java_library("test_support_sync_proto_java") { + proto_path = _test_support_sync_prepared_protos_dir + sources = get_target_outputs(":test_support_sync_proto_java_prepare") + deps = [ + ":test_support_sync_proto_java_prepare", + ] + } + + # GYP: //sync/sync_tests.gypi:sync_java_test_support + android_library("sync_java_test_support") { + testonly = true + deps = [ + "android:sync_java", + "//base:base_java", + "//base:base_java_test_support", + "//third_party/jsr-305:jsr_305_javalib", + ] + java_files = [ + "test/android/javatests/src/org/chromium/sync/test/util/AccountHolder.java", + "test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java", + "test/android/javatests/src/org/chromium/sync/test/util/MockSyncContentResolverDelegate.java", + "test/android/javatests/src/org/chromium/sync/test/util/SimpleFuture.java", + ] + } + + # GYP: //sync/sync_tests.gypi:test_support_sync_fake_server_android + static_library("test_support_sync_fake_server_android") { + testonly = true + sources = [ + "test/fake_server/android/fake_server_helper_android.cc", + "test/fake_server/android/fake_server_helper_android.h", + ] + deps = [ + ":fake_server_jni", + ":sync_core", + ":test_support_sync_fake_server", + "//base", + "//sync/protocol:protocol", + "//testing/gtest", + "//url:url", + ] + } +} diff --git a/chromium/sync/android/BUILD.gn b/chromium/sync/android/BUILD.gn new file mode 100644 index 00000000000..a906d3d8bfe --- /dev/null +++ b/chromium/sync/android/BUILD.gn @@ -0,0 +1,71 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +android_library("sync_java") { + deps = [ + "//base:base_java", + "//net/android:net_java", + "//third_party/android_tools:android_gcm_java", + "//third_party/cacheinvalidation:cacheinvalidation_javalib", + "//third_party/cacheinvalidation:cacheinvalidation_proto_java", + "//third_party/jsr-305:jsr_305_javalib", + google_play_services_library, + ] + srcjar_deps = [ ":java_enums" ] + java_files = [ + "java/src/org/chromium/sync/AndroidSyncSettings.java", + "java/src/org/chromium/sync/ModelTypeHelper.java", + "java/src/org/chromium/sync/PassphraseType.java", + "java/src/org/chromium/sync/SyncConstants.java", + "java/src/org/chromium/sync/SyncContentResolverDelegate.java", + "java/src/org/chromium/sync/SystemSyncContentResolverDelegate.java", + "java/src/org/chromium/sync/notifier/InvalidationClientNameGenerator.java", + "java/src/org/chromium/sync/notifier/InvalidationClientNameProvider.java", + "java/src/org/chromium/sync/notifier/InvalidationIntentProtocol.java", + "java/src/org/chromium/sync/notifier/InvalidationPreferences.java", + "java/src/org/chromium/sync/notifier/RandomizedInvalidationClientNameGenerator.java", + "java/src/org/chromium/sync/signin/AccountManagerDelegate.java", + "java/src/org/chromium/sync/signin/AccountManagerHelper.java", + "java/src/org/chromium/sync/signin/AuthException.java", + "java/src/org/chromium/sync/signin/ChromeSigninController.java", + "java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java", + ] +} + +android_library("sync_javatests") { + testonly = true + deps = [ + ":sync_java", + "//base:base_java", + "//base:base_java_test_support", + "//sync:sync_java_test_support", + "//third_party/cacheinvalidation:cacheinvalidation_javalib", + "//third_party/cacheinvalidation:cacheinvalidation_proto_java", + "//third_party/jsr-305:jsr_305_javalib", + ] + java_files = [ + "javatests/src/org/chromium/sync/AndroidSyncSettingsTest.java", + "javatests/src/org/chromium/sync/notifier/InvalidationClientNameProviderTest.java", + "javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java", + "javatests/src/org/chromium/sync/notifier/signin/AccountManagerHelperTest.java", + ] +} + +# GYP: //sync/sync_android.gypi:model_type_java +java_cpp_enum("java_enums") { + sources = [ + "//sync/internal_api/public/base/model_type.h", + "//sync/internal_api/public/base/stop_source.h", + ] +} + +generate_jni("jni_headers") { + sources = [ + "java/src/org/chromium/sync/ModelTypeHelper.java", + ] + jni_package = "syncer" +} diff --git a/chromium/sync/internal_api/attachments/proto/BUILD.gn b/chromium/sync/internal_api/attachments/proto/BUILD.gn new file mode 100644 index 00000000000..2c2fe0834a4 --- /dev/null +++ b/chromium/sync/internal_api/attachments/proto/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +proto_library("proto") { + # This should only get compiled into the sync component. + visibility = [ "//sync:sync_core" ] + + sources = [ + "attachment_store.proto", + ] + cc_generator_options = "dllexport_decl=SYNC_EXPORT:" + cc_include = "sync/base/sync_export.h" + + defines = [ "SYNC_IMPLEMENTATION" ] +} diff --git a/chromium/sync/protocol/BUILD.gn b/chromium/sync/protocol/BUILD.gn new file mode 100644 index 00000000000..c3b41f4210e --- /dev/null +++ b/chromium/sync/protocol/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") +import("protocol_sources.gni") + +# This must be a component for the dependency structure we have now, but the +# proto_library generates a source set. Link those into a component. +component("protocol") { + public_deps = [ + ":protocol_internal", + ] +} + +proto_library("protocol_internal") { + visibility = [ ":protocol" ] + + sources = sync_protocol_sources + + cc_generator_options = "dllexport_decl=SYNC_PROTO_EXPORT:" + cc_include = "sync/protocol/sync_proto_export.h" + component_build_force_source_set = true + + defines = [ "SYNC_PROTO_IMPLEMENTATION" ] + + extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] +} diff --git a/chromium/sync/protocol/protocol_sources.gni b/chromium/sync/protocol/protocol_sources.gni new file mode 100644 index 00000000000..86cefae53a2 --- /dev/null +++ b/chromium/sync/protocol/protocol_sources.gni @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +protocol_gypi = + exec_script("//build/gypi_to_gn.py", + [ + rebase_path("//sync/protocol/protocol.gypi"), + "--replace=<(sync_proto_sources_dir)=//sync/protocol", + ], + "scope", + [ "//sync/protocol/protocol.gypi" ]) + +sync_protocol_sources = protocol_gypi.sync_proto_source_paths diff --git a/chromium/sync/tools/BUILD.gn b/chromium/sync/tools/BUILD.gn new file mode 100644 index 00000000000..102584241df --- /dev/null +++ b/chromium/sync/tools/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +source_set("common") { + testonly = true + + sources = [ + "null_invalidation_state_tracker.cc", + "null_invalidation_state_tracker.h", + ] + + deps = [ + "//base", + "//components/invalidation/impl", + "//components/sync_driver", + "//sync", + ] +} + +test("sync_listen_notifications") { + sources = [ + "sync_listen_notifications.cc", + ] + + defines = [ "SYNC_TEST" ] + + deps = [ + ":common", + "//base", + "//components/invalidation/impl", + "//components/sync_driver", + "//jingle:notifier", + "//net:test_support", + "//sync:test_support_sync_core", + ] +} + +test("sync_client") { + sources = [ + "sync_client.cc", + ] + + defines = [ "SYNC_TEST" ] + + deps = [ + ":common", + "//base", + "//components/invalidation/impl", + "//components/sync_driver", + "//jingle:notifier", + "//net:test_support", + "//sync:test_support_sync_core", + ] +} diff --git a/chromium/testing/android/appurify_support/BUILD.gn b/chromium/testing/android/appurify_support/BUILD.gn new file mode 100644 index 00000000000..871f9d0dd8c --- /dev/null +++ b/chromium/testing/android/appurify_support/BUILD.gn @@ -0,0 +1,15 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //testing/android/appurify_support.gyp:appurify_support_java +android_library("appurify_support_java") { + chromium_code = true + + java_files = [ + "java/src/org/chromium/test/support/ResultsBundleGenerator.java", + "java/src/org/chromium/test/support/RobotiumBundleGenerator.java", + ] +} diff --git a/chromium/testing/android/broker/BUILD.gn b/chromium/testing/android/broker/BUILD.gn new file mode 100644 index 00000000000..8daa0408329 --- /dev/null +++ b/chromium/testing/android/broker/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //testing/android/on_device_instrumentation.gyp:broker_java +android_library("broker_java") { + chromium_code = true + + java_files = + [ "java/src/org/chromium/test/broker/OnDeviceInstrumentationBroker.java" ] +} diff --git a/chromium/testing/android/driver/BUILD.gn b/chromium/testing/android/driver/BUILD.gn new file mode 100644 index 00000000000..9dd354a23a9 --- /dev/null +++ b/chromium/testing/android/driver/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //testing/android/on_device_instrumentation.gyp:driver_apk +android_apk("driver_apk") { + android_manifest = "java/AndroidManifest.xml" + apk_name = "OnDeviceInstrumentationDriver" + testonly = true + + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//testing/android/appurify_support:appurify_support_java", + "//testing/android/broker:broker_java", + "//testing/android/reporter:reporter_java", + ] + + java_files = + [ "java/src/org/chromium/test/driver/OnDeviceInstrumentationDriver.java" ] +} diff --git a/chromium/testing/android/junit/BUILD.gn b/chromium/testing/android/junit/BUILD.gn new file mode 100644 index 00000000000..328f0523a94 --- /dev/null +++ b/chromium/testing/android/junit/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_android) + +import("//build/config/android/rules.gni") + +# GYP: //testing/android/junit_test.gyp:junit_test_support +java_library("junit_test_support") { + testonly = true + java_files = [ + "java/src/org/chromium/testing/local/BackgroundShadowAsyncTask.java", + "java/src/org/chromium/testing/local/CustomShadowAsyncTask.java", + "java/src/org/chromium/testing/local/GtestComputer.java", + "java/src/org/chromium/testing/local/GtestFilter.java", + "java/src/org/chromium/testing/local/GtestListener.java", + "java/src/org/chromium/testing/local/GtestLogger.java", + "java/src/org/chromium/testing/local/JsonListener.java", + "java/src/org/chromium/testing/local/JsonLogger.java", + "java/src/org/chromium/testing/local/JunitTestArgParser.java", + "java/src/org/chromium/testing/local/JunitTestMain.java", + "java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java", + "java/src/org/chromium/testing/local/PackageFilter.java", + "java/src/org/chromium/testing/local/RobolectricClasspathDependencyResolver.java", + "java/src/org/chromium/testing/local/RunnerFilter.java", + ] + deps = [ + "//third_party/junit", + "//third_party/mockito:mockito_java", + "//third_party/robolectric:android-all-4.3_r2-robolectric-0", + "//third_party/robolectric:robolectric_java", + ] +} + +# GYP: //testing/android/junit_test.gyp:junit_unit_tests +junit_binary("junit_unit_tests") { + java_files = [ + "javatests/src/org/chromium/testing/local/GtestFilterTest.java", + "javatests/src/org/chromium/testing/local/GtestLoggerTest.java", + "javatests/src/org/chromium/testing/local/PackageFilterTest.java", + "javatests/src/org/chromium/testing/local/RunnerFilterTest.java", + ] +} diff --git a/chromium/testing/android/native_test/BUILD.gn b/chromium/testing/android/native_test/BUILD.gn new file mode 100644 index 00000000000..3f2868bc250 --- /dev/null +++ b/chromium/testing/android/native_test/BUILD.gn @@ -0,0 +1,65 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //testing/android/native_test.gyp:native_test_support +source_set("native_test_support") { + testonly = true + sources = [ + "native_test_launcher.cc", + "native_test_launcher.h", + "native_test_util.cc", + "native_test_util.h", + ] + deps = [ + ":native_test_jni_headers", + "//base", + "//base/test:test_support", + "//base/third_party/dynamic_annotations", + "//testing/gtest", + ] +} + +# GYP: //testing/android/native_test.gyp:native_test_native_code +source_set("native_test_native_code") { + testonly = true + sources = [ + "native_test_jni_onload.cc", + ] + libs = [ "log" ] + deps = [ + ":native_test_support", + "//base", + ] +} + +# GYP: //testing/android/native_test.gyp:native_test_java +android_library("native_test_java") { + testonly = true + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//testing/android/appurify_support:appurify_support_java", + "//testing/android/reporter:reporter_java", + ] + srcjar_deps = [ "//base:base_native_libraries_gen" ] + java_files = [ + "java/src/org/chromium/native_test/NativeBrowserTestActivity.java", + "java/src/org/chromium/native_test/NativeTest.java", + "java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java", + "java/src/org/chromium/native_test/NativeUnitTest.java", + "java/src/org/chromium/native_test/NativeUnitTestActivity.java", + "java/src/org/chromium/native_test/NativeUnitTestNativeActivity.java", + ] + jar_excluded_patterns = [ "*/NativeLibraries.class" ] +} + +# GYP: //testing/android/native_test.gyp:native_test_jni_headers +generate_jni("native_test_jni_headers") { + sources = [ + "java/src/org/chromium/native_test/NativeTest.java", + ] + jni_package = "testing" +} diff --git a/chromium/testing/android/reporter/BUILD.gn b/chromium/testing/android/reporter/BUILD.gn new file mode 100644 index 00000000000..7086a79d3da --- /dev/null +++ b/chromium/testing/android/reporter/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //testing/android/on_device_instrumentation.gyp:reporter_java +android_library("reporter_java") { + chromium_code = true + + deps = [ + "//base:base_java", + ] + java_files = [ + "java/src/org/chromium/test/reporter/TestStatusListener.java", + "java/src/org/chromium/test/reporter/TestStatusReceiver.java", + "java/src/org/chromium/test/reporter/TestStatusReporter.java", + ] +} diff --git a/chromium/testing/libfuzzer/tests/BUILD.gn b/chromium/testing/libfuzzer/tests/BUILD.gn new file mode 100644 index 00000000000..d0b1c4c2ea5 --- /dev/null +++ b/chromium/testing/libfuzzer/tests/BUILD.gn @@ -0,0 +1,72 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Fuzzing Infrastructure Tests + +import("//testing/test.gni") +import("//testing/libfuzzer/fuzzer_test.gni") + +test("libfuzzer_tests") { + sources = [ + "fuzzer_launcher_test.cc", + ] + deps = [ + ":test_config_and_dict", + ":test_config_only", + ":test_dict_from_subdir", + ":test_dict_only", + "//base", + "//testing/gmock", + "//testing/gtest", + "//testing/gtest:gtest_main", + ] + data_deps = [ + ":check_fuzzer_config", + ] +} + +fuzzer_test("test_dict_only") { + sources = [ + "../fuzzers/empty_fuzzer.cc", + ] + dict = "test.dict" +} + +fuzzer_test("test_config_only") { + sources = [ + "../fuzzers/empty_fuzzer.cc", + ] + libfuzzer_options = [ + "some_test_option=test_value", + "max_len=1024", + ] +} + +fuzzer_test("test_config_and_dict") { + sources = [ + "../fuzzers/empty_fuzzer.cc", + ] + dict = "test.dict" + libfuzzer_options = [ + "max_len=random(1337, 31337)", + "timeout = 666", + "use_traces=1", + ] +} + +fuzzer_test("test_dict_from_subdir") { + sources = [ + "../fuzzers/empty_fuzzer.cc", + ] + dict = "dicts_subdir/test_subdir.dict" +} + +copy("check_fuzzer_config") { + sources = [ + "check_fuzzer_config.py", + ] + outputs = [ + "$root_build_dir/check_fuzzer_config.py", + ] +} diff --git a/chromium/third_party/android_async_task/BUILD.gn b/chromium/third_party/android_async_task/BUILD.gn new file mode 100644 index 00000000000..869dc85a5d6 --- /dev/null +++ b/chromium/third_party/android_async_task/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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") + +assert(is_android) + +android_library("android_async_task_java") { + java_files = [ "java/src/org/chromium/third_party/android/os/AsyncTask.java" ] + deps = [ + "//base:base_java", + "//third_party/android_tools:android_support_annotations_javalib", + ] + chromium_code = false +} diff --git a/chromium/third_party/android_crazy_linker/BUILD.gn b/chromium/third_party/android_crazy_linker/BUILD.gn new file mode 100644 index 00000000000..8eea6c2e4bc --- /dev/null +++ b/chromium/third_party/android_crazy_linker/BUILD.gn @@ -0,0 +1,47 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("crazy_config") { + include_dirs = [ "src/include" ] + libs = [ + "log", + "dl", + ] +} + +# GYP: //third_party/android_crazy_linker/crazy_linker.gyp:crazy_linker +source_set("android_crazy_linker") { + sources = [ + "src/src/crazy_linker_api.cpp", + "src/src/crazy_linker_ashmem.cpp", + "src/src/crazy_linker_debug.cpp", + "src/src/crazy_linker_elf_loader.cpp", + "src/src/crazy_linker_elf_relocations.cpp", + "src/src/crazy_linker_elf_relro.cpp", + "src/src/crazy_linker_elf_symbols.cpp", + "src/src/crazy_linker_elf_view.cpp", + "src/src/crazy_linker_error.cpp", + "src/src/crazy_linker_globals.cpp", + "src/src/crazy_linker_library_list.cpp", + "src/src/crazy_linker_library_view.cpp", + "src/src/crazy_linker_line_reader.cpp", + "src/src/crazy_linker_proc_maps.cpp", + "src/src/crazy_linker_rdebug.cpp", + "src/src/crazy_linker_search_path_list.cpp", + "src/src/crazy_linker_shared_library.cpp", + "src/src/crazy_linker_system.cpp", + "src/src/crazy_linker_thread.cpp", + "src/src/crazy_linker_util.cpp", + "src/src/crazy_linker_wrappers.cpp", + "src/src/crazy_linker_zip.cpp", + "src/src/linker_phdr.cpp", + ] + + include_dirs = [ "src/src" ] + defines = [ "CRAZY_DEBUG=0" ] + + public_configs = [ ":crazy_config" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] +} diff --git a/chromium/third_party/android_data_chart/BUILD.gn b/chromium/third_party/android_data_chart/BUILD.gn new file mode 100644 index 00000000000..09845680fc1 --- /dev/null +++ b/chromium/third_party/android_data_chart/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +assert(is_android) + +android_resources("android_data_chart_java_resources") { + custom_package = "org.chromium.third_party.android" + resource_dirs = [ "java/res" ] +} + +android_library("android_data_chart_java") { + java_files = [ + "java/src/org/chromium/third_party/android/datausagechart/ChartAxis.java", + "java/src/org/chromium/third_party/android/datausagechart/ChartDataUsageView.java", + "java/src/org/chromium/third_party/android/datausagechart/ChartNetworkSeriesView.java", + "java/src/org/chromium/third_party/android/datausagechart/ChartView.java", + "java/src/org/chromium/third_party/android/datausagechart/InvertedChartAxis.java", + "java/src/org/chromium/third_party/android/datausagechart/NetworkStats.java", + "java/src/org/chromium/third_party/android/datausagechart/NetworkStatsHistory.java", + ] + deps = [ + ":android_data_chart_java_resources", + ] +} diff --git a/chromium/third_party/android_media/BUILD.gn b/chromium/third_party/android_media/BUILD.gn new file mode 100644 index 00000000000..9f79b5813e1 --- /dev/null +++ b/chromium/third_party/android_media/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +assert(is_android) + +android_resources("android_media_resources") { + custom_package = "org.chromium.third_party.android.media" + resource_dirs = [ "java/res" ] + deps = [ + "//third_party/android_tools:android_support_v7_appcompat_resources", + "//third_party/android_tools:android_support_v7_mediarouter_resources", + ] +} + +android_library("android_media_java") { + java_files = + [ "java/src/org/chromium/third_party/android/media/MediaController.java" ] + deps = [ + ":android_media_resources", + "//third_party/android_tools:android_support_v13_java", + "//third_party/android_tools:android_support_v7_appcompat_java", + "//third_party/android_tools:android_support_v7_mediarouter_java", + ] +} diff --git a/chromium/third_party/android_opengl/etc1/BUILD.gn b/chromium/third_party/android_opengl/etc1/BUILD.gn new file mode 100644 index 00000000000..48f52c02d5b --- /dev/null +++ b/chromium/third_party/android_opengl/etc1/BUILD.gn @@ -0,0 +1,13 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_android) + +# GYP: //third_party/android_opengl/etc1/etc1.gyp:etc1 +source_set("etc1") { + sources = [ + "etc1.cpp", + "etc1.h", + ] +} diff --git a/chromium/third_party/android_platform/BUILD.gn b/chromium/third_party/android_platform/BUILD.gn new file mode 100644 index 00000000000..4d026c785c6 --- /dev/null +++ b/chromium/third_party/android_platform/BUILD.gn @@ -0,0 +1,86 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") +import("config.gni") + +if (current_toolchain == host_toolchain) { + # GYP: //third_party/android_platform/relocation_packer.gyp:android_lib_relocation_packer + source_set("android_lib_relocation_packer") { + deps = [ + "//third_party/elfutils:libelf", + ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + sources = [ + "bionic/tools/relocation_packer/src/debug.cc", + "bionic/tools/relocation_packer/src/debug.h", + "bionic/tools/relocation_packer/src/delta_encoder.cc", + "bionic/tools/relocation_packer/src/delta_encoder.h", + "bionic/tools/relocation_packer/src/elf_file.cc", + "bionic/tools/relocation_packer/src/elf_file.h", + "bionic/tools/relocation_packer/src/elf_traits.h", + "bionic/tools/relocation_packer/src/packer.cc", + "bionic/tools/relocation_packer/src/packer.h", + "bionic/tools/relocation_packer/src/sleb128.cc", + "bionic/tools/relocation_packer/src/sleb128.h", + ] + } + + # GYP: //third_party/android_platform/relocation_packer.gyp:android_relocation_packer + executable("android_relocation_packer") { + deps = [ + ":android_lib_relocation_packer", + "//build/config/sanitizers:deps", + "//third_party/elfutils:libelf", + ] + sources = [ + "bionic/tools/relocation_packer/src/main.cc", + "bionic/tools/relocation_packer/src/nativehelper/ScopedFd.h", + ] + } + + copy("copy_android_relocation_packer_test_data") { + sources = [ + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_arm32.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_arm32_packed.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_arm64.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_arm64_packed.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_ia32.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_ia32_packed.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_mips32.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_mips32_packed.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_x64.so", + "bionic/tools/relocation_packer/test_data/elf_file_unittest_relocs_x64_packed.so", + ] + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] + } + + # GYP: //third_party/android_platform/relocation_packer.gyp:android_relocation_packer_unittests + test("android_relocation_packer_unittests") { + deps = [ + ":android_lib_relocation_packer", + ":copy_android_relocation_packer_test_data", + "//testing/gtest", + ] + sources = [ + "bionic/tools/relocation_packer/src/debug_unittest.cc", + "bionic/tools/relocation_packer/src/delta_encoder_unittest.cc", + "bionic/tools/relocation_packer/src/elf_file_unittest.cc", + "bionic/tools/relocation_packer/src/packer_unittest.cc", + "bionic/tools/relocation_packer/src/run_all_unittests.cc", + "bionic/tools/relocation_packer/src/sleb128_unittest.cc", + ] + } +} + +if (is_android) { + import("//build/config/android/rules.gni") + + wrapper_script("stack_wrapper") { + target = "//third_party/android_platform/development/scripts/stack" + } +} diff --git a/chromium/third_party/android_platform/config.gni b/chromium/third_party/android_platform/config.gni new file mode 100644 index 00000000000..cef7f6b8ac0 --- /dev/null +++ b/chromium/third_party/android_platform/config.gni @@ -0,0 +1,9 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +relocation_packer_target = + "//third_party/android_platform:android_relocation_packer($host_toolchain)" +relocation_packer_dir = + get_label_info("$relocation_packer_target", "root_out_dir") +relocation_packer_exe = "${relocation_packer_dir}/android_relocation_packer" diff --git a/chromium/third_party/android_protobuf/BUILD.gn b/chromium/third_party/android_protobuf/BUILD.gn new file mode 100644 index 00000000000..c7d03b8d803 --- /dev/null +++ b/chromium/third_party/android_protobuf/BUILD.gn @@ -0,0 +1,167 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if (current_toolchain == host_toolchain) { + config("android_protoc_warnings") { + cflags = [ + "-Wno-null-conversion", + "-Wno-tautological-undefined-compare", + "-Wno-unused-function", + "-Wno-unused-local-typedef", + ] + } + + # GYP: //third_party/android_protobuf/android_protobuf.gyp:android_protoc + executable("android_protoc") { + configs -= [ + "//build/config/compiler:chromium_code", + + # Does not compile with sanitizers. + "//build/config/sanitizers:default_sanitizer_flags", + ] + + configs += [ + "//build/config/compiler:no_chromium_code", + + # Must be after no_chromium_code so warning flags are ordered correctly. + ":android_protoc_warnings", + ] + + deps = [ + "//build/config/sanitizers:deps", + "//third_party/zlib", + ] + + sources = [ + "src/src/google/protobuf/compiler/code_generator.cc", + "src/src/google/protobuf/compiler/command_line_interface.cc", + "src/src/google/protobuf/compiler/cpp/cpp_enum.cc", + "src/src/google/protobuf/compiler/cpp/cpp_enum_field.cc", + "src/src/google/protobuf/compiler/cpp/cpp_extension.cc", + "src/src/google/protobuf/compiler/cpp/cpp_field.cc", + "src/src/google/protobuf/compiler/cpp/cpp_file.cc", + "src/src/google/protobuf/compiler/cpp/cpp_generator.cc", + "src/src/google/protobuf/compiler/cpp/cpp_helpers.cc", + "src/src/google/protobuf/compiler/cpp/cpp_message.cc", + "src/src/google/protobuf/compiler/cpp/cpp_message_field.cc", + "src/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", + "src/src/google/protobuf/compiler/cpp/cpp_service.cc", + "src/src/google/protobuf/compiler/cpp/cpp_string_field.cc", + "src/src/google/protobuf/compiler/importer.cc", + "src/src/google/protobuf/compiler/java/java_context.cc", + "src/src/google/protobuf/compiler/java/java_doc_comment.cc", + "src/src/google/protobuf/compiler/java/java_enum.cc", + "src/src/google/protobuf/compiler/java/java_enum_field.cc", + "src/src/google/protobuf/compiler/java/java_extension.cc", + "src/src/google/protobuf/compiler/java/java_field.cc", + "src/src/google/protobuf/compiler/java/java_file.cc", + "src/src/google/protobuf/compiler/java/java_generator.cc", + "src/src/google/protobuf/compiler/java/java_generator_factory.cc", + "src/src/google/protobuf/compiler/java/java_helpers.cc", + "src/src/google/protobuf/compiler/java/java_lazy_message_field.cc", + "src/src/google/protobuf/compiler/java/java_message.cc", + "src/src/google/protobuf/compiler/java/java_message_field.cc", + "src/src/google/protobuf/compiler/java/java_name_resolver.cc", + "src/src/google/protobuf/compiler/java/java_primitive_field.cc", + "src/src/google/protobuf/compiler/java/java_service.cc", + "src/src/google/protobuf/compiler/java/java_shared_code_generator.cc", + "src/src/google/protobuf/compiler/java/java_string_field.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_enum.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_enum_field.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_field.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_file.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_generator.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_helpers.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_message.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_message_field.cc", + "src/src/google/protobuf/compiler/javamicro/javamicro_primitive_field.cc", + "src/src/google/protobuf/compiler/javanano/javanano_enum.cc", + "src/src/google/protobuf/compiler/javanano/javanano_enum_field.cc", + "src/src/google/protobuf/compiler/javanano/javanano_extension.cc", + "src/src/google/protobuf/compiler/javanano/javanano_field.cc", + "src/src/google/protobuf/compiler/javanano/javanano_file.cc", + "src/src/google/protobuf/compiler/javanano/javanano_generator.cc", + "src/src/google/protobuf/compiler/javanano/javanano_helpers.cc", + "src/src/google/protobuf/compiler/javanano/javanano_message.cc", + "src/src/google/protobuf/compiler/javanano/javanano_message_field.cc", + "src/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", + "src/src/google/protobuf/compiler/main.cc", + "src/src/google/protobuf/compiler/parser.cc", + "src/src/google/protobuf/compiler/plugin.cc", + "src/src/google/protobuf/compiler/plugin.pb.cc", + "src/src/google/protobuf/compiler/python/python_generator.cc", + "src/src/google/protobuf/compiler/subprocess.cc", + "src/src/google/protobuf/compiler/zip_writer.cc", + "src/src/google/protobuf/descriptor.cc", + "src/src/google/protobuf/descriptor.pb.cc", + "src/src/google/protobuf/descriptor_database.cc", + "src/src/google/protobuf/dynamic_message.cc", + "src/src/google/protobuf/extension_set.cc", + "src/src/google/protobuf/extension_set_heavy.cc", + "src/src/google/protobuf/generated_message_reflection.cc", + "src/src/google/protobuf/generated_message_util.cc", + "src/src/google/protobuf/io/coded_stream.cc", + "src/src/google/protobuf/io/gzip_stream.cc", + "src/src/google/protobuf/io/printer.cc", + "src/src/google/protobuf/io/strtod.cc", + "src/src/google/protobuf/io/tokenizer.cc", + "src/src/google/protobuf/io/zero_copy_stream.cc", + "src/src/google/protobuf/io/zero_copy_stream_impl.cc", + "src/src/google/protobuf/io/zero_copy_stream_impl_lite.cc", + "src/src/google/protobuf/message.cc", + "src/src/google/protobuf/message_lite.cc", + "src/src/google/protobuf/reflection_ops.cc", + "src/src/google/protobuf/repeated_field.cc", + "src/src/google/protobuf/service.cc", + "src/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", + "src/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", + "src/src/google/protobuf/stubs/common.cc", + "src/src/google/protobuf/stubs/hash.cc", + "src/src/google/protobuf/stubs/once.cc", + "src/src/google/protobuf/stubs/stringprintf.cc", + "src/src/google/protobuf/stubs/structurally_valid.cc", + "src/src/google/protobuf/stubs/strutil.cc", + "src/src/google/protobuf/stubs/substitute.cc", + "src/src/google/protobuf/text_format.cc", + "src/src/google/protobuf/unknown_field_set.cc", + "src/src/google/protobuf/wire_format.cc", + "src/src/google/protobuf/wire_format_lite.cc", + ] + + include_dirs = [ + "src/android", + "src/src", + ] + + defines = [ + # This macro must be defined to suppress the use + # of dynamic_cast<>, which requires RTTI. + "GOOGLE_PROTOBUF_NO_RTTI", + "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", + ] + } +} + +if (is_android) { + import("//build/config/android/rules.gni") + + # GYP: //third_party/android_protobuf/android_protobuf.gyp:protobuf_nano_javalib + android_library("protobuf_nano_javalib") { + chromium_code = false + java_files = [ + "src/java/src/main/java/com/google/protobuf/nano/CodedInputByteBufferNano.java", + "src/java/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java", + "src/java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java", + "src/java/src/main/java/com/google/protobuf/nano/Extension.java", + "src/java/src/main/java/com/google/protobuf/nano/FieldArray.java", + "src/java/src/main/java/com/google/protobuf/nano/FieldData.java", + "src/java/src/main/java/com/google/protobuf/nano/InternalNano.java", + "src/java/src/main/java/com/google/protobuf/nano/InvalidProtocolBufferNanoException.java", + "src/java/src/main/java/com/google/protobuf/nano/MessageNano.java", + "src/java/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java", + "src/java/src/main/java/com/google/protobuf/nano/UnknownFieldData.java", + "src/java/src/main/java/com/google/protobuf/nano/WireFormatNano.java", + ] + } +} diff --git a/chromium/third_party/android_support_test_runner/BUILD.gn b/chromium/third_party/android_support_test_runner/BUILD.gn new file mode 100644 index 00000000000..e4a7a26ec29 --- /dev/null +++ b/chromium/third_party/android_support_test_runner/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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") + +android_java_prebuilt("runner") { + jar_path = "lib/runner-0.3-release-no-dep.jar" + deps = [ + "//third_party/guava:guava_java", + ] +} diff --git a/chromium/third_party/android_swipe_refresh/BUILD.gn b/chromium/third_party/android_swipe_refresh/BUILD.gn new file mode 100644 index 00000000000..e3645439aa6 --- /dev/null +++ b/chromium/third_party/android_swipe_refresh/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +assert(is_android) + +android_library("android_swipe_refresh_java") { + chromium_code = false # Don't lint. + java_files = [ + "java/src/org/chromium/third_party/android/swiperefresh/CircleImageView.java", + "java/src/org/chromium/third_party/android/swiperefresh/MaterialProgressDrawable.java", + "java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java", + ] + deps = [ + "//third_party/android_tools:android_support_v13_java", + ] +} diff --git a/chromium/third_party/angle/src/tests/BUILD.gn b/chromium/third_party/angle/src/tests/BUILD.gn new file mode 100644 index 00000000000..2237216fa78 --- /dev/null +++ b/chromium/third_party/angle/src/tests/BUILD.gn @@ -0,0 +1,331 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") +import("//build/config/chromecast_build.gni") +import("//third_party/angle/build/angle_common.gni") + +unittests_gypi = exec_script("//build/gypi_to_gn.py", + [ + rebase_path("angle_unittests.gypi"), + "--replace=<(angle_path)=.", + ], + "scope", + [ "angle_unittests.gypi" ]) + +test("angle_unittests") { + include_dirs = [ + "testing/gtest/include", + "../../src", + ] + + sources = rebase_path(unittests_gypi.angle_unittests_sources, ".", "../..") + + if (angle_enable_hlsl) { + sources += + rebase_path(unittests_gypi.angle_unittests_hlsl_sources, ".", "../..") + } + + sources += [ "//gpu/angle_unittest_main.cc" ] + + deps = [ + "//base", + "//base/test:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/angle:libANGLE", + "//third_party/angle:preprocessor", + "//third_party/angle:translator_static", + ] +} + +if (is_win || is_linux || is_mac || is_android) { + end2end_gypi = exec_script("//build/gypi_to_gn.py", + [ + rebase_path("angle_end2end_tests.gypi"), + "--replace=<(angle_path)=.", + ], + "scope", + [ "angle_end2end_tests.gypi" ]) + + test("angle_end2end_tests") { + include_dirs = [ + "testing/gtest/include", + "../../src/tests", + "../../util", + ] + + if (is_android) { + use_native_activity = true + } + + sources = + rebase_path(end2end_gypi.angle_end2end_tests_sources, ".", "../..") + + if (is_win) { + sources += rebase_path(end2end_gypi.angle_end2end_tests_win_sources, + ".", + "../..") + } + if (use_x11) { + sources += rebase_path(end2end_gypi.angle_end2end_tests_x11_sources, + ".", + "../..") + } + + sources += [ "//gpu/angle_end2end_tests_main.cc" ] + + configs += [ + "//third_party/angle:internal_config", + "//third_party/angle:libANGLE_config", + ] + + if (is_linux && !is_component_build) { + # Set rpath to find libEGL.so and libGLESv2.so even in a non-component build. + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + + deps = [ + "//base", + "//base/test:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/angle:angle_util", + "//third_party/angle:libANGLE", + "//third_party/angle:libEGL", + "//third_party/angle:libGLESv2", + "//third_party/angle:preprocessor", + "//third_party/angle:translator_static", + ] + } +} + +if (is_win) { + perftests_gypi = exec_script("//build/gypi_to_gn.py", + [ + rebase_path("angle_perftests.gypi"), + "--replace=<(angle_path)=.", + ], + "scope", + [ "angle_perftests.gypi" ]) + + test("angle_perftests") { + include_dirs = [ + "testing/gtest/include", + "../../src/tests", + "../../util", + ] + + sources = rebase_path(perftests_gypi.angle_perf_tests_sources, ".", "../..") + + sources += + rebase_path(perftests_gypi.angle_perf_tests_win_sources, ".", "../..") + + sources += [ "//gpu/angle_perftests_main.cc" ] + + configs += [ + "//third_party/angle:internal_config", + "//third_party/angle:libANGLE_config", + ] + + deps = [ + "//base", + "//base/test:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/angle:angle_util", + "//third_party/angle:libANGLE", + "//third_party/angle:libEGL", + "//third_party/angle:libGLESv2", + ] + } +} + +###----------------------------------------------------- +### dEQP tests +###----------------------------------------------------- + +declare_args() { + # Don't build dEQP by default. + build_angle_deqp_tests = false +} + +# TODO(jmadill): Other platforms. +if (build_angle_deqp_tests) { + deqp_gypi = exec_script("//build/gypi_to_gn.py", + [ + rebase_path("deqp.gypi"), + "--replace=<(angle_path)=.", + "--replace=<(deqp_path)=../deqp/src", + ], + "scope", + [ "deqp.gypi" ]) + + config("angle_deqp_support") { + include_dirs = rebase_path(deqp_gypi.deqp_include_dirs, ".", "../..") + if (is_win) { + include_dirs += [ "../deqp/src/framework/platform/win32" ] + cflags = deqp_gypi.deqp_win_cflags + } + defines = deqp_gypi.deqp_defines + defines += [ "_MBCS" ] + + if (is_linux) { + # Ask the system headers to expose all the regular function otherwise + # dEQP doesn't compile and produces warnings about implicitly defined + # functions. + # This has to be GNU_SOURCE as on Linux dEQP uses syscall() + defines += [ "_GNU_SOURCE" ] + } + } + + deqp_undefine_configs = [ + "//build/config/compiler:chromium_code", + "//build/config/compiler:no_rtti", + ] + + if (is_win) { + deqp_undefine_configs += [ + "//build/config/win:lean_and_mean", + "//build/config/win:nominmax", + "//build/config/win:unicode", + ] + } + + if (is_linux) { + deqp_undefine_configs += [ "//build/config/gcc:no_exceptions" ] + } + + static_library("angle_deqp_decpp") { + configs -= deqp_undefine_configs + public_configs = [ + ":angle_deqp_support", + "//build/config/compiler:no_chromium_code", + "//third_party/angle:internal_config", + ] + sources = rebase_path(deqp_gypi.deqp_libtester_decpp_sources, ".", "../..") + } + + config("angle_deqp_libtester_config") { + defines = [ "ANGLE_DEQP_LIBTESTER_IMPLEMENTATION" ] + + if (is_clang) { + # TODO(jmadill): Remove this once we fix dEQP. + cflags_cc = [ "-Wno-delete-non-virtual-dtor" ] + } + } + + static_library("angle_deqp_libtester") { + public_deps = [ + ":angle_deqp_decpp", + "//third_party/angle:angle_util", + "//third_party/angle:libEGL", + "//third_party/libpng:libpng", + ] + configs -= deqp_undefine_configs + public_configs = [ ":angle_deqp_libtester_config" ] + sources = rebase_path(deqp_gypi.deqp_libtester_sources, ".", "../..") + if (is_win) { + sources += rebase_path(deqp_gypi.deqp_libtester_sources_win, ".", "../..") + } + if (is_linux) { + sources += + rebase_path(deqp_gypi.deqp_libtester_sources_unix, ".", "../..") + } + } + + config("angle_deqp_gtest_support_config") { + include_dirs = [ "third_party/gpu_test_expectations" ] + } + + source_set("angle_deqp_gtest_support") { + testonly = true + public_deps = [ + "//base", + "//base/test:test_support", + "//testing/gtest", + "//third_party/angle:angle_common", + "//third_party/angle:angle_util", + ] + public_configs = [ ":angle_deqp_gtest_support_config" ] + sources = deqp_gypi.deqp_gpu_test_expectations_sources + sources += [ "//gpu/angle_deqp_tests_main.cc" ] + + # Taken from gpu/BUILD.gn + # TODO(jmadill): this should be in a shared location + if (is_linux && !is_chromecast) { + libs = [ "pci" ] + } + } + + api_names = [ + "gles2", + "gles3", + "egl", + ] + target_defines = [ + "ANGLE_DEQP_GLES2_TESTS", + "ANGLE_DEQP_GLES3_TESTS", + "ANGLE_DEQP_EGL_TESTS", + ] + target_sources = [ + deqp_gypi.deqp_gles2_sources, + deqp_gypi.deqp_gles3_sources, + deqp_gypi.deqp_egl_sources, + ] + + foreach(index, + [ + 0, + 1, + 2, + ]) { + api_name = api_names[index] + config_name = "angle_deqp_lib${api_name}_config" + config(config_name) { + defines = [ target_defines[index] ] + } + + shared_library_name = "angle_deqp_lib${api_name}" + shared_library(shared_library_name) { + deps = [ + ":angle_deqp_libtester", + ] + + configs -= deqp_undefine_configs + public_configs = [ ":${config_name}" ] + + sources = rebase_path(target_sources[index], ".", "../..") + sources += [ + "deqp_support/angle_deqp_libtester_main.cpp", + "deqp_support/tcuANGLEPlatform.cpp", + "deqp_support/tcuANGLEPlatform.h", + ] + } + + test_name = "angle_deqp_${api_name}_tests" + test(test_name) { + deps = [ + ":${shared_library_name}", + ":angle_deqp_gtest_support", + ] + + # Must be included outside of the source set for the define + sources = [ + "deqp_support/angle_deqp_gtest.cpp", + ] + + data = [ + "deqp_support/deqp_${api_name}_test_expectations.txt", + "../../../deqp/src/android/cts/master/${api_name}-master.txt", + "../../../deqp/src/data/", + ] + + if (is_linux && !is_component_build) { + # Set rpath to find *.so files even in a non-component build. + configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + } + } +} diff --git a/chromium/third_party/apple_sample_code/BUILD.gn b/chromium/third_party/apple_sample_code/BUILD.gn new file mode 100644 index 00000000000..81b7ed013cb --- /dev/null +++ b/chromium/third_party/apple_sample_code/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("apple_sample_code") { + sources = [ + "ImageAndTextCell.h", + "ImageAndTextCell.m", + ] + + libs = [ "AppKit.framework" ] +} diff --git a/chromium/third_party/ashmem/BUILD.gn b/chromium/third_party/ashmem/BUILD.gn new file mode 100644 index 00000000000..5e92b3773f5 --- /dev/null +++ b/chromium/third_party/ashmem/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_android) + +source_set("ashmem") { + sources = [ + "ashmem-dev.c", + "ashmem.h", + ] +} diff --git a/chromium/third_party/cacheinvalidation/BUILD.gn b/chromium/third_party/cacheinvalidation/BUILD.gn new file mode 100644 index 00000000000..70be8c68a0b --- /dev/null +++ b/chromium/third_party/cacheinvalidation/BUILD.gn @@ -0,0 +1,243 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +config("cacheinvalidation_config") { + include_dirs = [ + "overrides", + "src", + ] +} + +static_library("cacheinvalidation") { + sources = [ + "overrides/google/cacheinvalidation/deps/callback.h", + "overrides/google/cacheinvalidation/deps/gmock.h", + "overrides/google/cacheinvalidation/deps/googletest.h", + "overrides/google/cacheinvalidation/deps/logging.h", + "overrides/google/cacheinvalidation/deps/mutex.h", + "overrides/google/cacheinvalidation/deps/random.cc", + "overrides/google/cacheinvalidation/deps/random.h", + "overrides/google/cacheinvalidation/deps/scoped_ptr.h", + "overrides/google/cacheinvalidation/deps/sha1-digest-function.h", + "overrides/google/cacheinvalidation/deps/stl-namespace.h", + "overrides/google/cacheinvalidation/deps/string_util.h", + "overrides/google/cacheinvalidation/deps/time.h", + "src/google/cacheinvalidation/deps/digest-function.h", + "src/google/cacheinvalidation/impl/basic-system-resources.cc", + "src/google/cacheinvalidation/impl/basic-system-resources.h", + "src/google/cacheinvalidation/impl/checking-invalidation-listener.cc", + "src/google/cacheinvalidation/impl/checking-invalidation-listener.h", + "src/google/cacheinvalidation/impl/client-protocol-namespace-fix.h", + "src/google/cacheinvalidation/impl/constants.cc", + "src/google/cacheinvalidation/impl/constants.h", + "src/google/cacheinvalidation/impl/digest-store.h", + "src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.cc", + "src/google/cacheinvalidation/impl/exponential-backoff-delay-generator.h", + "src/google/cacheinvalidation/impl/invalidation-client-core.cc", + "src/google/cacheinvalidation/impl/invalidation-client-core.h", + "src/google/cacheinvalidation/impl/invalidation-client-factory.cc", + "src/google/cacheinvalidation/impl/invalidation-client-impl.cc", + "src/google/cacheinvalidation/impl/invalidation-client-impl.h", + "src/google/cacheinvalidation/impl/invalidation-client-util.h", + "src/google/cacheinvalidation/impl/log-macro.h", + "src/google/cacheinvalidation/impl/object-id-digest-utils.cc", + "src/google/cacheinvalidation/impl/object-id-digest-utils.h", + "src/google/cacheinvalidation/impl/persistence-utils.cc", + "src/google/cacheinvalidation/impl/persistence-utils.h", + "src/google/cacheinvalidation/impl/proto-converter.cc", + "src/google/cacheinvalidation/impl/proto-converter.h", + "src/google/cacheinvalidation/impl/proto-helpers.cc", + "src/google/cacheinvalidation/impl/proto-helpers.h", + "src/google/cacheinvalidation/impl/protocol-handler.cc", + "src/google/cacheinvalidation/impl/protocol-handler.h", + "src/google/cacheinvalidation/impl/recurring-task.cc", + "src/google/cacheinvalidation/impl/recurring-task.h", + "src/google/cacheinvalidation/impl/registration-manager.cc", + "src/google/cacheinvalidation/impl/registration-manager.h", + "src/google/cacheinvalidation/impl/repeated-field-namespace-fix.h", + "src/google/cacheinvalidation/impl/run-state.h", + "src/google/cacheinvalidation/impl/safe-storage.cc", + "src/google/cacheinvalidation/impl/safe-storage.h", + "src/google/cacheinvalidation/impl/simple-registration-store.cc", + "src/google/cacheinvalidation/impl/simple-registration-store.h", + "src/google/cacheinvalidation/impl/smearer.h", + "src/google/cacheinvalidation/impl/statistics.cc", + "src/google/cacheinvalidation/impl/statistics.h", + "src/google/cacheinvalidation/impl/throttle.cc", + "src/google/cacheinvalidation/impl/throttle.h", + "src/google/cacheinvalidation/impl/ticl-message-validator.cc", + "src/google/cacheinvalidation/impl/ticl-message-validator.h", + "src/google/cacheinvalidation/include/invalidation-client-factory.h", + "src/google/cacheinvalidation/include/invalidation-client.h", + "src/google/cacheinvalidation/include/invalidation-listener.h", + "src/google/cacheinvalidation/include/system-resources.h", + "src/google/cacheinvalidation/include/types.h", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + public_configs = [ ":cacheinvalidation_config" ] + + public_deps = [ + "src/google/cacheinvalidation:cacheinvalidation_proto_cpp", + ] + + deps = [ + "//base", + ] +} + +test("cacheinvalidation_unittests") { + sources = [ + "src/google/cacheinvalidation/impl/invalidation-client-impl_test.cc", + "src/google/cacheinvalidation/impl/protocol-handler_test.cc", + "src/google/cacheinvalidation/impl/recurring-task_test.cc", + "src/google/cacheinvalidation/impl/throttle_test.cc", + "src/google/cacheinvalidation/test/deterministic-scheduler.cc", + "src/google/cacheinvalidation/test/deterministic-scheduler.h", + "src/google/cacheinvalidation/test/test-logger.cc", + "src/google/cacheinvalidation/test/test-logger.h", + "src/google/cacheinvalidation/test/test-utils.cc", + "src/google/cacheinvalidation/test/test-utils.h", + ] + + deps = [ + ":cacheinvalidation", + "src/google/cacheinvalidation:cacheinvalidation_proto_cpp", + "//base", + "//base/test:run_all_unittests", + "//testing/gmock", + "//testing/gtest", + ] +} + +if (is_android) { + import("//build/config/android/rules.gni") + + # GYP: //third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_java + proto_java_library("cacheinvalidation_proto_java") { + proto_path = "src/proto" + sources = [ + "$proto_path/android_channel.proto", + "$proto_path/android_listener.proto", + "$proto_path/android_service.proto", + "$proto_path/channel_common.proto", + "$proto_path/client.proto", + "$proto_path/client_protocol.proto", + "$proto_path/java_client.proto", + "$proto_path/types.proto", + ] + } + + # GYP: //third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib + android_library("cacheinvalidation_javalib") { + chromium_code = false + emma_never_instrument = true + deps = [ + ":cacheinvalidation_proto_java", + "//third_party/android_protobuf:protobuf_nano_javalib", + "//third_party/android_tools:android_gcm_java", + google_play_services_library, + ] + + java_files = [ + "src/java/com/google/ipc/invalidation/common/BaseCommonInvalidationConstants.java", + "src/java/com/google/ipc/invalidation/common/BuildConstants.java", + "src/java/com/google/ipc/invalidation/common/DigestFunction.java", + "src/java/com/google/ipc/invalidation/common/GcmSharedConstants.java", + "src/java/com/google/ipc/invalidation/common/ObjectIdDigestUtils.java", + "src/java/com/google/ipc/invalidation/external/client/InvalidationClient.java", + "src/java/com/google/ipc/invalidation/external/client/InvalidationClientConfig.java", + "src/java/com/google/ipc/invalidation/external/client/InvalidationClientFactory.java", + "src/java/com/google/ipc/invalidation/external/client/InvalidationListener.java", + "src/java/com/google/ipc/invalidation/external/client/SystemResources.java", + "src/java/com/google/ipc/invalidation/external/client/SystemResourcesBuilder.java", + "src/java/com/google/ipc/invalidation/external/client/android/service/AndroidLogger.java", + "src/java/com/google/ipc/invalidation/external/client/android2/AndroidClientFactory.java", + "src/java/com/google/ipc/invalidation/external/client/contrib/AndroidListener.java", + "src/java/com/google/ipc/invalidation/external/client/contrib/AndroidListenerIntents.java", + "src/java/com/google/ipc/invalidation/external/client/contrib/AndroidListenerProtos.java", + "src/java/com/google/ipc/invalidation/external/client/contrib/AndroidListenerState.java", + "src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java", + "src/java/com/google/ipc/invalidation/external/client/types/AckHandle.java", + "src/java/com/google/ipc/invalidation/external/client/types/ApplicationClientId.java", + "src/java/com/google/ipc/invalidation/external/client/types/BytesFormatter.java", + "src/java/com/google/ipc/invalidation/external/client/types/Callback.java", + "src/java/com/google/ipc/invalidation/external/client/types/ErrorContext.java", + "src/java/com/google/ipc/invalidation/external/client/types/ErrorInfo.java", + "src/java/com/google/ipc/invalidation/external/client/types/Invalidation.java", + "src/java/com/google/ipc/invalidation/external/client/types/ObjectId.java", + "src/java/com/google/ipc/invalidation/external/client/types/SimplePair.java", + "src/java/com/google/ipc/invalidation/external/client/types/Status.java", + "src/java/com/google/ipc/invalidation/ticl/AckCache.java", + "src/java/com/google/ipc/invalidation/ticl/BasicSystemResources.java", + "src/java/com/google/ipc/invalidation/ticl/CheckingInvalidationListener.java", + "src/java/com/google/ipc/invalidation/ticl/DigestStore.java", + "src/java/com/google/ipc/invalidation/ticl/InvalidationClientCore.java", + "src/java/com/google/ipc/invalidation/ticl/InvalidationClientImpl.java", + "src/java/com/google/ipc/invalidation/ticl/MemoryStorageImpl.java", + "src/java/com/google/ipc/invalidation/ticl/PersistenceUtils.java", + "src/java/com/google/ipc/invalidation/ticl/ProtoWrapperConverter.java", + "src/java/com/google/ipc/invalidation/ticl/ProtocolHandler.java", + "src/java/com/google/ipc/invalidation/ticl/RecurringTask.java", + "src/java/com/google/ipc/invalidation/ticl/RegistrationManager.java", + "src/java/com/google/ipc/invalidation/ticl/RunState.java", + "src/java/com/google/ipc/invalidation/ticl/SafeStorage.java", + "src/java/com/google/ipc/invalidation/ticl/SimpleRegistrationStore.java", + "src/java/com/google/ipc/invalidation/ticl/Statistics.java", + "src/java/com/google/ipc/invalidation/ticl/TestableInvalidationClient.java", + "src/java/com/google/ipc/invalidation/ticl/TestableNetworkChannel.java", + "src/java/com/google/ipc/invalidation/ticl/TiclExponentialBackoffDelayGenerator.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidClock.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidInternalScheduler.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidInvalidationClientImpl.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidInvalidationClientStub.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidInvalidationListenerIntentMapper.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidInvalidationListenerStub.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidStorage.java", + "src/java/com/google/ipc/invalidation/ticl/android2/AndroidTiclManifest.java", + "src/java/com/google/ipc/invalidation/ticl/android2/ProtocolIntents.java", + "src/java/com/google/ipc/invalidation/ticl/android2/ResourcesFactory.java", + "src/java/com/google/ipc/invalidation/ticl/android2/TiclService.java", + "src/java/com/google/ipc/invalidation/ticl/android2/TiclStateManager.java", + "src/java/com/google/ipc/invalidation/ticl/android2/WakeLockManager.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelConstants.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelPreferences.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidGcmController.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidInstanceIDListenerService.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/CommonUtils.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java", + "src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmUpstreamSenderService.java", + "src/java/com/google/ipc/invalidation/ticl/proto/AndroidChannel.java", + "src/java/com/google/ipc/invalidation/ticl/proto/AndroidListenerProtocol.java", + "src/java/com/google/ipc/invalidation/ticl/proto/AndroidService.java", + "src/java/com/google/ipc/invalidation/ticl/proto/ChannelCommon.java", + "src/java/com/google/ipc/invalidation/ticl/proto/Client.java", + "src/java/com/google/ipc/invalidation/ticl/proto/ClientConstants.java", + "src/java/com/google/ipc/invalidation/ticl/proto/ClientProtocol.java", + "src/java/com/google/ipc/invalidation/ticl/proto/CommonProtos.java", + "src/java/com/google/ipc/invalidation/ticl/proto/JavaClient.java", + "src/java/com/google/ipc/invalidation/util/BaseLogger.java", + "src/java/com/google/ipc/invalidation/util/Box.java", + "src/java/com/google/ipc/invalidation/util/Bytes.java", + "src/java/com/google/ipc/invalidation/util/ExponentialBackoffDelayGenerator.java", + "src/java/com/google/ipc/invalidation/util/Formatter.java", + "src/java/com/google/ipc/invalidation/util/InternalBase.java", + "src/java/com/google/ipc/invalidation/util/LazyString.java", + "src/java/com/google/ipc/invalidation/util/Marshallable.java", + "src/java/com/google/ipc/invalidation/util/NamedRunnable.java", + "src/java/com/google/ipc/invalidation/util/Preconditions.java", + "src/java/com/google/ipc/invalidation/util/ProtoWrapper.java", + "src/java/com/google/ipc/invalidation/util/Smearer.java", + "src/java/com/google/ipc/invalidation/util/TextBuilder.java", + "src/java/com/google/ipc/invalidation/util/TypedUtil.java", + "src/java/com/google/ipc/invalidation/util/UtilFormatter.java", + ] + } +} diff --git a/chromium/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn b/chromium/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn new file mode 100644 index 00000000000..3bbb844eeaa --- /dev/null +++ b/chromium/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/protobuf/proto_library.gni") + +proto_library("cacheinvalidation_proto_cpp") { + # Depend on cacheinvalidation instead. + visibility = [ "//third_party/cacheinvalidation/*" ] + + sources = [ + "client.proto", + "client_gateway.proto", + "client_protocol.proto", + "client_test_internal.proto", + "types.proto", + ] + + if (!is_android) { + sources += [ + "android_channel.proto", + "channel_common.proto", + ] + } + + proto_out_dir = "google/cacheinvalidation" +} diff --git a/chromium/third_party/catapult/telemetry/BUILD.gn b/chromium/third_party/catapult/telemetry/BUILD.gn new file mode 100644 index 00000000000..f786e3c8643 --- /dev/null +++ b/chromium/third_party/catapult/telemetry/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("telemetry_test_support") { + # Generic telemetry deps. For now, just include the whole catapult directory. + # TODO(nednguyen, aiolos): only include what telemetry needs. + # https://github.com/catapult-project/catapult/issues/1953 + data = [ + "../", + ] +} + +executable("bitmaptools") { + sources = [ + "telemetry/internal/image_processing/bitmaptools.cc", + ] + + deps = [ + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} diff --git a/chromium/third_party/catapult/tracing/BUILD.gn b/chromium/third_party/catapult/tracing/BUILD.gn new file mode 100644 index 00000000000..f81a2d5ff40 --- /dev/null +++ b/chromium/third_party/catapult/tracing/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("trace_viewer.gypi") ], + "scope", + [ "trace_viewer.gypi" ]) + +# TODO: ideally this would go into the target_gen_dir, but this requires some +# changes to the scripts that process them. +output_resource_dir = "$root_gen_dir/content/browser/tracing" + +action("generate_about_tracing") { + script = "bin/generate_about_tracing_contents" + + inputs = gypi_values.tracing_css_files + gypi_values.tracing_js_html_files + + gypi_values.tracing_img_files + outputs = [ + "$output_resource_dir/about_tracing.js", + "$output_resource_dir/about_tracing.html", + ] + + args = [ + "--outdir", rebase_path(output_resource_dir, root_build_dir), + ] +} diff --git a/chromium/third_party/cld_2/BUILD.gn b/chromium/third_party/cld_2/BUILD.gn new file mode 100644 index 00000000000..d90e8596640 --- /dev/null +++ b/chromium/third_party/cld_2/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +declare_args() { + if (is_android || is_ios) { + cld2_table_size = 0 # Small, accurate tables + } else { + cld2_table_size = 2 # Larger, more accurate tables + } +} + +gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("cld_2.gyp") ], + "scope", + [ "cld_2.gyp" ]) + +config("cld2_data_warnings") { + visibility = [ ":*" ] + if (is_clang) { + # The generated files don't have braces around subobject initializers. + cflags = [ "-Wno-missing-braces" ] + } +} + +source_set("cld2_data") { + sources = gypi_values.cld2_data_sources + if (cld2_table_size == 0) { + sources += gypi_values.cld2_data_smallest_sources + } else if (cld2_table_size == 2) { + sources += gypi_values.cld2_data_largest_sources + } + + include_dirs = [ + "src/internal", + "src/public", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ + "//build/config/compiler:no_chromium_code", + + # Must be after no_chromium_code for warning flags to be ordered correctly. + ":cld2_data_warnings", + ] +} + +config("cld2_warnings") { + if (is_clang) { + cflags = [ + # cld_2 contains unused private fields. + # https://code.google.com/p/cld2/issues/detail?id=37 + "-Wno-unused-private-field", + + # offsetmap.cc uses a char as a subscript. + "-Wno-char-subscripts", + ] + } +} + +static_library("cld_2") { + sources = gypi_values.cld2_core_sources + gypi_values.cld2_core_impl_sources + include_dirs = [ + "src/internal", + "src/public", + ] + + public_deps = [ + ":cld2_data", + ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ + "//build/config/compiler:no_chromium_code", + ":cld2_warnings", + ] +} diff --git a/chromium/third_party/codesighs/BUILD.gn b/chromium/third_party/codesighs/BUILD.gn new file mode 100644 index 00000000000..4d21da3fec7 --- /dev/null +++ b/chromium/third_party/codesighs/BUILD.gn @@ -0,0 +1,78 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +executable("codesighs") { + sources = [ + "codesighs.c", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} + +executable("maptsvdifftool") { + sources = [ + "maptsvdifftool.c", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} + +if (is_win) { + executable("msmap2tsv") { + sources = [ + "msmap2tsv.c", + ] + + libs = [ "dbghelp.lib" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + } + + executable("msdump2symdb") { + sources = [ + "msdump2symdb.c", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + } +} else { + executable("nm2tsv") { + sources = [ + "nm2tsv.c", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + deps = [ + "//build/config/sanitizers:deps", + ] + } +} diff --git a/chromium/third_party/cython/rules.gni b/chromium/third_party/cython/rules.gni new file mode 100644 index 00000000000..1d702df7de7 --- /dev/null +++ b/chromium/third_party/cython/rules.gni @@ -0,0 +1,163 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/toolchain/toolchain.gni") + +template("python_binary_source_set") { + # Only available on linux for now. + assert(is_linux) + assert(defined(invoker.cython_sources) || defined(invoker.sources)) + + config_name = target_name + "_python_config" + + target_visibility = [ ":$target_name" ] + + if (defined(invoker.cython_sources)) { + generator_target_name = target_name + "_cython_compiler" + + cython_root = "//third_party/cython" + cython_script = "$cython_root/src/cython.py" + cython_output = "${target_out_dir}/${target_name}.cc" + + action(generator_target_name) { + visibility = target_visibility + script = cython_script + sources = invoker.cython_sources + outputs = [ + cython_output, + ] + args = [ + "--cplus", + "-I", + rebase_path("//", root_build_dir), + "-I", + rebase_path(target_gen_dir, root_build_dir), + "-o", + rebase_path(cython_output, root_build_dir), + ] + rebase_path(sources, root_build_dir) + } + } + + config(config_name) { + visibility = target_visibility + python_flags = "//third_party/cython/python_flags.py" + include_dirs = exec_script(python_flags, [ "--includes" ], "list lines") + libs = exec_script(python_flags, [ "--libraries" ], "list lines") + lib_dirs = exec_script(python_flags, [ "--library_dirs" ], "list lines") + if (!is_win) { + # Generated code includes static utility functions that often go unused. + cflags = [ "-Wno-unused-function" ] + } + } + + source_set(target_name) { + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } + sources = [] + if (defined(invoker.cython_sources)) { + sources += [ cython_output ] + } + if (defined(invoker.sources)) { + sources += invoker.sources + } + if (defined(invoker.configs)) { + configs += invoker.configs + } + all_dependent_configs = [ ":$config_name" ] + deps = [] + if (defined(invoker.cython_sources)) { + deps += [ ":$generator_target_name" ] + } + if (defined(invoker.deps)) { + deps += invoker.deps + } + if (defined(invoker.datadeps)) { + datadeps = invoker.datadeps + } + } +} + +template("python_binary_module") { + # Only available on linux for now. + assert(is_linux) + + has_sources = defined(invoker.cython_sources) || defined(invoker.sources) + + assert(has_sources || defined(invoker.deps)) + assert( + !defined(invoker.python_base_module) || invoker.python_base_module != "") + + sources_target_name = target_name + "_cython_sources" + shared_library_name = target_name + "_shared_library" + + if (is_linux) { + shared_library_prefix = "lib" + shared_library_suffix = ".so" + python_module_suffix = ".so" + } + + target_visibility = [ + ":$sources_target_name", + ":$shared_library_name", + ":$target_name", + ] + + if (has_sources) { + python_binary_source_set(sources_target_name) { + visibility = target_visibility + if (defined(invoker.cython_sources)) { + cython_sources = invoker.cython_sources + } + if (defined(invoker.sources)) { + sources = invoker.sources + } + if (defined(invoker.configs)) { + configs = invoker.configs + } + if (defined(invoker.deps)) { + deps = invoker.deps + } + if (defined(invoker.datadeps)) { + datadeps = invoker.datadeps + } + } + } + + shared_library(shared_library_name) { + visibility = target_visibility + if (defined(invoker.configs)) { + configs += invoker.configs + } + deps = [] + if (has_sources) { + deps += [ ":$sources_target_name" ] + } + if (defined(invoker.deps)) { + deps += invoker.deps + } + if (defined(invoker.datadeps)) { + datadeps = invoker.datadeps + } + } + + copy(target_name) { + if (defined(invoker.python_base_module)) { + python_base_module = invoker.python_base_module + output = "$root_out_dir/python/$python_base_module/${target_name}${python_module_suffix}" + } else { + output = "$root_out_dir/python/${target_name}${python_module_suffix}" + } + + sources = [ + "$root_shlib_dir/${shared_library_prefix}${shared_library_name}${shared_library_suffix}", + ] + outputs = [ + output, + ] + deps = [ + ":$shared_library_name", + ] + } +} diff --git a/chromium/third_party/elfutils/BUILD.gn b/chromium/third_party/elfutils/BUILD.gn new file mode 100644 index 00000000000..899bb5fe402 --- /dev/null +++ b/chromium/third_party/elfutils/BUILD.gn @@ -0,0 +1,162 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("libelf_config") { + include_dirs = [ "src/libelf" ] +} + +source_set("libelf") { + sources = [ + "config.h", + "src/libelf/abstract.h", + "src/libelf/common.h", + "src/libelf/dl-hash.h", + "src/libelf/elf-knowledge.h", + "src/libelf/elf.h", + "src/libelf/elf32_checksum.c", + "src/libelf/elf32_fsize.c", + "src/libelf/elf32_getehdr.c", + "src/libelf/elf32_getphdr.c", + "src/libelf/elf32_getshdr.c", + "src/libelf/elf32_newehdr.c", + "src/libelf/elf32_newphdr.c", + "src/libelf/elf32_offscn.c", + "src/libelf/elf32_updatefile.c", + "src/libelf/elf32_updatenull.c", + "src/libelf/elf32_xlatetof.c", + "src/libelf/elf32_xlatetom.c", + "src/libelf/elf64_checksum.c", + "src/libelf/elf64_fsize.c", + "src/libelf/elf64_getehdr.c", + "src/libelf/elf64_getphdr.c", + "src/libelf/elf64_getshdr.c", + "src/libelf/elf64_newehdr.c", + "src/libelf/elf64_newphdr.c", + "src/libelf/elf64_offscn.c", + "src/libelf/elf64_updatefile.c", + "src/libelf/elf64_updatenull.c", + "src/libelf/elf64_xlatetof.c", + "src/libelf/elf64_xlatetom.c", + "src/libelf/elf_begin.c", + "src/libelf/elf_clone.c", + "src/libelf/elf_cntl.c", + "src/libelf/elf_end.c", + "src/libelf/elf_error.c", + "src/libelf/elf_fill.c", + "src/libelf/elf_flagdata.c", + "src/libelf/elf_flagehdr.c", + "src/libelf/elf_flagelf.c", + "src/libelf/elf_flagphdr.c", + "src/libelf/elf_flagscn.c", + "src/libelf/elf_flagshdr.c", + "src/libelf/elf_getarhdr.c", + "src/libelf/elf_getaroff.c", + "src/libelf/elf_getarsym.c", + "src/libelf/elf_getbase.c", + "src/libelf/elf_getdata.c", + "src/libelf/elf_getdata_rawchunk.c", + "src/libelf/elf_getident.c", + "src/libelf/elf_getphdrnum.c", + "src/libelf/elf_getscn.c", + "src/libelf/elf_getshdrnum.c", + "src/libelf/elf_getshdrstrndx.c", + "src/libelf/elf_gnu_hash.c", + "src/libelf/elf_hash.c", + "src/libelf/elf_kind.c", + "src/libelf/elf_memory.c", + "src/libelf/elf_ndxscn.c", + "src/libelf/elf_newdata.c", + "src/libelf/elf_newscn.c", + "src/libelf/elf_next.c", + "src/libelf/elf_nextscn.c", + "src/libelf/elf_rand.c", + "src/libelf/elf_rawdata.c", + "src/libelf/elf_rawfile.c", + "src/libelf/elf_readall.c", + "src/libelf/elf_scnshndx.c", + "src/libelf/elf_strptr.c", + "src/libelf/elf_update.c", + "src/libelf/elf_version.c", + "src/libelf/exttypes.h", + "src/libelf/gelf.h", + "src/libelf/gelf_checksum.c", + "src/libelf/gelf_fsize.c", + "src/libelf/gelf_getauxv.c", + "src/libelf/gelf_getclass.c", + "src/libelf/gelf_getdyn.c", + "src/libelf/gelf_getehdr.c", + "src/libelf/gelf_getlib.c", + "src/libelf/gelf_getmove.c", + "src/libelf/gelf_getnote.c", + "src/libelf/gelf_getphdr.c", + "src/libelf/gelf_getrel.c", + "src/libelf/gelf_getrela.c", + "src/libelf/gelf_getshdr.c", + "src/libelf/gelf_getsym.c", + "src/libelf/gelf_getsyminfo.c", + "src/libelf/gelf_getsymshndx.c", + "src/libelf/gelf_getverdaux.c", + "src/libelf/gelf_getverdef.c", + "src/libelf/gelf_getvernaux.c", + "src/libelf/gelf_getverneed.c", + "src/libelf/gelf_getversym.c", + "src/libelf/gelf_newehdr.c", + "src/libelf/gelf_newphdr.c", + "src/libelf/gelf_offscn.c", + "src/libelf/gelf_update_auxv.c", + "src/libelf/gelf_update_dyn.c", + "src/libelf/gelf_update_ehdr.c", + "src/libelf/gelf_update_lib.c", + "src/libelf/gelf_update_move.c", + "src/libelf/gelf_update_phdr.c", + "src/libelf/gelf_update_rel.c", + "src/libelf/gelf_update_rela.c", + "src/libelf/gelf_update_shdr.c", + "src/libelf/gelf_update_sym.c", + "src/libelf/gelf_update_syminfo.c", + "src/libelf/gelf_update_symshndx.c", + "src/libelf/gelf_update_verdaux.c", + "src/libelf/gelf_update_verdef.c", + "src/libelf/gelf_update_vernaux.c", + "src/libelf/gelf_update_verneed.c", + "src/libelf/gelf_update_versym.c", + "src/libelf/gelf_xlate.c", + "src/libelf/gelf_xlate.h", + "src/libelf/gelf_xlatetof.c", + "src/libelf/gelf_xlatetom.c", + "src/libelf/gnuhash_xlate.h", + "src/libelf/libelf.h", + "src/libelf/libelfP.h", + "src/libelf/libelf_crc32.c", + "src/libelf/libelf_next_prime.c", + "src/libelf/nlist.c", + "src/libelf/nlist.h", + "src/libelf/note_xlate.h", + "src/libelf/version_xlate.h", + ] + + include_dirs = [ + ".", + "src/lib", + ] + + defines = [ + "_GNU_SOURCE", + "HAVE_CONFIG_H", + ] + + cflags = [ + "-std=gnu99", + "-Wall", + "-Wshadow", + "-Werror", + "-Wunused", + "-Wextra", + "-Wformat=2", + ] + + public_configs = [ ":libelf_config" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] +} diff --git a/chromium/third_party/google_input_tools/closure.gni b/chromium/third_party/google_input_tools/closure.gni new file mode 100644 index 00000000000..81f866581fa --- /dev/null +++ b/chromium/third_party/google_input_tools/closure.gni @@ -0,0 +1,47 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +template("build_closure") { + assert(defined(invoker.sources)) + assert(defined(invoker.target)) + action_name = target_name + "_js_gen" + action(action_name) { + script = "//third_party/google_input_tools/builder.py" + sources = invoker.sources + outputs = [ + invoker.target, + ] + args = [ + "--target", + rebase_path(invoker.target, root_build_dir), + ] + if (defined(invoker.json_file)) { + # Optionally parse list of sources from a json file. Useful when the list + # is sufficiently long to create problems with length restrictions on the + # command line. + assert(defined(invoker.json_sources)) + args += [ + "--json_file", + rebase_path(invoker.json_file, root_build_dir), + "--json_sources", + invoker.json_sources, + ] + } else { + # If the number of source files is short, they can be directly extracted + # from the command line. + args += [ "--sources" ] + sources + } + if (defined(invoker.path)) { + args += [ + "--path", + invoker.path, + ] + } + } + group(target_name) { + deps = [ + ":$action_name", + ] + } +} diff --git a/chromium/third_party/google_input_tools/inputview.gni b/chromium/third_party/google_input_tools/inputview.gni new file mode 100644 index 00000000000..0c5d836edee --- /dev/null +++ b/chromium/third_party/google_input_tools/inputview.gni @@ -0,0 +1,9 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +inputview_gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("inputview.gypi") ], + "scope", + [ "inputview.gypi" ]) +inputview_sources = rebase_path(inputview_gypi_values.inputview_sources) diff --git a/chromium/third_party/google_toolbox_for_mac/BUILD.gn b/chromium/third_party/google_toolbox_for_mac/BUILD.gn new file mode 100644 index 00000000000..abbff2a1f8b --- /dev/null +++ b/chromium/third_party/google_toolbox_for_mac/BUILD.gn @@ -0,0 +1,101 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("google_toolbox_for_mac_public_config") { + include_dirs = [ + ".", + "src", + "src/AppKit", + "src/DebugUtils", + "src/Foundation", + ] +} + +component("google_toolbox_for_mac") { + sources = [ + "src/Foundation/GTMStringEncoding.h", + "src/Foundation/GTMStringEncoding.m", + "src/GTMDefines.h", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + public_configs = [ ":google_toolbox_for_mac_public_config" ] + + if (!is_ios) { + sources += [ + "src/AppKit/GTMCarbonEvent.h", + "src/AppKit/GTMCarbonEvent.m", + "src/AppKit/GTMFadeTruncatingTextFieldCell.h", + "src/AppKit/GTMFadeTruncatingTextFieldCell.m", + "src/AppKit/GTMIBArray.h", + "src/AppKit/GTMIBArray.m", + "src/AppKit/GTMKeyValueAnimation.h", + "src/AppKit/GTMKeyValueAnimation.m", + "src/AppKit/GTMNSAnimation+Duration.h", + "src/AppKit/GTMNSAnimation+Duration.m", + "src/AppKit/GTMNSBezierPath+CGPath.h", + "src/AppKit/GTMNSBezierPath+CGPath.m", + "src/AppKit/GTMNSBezierPath+RoundRect.h", + "src/AppKit/GTMNSBezierPath+RoundRect.m", + "src/AppKit/GTMNSColor+Luminance.h", + "src/AppKit/GTMNSColor+Luminance.m", + "src/AppKit/GTMUILocalizer.h", + "src/AppKit/GTMUILocalizer.m", + "src/AppKit/GTMUILocalizerAndLayoutTweaker.h", + "src/AppKit/GTMUILocalizerAndLayoutTweaker.m", + "src/DebugUtils/GTMDebugSelectorValidation.h", + "src/DebugUtils/GTMTypeCasting.h", + "src/Foundation/GTMServiceManagement.c", + "src/Foundation/GTMServiceManagement.h", + ] + + libs = [ + "AddressBook.framework", + "AppKit.framework", + "Carbon.framework", + "Cocoa.framework", + "QuartzCore.framework", + ] + } else { # is_ios + sources += [ + "src/DebugUtils/GTMMethodCheck.h", + "src/DebugUtils/GTMMethodCheck.m", + "src/Foundation/GTMLightweightProxy.h", + "src/Foundation/GTMLightweightProxy.m", + + # GTMLogger is used by breakpad, which is still used on iOS. + "src/Foundation/GTMLogger.h", + "src/Foundation/GTMLogger.m", + "src/Foundation/GTMNSDictionary+URLArguments.h", + "src/Foundation/GTMNSDictionary+URLArguments.m", + "src/Foundation/GTMNSString+URLArguments.h", + "src/Foundation/GTMNSString+URLArguments.m", + "src/iPhone/GTMFadeTruncatingLabel.h", + "src/iPhone/GTMFadeTruncatingLabel.m", + "src/iPhone/GTMRoundedRectPath.h", + "src/iPhone/GTMRoundedRectPath.m", + "src/iPhone/GTMUIImage+Resize.h", + "src/iPhone/GTMUIImage+Resize.m", + "src/iPhone/GTMUILocalizer.h", + "src/iPhone/GTMUILocalizer.m", + ] + + # TODO(crbug.com/569158): Suppresses warnings that are treated as errors + # when minimum iOS version support is increased to iOS 9 and up. + # This should be removed once all deprecation violations have been fixed. + cflags = [ "-Wno-deprecated-declarations" ] + } + + if (is_component_build) { + # GTM is third-party code, so we don't want to add _EXPORT + # annotations to it, so build it without -fvisibility=hidden + # (else the interface class symbols will be hidden in a 64bit + # build). Only do this in a component build, so that the shipping + # chrome binary doesn't end up with unnecessarily exported + # symbols. + configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] + configs += [ "//build/config/gcc:symbol_visibility_default" ] + } +} diff --git a/chromium/third_party/instrumented_libraries/BUILD.gn b/chromium/third_party/instrumented_libraries/BUILD.gn new file mode 100644 index 00000000000..cbaf7f57b02 --- /dev/null +++ b/chromium/third_party/instrumented_libraries/BUILD.gn @@ -0,0 +1,72 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/sanitizers/sanitizers.gni") + +group("deps") { + if (use_prebuilt_instrumented_libraries) { + assert(prebuilt_instrumented_libraries_available, + "Prebuilt instrumented libraries are only available when " + + "is_msan = true and msan_track_origins = {0, 2}") + deps = [ + ":prebuilt", + ] + data_deps = [ + ":prebuilt", + ] + } +} + +if (prebuilt_instrumented_libraries_available) { + group("prebuilt") { + visibility = [ ":deps" ] + + deps = [ + ":extract_prebuilt_instrumented_libraries", + ] + data_deps = [ + ":extract_prebuilt_instrumented_libraries", + ] + } + + if (is_msan) { + sanitizer_type = "msan" + if (msan_track_origins == 0) { + archive_prefix = "msan-no-origins" + } else if (msan_track_origins == 2) { + archive_prefix = "msan-chained-origins" + } + } + + # TODO(GYP): scripts/download_binaries.py uses GYP_DEFINES to decide whether + # to download the archives extracted here. + # Note: This requires a clobber whenever Ubuntu version changes. + action("extract_prebuilt_instrumented_libraries") { + visibility = [ ":prebuilt" ] + script = "scripts/unpack_binaries.py" + depfile = "$target_out_dir/$archive_prefix.d" + args = [ + archive_prefix, + rebase_path("binaries"), + rebase_path(root_build_dir + "/instrumented_libraries_prebuilt"), + rebase_path(target_out_dir, root_build_dir), + ] + outputs = [ + "$target_out_dir/$archive_prefix.txt", + ] + data = [ + "$root_out_dir/instrumented_libraries_prebuilt/", + ] + } + + config("prebuilt_ldflags") { + ldflags = [ + # Add a relative RPATH entry to Chromium binaries. This puts instrumented + # DSOs before system-installed versions in library search path. + "-Wl,-R,\$ORIGIN/instrumented_libraries_prebuilt/$sanitizer_type/lib", + "-Wl,-z,origin", + ] + } +} +# TODO(GYP): Support building instrumented libraries from source. diff --git a/chromium/third_party/junit/BUILD.gn b/chromium/third_party/junit/BUILD.gn new file mode 100644 index 00000000000..c397721e753 --- /dev/null +++ b/chromium/third_party/junit/BUILD.gn @@ -0,0 +1,183 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //third_party/junit.gyp:hamcrest_jar +java_prebuilt("hamcrest") { + jar_path = "src/lib/hamcrest-core-1.1.jar" +} + +# GYP: //third_party/junit.gyp:junit_jar +java_library("junit") { + chromium_code = false + testonly = true + deps = [ + ":hamcrest", + ] + java_files = [ + "src/src/main/java/junit/extensions/ActiveTestSuite.java", + "src/src/main/java/junit/extensions/RepeatedTest.java", + "src/src/main/java/junit/extensions/TestDecorator.java", + "src/src/main/java/junit/extensions/TestSetup.java", + "src/src/main/java/junit/extensions/package-info.java", + "src/src/main/java/junit/framework/Assert.java", + "src/src/main/java/junit/framework/AssertionFailedError.java", + "src/src/main/java/junit/framework/ComparisonCompactor.java", + "src/src/main/java/junit/framework/ComparisonFailure.java", + "src/src/main/java/junit/framework/JUnit4TestAdapter.java", + "src/src/main/java/junit/framework/JUnit4TestAdapterCache.java", + "src/src/main/java/junit/framework/JUnit4TestCaseFacade.java", + "src/src/main/java/junit/framework/Protectable.java", + "src/src/main/java/junit/framework/Test.java", + "src/src/main/java/junit/framework/TestCase.java", + "src/src/main/java/junit/framework/TestFailure.java", + "src/src/main/java/junit/framework/TestListener.java", + "src/src/main/java/junit/framework/TestResult.java", + "src/src/main/java/junit/framework/TestSuite.java", + "src/src/main/java/junit/framework/package-info.java", + "src/src/main/java/junit/runner/BaseTestRunner.java", + "src/src/main/java/junit/runner/TestRunListener.java", + "src/src/main/java/junit/runner/Version.java", + "src/src/main/java/junit/runner/package-info.java", + "src/src/main/java/junit/textui/ResultPrinter.java", + "src/src/main/java/junit/textui/TestRunner.java", + "src/src/main/java/junit/textui/package-info.java", + "src/src/main/java/org/junit/After.java", + "src/src/main/java/org/junit/AfterClass.java", + "src/src/main/java/org/junit/Assert.java", + "src/src/main/java/org/junit/Assume.java", + "src/src/main/java/org/junit/Before.java", + "src/src/main/java/org/junit/BeforeClass.java", + "src/src/main/java/org/junit/ClassRule.java", + "src/src/main/java/org/junit/ComparisonFailure.java", + "src/src/main/java/org/junit/Ignore.java", + "src/src/main/java/org/junit/Rule.java", + "src/src/main/java/org/junit/Test.java", + "src/src/main/java/org/junit/experimental/ParallelComputer.java", + "src/src/main/java/org/junit/experimental/categories/Categories.java", + "src/src/main/java/org/junit/experimental/categories/Category.java", + "src/src/main/java/org/junit/experimental/max/CouldNotReadCoreException.java", + "src/src/main/java/org/junit/experimental/max/MaxCore.java", + "src/src/main/java/org/junit/experimental/max/MaxHistory.java", + "src/src/main/java/org/junit/experimental/results/FailureList.java", + "src/src/main/java/org/junit/experimental/results/PrintableResult.java", + "src/src/main/java/org/junit/experimental/results/ResultMatchers.java", + "src/src/main/java/org/junit/experimental/runners/Enclosed.java", + "src/src/main/java/org/junit/experimental/theories/DataPoint.java", + "src/src/main/java/org/junit/experimental/theories/DataPoints.java", + "src/src/main/java/org/junit/experimental/theories/ParameterSignature.java", + "src/src/main/java/org/junit/experimental/theories/ParameterSupplier.java", + "src/src/main/java/org/junit/experimental/theories/ParametersSuppliedBy.java", + "src/src/main/java/org/junit/experimental/theories/PotentialAssignment.java", + "src/src/main/java/org/junit/experimental/theories/Theories.java", + "src/src/main/java/org/junit/experimental/theories/Theory.java", + "src/src/main/java/org/junit/experimental/theories/internal/AllMembersSupplier.java", + "src/src/main/java/org/junit/experimental/theories/internal/Assignments.java", + "src/src/main/java/org/junit/experimental/theories/internal/ParameterizedAssertionError.java", + "src/src/main/java/org/junit/experimental/theories/suppliers/TestedOn.java", + "src/src/main/java/org/junit/experimental/theories/suppliers/TestedOnSupplier.java", + "src/src/main/java/org/junit/internal/ArrayComparisonFailure.java", + "src/src/main/java/org/junit/internal/AssumptionViolatedException.java", + "src/src/main/java/org/junit/internal/ComparisonCriteria.java", + "src/src/main/java/org/junit/internal/ExactComparisonCriteria.java", + "src/src/main/java/org/junit/internal/InexactComparisonCriteria.java", + "src/src/main/java/org/junit/internal/JUnitSystem.java", + "src/src/main/java/org/junit/internal/RealSystem.java", + "src/src/main/java/org/junit/internal/TextListener.java", + "src/src/main/java/org/junit/internal/builders/AllDefaultPossibilitiesBuilder.java", + "src/src/main/java/org/junit/internal/builders/AnnotatedBuilder.java", + "src/src/main/java/org/junit/internal/builders/IgnoredBuilder.java", + "src/src/main/java/org/junit/internal/builders/IgnoredClassRunner.java", + "src/src/main/java/org/junit/internal/builders/JUnit3Builder.java", + "src/src/main/java/org/junit/internal/builders/JUnit4Builder.java", + "src/src/main/java/org/junit/internal/builders/NullBuilder.java", + "src/src/main/java/org/junit/internal/builders/SuiteMethodBuilder.java", + "src/src/main/java/org/junit/internal/matchers/CombinableMatcher.java", + "src/src/main/java/org/junit/internal/matchers/Each.java", + "src/src/main/java/org/junit/internal/matchers/IsCollectionContaining.java", + "src/src/main/java/org/junit/internal/matchers/StringContains.java", + "src/src/main/java/org/junit/internal/matchers/SubstringMatcher.java", + "src/src/main/java/org/junit/internal/matchers/TypeSafeMatcher.java", + "src/src/main/java/org/junit/internal/requests/ClassRequest.java", + "src/src/main/java/org/junit/internal/requests/FilterRequest.java", + "src/src/main/java/org/junit/internal/requests/SortingRequest.java", + "src/src/main/java/org/junit/internal/requests/package-info.java", + "src/src/main/java/org/junit/internal/runners/ClassRoadie.java", + "src/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java", + "src/src/main/java/org/junit/internal/runners/FailedBefore.java", + "src/src/main/java/org/junit/internal/runners/InitializationError.java", + "src/src/main/java/org/junit/internal/runners/JUnit38ClassRunner.java", + "src/src/main/java/org/junit/internal/runners/JUnit4ClassRunner.java", + "src/src/main/java/org/junit/internal/runners/MethodRoadie.java", + "src/src/main/java/org/junit/internal/runners/MethodValidator.java", + "src/src/main/java/org/junit/internal/runners/SuiteMethod.java", + "src/src/main/java/org/junit/internal/runners/TestClass.java", + "src/src/main/java/org/junit/internal/runners/TestMethod.java", + "src/src/main/java/org/junit/internal/runners/model/EachTestNotifier.java", + "src/src/main/java/org/junit/internal/runners/model/MultipleFailureException.java", + "src/src/main/java/org/junit/internal/runners/model/ReflectiveCallable.java", + "src/src/main/java/org/junit/internal/runners/package-info.java", + "src/src/main/java/org/junit/internal/runners/rules/RuleFieldValidator.java", + "src/src/main/java/org/junit/internal/runners/statements/ExpectException.java", + "src/src/main/java/org/junit/internal/runners/statements/Fail.java", + "src/src/main/java/org/junit/internal/runners/statements/FailOnTimeout.java", + "src/src/main/java/org/junit/internal/runners/statements/InvokeMethod.java", + "src/src/main/java/org/junit/internal/runners/statements/RunAfters.java", + "src/src/main/java/org/junit/internal/runners/statements/RunBefores.java", + "src/src/main/java/org/junit/matchers/JUnitMatchers.java", + "src/src/main/java/org/junit/matchers/package-info.java", + "src/src/main/java/org/junit/package-info.java", + "src/src/main/java/org/junit/rules/ErrorCollector.java", + "src/src/main/java/org/junit/rules/ExpectedException.java", + "src/src/main/java/org/junit/rules/ExternalResource.java", + "src/src/main/java/org/junit/rules/MethodRule.java", + "src/src/main/java/org/junit/rules/RuleChain.java", + "src/src/main/java/org/junit/rules/RunRules.java", + "src/src/main/java/org/junit/rules/TemporaryFolder.java", + "src/src/main/java/org/junit/rules/TestName.java", + "src/src/main/java/org/junit/rules/TestRule.java", + "src/src/main/java/org/junit/rules/TestWatcher.java", + "src/src/main/java/org/junit/rules/TestWatchman.java", + "src/src/main/java/org/junit/rules/Timeout.java", + "src/src/main/java/org/junit/rules/Verifier.java", + "src/src/main/java/org/junit/runner/Computer.java", + "src/src/main/java/org/junit/runner/Describable.java", + "src/src/main/java/org/junit/runner/Description.java", + "src/src/main/java/org/junit/runner/JUnitCore.java", + "src/src/main/java/org/junit/runner/Request.java", + "src/src/main/java/org/junit/runner/Result.java", + "src/src/main/java/org/junit/runner/RunWith.java", + "src/src/main/java/org/junit/runner/Runner.java", + "src/src/main/java/org/junit/runner/manipulation/Filter.java", + "src/src/main/java/org/junit/runner/manipulation/Filterable.java", + "src/src/main/java/org/junit/runner/manipulation/NoTestsRemainException.java", + "src/src/main/java/org/junit/runner/manipulation/Sortable.java", + "src/src/main/java/org/junit/runner/manipulation/Sorter.java", + "src/src/main/java/org/junit/runner/manipulation/package-info.java", + "src/src/main/java/org/junit/runner/notification/Failure.java", + "src/src/main/java/org/junit/runner/notification/RunListener.java", + "src/src/main/java/org/junit/runner/notification/RunNotifier.java", + "src/src/main/java/org/junit/runner/notification/StoppedByUserException.java", + "src/src/main/java/org/junit/runner/notification/package-info.java", + "src/src/main/java/org/junit/runner/package-info.java", + "src/src/main/java/org/junit/runners/AllTests.java", + "src/src/main/java/org/junit/runners/BlockJUnit4ClassRunner.java", + "src/src/main/java/org/junit/runners/JUnit4.java", + "src/src/main/java/org/junit/runners/Parameterized.java", + "src/src/main/java/org/junit/runners/ParentRunner.java", + "src/src/main/java/org/junit/runners/Suite.java", + "src/src/main/java/org/junit/runners/model/FrameworkField.java", + "src/src/main/java/org/junit/runners/model/FrameworkMember.java", + "src/src/main/java/org/junit/runners/model/FrameworkMethod.java", + "src/src/main/java/org/junit/runners/model/InitializationError.java", + "src/src/main/java/org/junit/runners/model/MultipleFailureException.java", + "src/src/main/java/org/junit/runners/model/NoGenericTypeParametersValidator.java", + "src/src/main/java/org/junit/runners/model/RunnerBuilder.java", + "src/src/main/java/org/junit/runners/model/RunnerScheduler.java", + "src/src/main/java/org/junit/runners/model/Statement.java", + "src/src/main/java/org/junit/runners/model/TestClass.java", + "src/src/main/java/org/junit/runners/package-info.java", + ] +} diff --git a/chromium/third_party/liblouis/BUILD.gn b/chromium/third_party/liblouis/BUILD.gn new file mode 100644 index 00000000000..02de24d2bb2 --- /dev/null +++ b/chromium/third_party/liblouis/BUILD.gn @@ -0,0 +1,202 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/nacl/config.gni") +import("//build/config/nacl/rules.gni") + +if (current_toolchain == default_toolchain) { + chromevox_test_data_dir = "$root_build_dir/chromevox_test_data/braille" + + # Build Liblouis library + # + # This target is used to build and assemble Liblouis braille translator + # including Native Client executable, manifest and translation tables. + # + # Variables: + # dest_dir: destination path for all translator files + # deps: private linked dependencies + # testonly: a target must only be used for testing + template("liblouis_library") { + assert(defined(invoker.dest_dir), "Must define dest_dir") + forward_variables_from(invoker, [ "dest_dir" ]) + + tables_target_name = "${target_name}_tables" + tables_json_target_name = "${target_name}_tables_json" + nexe_target_name = "${target_name}_nexe" + nmf_target_name = "${target_name}_nmf" + final_target_name = target_name + + action(tables_target_name) { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ ":$final_target_name" ] + script = "copy_tables.py" + inputs = [ + "liblouis_list_tables.py", + ] + depfile = "$target_gen_dir/$target_name.d" + sources = [ + "tables.json", + ] + outputs = [ + "$depfile.stamp", + ] + args = [ + "-D", + rebase_path(".", root_build_dir), + "-D", + rebase_path("src/tables", root_build_dir), + "-d", + rebase_path("$dest_dir/tables", root_build_dir), + "-e", + "cvox-common.cti", + "--depfile", + rebase_path(depfile, root_build_dir), + ] + rebase_path(sources, root_build_dir) + } + + copy(tables_json_target_name) { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ ":$final_target_name" ] + sources = [ + "tables.json", + ] + outputs = [ + "$dest_dir/{{source_file_part}}", + ] + } + + copy(nexe_target_name) { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ + ":$final_target_name", + ":$nmf_target_name", + ] + nacl_wrapper = "liblouis_nacl_wrapper(//build/toolchain/nacl:clang_newlib_${target_cpu})" + path = get_label_info(":$nacl_wrapper", "root_out_dir") + sources = [ + "${path}/liblouis_nacl.nexe", + ] + + if (current_cpu == "x86") { + nmf_cpu = "x86_32" + } else if (current_cpu == "x64") { + nmf_cpu = "x86_64" + } else { + nmf_cpu = current_cpu + } + outputs = [ + "$dest_dir/{{source_name_part}}_${nmf_cpu}.nexe", + ] + deps = [ + ":$nacl_wrapper", + ] + } + + generate_nmf(nmf_target_name) { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ ":$final_target_name" ] + executables = get_target_outputs(":$nexe_target_name") + nmf = "$dest_dir/liblouis_nacl.nmf" + deps = [ + ":$nexe_target_name", + ] + } + + group(target_name) { + forward_variables_from(invoker, [ "testonly" ]) + deps = [ + ":$nexe_target_name", + ":$nmf_target_name", + ":$tables_json_target_name", + ":$tables_target_name", + ] + if (defined(invoker.deps)) { + deps += invoker.deps + } + } + } + + liblouis_library("liblouis") { + dest_dir = "$root_build_dir/resources/chromeos/chromevox/braille" + } + + liblouis_library("liblouis_test_data") { + testonly = true + dest_dir = chromevox_test_data_dir + deps = [ + ":liblouis_test_files", + ] + } + + copy("liblouis_test_files") { + visibility = [ ":liblouis_test_data" ] + testonly = true + sources = [ + "//chrome/test/data/chromeos/liblouis_nacl/manifest.json", + "//chrome/test/data/chromeos/liblouis_nacl/test.js", + ] + outputs = [ + "${chromevox_test_data_dir}/{{source_file_part}}", + ] + } +} + +if (is_nacl) { + config("liblouis_nacl_config") { + cflags = [ + "-Wno-sign-compare", + + # Needed for target_arch=mipsel + # src/liblouis/compileTranslationTable.c:1414 + "-Wno-tautological-compare", + + # Needed for target_arch=mipsel + # src/liblouis/logging.c:58 + "-Wno-non-literal-null-conversion", + ] + } + + source_set("liblouis_nacl") { + visibility = [ ":liblouis_nacl_wrapper" ] + sources = [ + "overrides/liblouis/config.h", + "overrides/liblouis/liblouis.h", + "src/liblouis/compileTranslationTable.c", + "src/liblouis/logging.c", + "src/liblouis/lou_backTranslateString.c", + "src/liblouis/lou_translateString.c", + "src/liblouis/transcommon.ci", + "src/liblouis/wrappers.c", + ] + include_dirs = [ + "overrides/liblouis", + "src/liblouis", + ".", + "../..", + ] + configs += [ ":liblouis_nacl_config" ] + } + + executable("liblouis_nacl_wrapper") { + visibility = [ ":*" ] + output_name = "liblouis_nacl" + sources = [ + "nacl_wrapper/liblouis_instance.cc", + "nacl_wrapper/liblouis_instance.h", + "nacl_wrapper/liblouis_module.cc", + "nacl_wrapper/liblouis_module.h", + "nacl_wrapper/liblouis_wrapper.cc", + "nacl_wrapper/liblouis_wrapper.h", + "nacl_wrapper/translation_params.h", + "nacl_wrapper/translation_result.h", + ] + deps = [ + ":liblouis_nacl", + "//native_client_sdk/src/libraries/nacl_io", + "//ppapi:ppapi_cpp_lib", + "//ppapi/native_client:ppapi_lib", + "//third_party/jsoncpp", + ] + } +} diff --git a/chromium/third_party/libphonenumber/BUILD.gn b/chromium/third_party/libphonenumber/BUILD.gn new file mode 100644 index 00000000000..0e979c0e74a --- /dev/null +++ b/chromium/third_party/libphonenumber/BUILD.gn @@ -0,0 +1,120 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") +import("//third_party/protobuf/proto_library.gni") + +proto_library("proto") { + sources = [ + "dist/resources/phonemetadata.proto", + "dist/resources/phonenumber.proto", + ] + proto_out_dir = "third_party/libphonenumber/phonenumbers" +} + +config("libphonenumber_config") { + include_dirs = [ + "dist/cpp/src", + "$root_gen_dir/third_party/libphonenumber", + ] + defines = [ "I18N_PHONENUMBERS_USE_ICU_REGEXP=1" ] + if (!is_android) { + defines += [ "I18N_PHONENUMBERS_NO_THREAD_SAFETY=1" ] + } +} + +config("libphonenumber_config_internal") { + if (is_clang) { + cflags = [ + # https://github.com/googlei18n/libphonenumber/pull/741 + "-Wno-unused-private-field", + ] + } +} + +# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_without_metadata +static_library("libphonenumber_without_metadata") { + sources = [ + "dist/cpp/src/phonenumbers/asyoutypeformatter.cc", + "dist/cpp/src/phonenumbers/base/strings/string_piece.cc", + "dist/cpp/src/phonenumbers/default_logger.cc", + "dist/cpp/src/phonenumbers/logger.cc", + "dist/cpp/src/phonenumbers/phonenumber.cc", + "dist/cpp/src/phonenumbers/phonenumbermatch.cc", + "dist/cpp/src/phonenumbers/phonenumbermatcher.cc", + "dist/cpp/src/phonenumbers/phonenumberutil.cc", + "dist/cpp/src/phonenumbers/regexp_adapter_icu.cc", + "dist/cpp/src/phonenumbers/regexp_cache.cc", + "dist/cpp/src/phonenumbers/string_byte_sink.cc", + "dist/cpp/src/phonenumbers/stringutil.cc", + "dist/cpp/src/phonenumbers/unicodestring.cc", + "dist/cpp/src/phonenumbers/utf/rune.c", + "dist/cpp/src/phonenumbers/utf/unicodetext.cc", + "dist/cpp/src/phonenumbers/utf/unilib.cc", + ] + + # libphonenumber's base/logging.h is a minimal implementation where DCHECKs + # do not consume their arguments. This leads to unused variable warnings in + # release builds. + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ + "//build/config/compiler:no_chromium_code", + ":libphonenumber_config_internal", + ] + + public_configs = [ ":libphonenumber_config" ] + + public_deps = [ + ":proto", + ] + deps = [ + ":proto", + "//third_party/icu", + "//third_party/protobuf:protobuf_lite", + ] +} + +# Library used by clients that includes production metadata. +# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber +static_library("libphonenumber") { + sources = [ + # Comment next line and uncomment the line after, if complete metadata + # (with examples) is needed. + "dist/cpp/src/phonenumbers/lite_metadata.cc", + #"dist/cpp/src/phonenumbers/metadata.cc", + ] + + public_deps = [ + ":libphonenumber_without_metadata", + ] +} + +# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests +test("libphonenumber_unittests") { + sources = [ + "dist/cpp/src/phonenumbers/test_metadata.cc", + "dist/cpp/test/phonenumbers/asyoutypeformatter_test.cc", + "dist/cpp/test/phonenumbers/phonenumbermatch_test.cc", + "dist/cpp/test/phonenumbers/phonenumbermatcher_test.cc", + "dist/cpp/test/phonenumbers/phonenumberutil_test.cc", + "dist/cpp/test/phonenumbers/regexp_adapter_test.cc", + "dist/cpp/test/phonenumbers/stringutil_test.cc", + "dist/cpp/test/phonenumbers/test_util.cc", + "dist/cpp/test/phonenumbers/unicodestring_test.cc", + ] + + configs += [ ":libphonenumber_config_internal" ] + + include_dirs = [ "dist/cpp/test" ] + + deps = [ + ":libphonenumber_without_metadata", + "//base", + "//base/test:run_all_unittests", + "//base/third_party/dynamic_annotations", + "//testing/gmock", + "//testing/gtest", + "//third_party/icu", + ] +} diff --git a/chromium/tools/android/BUILD.gn b/chromium/tools/android/BUILD.gn new file mode 100644 index 00000000000..55d94168dd0 --- /dev/null +++ b/chromium/tools/android/BUILD.gn @@ -0,0 +1,81 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Intermediate target grouping the android tools needed to run native +# unittests and instrumentation test apks. +# +# GYP: //tools/android/android_tools.gyp:android_tools +group("android_tools") { + deps = [ + "//build/android:wrapper_scripts", + "//third_party/android_platform:stack_wrapper", + "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", + "//tools/android/adb_reboot", + "//tools/android/file_poller", + "//tools/android/forwarder2", + "//tools/android/md5sum", + "//tools/android/memtrack_helper:memtrack_helper", + "//tools/android/purge_ashmem", + "//tools/perf:run_benchmark_wrapper", + ] +} + +# GYP: //tools/android/android_tools.gyp:memdump +group("memdump") { + deps = [ + "//tools/android/memdump", + ] +} + +# GYP: //tools/android/android_tools.gyp:memconsumer +group("memconsumer") { + deps = [ + "//tools/android/memconsumer:memconsumer_apk", + ] +} + +# GYP: //tools/android/android_tools.gyp:memtrack_helper +group("memtrack_helper") { + deps = [ + "//tools/android/memtrack_helper", + ] +} + +# GYP: //tools/android/android_tools.gyp:ps_ext +group("ps_ext") { + deps = [ + "//tools/android/ps_ext", + ] +} + +# GYP: //tools/android/android_tools.gyp:spnego_authenticator +group("spnego_authenticator") { + testonly = true + deps = [ + "//tools/android/kerberos/SpnegoAuthenticator:spnego_authenticator_apk", + ] +} + +# GYP: //tools/android/android_tools.gyp:customtabs_benchmark +group("customtabs_benchmark") { + deps = [ + "//tools/android/customtabs_benchmark:customtabs_benchmark_apk", + ] +} + +# GYP: //tools/android/android_tools.gyp:audio_focus_grabber +group("audio_focus_grabber") { + testonly = true + deps = [ + "//tools/android/audio_focus_grabber:audio_focus_grabber_apk", + ] +} + +# GYP: //tools/android/android_tools.gyp:push_apps_to_background +group("push_apps_to_background") { + testonly = true + deps = [ + "//tools/android/push_apps_to_background:push_apps_to_background_apk", + ] +} diff --git a/chromium/tools/android/adb_reboot/BUILD.gn b/chromium/tools/android/adb_reboot/BUILD.gn new file mode 100644 index 00000000000..9c59f949ae6 --- /dev/null +++ b/chromium/tools/android/adb_reboot/BUILD.gn @@ -0,0 +1,9 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("adb_reboot") { + sources = [ + "adb_reboot.c", + ] +} diff --git a/chromium/tools/android/audio_focus_grabber/BUILD.gn b/chromium/tools/android/audio_focus_grabber/BUILD.gn new file mode 100644 index 00000000000..94ea7511e8f --- /dev/null +++ b/chromium/tools/android/audio_focus_grabber/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +# GYP: //tools/android/audio_focus_grabber/audio_focus_grabber.gyp:audio_focus_grabber_apk +android_apk("audio_focus_grabber_apk") { + testonly = true + android_manifest = "java/AndroidManifest.xml" + apk_name = "AudioFocusGrabber" + + deps = [ + ":audio_focus_grabber_apk_resources", + "//base:base_java", + "//third_party/android_tools:android_support_v13_java", + ] + + java_files = [ + "java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberActivity.java", + "java/src/org/chromium/tools/audio_focus_grabber/AudioFocusGrabberListenerService.java", + ] +} + +android_resources("audio_focus_grabber_apk_resources") { + testonly = true + resource_dirs = [ "java/res" ] + android_manifest = "java/AndroidManifest.xml" +} diff --git a/chromium/tools/android/common/BUILD.gn b/chromium/tools/android/common/BUILD.gn new file mode 100644 index 00000000000..3c867410aab --- /dev/null +++ b/chromium/tools/android/common/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# GYP: //tools/android/common/common.gyp:android_tools_common +source_set("common") { + sources = [ + "adb_connection.cc", + "adb_connection.h", + "daemon.cc", + "daemon.h", + "net.cc", + "net.h", + ] + + deps = [ + "//base", + ] +} diff --git a/chromium/tools/android/customtabs_benchmark/BUILD.gn b/chromium/tools/android/customtabs_benchmark/BUILD.gn new file mode 100644 index 00000000000..e1bd05e9cdc --- /dev/null +++ b/chromium/tools/android/customtabs_benchmark/BUILD.gn @@ -0,0 +1,14 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +android_apk("customtabs_benchmark_apk") { + java_files = [ "java/src/org/chromium/customtabs/test/MainActivity.java" ] + android_manifest = "java/AndroidManifest.xml" + apk_name = "CustomTabsBenchmark" + deps = [ + "//third_party/custom_tabs_client:custom_tabs_support_lib", + ] +} diff --git a/chromium/tools/android/file_poller/BUILD.gn b/chromium/tools/android/file_poller/BUILD.gn new file mode 100644 index 00000000000..828dc560dc9 --- /dev/null +++ b/chromium/tools/android/file_poller/BUILD.gn @@ -0,0 +1,15 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("file_poller") { + sources = [ + "file_poller.cc", + ] + deps = [ + "//base", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] +} diff --git a/chromium/tools/android/forwarder/BUILD.gn b/chromium/tools/android/forwarder/BUILD.gn new file mode 100644 index 00000000000..c59cd90a165 --- /dev/null +++ b/chromium/tools/android/forwarder/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/symlink.gni") + +# GYP: //tools/android/forwarder/forwarder.gyp:forwarder +executable("forwarder") { + sources = [ + "forwarder.cc", + ] + deps = [ + "//base", + "//build/config/sanitizers:deps", + "//tools/android/common", + ] +} diff --git a/chromium/tools/android/forwarder2/BUILD.gn b/chromium/tools/android/forwarder2/BUILD.gn new file mode 100644 index 00000000000..d2af725822f --- /dev/null +++ b/chromium/tools/android/forwarder2/BUILD.gn @@ -0,0 +1,98 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/symlink.gni") + +# GYP: //tools/android/forwarder2/forwarder.gyp:forwarder2 +group("forwarder2") { + data_deps = [ + ":host_forwarder", + ":device_forwarder_prepare_dist($default_toolchain)", + ] +} + +if (current_toolchain == default_toolchain) { + import("//build/config/android/rules.gni") + + # GYP: //tools/android/forwarder2/forwarder.gyp:device_forwarder + executable("device_forwarder") { + sources = [ + "command.cc", + "command.h", + "common.cc", + "common.h", + "daemon.cc", + "daemon.h", + "device_controller.cc", + "device_controller.h", + "device_forwarder_main.cc", + "device_listener.cc", + "device_listener.h", + "forwarder.cc", + "forwarder.h", + "forwarders_manager.cc", + "forwarders_manager.h", + "pipe_notifier.cc", + "pipe_notifier.h", + "self_deleter_helper.h", + "socket.cc", + "socket.h", + "util.h", + ] + deps = [ + "//base", + "//build/config/sanitizers:deps", + "//tools/android/common", + ] + data_deps = [ + "//build/android/pylib/device/commands", + ] + } + + # GYP: //tools/android/forwarder2/forwarder.gyp:forwarder2 + create_native_executable_dist("device_forwarder_prepare_dist") { + dist_dir = "$root_build_dir/forwarder_dist" + binary = "$root_build_dir/device_forwarder" + deps = [ + ":device_forwarder", + ] + } +} + +if (current_toolchain != default_toolchain) { + # GYP: //tools/android/forwarder2/forwarder.gyp:host_forwarder + executable("host_forwarder") { + sources = [ + "command.cc", + "command.h", + "common.cc", + "common.h", + "daemon.cc", + "daemon.h", + "forwarder.cc", + "forwarder.h", + "forwarders_manager.cc", + "forwarders_manager.h", + "host_controller.cc", + "host_controller.h", + "host_forwarder_main.cc", + "pipe_notifier.cc", + "pipe_notifier.h", + "self_deleter_helper.h", + "socket.cc", + "socket.h", + "util.h", + ] + deps = [ + "//base", + "//build/config/sanitizers:deps", + "//tools/android/common", + ] + } +} else { + # Create a symlink from root_build_dir -> clang_x64/host_forwarder. + binary_symlink("host_forwarder") { + binary_label = ":$target_name($host_toolchain)" + } +} diff --git a/chromium/tools/android/kerberos/SpnegoAuthenticator/BUILD.gn b/chromium/tools/android/kerberos/SpnegoAuthenticator/BUILD.gn new file mode 100644 index 00000000000..e6e8f89cd58 --- /dev/null +++ b/chromium/tools/android/kerberos/SpnegoAuthenticator/BUILD.gn @@ -0,0 +1,33 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/config/android/rules.gni") + +# GYP: //tools/android/kerberos:kerberos.gyp:spnego_authenticator_apk +android_apk("spnego_authenticator_apk") { + testonly = true + android_manifest = "AndroidManifest.xml" + apk_name = "SpnegoAuthenticator" + + deps = [ + ":spnego_authenticator_apk_assets", + "//base:base_java", + "//net/android:net_java", + ] + + java_files = [ + "src/org/chromium/tools/spnegoauthenticator/AccountData.java", + "src/org/chromium/tools/spnegoauthenticator/Constants.java", + "src/org/chromium/tools/spnegoauthenticator/SpnegoAuthenticator.java", + "src/org/chromium/tools/spnegoauthenticator/SpnegoAuthenticatorActivity.java", + "src/org/chromium/tools/spnegoauthenticator/SpnegoAuthenticatorService.java", + ] +} + +android_resources("spnego_authenticator_apk_assets") { + testonly = true + resource_dirs = [ "res" ] + android_manifest = "AndroidManifest.xml" +} diff --git a/chromium/tools/android/md5sum/BUILD.gn b/chromium/tools/android/md5sum/BUILD.gn new file mode 100644 index 00000000000..35c386b7196 --- /dev/null +++ b/chromium/tools/android/md5sum/BUILD.gn @@ -0,0 +1,51 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/config.gni") +import("//build/symlink.gni") + +# GYP: //tools/android/md5sum/md5sum.gyp:md5sum +group("md5sum") { + data_deps = [ + ":md5sum_prepare_dist($default_toolchain)", + ":md5sum_bin_host($default_toolchain)", + ] + + # TODO(cjhopman): Remove once group data_deps are fixed. + deps = data_deps +} + +# GYP: //tools/android/md5sum/md5sum.gyp:md5sum_bin_device (and md5sum_bin_host) +executable("md5sum_bin") { + sources = [ + "md5sum.cc", + ] + deps = [ + "//base", + "//build/config/sanitizers:deps", + ] + + if (is_android && use_order_profiling) { + deps += [ "//tools/cygprofile" ] + } +} + +if (current_toolchain == default_toolchain) { + import("//build/config/android/rules.gni") + + # GYP: //tools/android/md5sum/md5sum.gyp:md5sum_stripped_device_bin + create_native_executable_dist("md5sum_prepare_dist") { + dist_dir = "$root_build_dir/md5sum_dist" + binary = "$root_build_dir/md5sum_bin" + deps = [ + ":md5sum_bin", + ] + } + + # GYP: //tools/android/md5sum/md5sum.gyp:md5sum_bin_host + binary_symlink("md5sum_bin_host") { + binary_label = ":md5sum_bin($host_toolchain)" + output_name = "md5sum_bin_host" + } +} diff --git a/chromium/tools/android/memconsumer/BUILD.gn b/chromium/tools/android/memconsumer/BUILD.gn new file mode 100644 index 00000000000..70a4447d217 --- /dev/null +++ b/chromium/tools/android/memconsumer/BUILD.gn @@ -0,0 +1,37 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# 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") + +android_resources("memconsumer_apk_resources") { + resource_dirs = [ "java/res" ] + android_manifest = "java/AndroidManifest.xml" +} + +android_apk("memconsumer_apk") { + apk_name = "MemConsumer" + android_manifest = "java/AndroidManifest.xml" + java_files = [ + "java/src/org/chromium/memconsumer/MemConsumer.java", + "java/src/org/chromium/memconsumer/ResidentService.java", + ] + shared_libraries = [ ":libmemconsumer" ] + + deps = [ + ":memconsumer_apk_resources", + "//base:base_java", + ] +} + +shared_library("libmemconsumer") { + output_name = "memconsumer" + sources = [ + "memconsumer_hook.cc", + ] + libs = [ "log" ] + configs -= [ "//build/config/android:hide_native_jni_exports" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] +} diff --git a/chromium/tools/android/memdump/BUILD.gn b/chromium/tools/android/memdump/BUILD.gn new file mode 100644 index 00000000000..dafc7ec1d6f --- /dev/null +++ b/chromium/tools/android/memdump/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("memdump") { + sources = [ + "memdump.cc", + ] + deps = [ + "//base", + ] +} diff --git a/chromium/tools/android/memtrack_helper/BUILD.gn b/chromium/tools/android/memtrack_helper/BUILD.gn new file mode 100644 index 00000000000..5948cb57588 --- /dev/null +++ b/chromium/tools/android/memtrack_helper/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Unwind tables create a dependency on libc++. By removing them +# the final binary will not require anything more than libc and libdl. +# This makes its deployment easier in component=shared_library mode. +config("android_binary_no_libcpp_config") { + cflags = [ + "-fno-unwind-tables", + "-fno-asynchronous-unwind-tables", + ] +} + +executable("memtrack_helper") { + sources = [ + "memtrack_helper.c", + "memtrack_helper.h", + ] + configs += [ ":android_binary_no_libcpp_config" ] +} + +executable("memtrack_helper_test_client") { + sources = [ + "memtrack_helper.h", + "memtrack_helper_test_client.c", + ] + configs += [ ":android_binary_no_libcpp_config" ] +} diff --git a/chromium/tools/android/ps_ext/BUILD.gn b/chromium/tools/android/ps_ext/BUILD.gn new file mode 100644 index 00000000000..6fbba19a203 --- /dev/null +++ b/chromium/tools/android/ps_ext/BUILD.gn @@ -0,0 +1,9 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("ps_ext") { + sources = [ + "ps_ext.c", + ] +} diff --git a/chromium/tools/android/purge_ashmem/BUILD.gn b/chromium/tools/android/purge_ashmem/BUILD.gn new file mode 100644 index 00000000000..e717fb137f6 --- /dev/null +++ b/chromium/tools/android/purge_ashmem/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("purge_ashmem") { + sources = [ + "purge_ashmem.c", + ] + deps = [ + "//third_party/ashmem", + ] +} diff --git a/chromium/tools/android/push_apps_to_background/BUILD.gn b/chromium/tools/android/push_apps_to_background/BUILD.gn new file mode 100644 index 00000000000..cd90aa39b8e --- /dev/null +++ b/chromium/tools/android/push_apps_to_background/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# 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("//testing/test.gni") + +# Mark all targets as test only. +testonly = true + +android_apk("push_apps_to_background_apk") { + apk_name = "PushAppsToBackground" + java_files = [ "src/org/chromium/push_apps_to_background/PushAppsToBackgroundActivity.java" ] + android_manifest = "AndroidManifest.xml" + deps = [ + ":push_apps_to_background_apk_resources", + ] +} + +android_resources("push_apps_to_background_apk_resources") { + resource_dirs = [ "res" ] + custom_package = "org.chromium.push_apps_to_background" +} diff --git a/chromium/tools/json_schema_compiler/test/BUILD.gn b/chromium/tools/json_schema_compiler/test/BUILD.gn new file mode 100644 index 00000000000..22a23af979a --- /dev/null +++ b/chromium/tools/json_schema_compiler/test/BUILD.gn @@ -0,0 +1,49 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/json_schema_api.gni") + +json_schema_api("api") { + visibility = [ ":*" ] + + sources = [ + "additional_properties.json", + "any.json", + "arrays.json", + "callbacks.json", + "choices.json", + "crossref.json", + "enums.json", + "error_generation.json", + "functions_as_parameters.json", + "functions_on_types.json", + "idl_basics.idl", + "idl_object_types.idl", + "idl_other_namespace.idl", + "idl_other_namespace_sub_namespace.idl", + "objects.json", + "objects_movable.idl", + "objects_movable_json.json", + "simple_api.json", + ] + + schemas = true + root_namespace = "test::api::%(namespace)s" +} + +source_set("test") { + testonly = true + sources = [ + "test_util.cc", + "test_util.h", + ] + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + public_deps = [ + ":api", + "//base", + ] +} diff --git a/chromium/tools/perf/BUILD.gn b/chromium/tools/perf/BUILD.gn new file mode 100644 index 00000000000..333907bafd5 --- /dev/null +++ b/chromium/tools/perf/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("perf") { + testonly = true + deps = [ + "//tools/perf/chrome_telemetry_build:telemetry_chrome_test", + ] + + data = [ + "//tools/perf/", + + # Field trial config + "//tools/variations/", + "//testing/variations/", + ] +} + +if (is_android) { + import("//build/config/android/rules.gni") + + wrapper_script("run_benchmark_wrapper") { + target = "run_benchmark" + flag_name = "--chromium-output-directory" + } +} diff --git a/chromium/tools/perf/chrome_telemetry_build/BUILD.gn b/chromium/tools/perf/chrome_telemetry_build/BUILD.gn new file mode 100644 index 00000000000..d5663bd6728 --- /dev/null +++ b/chromium/tools/perf/chrome_telemetry_build/BUILD.gn @@ -0,0 +1,90 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/compiler/compiler.gni") + +if (is_win) { + action("copy_cdb_to_output") { + script = "//build/win/copy_cdb_to_output.py" + inputs = [ + script, + ] + outputs = [ + "$root_out_dir/cdb/cdb.exe", + "$root_out_dir/cdb/dbgeng.dll", + "$root_out_dir/cdb/dbghelp.dll", + "$root_out_dir/cdb/dbgmodel.dll", + "$root_out_dir/cdb/winext/ext.dll", + "$root_out_dir/cdb/winext/uext.dll", + "$root_out_dir/cdb/winxp/exts.dll", + "$root_out_dir/cdb/winxp/ntsdexts.dll", + ] + args = [ + rebase_path("$root_out_dir/cdb", root_out_dir), + current_cpu, + ] + } +} + +group("telemetry_chrome_test") { + testonly = true + + if (is_android) { + data_deps = [ + "//chrome/android:chrome_public_apk", + ] + } else { + data_deps = [ + "//third_party/catapult/telemetry:bitmaptools", + ] + + data_deps += [ "//chrome" ] + } + + data = [ + "//tools/perf/chrome_telemetry_build/", + "//third_party/catapult/", + "//components/crash/content/tools/generate_breakpad_symbols.py", + ] + + if (is_win) { + data_deps += [ "//chrome:reorder_imports" ] + } + + if (is_linux) { + data_deps += [ + "//tools/xdisplaycheck", + "//breakpad:dump_syms($host_toolchain)", + ] + } + + if (is_mac) { + data_deps += [ + "//breakpad:dump_syms", + "//chrome:chrome_framework", + "//chrome:chrome_helper_app", + "//third_party/crashpad/crashpad/tools:crashpad_database_util", + ] + } + + if (is_win && (symbol_level == 1 || symbol_level == 2)) { + data_deps += [ + ":copy_cdb_to_output", + "//third_party/crashpad/crashpad/tools:crashpad_database_util", + ] + + # TODO(GYP): These should be provided automatically through data_deps. + data += [ "$root_out_dir/chrome.exe.pdb" ] + if (is_component_build) { + data += [ + "$root_out_dir/base.dll.pdb", + "$root_out_dir/blink_platform.dll.pdb", + "$root_out_dir/blink_web.dll.pdb", + "$root_out_dir/content.dll.pdb", + ] + } else { + data += [ "$root_out_dir/chrome_child.dll.pdb" ] + } + } +} diff --git a/chromium/tools/perf/clear_system_cache/BUILD.gn b/chromium/tools/perf/clear_system_cache/BUILD.gn new file mode 100644 index 00000000000..3072d32285d --- /dev/null +++ b/chromium/tools/perf/clear_system_cache/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +executable("clear_system_cache") { + testonly = true + + sources = [ + "clear_system_cache_main.cc", + ] + + deps = [ + "//base", + "//base/test:test_support", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} diff --git a/chromium/ui/app_list/BUILD.gn b/chromium/ui/app_list/BUILD.gn new file mode 100644 index 00000000000..2fc27286a87 --- /dev/null +++ b/chromium/ui/app_list/BUILD.gn @@ -0,0 +1,340 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//testing/test.gni") + +component("app_list") { + sources = [ + "app_list_constants.cc", + "app_list_constants.h", + "app_list_export.h", + "app_list_folder_item.cc", + "app_list_folder_item.h", + "app_list_item.cc", + "app_list_item.h", + "app_list_item_list.cc", + "app_list_item_list.h", + "app_list_item_list_observer.h", + "app_list_item_observer.h", + "app_list_menu.cc", + "app_list_menu.h", + "app_list_model.cc", + "app_list_model.h", + "app_list_model_observer.h", + "app_list_switches.cc", + "app_list_switches.h", + "app_list_view_delegate.cc", + "app_list_view_delegate.h", + "folder_image.cc", + "folder_image.h", + "pagination_controller.cc", + "pagination_controller.h", + "pagination_model.cc", + "pagination_model.h", + "pagination_model_observer.h", + "search/dictionary_data_store.cc", + "search/dictionary_data_store.h", + "search/history.cc", + "search/history.h", + "search/history_data.cc", + "search/history_data.h", + "search/history_data_store.cc", + "search/history_data_store.h", + "search/history_types.h", + "search/mixer.cc", + "search/mixer.h", + "search/term_break_iterator.cc", + "search/term_break_iterator.h", + "search/tokenized_string.cc", + "search/tokenized_string.h", + "search/tokenized_string_char_iterator.cc", + "search/tokenized_string_char_iterator.h", + "search/tokenized_string_match.cc", + "search/tokenized_string_match.h", + "search_box_model.cc", + "search_box_model.h", + "search_box_model_observer.h", + "search_controller.cc", + "search_controller.h", + "search_provider.cc", + "search_provider.h", + "search_result.cc", + "search_result.h", + "speech_ui_model.cc", + "speech_ui_model.h", + "speech_ui_model_observer.h", + ] + + defines = [ "APP_LIST_IMPLEMENTATION" ] + + deps = [ + "//base", + "//base:i18n", + "//base/third_party/dynamic_annotations", + "//components/keyed_service/core", + "//skia", + "//sync", + "//third_party/icu", + "//ui/accessibility", + "//ui/app_list/resources", + "//ui/base", + "//ui/base/ime", + "//ui/compositor", + "//ui/display", + "//ui/events", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/resources", + "//ui/strings", + ] + + if (use_aura) { + deps += [ + "//ui/aura", + "//ui/wm", + ] + } + + if (toolkit_views) { + sources += [ + "views/all_apps_tile_item_view.cc", + "views/all_apps_tile_item_view.h", + "views/app_list_background.cc", + "views/app_list_background.h", + "views/app_list_drag_and_drop_host.h", + "views/app_list_folder_view.cc", + "views/app_list_folder_view.h", + "views/app_list_item_view.cc", + "views/app_list_item_view.h", + "views/app_list_main_view.cc", + "views/app_list_main_view.h", + "views/app_list_menu_views.cc", + "views/app_list_menu_views.h", + "views/app_list_page.cc", + "views/app_list_page.h", + "views/app_list_view.cc", + "views/app_list_view.h", + "views/app_list_view_observer.h", + "views/apps_container_view.cc", + "views/apps_container_view.h", + "views/apps_grid_view.cc", + "views/apps_grid_view.h", + "views/apps_grid_view_delegate.h", + "views/apps_grid_view_folder_delegate.h", + "views/cached_label.cc", + "views/cached_label.h", + "views/contents_view.cc", + "views/contents_view.h", + "views/custom_launcher_page_view.cc", + "views/custom_launcher_page_view.h", + "views/folder_background_view.cc", + "views/folder_background_view.h", + "views/folder_header_view.cc", + "views/folder_header_view.h", + "views/folder_header_view_delegate.h", + "views/image_shadow_animator.cc", + "views/image_shadow_animator.h", + "views/page_switcher.cc", + "views/page_switcher.h", + "views/progress_bar_view.cc", + "views/progress_bar_view.h", + "views/pulsing_block_view.cc", + "views/pulsing_block_view.h", + "views/search_box_view.cc", + "views/search_box_view.h", + "views/search_box_view_delegate.h", + "views/search_result_actions_view.cc", + "views/search_result_actions_view.h", + "views/search_result_container_view.cc", + "views/search_result_container_view.h", + "views/search_result_list_view.cc", + "views/search_result_list_view.h", + "views/search_result_list_view_delegate.h", + "views/search_result_page_view.cc", + "views/search_result_page_view.h", + "views/search_result_tile_item_list_view.cc", + "views/search_result_tile_item_list_view.h", + "views/search_result_tile_item_view.cc", + "views/search_result_tile_item_view.h", + "views/search_result_view.cc", + "views/search_result_view.h", + "views/speech_view.cc", + "views/speech_view.h", + "views/start_page_view.cc", + "views/start_page_view.h", + "views/tile_item_view.cc", + "views/tile_item_view.h", + "views/top_icon_animation_view.cc", + "views/top_icon_animation_view.h", + ] + deps += [ + "//ui/events", + "//ui/views", + ] + + public_deps = [ + "//ui/views", + ] + } + + if (is_mac) { + sources += [ + "cocoa/app_list_pager_view.h", + "cocoa/app_list_pager_view.mm", + "cocoa/app_list_view_controller.h", + "cocoa/app_list_view_controller.mm", + "cocoa/app_list_window_controller.h", + "cocoa/app_list_window_controller.mm", + "cocoa/apps_collection_view_drag_manager.h", + "cocoa/apps_collection_view_drag_manager.mm", + "cocoa/apps_grid_controller.h", + "cocoa/apps_grid_controller.mm", + "cocoa/apps_grid_view_item.h", + "cocoa/apps_grid_view_item.mm", + "cocoa/apps_pagination_model_observer.h", + "cocoa/apps_search_box_controller.h", + "cocoa/apps_search_box_controller.mm", + "cocoa/apps_search_results_controller.h", + "cocoa/apps_search_results_controller.mm", + "cocoa/apps_search_results_model_bridge.h", + "cocoa/apps_search_results_model_bridge.mm", + "cocoa/item_drag_controller.h", + "cocoa/item_drag_controller.mm", + "cocoa/scroll_view_with_no_scrollbars.h", + "cocoa/scroll_view_with_no_scrollbars.mm", + ] + deps += [ "//third_party/google_toolbox_for_mac" ] + libs = [ + "AppKit.framework", + "QuartzCore.framework", + ] + } +} + +static_library("test_support") { + sources = [ + "test/app_list_test_model.cc", + "test/app_list_test_model.h", + "test/app_list_test_view_delegate.cc", + "test/app_list_test_view_delegate.h", + "test/test_search_result.cc", + "test/test_search_result.h", + ] + + deps = [ + ":app_list", + "//base", + "//ui/gfx", + "//ui/gfx/geometry", + ] +} + +if (toolkit_views) { + executable("app_list_demo") { + testonly = true + + sources = [ + "demo/app_list_demo_views.cc", + ] + + deps = [ + ":app_list", + ":test_support", + "//base", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//content", + "//content/public/browser", + "//skia", + "//ui/base", + "//ui/events", + "//ui/resources", + "//ui/resources:ui_test_pak", + "//ui/views", + "//ui/views/controls/webview", + "//ui/views_content_client", + "//url", + ] + if (is_win) { + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + + deps += [ + "//content:sandbox_helper_win", + "//sandbox", + ] + } + } +} + +test("app_list_unittests") { + sources = [ + "app_list_item_list_unittest.cc", + "app_list_model_unittest.cc", + "folder_image_unittest.cc", + "pagination_model_unittest.cc", + "search/history_data_store_unittest.cc", + "search/mixer_unittest.cc", + "search/term_break_iterator_unittest.cc", + "search/tokenized_string_char_iterator_unittest.cc", + "search/tokenized_string_match_unittest.cc", + "search/tokenized_string_unittest.cc", + "test/run_all_unittests.cc", + ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":app_list", + ":test_support", + "//base", + "//base/test:test_support", + "//skia", + "//testing/gtest", + "//ui/base", + "//ui/compositor", + "//ui/events:test_support", + "//ui/gfx:test_support", + "//ui/gl:test_support", + "//ui/resources", + ] + + data_deps = [ + "//third_party/mesa:osmesa", + "//ui/resources:ui_test_pak_data", + ] + + if (toolkit_views) { + sources += [ + "views/app_list_main_view_unittest.cc", + "views/app_list_view_unittest.cc", + "views/apps_grid_view_unittest.cc", + "views/folder_header_view_unittest.cc", + "views/image_shadow_animator_unittest.cc", + "views/search_box_view_unittest.cc", + "views/search_result_list_view_unittest.cc", + "views/search_result_page_view_unittest.cc", + "views/speech_view_unittest.cc", + "views/test/apps_grid_view_test_api.cc", + "views/test/apps_grid_view_test_api.h", + ] + deps += [ + "//ui/views", + "//ui/views:test_support", + ] + } + + if (is_mac) { + sources += [ + "cocoa/app_list_view_controller_unittest.mm", + "cocoa/app_list_window_controller_unittest.mm", + "cocoa/apps_grid_controller_unittest.mm", + "cocoa/apps_search_box_controller_unittest.mm", + "cocoa/apps_search_results_controller_unittest.mm", + "cocoa/test/apps_grid_controller_test_helper.h", + "cocoa/test/apps_grid_controller_test_helper.mm", + ] + } +} diff --git a/chromium/ui/app_list/presenter/BUILD.gn b/chromium/ui/app_list/presenter/BUILD.gn new file mode 100644 index 00000000000..fd6cb444b4f --- /dev/null +++ b/chromium/ui/app_list/presenter/BUILD.gn @@ -0,0 +1,96 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/ui.gni") +import("//mojo/public/tools/bindings/mojom.gni") +import("//testing/test.gni") + +assert(use_aura) + +component("presenter") { + sources = [ + "app_list_presenter.h", + "app_list_presenter_delegate.cc", + "app_list_presenter_delegate.h", + "app_list_presenter_delegate_factory.h", + "app_list_presenter_export.h", + "app_list_presenter_impl.cc", + "app_list_presenter_impl.h", + "app_list_view_delegate_factory.cc", + "app_list_view_delegate_factory.h", + ] + + defines = [ "APP_LIST_PRESENTER_IMPLEMENTATION" ] + + public_deps = [ + "//base", + "//ui/app_list", + "//ui/aura", + "//ui/compositor", + "//ui/gfx/geometry", + "//ui/views", + + # Temporary dependency to fix compile flake in http://crbug.com/611898. + # TODO(tapted): Remove once http://crbug.com/612382 is fixed. + "//ui/accessibility:ax_gen", + ] +} + +mojom("mojom") { + sources = [ + "app_list_presenter.mojom", + ] + deps = [ + "//components/mus/public/interfaces", + ] +} + +source_set("test_support") { + sources = [ + "test/app_list_presenter_impl_test_api.cc", + "test/app_list_presenter_impl_test_api.h", + + # Temporary dependency to fix compile flake in http://crbug.com/611898. + # TODO(tapted): Remove once http://crbug.com/612382 is fixed. + "//ui/accessibility:ax_gen", + ] + + public_deps = [ + ":presenter", + ] + deps = [ + "//base", + ] +} + +test("app_list_presenter_unittests") { + sources = [ + "app_list_presenter_impl_unittest.cc", + "test/run_all_unittests.cc", + ] + + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + deps = [ + ":presenter", + ":test_support", + "//base", + "//base/test:test_support", + "//testing/gtest", + "//ui/app_list:test_support", + "//ui/aura:aura", + "//ui/aura:test_support", + "//ui/base", + "//ui/gl:test_support", + "//ui/wm:wm", + + # Temporary dependency to fix compile flake in http://crbug.com/611898. + # TODO(tapted): Remove once http://crbug.com/612382 is fixed. + "//ui/accessibility:ax_gen", + ] + + data_deps = [ + "//ui/resources:ui_test_pak_data", + ] +} diff --git a/chromium/ui/app_list/presenter/app_list_presenter.mojom b/chromium/ui/app_list/presenter/app_list_presenter.mojom new file mode 100644 index 00000000000..0c4fe292932 --- /dev/null +++ b/chromium/ui/app_list/presenter/app_list_presenter.mojom @@ -0,0 +1,19 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module app_list.mojom; + +import "components/mus/public/interfaces/window_manager_constants.mojom"; + +interface AppListPresenter { + // Show the app list on the specified display. + Show(int64 display_id); + + // Dismiss the app list. + Dismiss(); + + // Show the app list (on the specified display) if it is hidden; hide the + // app list if it is shown. + ToggleAppList(int64 display_id); +}; diff --git a/chromium/ui/app_list/resources/BUILD.gn b/chromium/ui/app_list/resources/BUILD.gn new file mode 100644 index 00000000000..d42b3e763ff --- /dev/null +++ b/chromium/ui/app_list/resources/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") +import("//tools/grit/repack.gni") + +group("resources") { + public_deps = [ + ":resources_grd", + ] +} + +grit("resources_grd") { + source = "app_list_resources.grd" + outputs = [ + "grit/app_list_resources.h", + "grit/app_list_resources_map.cc", + "grit/app_list_resources_map.h", + "app_list_resources_100_percent.pak", + "app_list_resources_200_percent.pak", + "app_list_resources_300_percent.pak", + ] +} diff --git a/chromium/ui/chromeos/BUILD.gn b/chromium/ui/chromeos/BUILD.gn new file mode 100644 index 00000000000..69fd5c6f64d --- /dev/null +++ b/chromium/ui/chromeos/BUILD.gn @@ -0,0 +1,97 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//testing/test.gni") + +component("ui_chromeos") { + sources = [ + "accelerometer/accelerometer_util.cc", + "accelerometer/accelerometer_util.h", + "ime/candidate_view.cc", + "ime/candidate_view.h", + "ime/candidate_window_view.cc", + "ime/candidate_window_view.h", + "ime/infolist_window.cc", + "ime/infolist_window.h", + "ime/input_method_menu_item.cc", + "ime/input_method_menu_item.h", + "ime/input_method_menu_manager.cc", + "ime/input_method_menu_manager.h", + "ime/mode_indicator_view.cc", + "ime/mode_indicator_view.h", + "material_design_icon_controller.cc", + "material_design_icon_controller.h", + "network/network_connect.cc", + "network/network_connect.h", + "network/network_icon.cc", + "network/network_icon.h", + "network/network_icon_animation.cc", + "network/network_icon_animation.h", + "network/network_icon_animation_observer.h", + "network/network_info.cc", + "network/network_info.h", + "network/network_list.cc", + "network/network_list.h", + "network/network_list_delegate.h", + "network/network_list_view_base.cc", + "network/network_list_view_base.h", + "network/network_state_notifier.cc", + "network/network_state_notifier.h", + "touch_exploration_controller.cc", + "touch_exploration_controller.h", + "user_activity_power_manager_notifier.cc", + "user_activity_power_manager_notifier.h", + ] + defines = [ "UI_CHROMEOS_IMPLEMENTATION" ] + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//chromeos:chromeos", + "//chromeos:power_manager_proto", + "//components/device_event_log", + "//components/onc", + "//skia", + "//ui/aura", + "//ui/base", + "//ui/base/ime", + "//ui/chromeos/resources", + "//ui/chromeos/strings", + "//ui/display", + "//ui/events", + "//ui/events:gesture_detection", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/message_center", + "//ui/native_theme", + "//ui/views", + "//ui/wm", + ] +} + +test("ui_chromeos_unittests") { + sources = [ + "ime/candidate_view_unittest.cc", + "ime/candidate_window_view_unittest.cc", + "ime/input_method_menu_item_unittest.cc", + "ime/input_method_menu_manager_unittest.cc", + "network/network_state_notifier_unittest.cc", + "run_all_unittests.cc", + "touch_exploration_controller_unittest.cc", + ] + deps = [ + ":ui_chromeos", + "//base/test:test_support", + "//chromeos", + "//skia", + "//testing/gtest", + "//ui/aura:test_support", + "//ui/compositor", + "//ui/events:test_support", + "//ui/gl:test_support", + "//ui/message_center", + "//ui/resources:ui_test_pak", + "//ui/views", + "//ui/views:test_support", + ] +} diff --git a/chromium/ui/chromeos/resources/BUILD.gn b/chromium/ui/chromeos/resources/BUILD.gn new file mode 100644 index 00000000000..7f278402bb9 --- /dev/null +++ b/chromium/ui/chromeos/resources/BUILD.gn @@ -0,0 +1,16 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +grit("resources") { + source = "ui_chromeos_resources.grd" + outputs = [ + "grit/ui_chromeos_resources.h", + "grit/ui_chromeos_resources_map.cc", + "grit/ui_chromeos_resources_map.h", + "ui_chromeos_resources_100_percent.pak", + "ui_chromeos_resources_200_percent.pak", + ] +} diff --git a/chromium/ui/chromeos/strings/BUILD.gn b/chromium/ui/chromeos/strings/BUILD.gn new file mode 100644 index 00000000000..c6d41f524c1 --- /dev/null +++ b/chromium/ui/chromeos/strings/BUILD.gn @@ -0,0 +1,66 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +grit("strings") { + source = "../ui_chromeos_strings.grd" + outputs = [ + "grit/ui_chromeos_strings.h", + "ui_chromeos_strings_am.pak", + "ui_chromeos_strings_ar.pak", + "ui_chromeos_strings_bg.pak", + "ui_chromeos_strings_bn.pak", + "ui_chromeos_strings_ca.pak", + "ui_chromeos_strings_cs.pak", + "ui_chromeos_strings_da.pak", + "ui_chromeos_strings_de.pak", + "ui_chromeos_strings_el.pak", + "ui_chromeos_strings_en-GB.pak", + "ui_chromeos_strings_en-US.pak", + "ui_chromeos_strings_es-419.pak", + "ui_chromeos_strings_es.pak", + "ui_chromeos_strings_et.pak", + "ui_chromeos_strings_fake-bidi.pak", + "ui_chromeos_strings_fa.pak", + "ui_chromeos_strings_fil.pak", + "ui_chromeos_strings_fi.pak", + "ui_chromeos_strings_fr.pak", + "ui_chromeos_strings_gu.pak", + "ui_chromeos_strings_he.pak", + "ui_chromeos_strings_hi.pak", + "ui_chromeos_strings_hr.pak", + "ui_chromeos_strings_hu.pak", + "ui_chromeos_strings_id.pak", + "ui_chromeos_strings_it.pak", + "ui_chromeos_strings_ja.pak", + "ui_chromeos_strings_kn.pak", + "ui_chromeos_strings_ko.pak", + "ui_chromeos_strings_lt.pak", + "ui_chromeos_strings_lv.pak", + "ui_chromeos_strings_ml.pak", + "ui_chromeos_strings_mr.pak", + "ui_chromeos_strings_ms.pak", + "ui_chromeos_strings_nb.pak", + "ui_chromeos_strings_nl.pak", + "ui_chromeos_strings_pl.pak", + "ui_chromeos_strings_pt-BR.pak", + "ui_chromeos_strings_pt-PT.pak", + "ui_chromeos_strings_ro.pak", + "ui_chromeos_strings_ru.pak", + "ui_chromeos_strings_sk.pak", + "ui_chromeos_strings_sl.pak", + "ui_chromeos_strings_sr.pak", + "ui_chromeos_strings_sv.pak", + "ui_chromeos_strings_sw.pak", + "ui_chromeos_strings_ta.pak", + "ui_chromeos_strings_te.pak", + "ui_chromeos_strings_th.pak", + "ui_chromeos_strings_tr.pak", + "ui_chromeos_strings_uk.pak", + "ui_chromeos_strings_vi.pak", + "ui_chromeos_strings_zh-CN.pak", + "ui_chromeos_strings_zh-TW.pak", + ] +} diff --git a/chromium/ui/file_manager/BUILD.gn b/chromium/ui/file_manager/BUILD.gn new file mode 100644 index 00000000000..369a695a25b --- /dev/null +++ b/chromium/ui/file_manager/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//tools/grit/grit_rule.gni") + +grit("resources") { + source = "file_manager_resources.grd" + outputs = [ + "grit/file_manager_resources.h", + "grit/file_manager_resources_map.cc", + "grit/file_manager_resources_map.h", + "file_manager_resources.pak", + "file_manager_resources.rc", + ] +} + +component("file_manager") { + sources = [ + "file_manager_export.h", + "file_manager_resource_util.cc", + "file_manager_resource_util.h", + ] + deps = [ + ":resources", + "//base", + ] + defines = [ "FILE_MANAGER_IMPLEMENTATION" ] +} diff --git a/chromium/v8/test/BUILD.gn b/chromium/v8/test/BUILD.gn new file mode 100644 index 00000000000..271df0d6efd --- /dev/null +++ b/chromium/v8/test/BUILD.gn @@ -0,0 +1,203 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../gni/isolate.gni") + +group("gn_all") { + testonly = true + + deps = [ + ":default_tests", + ] + + if (host_os != "mac" || !is_android) { + # These items don't compile for Android on Mac. + deps += [ + "cctest:cctest", + "cctest:generate-bytecode-expectations", + "unittests:unittests", + ] + } + + if (v8_test_isolation_mode != "noop") { + deps += [ + ":bot_default_run", + ":benchmarks_run", + ":default_run", + ":mozilla_run", + ":simdjs_run", + "test262:test262_run", + ] + } +} + +############################################################################### +# Test groups +# + +group("default_tests") { + testonly = true + + if (v8_test_isolation_mode != "noop") { + deps = [ + ":cctest_run", + ":fuzzer_run", + ":intl_run", + ":message_run", + ":mjsunit_run", + ":preparser_run", + ":unittests_run", + ] + } +} + +v8_isolate_run("bot_default") { + deps = [ + ":default_tests", + ":webkit_run", + ] + + isolate = "bot_default.isolate" +} + +v8_isolate_run("default") { + deps = [ + ":default_tests", + ] + + isolate = "default.isolate" +} + +v8_isolate_run("ignition") { + deps = [ + ":cctest_run", + ":mjsunit_run", + ] + + isolate = "ignition.isolate" +} + +v8_isolate_run("optimize_for_size") { + deps = [ + ":cctest_run", + ":intl_run", + ":mjsunit_run", + ":webkit_run", + ] + + isolate = "optimize_for_size.isolate" +} + +v8_isolate_run("perf") { + deps = [ + ":cctest_exe_run", + "..:d8_run", + ] + + isolate = "perf.isolate" +} + +############################################################################### +# Subtests +# + +v8_isolate_run("benchmarks") { + deps = [ + "..:d8_run", + ] + + isolate = "benchmarks/benchmarks.isolate" +} + +v8_isolate_run("cctest") { + deps = [ + ":cctest_exe_run", + ] + + isolate = "cctest/cctest.isolate" +} + +v8_isolate_run("cctest_exe") { + deps = [ + "cctest:cctest", + ] + + isolate = "cctest/cctest_exe.isolate" +} + +v8_isolate_run("fuzzer") { + deps = [ + "..:v8_simple_json_fuzzer", + "..:v8_simple_parser_fuzzer", + "..:v8_simple_regexp_fuzzer", + "..:v8_simple_wasm_fuzzer", + "..:v8_simple_wasm_asmjs_fuzzer", + ] + + isolate = "fuzzer/fuzzer.isolate" +} + +v8_isolate_run("intl") { + deps = [ + "..:d8_run", + ] + + isolate = "intl/intl.isolate" +} + +v8_isolate_run("message") { + deps = [ + "..:d8_run", + ] + + isolate = "message/message.isolate" +} + +v8_isolate_run("mjsunit") { + deps = [ + "..:d8_run", + ] + + isolate = "mjsunit/mjsunit.isolate" +} + +v8_isolate_run("mozilla") { + deps = [ + "..:d8_run", + ] + + isolate = "mozilla/mozilla.isolate" +} + +v8_isolate_run("preparser") { + deps = [ + "..:d8_run", + ] + + isolate = "preparser/preparser.isolate" +} + +v8_isolate_run("simdjs") { + deps = [ + "..:d8_run", + ] + + isolate = "simdjs/simdjs.isolate" +} + +v8_isolate_run("unittests") { + deps = [ + "unittests:unittests", + ] + + isolate = "unittests/unittests.isolate" +} + +v8_isolate_run("webkit") { + deps = [ + "..:d8_run", + ] + + isolate = "webkit/webkit.isolate" +} diff --git a/chromium/v8/test/cctest/BUILD.gn b/chromium/v8/test/cctest/BUILD.gn new file mode 100644 index 00000000000..38738b70ef4 --- /dev/null +++ b/chromium/v8/test/cctest/BUILD.gn @@ -0,0 +1,402 @@ +# Copyright 2016 The V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Please keep this file in sync with cctest.gyp. + +import("../../gni/v8.gni") + +v8_executable("cctest") { + testonly = true + + sources = [ + "$target_gen_dir/resources.cc", + "cctest.cc", + "compiler/c-signature.h", + "compiler/code-assembler-tester.h", + "compiler/codegen-tester.cc", + "compiler/codegen-tester.h", + "compiler/function-tester.h", + "compiler/graph-builder-tester.h", + "compiler/test-basic-block-profiler.cc", + "compiler/test-branch-combine.cc", + "compiler/test-code-assembler.cc", + "compiler/test-gap-resolver.cc", + "compiler/test-graph-visualizer.cc", + "compiler/test-instruction.cc", + "compiler/test-js-constant-cache.cc", + "compiler/test-js-context-specialization.cc", + "compiler/test-js-typed-lowering.cc", + "compiler/test-jump-threading.cc", + "compiler/test-linkage.cc", + "compiler/test-loop-analysis.cc", + "compiler/test-loop-assignment-analysis.cc", + "compiler/test-machine-operator-reducer.cc", + "compiler/test-multiple-return.cc", + "compiler/test-node.cc", + "compiler/test-operator.cc", + "compiler/test-osr.cc", + "compiler/test-representation-change.cc", + "compiler/test-run-bytecode-graph-builder.cc", + "compiler/test-run-calls-to-external-references.cc", + "compiler/test-run-deopt.cc", + "compiler/test-run-inlining.cc", + "compiler/test-run-intrinsics.cc", + "compiler/test-run-jsbranches.cc", + "compiler/test-run-jscalls.cc", + "compiler/test-run-jsexceptions.cc", + "compiler/test-run-jsobjects.cc", + "compiler/test-run-jsops.cc", + "compiler/test-run-load-store.cc", + "compiler/test-run-machops.cc", + "compiler/test-run-native-calls.cc", + "compiler/test-run-stackcheck.cc", + "compiler/test-run-stubs.cc", + "compiler/test-run-variables.cc", + "compiler/test-run-wasm-machops.cc", + "compiler/test-simplified-lowering.cc", + "expression-type-collector.cc", + "expression-type-collector.h", + "gay-fixed.cc", + "gay-precision.cc", + "gay-shortest.cc", + "heap/heap-tester.h", + "heap/heap-utils.cc", + "heap/heap-utils.h", + "heap/test-alloc.cc", + "heap/test-array-buffer-tracker.cc", + "heap/test-compaction.cc", + "heap/test-heap.cc", + "heap/test-incremental-marking.cc", + "heap/test-lab.cc", + "heap/test-mark-compact.cc", + "heap/test-page-promotion.cc", + "heap/test-spaces.cc", + "interpreter/bytecode-expectations-printer.cc", + "interpreter/bytecode-expectations-printer.h", + "interpreter/interpreter-tester.cc", + "interpreter/source-position-matcher.cc", + "interpreter/source-position-matcher.h", + "interpreter/test-bytecode-generator.cc", + "interpreter/test-interpreter-intrinsics.cc", + "interpreter/test-interpreter.cc", + "interpreter/test-source-positions.cc", + "libsampler/test-sampler.cc", + "print-extension.cc", + "profiler-extension.cc", + "test-access-checks.cc", + "test-accessors.cc", + "test-api-accessors.cc", + "test-api-fast-accessor-builder.cc", + "test-api-interceptors.cc", + "test-api.cc", + "test-api.h", + "test-array-list.cc", + "test-asm-validator.cc", + "test-ast-expression-visitor.cc", + "test-ast.cc", + "test-atomicops.cc", + "test-bignum-dtoa.cc", + "test-bignum.cc", + "test-bit-vector.cc", + "test-circular-queue.cc", + "test-code-cache.cc", + "test-code-layout.cc", + "test-code-stub-assembler.cc", + "test-compiler.cc", + "test-constantpool.cc", + "test-conversions.cc", + "test-cpu-profiler.cc", + "test-date.cc", + "test-debug.cc", + "test-decls.cc", + "test-deoptimization.cc", + "test-dictionary.cc", + "test-diy-fp.cc", + "test-double.cc", + "test-dtoa.cc", + "test-eh-frame-hdr.cc", + "test-elements-kind.cc", + "test-fast-dtoa.cc", + "test-feedback-vector.cc", + "test-field-type-tracking.cc", + "test-fixed-dtoa.cc", + "test-flags.cc", + "test-func-name-inference.cc", + "test-global-handles.cc", + "test-global-object.cc", + "test-hashing.cc", + "test-hashmap.cc", + "test-heap-profiler.cc", + "test-hydrogen-types.cc", + "test-identity-map.cc", + "test-inobject-slack-tracking.cc", + "test-list.cc", + "test-liveedit.cc", + "test-lockers.cc", + "test-log.cc", + "test-mementos.cc", + "test-parsing.cc", + "test-platform.cc", + "test-profile-generator.cc", + "test-random-number-generator.cc", + "test-receiver-check-hidden-prototype.cc", + "test-regexp.cc", + "test-reloc-info.cc", + "test-representation.cc", + "test-sampler-api.cc", + "test-serialize.cc", + "test-simd.cc", + "test-strings.cc", + "test-strtod.cc", + "test-symbols.cc", + "test-thread-termination.cc", + "test-threads.cc", + "test-trace-event.cc", + "test-transitions.cc", + "test-typedarrays.cc", + "test-types.cc", + "test-unbound-queue.cc", + "test-unboxed-doubles.cc", + "test-unique.cc", + "test-unscopables-hidden-prototype.cc", + "test-usecounters.cc", + "test-utils.cc", + "test-version.cc", + "test-weakmaps.cc", + "test-weaksets.cc", + "trace-extension.cc", + "wasm/test-run-wasm-64.cc", + "wasm/test-run-wasm-asmjs.cc", + "wasm/test-run-wasm-interpreter.cc", + "wasm/test-run-wasm-js.cc", + "wasm/test-run-wasm-module.cc", + "wasm/test-run-wasm-relocation.cc", + "wasm/test-run-wasm.cc", + "wasm/test-signatures.h", + "wasm/test-wasm-function-name-table.cc", + "wasm/test-wasm-stack.cc", + "wasm/test-wasm-trap-position.cc", + "wasm/wasm-run-utils.h", + ] + + if (v8_target_cpu == "arm") { + sources += [ + "test-assembler-arm.cc", + "test-code-stubs-arm.cc", + "test-code-stubs.cc", + "test-disasm-arm.cc", + "test-macro-assembler-arm.cc", + "test-run-wasm-relocation-arm.cc", + ] + } else if (v8_target_cpu == "arm64") { + sources += [ + "test-assembler-arm64.cc", + "test-code-stubs-arm64.cc", + "test-code-stubs.cc", + "test-disasm-arm64.cc", + "test-fuzz-arm64.cc", + "test-javascript-arm64.cc", + "test-js-arm64-variables.cc", + "test-run-wasm-relocation-arm64.cc", + "test-utils-arm64.cc", + ] + } else if (v8_target_cpu == "x86") { + sources += [ + "test-assembler-ia32.cc", + "test-code-stubs-ia32.cc", + "test-code-stubs.cc", + "test-disasm-ia32.cc", + "test-log-stack-tracer.cc", + "test-macro-assembler-ia32.cc", + "test-run-wasm-relocation-ia32.cc", + ] + } else if (v8_target_cpu == "mips") { + sources += [ + "test-assembler-mips.cc", + "test-code-stubs-mips.cc", + "test-code-stubs.cc", + "test-disasm-mips.cc", + "test-macro-assembler-mips.cc", + ] + } else if (v8_target_cpu == "mipsel") { + sources += [ + "test-assembler-mips.cc", + "test-code-stubs-mips.cc", + "test-code-stubs.cc", + "test-disasm-mips.cc", + "test-macro-assembler-mips.cc", + ] + } else if (v8_target_cpu == "mips64") { + sources += [ + "test-assembler-mips64.cc", + "test-code-stubs-mips64.cc", + "test-code-stubs.cc", + "test-disasm-mips64.cc", + "test-macro-assembler-mips64.cc", + ] + } else if (v8_target_cpu == "mips64el") { + sources += [ + "test-assembler-mips64.cc", + "test-code-stubs-mips64.cc", + "test-code-stubs.cc", + "test-disasm-mips64.cc", + "test-macro-assembler-mips64.cc", + ] + } else if (v8_target_cpu == "x64") { + sources += [ + "test-assembler-x64.cc", + "test-code-stubs-x64.cc", + "test-code-stubs.cc", + "test-disasm-x64.cc", + "test-log-stack-tracer.cc", + "test-macro-assembler-x64.cc", + "test-run-wasm-relocation-x64.cc", + ] + } else if (v8_target_cpu == "x87") { + sources += [ + "test-assembler-x87.cc", + "test-code-stubs-x87.cc", + "test-code-stubs.cc", + "test-disasm-x87.cc", + "test-log-stack-tracer.cc", + "test-macro-assembler-x87.cc", + "test-run-wasm-relocation-x87.cc", + ] + } else if (v8_target_cpu == "ppc" || v8_target_cpu == "ppc64") { + sources += [ + "test-assembler-ppc.cc", + "test-code-stubs.cc", + "test-disasm-ppc.cc", + ] + } else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") { + sources += [ + "test-assembler-s390.cc", + "test-code-stubs.cc", + "test-disasm-s390.cc", + ] + } + + if (is_linux) { + # TODO(machenbach): Translate 'or OS=="qnx"' from gyp. + sources += [ "test-platform-linux.cc" ] + } else if (is_win) { + sources += [ "test-platform-win32.cc" ] + # TODO(machenbach): Translate from gyp. + # "msvs_settings": { + # "VCCLCompilerTool": { + # # MSVS wants this for gay-{precision,shortest}.cc. + # "AdditionalOptions": ["/bigobj"], + # }, + # }, + } + + configs = [ + "../..:external_config", + "../..:internal_config_base", + ] + + # TODO(machenbach): Translate from gyp. + #['v8_target_cpu=="ppc" or v8_target_cpu=="ppc64" \ + # or v8_target_cpu=="arm" or v8_target_cpu=="arm64" \ + # or v8_target_cpu=="s390" or v8_target_cpu=="s390x"', { + # # disable fmadd/fmsub so that expected results match generated code in + # # RunFloat64MulAndFloat64Add1 and friends. + # 'cflags': ['-ffp-contract=off'], + #}], + + # TODO(machenbach): Translate from gyp. + #["OS=="aix"", { + # "ldflags": [ "-Wl,-bbigtoc" ], + #}], + + deps = [ + ":resources", + "../..:v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (is_component_build) { + # cctest can't be built against a shared library, so we + # need to depend on the underlying static target in that case. + deps += [ "../..:v8_maybe_snapshot" ] + } else { + deps += [ "../..:v8" ] + } + + if (is_win) { + # This warning is benignly triggered by the U16 and U32 macros in + # bytecode-utils.h. + # C4309: 'static_cast': truncation of constant value + cflags = [ "/wd4309" ] + + # Suppress warnings about importing locally defined symbols. + if (is_component_build) { + ldflags = [ + "/ignore:4049", + "/ignore:4217", + ] + } + } +} + +action("resources") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + script = "../../tools/js2c.py" + + # The script depends on this other script, this rule causes a rebuild if it + # changes. + inputs = [ + "../../tools/jsmin.py", + ] + + # NOSORT + sources = [ + "../../tools/splaytree.js", + "../../tools/codemap.js", + "../../tools/csvparser.js", + "../../tools/consarray.js", + "../../tools/profile.js", + "../../tools/profile_view.js", + "../../tools/logreader.js", + "log-eq-of-logging-and-traversal.js", + ] + + outputs = [ + "$target_gen_dir/resources.cc", + ] + + args = [ + rebase_path("$target_gen_dir/resources.cc", root_build_dir), + "TEST", + ] + args += rebase_path(sources, root_build_dir) +} + +v8_executable("generate-bytecode-expectations") { + sources = [ + "interpreter/bytecode-expectations-printer.cc", + "interpreter/bytecode-expectations-printer.h", + "interpreter/generate-bytecode-expectations.cc", + ] + + configs = [ + "../..:external_config", + "../..:internal_config_base", + ] + + deps = [ + "../..:v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (is_component_build) { + # Same as cctest, we need to depend on the underlying static target. + deps += [ "../..:v8_maybe_snapshot" ] + } else { + deps += [ "../..:v8" ] + } +} diff --git a/chromium/v8/test/test262/BUILD.gn b/chromium/v8/test/test262/BUILD.gn new file mode 100644 index 00000000000..9aaa7770c10 --- /dev/null +++ b/chromium/v8/test/test262/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../../gni/isolate.gni") + +if (v8_test_isolation_mode != "noop") { + action("archive_test262") { + visibility = [ ":*" ] + + script = "archive.py" + + inputs = [ + "list.py", + ] + + sources = exec_script("list.py", [], "list lines") + + outputs = [ + "$target_gen_dir/test262_archiving.stamp", + ] + + args = rebase_path(outputs, root_build_dir) + } +} + +v8_isolate_run("test262") { + deps = [ + ":archive_test262", + "../..:d8_run", + ] + + isolate = "test262.isolate" +} diff --git a/chromium/v8/test/unittests/BUILD.gn b/chromium/v8/test/unittests/BUILD.gn new file mode 100644 index 00000000000..b962673fb2b --- /dev/null +++ b/chromium/v8/test/unittests/BUILD.gn @@ -0,0 +1,182 @@ +# Copyright 2016 The V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Please keep this file in sync with unittests.gyp. + +import("../../gni/v8.gni") + +v8_executable("unittests") { + testonly = true + + sources = [ + "base/atomic-utils-unittest.cc", + "base/bits-unittest.cc", + "base/cpu-unittest.cc", + "base/division-by-constant-unittest.cc", + "base/flags-unittest.cc", + "base/functional-unittest.cc", + "base/ieee754-unittest.cc", + "base/iterator-unittest.cc", + "base/logging-unittest.cc", + "base/platform/condition-variable-unittest.cc", + "base/platform/mutex-unittest.cc", + "base/platform/platform-unittest.cc", + "base/platform/semaphore-unittest.cc", + "base/platform/time-unittest.cc", + "base/sys-info-unittest.cc", + "base/utils/random-number-generator-unittest.cc", + "cancelable-tasks-unittest.cc", + "char-predicates-unittest.cc", + "compiler/branch-elimination-unittest.cc", + "compiler/checkpoint-elimination-unittest.cc", + "compiler/common-operator-reducer-unittest.cc", + "compiler/common-operator-unittest.cc", + "compiler/compiler-test-utils.h", + "compiler/control-equivalence-unittest.cc", + "compiler/control-flow-optimizer-unittest.cc", + "compiler/dead-code-elimination-unittest.cc", + "compiler/diamond-unittest.cc", + "compiler/effect-control-linearizer-unittest.cc", + "compiler/escape-analysis-unittest.cc", + "compiler/graph-reducer-unittest.cc", + "compiler/graph-reducer-unittest.h", + "compiler/graph-trimmer-unittest.cc", + "compiler/graph-unittest.cc", + "compiler/graph-unittest.h", + "compiler/instruction-selector-unittest.cc", + "compiler/instruction-selector-unittest.h", + "compiler/instruction-sequence-unittest.cc", + "compiler/instruction-sequence-unittest.h", + "compiler/int64-lowering-unittest.cc", + "compiler/js-builtin-reducer-unittest.cc", + "compiler/js-create-lowering-unittest.cc", + "compiler/js-intrinsic-lowering-unittest.cc", + "compiler/js-operator-unittest.cc", + "compiler/js-typed-lowering-unittest.cc", + "compiler/linkage-tail-call-unittest.cc", + "compiler/live-range-unittest.cc", + "compiler/liveness-analyzer-unittest.cc", + "compiler/load-elimination-unittest.cc", + "compiler/loop-peeling-unittest.cc", + "compiler/machine-operator-reducer-unittest.cc", + "compiler/machine-operator-unittest.cc", + "compiler/move-optimizer-unittest.cc", + "compiler/node-cache-unittest.cc", + "compiler/node-matchers-unittest.cc", + "compiler/node-properties-unittest.cc", + "compiler/node-test-utils.cc", + "compiler/node-test-utils.h", + "compiler/node-unittest.cc", + "compiler/opcodes-unittest.cc", + "compiler/register-allocator-unittest.cc", + "compiler/schedule-unittest.cc", + "compiler/scheduler-rpo-unittest.cc", + "compiler/scheduler-unittest.cc", + "compiler/simplified-operator-reducer-unittest.cc", + "compiler/simplified-operator-unittest.cc", + "compiler/state-values-utils-unittest.cc", + "compiler/tail-call-optimization-unittest.cc", + "compiler/typer-unittest.cc", + "compiler/value-numbering-reducer-unittest.cc", + "compiler/zone-pool-unittest.cc", + "counters-unittest.cc", + "heap/bitmap-unittest.cc", + "heap/gc-idle-time-handler-unittest.cc", + "heap/gc-tracer-unittest.cc", + "heap/heap-unittest.cc", + "heap/memory-reducer-unittest.cc", + "heap/scavenge-job-unittest.cc", + "heap/slot-set-unittest.cc", + "interpreter/bytecode-array-builder-unittest.cc", + "interpreter/bytecode-array-iterator-unittest.cc", + "interpreter/bytecode-array-writer-unittest.cc", + "interpreter/bytecode-dead-code-optimizer-unittest.cc", + "interpreter/bytecode-peephole-optimizer-unittest.cc", + "interpreter/bytecode-pipeline-unittest.cc", + "interpreter/bytecode-register-allocator-unittest.cc", + "interpreter/bytecode-register-optimizer-unittest.cc", + "interpreter/bytecodes-unittest.cc", + "interpreter/constant-array-builder-unittest.cc", + "interpreter/interpreter-assembler-unittest.cc", + "interpreter/interpreter-assembler-unittest.h", + "interpreter/source-position-table-unittest.cc", + "libplatform/default-platform-unittest.cc", + "libplatform/task-queue-unittest.cc", + "libplatform/worker-thread-unittest.cc", + "locked-queue-unittest.cc", + "register-configuration-unittest.cc", + "run-all-unittests.cc", + "test-utils.cc", + "test-utils.h", + "wasm/asm-types-unittest.cc", + "wasm/ast-decoder-unittest.cc", + "wasm/control-transfer-unittest.cc", + "wasm/decoder-unittest.cc", + "wasm/encoder-unittest.cc", + "wasm/leb-helper-unittest.cc", + "wasm/loop-assignment-analysis-unittest.cc", + "wasm/module-decoder-unittest.cc", + "wasm/switch-logic-unittest.cc", + "wasm/wasm-macro-gen-unittest.cc", + ] + + if (v8_target_cpu == "arm") { + sources += [ "compiler/arm/instruction-selector-arm-unittest.cc" ] + } else if (v8_target_cpu == "arm64") { + sources += [ "compiler/arm64/instruction-selector-arm64-unittest.cc" ] + } else if (v8_target_cpu == "x86") { + sources += [ "compiler/ia32/instruction-selector-ia32-unittest.cc" ] + } else if (v8_target_cpu == "mips" || v8_target_cpu == "mipsel") { + sources += [ "compiler/mips/instruction-selector-mips-unittest.cc" ] + } else if (v8_target_cpu == "mips64" || v8_target_cpu == "mips64el") { + sources += [ "compiler/mips64/instruction-selector-mips64-unittest.cc" ] + } else if (v8_target_cpu == "x64") { + sources += [ "compiler/x64/instruction-selector-x64-unittest.cc" ] + } else if (v8_target_cpu == "ppc" || v8_target_cpu == "ppc64") { + sources += [ "compiler/ppc/instruction-selector-ppc-unittest.cc" ] + } else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") { + sources += [ "compiler/s390/instruction-selector-s390-unittest.cc" ] + } + + configs = [ + "../..:external_config", + "../..:internal_config_base", + ] + + # TODO(machenbach): Translate from gyp. + #['OS=="aix"', { + # 'ldflags': [ '-Wl,-bbigtoc' ], + #}], + + deps = [ + "../..:v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + "//testing/gmock", + "//testing/gtest", + ] + + if (is_component_build) { + # compiler-unittests can't be built against a shared library, so we + # need to depend on the underlying static target in that case. + deps += [ "../..:v8_maybe_snapshot" ] + } else { + deps += [ "../..:v8" ] + } + + if (is_win) { + # This warning is benignly triggered by the U16 and U32 macros in + # bytecode-utils.h. + # C4309: 'static_cast': truncation of constant value + cflags = [ "/wd4309" ] + + # Suppress warnings about importing locally defined symbols. + if (is_component_build) { + ldflags = [ + "/ignore:4049", + "/ignore:4217", + ] + } + } +} |