| OLD | NEW |
| 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 |
| OLD | NEW |