| OLD | NEW |
| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return; | 251 return; |
| 252 | 252 |
| 253 ash::Shell* shell = ash::Shell::GetInstance(); | 253 ash::Shell* shell = ash::Shell::GetInstance(); |
| 254 shell->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT, | 254 shell->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT, |
| 255 shell->GetPrimaryRootWindow()); | 255 shell->GetPrimaryRootWindow()); |
| 256 scoped_ptr<aura::Window> window( | 256 scoped_ptr<aura::Window> window( |
| 257 CreatePanelWindow(gfx::Point(0, 0))); | 257 CreatePanelWindow(gfx::Point(0, 0))); |
| 258 DetachReattachTest(window.get(), -1, 0); | 258 DetachReattachTest(window.get(), -1, 0); |
| 259 } | 259 } |
| 260 | 260 |
| 261 TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) { | |
| 262 if (!SupportsHostWindowResize()) | |
| 263 return; | |
| 264 | |
| 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); | |
| 270 } | |
| 271 | |
| 272 // Tests that a drag continues when the shelf is hidden. This occurs as part of | 261 // 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. | 262 // the animation when switching profiles. http://crbug.com/393047. |
| 274 TEST_F(PanelWindowResizerTest, DetachThenHideShelf) { | 263 TEST_F(PanelWindowResizerTest, DetachThenHideShelf) { |
| 275 if (!SupportsHostWindowResize()) | 264 if (!SupportsHostWindowResize()) |
| 276 return; | 265 return; |
| 277 scoped_ptr<aura::Window> window( | 266 scoped_ptr<aura::Window> window( |
| 278 CreatePanelWindow(gfx::Point(0, 0))); | 267 CreatePanelWindow(gfx::Point(0, 0))); |
| 279 wm::WindowState* state = wm::GetWindowState(window.get()); | 268 wm::WindowState* state = wm::GetWindowState(window.get()); |
| 280 gfx::Rect expected_bounds = window->GetBoundsInScreen(); | 269 gfx::Rect expected_bounds = window->GetBoundsInScreen(); |
| 281 expected_bounds.set_y(expected_bounds.y() - 100); | 270 expected_bounds.set_y(expected_bounds.y() - 100); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 571 |
| 583 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, | 572 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, |
| 584 testing::Bool()); | 573 testing::Bool()); |
| 585 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, | 574 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, |
| 586 PanelWindowResizerTransientTest, | 575 PanelWindowResizerTransientTest, |
| 587 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 576 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 588 ui::wm::WINDOW_TYPE_PANEL, | 577 ui::wm::WINDOW_TYPE_PANEL, |
| 589 ui::wm::WINDOW_TYPE_POPUP)); | 578 ui::wm::WINDOW_TYPE_POPUP)); |
| 590 | 579 |
| 591 } // namespace ash | 580 } // namespace ash |
| OLD | NEW |