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

Side by Side Diff: ash/wm/workspace/workspace_window_resizer_unittest.cc

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dock with zero width (exposing DragWindowResizer for tests, rebase) Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/workspace/workspace_window_resizer.h" 5 #include "ash/wm/workspace/workspace_window_resizer.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/display_controller.h" 8 #include "ash/display/display_controller.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/screen_ash.h" 10 #include "ash/screen_ash.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 result += base::IntToString((*i)->id()); 130 result += base::IntToString((*i)->id());
131 } 131 }
132 } 132 }
133 return result; 133 return result;
134 } 134 }
135 135
136 protected: 136 protected:
137 gfx::Point CalculateDragPoint(const WorkspaceWindowResizer& resizer, 137 gfx::Point CalculateDragPoint(const WorkspaceWindowResizer& resizer,
138 int delta_x, 138 int delta_x,
139 int delta_y) const { 139 int delta_y) const {
140 gfx::Point location = resizer.GetInitialLocationInParentForTest(); 140 gfx::Point location = resizer.GetInitialLocationForTest();
141 location.set_x(location.x() + delta_x); 141 location.set_x(location.x() + delta_x);
142 location.set_y(location.y() + delta_y); 142 location.set_y(location.y() + delta_y);
143 return location; 143 return location;
144 } 144 }
145 145
146 std::vector<aura::Window*> empty_windows() const { 146 std::vector<aura::Window*> empty_windows() const {
147 return std::vector<aura::Window*>(); 147 return std::vector<aura::Window*>();
148 } 148 }
149 149
150 internal::ShelfLayoutManager* shelf_layout_manager() { 150 internal::ShelfLayoutManager* shelf_layout_manager() {
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 ASSERT_TRUE(resizer.get()); 1580 ASSERT_TRUE(resizer.get());
1581 // Move it 50 to the left, which should contract w1 and expand w2-3. 1581 // Move it 50 to the left, which should contract w1 and expand w2-3.
1582 resizer->Drag(CalculateDragPoint(*resizer, -50, 0), 0); 1582 resizer->Drag(CalculateDragPoint(*resizer, -50, 0), 0);
1583 EXPECT_EQ("100,100 98x100", window_->bounds().ToString()); 1583 EXPECT_EQ("100,100 98x100", window_->bounds().ToString());
1584 EXPECT_EQ("198,100 101x100", window2_->bounds().ToString()); 1584 EXPECT_EQ("198,100 101x100", window2_->bounds().ToString());
1585 EXPECT_EQ("299,100 101x100", window3_->bounds().ToString()); 1585 EXPECT_EQ("299,100 101x100", window3_->bounds().ToString());
1586 } 1586 }
1587 1587
1588 } // namespace internal 1588 } // namespace internal
1589 } // namespace ash 1589 } // namespace ash
OLDNEW
« ash/wm/window_resizer.h ('K') | « ash/wm/workspace/workspace_window_resizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698