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

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_controller_unittest.cc

Issue 308683002: Move MaximizeModeWindowManager to the controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/wm/maximize_mode/maximize_mode_controller.h" 5 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
6 6
7 #include "ash/accelerometer/accelerometer_controller.h" 7 #include "ash/accelerometer/accelerometer_controller.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 test::DisplayManagerTestApi(Shell::GetInstance()->display_manager()). 106 test::DisplayManagerTestApi(Shell::GetInstance()->display_manager()).
107 SetFirstDisplayAsInternalDisplay(); 107 SetFirstDisplayAsInternalDisplay();
108 } 108 }
109 109
110 virtual void TearDown() OVERRIDE { 110 virtual void TearDown() OVERRIDE {
111 Shell::GetInstance()->accelerometer_controller()->AddObserver( 111 Shell::GetInstance()->accelerometer_controller()->AddObserver(
112 maximize_mode_controller()); 112 maximize_mode_controller());
113 test::AshTestBase::TearDown(); 113 test::AshTestBase::TearDown();
114 } 114 }
115 115
116 MaximizeModeController* maximize_mode_controller() { 116 MaximizeModeController* maximize_mode_controller() const {
flackr 2014/05/29 16:10:06 How about const and non-const versions which retur
jonross 2014/05/29 17:40:00 Removed the original const on 1125 to clear the ne
117 return Shell::GetInstance()->maximize_mode_controller(); 117 return Shell::GetInstance()->maximize_mode_controller();
118 } 118 }
119 119
120 void TriggerAccelerometerUpdate(const gfx::Vector3dF& base, 120 void TriggerAccelerometerUpdate(const gfx::Vector3dF& base,
121 const gfx::Vector3dF& lid) { 121 const gfx::Vector3dF& lid) {
122 maximize_mode_controller()->OnAccelerometerUpdated(base, lid); 122 maximize_mode_controller()->OnAccelerometerUpdated(base, lid);
123 } 123 }
124 124
125 bool IsMaximizeModeStarted() const { 125 bool IsMaximizeModeStarted() const {
126 return Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled(); 126 return maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled();
127 } 127 }
128 128
129 // Overrides the internal input device list for the current event targeters 129 // Overrides the internal input device list for the current event targeters
130 // with one which always returns true. 130 // with one which always returns true.
131 void InstallTestInternalDeviceList() { 131 void InstallTestInternalDeviceList() {
132 maximize_mode_controller()->event_blocker_->internal_devices_.reset( 132 maximize_mode_controller()->event_blocker_->internal_devices_.reset(
133 new TestInternalInputDeviceList); 133 new TestInternalInputDeviceList);
134 } 134 }
135 135
136 gfx::Display::Rotation GetInternalDisplayRotation() const { 136 gfx::Display::Rotation GetInternalDisplayRotation() const {
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 EXPECT_EQ(gfx::Display::ROTATE_180, GetInternalDisplayRotation()); 613 EXPECT_EQ(gfx::Display::ROTATE_180, GetInternalDisplayRotation());
614 614
615 // Exit maximize mode 615 // Exit maximize mode
616 TriggerAccelerometerUpdate(gfx::Vector3dF(0.0f, 0.0f, 1.0f), 616 TriggerAccelerometerUpdate(gfx::Vector3dF(0.0f, 0.0f, 1.0f),
617 gfx::Vector3dF(-1.0f, 0.0f, 0.0f)); 617 gfx::Vector3dF(-1.0f, 0.0f, 0.0f));
618 EXPECT_FALSE(IsMaximizeModeStarted()); 618 EXPECT_FALSE(IsMaximizeModeStarted());
619 EXPECT_EQ(gfx::Display::ROTATE_90, GetInternalDisplayRotation()); 619 EXPECT_EQ(gfx::Display::ROTATE_90, GetInternalDisplayRotation());
620 } 620 }
621 621
622 } // namespace ash 622 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698