summaryrefslogtreecommitdiffstats
path: root/extensions/utility
diff options
context:
space:
mode:
authortapted <tapted@chromium.org>2015-01-14 17:01:27 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-15 01:02:42 +0000
commitf8346eaaa8271f81474f1daf9cc5fcb436d358ac (patch)
tree6a2552f5142fc541a13eceb2e1777f7ab9cc5dab /extensions/utility
parent7ff0672b2a8c73be5a0164a04bc9c53f64f4b138 (diff)
downloadchromium_src-f8346eaaa8271f81474f1daf9cc5fcb436d358ac.zip
chromium_src-f8346eaaa8271f81474f1daf9cc5fcb436d358ac.tar.gz
chromium_src-f8346eaaa8271f81474f1daf9cc5fcb436d358ac.tar.bz2
MacViews: Fix widget activation.
Fixes NativeWidetMac::IsActive(), and gets some WidgetTestInteractive activation tests passing, without regressing any views_unittests. NativeWidetMac::IsActive had a bit of a hack to try to make it synchronous. This once allowed tests designed for non-Desktop Aura widgets to work the same for *desktop* widgets on Mac, but it was never quite right. For Aura, these tests are using non-Desktop Aura widgets, which are parented off the root window and are able to ask the per-process aura window manager for the active window. This avoids having to run in an interactive_ui_test. However, the same is not true for desktop Aura widgets (e.g. activation on desktop Linux needs to communicate with the window server and has the same problems here as Mac if desktop widgets are used). On Mac, all widgets are desktop widgets for now. Calls to activate the window are mostly processed synchronously (e.g. visibility and layering). However, the system does not update the window reported by [NSApplication keyWindow] in the same runloop iteration. IsActive() on Mac is now just [NSWindow isKeyWindow], and Widget::CanActivate() is honored. To avoid making textfield views_unittests flaky, test::WidgetTest::FakeWidgetIsActiveAlways() is added. On Mac, this calls into the Objective-C runtime to force [NSWindow isKeyWindow] to return `YES`. To avoid making a subset of WidgetTests using GetWidgetShowState() flaky, these tests (and GetWidgetShowState()) are moved to WidgetTestInteractive, and a WidgetObserver used on Mac to ensure an activation is processed by the OS. Moving these previously non-interactive UI tests to interactive_ui_tests isn't ideal. However, it means a follow-up can enable these tests for desktop widgets on other (non-Mac) desktop platforms, which use different codepaths and are currently missing out on some coverage. Gets the following tests passing: WidgetTestInteractive.CanActivateFlagIsHonored WidgetTestInteractive.DisableViewDoesNotActivateWidget WidgetTestInteractive.ViewFocusOnWidgetActivationChanges BUG=402679 Review URL: https://codereview.chromium.org/840183002 Cr-Commit-Position: refs/heads/master@{#311597}
Diffstat (limited to 'extensions/utility')
0 files changed, 0 insertions, 0 deletions