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 359d0b67a184d4b507dd139916c4c14f1d9d1ef8..850a971eca50abdb46c2d08ba0480d616a341f6f 100644 |
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc |
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc |
@@ -83,7 +83,8 @@ class WorkspaceWindowResizerTest : public test::AshTestBase { |
EXPECT_EQ(kRootHeight, root_bounds.height()); |
#endif |
EXPECT_EQ(800, root_bounds.width()); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, |
+ gfx::Insets()); |
window_.reset(new aura::Window(&delegate_)); |
window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
window_->Init(ui::LAYER_NOT_DRAWN); |
@@ -434,7 +435,7 @@ TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_2) { |
TEST_F(WorkspaceWindowResizerTest, MAYBE_AttachedResize_BOTTOM_3) { |
UpdateDisplay("600x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
window_->SetBounds(gfx::Rect( 300, 100, 300, 200)); |
window2_->SetBounds(gfx::Rect(300, 300, 200, 150)); |
@@ -792,7 +793,7 @@ TEST_F(WorkspaceWindowResizerTest, RestackAttached) { |
// Makes sure we don't allow dragging below the work area. |
TEST_F(WorkspaceWindowResizerTest, DontDragOffBottom) { |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 10, 0)); |
ASSERT_EQ(1, Shell::GetScreen()->GetNumDisplays()); |
@@ -816,7 +817,7 @@ TEST_F(WorkspaceWindowResizerTest, DontDragOffBottomWithMultiDisplay) { |
UpdateDisplay("800x600,800x600"); |
ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 10, 0)); |
// Positions the secondary display at the bottom the primary display. |
@@ -842,7 +843,7 @@ TEST_F(WorkspaceWindowResizerTest, DontDragOffBottomWithMultiDisplay) { |
resizer->RevertDrag(); |
} |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 10, 0)); |
{ |
window_->SetBounds(gfx::Rect(100, 200, 300, 400)); |
@@ -876,7 +877,7 @@ TEST_F(WorkspaceWindowResizerTest, DontDragOffBottomWithMultiDisplay) { |
// Makes sure we don't allow dragging off the top of the work area. |
TEST_F(WorkspaceWindowResizerTest, DontDragOffTop) { |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(10, 0, 0, 0)); |
window_->SetBounds(gfx::Rect(100, 200, 300, 400)); |
@@ -888,7 +889,7 @@ TEST_F(WorkspaceWindowResizerTest, DontDragOffTop) { |
} |
TEST_F(WorkspaceWindowResizerTest, ResizeBottomOutsideWorkArea) { |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 50, 0)); |
window_->SetBounds(gfx::Rect(100, 200, 300, 380)); |
@@ -900,7 +901,7 @@ TEST_F(WorkspaceWindowResizerTest, ResizeBottomOutsideWorkArea) { |
} |
TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideLeftWorkArea) { |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 50, 0)); |
int left = ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_.get()).x(); |
int pixels_to_left_border = 50; |
@@ -917,7 +918,7 @@ TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideLeftWorkArea) { |
} |
TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideRightWorkArea) { |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 50, 0)); |
int right = ScreenUtil::GetDisplayWorkAreaBoundsInParent( |
window_.get()).right(); |
@@ -937,7 +938,7 @@ TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideRightWorkArea) { |
} |
TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideBottomWorkArea) { |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 50, 0)); |
int bottom = ScreenUtil::GetDisplayWorkAreaBoundsInParent( |
window_.get()).bottom(); |
@@ -961,7 +962,7 @@ TEST_F(WorkspaceWindowResizerTest, ResizeWindowOutsideBottomWorkArea) { |
TEST_F(WorkspaceWindowResizerTest, DragWindowOutsideRightToSecondaryDisplay) { |
// Only primary display. Changes the window position to fit within the |
// display. |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 50, 0)); |
int right = ScreenUtil::GetDisplayWorkAreaBoundsInParent( |
window_.get()).right(); |
@@ -984,7 +985,7 @@ TEST_F(WorkspaceWindowResizerTest, DragWindowOutsideRightToSecondaryDisplay) { |
// With secondary display. Operation itself is same but doesn't change |
// the position because the window is still within the secondary display. |
UpdateDisplay("1000x600,600x400"); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets( |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting( |
Shell::GetPrimaryRootWindow(), gfx::Insets(0, 0, 50, 0)); |
window_->SetBounds(gfx::Rect(window_x, 100, window_width, 380)); |
resizer->Drag(CalculateDragPoint(*resizer, window_width, 0), 0); |
@@ -1516,7 +1517,7 @@ TEST_F(WorkspaceWindowResizerTest, PhantomSnapMaxSize) { |
TEST_F(WorkspaceWindowResizerTest, DontRewardRightmostWindowForOverflows) { |
UpdateDisplay("600x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Four 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |
@@ -1547,7 +1548,7 @@ TEST_F(WorkspaceWindowResizerTest, DontRewardRightmostWindowForOverflows) { |
TEST_F(WorkspaceWindowResizerTest, DontExceedMaxWidth) { |
UpdateDisplay("600x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Four 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |
@@ -1576,7 +1577,7 @@ TEST_F(WorkspaceWindowResizerTest, DontExceedMaxWidth) { |
TEST_F(WorkspaceWindowResizerTest, DontExceedMaxHeight) { |
UpdateDisplay("600x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Four 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |
@@ -1612,7 +1613,7 @@ TEST_F(WorkspaceWindowResizerTest, DontExceedMaxHeight) { |
TEST_F(WorkspaceWindowResizerTest, MAYBE_DontExceedMinHeight) { |
UpdateDisplay("600x500"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Four 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |
@@ -1641,7 +1642,7 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_DontExceedMinHeight) { |
TEST_F(WorkspaceWindowResizerTest, DontExpandRightmostPastMaxWidth) { |
UpdateDisplay("600x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Three 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |
@@ -1667,7 +1668,7 @@ TEST_F(WorkspaceWindowResizerTest, DontExpandRightmostPastMaxWidth) { |
TEST_F(WorkspaceWindowResizerTest, MoveAttachedWhenGrownToMaxSize) { |
UpdateDisplay("600x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Three 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |
@@ -1701,7 +1702,7 @@ TEST_F(WorkspaceWindowResizerTest, MoveAttachedWhenGrownToMaxSize) { |
TEST_F(WorkspaceWindowResizerTest, MAYBE_MainWindowHonoursMaxWidth) { |
UpdateDisplay("400x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Three 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |
@@ -1728,7 +1729,7 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_MainWindowHonoursMaxWidth) { |
TEST_F(WorkspaceWindowResizerTest, MainWindowHonoursMinWidth) { |
UpdateDisplay("400x800"); |
aura::Window* root = Shell::GetPrimaryRootWindow(); |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
+ Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(root, gfx::Insets()); |
// Three 100x100 windows flush against eachother, starting at 100,100. |
window_->SetBounds(gfx::Rect( 100, 100, 100, 100)); |