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

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
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;
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/common/test/ash_test.cc » ('j') | ash/common/wm_window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698