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

Side by Side Diff: ash/wm/panels/panel_window_resizer_unittest.cc

Issue 1914093002: Refactors DockedWindowLayoutManager in terms of ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nuke_aura_window
Patch Set: merge 2 trunk Created 4 years, 7 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) 2013 The Chromium Authors. All rights reserved. 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 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/panels/panel_window_resizer.h" 5 #include "ash/wm/panels/panel_window_resizer.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_model.h" 10 #include "ash/shelf/shelf_model.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); 234 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
235 DetachReattachTest(window.get(), 0, -1); 235 DetachReattachTest(window.get(), 0, -1);
236 } 236 }
237 237
238 TEST_F(PanelWindowResizerTest, PanelDetachReattachLeft) { 238 TEST_F(PanelWindowResizerTest, PanelDetachReattachLeft) {
239 if (!SupportsHostWindowResize()) 239 if (!SupportsHostWindowResize())
240 return; 240 return;
241 241
242 ash::Shell* shell = ash::Shell::GetInstance(); 242 ash::Shell* shell = ash::Shell::GetInstance();
243 shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow()); 243 shell->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
244 shell->GetPrimaryRootWindow());
244 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); 245 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
245 DetachReattachTest(window.get(), 1, 0); 246 DetachReattachTest(window.get(), 1, 0);
246 } 247 }
247 248
248 TEST_F(PanelWindowResizerTest, PanelDetachReattachRight) { 249 TEST_F(PanelWindowResizerTest, PanelDetachReattachRight) {
249 if (!SupportsHostWindowResize()) 250 if (!SupportsHostWindowResize())
250 return; 251 return;
251 252
252 ash::Shell* shell = ash::Shell::GetInstance(); 253 ash::Shell* shell = ash::Shell::GetInstance();
253 shell->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT, 254 shell->SetShelfAlignment(wm::SHELF_ALIGNMENT_RIGHT,
254 shell->GetPrimaryRootWindow()); 255 shell->GetPrimaryRootWindow());
255 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); 256 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
256 DetachReattachTest(window.get(), -1, 0); 257 DetachReattachTest(window.get(), -1, 0);
257 } 258 }
258 259
259 // Tests that a drag continues when the shelf is hidden. This occurs as part of 260 // Tests that a drag continues when the shelf is hidden. This occurs as part of
260 // the animation when switching profiles. http://crbug.com/393047. 261 // the animation when switching profiles. http://crbug.com/393047.
261 TEST_F(PanelWindowResizerTest, DetachThenHideShelf) { 262 TEST_F(PanelWindowResizerTest, DetachThenHideShelf) {
262 if (!SupportsHostWindowResize()) 263 if (!SupportsHostWindowResize())
263 return; 264 return;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 return; 487 return;
487 488
488 DragAlongShelfReorder(base::i18n::IsRTL() ? 1 : -1, 0); 489 DragAlongShelfReorder(base::i18n::IsRTL() ? 1 : -1, 0);
489 } 490 }
490 491
491 TEST_F(PanelWindowResizerTest, DragReordersPanelsVertical) { 492 TEST_F(PanelWindowResizerTest, DragReordersPanelsVertical) {
492 if (!SupportsHostWindowResize()) 493 if (!SupportsHostWindowResize())
493 return; 494 return;
494 495
495 ash::Shell* shell = ash::Shell::GetInstance(); 496 ash::Shell* shell = ash::Shell::GetInstance();
496 shell->SetShelfAlignment(SHELF_ALIGNMENT_LEFT, shell->GetPrimaryRootWindow()); 497 shell->SetShelfAlignment(wm::SHELF_ALIGNMENT_LEFT,
498 shell->GetPrimaryRootWindow());
497 DragAlongShelfReorder(0, -1); 499 DragAlongShelfReorder(0, -1);
498 } 500 }
499 501
500 // Tests that panels can have transient children of different types. 502 // Tests that panels can have transient children of different types.
501 // The transient children should be reparented in sync with the panel. 503 // The transient children should be reparented in sync with the panel.
502 TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) { 504 TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) {
503 if (!SupportsHostWindowResize()) 505 if (!SupportsHostWindowResize())
504 return; 506 return;
505 507
506 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); 508 std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 564
563 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, 565 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest,
564 testing::Bool()); 566 testing::Bool());
565 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, 567 INSTANTIATE_TEST_CASE_P(NormalPanelPopup,
566 PanelWindowResizerTransientTest, 568 PanelWindowResizerTransientTest,
567 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 569 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
568 ui::wm::WINDOW_TYPE_PANEL, 570 ui::wm::WINDOW_TYPE_PANEL,
569 ui::wm::WINDOW_TYPE_POPUP)); 571 ui::wm::WINDOW_TYPE_POPUP));
570 572
571 } // namespace ash 573 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698