blob: a32013fee957193a5dccf3378e958215ff82091f [file] [log] [blame]
# 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/chromeos/ui_mode.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")
import("//ui/display/display.gni")
component("display") {
sources = [
"display.cc",
"display.h",
"display_change_notifier.cc",
"display_change_notifier.h",
"display_export.h",
"display_features.cc",
"display_features.h",
"display_finder.cc",
"display_finder.h",
"display_layout.cc",
"display_layout.h",
"display_layout_builder.cc",
"display_layout_builder.h",
"display_list.cc",
"display_list.h",
"display_observer.cc",
"display_observer.h",
"display_switches.cc",
"display_switches.h",
"display_transform.cc",
"display_transform.h",
"scoped_display_for_new_windows.cc",
"scoped_display_for_new_windows.h",
"screen.cc",
"screen.h",
"screen_base.cc",
"screen_base.h",
"tablet_state.h",
"unified_desktop_utils.cc",
"unified_desktop_utils.h",
]
if (is_android) {
sources += [ "screen_android.cc" ]
}
if (is_mac) {
sources += [
"mac/display_link_mac.cc",
"mac/display_link_mac.h",
"mac/screen_mac.mm",
]
}
if (is_win) {
sources += [
"win/base_window_finder_win.cc",
"win/base_window_finder_win.h",
"win/color_profile_reader.cc",
"win/color_profile_reader.h",
"win/display_info.cc",
"win/display_info.h",
"win/dpi.cc",
"win/dpi.h",
"win/local_process_window_finder_win.cc",
"win/local_process_window_finder_win.h",
"win/scaling_util.cc",
"win/scaling_util.h",
"win/screen_win.cc",
"win/screen_win.h",
"win/screen_win_display.cc",
"win/screen_win_display.h",
"win/topmost_window_finder_win.cc",
"win/topmost_window_finder_win.h",
"win/uwp_text_scale_factor.cc",
"win/uwp_text_scale_factor.h",
]
}
if (is_ios) {
sources += [ "ios/screen_ios.mm" ]
}
defines = [ "DISPLAY_IMPLEMENTATION" ]
public_deps = [
"//ui/display/types",
"//ui/gfx:color_space",
"//ui/gfx:gfx",
]
deps = [
"//base",
"//build:chromeos_buildflags",
"//mojo/public/cpp/bindings:struct_traits",
"//ui/display/util",
"//ui/gfx",
"//ui/gfx/geometry",
]
if (is_win) {
# Don't conflict with Windows' "display.dll".
output_name = "ui_display"
}
if (use_aura) {
sources += [ "screen_aura.cc" ]
}
if (is_mac) {
frameworks = [
"AppKit.framework",
"CoreGraphics.framework",
"QuartzCore.framework",
]
}
}
component("display_manager_test_api") {
testonly = true
sources = [
"test/display_manager_test_api.cc",
"test/display_manager_test_api.h",
]
defines = [ "DISPLAY_IMPLEMENTATION" ]
public_deps = [ "//ui/display/manager" ]
deps = [
"//base",
"//build:chromeos_buildflags",
"//ui/display",
"//ui/display/types",
]
}
static_library("test_support") {
testonly = true
sources = [
"test/display_matchers.cc",
"test/display_matchers.h",
"test/display_test_util.h",
"test/scoped_screen_override.cc",
"test/scoped_screen_override.h",
"test/test_screen.cc",
"test/test_screen.h",
]
if (is_win) {
sources += [
"win/test/scoped_screen_win.cc",
"win/test/scoped_screen_win.h",
"win/test/screen_util_win.cc",
"win/test/screen_util_win.h",
]
}
if (build_display_configuration) {
sources += [
"manager/test/action_logger.cc",
"manager/test/action_logger.h",
"manager/test/action_logger_util.cc",
"manager/test/action_logger_util.h",
"manager/test/test_display_layout_manager.cc",
"manager/test/test_display_layout_manager.h",
"manager/test/test_native_display_delegate.cc",
"manager/test/test_native_display_delegate.h",
"manager/test/touch_device_manager_test_api.cc",
"manager/test/touch_device_manager_test_api.h",
"manager/test/touch_transform_controller_test_api.cc",
"manager/test/touch_transform_controller_test_api.h",
]
}
public_deps = [
":display",
"//ui/display/manager",
]
deps = [
"//base",
"//testing/gmock",
"//ui/display/types",
"//ui/events/devices",
"//ui/gfx",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
]
}
# This test covers all testable components in display.
test("display_unittests") {
sources = [
"display_layout_builder_unittest.cc",
"display_layout_unittest.cc",
"display_list_unittest.cc",
"display_unittest.cc",
"fake/fake_display_snapshot_unittest.cc",
"manager/display_manager_utilities_unittest.cc",
"manager/json_converter_unittest.cc",
"manager/managed_display_info_unittest.cc",
"mojom/display_mojom_traits_unittest.cc",
"screen_unittest.cc",
"unified_desktop_utils_unittests.cc",
"util/display_util_unittest.cc",
"util/edid_parser_unittest.cc",
]
if (is_win) {
sources += [
"win/scaling_util_unittest.cc",
"win/screen_win_unittest.cc",
]
}
if (build_display_configuration) {
sources += [
"manager/apply_content_protection_task_unittest.cc",
"manager/configure_displays_task_unittest.cc",
"manager/content_protection_manager_unittest.cc",
"manager/display_change_observer_unittest.cc",
"manager/display_configurator_unittest.cc",
"manager/display_utils_unittest.cc",
"manager/query_content_protection_task_unittest.cc",
"manager/touch_device_manager_unittest.cc",
"manager/touch_transform_controller_unittest.cc",
"manager/update_display_configuration_task_unittest.cc",
]
}
deps = [
":display",
":display_manager_test_api",
":test_support",
"//base",
"//base/test:test_support",
"//build:chromeos_buildflags",
"//cc/base",
"//mojo/core/test:run_all_unittests",
"//testing/gmock",
"//testing/gtest",
"//ui/display/fake",
"//ui/display/manager",
"//ui/display/mojom:mojom",
"//ui/display/types",
"//ui/display/util",
"//ui/events:test_support",
"//ui/events/devices",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
]
if (!is_android) {
# Do not run display_change_notifier_unittest.cc on Android because it
# does not compile display_observer.cc
sources += [ "display_change_notifier_unittest.cc" ]
}
if (is_chromeos_ash) {
deps += [ "//chromeos/constants" ]
}
}