| Index: ui/views/test/menu_test_utils.h
|
| diff --git a/ui/views/test/menu_test_utils.h b/ui/views/test/menu_test_utils.h
|
| index b6718275b2cdb4143676ac3e3204b45ea61d2c1b..6a7dbfa365b123a1c37aa841a26277922d62157e 100644
|
| --- a/ui/views/test/menu_test_utils.h
|
| +++ b/ui/views/test/menu_test_utils.h
|
| @@ -6,9 +6,13 @@
|
| #define UI_VIEWS_TEST_MENU_TEST_UTILS_H_
|
|
|
| #include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "ui/views/controls/menu/menu_delegate.h"
|
|
|
| namespace views {
|
| +
|
| +class MenuController;
|
| +
|
| namespace test {
|
|
|
| // Test implementation of MenuDelegate that tracks calls to MenuDelegate, along
|
| @@ -52,17 +56,29 @@ class TestMenuDelegate : public MenuDelegate {
|
| DISALLOW_COPY_AND_ASSIGN(TestMenuDelegate);
|
| };
|
|
|
| -// Test api which can be used to hide the active MenuController, without
|
| -// performing normal shutdown.
|
| +// Test api which caches the currently active MenuController. Can be used to
|
| +// toggle visibility, and to clear seletion states, without performing full
|
| +// shutdown. This is used to simulate menus with varing states, such as during
|
| +// drags, without performing the entire operation. Used to test strange shutdown
|
| +// ordering.
|
| class MenuControllerTestApi {
|
| public:
|
| MenuControllerTestApi();
|
| ~MenuControllerTestApi();
|
|
|
| - // Tells the active MenuController to consider itself not showing.
|
| - void Hide();
|
| + MenuController* controller() { return controller_.get(); };
|
| +
|
| + // Clears out the current and pending states, without notifying the associated
|
| + // menu items.
|
| + void ClearState();
|
| +
|
| + // Toggles the internal showing state of |controller_| without attempting
|
| + // to change associated Widgets.
|
| + void SetShowing(bool showing);
|
|
|
| private:
|
| + base::WeakPtr<MenuController> controller_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MenuControllerTestApi);
|
| };
|
|
|
|
|