Index: ash/BUILD.gn |
diff --git a/ash/BUILD.gn b/ash/BUILD.gn |
index d6642dd24088ed5dc7127f72d2c63d5b7d126917..4a2d982f49b9f2ade6dc65f71375749bdc9cd69b 100644 |
--- a/ash/BUILD.gn |
+++ b/ash/BUILD.gn |
@@ -184,9 +184,14 @@ component("ash_with_content") { |
] |
} |
-# TODO(msw): Move support code with content deps to test_support_with_content. |
-static_library("test_support") { |
+# Internal target consumed by |test_support| and |test_support_with_content|. |
+# This target contains all the test support files, with the exception of |
+# an implementation of AshTestEnvironment. Consumers of ash should use one of |
+# test_support_with_content or test_support, depending upon whether they use |
+# content or use content. |
James Cook
2016/08/31 16:20:16
nit: use content or don't use content (or maybe no
|
+static_library("test_support_no_environment") { |
James Cook
2016/08/31 16:20:16
nit: How about test_support_common or test_support
sky
2016/08/31 17:35:57
Good idea, renamed to test_support_shared.
|
testonly = true |
+ visibility = [ ":*" ] |
sources = gypi_values.ash_test_support_sources |
configs += [ "//build/config:precompiled_headers" ] |
@@ -194,14 +199,11 @@ static_library("test_support") { |
":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", |
@@ -241,13 +243,35 @@ static_library("test_support") { |
} |
} |
+static_library("test_support") { |
James Cook
2016/08/31 16:20:16
nit: How about test_support_without_content ?
sky
2016/08/31 17:35:57
Great idea! Done.
|
+ testonly = true |
+ sources = [ |
+ "test/ash_test_environment_default.cc", |
+ ] |
+ |
+ public_deps = [ |
+ ":test_support_no_environment", |
+ ] |
+ |
+ deps = [ |
+ "//base", |
+ "//skia", |
+ ] |
+} |
+ |
static_library("test_support_with_content") { |
testonly = true |
sources = gypi_values.ash_test_support_with_content_sources |
+ sources += [ |
+ "test/ash_test_environment_content.cc", |
+ "test/ash_test_environment_content.h", |
+ ] |
configs += [ "//build/config:precompiled_headers" ] |
- deps = [ |
+ public_deps = [ |
":ash_with_content", |
+ ":test_support_no_environment", |
+ "//content/public/browser", |
"//content/test:test_support", |
"//skia", |
] |
@@ -266,7 +290,7 @@ static_library("interactive_ui_test_support") { |
] |
deps = [ |
":ash", |
- ":test_support", |
+ ":test_support_with_content", |
"//base", |
"//skia", |
"//testing/gtest", |
@@ -342,14 +366,21 @@ static_library("ash_shell_lib_with_content") { |
} |
} |
-test("ash_unittests") { |
- sources = gypi_values.ash_unittests_sources |
- configs += [ "//build/config:precompiled_headers" ] |
+test("ash_content_unittests") { |
James Cook
2016/08/31 16:20:16
nit: I would comment here about the content depend
sky
2016/08/31 17:35:57
Done.
|
+ sources = [ |
+ "content/display/screen_orientation_controller_chromeos_unittest.cc", |
+ "content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc", |
+ "content/keyboard_overlay/keyboard_overlay_view_unittest.cc", |
+ "test/ash_unittests.cc", |
+ ] |
+ configs += [ |
+ "//build/config:precompiled_headers", |
+ "//build/config/compiler:no_size_t_to_int_warning", |
+ ] |
deps = [ |
":ash", |
":ash_with_content", |
- ":test_support", |
":test_support_with_content", |
"//ash/autoclick/common:autoclick", |
James Cook
2016/08/31 16:20:16
I suspect a lot of these deps are not required. Ma
sky
2016/08/31 17:35:57
Indeed. I just copied the list from ash_unittests.
|
"//ash/common/strings", |
@@ -363,6 +394,7 @@ test("ash_unittests") { |
"//content/test:test_support", |
"//mojo/edk/system", |
"//skia", |
+ "//testing/gmock", |
"//testing/gtest", |
"//third_party/icu", |
"//ui/accessibility", |
@@ -402,36 +434,84 @@ test("ash_unittests") { |
"//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", |
- |
- # Talks to ChromeOS system services. |
- "wm/lock_state_controller_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", |
- "magnifier/partial_magnification_controller_unittest.cc", |
- "sticky_keys/sticky_keys_overlay_unittest.cc", |
- "virtual_keyboard_controller_unittest.cc", |
- "wm/workspace/workspace_window_resizer_unittest.cc", |
+ if (is_chromeos) { |
+ deps += [ |
+ "//chromeos", |
+ "//chromeos:power_manager_proto", |
+ "//chromeos:test_support_without_gmock", |
+ "//components/quirks", |
+ "//device/bluetooth", |
+ "//net:net", |
+ "//ui/chromeos", |
+ "//ui/display", |
+ "//ui/display:test_support", |
+ "//ui/display:test_util", |
] |
} |
+} |
+ |
+test("ash_unittests") { |
+ sources = gypi_values.ash_unittests_sources |
+ sources += [ "test/ash_test_environment_default.cc" ] |
+ configs += [ |
+ "//build/config:precompiled_headers", |
+ "//build/config/compiler:no_size_t_to_int_warning", |
+ ] |
+ |
+ deps = [ |
+ ":ash", |
+ ":test_support", |
+ "//ash/autoclick/common:autoclick", |
+ "//ash/common/strings", |
+ "//ash/resources", |
+ "//ash/touch_hud", |
+ "//base", |
+ "//base/test:test_support", |
+ "//components/signin/core/account_id", |
+ "//components/user_manager", |
+ "//mojo/edk/system", |
+ "//skia", |
+ "//testing/gmock", |
+ "//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/message_center", |
+ "//ui/message_center:test_support", |
+ "//ui/resources", |
+ "//ui/strings", |
+ "//ui/views", |
+ "//ui/views:test_support", |
+ "//ui/wm", |
+ "//ui/wm:test_support", |
+ "//url", |
+ ] |
- configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
+ data_deps = [ |
+ "//ash/common/strings:ash_test_strings", |
+ "//ash/resources:ash_test_resources_100_percent", |
+ "//ash/resources:ash_test_resources_200_percent", |
+ ] |
if (!use_x11) { |
sources -= [ "host/ash_window_tree_host_x11_unittest.cc" ] |
} |
+ |
if (is_chromeos) { |
sources += [ "first_run/first_run_helper_unittest.cc" ] |
deps += [ |
@@ -450,18 +530,36 @@ test("ash_unittests") { |
sources -= [ |
"accelerators/magnifier_key_scroller_unittest.cc", |
"accelerators/spoken_feedback_toggler_unittest.cc", |
+ |
+ # Can't resize on Windows Ash. http://crbug.com/165962 |
+ "autoclick/autoclick_unittest.cc", |
"display/resolution_notification_controller_unittest.cc", |
+ |
+ # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906 |
+ "focus_cycler_unittest.cc", |
+ "magnifier/magnification_controller_unittest.cc", |
+ "magnifier/partial_magnification_controller_unittest.cc", |
+ "sticky_keys/sticky_keys_overlay_unittest.cc", |
+ "sticky_keys/sticky_keys_unittest.cc", |
"touch/touchscreen_util_unittest.cc", |
+ "virtual_keyboard_controller_unittest.cc", |
+ |
+ # All tests for multiple displays: not supported on Windows Ash. |
+ "wm/drag_window_resizer_unittest.cc", |
+ |
+ # Talks to ChromeOS system services. |
+ "wm/lock_state_controller_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", |
+ "wm/workspace/workspace_window_resizer_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") { |