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

Unified Diff: ash/wm/workspace/workspace_window_resizer_unittest.cc

Issue 2617733002: Hide docked windows behind a flag (Closed)
Patch Set: Fix tests failed because of DCHECK Created 3 years, 11 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/wm/workspace/workspace_window_resizer_unittest.cc
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index 1bf44f64e3cac4caa00026cdd9ef58ac8402913e..954ae6519eeeefaa9e55bc41699c1ce338150fa4 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/common/wm/workspace/workspace_window_resizer.h"
#include "ash/aura/wm_window_aura.h"
+#include "ash/common/ash_switches.h"
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm/window_positioning_utils.h"
@@ -650,6 +651,11 @@ TEST_P(WorkspaceWindowResizerTest, CancelSnapPhantom) {
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
display::Screen::GetScreen()->GetPrimaryDisplay());
+
+ // Make the window snappable by making it resizable and maximizable.
+ window_->SetProperty(aura::client::kResizeBehaviorKey,
+ ui::mojom::kResizeBehaviorCanResize |
+ ui::mojom::kResizeBehaviorCanMaximize);
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity());
{
@@ -1502,6 +1508,15 @@ TEST_P(WorkspaceWindowResizerTest, TestPartialMaxSizeEnforced) {
// Test that a window with a specified max size can't be snapped.
TEST_P(WorkspaceWindowResizerTest, PhantomSnapMaxSize) {
+ // Make the window snappable by making it resizable and maximizable.
+ window_->SetProperty(aura::client::kResizeBehaviorKey,
+ ui::mojom::kResizeBehaviorCanResize |
+ ui::mojom::kResizeBehaviorCanMaximize);
+
+ // Enable docking for this test.
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ ash::switches::kAshEnableDockedWindows);
+
{
// With max size not set we get a phantom window controller for dragging off
// the right hand side.

Powered by Google App Engine
This is Rietveld 408576698