OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/test/task_switch_time_tracker_test_api.h" |
| 6 |
| 7 #include "ash/metrics/task_switch_time_tracker.h" |
| 8 #include "base/test/simple_test_tick_clock.h" |
| 9 |
| 10 namespace ash { |
| 11 namespace test { |
| 12 |
| 13 TaskSwitchTimeTrackerTestAPI::TaskSwitchTimeTrackerTestAPI( |
| 14 const std::string& histogram_name) { |
| 15 tick_clock_ = new base::SimpleTestTickClock(); |
| 16 time_tracker_.reset(new TaskSwitchTimeTracker( |
| 17 histogram_name, scoped_ptr<base::TickClock>(tick_clock_))); |
| 18 } |
| 19 |
| 20 TaskSwitchTimeTrackerTestAPI::~TaskSwitchTimeTrackerTestAPI() { |
| 21 tick_clock_ = nullptr; |
| 22 } |
| 23 |
| 24 void TaskSwitchTimeTrackerTestAPI::Advance(base::TimeDelta time_delta) { |
| 25 tick_clock_->Advance(time_delta); |
| 26 } |
| 27 |
| 28 bool TaskSwitchTimeTrackerTestAPI::HasLastActionTime() const { |
| 29 return time_tracker_->HasLastActionTime(); |
| 30 } |
| 31 |
| 32 } // namespace test |
| 33 } // namespace ash |
OLD | NEW |