OLD | NEW |
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/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "base/string_number_conversions.h" |
9 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
10 #include "ui/aura/screen_aura.h" | 11 #include "ui/aura/screen_aura.h" |
11 #include "ui/aura/test/test_window_delegate.h" | 12 #include "ui/aura/test/test_window_delegate.h" |
12 #include "ui/base/hit_test.h" | 13 #include "ui/base/hit_test.h" |
13 | 14 |
14 namespace ash { | 15 namespace ash { |
15 namespace internal { | 16 namespace internal { |
16 namespace { | 17 namespace { |
17 | 18 |
18 const int kRootHeight = 600; | 19 const int kRootHeight = 600; |
(...skipping 28 matching lines...) Expand all Loading... |
47 virtual void SetUp() OVERRIDE { | 48 virtual void SetUp() OVERRIDE { |
48 AshTestBase::SetUp(); | 49 AshTestBase::SetUp(); |
49 aura::RootWindow* root = Shell::GetInstance()->GetRootWindow(); | 50 aura::RootWindow* root = Shell::GetInstance()->GetRootWindow(); |
50 root->SetBounds(gfx::Rect(0, 0, 800, kRootHeight)); | 51 root->SetBounds(gfx::Rect(0, 0, 800, kRootHeight)); |
51 gfx::Rect root_bounds(root->bounds()); | 52 gfx::Rect root_bounds(root->bounds()); |
52 EXPECT_EQ(kRootHeight, root_bounds.height()); | 53 EXPECT_EQ(kRootHeight, root_bounds.height()); |
53 root->SetScreenWorkAreaInsets(gfx::Insets()); | 54 root->SetScreenWorkAreaInsets(gfx::Insets()); |
54 window_.reset(new aura::Window(&delegate_)); | 55 window_.reset(new aura::Window(&delegate_)); |
55 window_->Init(ui::Layer::LAYER_NOT_DRAWN); | 56 window_->Init(ui::Layer::LAYER_NOT_DRAWN); |
56 window_->SetParent(Shell::GetInstance()->GetRootWindow()); | 57 window_->SetParent(Shell::GetInstance()->GetRootWindow()); |
| 58 |
| 59 window2_.reset(new aura::Window(&delegate2_)); |
| 60 window2_->Init(ui::Layer::LAYER_NOT_DRAWN); |
| 61 window2_->SetParent(Shell::GetInstance()->GetRootWindow()); |
| 62 |
| 63 window3_.reset(new aura::Window(&delegate3_)); |
| 64 window3_->Init(ui::Layer::LAYER_NOT_DRAWN); |
| 65 window3_->SetParent(Shell::GetInstance()->GetRootWindow()); |
57 } | 66 } |
58 | 67 |
59 virtual void TearDown() OVERRIDE { | 68 virtual void TearDown() OVERRIDE { |
60 window_.reset(); | 69 window_.reset(); |
| 70 window2_.reset(); |
| 71 window3_.reset(); |
61 AshTestBase::TearDown(); | 72 AshTestBase::TearDown(); |
62 } | 73 } |
63 | 74 |
64 protected: | 75 protected: |
65 gfx::Point CalculateDragPoint(const WindowResizer& resizer, | 76 gfx::Point CalculateDragPoint(const WorkspaceWindowResizer& resizer, |
| 77 int delta_x, |
66 int delta_y) const { | 78 int delta_y) const { |
67 gfx::Point location = resizer.initial_location_in_parent(); | 79 gfx::Point location = resizer.initial_location_in_parent(); |
| 80 location.set_x(location.x() + delta_x); |
68 location.set_y(location.y() + delta_y); | 81 location.set_y(location.y() + delta_y); |
69 aura::Window::ConvertPointToWindow(window_->parent(), window_.get(), | |
70 &location); | |
71 return location; | 82 return location; |
72 } | 83 } |
73 | 84 |
74 TestWindowDelegate delegate_; | 85 TestWindowDelegate delegate_; |
| 86 TestWindowDelegate delegate2_; |
| 87 TestWindowDelegate delegate3_; |
75 scoped_ptr<aura::Window> window_; | 88 scoped_ptr<aura::Window> window_; |
| 89 scoped_ptr<aura::Window> window2_; |
| 90 scoped_ptr<aura::Window> window3_; |
76 | 91 |
77 private: | 92 private: |
78 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizerTest); | 93 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizerTest); |
79 }; | 94 }; |
80 | 95 |
81 // Assertions around making sure dragging shrinks when appropriate. | 96 // Assertions around making sure dragging shrinks when appropriate. |
82 TEST_F(WorkspaceWindowResizerTest, ShrinkOnDrag) { | 97 TEST_F(WorkspaceWindowResizerTest, ShrinkOnDrag) { |
83 int initial_y = 300; | 98 int initial_y = 300; |
84 window_->SetBounds(gfx::Rect(0, initial_y, 400, 296)); | 99 window_->SetBounds(gfx::Rect(0, initial_y, 400, 296)); |
85 | 100 |
86 // Drag down past the bottom of the screen, height should stop when it hits | 101 // Drag down past the bottom of the screen, height should stop when it hits |
87 // the bottom. | 102 // the bottom. |
88 { | 103 { |
89 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTBOTTOM, 0); | 104 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
90 EXPECT_TRUE(resizer.is_resizable()); | 105 window_.get(), gfx::Point(), HTBOTTOM, 0)); |
91 resizer.Drag(CalculateDragPoint(resizer, 600)); | 106 ASSERT_TRUE(resizer.get()); |
| 107 resizer->Drag(CalculateDragPoint(*resizer, 0, 600)); |
92 EXPECT_EQ(kRootHeight - initial_y, window_->bounds().height()); | 108 EXPECT_EQ(kRootHeight - initial_y, window_->bounds().height()); |
93 | 109 |
94 // Drag up 10 and make sure height is the same. | 110 // Drag up 10 and make sure height is the same. |
95 resizer.Drag(CalculateDragPoint(resizer, 590)); | 111 resizer->Drag(CalculateDragPoint(*resizer, 0, 590)); |
96 EXPECT_EQ(kRootHeight - initial_y, window_->bounds().height()); | 112 EXPECT_EQ(kRootHeight - initial_y, window_->bounds().height()); |
97 } | 113 } |
98 | 114 |
99 { | 115 { |
100 // Move the window down 10 pixels, the height should change. | 116 // Move the window down 10 pixels, the height should change. |
101 int initial_height = window_->bounds().height(); | 117 int initial_height = window_->bounds().height(); |
102 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 118 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
103 resizer.Drag(CalculateDragPoint(resizer, 10)); | 119 window_.get(), gfx::Point(), HTCAPTION, 0)); |
| 120 ASSERT_TRUE(resizer.get()); |
| 121 resizer->Drag(CalculateDragPoint(*resizer, 0, 10)); |
104 EXPECT_EQ(initial_height - 10, window_->bounds().height()); | 122 EXPECT_EQ(initial_height - 10, window_->bounds().height()); |
105 | 123 |
106 // Move up 10, height should grow. | 124 // Move up 10, height should grow. |
107 resizer.Drag(CalculateDragPoint(resizer, 0)); | 125 resizer->Drag(CalculateDragPoint(*resizer, 0, 0)); |
108 EXPECT_EQ(initial_height, window_->bounds().height()); | 126 EXPECT_EQ(initial_height, window_->bounds().height()); |
109 | 127 |
110 // Move up another 10, height shouldn't change. | 128 // Move up another 10, height shouldn't change. |
111 resizer.Drag(CalculateDragPoint(resizer, -10)); | 129 resizer->Drag(CalculateDragPoint(*resizer, 0, -10)); |
112 EXPECT_EQ(initial_height, window_->bounds().height()); | 130 EXPECT_EQ(initial_height, window_->bounds().height()); |
113 } | 131 } |
114 } | 132 } |
115 | 133 |
116 // More assertions around making sure dragging shrinks when appropriate. | 134 // More assertions around making sure dragging shrinks when appropriate. |
117 TEST_F(WorkspaceWindowResizerTest, ShrinkOnDrag2) { | 135 TEST_F(WorkspaceWindowResizerTest, ShrinkOnDrag2) { |
118 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); | 136 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); |
119 | 137 |
120 // Drag down past the bottom of the screen, height should stop when it hits | 138 // Drag down past the bottom of the screen, height should stop when it hits |
121 // the bottom. | 139 // the bottom. |
122 { | 140 { |
123 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 141 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
124 EXPECT_TRUE(resizer.is_resizable()); | 142 window_.get(), gfx::Point(), HTCAPTION, 0)); |
125 resizer.Drag(CalculateDragPoint(resizer, 200)); | 143 ASSERT_TRUE(resizer.get()); |
| 144 resizer->Drag(CalculateDragPoint(*resizer, 0, 200)); |
126 EXPECT_EQ(500, window_->bounds().y()); | 145 EXPECT_EQ(500, window_->bounds().y()); |
127 EXPECT_EQ(100, window_->bounds().height()); | 146 EXPECT_EQ(100, window_->bounds().height()); |
128 // End and start a new drag session. | 147 // End and start a new drag session. |
129 } | 148 } |
130 | 149 |
131 { | 150 { |
132 // Drag up 400. | 151 // Drag up 400. |
133 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 152 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
134 resizer.Drag(CalculateDragPoint(resizer, -400)); | 153 window_.get(), gfx::Point(), HTCAPTION, 0)); |
| 154 ASSERT_TRUE(resizer.get()); |
| 155 resizer->Drag(CalculateDragPoint(*resizer, 0, -400)); |
135 EXPECT_EQ(100, window_->bounds().y()); | 156 EXPECT_EQ(100, window_->bounds().y()); |
136 EXPECT_EQ(300, window_->bounds().height()); | 157 EXPECT_EQ(300, window_->bounds().height()); |
137 } | 158 } |
138 } | 159 } |
139 | 160 |
140 // Moves enough to shrink, then moves up twice to expose more than was initially | 161 // Moves enough to shrink, then moves up twice to expose more than was initially |
141 // exposed. | 162 // exposed. |
142 TEST_F(WorkspaceWindowResizerTest, ShrinkMoveThanMoveUp) { | 163 TEST_F(WorkspaceWindowResizerTest, ShrinkMoveThanMoveUp) { |
143 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); | 164 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); |
144 | 165 |
145 // Drag down past the bottom of the screen, height should stop when it hits | 166 // Drag down past the bottom of the screen, height should stop when it hits |
146 // the bottom. | 167 // the bottom. |
147 { | 168 { |
148 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 169 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
149 EXPECT_TRUE(resizer.is_resizable()); | 170 window_.get(), gfx::Point(), HTCAPTION, 0)); |
150 resizer.Drag(CalculateDragPoint(resizer, 200)); | 171 ASSERT_TRUE(resizer.get()); |
| 172 resizer->Drag(CalculateDragPoint(*resizer, 0, 200)); |
151 EXPECT_EQ(500, window_->bounds().y()); | 173 EXPECT_EQ(500, window_->bounds().y()); |
152 EXPECT_EQ(100, window_->bounds().height()); | 174 EXPECT_EQ(100, window_->bounds().height()); |
153 // End and start a new drag session. | 175 // End and start a new drag session. |
154 } | 176 } |
155 | 177 |
156 { | 178 { |
157 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 179 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
158 resizer.Drag(CalculateDragPoint(resizer, -400)); | 180 window_.get(), gfx::Point(), HTCAPTION, 0)); |
159 resizer.Drag(CalculateDragPoint(resizer, -450)); | 181 ASSERT_TRUE(resizer.get()); |
| 182 resizer->Drag(CalculateDragPoint(*resizer, 0, -400)); |
| 183 resizer->Drag(CalculateDragPoint(*resizer, 0, -450)); |
160 EXPECT_EQ(50, window_->bounds().y()); | 184 EXPECT_EQ(50, window_->bounds().y()); |
161 EXPECT_EQ(300, window_->bounds().height()); | 185 EXPECT_EQ(300, window_->bounds().height()); |
162 } | 186 } |
163 } | 187 } |
164 | 188 |
165 // Makes sure shrinking honors the grid appropriately. | 189 // Makes sure shrinking honors the grid appropriately. |
166 TEST_F(WorkspaceWindowResizerTest, ShrinkWithGrid) { | 190 TEST_F(WorkspaceWindowResizerTest, ShrinkWithGrid) { |
167 window_->SetBounds(gfx::Rect(0, 300, 400, 296)); | 191 window_->SetBounds(gfx::Rect(0, 300, 400, 296)); |
168 | 192 |
169 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 5); | 193 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
170 EXPECT_TRUE(resizer.is_resizable()); | 194 window_.get(), gfx::Point(), HTCAPTION, 5)); |
| 195 ASSERT_TRUE(resizer.get()); |
171 // Drag down 8 pixels. | 196 // Drag down 8 pixels. |
172 resizer.Drag(CalculateDragPoint(resizer, 8)); | 197 resizer->Drag(CalculateDragPoint(*resizer, 0, 8)); |
173 resizer.CompleteDrag(); | 198 resizer->CompleteDrag(); |
174 EXPECT_EQ(310, window_->bounds().y()); | 199 EXPECT_EQ(310, window_->bounds().y()); |
175 EXPECT_EQ(kRootHeight - 310, window_->bounds().height()); | 200 EXPECT_EQ(kRootHeight - 310, window_->bounds().height()); |
176 } | 201 } |
177 | 202 |
178 // Makes sure once a window has been shrunk it can grow bigger than obscured | 203 // Makes sure once a window has been shrunk it can grow bigger than obscured |
179 // height | 204 // height |
180 TEST_F(WorkspaceWindowResizerTest, ShrinkThanGrow) { | 205 TEST_F(WorkspaceWindowResizerTest, ShrinkThanGrow) { |
181 int initial_y = 400; | 206 int initial_y = 400; |
182 int initial_height = 150; | 207 int initial_height = 150; |
183 window_->SetBounds(gfx::Rect(0, initial_y, 400, initial_height)); | 208 window_->SetBounds(gfx::Rect(0, initial_y, 400, initial_height)); |
184 | 209 |
185 // Most past the bottom of the screen, height should stop when it hits the | 210 // Most past the bottom of the screen, height should stop when it hits the |
186 // bottom. | 211 // bottom. |
187 { | 212 { |
188 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 213 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
189 resizer.Drag(CalculateDragPoint(resizer, 150)); | 214 window_.get(), gfx::Point(), HTCAPTION, 0)); |
| 215 ASSERT_TRUE(resizer.get()); |
| 216 resizer->Drag(CalculateDragPoint(*resizer, 0, 150)); |
190 EXPECT_EQ(550, window_->bounds().y()); | 217 EXPECT_EQ(550, window_->bounds().y()); |
191 EXPECT_EQ(50, window_->bounds().height()); | 218 EXPECT_EQ(50, window_->bounds().height()); |
192 } | 219 } |
193 | 220 |
194 // Resize the window 500 pixels up. | 221 // Resize the window 500 pixels up. |
195 { | 222 { |
196 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTTOP, 0); | 223 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
197 resizer.Drag(CalculateDragPoint(resizer, -500)); | 224 window_.get(), gfx::Point(), HTTOP, 0)); |
| 225 ASSERT_TRUE(resizer.get()); |
| 226 resizer->Drag(CalculateDragPoint(*resizer, 0, -500)); |
198 EXPECT_EQ(50, window_->bounds().y()); | 227 EXPECT_EQ(50, window_->bounds().y()); |
199 EXPECT_EQ(550, window_->bounds().height()); | 228 EXPECT_EQ(550, window_->bounds().height()); |
200 } | 229 } |
201 } | 230 } |
202 | 231 |
203 // Makes sure once a window has been shrunk it can grow bigger than obscured | 232 // Makes sure once a window has been shrunk it can grow bigger than obscured |
204 // height | 233 // height |
205 TEST_F(WorkspaceWindowResizerTest, DontRememberAfterMove) { | 234 TEST_F(WorkspaceWindowResizerTest, DontRememberAfterMove) { |
206 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); | 235 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); |
207 | 236 |
208 // Most past the bottom of the screen, height should stop when it hits the | 237 // Most past the bottom of the screen, height should stop when it hits the |
209 // bottom. | 238 // bottom. |
210 { | 239 { |
211 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 240 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
212 resizer.Drag(CalculateDragPoint(resizer, 150)); | 241 window_.get(), gfx::Point(), HTCAPTION, 0)); |
| 242 ASSERT_TRUE(resizer.get()); |
| 243 resizer->Drag(CalculateDragPoint(*resizer, 0, 150)); |
213 EXPECT_EQ(450, window_->bounds().y()); | 244 EXPECT_EQ(450, window_->bounds().y()); |
214 EXPECT_EQ(150, window_->bounds().height()); | 245 EXPECT_EQ(150, window_->bounds().height()); |
215 resizer.Drag(CalculateDragPoint(resizer, -150)); | 246 resizer->Drag(CalculateDragPoint(*resizer, 0, -150)); |
216 EXPECT_EQ(150, window_->bounds().y()); | 247 EXPECT_EQ(150, window_->bounds().y()); |
217 EXPECT_EQ(300, window_->bounds().height()); | 248 EXPECT_EQ(300, window_->bounds().height()); |
218 } | 249 } |
219 | 250 |
220 // Resize it slightly. | 251 // Resize it slightly. |
221 { | 252 { |
222 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTBOTTOM, 0); | 253 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
223 resizer.Drag(CalculateDragPoint(resizer, -100)); | 254 window_.get(), gfx::Point(), HTBOTTOM, 0)); |
| 255 ASSERT_TRUE(resizer.get()); |
| 256 resizer->Drag(CalculateDragPoint(*resizer, 0, -100)); |
224 EXPECT_EQ(150, window_->bounds().y()); | 257 EXPECT_EQ(150, window_->bounds().y()); |
225 EXPECT_EQ(200, window_->bounds().height()); | 258 EXPECT_EQ(200, window_->bounds().height()); |
226 } | 259 } |
227 | 260 |
228 { | 261 { |
229 // Move it down then back up. | 262 // Move it down then back up. |
230 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 263 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
231 resizer.Drag(CalculateDragPoint(resizer, 400)); | 264 window_.get(), gfx::Point(), HTCAPTION, 0)); |
| 265 ASSERT_TRUE(resizer.get()); |
| 266 resizer->Drag(CalculateDragPoint(*resizer, 0, 400)); |
232 EXPECT_EQ(550, window_->bounds().y()); | 267 EXPECT_EQ(550, window_->bounds().y()); |
233 EXPECT_EQ(50, window_->bounds().height()); | 268 EXPECT_EQ(50, window_->bounds().height()); |
234 | 269 |
235 resizer.Drag(CalculateDragPoint(resizer, 0)); | 270 resizer->Drag(CalculateDragPoint(*resizer, 0, 0)); |
236 EXPECT_EQ(150, window_->bounds().y()); | 271 EXPECT_EQ(150, window_->bounds().y()); |
237 EXPECT_EQ(200, window_->bounds().height()); | 272 EXPECT_EQ(200, window_->bounds().height()); |
238 } | 273 } |
239 } | 274 } |
240 | 275 |
241 // Makes sure we honor the min size. | 276 // Makes sure we honor the min size. |
242 TEST_F(WorkspaceWindowResizerTest, HonorMin) { | 277 TEST_F(WorkspaceWindowResizerTest, HonorMin) { |
243 delegate_.set_min_size(gfx::Size(50, 100)); | 278 delegate_.set_min_size(gfx::Size(50, 100)); |
244 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); | 279 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); |
245 | 280 |
246 // Most past the bottom of the screen, height should stop when it hits the | 281 // Most past the bottom of the screen, height should stop when it hits the |
247 // bottom. | 282 // bottom. |
248 { | 283 { |
249 WorkspaceWindowResizer resizer(window_.get(), gfx::Point(), HTCAPTION, 0); | 284 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
250 resizer.Drag(CalculateDragPoint(resizer, 350)); | 285 window_.get(), gfx::Point(), HTCAPTION, 0)); |
| 286 ASSERT_TRUE(resizer.get()); |
| 287 resizer->Drag(CalculateDragPoint(*resizer, 0, 350)); |
251 EXPECT_EQ(500, window_->bounds().y()); | 288 EXPECT_EQ(500, window_->bounds().y()); |
252 EXPECT_EQ(100, window_->bounds().height()); | 289 EXPECT_EQ(100, window_->bounds().height()); |
253 | 290 |
254 resizer.Drag(CalculateDragPoint(resizer, 300)); | 291 resizer->Drag(CalculateDragPoint(*resizer, 0, 300)); |
255 EXPECT_EQ(500, window_->bounds().y()); | 292 EXPECT_EQ(500, window_->bounds().y()); |
256 EXPECT_EQ(100, window_->bounds().height()); | 293 EXPECT_EQ(100, window_->bounds().height()); |
257 | 294 |
258 resizer.Drag(CalculateDragPoint(resizer, 250)); | 295 resizer->Drag(CalculateDragPoint(*resizer, 0, 250)); |
259 EXPECT_EQ(500, window_->bounds().y()); | 296 EXPECT_EQ(500, window_->bounds().y()); |
260 EXPECT_EQ(100, window_->bounds().height()); | 297 EXPECT_EQ(100, window_->bounds().height()); |
261 | 298 |
262 resizer.Drag(CalculateDragPoint(resizer, 100)); | 299 resizer->Drag(CalculateDragPoint(*resizer, 0, 100)); |
263 EXPECT_EQ(400, window_->bounds().y()); | 300 EXPECT_EQ(400, window_->bounds().y()); |
264 EXPECT_EQ(200, window_->bounds().height()); | 301 EXPECT_EQ(200, window_->bounds().height()); |
265 | 302 |
266 resizer.Drag(CalculateDragPoint(resizer, -100)); | 303 resizer->Drag(CalculateDragPoint(*resizer, 0, -100)); |
267 EXPECT_EQ(200, window_->bounds().y()); | 304 EXPECT_EQ(200, window_->bounds().y()); |
268 EXPECT_EQ(300, window_->bounds().height()); | 305 EXPECT_EQ(300, window_->bounds().height()); |
269 } | 306 } |
270 } | 307 } |
271 | 308 |
272 } // namespace | 309 } // namespace |
273 } // namespace test | 310 } // namespace test |
274 } // namespace aura | 311 } // namespace aura |
OLD | NEW |