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

Side by Side Diff: ash/test/task_switch_time_tracker_test_api.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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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/test/task_switch_time_tracker_test_api.h" 5 #include "ash/test/task_switch_time_tracker_test_api.h"
6 6
7 #include "ash/metrics/task_switch_time_tracker.h" 7 #include "ash/metrics/task_switch_time_tracker.h"
8 #include "base/test/simple_test_tick_clock.h" 8 #include "base/test/simple_test_tick_clock.h"
9 9
10 namespace ash { 10 namespace ash {
11 namespace test { 11 namespace test {
12 12
13 TaskSwitchTimeTrackerTestAPI::TaskSwitchTimeTrackerTestAPI( 13 TaskSwitchTimeTrackerTestAPI::TaskSwitchTimeTrackerTestAPI(
14 const std::string& histogram_name) { 14 const std::string& histogram_name) {
15 tick_clock_ = new base::SimpleTestTickClock(); 15 tick_clock_ = new base::SimpleTestTickClock(base::TimeTicks());
16 time_tracker_.reset(new TaskSwitchTimeTracker( 16 time_tracker_.reset(new TaskSwitchTimeTracker(
17 histogram_name, scoped_ptr<base::TickClock>(tick_clock_))); 17 histogram_name, scoped_ptr<base::TickClock>(tick_clock_)));
18 } 18 }
19 19
20 TaskSwitchTimeTrackerTestAPI::~TaskSwitchTimeTrackerTestAPI() { 20 TaskSwitchTimeTrackerTestAPI::~TaskSwitchTimeTrackerTestAPI() {
21 tick_clock_ = nullptr; 21 tick_clock_ = nullptr;
22 } 22 }
23 23
24 void TaskSwitchTimeTrackerTestAPI::Advance(base::TimeDelta time_delta) { 24 void TaskSwitchTimeTrackerTestAPI::Advance(base::TimeDelta time_delta) {
25 tick_clock_->Advance(time_delta); 25 tick_clock_->Advance(time_delta);
26 } 26 }
27 27
28 bool TaskSwitchTimeTrackerTestAPI::HasLastActionTime() const { 28 bool TaskSwitchTimeTrackerTestAPI::HasLastActionTime() const {
29 return time_tracker_->HasLastActionTime(); 29 return time_tracker_->HasLastActionTime();
30 } 30 }
31 31
32 } // namespace test 32 } // namespace test
33 } // namespace ash 33 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_button_pressed_metric_tracker_unittest.cc ('k') | ash/wm/maximize_mode/maximize_mode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698