| # 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("display") { |
| sources = [ |
| "android/screen_android.cc", |
| "chromeos/apply_content_protection_task.cc", |
| "chromeos/apply_content_protection_task.h", |
| "chromeos/configure_displays_task.cc", |
| "chromeos/configure_displays_task.h", |
| "chromeos/display_configurator.cc", |
| "chromeos/display_configurator.h", |
| "chromeos/display_layout_manager.h", |
| "chromeos/display_snapshot_virtual.cc", |
| "chromeos/display_snapshot_virtual.h", |
| "chromeos/display_util.cc", |
| "chromeos/display_util.h", |
| "chromeos/query_content_protection_task.cc", |
| "chromeos/query_content_protection_task.h", |
| "chromeos/update_display_configuration_task.cc", |
| "chromeos/update_display_configuration_task.h", |
| "display.cc", |
| "display.h", |
| "display_change_notifier.cc", |
| "display_change_notifier.h", |
| "display_export.h", |
| "display_finder.cc", |
| "display_finder.h", |
| "display_list.cc", |
| "display_list.h", |
| "display_observer.cc", |
| "display_observer.h", |
| "display_switches.cc", |
| "display_switches.h", |
| "fake_display_delegate.cc", |
| "fake_display_delegate.h", |
| "fake_display_snapshot.cc", |
| "fake_display_snapshot.h", |
| "ios/screen_ios.mm", |
| "mac/screen_mac.mm", |
| "manager/display_layout.cc", |
| "manager/display_layout.h", |
| "manager/display_layout_builder.cc", |
| "manager/display_layout_builder.h", |
| "manager/display_layout_store.cc", |
| "manager/display_layout_store.h", |
| "manager/display_manager_utilities.cc", |
| "manager/display_manager_utilities.h", |
| "manager/managed_display_info.cc", |
| "manager/managed_display_info.h", |
| "screen.cc", |
| "screen.h", |
| "screen_aura.cc", |
| "screen_base.cc", |
| "screen_base.h", |
| "win/display_info.cc", |
| "win/display_info.h", |
| "win/dpi.cc", |
| "win/dpi.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", |
| ] |
| |
| defines = [ "DISPLAY_IMPLEMENTATION" ] |
| |
| public_deps = [ |
| "//ui/gfx:gfx", |
| ] |
| |
| deps = [ |
| "//base", |
| "//ui/display/types", |
| "//ui/display/util", |
| "//ui/gfx", |
| "//ui/gfx/geometry", |
| ] |
| |
| if (is_chromeos && use_x11) { |
| sources += [ |
| "chromeos/x11/display_mode_x11.cc", |
| "chromeos/x11/display_mode_x11.h", |
| "chromeos/x11/display_snapshot_x11.cc", |
| "chromeos/x11/display_snapshot_x11.h", |
| "chromeos/x11/display_util_x11.cc", |
| "chromeos/x11/display_util_x11.h", |
| "chromeos/x11/native_display_delegate_x11.cc", |
| "chromeos/x11/native_display_delegate_x11.h", |
| "chromeos/x11/native_display_event_dispatcher_x11.cc", |
| "chromeos/x11/native_display_event_dispatcher_x11.h", |
| ] |
| |
| configs += [ |
| "//build/config/linux:x11", |
| "//build/config/linux:xext", |
| "//build/config/linux:xi", |
| "//build/config/linux:xrandr", |
| ] |
| |
| deps += [ "//ui/events/platform" ] |
| } |
| |
| if (use_x11) { |
| deps += [ "//ui/gfx/x" ] |
| } |
| |
| if (!use_aura) { |
| sources -= [ "screen_aura.cc" ] |
| } |
| if (is_android && use_aura) { |
| sources -= [ "android/screen_android.cc" ] |
| } |
| if (is_mac) { |
| libs = [ |
| "AppKit.framework", |
| "CoreGraphics.framework", |
| ] |
| } |
| } |
| |
| if (is_chromeos) { |
| component("test_util") { |
| output_name = "display_test_util" |
| sources = [ |
| "chromeos/test/test_display_snapshot.cc", |
| "chromeos/test/test_display_snapshot.h", |
| ] |
| |
| defines = [ "DISPLAY_IMPLEMENTATION" ] |
| |
| public_deps = [ |
| ":display", |
| ] |
| deps = [ |
| "//base", |
| "//ui/display/types", |
| "//ui/gfx", |
| "//ui/gfx/geometry", |
| ] |
| } |
| } |
| |
| static_library("test_support") { |
| testonly = true |
| sources = [ |
| "chromeos/test/action_logger.cc", |
| "chromeos/test/action_logger.h", |
| "chromeos/test/action_logger_util.cc", |
| "chromeos/test/action_logger_util.h", |
| "chromeos/test/test_display_layout_manager.cc", |
| "chromeos/test/test_display_layout_manager.h", |
| "chromeos/test/test_native_display_delegate.cc", |
| "chromeos/test/test_native_display_delegate.h", |
| "test/display_test_util.h", |
| "test/test_screen.cc", |
| "test/test_screen.h", |
| "win/test/screen_util_win.cc", |
| "win/test/screen_util_win.h", |
| ] |
| |
| public_deps = [ |
| ":display", |
| ] |
| deps = [ |
| "//base", |
| "//ui/display/types", |
| "//ui/gfx", |
| "//ui/gfx:test_support", |
| "//ui/gfx/geometry", |
| ] |
| } |
| |
| # This test covers all testable components in display. |
| test("display_unittests") { |
| sources = [ |
| "chromeos/apply_content_protection_task_unittest.cc", |
| "chromeos/configure_displays_task_unittest.cc", |
| "chromeos/display_configurator_unittest.cc", |
| "chromeos/query_content_protection_task_unittest.cc", |
| "chromeos/update_display_configuration_task_unittest.cc", |
| "chromeos/x11/display_util_x11_unittest.cc", |
| "chromeos/x11/native_display_event_dispatcher_x11_unittest.cc", |
| "display_change_notifier_unittest.cc", |
| "display_list_unittest.cc", |
| "display_unittest.cc", |
| "manager/display_layout_builder_unittest.cc", |
| "manager/display_layout_unittest.cc", |
| "manager/display_manager_utilities_unittest.cc", |
| "manager/managed_display_info_unittest.cc", |
| "screen_unittest.cc", |
| "util/display_util_unittest.cc", |
| "util/edid_parser_unittest.cc", |
| "win/scaling_util_unittest.cc", |
| "win/screen_win_unittest.cc", |
| ] |
| |
| deps = [ |
| ":display", |
| ":test_support", |
| "//base", |
| "//base/test:run_all_unittests", |
| "//base/test:test_support", |
| "//testing/gtest", |
| "//ui/display/types", |
| "//ui/display/util", |
| "//ui/gfx:test_support", |
| "//ui/gfx/geometry", |
| ] |
| |
| if (is_chromeos) { |
| deps += [ ":test_util" ] |
| } |
| |
| if (use_aura) { |
| sources -= [ "screen_unittest.cc" ] |
| } |
| |
| 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 && use_ozone) { |
| sources -= [ |
| "chromeos/x11/display_util_x11_unittest.cc", |
| "chromeos/x11/native_display_event_dispatcher_x11_unittest.cc", |
| ] |
| } |
| } |