| 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/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/launcher/launcher_model.h" | |
| 9 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_model.h" |
| 11 #include "ash/shelf/shelf_types.h" | 11 #include "ash/shelf/shelf_types.h" |
| 12 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
| 15 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
| 16 #include "ash/test/cursor_manager_test_api.h" | 16 #include "ash/test/cursor_manager_test_api.h" |
| 17 #include "ash/test/shell_test_api.h" | 17 #include "ash/test/shell_test_api.h" |
| 18 #include "ash/test/test_launcher_delegate.h" | 18 #include "ash/test/test_launcher_delegate.h" |
| 19 #include "ash/wm/drag_window_resizer.h" | 19 #include "ash/wm/drag_window_resizer.h" |
| 20 #include "ash/wm/panels/panel_layout_manager.h" | 20 #include "ash/wm/panels/panel_layout_manager.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 class PanelWindowResizerTest : public test::AshTestBase { | 33 class PanelWindowResizerTest : public test::AshTestBase { |
| 34 public: | 34 public: |
| 35 PanelWindowResizerTest() {} | 35 PanelWindowResizerTest() {} |
| 36 virtual ~PanelWindowResizerTest() {} | 36 virtual ~PanelWindowResizerTest() {} |
| 37 | 37 |
| 38 virtual void SetUp() OVERRIDE { | 38 virtual void SetUp() OVERRIDE { |
| 39 AshTestBase::SetUp(); | 39 AshTestBase::SetUp(); |
| 40 UpdateDisplay("600x400"); | 40 UpdateDisplay("600x400"); |
| 41 test::ShellTestApi test_api(Shell::GetInstance()); | 41 test::ShellTestApi test_api(Shell::GetInstance()); |
| 42 model_ = test_api.launcher_model(); | 42 model_ = test_api.shelf_model(); |
| 43 launcher_delegate_ = test::TestLauncherDelegate::instance(); | 43 launcher_delegate_ = test::TestLauncherDelegate::instance(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual void TearDown() OVERRIDE { | 46 virtual void TearDown() OVERRIDE { |
| 47 AshTestBase::TearDown(); | 47 AshTestBase::TearDown(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 gfx::Point CalculateDragPoint(const WindowResizer& resizer, | 51 gfx::Point CalculateDragPoint(const WindowResizer& resizer, |
| 52 int delta_x, | 52 int delta_x, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 TestWindowOrder(window_order_original); | 179 TestWindowOrder(window_order_original); |
| 180 DragEnd(); | 180 DragEnd(); |
| 181 | 181 |
| 182 // Expect original order. | 182 // Expect original order. |
| 183 TestWindowOrder(window_order_original); | 183 TestWindowOrder(window_order_original); |
| 184 } | 184 } |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 scoped_ptr<WindowResizer> resizer_; | 187 scoped_ptr<WindowResizer> resizer_; |
| 188 internal::PanelLayoutManager* panel_layout_manager_; | 188 internal::PanelLayoutManager* panel_layout_manager_; |
| 189 LauncherModel* model_; | 189 ShelfModel* model_; |
| 190 test::TestLauncherDelegate* launcher_delegate_; | 190 test::TestLauncherDelegate* launcher_delegate_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizerTest); | 192 DISALLOW_COPY_AND_ASSIGN(PanelWindowResizerTest); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 class PanelWindowResizerTextDirectionTest | 195 class PanelWindowResizerTextDirectionTest |
| 196 : public PanelWindowResizerTest, | 196 : public PanelWindowResizerTest, |
| 197 public testing::WithParamInterface<bool> { | 197 public testing::WithParamInterface<bool> { |
| 198 public: | 198 public: |
| 199 PanelWindowResizerTextDirectionTest() : is_rtl_(GetParam()) {} | 199 PanelWindowResizerTextDirectionTest() : is_rtl_(GetParam()) {} |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 527 |
| 528 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, | 528 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, |
| 529 testing::Bool()); | 529 testing::Bool()); |
| 530 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, PanelWindowResizerTransientTest, | 530 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, PanelWindowResizerTransientTest, |
| 531 testing::Values(aura::client::WINDOW_TYPE_NORMAL, | 531 testing::Values(aura::client::WINDOW_TYPE_NORMAL, |
| 532 aura::client::WINDOW_TYPE_PANEL, | 532 aura::client::WINDOW_TYPE_PANEL, |
| 533 aura::client::WINDOW_TYPE_POPUP)); | 533 aura::client::WINDOW_TYPE_POPUP)); |
| 534 | 534 |
| 535 } // namespace internal | 535 } // namespace internal |
| 536 } // namespace ash | 536 } // namespace ash |
| OLD | NEW |