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

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

Issue 1178423008: Provision to start base::SimpleTestTickClock at initial ticks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 11 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/test/task_switch_time_tracker_test_api.cc ('k') | base/test/simple_test_tick_clock.h » ('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 <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
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
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
OLDNEW
« no previous file with comments | « ash/test/task_switch_time_tracker_test_api.cc ('k') | base/test/simple_test_tick_clock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698