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

Side by Side Diff: ash/wm/dock/docked_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
« no previous file with comments | « ash/test/shell_test_api.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dock/docked_window_resizer.h" 5 #include "ash/common/wm/dock/docked_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/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/common/shelf/shelf_model.h" 9 #include "ash/common/shelf/shelf_model.h"
10 #include "ash/common/shelf/shelf_types.h" 10 #include "ash/common/shelf/shelf_types.h"
11 #include "ash/common/shell_window_ids.h" 11 #include "ash/common/shell_window_ids.h"
12 #include "ash/common/wm/dock/docked_window_layout_manager.h" 12 #include "ash/common/wm/dock/docked_window_layout_manager.h"
13 #include "ash/common/wm/panels/panel_layout_manager.h" 13 #include "ash/common/wm/panels/panel_layout_manager.h"
14 #include "ash/common/wm/window_state.h" 14 #include "ash/common/wm/window_state.h"
15 #include "ash/common/wm/wm_event.h" 15 #include "ash/common/wm/wm_event.h"
16 #include "ash/common/wm_shell.h"
16 #include "ash/display/window_tree_host_manager.h" 17 #include "ash/display/window_tree_host_manager.h"
17 #include "ash/root_window_controller.h" 18 #include "ash/root_window_controller.h"
18 #include "ash/screen_util.h" 19 #include "ash/screen_util.h"
19 #include "ash/shelf/shelf.h" 20 #include "ash/shelf/shelf.h"
20 #include "ash/shelf/shelf_layout_manager.h" 21 #include "ash/shelf/shelf_layout_manager.h"
21 #include "ash/shelf/shelf_widget.h" 22 #include "ash/shelf/shelf_widget.h"
22 #include "ash/shell.h" 23 #include "ash/shell.h"
23 #include "ash/test/ash_test_base.h" 24 #include "ash/test/ash_test_base.h"
24 #include "ash/test/cursor_manager_test_api.h" 25 #include "ash/test/cursor_manager_test_api.h"
25 #include "ash/test/shell_test_api.h"
26 #include "ash/test/test_shelf_delegate.h" 26 #include "ash/test/test_shelf_delegate.h"
27 #include "ash/wm/drag_window_resizer.h" 27 #include "ash/wm/drag_window_resizer.h"
28 #include "ash/wm/window_state_aura.h" 28 #include "ash/wm/window_state_aura.h"
29 #include "ash/wm/window_util.h" 29 #include "ash/wm/window_util.h"
30 #include "base/command_line.h" 30 #include "base/command_line.h"
31 #include "ui/aura/client/aura_constants.h" 31 #include "ui/aura/client/aura_constants.h"
32 #include "ui/aura/client/window_tree_client.h" 32 #include "ui/aura/client/window_tree_client.h"
33 #include "ui/aura/test/test_window_delegate.h" 33 #include "ui/aura/test/test_window_delegate.h"
34 #include "ui/aura/window_event_dispatcher.h" 34 #include "ui/aura/window_event_dispatcher.h"
35 #include "ui/base/hit_test.h" 35 #include "ui/base/hit_test.h"
36 #include "ui/base/ui_base_types.h" 36 #include "ui/base/ui_base_types.h"
37 #include "ui/events/test/event_generator.h" 37 #include "ui/events/test/event_generator.h"
38 #include "ui/views/widget/widget.h" 38 #include "ui/views/widget/widget.h"
39 #include "ui/wm/core/coordinate_conversion.h" 39 #include "ui/wm/core/coordinate_conversion.h"
40 #include "ui/wm/core/window_util.h" 40 #include "ui/wm/core/window_util.h"
41 41
42 namespace ash { 42 namespace ash {
43 43
44 class DockedWindowResizerTest 44 class DockedWindowResizerTest
45 : public test::AshTestBase, 45 : public test::AshTestBase,
46 public testing::WithParamInterface<ui::wm::WindowType> { 46 public testing::WithParamInterface<ui::wm::WindowType> {
47 public: 47 public:
48 DockedWindowResizerTest() : model_(NULL), window_type_(GetParam()) {} 48 DockedWindowResizerTest() : model_(NULL), window_type_(GetParam()) {}
49 virtual ~DockedWindowResizerTest() {} 49 virtual ~DockedWindowResizerTest() {}
50 50
51 void SetUp() override { 51 void SetUp() override {
52 AshTestBase::SetUp(); 52 AshTestBase::SetUp();
53 UpdateDisplay("600x400"); 53 UpdateDisplay("600x400");
54 test::ShellTestApi test_api(Shell::GetInstance()); 54 model_ = WmShell::Get()->shelf_model();
55 model_ = test_api.shelf_model();
56 } 55 }
57 56
58 void TearDown() override { AshTestBase::TearDown(); } 57 void TearDown() override { AshTestBase::TearDown(); }
59 58
60 protected: 59 protected:
61 enum DockedEdge { 60 enum DockedEdge {
62 DOCKED_EDGE_NONE, 61 DOCKED_EDGE_NONE,
63 DOCKED_EDGE_LEFT, 62 DOCKED_EDGE_LEFT,
64 DOCKED_EDGE_RIGHT, 63 DOCKED_EDGE_RIGHT,
65 }; 64 };
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 EXPECT_TRUE(window_state->IsMaximized()); 1575 EXPECT_TRUE(window_state->IsMaximized());
1577 } 1576 }
1578 1577
1579 // Tests run twice - on both panels and normal windows 1578 // Tests run twice - on both panels and normal windows
1580 INSTANTIATE_TEST_CASE_P(NormalOrPanel, 1579 INSTANTIATE_TEST_CASE_P(NormalOrPanel,
1581 DockedWindowResizerTest, 1580 DockedWindowResizerTest,
1582 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 1581 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
1583 ui::wm::WINDOW_TYPE_PANEL)); 1582 ui::wm::WINDOW_TYPE_PANEL));
1584 1583
1585 } // namespace ash 1584 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/shell_test_api.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698