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

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

Issue 2183483002: Clean up ash::ShellTestApi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/common/wm/panels/panel_window_resizer.h" 5 #include "ash/common/wm/panels/panel_window_resizer.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/shelf/shelf_model.h" 8 #include "ash/common/shelf/shelf_model.h"
9 #include "ash/common/shelf/shelf_types.h" 9 #include "ash/common/shelf/shelf_types.h"
10 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
11 #include "ash/common/wm/window_state.h" 11 #include "ash/common/wm/window_state.h"
12 #include "ash/common/wm/wm_event.h" 12 #include "ash/common/wm/wm_event.h"
13 #include "ash/common/wm_shell.h"
13 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
14 #include "ash/shelf/shelf.h" 15 #include "ash/shelf/shelf.h"
15 #include "ash/shelf/shelf_layout_manager.h" 16 #include "ash/shelf/shelf_layout_manager.h"
16 #include "ash/shelf/shelf_util.h" 17 #include "ash/shelf/shelf_util.h"
17 #include "ash/shelf/shelf_widget.h" 18 #include "ash/shelf/shelf_widget.h"
18 #include "ash/shell.h" 19 #include "ash/shell.h"
19 #include "ash/test/ash_test_base.h" 20 #include "ash/test/ash_test_base.h"
20 #include "ash/test/cursor_manager_test_api.h" 21 #include "ash/test/cursor_manager_test_api.h"
21 #include "ash/test/shell_test_api.h"
22 #include "ash/test/test_shelf_delegate.h" 22 #include "ash/test/test_shelf_delegate.h"
23 #include "ash/wm/drag_window_resizer.h" 23 #include "ash/wm/drag_window_resizer.h"
24 #include "ash/wm/window_state_aura.h" 24 #include "ash/wm/window_state_aura.h"
25 #include "base/i18n/rtl.h" 25 #include "base/i18n/rtl.h"
26 #include "base/win/windows_version.h" 26 #include "base/win/windows_version.h"
27 #include "ui/aura/client/aura_constants.h" 27 #include "ui/aura/client/aura_constants.h"
28 #include "ui/aura/window_event_dispatcher.h" 28 #include "ui/aura/window_event_dispatcher.h"
29 #include "ui/base/hit_test.h" 29 #include "ui/base/hit_test.h"
30 #include "ui/base/ui_base_types.h" 30 #include "ui/base/ui_base_types.h"
31 #include "ui/views/widget/widget.h" 31 #include "ui/views/widget/widget.h"
32 #include "ui/wm/core/window_util.h" 32 #include "ui/wm/core/window_util.h"
33 33
34 namespace ash { 34 namespace ash {
35 35
36 class PanelWindowResizerTest : public test::AshTestBase { 36 class PanelWindowResizerTest : public test::AshTestBase {
37 public: 37 public:
38 PanelWindowResizerTest() {} 38 PanelWindowResizerTest() {}
39 ~PanelWindowResizerTest() override {} 39 ~PanelWindowResizerTest() override {}
40 40
41 void SetUp() override { 41 void SetUp() override {
42 AshTestBase::SetUp(); 42 AshTestBase::SetUp();
43 UpdateDisplay("600x400"); 43 UpdateDisplay("600x400");
44 test::ShellTestApi test_api(Shell::GetInstance()); 44 model_ = WmShell::Get()->shelf_model();
45 model_ = test_api.shelf_model();
46 shelf_delegate_ = test::TestShelfDelegate::instance(); 45 shelf_delegate_ = test::TestShelfDelegate::instance();
47 } 46 }
48 47
49 void TearDown() override { AshTestBase::TearDown(); } 48 void TearDown() override { AshTestBase::TearDown(); }
50 49
51 protected: 50 protected:
52 gfx::Point CalculateDragPoint(const WindowResizer& resizer, 51 gfx::Point CalculateDragPoint(const WindowResizer& resizer,
53 int delta_x, 52 int delta_x,
54 int delta_y) const { 53 int delta_y) const {
55 gfx::Point location = resizer.GetInitialLocation(); 54 gfx::Point location = resizer.GetInitialLocation();
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 INSTANTIATE_TEST_CASE_P(LtrRtl, 556 INSTANTIATE_TEST_CASE_P(LtrRtl,
558 PanelWindowResizerTextDirectionTest, 557 PanelWindowResizerTextDirectionTest,
559 testing::Bool()); 558 testing::Bool());
560 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, 559 INSTANTIATE_TEST_CASE_P(NormalPanelPopup,
561 PanelWindowResizerTransientTest, 560 PanelWindowResizerTransientTest,
562 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 561 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
563 ui::wm::WINDOW_TYPE_PANEL, 562 ui::wm::WINDOW_TYPE_PANEL,
564 ui::wm::WINDOW_TYPE_POPUP)); 563 ui::wm::WINDOW_TYPE_POPUP));
565 564
566 } // namespace ash 565 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698