New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 611601 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 602036



Sign in to add a comment

mash: widget->IsActive() fails in tests because USER_PRIVATE window container is not visible

Project Member Reported by jamescook@chromium.org, May 12 2016

Issue description

This came up while getting widget_interactive_uittests.cc to run. When a widget is shown the window tree client attempts to set it focused. This locally caches the focus state as focused/activated, so most tests that call widget->IsActive() will see the focus state and return true.

However, if the test runs the message loop it will get a message from the window server rejecting the focus change request because a test for ServerWindow::IsDrawn() return false. Subsequent calls to widget->IsActive() in the client will fail.

See for example WidgetTestInteractive.TouchSelectionQuickMenuIsNotActivated

The problem is that the USER_PRIVATE window container is not visible by default. The window manager sets this in root_window_controller.cc and it's desirable in production (so we don't leak user windows).

We need to either unlock the screen for tests, or otherwise set that container as visible.

 
WidgetTestInteractive.WindowModalWindowDestroyedActivationTest fails, probably for the reason above.

WidgetTestInteractive.WindowModalWindowDestroyedActivationTest (run #1):
[ RUN      ] WidgetTestInteractive.WindowModalWindowDestroyedActivationTest
[0512/142602:ERROR:gpu_state.cc(65)] Collect basic graphics info failed!
Xlib:  extension "RANDR" missing on display ":9".
[0512/142602:ERROR:screen_mus.cc(126)] Not implemented reached in virtual gfx::Point views::ScreenMus::GetCursorScreenPoint()
[0512/142602:ERROR:layer_tree_host_impl.cc(2223)] Forcing zero-copy tile initialization as worker context is missing
../../ui/views/widget/widget_interactive_uitest.cc:938: Failure
Value of: focus_changes.size()
  Actual: 4
Expected: 5u
Which is: 5
../../ui/views/widget/widget_interactive_uitest.cc:940: Failure
Value of: focus_changes[4]
  Actual: NULL
Expected: top_level_native_view
Which is: 0x23f80492e000
[0512/142602:ERROR:screen_mus.cc(126)] Not implemented reached in virtual gfx::Point views::ScreenMus::GetCursorScreenPoint()
[0512/142602:ERROR:layer_tree_host_impl.cc(2223)] Forcing zero-copy tile initialization as worker context is missing
[12534:12577:0512/142602:14411943194:ERROR:node_controller.cc(878)] Could not be introduced to peer E04AF95B32FF42DF.8FA9B01B30833A64
[12536:12597:0512/142602:14411949178:ERROR:node_controller.cc(878)] Could not be introduced to peer 212B789CE1B959FD.16BA708E64DEF424
[12536:12597:0512/142602:14411953553:ERROR:node_controller.cc(878)] Could not be introduced to peer B7AB49C071E1D3CC.16E97EB56FB6D809
[12536:12597:0512/142602:14411953575:ERROR:node_controller.cc(878)] Could not be introduced to peer 212B789CE1B959FD.16BA708E64DEF424
[  FAILED  ] WidgetTestInteractive.WindowModalWindowDestroyedActivationTest (378 ms)
Status: Started (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, May 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8118b48cd97c983be355bce77215faa6de9c61a0

commit 8118b48cd97c983be355bce77215faa6de9c61a0
Author: jamescook <jamescook@chromium.org>
Date: Wed May 18 01:43:17 2016

mus: Show USER_PRIVATE window container during views tests

If that container starts hidden then tests that open normal user windows will
not be able to focus/activate them.

* Ensure the --user-test-config flag is set in views tests
* Set the USER_PRIVATE container visible when --user-test-config is set
* Rename components/mus/common/args.h to switches.h and place in "switches"
  namespace for consistency with Chrome code
* Add logging to window server for focus failures
* Re-enable WidgetTestInteractive.TouchSelectionQuickMenuIsNotActivated

BUG= 611601 
TEST=views_mus_interactive_ui_tests as above

Review-Url: https://codereview.chromium.org/1979323002
Cr-Commit-Position: refs/heads/master@{#394310}

[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/components/mus/common/BUILD.gn
[rename] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/components/mus/common/switches.cc
[rename] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/components/mus/common/switches.h
[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/components/mus/mus_app.cc
[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/components/mus/public/cpp/tests/window_server_shelltest_base.cc
[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/components/mus/ws/window_tree.cc
[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/mash/wm/root_window_controller.cc
[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/ui/views/mus/BUILD.gn
[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/ui/views/mus/views_mus_test_suite.cc
[modify] https://crrev.com/8118b48cd97c983be355bce77215faa6de9c61a0/ui/views/widget/widget_interactive_uitest.cc

Status: Fixed (was: Started)
Components: -MUS Internals>Services>WindowService

Sign in to add a comment