Chromium Code Reviews| Index: ash/common/test/ash_test.h |
| diff --git a/ash/common/test/ash_test.h b/ash/common/test/ash_test.h |
| index 161732a552dce5320cf291be8a6c168df4a8d5cf..e16162734fd9cd71eb366a99ed665e4cee87ea28 100644 |
| --- a/ash/common/test/ash_test.h |
| +++ b/ash/common/test/ash_test.h |
| @@ -13,6 +13,7 @@ |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "ui/display/manager/display_layout.h" |
| #include "ui/gfx/geometry/rect.h" |
| +#include "ui/views/widget/widget.h" |
| #include "ui/wm/public/window_types.h" |
| namespace display { |
| @@ -22,6 +23,7 @@ class Display; |
| namespace ash { |
| class AshTestImpl; |
| +class WmShelf; |
| class WmWindow; |
| // Wraps a WmWindow calling WmWindow::Destroy() from the destructor. WmWindow is |
| @@ -54,6 +56,12 @@ class AshTest : public testing::Test { |
| AshTest(); |
| ~AshTest() override; |
| + // Cover functions for WmShell::Get()->IsRunningInMash(). |
|
msw
2016/10/06 20:18:24
nit: "Cover functions"? maybe just "Calls WmShell:
sky
2016/10/06 21:05:58
Done.
|
| + static bool IsRunningInMash(); |
| + |
| + // Returns the WmShelf for the primary display. |
| + static WmShelf* GetPrimaryShelf(); |
| + |
| bool SupportsMultipleDisplays() const; |
| // Update the display configuration as given in |display_spec|. |
| @@ -69,6 +77,13 @@ class AshTest : public testing::Test { |
| ui::wm::WindowType type = ui::wm::WINDOW_TYPE_NORMAL, |
| int shell_window_id = kShellWindowId_Invalid); |
| + // Creates a visible top-level window. For aura a top-level window is a Window |
| + // that has a delegate, see aura::Window::GetToplevelWindow() for more |
| + // details. |
| + std::unique_ptr<WindowOwner> CreateToplevelTestWindow( |
| + const gfx::Rect& bounds_in_screen = gfx::Rect(), |
| + int shell_window_id = kShellWindowId_Invalid); |
| + |
| // Creates a visible window parented to |parent| with the specified bounds and |
| // id. |
| std::unique_ptr<WindowOwner> CreateChildWindow( |
| @@ -87,6 +102,24 @@ class AshTest : public testing::Test { |
| display::DisplayPlacement::Position position, |
| int offset); |
| + // Configures |init_params| so that the widget will be created on the same |
| + // display as |window|. |
| + void ConfigureWidgetInitParamsForDisplay( |
| + WmWindow* window, |
| + views::Widget::InitParams* init_params); |
| + |
| + // Adds |window| to the appropriate container in the primary root window. |
| + void ParentWindowInPrimaryRootWindow(WmWindow* window); |
| + |
| + // Adds |window| as as a transient child of |parent|. |
| + void AddTransientChild(WmWindow* parent, WmWindow* window); |
| + |
| + // Helper for calling TestSessionStateDelegate::SetCanLockScreen(). Controls |
| + // the return value from SessionStateDelegate::CanLockScreen(). |
| + void SetCanLockScreen(bool can_lock_screen); |
|
msw
2016/10/06 20:18:24
This seems a little unnecessary as an AshTest func
sky
2016/10/06 21:05:58
Agreed. Done.
|
| + |
| + void RunAllPendingInMessageLoop(); |
| + |
| protected: |
| // testing::Test: |
| void SetUp() override; |