| Index: ui/views/test/views_test_helper_mac.h
|
| diff --git a/ui/views/test/views_test_helper_mac.h b/ui/views/test/views_test_helper_mac.h
|
| index 31fc0d8d09289aa3220eb97e138729ec3b4719bb..6dbb253e0fa647c169b6e4254fa201a1bd639d1b 100644
|
| --- a/ui/views/test/views_test_helper_mac.h
|
| +++ b/ui/views/test/views_test_helper_mac.h
|
| @@ -10,6 +10,9 @@
|
| #include "ui/views/test/views_test_helper.h"
|
|
|
| namespace ui {
|
| +namespace test {
|
| +class ScopedFakeNSWindowFocus;
|
| +}
|
| class ScopedAnimationDurationScaleMode;
|
| }
|
|
|
| @@ -21,12 +24,20 @@ class ViewsTestHelperMac : public ViewsTestHelper {
|
| ~ViewsTestHelperMac() override;
|
|
|
| // ViewsTestHelper:
|
| + void SetUp() override;
|
| void TearDown() override;
|
|
|
| private:
|
| // Disable animations during tests.
|
| scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
|
|
|
| + // When using desktop widgets on Mac, window activation is asynchronous
|
| + // because the window server is involved. A window may also be deactivated by
|
| + // a test running in parallel, making it flaky. In non-interactive/sharded
|
| + // tests, |faked_focus_| is initialized, permitting a unit test to "fake" this
|
| + // activation, causing it to be synchronous and per-process instead.
|
| + scoped_ptr<ui::test::ScopedFakeNSWindowFocus> faked_focus_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ViewsTestHelperMac);
|
| };
|
|
|
|
|