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

Issue 615033 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 28
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
mus



Sign in to add a comment

EventGenerator does not work correctly for tests in mus

Project Member Reported by sadrul@chromium.org, May 26 2016

Issue description

EventGenerator does not work correctly for views-tests, since in most of these tests, it operates on the root-window set-up by the TestScreen instance. However, since the Widgets (and their backing aura window trees) are disconnected from that, the events generated from EventGenerator do not reach their intended targets.

 

Comment 1 by sadrul@chromium.org, May 28 2016

Additional issue: once EventGenerator is used to move the mouse, it doesn't update display::Screen::GetCursorScreenPoint(). This is because ScreenMus::GetCursorScreenPoint() looks at a memory shared with mus-ws, and EventGenerator only moves the cursor in client-local space (i.e. mus-ws isn't aware of this change). So tests that depend on this directly or indirectly (e.g. View::IsMouseHovered()) does not work correctly.
Components: Internals>MUS
Labels: Proj-Mustash

Comment 3 by sky@chromium.org, Nov 10 2016

Labels: OS-Chrome
Sadrul's comment 1 effects aura-mus as well.
Components: -MUS
Labels: Proj-Mustash-Testing Proj-Mustash-Milestone-Tadpole Proj-Mustash-Mus-WS
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 11 2016

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

commit a178499ab5e3a157c30198dc94deed31104360d9
Author: sky <sky@chromium.org>
Date: Fri Nov 11 05:34:32 2016

Changes views_aura_mus_unittests to create DesktopNativeWidgetAura

And disables a bunch of tests that are either broke or don't make
sense.

Tests that don't call CreatePlatformNativeWidgetImpl() already
create a DesktopNativeWidgetAura, but those calling
CreatePlatformNativeWidgetImpl() ended up with a
NativeWidgetAura. This patch makes it so when aura-mus-client is used
CreatePlatformNativeWidgetImpl() creates a DesktopNativeWidgetAura
(assuming that is appropriate).

Additionally I'm making ViewsTestBase::GetContext() return null for
aura-mus-client. That way we sure see failures early on.

BUG= 663903  663809 663561  663868   664261   664280   615033 
TEST=covered by tests
R=msw@chromium.org

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

[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/BUILD.gn
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/accessible_pane_view_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/controls/button/menu_button_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/controls/menu/menu_controller_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/controls/menu/menu_runner_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/controls/native/native_view_host_aura_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/event_monitor_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/focus/focus_manager_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/mus/mus_client.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/mus/mus_client.h
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/mus/views_aura_mus_test_suite.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/mus/views_mus_test_suite.cc
[delete] https://crrev.com/93f33fbe1479699499e6e05793785a02fdb1cc81/ui/views/test/native_widget_factory.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/native_widget_factory.h
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/native_widget_factory_aura_mus.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/native_widget_factory_desktop.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/native_widget_factory_mus.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/platform_test_helper.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/platform_test_helper.h
[add] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/platform_test_helper_cocoa.mm
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/scoped_views_test_helper.h
[add] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/test_platform_native_widget.h
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/test_views.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/views_test_base.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/views_test_base.h
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/views_test_helper_aura.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/widget_test.h
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/widget_test_aura.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/test/widget_test_mac.mm
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/touchui/touch_selection_controller_impl_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/touchui/touch_selection_menu_runner_views_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/view_unittest_aura.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/widget/native_widget_aura_interactive_uitest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/widget/native_widget_mac_unittest.mm
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/widget/native_widget_unittest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/widget/widget_interactive_uitest.cc
[modify] https://crrev.com/a178499ab5e3a157c30198dc94deed31104360d9/ui/views/widget/widget_unittest.cc

Components: -Internals>MUS Internals>Services>WindowService
Labels: -Proj-Mustash-Mus-WS
Deprecating label Proj-Mustash-Mus-WS in favor of Components.
Labels: -Proj-Mustash Proj-Mash-SingleProcess
Owner: sky@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 28

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

commit 9aafab69cf07b5abf2b8baf173dc3bcb66cadf68
Author: Scott Violet <sky@chromium.org>
Date: Tue Aug 28 20:46:34 2018

events: replaces EventGenerator::delegate with a factory function

I need the ability for the delegate to have some additional context, and not
be long lived. By creating a unique delegate for each EventGenerator there can
be context per EventGenerator.

BUG= 615033 
TEST=this is a test only change

Change-Id: I9d8e099b940426b19d11071a427186573caf6b06
Reviewed-on: https://chromium-review.googlesource.com/1192124
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586840}
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ash/test/ash_test_base.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ash/test/ash_test_helper.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/chrome/test/base/default_ash_event_generator_delegate.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/chrome/test/base/default_ash_event_generator_delegate.h
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/chrome/test/base/in_process_browser_test.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/chromecast/graphics/accessibility/partial_magnification_controller_unittest.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/chromecast/graphics/gestures/side_swipe_detector_test.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/content/public/test/browser_test_base.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/aura/test/aura_test_helper.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/aura/test/event_generator_delegate_aura.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/aura/test/event_generator_delegate_aura.h
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/events/test/event_generator.cc
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/events/test/event_generator.h
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/views/test/event_generator_delegate_mac.h
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/views/test/event_generator_delegate_mac.mm
[modify] https://crrev.com/9aafab69cf07b5abf2b8baf173dc3bcb66cadf68/ui/views/test/views_test_helper_mac.mm

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 28

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

