forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_list_controller_impl_unittest.cc
526 lines (454 loc) · 21 KB
/
app_list_controller_impl_unittest.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
// Copyright 2019 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/app_list/app_list_controller_impl.h"
#include "ash/app_list/app_list_metrics.h"
#include "ash/app_list/views/app_list_main_view.h"
#include "ash/app_list/views/app_list_view.h"
#include "ash/app_list/views/contents_view.h"
#include "ash/app_list/views/expand_arrow_view.h"
#include "ash/app_list/views/search_box_view.h"
#include "ash/home_screen/home_launcher_gesture_handler.h"
#include "ash/home_screen/home_screen_controller.h"
#include "ash/keyboard/ash_keyboard_controller.h"
#include "ash/public/cpp/presentation_time_recorder.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/system/unified/unified_system_tray_test_api.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "ui/events/test/event_generator.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/views/message_popup_view.h"
namespace ash {
namespace {
using ::app_list::kAppListResultLaunchIndexAndQueryLength;
using ::app_list::kAppListTileLaunchIndexAndQueryLength;
using ::app_list::SearchResultLaunchLocation;
bool IsTabletMode() {
return Shell::Get()
->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled();
}
app_list::AppListView* GetAppListView() {
return Shell::Get()->app_list_controller()->presenter()->GetView();
}
bool GetExpandArrowViewVisibility() {
return GetAppListView()
->app_list_main_view()
->contents_view()
->expand_arrow_view()
->GetVisible();
}
app_list::SearchBoxView* GetSearchBoxView() {
return GetAppListView()
->app_list_main_view()
->contents_view()
->GetSearchBoxView();
}
aura::Window* GetVirtualKeyboardWindow() {
return Shell::Get()
->ash_keyboard_controller()
->keyboard_controller()
->GetKeyboardWindow();
}
void ShowAppListNow() {
Shell::Get()->app_list_controller()->presenter()->Show(
display::Screen::GetScreen()->GetPrimaryDisplay().id(),
base::TimeTicks::Now());
}
void DismissAppListNow() {
Shell::Get()->app_list_controller()->presenter()->Dismiss(
base::TimeTicks::Now());
}
aura::Window* GetAppListViewNativeWindow() {
return GetAppListView()->get_fullscreen_widget_for_test()->GetNativeView();
}
void SetSearchText(AppListControllerImpl* controller, const std::string& text) {
controller->GetSearchModel()->search_box()->Update(base::ASCIIToUTF16(text),
false);
}
} // namespace
class AppListControllerImplTest : public AshTestBase {
public:
AppListControllerImplTest() = default;
~AppListControllerImplTest() override = default;
std::unique_ptr<aura::Window> CreateTestWindow() {
return AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400));
}
private:
DISALLOW_COPY_AND_ASSIGN(AppListControllerImplTest);
};
// Hide the expand arrow view in tablet mode when there is no activatable window
// (see https://crbug.com/923089).
TEST_F(AppListControllerImplTest, UpdateExpandArrowViewVisibility) {
// Turn on the tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
EXPECT_TRUE(IsTabletMode());
// No activatable windows. So hide the expand arrow view.
EXPECT_FALSE(GetExpandArrowViewVisibility());
std::unique_ptr<aura::Window> w1(CreateTestWindow());
std::unique_ptr<aura::Window> w2(CreateTestWindow());
// Activate w1 then press home launcher button. Expand arrow view should show
// because w1 still exists.
wm::ActivateWindow(w1.get());
Shell::Get()
->home_screen_controller()
->home_launcher_gesture_handler()
->ShowHomeLauncher(display::Screen::GetScreen()->GetPrimaryDisplay());
EXPECT_EQ(WindowStateType::kMinimized,
wm::GetWindowState(w1.get())->GetStateType());
EXPECT_TRUE(GetExpandArrowViewVisibility());
// Activate w2 then close w1. w2 still exists so expand arrow view shows.
wm::ActivateWindow(w2.get());
w1.reset();
EXPECT_TRUE(GetExpandArrowViewVisibility());
// No activatable windows. Hide the expand arrow view.
w2.reset();
EXPECT_FALSE(GetExpandArrowViewVisibility());
}
// In clamshell mode, when the AppListView's bottom is on the display edge
// and app list state is HALF, the rounded corners should be hidden
// (https://crbug.com/942084).
TEST_F(AppListControllerImplTest, HideRoundingCorners) {
Shell::Get()->ash_keyboard_controller()->SetEnableFlag(
keyboard::mojom::KeyboardEnableFlag::kShelfEnabled);
// Show the app list view and click on the search box with mouse. So the
// VirtualKeyboard is shown.
ShowAppListNow();
GetSearchBoxView()->SetSearchBoxActive(true, ui::ET_MOUSE_PRESSED);
// Wait until the virtual keyboard shows on the screen.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(GetVirtualKeyboardWindow()->IsVisible());
// Test the following things:
// (1) AppListView is at the top of the screen.
// (2) AppListView's state is HALF.
// (3) AppListBackgroundShield is translated to hide the rounded corners.
aura::Window* native_window =
GetAppListView()->get_fullscreen_widget_for_test()->GetNativeView();
gfx::Rect app_list_screen_bounds = native_window->GetBoundsInScreen();
EXPECT_EQ(0, app_list_screen_bounds.y());
EXPECT_EQ(ash::AppListViewState::kHalf, GetAppListView()->app_list_state());
gfx::Transform expected_transform;
expected_transform.Translate(0, -app_list::kAppListBackgroundRadius);
EXPECT_EQ(
expected_transform,
GetAppListView()->GetAppListBackgroundShieldForTest()->GetTransform());
// Set the search box inactive and wait until the virtual keyboard is hidden.
GetSearchBoxView()->SetSearchBoxActive(false, ui::ET_MOUSE_PRESSED);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(nullptr, GetVirtualKeyboardWindow());
// Test that the rounded corners should show again.
expected_transform = gfx::Transform();
EXPECT_EQ(
expected_transform,
GetAppListView()->GetAppListBackgroundShieldForTest()->GetTransform());
}
// Verifies that in clamshell mode the bounds of AppListView are correct when
// the AppListView is in PEEKING state and the virtual keyboard is enabled (see
// https://crbug.com/944233).
TEST_F(AppListControllerImplTest, CheckAppListViewBoundsWhenVKeyboardEnabled) {
Shell::Get()->ash_keyboard_controller()->SetEnableFlag(
keyboard::mojom::KeyboardEnableFlag::kShelfEnabled);
// Show the AppListView and click on the search box with mouse. So the
// VirtualKeyboard is shown. Wait until the virtual keyboard shows.
ShowAppListNow();
GetSearchBoxView()->SetSearchBoxActive(true, ui::ET_MOUSE_PRESSED);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(GetVirtualKeyboardWindow()->IsVisible());
// Hide the AppListView. Wait until the virtual keyboard is hidden as well.
DismissAppListNow();
base::RunLoop().RunUntilIdle();
EXPECT_EQ(nullptr, GetVirtualKeyboardWindow());
// Show the AppListView again. Check the following things:
// (1) Virtual keyboard does not show.
// (2) AppListView is in PEEKING state.
// (3) AppListView's bounds are the same as the preferred bounds for
// the PEEKING state.
ShowAppListNow();
base::RunLoop().RunUntilIdle();
EXPECT_EQ(ash::AppListViewState::kPeeking,
GetAppListView()->app_list_state());
EXPECT_EQ(nullptr, GetVirtualKeyboardWindow());
EXPECT_EQ(GetAppListView()->GetPreferredWidgetBoundsForState(
ash::AppListViewState::kPeeking),
GetAppListViewNativeWindow()->bounds());
}
// Verifies that in tablet mode, the AppListView has correct bounds when the
// virtual keyboard is dismissed (see https://crbug.com/944133).
TEST_F(AppListControllerImplTest, CheckAppListViewBoundsWhenDismissVKeyboard) {
Shell::Get()->ash_keyboard_controller()->SetEnableFlag(
keyboard::mojom::KeyboardEnableFlag::kShelfEnabled);
// Show the AppListView and click on the search box with mouse so the
// VirtualKeyboard is shown. Wait until the virtual keyboard shows.
ShowAppListNow();
GetSearchBoxView()->SetSearchBoxActive(true, ui::ET_MOUSE_PRESSED);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(GetVirtualKeyboardWindow()->IsVisible());
// Turn on the tablet mode. The virtual keyboard should still show.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
EXPECT_TRUE(IsTabletMode());
EXPECT_TRUE(GetVirtualKeyboardWindow()->IsVisible());
// Close the virtual keyboard. Wait until it is hidden.
Shell::Get()->ash_keyboard_controller()->HideKeyboard(
mojom::HideReason::kUser);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(nullptr, GetVirtualKeyboardWindow());
// Check the following things:
// (1) AppListView's state is FULLSCREEN_SEARCH
// (2) AppListView's bounds are the same as the preferred bounds for
// the FULLSCREEN_SEARCH state.
EXPECT_EQ(ash::AppListViewState::kFullscreenSearch,
GetAppListView()->app_list_state());
EXPECT_EQ(GetAppListView()->GetPreferredWidgetBoundsForState(
ash::AppListViewState::kFullscreenSearch),
GetAppListViewNativeWindow()->bounds());
}
// Verifies that closing notification by gesture should not dismiss the AppList.
// (see https://crbug.com/948344)
TEST_F(AppListControllerImplTest, CloseNotificationWithAppListShown) {
ShowAppListNow();
// Add one notification.
ASSERT_EQ(
0u, message_center::MessageCenter::Get()->GetPopupNotifications().size());
const std::string notification_id("id");
const std::string notification_title("title");
message_center::MessageCenter::Get()->AddNotification(
std::make_unique<message_center::Notification>(
message_center::NOTIFICATION_TYPE_BASE_FORMAT, notification_id,
base::UTF8ToUTF16(notification_title),
base::UTF8ToUTF16("test message"), gfx::Image(),
base::string16() /* display_source */, GURL(),
message_center::NotifierId(), message_center::RichNotificationData(),
new message_center::NotificationDelegate()));
base::RunLoop().RunUntilIdle();
ASSERT_EQ(
1u, message_center::MessageCenter::Get()->GetPopupNotifications().size());
// Calculate the drag start point and end point.
UnifiedSystemTrayTestApi test_api(GetPrimaryUnifiedSystemTray());
message_center::MessagePopupView* popup_view =
test_api.GetPopupViewForNotificationID(notification_id);
ASSERT_TRUE(popup_view);
gfx::Rect bounds_in_screen = popup_view->GetBoundsInScreen();
const gfx::Point drag_start = bounds_in_screen.left_center();
const gfx::Point drag_end = bounds_in_screen.right_center();
// Swipe away notification by gesture. Verifies that AppListView still shows.
ui::test::EventGenerator* event_generator = GetEventGenerator();
event_generator->GestureScrollSequence(
drag_start, drag_end, base::TimeDelta::FromMicroseconds(500), 10);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(GetAppListView());
EXPECT_EQ(
0u, message_center::MessageCenter::Get()->GetPopupNotifications().size());
}
class AppListControllerImplMetricsTest : public AshTestBase {
public:
AppListControllerImplMetricsTest() = default;
~AppListControllerImplMetricsTest() override = default;
void SetUp() override {
AshTestBase::SetUp();
controller_ = ash::Shell::Get()->app_list_controller();
ash::PresentationTimeRecorder::SetReportPresentationTimeImmediatelyForTest(
true);
}
void TearDown() override {
ash::PresentationTimeRecorder::SetReportPresentationTimeImmediatelyForTest(
false);
AshTestBase::TearDown();
}
AppListControllerImpl* controller_;
const base::HistogramTester histogram_tester_;
private:
DISALLOW_COPY_AND_ASSIGN(AppListControllerImplMetricsTest);
};
TEST_F(AppListControllerImplMetricsTest, LogSingleResultListClick) {
histogram_tester_.ExpectTotalCount(kAppListResultLaunchIndexAndQueryLength,
0);
SetSearchText(controller_, "");
controller_->LogResultLaunchHistogram(SearchResultLaunchLocation::kResultList,
4);
histogram_tester_.ExpectUniqueSample(kAppListResultLaunchIndexAndQueryLength,
4, 1);
}
TEST_F(AppListControllerImplMetricsTest, LogSingleTileListClick) {
histogram_tester_.ExpectTotalCount(kAppListTileLaunchIndexAndQueryLength, 0);
SetSearchText(controller_, "aaaa");
controller_->LogResultLaunchHistogram(SearchResultLaunchLocation::kTileList,
4);
histogram_tester_.ExpectUniqueSample(kAppListTileLaunchIndexAndQueryLength,
32, 1);
}
TEST_F(AppListControllerImplMetricsTest, LogOneClickInEveryBucket) {
histogram_tester_.ExpectTotalCount(kAppListResultLaunchIndexAndQueryLength,
0);
for (int query_length = 0; query_length < 11; ++query_length) {
const std::string query(query_length, 'a');
for (int click_index = 0; click_index < 7; ++click_index) {
SetSearchText(controller_, query);
controller_->LogResultLaunchHistogram(
SearchResultLaunchLocation::kResultList, click_index);
}
}
histogram_tester_.ExpectTotalCount(kAppListResultLaunchIndexAndQueryLength,
77);
for (int query_length = 0; query_length < 11; ++query_length) {
for (int click_index = 0; click_index < 7; ++click_index) {
histogram_tester_.ExpectBucketCount(
kAppListResultLaunchIndexAndQueryLength,
7 * query_length + click_index, 1);
}
}
}
TEST_F(AppListControllerImplMetricsTest, LogManyClicksInOneBucket) {
histogram_tester_.ExpectTotalCount(kAppListTileLaunchIndexAndQueryLength, 0);
SetSearchText(controller_, "aaaa");
for (int i = 0; i < 50; ++i)
controller_->LogResultLaunchHistogram(SearchResultLaunchLocation::kTileList,
4);
histogram_tester_.ExpectUniqueSample(kAppListTileLaunchIndexAndQueryLength,
32, 50);
}
// Verifies that the PresentationTimeRecorder works correctly for the home
// launcher gesture drag in tablet mode (https://crbug.com/947105).
TEST_F(AppListControllerImplMetricsTest,
PresentationTimeRecordedForDragInTabletMode) {
// Wait until the construction of TabletModeController finishes.
base::RunLoop().RunUntilIdle();
// Turn on the tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
EXPECT_TRUE(IsTabletMode());
// Create a window then press the home launcher button. Expect that |w| is
// hidden.
std::unique_ptr<aura::Window> w(
AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400)));
Shell::Get()
->home_screen_controller()
->home_launcher_gesture_handler()
->ShowHomeLauncher(display::Screen::GetScreen()->GetPrimaryDisplay());
EXPECT_FALSE(w->IsVisible());
EXPECT_EQ(AppListViewState::kFullscreenAllApps,
GetAppListView()->app_list_state());
int delta_y = 1;
gfx::Point start = GetAppListView()
->get_fullscreen_widget_for_test()
->GetWindowBoundsInScreen()
.top_right();
base::TimeTicks timestamp = base::TimeTicks::Now();
// Emulate to drag the launcher downward.
// Send SCROLL_START event. Check the presentation metrics values.
ui::GestureEvent start_event = ui::GestureEvent(
start.x(), start.y(), ui::EF_NONE, timestamp,
ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN, 0, delta_y));
GetAppListView()->OnGestureEvent(&start_event);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.TabletMode", 0);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.MaxLatency.TabletMode", 0);
// Send SCROLL_UPDATE event. Check the presentation metrics values.
timestamp += base::TimeDelta::FromMilliseconds(25);
delta_y += 20;
start.Offset(0, 1);
ui::GestureEvent update_event = ui::GestureEvent(
start.x(), start.y(), ui::EF_NONE, timestamp,
ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_UPDATE, 0, delta_y));
GetAppListView()->OnGestureEvent(&update_event);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.TabletMode", 1);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.MaxLatency.TabletMode", 0);
// Send SCROLL_END event. Check the presentation metrics values.
timestamp += base::TimeDelta::FromMilliseconds(25);
start.Offset(0, 1);
ui::GestureEvent end_event =
ui::GestureEvent(start.x(), start.y() + delta_y, ui::EF_NONE, timestamp,
ui::GestureEventDetails(ui::ET_GESTURE_END));
GetAppListView()->OnGestureEvent(&end_event);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.TabletMode", 1);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.MaxLatency.TabletMode", 1);
// After the gesture scroll event ends, the window shows.
EXPECT_TRUE(w->IsVisible());
ASSERT_TRUE(IsTabletMode());
}
// One edge case may do harm to the presentation metrics reporter for tablet
// mode: the user may keep pressing on launcher while exiting the tablet mode by
// rotating the lid. In this situation, OnHomeLauncherDragEnd is not triggered.
// It is handled correctly now because the AppListView is always closed after
// exiting the tablet mode. But it still has potential risk to break in future.
// Write this test case for precaution (https://crbug.com/947105).
TEST_F(AppListControllerImplMetricsTest,
PresentationMetricsForTabletNotRecordedInClamshell) {
// Wait until the construction of TabletModeController finishes.
base::RunLoop().RunUntilIdle();
// Turn on the tablet mode.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
EXPECT_TRUE(IsTabletMode());
// Create a window then press the home launcher button. Expect that |w| is
// hidden.
std::unique_ptr<aura::Window> w(
AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400)));
Shell::Get()
->home_screen_controller()
->home_launcher_gesture_handler()
->ShowHomeLauncher(display::Screen::GetScreen()->GetPrimaryDisplay());
EXPECT_FALSE(w->IsVisible());
EXPECT_EQ(AppListViewState::kFullscreenAllApps,
GetAppListView()->app_list_state());
gfx::Point start = GetAppListView()
->get_fullscreen_widget_for_test()
->GetWindowBoundsInScreen()
.top_right();
base::TimeTicks timestamp = base::TimeTicks::Now();
// Emulate to drag the launcher downward.
// Send SCROLL_START event. Check the presentation metrics values.
ui::GestureEvent start_event = ui::GestureEvent(
start.x(), start.y(), ui::EF_NONE, timestamp,
ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN, 0, 1));
GetAppListView()->OnGestureEvent(&start_event);
// Turn off the tablet mode before scrolling is finished.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
EXPECT_FALSE(IsTabletMode());
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(GetAppListView());
// Check metrics initial values.
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.TabletMode", 0);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.MaxLatency.TabletMode", 0);
// Emulate to drag launcher from shelf. Then verifies the following things:
// (1) Metrics values for tablet mode are not recorded.
// (2) Metrics values for clamshell mode are recorded correctly.
gfx::Rect shelf_bounds =
GetPrimaryShelf()->shelf_widget()->GetWindowBoundsInScreen();
shelf_bounds.Intersect(
display::Screen::GetScreen()->GetPrimaryDisplay().bounds());
gfx::Point shelf_center = shelf_bounds.CenterPoint();
gfx::Point target_point =
display::Screen::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint();
ui::test::EventGenerator* generator = GetEventGenerator();
generator->GestureScrollSequence(shelf_center, target_point,
base::TimeDelta::FromMicroseconds(500), 1);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(AppListViewState::kFullscreenAllApps,
GetAppListView()->app_list_state());
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.TabletMode", 0);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.MaxLatency.TabletMode", 0);
// AppListView::UpdateYPositionAndOpacity is triggered by
// ShelfLayoutManager::StartGestureDrag and
// ShelfLayoutManager::UpdateGestureDrag. Note that scrolling step of event
// generator is 1. So the expected value is 2.
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.ClamshellMode", 2);
histogram_tester_.ExpectTotalCount(
"Apps.StateTransition.Drag.PresentationTime.MaxLatency.ClamshellMode", 1);
}
} // namespace ash