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

Unified Diff: ash/metrics/task_switch_metrics_recorder_unittest.cc

Issue 1126333005: Added metrics to track the time between task switches done via Alt+Tab and Alt+Shift+Tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed "window_list.size() > 0" to "window.empty()". 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/metrics/task_switch_metrics_recorder.cc ('k') | ash/metrics/user_metrics_recorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/metrics/task_switch_metrics_recorder_unittest.cc
diff --git a/ash/metrics/task_switch_metrics_recorder_unittest.cc b/ash/metrics/task_switch_metrics_recorder_unittest.cc
index 155be5b79cd3413135de7152d64bb614cb8dd6b9..ca3078e3394086e02d4b464fd936265ca1f8802e 100644
--- a/ash/metrics/task_switch_metrics_recorder_unittest.cc
+++ b/ash/metrics/task_switch_metrics_recorder_unittest.cc
@@ -62,6 +62,21 @@ void TaskSwitchMetricsRecorderTest::TearDown() {
} // namespace
+// Verifies that the TaskSwitchMetricsRecorder::kWindowCycleController source
+// adds data to the Ash.WindowCycleController.TimeBetweenTaskSwitches histogram.
+TEST_F(TaskSwitchMetricsRecorderTest,
+ VerifyTaskSwitchesForWindowCycleControllerAreRecorded) {
+ const std::string kHistogramName =
+ "Ash.WindowCycleController.TimeBetweenTaskSwitches";
+
+ OnTaskSwitch(TaskSwitchMetricsRecorder::kWindowCycleController);
+ OnTaskSwitch(TaskSwitchMetricsRecorder::kWindowCycleController);
+ histogram_tester_->ExpectTotalCount(kHistogramName, 1);
+
+ OnTaskSwitch(TaskSwitchMetricsRecorder::kWindowCycleController);
+ histogram_tester_->ExpectTotalCount(kHistogramName, 2);
+}
+
// Verifies that the TaskSwitchMetricsRecorder::kShelf source adds data to the
// Ash.Shelf.TimeBetweenNavigateToTaskSwitches histogram.
TEST_F(TaskSwitchMetricsRecorderTest,
« no previous file with comments | « ash/metrics/task_switch_metrics_recorder.cc ('k') | ash/metrics/user_metrics_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698