Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / ash / wm / panels / panel_window_resizer_unittest.cc
blob1e39c7093fd5159305831eb87cb1285a322d64c0
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/wm/panels/panel_window_resizer.h"
7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_model.h"
11 #include "ash/shelf/shelf_types.h"
12 #include "ash/shelf/shelf_util.h"
13 #include "ash/shelf/shelf_widget.h"
14 #include "ash/shell.h"
15 #include "ash/shell_window_ids.h"
16 #include "ash/test/ash_test_base.h"
17 #include "ash/test/cursor_manager_test_api.h"
18 #include "ash/test/shell_test_api.h"
19 #include "ash/test/test_shelf_delegate.h"
20 #include "ash/wm/drag_window_resizer.h"
21 #include "ash/wm/window_state.h"
22 #include "ash/wm/wm_event.h"
23 #include "base/win/windows_version.h"
24 #include "ui/aura/client/aura_constants.h"
25 #include "ui/aura/window_event_dispatcher.h"
26 #include "ui/base/hit_test.h"
27 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/base/ui_base_types.h"
29 #include "ui/views/widget/widget.h"
30 #include "ui/wm/core/window_util.h"
32 namespace ash {
34 class PanelWindowResizerTest : public test::AshTestBase {
35 public:
36 PanelWindowResizerTest() {}
37 ~PanelWindowResizerTest() override {}
39 void SetUp() override {
40 AshTestBase::SetUp();
41 UpdateDisplay("600x400");
42 test::ShellTestApi test_api(Shell::GetInstance());
43 model_ = test_api.shelf_model();
44 shelf_delegate_ = test::TestShelfDelegate::instance();
47 void TearDown() override { AshTestBase::TearDown(); }
49 protected:
50 gfx::Point CalculateDragPoint(const WindowResizer& resizer,
51 int delta_x,
52 int delta_y) const {
53 gfx::Point location = resizer.GetInitialLocation();
54 location.set_x(location.x() + delta_x);
55 location.set_y(location.y() + delta_y);
56 return location;
59 aura::Window* CreatePanelWindow(const gfx::Point& origin) {
60 gfx::Rect bounds(origin, gfx::Size(101, 101));
61 aura::Window* window = CreateTestWindowInShellWithDelegateAndType(
62 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds);
63 shelf_delegate_->AddShelfItem(window);
64 return window;
67 void DragStart(aura::Window* window) {
68 resizer_.reset(CreateWindowResizer(
69 window,
70 window->bounds().origin(),
71 HTCAPTION,
72 aura::client::WINDOW_MOVE_SOURCE_MOUSE).release());
73 ASSERT_TRUE(resizer_.get());
76 void DragMove(int dx, int dy) {
77 resizer_->Drag(CalculateDragPoint(*resizer_, dx, dy), 0);
80 void DragEnd() {
81 resizer_->CompleteDrag();
82 resizer_.reset();
85 void DragRevert() {
86 resizer_->RevertDrag();
87 resizer_.reset();
90 // Test dragging the panel slightly, then detaching, and then reattaching
91 // dragging out by the vector (dx, dy).
92 void DetachReattachTest(aura::Window* window, int dx, int dy) {
93 wm::WindowState* window_state = wm::GetWindowState(window);
94 EXPECT_TRUE(window_state->panel_attached());
95 aura::Window* root_window = window->GetRootWindow();
96 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
97 DragStart(window);
98 gfx::Rect initial_bounds = window->GetBoundsInScreen();
100 // Drag the panel slightly. The window should still be snapped to the
101 // launcher.
102 DragMove(dx * 5, dy * 5);
103 EXPECT_EQ(initial_bounds.x(), window->GetBoundsInScreen().x());
104 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y());
106 // Drag further out and the window should now move to the cursor.
107 DragMove(dx * 100, dy * 100);
108 EXPECT_EQ(initial_bounds.x() + dx * 100, window->GetBoundsInScreen().x());
109 EXPECT_EQ(initial_bounds.y() + dy * 100, window->GetBoundsInScreen().y());
111 // The panel should be detached when the drag completes.
112 DragEnd();
114 EXPECT_FALSE(window_state->panel_attached());
115 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
116 EXPECT_EQ(root_window, window->GetRootWindow());
118 DragStart(window);
119 // Drag the panel down.
120 DragMove(dx * -95, dy * -95);
121 // Release the mouse and the panel should be reattached.
122 DragEnd();
124 // The panel should be reattached and have snapped to the launcher.
125 EXPECT_TRUE(window_state->panel_attached());
126 EXPECT_EQ(initial_bounds.x(), window->GetBoundsInScreen().x());
127 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y());
128 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
131 void TestWindowOrder(const std::vector<aura::Window*>& window_order) {
132 int panel_index = model_->FirstPanelIndex();
133 EXPECT_EQ((int)(panel_index + window_order.size()), model_->item_count());
134 for (std::vector<aura::Window*>::const_iterator iter =
135 window_order.begin(); iter != window_order.end();
136 ++iter, ++panel_index) {
137 ShelfID id = GetShelfIDForWindow(*iter);
138 EXPECT_EQ(id, model_->items()[panel_index].id);
142 // Test dragging panel window along the shelf and verify that panel icons
143 // are reordered appropriately.
144 void DragAlongShelfReorder(int dx, int dy) {
145 gfx::Point origin(0, 0);
146 scoped_ptr<aura::Window> w1(CreatePanelWindow(origin));
147 scoped_ptr<aura::Window> w2(CreatePanelWindow(origin));
148 std::vector<aura::Window*> window_order_original;
149 std::vector<aura::Window*> window_order_swapped;
150 window_order_original.push_back(w1.get());
151 window_order_original.push_back(w2.get());
152 window_order_swapped.push_back(w2.get());
153 window_order_swapped.push_back(w1.get());
154 TestWindowOrder(window_order_original);
156 // Drag window #2 to the beginning of the shelf.
157 DragStart(w2.get());
158 DragMove(400 * dx, 400 * dy);
159 TestWindowOrder(window_order_swapped);
160 DragEnd();
162 // Expect swapped window order.
163 TestWindowOrder(window_order_swapped);
165 // Drag window #2 back to the end.
166 DragStart(w2.get());
167 DragMove(-400 * dx, -400 * dy);
168 TestWindowOrder(window_order_original);
169 DragEnd();
171 // Expect original order.
172 TestWindowOrder(window_order_original);
175 private:
176 scoped_ptr<WindowResizer> resizer_;
177 ShelfModel* model_;
178 test::TestShelfDelegate* shelf_delegate_;
180 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizerTest);
183 class PanelWindowResizerTextDirectionTest
184 : public PanelWindowResizerTest,
185 public testing::WithParamInterface<bool> {
186 public:
187 PanelWindowResizerTextDirectionTest() : is_rtl_(GetParam()) {}
188 virtual ~PanelWindowResizerTextDirectionTest() {}
190 void SetUp() override {
191 original_locale = l10n_util::GetApplicationLocale(std::string());
192 if (is_rtl_)
193 base::i18n::SetICUDefaultLocale("he");
194 PanelWindowResizerTest::SetUp();
195 ASSERT_EQ(is_rtl_, base::i18n::IsRTL());
198 void TearDown() override {
199 if (is_rtl_)
200 base::i18n::SetICUDefaultLocale(original_locale);
201 PanelWindowResizerTest::TearDown();
204 private:
205 bool is_rtl_;
206 std::string original_locale;
208 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizerTextDirectionTest);
211 // PanelLayoutManager and PanelWindowResizer should work if panels have
212 // transient children of supported types.
213 class PanelWindowResizerTransientTest
214 : public PanelWindowResizerTest,
215 public testing::WithParamInterface<ui::wm::WindowType> {
216 public:
217 PanelWindowResizerTransientTest() : transient_window_type_(GetParam()) {}
218 virtual ~PanelWindowResizerTransientTest() {}
220 protected:
221 ui::wm::WindowType transient_window_type_;
223 private:
224 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizerTransientTest);
227 // Verifies a window can be dragged from the panel and detached and then
228 // reattached.
229 TEST_F(PanelWindowResizerTest, PanelDetachReattachBottom) {
230 if (!SupportsHostWindowResize())
231 return;
233 scoped_ptr<aura::Window> window(
234 CreatePanelWindow(gfx::Point(0, 0)));
235 DetachReattachTest(window.get(), 0, -1);
238 TEST_F(PanelWindowResizerTest, PanelDetachReattachLeft) {
239 if (!SupportsHostWindowResize())
240 return;
242 ash::Shell* shell = ash::Shell::GetInstance();
243 shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow());
244 scoped_ptr<aura::Window> window(
245 CreatePanelWindow(gfx::Point(0, 0)));
246 DetachReattachTest(window.get(), 1, 0);
249 TEST_F(PanelWindowResizerTest, PanelDetachReattachRight) {
250 if (!SupportsHostWindowResize())
251 return;
253 ash::Shell* shell = ash::Shell::GetInstance();
254 shell->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT,
255 shell->GetPrimaryRootWindow());
256 scoped_ptr<aura::Window> window(
257 CreatePanelWindow(gfx::Point(0, 0)));
258 DetachReattachTest(window.get(), -1, 0);
261 TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) {
262 if (!SupportsHostWindowResize())
263 return;
265 ash::Shell* shell = ash::Shell::GetInstance();
266 shell->SetShelfAlignment(SHELF_ALIGNMENT_TOP, shell->GetPrimaryRootWindow());
267 scoped_ptr<aura::Window> window(
268 CreatePanelWindow(gfx::Point(0, 0)));
269 DetachReattachTest(window.get(), 0, 1);
272 // Tests that a drag continues when the shelf is hidden. This occurs as part of
273 // the animation when switching profiles. http://crbug.com/393047.
274 TEST_F(PanelWindowResizerTest, DetachThenHideShelf) {
275 if (!SupportsHostWindowResize())
276 return;
277 scoped_ptr<aura::Window> window(
278 CreatePanelWindow(gfx::Point(0, 0)));
279 wm::WindowState* state = wm::GetWindowState(window.get());
280 gfx::Rect expected_bounds = window->GetBoundsInScreen();
281 expected_bounds.set_y(expected_bounds.y() - 100);
282 DragStart(window.get());
283 DragMove(0, -100);
284 EXPECT_FALSE(state->IsMinimized());
286 // Hide the shelf. This minimizes all attached windows but should ignore
287 // the dragged window.
288 ShelfLayoutManager* shelf = RootWindowController::ForWindow(window.get())->
289 shelf()->shelf_layout_manager();
290 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_ALWAYS_HIDDEN);
291 shelf->UpdateVisibilityState();
292 RunAllPendingInMessageLoop();
293 EXPECT_FALSE(state->IsMinimized());
294 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
295 DragEnd();
297 // When the drag ends the window should be detached and placed where it was
298 // dragged to.
299 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
300 EXPECT_FALSE(state->IsMinimized());
301 EXPECT_EQ(expected_bounds.ToString(), window->GetBoundsInScreen().ToString());
304 TEST_F(PanelWindowResizerTest, PanelDetachReattachMultipleDisplays) {
305 if (!SupportsMultipleDisplays())
306 return;
308 UpdateDisplay("600x400,600x400");
309 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
310 scoped_ptr<aura::Window> window(
311 CreatePanelWindow(gfx::Point(600, 0)));
312 EXPECT_EQ(root_windows[1], window->GetRootWindow());
313 DetachReattachTest(window.get(), 0, -1);
316 TEST_F(PanelWindowResizerTest, DetachThenDragAcrossDisplays) {
317 if (!SupportsMultipleDisplays())
318 return;
320 UpdateDisplay("600x400,600x400");
321 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
322 scoped_ptr<aura::Window> window(
323 CreatePanelWindow(gfx::Point(0, 0)));
324 gfx::Rect initial_bounds = window->GetBoundsInScreen();
325 EXPECT_EQ(root_windows[0], window->GetRootWindow());
326 DragStart(window.get());
327 DragMove(0, -100);
328 DragEnd();
329 EXPECT_EQ(root_windows[0], window->GetRootWindow());
330 EXPECT_EQ(initial_bounds.x(), window->GetBoundsInScreen().x());
331 EXPECT_EQ(initial_bounds.y() - 100, window->GetBoundsInScreen().y());
332 EXPECT_FALSE(wm::GetWindowState(window.get())->panel_attached());
333 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
335 DragStart(window.get());
336 DragMove(500, 0);
337 DragEnd();
338 EXPECT_EQ(root_windows[1], window->GetRootWindow());
339 EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x());
340 EXPECT_EQ(initial_bounds.y() - 100, window->GetBoundsInScreen().y());
341 EXPECT_FALSE(wm::GetWindowState(window.get())->panel_attached());
342 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
345 TEST_F(PanelWindowResizerTest, DetachAcrossDisplays) {
346 if (!SupportsMultipleDisplays())
347 return;
349 UpdateDisplay("600x400,600x400");
350 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
351 scoped_ptr<aura::Window> window(
352 CreatePanelWindow(gfx::Point(0, 0)));
353 gfx::Rect initial_bounds = window->GetBoundsInScreen();
354 EXPECT_EQ(root_windows[0], window->GetRootWindow());
355 DragStart(window.get());
356 DragMove(500, -100);
357 DragEnd();
358 EXPECT_EQ(root_windows[1], window->GetRootWindow());
359 EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x());
360 EXPECT_EQ(initial_bounds.y() - 100, window->GetBoundsInScreen().y());
361 EXPECT_FALSE(wm::GetWindowState(window.get())->panel_attached());
362 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
365 TEST_F(PanelWindowResizerTest, DetachThenAttachToSecondDisplay) {
366 if (!SupportsMultipleDisplays())
367 return;
369 UpdateDisplay("600x400,600x600");
370 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
371 scoped_ptr<aura::Window> window(
372 CreatePanelWindow(gfx::Point(0, 0)));
373 gfx::Rect initial_bounds = window->GetBoundsInScreen();
374 EXPECT_EQ(root_windows[0], window->GetRootWindow());
376 // Detach the window.
377 DragStart(window.get());
378 DragMove(0, -100);
379 DragEnd();
380 EXPECT_EQ(root_windows[0], window->GetRootWindow());
381 EXPECT_FALSE(wm::GetWindowState(window.get())->panel_attached());
383 // Drag the window just above the other display's launcher.
384 DragStart(window.get());
385 DragMove(500, 295);
386 EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x());
388 // Should stick to other launcher.
389 EXPECT_EQ(initial_bounds.y() + 200, window->GetBoundsInScreen().y());
390 DragEnd();
392 // When dropped should move to second display's panel container.
393 EXPECT_EQ(root_windows[1], window->GetRootWindow());
394 EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached());
395 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
398 TEST_F(PanelWindowResizerTest, AttachToSecondDisplay) {
399 if (!SupportsMultipleDisplays())
400 return;
402 UpdateDisplay("600x400,600x600");
403 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
404 scoped_ptr<aura::Window> window(
405 CreatePanelWindow(gfx::Point(0, 0)));
406 gfx::Rect initial_bounds = window->GetBoundsInScreen();
407 EXPECT_EQ(root_windows[0], window->GetRootWindow());
409 // Drag the window just above the other display's launcher.
410 DragStart(window.get());
411 DragMove(500, 195);
412 EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x());
414 // Should stick to other launcher.
415 EXPECT_EQ(initial_bounds.y() + 200, window->GetBoundsInScreen().y());
416 DragEnd();
418 // When dropped should move to second display's panel container.
419 EXPECT_EQ(root_windows[1], window->GetRootWindow());
420 EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached());
421 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
424 TEST_F(PanelWindowResizerTest, AttachToSecondFullscreenDisplay) {
425 if (!SupportsMultipleDisplays())
426 return;
428 UpdateDisplay("600x400,600x600");
429 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
430 scoped_ptr<aura::Window> window(
431 CreatePanelWindow(gfx::Point(0, 0)));
432 scoped_ptr<aura::Window> fullscreen(
433 CreateTestWindowInShellWithBounds(gfx::Rect(600, 0, 101, 101)));
434 wm::GetWindowState(fullscreen.get())->Activate();
435 const wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
436 wm::GetWindowState(fullscreen.get())->OnWMEvent(&event);
437 EXPECT_TRUE(wm::GetWindowState(fullscreen.get())->IsFullscreen());
439 gfx::Rect initial_bounds = window->GetBoundsInScreen();
440 EXPECT_EQ(root_windows[0], window->GetRootWindow());
442 // Activate and drag the window to the other display's launcher.
443 wm::GetWindowState(window.get())->Activate();
444 DragStart(window.get());
445 DragMove(500, 250);
446 EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x());
447 EXPECT_GT(window->GetBoundsInScreen().y(),
448 initial_bounds.y() + 200);
449 DragEnd();
451 // When dropped should move to second display's panel container.
452 EXPECT_EQ(root_windows[1], window->GetRootWindow());
453 EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached());
454 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
455 EXPECT_TRUE(window->IsVisible());
456 EXPECT_TRUE(wm::GetWindowState(window.get())->IsActive());
457 EXPECT_EQ(initial_bounds.y() + 200, window->GetBoundsInScreen().y());
460 TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) {
461 scoped_ptr<aura::Window> window(
462 CreatePanelWindow(gfx::Point(0, 0)));
463 EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached());
464 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
465 DragStart(window.get());
466 DragMove(0, -100);
467 DragRevert();
468 EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached());
469 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
471 // Detach panel.
472 DragStart(window.get());
473 DragMove(0, -100);
474 DragEnd();
475 EXPECT_FALSE(wm::GetWindowState(window.get())->panel_attached());
476 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
478 // Drag back to launcher.
479 DragStart(window.get());
480 DragMove(0, 100);
482 // When the drag is reverted it should remain detached.
483 DragRevert();
484 EXPECT_FALSE(wm::GetWindowState(window.get())->panel_attached());
485 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
488 TEST_F(PanelWindowResizerTest, DragMovesToPanelLayer) {
489 scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
490 DragStart(window.get());
491 DragMove(0, -100);
492 DragEnd();
493 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
495 // While moving the panel window should be moved to the panel container.
496 DragStart(window.get());
497 DragMove(20, 0);
498 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
499 DragEnd();
501 // When dropped it should return to the default container.
502 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
505 TEST_P(PanelWindowResizerTextDirectionTest, DragReordersPanelsHorizontal) {
506 if (!SupportsHostWindowResize())
507 return;
509 DragAlongShelfReorder(base::i18n::IsRTL() ? 1 : -1, 0);
512 TEST_F(PanelWindowResizerTest, DragReordersPanelsVertical) {
513 if (!SupportsHostWindowResize())
514 return;
516 ash::Shell* shell = ash::Shell::GetInstance();
517 shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow());
518 DragAlongShelfReorder(0, -1);
521 // Tests that panels can have transient children of different types.
522 // The transient children should be reparented in sync with the panel.
523 TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) {
524 if (!SupportsHostWindowResize())
525 return;
527 scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
528 scoped_ptr<aura::Window> child(CreateTestWindowInShellWithDelegateAndType(
529 NULL, transient_window_type_, 0, gfx::Rect(20, 20, 150, 40)));
530 ::wm::AddTransientChild(window.get(), child.get());
531 if (window->parent() != child->parent())
532 window->parent()->AddChild(child.get());
533 EXPECT_EQ(window.get(), ::wm::GetTransientParent(child.get()));
535 // Drag the child to the shelf. Its new position should not be overridden.
536 const gfx::Rect attached_bounds(window->GetBoundsInScreen());
537 const int dy = window->GetBoundsInScreen().bottom() -
538 child->GetBoundsInScreen().bottom();
539 DragStart(child.get());
540 DragMove(50, dy);
541 // While moving the transient child window should be in the panel container.
542 EXPECT_EQ(kShellWindowId_PanelContainer, child->parent()->id());
543 DragEnd();
544 // Child should move, |window| should not.
545 EXPECT_EQ(gfx::Point(20 + 50, 20 + dy).ToString(),
546 child->GetBoundsInScreen().origin().ToString());
547 EXPECT_EQ(attached_bounds.ToString(), window->GetBoundsInScreen().ToString());
549 // Drag the child along the the shelf past the |window|.
550 // Its new position should not be overridden.
551 DragStart(child.get());
552 DragMove(350, 0);
553 // While moving the transient child window should be in the panel container.
554 EXPECT_EQ(kShellWindowId_PanelContainer, child->parent()->id());
555 DragEnd();
556 // |child| should move, |window| should not.
557 EXPECT_EQ(gfx::Point(20 + 50 + 350, 20 + dy).ToString(),
558 child->GetBoundsInScreen().origin().ToString());
559 EXPECT_EQ(attached_bounds.ToString(), window->GetBoundsInScreen().ToString());
561 DragStart(window.get());
562 DragMove(0, -100);
563 // While moving the windows should be in the panel container.
564 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
565 EXPECT_EQ(kShellWindowId_PanelContainer, child->parent()->id());
566 DragEnd();
567 // When dropped they should return to the default container.
568 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
569 EXPECT_EQ(kShellWindowId_DefaultContainer, child->parent()->id());
571 // While moving the window and child should be moved to the panel container.
572 DragStart(window.get());
573 DragMove(20, 0);
574 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
575 EXPECT_EQ(kShellWindowId_PanelContainer, child->parent()->id());
576 DragEnd();
578 // When dropped they should return to the default container.
579 EXPECT_EQ(kShellWindowId_DefaultContainer, window->parent()->id());
580 EXPECT_EQ(kShellWindowId_DefaultContainer, child->parent()->id());
583 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest,
584 testing::Bool());
585 INSTANTIATE_TEST_CASE_P(NormalPanelPopup,
586 PanelWindowResizerTransientTest,
587 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
588 ui::wm::WINDOW_TYPE_PANEL,
589 ui::wm::WINDOW_TYPE_POPUP));
591 } // namespace ash