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

Side by Side Diff: ash/test/task_switch_time_tracker_test_api.h

Issue 1133123003: Added metrics to track the time between task switches done via the shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ASH_EXPORT to TaskSwitchTimeTracker. Created 5 years, 7 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/metrics/user_metrics_recorder.cc ('k') | ash/test/task_switch_time_tracker_test_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #ifndef ASH_TEST_TASK_SWITCH_TIME_TRACKER_TEST_API_H_
6 #define ASH_TEST_TASK_SWITCH_TIME_TRACKER_TEST_API_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/time/time.h"
12
13 namespace base {
14 class SimpleTestTickClock;
15 } // namespace base
16
17 namespace ash {
18
19 class TaskSwitchTimeTracker;
20
21 namespace test {
22
23 // Provides access TaskSwitchTimeTracker's internals.
24 class TaskSwitchTimeTrackerTestAPI {
25 public:
26 // Creates a TaskSwitchTimeTracker with the given |histogram_name| and injects
27 // a base::SimpleTestTickClock that can be controlled.
28 explicit TaskSwitchTimeTrackerTestAPI(const std::string& histogram_name);
29
30 ~TaskSwitchTimeTrackerTestAPI();
31
32 TaskSwitchTimeTracker* time_tracker() { return time_tracker_.get(); }
33
34 // Advances |time_tracker_|'s TickClock by |time_delta|.
35 void Advance(base::TimeDelta time_delta);
36
37 // Wrapper function to access TaskSwitchTimeTracker::HasLastActionTime();
38 bool HasLastActionTime() const;
39
40 private:
41 // Owned by |time_tracker_|.
42 base::SimpleTestTickClock* tick_clock_;
43
44 // The TaskSwitchTimeTracker to provide internal access to.
45 scoped_ptr<TaskSwitchTimeTracker> time_tracker_;
46
47 DISALLOW_COPY_AND_ASSIGN(TaskSwitchTimeTrackerTestAPI);
48 };
49
50 } // namespace test
51 } // namespace ash
52
53 #endif // ASH_TEST_TASK_SWITCH_TIME_TRACKER_TEST_API_H_
OLDNEW
« no previous file with comments | « ash/metrics/user_metrics_recorder.cc ('k') | ash/test/task_switch_time_tracker_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698