OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ | 5 #ifndef UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ |
6 #define UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ | 6 #define UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/views/test/views_test_helper.h" | 11 #include "ui/views/test/views_test_helper.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 namespace test { | 14 namespace test { |
| 15 class ScopedFakeFullKeyboardAccess; |
15 class ScopedFakeNSWindowFocus; | 16 class ScopedFakeNSWindowFocus; |
16 class ScopedFakeNSWindowFullscreen; | 17 class ScopedFakeNSWindowFullscreen; |
17 } | 18 } |
18 class ScopedAnimationDurationScaleMode; | 19 class ScopedAnimationDurationScaleMode; |
19 } | 20 } |
20 | 21 |
21 namespace views { | 22 namespace views { |
22 | 23 |
23 class ViewsTestHelperMac : public ViewsTestHelper { | 24 class ViewsTestHelperMac : public ViewsTestHelper { |
24 public: | 25 public: |
(...skipping 14 matching lines...) Expand all Loading... |
39 // tests, |faked_focus_| is initialized, permitting a unit test to "fake" this | 40 // tests, |faked_focus_| is initialized, permitting a unit test to "fake" this |
40 // activation, causing it to be synchronous and per-process instead. | 41 // activation, causing it to be synchronous and per-process instead. |
41 std::unique_ptr<ui::test::ScopedFakeNSWindowFocus> faked_focus_; | 42 std::unique_ptr<ui::test::ScopedFakeNSWindowFocus> faked_focus_; |
42 | 43 |
43 // Toggling fullscreen mode on Mac can be flaky for tests run in parallel | 44 // Toggling fullscreen mode on Mac can be flaky for tests run in parallel |
44 // because only one window may be animating into or out of fullscreen at a | 45 // because only one window may be animating into or out of fullscreen at a |
45 // time. In non-interactive/sharded tests, |faked_fullscreen_| is initialized, | 46 // time. In non-interactive/sharded tests, |faked_fullscreen_| is initialized, |
46 // permitting a unit test to 'fake' toggling fullscreen mode. | 47 // permitting a unit test to 'fake' toggling fullscreen mode. |
47 std::unique_ptr<ui::test::ScopedFakeNSWindowFullscreen> faked_fullscreen_; | 48 std::unique_ptr<ui::test::ScopedFakeNSWindowFullscreen> faked_fullscreen_; |
48 | 49 |
| 50 // Enable fake full keyboard access by default, so that tests don't depend on |
| 51 // system setting of the test machine. Also, this helps to make tests on Mac |
| 52 // more consistent with other platforms, where most views are focusable by |
| 53 // default. |
| 54 std::unique_ptr<ui::test::ScopedFakeFullKeyboardAccess> |
| 55 faked_full_keyboard_access_; |
| 56 |
49 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelperMac); | 57 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelperMac); |
50 }; | 58 }; |
51 | 59 |
52 } // namespace views | 60 } // namespace views |
53 | 61 |
54 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ | 62 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ |
OLD | NEW |