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

Unified Diff: ash/test/task_switch_time_tracker_test_api.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/task_switch_time_tracker_test_api.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/task_switch_time_tracker_test_api.cc
diff --git a/ash/test/task_switch_time_tracker_test_api.cc b/ash/test/task_switch_time_tracker_test_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..797207e134574a88bdfb36c8daf9b4fda62c4814
--- /dev/null
+++ b/ash/test/task_switch_time_tracker_test_api.cc
@@ -0,0 +1,33 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/test/task_switch_time_tracker_test_api.h"
+
+#include "ash/metrics/task_switch_time_tracker.h"
+#include "base/test/simple_test_tick_clock.h"
+
+namespace ash {
+namespace test {
+
+TaskSwitchTimeTrackerTestAPI::TaskSwitchTimeTrackerTestAPI(
+ const std::string& histogram_name) {
+ tick_clock_ = new base::SimpleTestTickClock();
+ time_tracker_.reset(new TaskSwitchTimeTracker(
+ histogram_name, scoped_ptr<base::TickClock>(tick_clock_)));
+}
+
+TaskSwitchTimeTrackerTestAPI::~TaskSwitchTimeTrackerTestAPI() {
+ tick_clock_ = nullptr;
+}
+
+void TaskSwitchTimeTrackerTestAPI::Advance(base::TimeDelta time_delta) {
+ tick_clock_->Advance(time_delta);
+}
+
+bool TaskSwitchTimeTrackerTestAPI::HasLastActionTime() const {
+ return time_tracker_->HasLastActionTime();
+}
+
+} // namespace test
+} // namespace ash
« no previous file with comments | « ash/test/task_switch_time_tracker_test_api.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698