Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2670)

Unified Diff: ash/common/test/ash_test.h

Issue 2391153002: Converts most of WorkspaceLayoutManager tests to use common code (Closed)
Patch Set: merge Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/common/test/ash_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8f44db26c4ac11d64fbaa105057e72a80f480d69 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,21 +56,32 @@ class AshTest : public testing::Test {
AshTest();
~AshTest() override;
+ // Returns the WmShelf for the primary display.
+ static WmShelf* GetPrimaryShelf();
+
bool SupportsMultipleDisplays() const;
// Update the display configuration as given in |display_spec|.
// See test::DisplayManagerTestApi::UpdateDisplay for more details.
void UpdateDisplay(const std::string& display_spec);
- // Creates a top level visible window in the appropriate container. If
- // |bounds_in_screen| is empty the window is added to the primary root window,
- // otherwise the window is added to the display matching |bounds_in_screen|.
- // |shell_window_id| is the shell window id to give to the new window.
+ // Creates a visible window in the appropriate container. If
+ // |bounds_in_screen| is empty the window is added to the primary root
+ // window, otherwise the window is added to the display matching
+ // |bounds_in_screen|. |shell_window_id| is the shell window id to give to
+ // the new window.
std::unique_ptr<WindowOwner> CreateTestWindow(
const gfx::Rect& bounds_in_screen = gfx::Rect(),
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 +100,20 @@ 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);
+
+ void RunAllPendingInMessageLoop();
+
protected:
// testing::Test:
void SetUp() override;
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/common/test/ash_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698