Skip to content

Commit

Permalink
Disable unit tests for Window Manager Client in external window mode
Browse files Browse the repository at this point in the history
After [1], no default display is created at the startup of the window
server, making the following mus_ws_unitests hang:

  WindowServerTest.OnWindowHierarchyChangedIncludesTransientParent
  WindowServerTest.RootWindow
  WindowServerTest.Embed
  WindowServerTest.EmbeddedDoesntSeeChild
  WindowServerTest.SetBounds
  WindowServerTest.SetBoundsSecurity
  WindowServerTest.DestroySecurity
  WindowServerTest.MultiRoots
  WindowServerTest.Reorder
  WindowServerTest.Visible
  WindowServerTest.EmbedFailsWithChildren
  WindowServerTest.WindowServerDestroyedAfterRootObserver
  WindowServerTest.ClientAreaChanged
  WindowServerTest.EstablishConnectionViaFactory

The issue is that WindowServerTestBase::SetUp is designed to wait
until OnWmNewDisplay is called to be sure that a display (and root)
is available, which never happens in external window mode.

The above tests check WindowManagerClient and this class is not needed
in external mode since the host system is always the window manager.
Hence this CL disables these tests in external window mode, making
mus_ws_unitests pass again on the corresponding platforms.

[1] https://codereview.chromium.org/2697693002/

BUG=666958

Review-Url: https://codereview.chromium.org/2740123002
Cr-Commit-Position: refs/heads/master@{#455902}
  • Loading branch information
fred-wang authored and Commit bot committed Mar 9, 2017
1 parent e5e975b commit 7dac3c6
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions services/ui/ws/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import("//services/service_manager/public/cpp/service.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//services/service_manager/public/tools/test/service_test.gni")

# In external window mode, top-level windows are native platform windows i.e.
# not children of a Chrome OS window manager's root window.
is_external_mode = use_ozone && !is_chromeos

static_library("lib") {
sources = [
"accelerator.cc",
Expand Down Expand Up @@ -171,10 +175,18 @@ static_library("test_support") {
"test_change_tracker.h",
"window_server_service_test_base.cc",
"window_server_service_test_base.h",
"window_server_test_base.cc",
"window_server_test_base.h",
]

if (!is_external_mode) {
# WindowServerTestBase assumes an initial display (and root) is provided
# at startup, which is not the case on platforms running external window
# mode.
sources += [
"window_server_test_base.cc",
"window_server_test_base.h",
]
}

deps = [
"//base",
"//base/test:test_config",
Expand Down Expand Up @@ -223,12 +235,17 @@ service_test("mus_ws_unittests") {
"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",
]

if (!is_external_mode) {
# A window manager client is not needed on platforms running external
# window mode, since the host system is always the window manager.
sources += [ "window_manager_client_unittest.cc" ]
}

catalog = ":mus_ws_unittests_catalog"

deps = [
Expand Down

0 comments on commit 7dac3c6

Please sign in to comment.