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

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

Issue 2768543002: chromeos: Add PowerManagerClient::GetSwitchStates(). (Closed)
Patch Set: document that callbacks aren't run on error 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/maximize_mode/maximize_mode_controller.h" 5 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 146
147 void HoldDeviceVertical() { 147 void HoldDeviceVertical() {
148 gfx::Vector3dF base_vector(9.8f, 0.0f, 0.0f); 148 gfx::Vector3dF base_vector(9.8f, 0.0f, 0.0f);
149 gfx::Vector3dF lid_vector(9.8f, 0.0f, 0.0f); 149 gfx::Vector3dF lid_vector(9.8f, 0.0f, 0.0f);
150 TriggerBaseAndLidUpdate(base_vector, lid_vector); 150 TriggerBaseAndLidUpdate(base_vector, lid_vector);
151 } 151 }
152 152
153 void OpenLid() { 153 void OpenLid() {
154 maximize_mode_controller()->LidEventReceived( 154 maximize_mode_controller()->LidEventReceived(
155 true /* open */, maximize_mode_controller()->tick_clock_->NowTicks()); 155 chromeos::PowerManagerClient::LidState::OPEN,
156 maximize_mode_controller()->tick_clock_->NowTicks());
156 } 157 }
157 158
158 void CloseLid() { 159 void CloseLid() {
159 maximize_mode_controller()->LidEventReceived( 160 maximize_mode_controller()->LidEventReceived(
160 false /* open */, maximize_mode_controller()->tick_clock_->NowTicks()); 161 chromeos::PowerManagerClient::LidState::CLOSED,
162 maximize_mode_controller()->tick_clock_->NowTicks());
161 } 163 }
162 164
163 bool WasLidOpenedRecently() { 165 bool WasLidOpenedRecently() {
164 return maximize_mode_controller()->WasLidOpenedRecently(); 166 return maximize_mode_controller()->WasLidOpenedRecently();
165 } 167 }
166 168
167 void SetTabletMode(bool on) { 169 void SetTabletMode(bool on) {
168 maximize_mode_controller()->TabletModeEventReceived( 170 maximize_mode_controller()->TabletModeEventReceived(
169 on, maximize_mode_controller()->tick_clock_->NowTicks()); 171 on ? chromeos::PowerManagerClient::TabletMode::ON
172 : chromeos::PowerManagerClient::TabletMode::OFF,
173 maximize_mode_controller()->tick_clock_->NowTicks());
170 } 174 }
171 175
172 bool AreEventsBlocked() { 176 bool AreEventsBlocked() {
173 return !!maximize_mode_controller()->event_blocker_.get(); 177 return !!maximize_mode_controller()->event_blocker_.get();
174 } 178 }
175 179
176 base::UserActionTester* user_action_tester() { return &user_action_tester_; } 180 base::UserActionTester* user_action_tester() { return &user_action_tester_; }
177 181
178 private: 182 private:
179 base::SimpleTestTickClock* test_tick_clock_; 183 base::SimpleTestTickClock* test_tick_clock_;
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 4], 577 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 4],
574 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 5]); 578 kAccelerometerVerticalHingeUnstableAnglesTestData[i * 6 + 5]);
575 TriggerBaseAndLidUpdate(base, lid); 579 TriggerBaseAndLidUpdate(base, lid);
576 // There are a lot of samples, so ASSERT rather than EXPECT to only generate 580 // There are a lot of samples, so ASSERT rather than EXPECT to only generate
577 // one failure rather than potentially hundreds. 581 // one failure rather than potentially hundreds.
578 ASSERT_TRUE(IsMaximizeModeStarted()); 582 ASSERT_TRUE(IsMaximizeModeStarted());
579 } 583 }
580 } 584 }
581 585
582 } // namespace ash 586 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_controller.cc ('k') | chrome/browser/chromeos/login/lock/webui_screen_locker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698