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

Side by Side Diff: ash/laser/laser_pointer_points_test_api.cc

Issue 2745953002: ash: Add basic prediction code to the laser pointer. (Closed)
Patch Set: more tests and nits 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
« no previous file with comments | « ash/laser/laser_pointer_points.cc ('k') | ash/laser/laser_pointer_points_unittest.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/laser/laser_pointer_points_test_api.h" 5 #include "ash/laser/laser_pointer_points_test_api.h"
6 6
7 namespace ash { 7 namespace ash {
8 8
9 LaserPointerPointsTestApi::LaserPointerPointsTestApi( 9 LaserPointerPointsTestApi::LaserPointerPointsTestApi(
10 LaserPointerPoints* instance) 10 LaserPointerPoints* instance)
11 : instance_(instance) {} 11 : instance_(instance) {}
12 12
13 LaserPointerPointsTestApi::~LaserPointerPointsTestApi() {} 13 LaserPointerPointsTestApi::~LaserPointerPointsTestApi() {}
14 14
15 int LaserPointerPointsTestApi::GetNumberOfPoints() const { 15 int LaserPointerPointsTestApi::GetNumberOfPoints() const {
16 return instance_->GetNumberOfPoints(); 16 return instance_->GetNumberOfPoints();
17 } 17 }
18 18
19 void LaserPointerPointsTestApi::MoveForwardInTime( 19 void LaserPointerPointsTestApi::MoveForwardInTime(
20 const base::TimeDelta& delta) { 20 const base::TimeDelta& delta) {
21 base::Time new_time = instance_->collection_latest_time_ + delta; 21 base::TimeTicks new_time = instance_->collection_latest_time_ + delta;
22 instance_->MoveForwardToTime(new_time); 22 instance_->MoveForwardToTime(new_time);
23 23
24 LaserPointerPoints::LaserPoint new_point; 24 LaserPointerPoints::LaserPoint new_point;
25 instance_->points_.push_back(new_point); 25 instance_->points_.push_back(new_point);
26 } 26 }
27 27
28 LaserPointerPoints::LaserPoint LaserPointerPointsTestApi::GetPointAtIndex( 28 LaserPointerPoints::LaserPoint LaserPointerPointsTestApi::GetPointAtIndex(
29 int index) { 29 int index) {
30 DCHECK(index >= 0 && index < GetNumberOfPoints()); 30 DCHECK(index >= 0 && index < GetNumberOfPoints());
31 return instance_->points_[index]; 31 return instance_->points_[index];
32 } 32 }
33 33
34 } // namespace ash 34 } // namespace ash
OLDNEW
« no previous file with comments | « ash/laser/laser_pointer_points.cc ('k') | ash/laser/laser_pointer_points_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698