mash: widget->IsActive() fails in tests because USER_PRIVATE window container is not visible |
||||
Issue descriptionThis 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.
,
May 16 2016
,
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
,
May 18 2016
,
Feb 26 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by jamescook@chromium.org
, May 13 2016