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

Side by Side Diff: ash/wm/dock/docked_window_layout_manager_unittest.cc

Issue 2617733002: Hide docked windows behind a flag (Closed)
Patch Set: Fix tests failed because of DCHECK Created 3 years, 11 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/dock/docked_window_layout_manager.h" 5 #include "ash/common/wm/dock/docked_window_layout_manager.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/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/test/test_shelf_delegate.h" 10 #include "ash/common/test/test_shelf_delegate.h"
10 #include "ash/common/wm/panels/panel_layout_manager.h" 11 #include "ash/common/wm/panels/panel_layout_manager.h"
11 #include "ash/common/wm/window_resizer.h" 12 #include "ash/common/wm/window_resizer.h"
12 #include "ash/common/wm/window_state.h" 13 #include "ash/common/wm/window_state.h"
13 #include "ash/public/cpp/shell_window_ids.h" 14 #include "ash/public/cpp/shell_window_ids.h"
14 #include "ash/root_window_controller.h" 15 #include "ash/root_window_controller.h"
15 #include "ash/shell.h" 16 #include "ash/shell.h"
16 #include "ash/test/ash_test_base.h" 17 #include "ash/test/ash_test_base.h"
17 #include "ash/test/shelf_view_test_api.h" 18 #include "ash/test/shelf_view_test_api.h"
18 #include "ash/test/shell_test_api.h" 19 #include "ash/test/shell_test_api.h"
19 #include "ash/wm/window_state_aura.h" 20 #include "ash/wm/window_state_aura.h"
20 #include "ash/wm/window_util.h" 21 #include "ash/wm/window_util.h"
22 #include "base/command_line.h"
21 #include "base/strings/string_number_conversions.h" 23 #include "base/strings/string_number_conversions.h"
22 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 24 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
23 #include "ui/aura/client/aura_constants.h" 25 #include "ui/aura/client/aura_constants.h"
24 #include "ui/aura/test/test_window_delegate.h" 26 #include "ui/aura/test/test_window_delegate.h"
25 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
26 #include "ui/aura/window_event_dispatcher.h" 28 #include "ui/aura/window_event_dispatcher.h"
27 #include "ui/base/hit_test.h" 29 #include "ui/base/hit_test.h"
28 #include "ui/display/display_layout.h" 30 #include "ui/display/display_layout.h"
29 #include "ui/display/manager/display_manager.h" 31 #include "ui/display/manager/display_manager.h"
30 #include "ui/display/screen.h" 32 #include "ui/display/screen.h"
31 #include "ui/display/test/display_manager_test_api.h" 33 #include "ui/display/test/display_manager_test_api.h"
32 #include "ui/views/widget/widget.h" 34 #include "ui/views/widget/widget.h"
33 #include "ui/wm/core/coordinate_conversion.h" 35 #include "ui/wm/core/coordinate_conversion.h"
34 36
35 namespace ash { 37 namespace ash {
36 38
37 class DockedWindowLayoutManagerTest 39 class DockedWindowLayoutManagerTest
38 : public test::AshTestBase, 40 : public test::AshTestBase,
39 public testing::WithParamInterface<ui::wm::WindowType> { 41 public testing::WithParamInterface<ui::wm::WindowType> {
40 public: 42 public:
41 DockedWindowLayoutManagerTest() : window_type_(GetParam()) {} 43 DockedWindowLayoutManagerTest() : window_type_(GetParam()) {}
42 virtual ~DockedWindowLayoutManagerTest() {} 44 virtual ~DockedWindowLayoutManagerTest() {}
43 45
44 void SetUp() override { 46 void SetUp() override {
47 base::CommandLine::ForCurrentProcess()->AppendSwitch(
48 ash::switches::kAshEnableDockedWindows);
45 AshTestBase::SetUp(); 49 AshTestBase::SetUp();
46 UpdateDisplay("600x600"); 50 UpdateDisplay("600x600");
47 51
48 shelf_view_test_.reset(new test::ShelfViewTestAPI( 52 shelf_view_test_.reset(new test::ShelfViewTestAPI(
49 GetPrimaryShelf()->GetShelfViewForTesting())); 53 GetPrimaryShelf()->GetShelfViewForTesting()));
50 shelf_view_test_->SetAnimationDuration(1); 54 shelf_view_test_->SetAnimationDuration(1);
51 } 55 }
52 56
53 protected: 57 protected:
54 enum DockedEdge { 58 enum DockedEdge {
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); 802 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height());
799 } 803 }
800 804
801 // Tests run twice - on both panels and normal windows 805 // Tests run twice - on both panels and normal windows
802 INSTANTIATE_TEST_CASE_P(NormalOrPanel, 806 INSTANTIATE_TEST_CASE_P(NormalOrPanel,
803 DockedWindowLayoutManagerTest, 807 DockedWindowLayoutManagerTest,
804 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 808 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
805 ui::wm::WINDOW_TYPE_PANEL)); 809 ui::wm::WINDOW_TYPE_PANEL));
806 810
807 } // namespace ash 811 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698