DescriptionMacViews: Enhance aura's EventGenerator to abstract platform-specific event generation for tests.
The focus of this CL is to get widget_unittest.cc compiling on MacViews.
To achieve this, aura::test::EventGenerator is moved to ui/events/test
and constructed with a delegate class that abstracts away the
platform-specific event targeting and coordinate conversions.
ui::test::EventGenerator::CreateDefaultPlatformDelegate(..) allows a default
platform-specific EventGeneratorDelegate to be provided so that
this detail is hidden from tests.
On Mac, this delegate wraps a single NSWindow and targets NSEvents at
that window. On Aura, the delegate is a thin wrapper to find and target
events at an aura::Window, using the aura root window as the initial
target.
For Mac, NativeWidgetPrivate::IsMouseButtonDown and NSView mouse event
handling in BridgedContentView is implemented to put the Mac event
generator in context.
Adds views_unittest WidgetTest.MouseEventTypesViaGenerator to ensure
event generation is consistent across platforms (which currently passes
on Mac). Allows an additional 67 tests to compile on Mac (49 pass).
After this, widget_unittests.cc compiles on Mac. views_unittests has:
Before: 358 tests run 10 tests failed 16 tests crashed.
After: 425 tests run 24 tests failed 20 tests crashed.
BUG=378134
TEST=views_unittests
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283694
Patch Set 1 : rebase onto crrev/329743002 #Patch Set 2 : cull orthogonal stuff, add WidgetTest.MouseEventTypesViaGenerator #
Total comments: 12
Patch Set 3 : respond to comments, fix aura #Patch Set 4 : Rebase on crrev/334573008 #
Total comments: 4
Patch Set 5 : respond to comments: common EventGeneratorBase #Patch Set 6 : rebase at r282511 #
Total comments: 5
Patch Set 7 : Move to events/test. ui:: stripping deferred. fix new win64 warnings (enabled in events) #
Total comments: 2
Patch Set 8 : rebase for r283070 conflict #Patch Set 9 : self review + related fix for r283070 #
Total comments: 2
Patch Set 10 : just a rebase (views.gyp conflict and `context` now a NativeWindow) #Patch Set 11 : No inheritance #
Total comments: 4
Patch Set 12 : -> event_generator_delegate_mac.mm, comment fixes #
Total comments: 2
Messages
Total messages: 28 (0 generated)
|