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

Side by Side Diff: ash/wm/window_cycle_controller_unittest.cc

Issue 2825533003: mash: Prerequisites for removing ShelfDelegate. (Closed)
Patch Set: Expand CheckWindowAndItemPlacement comment. Created 3 years, 8 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/wm/panels/panel_window_resizer_unittest.cc ('k') | ash/wm/workspace_controller_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/window_cycle_controller.h" 5 #include "ash/wm/window_cycle_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/focus_cycler.h" 10 #include "ash/focus_cycler.h"
11 #include "ash/public/cpp/config.h" 11 #include "ash/public/cpp/config.h"
12 #include "ash/public/cpp/shell_window_ids.h" 12 #include "ash/public/cpp/shell_window_ids.h"
13 #include "ash/scoped_root_window_for_new_windows.h" 13 #include "ash/scoped_root_window_for_new_windows.h"
14 #include "ash/session/session_controller.h" 14 #include "ash/session/session_controller.h"
15 #include "ash/shelf/shelf_widget.h" 15 #include "ash/shelf/shelf_widget.h"
16 #include "ash/shelf/wm_shelf.h" 16 #include "ash/shelf/wm_shelf.h"
17 #include "ash/shell.h" 17 #include "ash/shell.h"
18 #include "ash/test/ash_test_base.h" 18 #include "ash/test/ash_test_base.h"
19 #include "ash/test/shelf_view_test_api.h" 19 #include "ash/test/shelf_view_test_api.h"
20 #include "ash/test/test_app_list_view_presenter_impl.h" 20 #include "ash/test/test_app_list_view_presenter_impl.h"
21 #include "ash/test/test_session_controller_client.h" 21 #include "ash/test/test_session_controller_client.h"
22 #include "ash/test/test_shelf_delegate.h"
23 #include "ash/test/test_shell_delegate.h" 22 #include "ash/test/test_shell_delegate.h"
24 #include "ash/wm/window_cycle_list.h" 23 #include "ash/wm/window_cycle_list.h"
25 #include "ash/wm/window_state.h" 24 #include "ash/wm/window_state.h"
26 #include "ash/wm/window_state_aura.h" 25 #include "ash/wm/window_state_aura.h"
27 #include "ash/wm/window_util.h" 26 #include "ash/wm/window_util.h"
28 #include "ash/wm/wm_event.h" 27 #include "ash/wm/wm_event.h"
29 #include "ash/wm_window.h" 28 #include "ash/wm_window.h"
30 #include "ui/aura/client/aura_constants.h" 29 #include "ui/aura/client/aura_constants.h"
31 #include "ui/aura/client/screen_position_client.h" 30 #include "ui/aura/client/screen_position_client.h"
32 #include "ui/aura/env.h" 31 #include "ui/aura/env.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 94
96 shelf_view_test_.reset(new test::ShelfViewTestAPI( 95 shelf_view_test_.reset(new test::ShelfViewTestAPI(
97 GetPrimaryShelf()->GetShelfViewForTesting())); 96 GetPrimaryShelf()->GetShelfViewForTesting()));
98 shelf_view_test_->SetAnimationDuration(1); 97 shelf_view_test_->SetAnimationDuration(1);
99 } 98 }
100 99
101 aura::Window* CreatePanelWindow() { 100 aura::Window* CreatePanelWindow() {
102 gfx::Rect rect(100, 100); 101 gfx::Rect rect(100, 100);
103 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( 102 aura::Window* window = CreateTestWindowInShellWithDelegateAndType(
104 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, rect); 103 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, rect);
105 test::TestShelfDelegate::instance()->AddShelfItem(WmWindow::Get(window));
106 shelf_view_test_->RunMessageLoopUntilAnimationsDone(); 104 shelf_view_test_->RunMessageLoopUntilAnimationsDone();
107 return window; 105 return window;
108 } 106 }
109 107
110 const aura::Window::Windows GetWindows(WindowCycleController* controller) { 108 const aura::Window::Windows GetWindows(WindowCycleController* controller) {
111 return WmWindow::ToAuraWindows(controller->window_cycle_list()->windows()); 109 return WmWindow::ToAuraWindows(controller->window_cycle_list()->windows());
112 } 110 }
113 111
114 const views::Widget* GetWindowCycleListWidget() const { 112 const views::Widget* GetWindowCycleListWidget() const {
115 return Shell::Get() 113 return Shell::Get()
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 // Base case sets the expectation for other cases. 761 // Base case sets the expectation for other cases.
764 if (expected_bounds.IsEmpty()) 762 if (expected_bounds.IsEmpty())
765 expected_bounds = display_relative_bounds; 763 expected_bounds = display_relative_bounds;
766 else 764 else
767 EXPECT_EQ(expected_bounds, display_relative_bounds); 765 EXPECT_EQ(expected_bounds, display_relative_bounds);
768 controller->CompleteCycling(); 766 controller->CompleteCycling();
769 } 767 }
770 } 768 }
771 769
772 } // namespace ash 770 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_window_resizer_unittest.cc ('k') | ash/wm/workspace_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698