| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WIDGET_TEST_H_ | 5 #ifndef UI_VIEWS_TEST_WIDGET_TEST_H_ |
| 6 #define UI_VIEWS_TEST_WIDGET_TEST_H_ | 6 #define UI_VIEWS_TEST_WIDGET_TEST_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // instance of the "native desktop" type. This is a PlatformNativeWidget on | 55 // instance of the "native desktop" type. This is a PlatformNativeWidget on |
| 56 // ChromeOS, and a PlatformDesktopNativeWidget everywhere else. | 56 // ChromeOS, and a PlatformDesktopNativeWidget everywhere else. |
| 57 Widget* CreateNativeDesktopWidget(); | 57 Widget* CreateNativeDesktopWidget(); |
| 58 | 58 |
| 59 View* GetMousePressedHandler(internal::RootView* root_view); | 59 View* GetMousePressedHandler(internal::RootView* root_view); |
| 60 | 60 |
| 61 View* GetMouseMoveHandler(internal::RootView* root_view); | 61 View* GetMouseMoveHandler(internal::RootView* root_view); |
| 62 | 62 |
| 63 View* GetGestureHandler(internal::RootView* root_view); | 63 View* GetGestureHandler(internal::RootView* root_view); |
| 64 | 64 |
| 65 // Simulate an OS-level destruction of the native window held by |widget|. | |
| 66 static void SimulateNativeDestroy(Widget* widget); | |
| 67 | |
| 68 // Simulate an activation of the native window held by |widget|, as if it was | 65 // Simulate an activation of the native window held by |widget|, as if it was |
| 69 // clicked by the user. This is a synchronous method for use in | 66 // clicked by the user. This is a synchronous method for use in |
| 70 // non-interactive tests that do not spin a RunLoop in the test body (since | 67 // non-interactive tests that do not spin a RunLoop in the test body (since |
| 71 // that may cause real focus changes to flakily manifest). | 68 // that may cause real focus changes to flakily manifest). |
| 72 static void SimulateNativeActivate(Widget* widget); | 69 static void SimulateNativeActivate(Widget* widget); |
| 73 | 70 |
| 74 // Return true if |window| is visible according to the native platform. | 71 // Return true if |window| is visible according to the native platform. |
| 75 static bool IsNativeWindowVisible(gfx::NativeWindow window); | 72 static bool IsNativeWindowVisible(gfx::NativeWindow window); |
| 76 | 73 |
| 77 // Return true if |above| is higher than |below| in the native window Z-order. | 74 // Return true if |above| is higher than |below| in the native window Z-order. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 bool observed_; | 172 bool observed_; |
| 176 bool active_; | 173 bool active_; |
| 177 | 174 |
| 178 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter); | 175 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter); |
| 179 }; | 176 }; |
| 180 | 177 |
| 181 } // namespace test | 178 } // namespace test |
| 182 } // namespace views | 179 } // namespace views |
| 183 | 180 |
| 184 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ | 181 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ |
| OLD | NEW |