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

Side by Side Diff: ash/metrics/task_switch_metrics_recorder_unittest.cc

Issue 1132293004: Record time between switching the active window from Ash overview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/task_switch_metrics_recorder.cc ('k') | ash/metrics/user_metrics_recorder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/metrics/task_switch_metrics_recorder.h" 5 #include "ash/metrics/task_switch_metrics_recorder.h"
6 6
7 #include "base/test/histogram_tester.h" 7 #include "base/test/histogram_tester.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace ash { 10 namespace ash {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 "Ash.Tab.TimeBetweenSwitchToExistingTabUserActions"; 100 "Ash.Tab.TimeBetweenSwitchToExistingTabUserActions";
101 101
102 OnTaskSwitch(TaskSwitchMetricsRecorder::kTabStrip); 102 OnTaskSwitch(TaskSwitchMetricsRecorder::kTabStrip);
103 OnTaskSwitch(TaskSwitchMetricsRecorder::kTabStrip); 103 OnTaskSwitch(TaskSwitchMetricsRecorder::kTabStrip);
104 histogram_tester_->ExpectTotalCount(kHistogramName, 1); 104 histogram_tester_->ExpectTotalCount(kHistogramName, 1);
105 105
106 OnTaskSwitch(TaskSwitchMetricsRecorder::kTabStrip); 106 OnTaskSwitch(TaskSwitchMetricsRecorder::kTabStrip);
107 histogram_tester_->ExpectTotalCount(kHistogramName, 2); 107 histogram_tester_->ExpectTotalCount(kHistogramName, 2);
108 } 108 }
109 109
110 // Verifies that the TaskSwitchMetricsRecorder::kOverviewMode source adds data
111 // to the Ash.WindowSelector.TimeBetweenActiveWindowChanges histogram.
112 TEST_F(TaskSwitchMetricsRecorderTest,
113 VerifyTaskSwitchesFromOverviewModeAreRecorded) {
114 const std::string kHistogramName =
115 "Ash.WindowSelector.TimeBetweenActiveWindowChanges";
116
117 OnTaskSwitch(TaskSwitchMetricsRecorder::kOverviewMode);
118 OnTaskSwitch(TaskSwitchMetricsRecorder::kOverviewMode);
119 histogram_tester_->ExpectTotalCount(kHistogramName, 1);
120
121 OnTaskSwitch(TaskSwitchMetricsRecorder::kOverviewMode);
122 histogram_tester_->ExpectTotalCount(kHistogramName, 2);
123 }
124
110 } // namespace ash 125 } // namespace ash
OLDNEW
« no previous file with comments | « ash/metrics/task_switch_metrics_recorder.cc ('k') | ash/metrics/user_metrics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698