commit 03467435a89c3f25582bca1d56407825abd9b50e
Author: Scott Violet <sky@chromium.org>
Date: Tue Aug 28 22:11:39 2018

views: adds ability for EventGenerator to send events to mus

It's only used in views_mus_unittests, but the wiring is there for other
targets to make use of it.

BUG= 615033 
TEST=this is a test only change
TBR=tsepez@chromium.org

Change-Id: I1e85d71f241825dae65c7c2367244646b8ec4f19
Reviewed-on: https://chromium-review.googlesource.com/1192335
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586882}
[modify] https://crrev.com/03467435a89c3f25582bca1d56407825abd9b50e/ash/test/ash_test_helper.cc
[modify] https://crrev.com/03467435a89c3f25582bca1d56407825abd9b50e/chrome/test/base/default_ash_event_generator_delegate.cc
[modify] https://crrev.com/03467435a89c3f25582bca1d56407825abd9b50e/content/public/test/browser_test_base.cc
[modify] https://crrev.com/03467435a89c3f25582bca1d56407825abd9b50e/services/ws/public/mojom/event_injector.mojom
[modify] https://crrev.com/03467435a89c3f25582bca1d56407825abd9b50e/ui/aura/test/aura_test_helper.cc
[modify] https://crrev.com/03467435a89c3f25582bca1d56407825abd9b50e/ui/aura/test/event_generator_delegate_aura.cc
[modify] https://crrev.com/03467435a89c3f25582bca1d56407825abd9b50e/ui/aura/test/event_generator_delegate_aura.h

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 28

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

commit 07a159d001c0535ea940e278cca255608ad64ff5
Author: Scott Violet <sky@chromium.org>
Date: Tue Aug 28 22:52:18 2018

views: enable some tests with mus and cleanup comments

tooltip_controller_unittest and window_reorder_unittest mostly just
work with mus. There are a couple of things that need to be disabled, but
for the most part they just work.

Also adds comment as to why some tests are not in views_mus_unittests.

BUG= 615033 
TEST=this is a test only change

Change-Id: I2e77b2624557fa7e27f4f2abb0f4de86a2b3e772
Reviewed-on: https://chromium-review.googlesource.com/1194259
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586902}
[modify] https://crrev.com/07a159d001c0535ea940e278cca255608ad64ff5/ui/views/BUILD.gn
[modify] https://crrev.com/07a159d001c0535ea940e278cca255608ad64ff5/ui/views/corewm/tooltip_controller_unittest.cc

Status: Fixed (was: Started)
EventGenerator now works with mus. In chrome code, if you create an EventGenerator with a null window, the EventGenerator will end up sending events over mojom to ash. We may want to add some cover functions that abstract this way, but that can be done separately.
Project Member

Comment 14 by bugdroid1@chromium.org, Aug 29

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

commit 4e2673b8b28d725bc28a46a2b71bd62a22802ade
Author: Yuta Kitamura <yutak@chromium.org>
Date: Wed Aug 29 10:36:37 2018

Revert "views: enable some tests with mus and cleanup comments"

This reverts commit 07a159d001c0535ea940e278cca255608ad64ff5.

Reason for revert: caused LSan bot failure (leak).

https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/28776

Original change's description:
> views: enable some tests with mus and cleanup comments
> 
> tooltip_controller_unittest and window_reorder_unittest mostly just
> work with mus. There are a couple of things that need to be disabled, but
> for the most part they just work.
> 
> Also adds comment as to why some tests are not in views_mus_unittests.
> 
> BUG= 615033 
> TEST=this is a test only change
> 
> Change-Id: I2e77b2624557fa7e27f4f2abb0f4de86a2b3e772
> Reviewed-on: https://chromium-review.googlesource.com/1194259
> Commit-Queue: Scott Violet <sky@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#586902}

TBR=xiyuan@chromium.org,sky@chromium.org

Change-Id: I9145b351d92f2a54aca08c9f93b2a1335a3364b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  615033 
Reviewed-on: https://chromium-review.googlesource.com/1195404
Reviewed-by: Yuta Kitamura <yutak@chromium.org>
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587065}
[modify] https://crrev.com/4e2673b8b28d725bc28a46a2b71bd62a22802ade/ui/views/BUILD.gn
[modify] https://crrev.com/4e2673b8b28d725bc28a46a2b71bd62a22802ade/ui/views/corewm/tooltip_controller_unittest.cc

Sign in to add a comment