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

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

Issue 2761063002: Move more from WmShell to Shell (Closed)
Patch Set: cleanup Created 3 years, 9 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 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/common/wm/window_cycle_controller.h" 5 #include "ash/common/wm/window_cycle_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/common/focus_cycler.h" 10 #include "ash/common/focus_cycler.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 TEST_F(WindowCycleControllerTest, SingleWindowNotActive) { 144 TEST_F(WindowCycleControllerTest, SingleWindowNotActive) {
145 WindowCycleController* controller = WmShell::Get()->window_cycle_controller(); 145 WindowCycleController* controller = WmShell::Get()->window_cycle_controller();
146 146
147 // Create a single test window. 147 // Create a single test window.
148 std::unique_ptr<Window> window0(CreateTestWindowInShellWithId(0)); 148 std::unique_ptr<Window> window0(CreateTestWindowInShellWithId(0));
149 wm::ActivateWindow(window0.get()); 149 wm::ActivateWindow(window0.get());
150 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); 150 EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
151 151
152 // Rotate focus, this should move focus to another window that isn't part of 152 // Rotate focus, this should move focus to another window that isn't part of
153 // the default container. 153 // the default container.
154 WmShell::Get()->focus_cycler()->RotateFocus(FocusCycler::FORWARD); 154 Shell::Get()->focus_cycler()->RotateFocus(FocusCycler::FORWARD);
155 EXPECT_FALSE(wm::IsActiveWindow(window0.get())); 155 EXPECT_FALSE(wm::IsActiveWindow(window0.get()));
156 156
157 // Cycling should activate the window. 157 // Cycling should activate the window.
158 controller->HandleCycleWindow(WindowCycleController::FORWARD); 158 controller->HandleCycleWindow(WindowCycleController::FORWARD);
159 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); 159 EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
160 } 160 }
161 161
162 TEST_F(WindowCycleControllerTest, HandleCycleWindow) { 162 TEST_F(WindowCycleControllerTest, HandleCycleWindow) {
163 WindowCycleController* controller = WmShell::Get()->window_cycle_controller(); 163 WindowCycleController* controller = WmShell::Get()->window_cycle_controller();
164 164
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 // Base case sets the expectation for other cases. 762 // Base case sets the expectation for other cases.
763 if (expected_bounds.IsEmpty()) 763 if (expected_bounds.IsEmpty())
764 expected_bounds = display_relative_bounds; 764 expected_bounds = display_relative_bounds;
765 else 765 else
766 EXPECT_EQ(expected_bounds, display_relative_bounds); 766 EXPECT_EQ(expected_bounds, display_relative_bounds);
767 controller->CompleteCycling(); 767 controller->CompleteCycling();
768 } 768 }
769 } 769 }
770 770
771 } // namespace ash 771 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698