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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2293183002: ash: Remove ash::Shelf in favor of ash::WmShelf (Closed)
Patch Set: rebase again Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/aura/wm_window_aura.h" 8 #include "ash/aura/wm_window_aura.h"
9 #include "ash/common/accessibility_delegate.h" 9 #include "ash/common/accessibility_delegate.h"
10 #include "ash/common/accessibility_types.h" 10 #include "ash/common/accessibility_types.h"
11 #include "ash/common/ash_switches.h" 11 #include "ash/common/ash_switches.h"
12 #include "ash/common/material_design/material_design_controller.h" 12 #include "ash/common/material_design/material_design_controller.h"
13 #include "ash/common/shelf/shelf.h"
14 #include "ash/common/shelf/shelf_widget.h" 13 #include "ash/common/shelf/shelf_widget.h"
14 #include "ash/common/shelf/wm_shelf.h"
15 #include "ash/common/shell_window_ids.h" 15 #include "ash/common/shell_window_ids.h"
16 #include "ash/common/system/tray/system_tray.h" 16 #include "ash/common/system/tray/system_tray.h"
17 #include "ash/common/test/material_design_controller_test_api.h" 17 #include "ash/common/test/material_design_controller_test_api.h"
18 #include "ash/common/wm/dock/docked_window_layout_manager.h" 18 #include "ash/common/wm/dock/docked_window_layout_manager.h"
19 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 19 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
20 #include "ash/common/wm/mru_window_tracker.h" 20 #include "ash/common/wm/mru_window_tracker.h"
21 #include "ash/common/wm/overview/scoped_transform_overview_window.h" 21 #include "ash/common/wm/overview/scoped_transform_overview_window.h"
22 #include "ash/common/wm/overview/window_grid.h" 22 #include "ash/common/wm/overview/window_grid.h"
23 #include "ash/common/wm/overview/window_selector.h" 23 #include "ash/common/wm/overview/window_selector.h"
24 #include "ash/common/wm/overview/window_selector_controller.h" 24 #include "ash/common/wm/overview/window_selector_controller.h"
25 #include "ash/common/wm/overview/window_selector_item.h" 25 #include "ash/common/wm/overview/window_selector_item.h"
26 #include "ash/common/wm/panels/panel_layout_manager.h" 26 #include "ash/common/wm/panels/panel_layout_manager.h"
27 #include "ash/common/wm/window_state.h" 27 #include "ash/common/wm/window_state.h"
28 #include "ash/common/wm/wm_event.h" 28 #include "ash/common/wm/wm_event.h"
29 #include "ash/common/wm_shell.h" 29 #include "ash/common/wm_shell.h"
30 #include "ash/display/display_manager.h" 30 #include "ash/display/display_manager.h"
31 #include "ash/drag_drop/drag_drop_controller.h" 31 #include "ash/drag_drop/drag_drop_controller.h"
32 #include "ash/root_window_controller.h" 32 #include "ash/root_window_controller.h"
33 #include "ash/screen_util.h" 33 #include "ash/screen_util.h"
34 #include "ash/shell.h" 34 #include "ash/shell.h"
35 #include "ash/test/ash_test_base.h" 35 #include "ash/test/ash_test_base.h"
36 #include "ash/test/display_manager_test_api.h" 36 #include "ash/test/display_manager_test_api.h"
37 #include "ash/test/shelf_test_api.h"
38 #include "ash/test/shelf_view_test_api.h" 37 #include "ash/test/shelf_view_test_api.h"
39 #include "ash/test/shell_test_api.h" 38 #include "ash/test/shell_test_api.h"
40 #include "ash/test/test_shelf_delegate.h" 39 #include "ash/test/test_shelf_delegate.h"
41 #include "ash/wm/window_state_aura.h" 40 #include "ash/wm/window_state_aura.h"
42 #include "ash/wm/window_util.h" 41 #include "ash/wm/window_util.h"
43 #include "base/command_line.h" 42 #include "base/command_line.h"
44 #include "base/compiler_specific.h" 43 #include "base/compiler_specific.h"
45 #include "base/memory/scoped_vector.h" 44 #include "base/memory/scoped_vector.h"
46 #include "base/run_loop.h" 45 #include "base/run_loop.h"
47 #include "base/strings/string_piece.h" 46 #include "base/strings/string_piece.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void SetUp() override { 115 void SetUp() override {
117 set_material_mode(GetParam()); 116 set_material_mode(GetParam());
118 test::AshTestBase::SetUp(); 117 test::AshTestBase::SetUp();
119 if (!ash::MaterialDesignController::IsOverviewMaterial()) { 118 if (!ash::MaterialDesignController::IsOverviewMaterial()) {
120 base::CommandLine::ForCurrentProcess()->AppendSwitch( 119 base::CommandLine::ForCurrentProcess()->AppendSwitch(
121 switches::kAshEnableStableOverviewOrder); 120 switches::kAshEnableStableOverviewOrder);
122 } 121 }
123 ASSERT_TRUE(test::TestShelfDelegate::instance()); 122 ASSERT_TRUE(test::TestShelfDelegate::instance());
124 123
125 shelf_view_test_.reset(new test::ShelfViewTestAPI( 124 shelf_view_test_.reset(new test::ShelfViewTestAPI(
126 test::ShelfTestAPI(Shelf::ForPrimaryDisplay()).shelf_view())); 125 GetPrimaryShelf()->GetShelfViewForTesting()));
127 shelf_view_test_->SetAnimationDuration(1); 126 shelf_view_test_->SetAnimationDuration(1);
128 ScopedTransformOverviewWindow::SetImmediateCloseForTests(); 127 ScopedTransformOverviewWindow::SetImmediateCloseForTests();
129 } 128 }
130 129
131 aura::Window* CreateWindow(const gfx::Rect& bounds) { 130 aura::Window* CreateWindow(const gfx::Rect& bounds) {
132 return CreateTestWindowInShellWithDelegate(&delegate_, -1, bounds); 131 return CreateTestWindowInShellWithDelegate(&delegate_, -1, bounds);
133 } 132 }
134 133
135 aura::Window* CreateWindowWithId(const gfx::Rect& bounds, int id) { 134 aura::Window* CreateWindowWithId(const gfx::Rect& bounds, int id) {
136 return CreateTestWindowInShellWithDelegate(&delegate_, id, bounds); 135 return CreateTestWindowInShellWithDelegate(&delegate_, id, bounds);
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 bounds.y()); 2119 bounds.y());
2121 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); 2120 EXPECT_LE(transformed_rect.bottom(), bounds.bottom());
2122 EXPECT_NEAR(transformed_rect.x() - bounds.x(), 2121 EXPECT_NEAR(transformed_rect.x() - bounds.x(),
2123 bounds.right() - transformed_rect.right(), 1); 2122 bounds.right() - transformed_rect.right(), 1);
2124 EXPECT_NEAR( 2123 EXPECT_NEAR(
2125 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), 2124 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(),
2126 bounds.bottom() - transformed_rect.bottom(), 1); 2125 bounds.bottom() - transformed_rect.bottom(), 1);
2127 } 2126 }
2128 2127
2129 } // namespace ash 2128 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager_unittest.cc ('k') | ash/wm/panels/attached_panel_window_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698