OLD | NEW |
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 <math.h> | 5 #include <math.h> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 8 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 | 112 |
113 bool IsMaximizeModeStarted() { | 113 bool IsMaximizeModeStarted() { |
114 return maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled(); | 114 return maximize_mode_controller()->IsMaximizeModeWindowManagerEnabled(); |
115 } | 115 } |
116 | 116 |
117 // Attaches a SimpleTestTickClock to the MaximizeModeController with a non | 117 // Attaches a SimpleTestTickClock to the MaximizeModeController with a non |
118 // null value initial value. | 118 // null value initial value. |
119 void AttachTickClockForTest() { | 119 void AttachTickClockForTest() { |
120 scoped_ptr<base::TickClock> tick_clock( | 120 scoped_ptr<base::TickClock> tick_clock( |
121 test_tick_clock_ = new base::SimpleTestTickClock()); | 121 test_tick_clock_ = new base::SimpleTestTickClock( |
122 test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1)); | 122 base::TimeTicks() + base::TimeDelta::FromSeconds(1))); |
123 maximize_mode_controller()->SetTickClockForTest(tick_clock.Pass()); | 123 maximize_mode_controller()->SetTickClockForTest(tick_clock.Pass()); |
124 } | 124 } |
125 | 125 |
126 void AdvanceTickClock(const base::TimeDelta& delta) { | 126 void AdvanceTickClock(const base::TimeDelta& delta) { |
127 DCHECK(test_tick_clock_); | 127 DCHECK(test_tick_clock_); |
128 test_tick_clock_->Advance(delta); | 128 test_tick_clock_->Advance(delta); |
129 } | 129 } |
130 | 130 |
131 void OpenLidToAngle(float degrees) { | 131 void OpenLidToAngle(float degrees) { |
132 DCHECK(degrees >= 0.0f); | 132 DCHECK(degrees >= 0.0f); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 // accelerometer updates which would normally cause it to exit do not. | 484 // accelerometer updates which would normally cause it to exit do not. |
485 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) { | 485 TEST_F(MaximizeModeControllerSwitchesTest, IgnoreHingeAngles) { |
486 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); | 486 maximize_mode_controller()->EnableMaximizeModeWindowManager(true); |
487 | 487 |
488 // Would normally trigger an exit from maximize mode. | 488 // Would normally trigger an exit from maximize mode. |
489 OpenLidToAngle(90.0f); | 489 OpenLidToAngle(90.0f); |
490 EXPECT_TRUE(IsMaximizeModeStarted()); | 490 EXPECT_TRUE(IsMaximizeModeStarted()); |
491 } | 491 } |
492 | 492 |
493 } // namespace ash | 493 } // namespace ash |
OLD | NEW |