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

Side by Side Diff: ash/common/shelf/shelf_button_pressed_metric_tracker_unittest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 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/common/shelf/shelf_button_pressed_metric_tracker.h" 5 #include "ash/common/shelf/shelf_button_pressed_metric_tracker.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } // namespace 151 } // namespace
152 152
153 // Verifies that a Launcher_ButtonPressed_Mouse UMA user action is recorded when 153 // Verifies that a Launcher_ButtonPressed_Mouse UMA user action is recorded when
154 // a button is pressed by a mouse event. 154 // a button is pressed by a mouse event.
155 TEST_F(ShelfButtonPressedMetricTrackerTest, 155 TEST_F(ShelfButtonPressedMetricTrackerTest,
156 Launcher_ButtonPressed_MouseIsRecordedWhenIconActivatedByMouse) { 156 Launcher_ButtonPressed_MouseIsRecordedWhenIconActivatedByMouse) {
157 // TODO: investigate failure in mash. http://crbug.com/695565. 157 // TODO: investigate failure in mash. http://crbug.com/695565.
158 if (WmShell::Get()->IsRunningInMash()) 158 if (WmShell::Get()->IsRunningInMash())
159 return; 159 return;
160 160
161 const ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), 161 const ui::MouseEvent mouse_event(
162 gfx::Point(), base::TimeTicks(), 0, 0); 162 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), base::TimeTicks(), 0, 0,
163 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
163 164
164 base::UserActionTester user_action_tester; 165 base::UserActionTester user_action_tester;
165 ButtonPressed(mouse_event); 166 ButtonPressed(mouse_event);
166 EXPECT_EQ(1, 167 EXPECT_EQ(1,
167 user_action_tester.GetActionCount("Launcher_ButtonPressed_Mouse")); 168 user_action_tester.GetActionCount("Launcher_ButtonPressed_Mouse"));
168 } 169 }
169 170
170 // Verifies that a Launcher_ButtonPressed_Touch UMA user action is recorded when 171 // Verifies that a Launcher_ButtonPressed_Touch UMA user action is recorded when
171 // a button is pressed by a touch event. 172 // a button is pressed by a touch event.
172 TEST_F(ShelfButtonPressedMetricTrackerTest, 173 TEST_F(ShelfButtonPressedMetricTrackerTest,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 307
307 histogram_tester.ExpectTotalCount( 308 histogram_tester.ExpectTotalCount(
308 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 1); 309 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 1);
309 histogram_tester.ExpectBucketCount( 310 histogram_tester.ExpectBucketCount(
310 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 311 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName,
311 kTimeDeltaInMilliseconds, 1); 312 kTimeDeltaInMilliseconds, 1);
312 } 313 }
313 314
314 } // namespace test 315 } // namespace test
315 } // namespace ash 316 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698