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 ScopedFakeFullKeyboardAccess; |
16 class ScopedFakeNSWindowFocus; | 16 class ScopedFakeNSWindowFocus; |
17 class ScopedFakeNSWindowFullscreen; | 17 class ScopedFakeNSWindowFullscreen; |
18 } | 18 } |
19 class ScopedAnimationDurationScaleMode; | 19 class ScopedAnimationDurationScaleMode; |
20 } | 20 } |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 | 23 |
| 24 class Widget; |
| 25 |
24 class ViewsTestHelperMac : public ViewsTestHelper { | 26 class ViewsTestHelperMac : public ViewsTestHelper { |
25 public: | 27 public: |
26 ViewsTestHelperMac(); | 28 ViewsTestHelperMac(); |
27 ~ViewsTestHelperMac() override; | 29 ~ViewsTestHelperMac() override; |
28 | 30 |
29 // ViewsTestHelper: | 31 // ViewsTestHelper: |
30 void SetUp() override; | 32 void SetUp() override; |
31 void TearDown() override; | 33 void TearDown() override; |
| 34 void SetFullKeyboardAccessState(Widget* widget, bool new_state) override; |
32 | 35 |
33 private: | 36 private: |
34 // Disable animations during tests. | 37 // Disable animations during tests. |
35 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; | 38 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; |
36 | 39 |
37 // When using desktop widgets on Mac, window activation is asynchronous | 40 // When using desktop widgets on Mac, window activation is asynchronous |
38 // because the window server is involved. A window may also be deactivated by | 41 // because the window server is involved. A window may also be deactivated by |
39 // a test running in parallel, making it flaky. In non-interactive/sharded | 42 // a test running in parallel, making it flaky. In non-interactive/sharded |
40 // tests, |faked_focus_| is initialized, permitting a unit test to "fake" this | 43 // tests, |faked_focus_| is initialized, permitting a unit test to "fake" this |
41 // activation, causing it to be synchronous and per-process instead. | 44 // activation, causing it to be synchronous and per-process instead. |
(...skipping 11 matching lines...) Expand all Loading... |
53 // default. | 56 // default. |
54 std::unique_ptr<ui::test::ScopedFakeFullKeyboardAccess> | 57 std::unique_ptr<ui::test::ScopedFakeFullKeyboardAccess> |
55 faked_full_keyboard_access_; | 58 faked_full_keyboard_access_; |
56 | 59 |
57 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelperMac); | 60 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelperMac); |
58 }; | 61 }; |
59 | 62 |
60 } // namespace views | 63 } // namespace views |
61 | 64 |
62 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ | 65 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_MAC_H_ |
OLD | NEW |