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

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

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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/shelf/shelf_button_pressed_metric_tracker.h" 5 #include "ash/shelf/shelf_button_pressed_metric_tracker.h"
6 6
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/test/shelf_button_pressed_metric_tracker_test_api.h" 9 #include "ash/test/shelf_button_pressed_metric_tracker_test_api.h"
10 #include "ash/test/shelf_test_api.h" 10 #include "ash/test/shelf_test_api.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 const DummyEvent kDummyEvent; 151 const DummyEvent kDummyEvent;
152 metric_tracker_->ButtonPressed(kDummyEvent, sender, performed_action); 152 metric_tracker_->ButtonPressed(kDummyEvent, sender, performed_action);
153 } 153 }
154 154
155 } // namespace 155 } // namespace
156 156
157 // Verifies that a Launcher_ButtonPressed_Mouse UMA user action is recorded when 157 // Verifies that a Launcher_ButtonPressed_Mouse UMA user action is recorded when
158 // a button is pressed by a mouse event. 158 // a button is pressed by a mouse event.
159 TEST_F(ShelfButtonPressedMetricTrackerTest, 159 TEST_F(ShelfButtonPressedMetricTrackerTest,
160 Launcher_ButtonPressed_MouseIsRecordedWhenIconActivatedByMouse) { 160 Launcher_ButtonPressed_MouseIsRecordedWhenIconActivatedByMouse) {
161 const ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), 161 const ui::MouseEvent mouse_event(
162 gfx::Point(), base::TimeDelta(), 0, 0); 162 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), base::TimeDelta(), 0, 0,
163 ui::PointerEventDetails(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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 291
291 histogram_tester.ExpectTotalCount( 292 histogram_tester.ExpectTotalCount(
292 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 1); 293 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 1);
293 histogram_tester.ExpectBucketCount( 294 histogram_tester.ExpectBucketCount(
294 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 295 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName,
295 kTimeDeltaInMilliseconds, 1); 296 kTimeDeltaInMilliseconds, 1);
296 } 297 }
297 298
298 } // namespace test 299 } // namespace test
299 } // namespace ash 300 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698