1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/system/web_notification/web_notification_tray.h"
9 #include "ash/display/display_manager.h"
10 #include "ash/root_window_controller.h"
11 #include "ash/shelf/shelf_layout_manager.h"
12 #include "ash/shelf/shelf_widget.h"
13 #include "ash/shell.h"
14 #include "ash/system/status_area_widget.h"
15 #include "ash/system/tray/system_tray.h"
16 #include "ash/system/tray/system_tray_item.h"
17 #include "ash/system/web_notification/ash_popup_alignment_delegate.h"
18 #include "ash/test/ash_test_base.h"
19 #include "ash/test/status_area_widget_test_helper.h"
20 #include "ash/test/test_system_tray_delegate.h"
21 #include "ash/wm/window_state.h"
22 #include "base/strings/stringprintf.h"
23 #include "base/strings/utf_string_conversions.h"
24 #include "ui/aura/client/aura_constants.h"
25 #include "ui/aura/window.h"
26 #include "ui/events/event.h"
27 #include "ui/events/test/event_generator.h"
28 #include "ui/gfx/display.h"
29 #include "ui/gfx/geometry/point.h"
30 #include "ui/gfx/geometry/rect.h"
31 #include "ui/gfx/screen.h"
32 #include "ui/message_center/message_center_style.h"
33 #include "ui/message_center/message_center_tray.h"
34 #include "ui/message_center/notification_list.h"
35 #include "ui/message_center/notification_types.h"
36 #include "ui/message_center/views/message_center_bubble.h"
37 #include "ui/message_center/views/message_popup_collection.h"
38 #include "ui/views/controls/label.h"
39 #include "ui/views/layout/fill_layout.h"
40 #include "ui/views/view.h"
41 #include "ui/views/widget/widget.h"
47 WebNotificationTray
* GetTray() {
48 return StatusAreaWidgetTestHelper::GetStatusAreaWidget()->
49 web_notification_tray();
52 WebNotificationTray
* GetSecondaryTray() {
53 StatusAreaWidget
* status_area_widget
=
54 StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget();
55 if (status_area_widget
)
56 return status_area_widget
->web_notification_tray();
60 message_center::MessageCenter
* GetMessageCenter() {
61 return GetTray()->message_center();
64 SystemTray
* GetSystemTray() {
65 return StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray();
68 // Trivial item implementation for testing PopupAndSystemTray test case.
69 class TestItem
: public SystemTrayItem
{
71 TestItem() : SystemTrayItem(GetSystemTray()) {}
73 views::View
* CreateDefaultView(user::LoginStatus status
) override
{
74 views::View
* default_view
= new views::View
;
75 default_view
->SetLayoutManager(new views::FillLayout
);
76 default_view
->AddChildView(new views::Label(base::UTF8ToUTF16("Default")));
80 views::View
* CreateNotificationView(user::LoginStatus status
) override
{
81 return new views::View
;
85 DISALLOW_COPY_AND_ASSIGN(TestItem
);
90 class WebNotificationTrayTest
: public test::AshTestBase
{
92 WebNotificationTrayTest() {}
93 ~WebNotificationTrayTest() override
{}
95 void TearDown() override
{
96 GetMessageCenter()->RemoveAllNotifications(false);
97 test::AshTestBase::TearDown();
101 void AddNotification(const std::string
& id
) {
102 scoped_ptr
<message_center::Notification
> notification
;
103 notification
.reset(new message_center::Notification(
104 message_center::NOTIFICATION_TYPE_SIMPLE
, id
,
105 base::ASCIIToUTF16("Test Web Notification"),
106 base::ASCIIToUTF16("Notification message body."), gfx::Image(),
107 base::ASCIIToUTF16("www.test.org"), GURL(),
108 message_center::NotifierId(), message_center::RichNotificationData(),
109 NULL
/* delegate */));
110 GetMessageCenter()->AddNotification(notification
.Pass());
113 void UpdateNotification(const std::string
& old_id
,
114 const std::string
& new_id
) {
115 scoped_ptr
<message_center::Notification
> notification
;
116 notification
.reset(new message_center::Notification(
117 message_center::NOTIFICATION_TYPE_SIMPLE
, new_id
,
118 base::ASCIIToUTF16("Updated Web Notification"),
119 base::ASCIIToUTF16("Updated message body."), gfx::Image(),
120 base::ASCIIToUTF16("www.test.org"), GURL(),
121 message_center::NotifierId(), message_center::RichNotificationData(),
122 NULL
/* delegate */));
123 GetMessageCenter()->UpdateNotification(old_id
, notification
.Pass());
126 void RemoveNotification(const std::string
& id
) {
127 GetMessageCenter()->RemoveNotification(id
, false);
130 views::Widget
* GetWidget() {
131 return GetTray()->GetWidget();
134 int GetPopupWorkAreaBottom() {
135 return GetPopupWorkAreaBottomForTray(GetTray());
138 int GetPopupWorkAreaBottomForTray(WebNotificationTray
* tray
) {
139 return tray
->popup_alignment_delegate_
->GetWorkAreaBottom();
142 bool IsPopupVisible() {
143 return GetTray()->IsPopupVisible();
147 DISALLOW_COPY_AND_ASSIGN(WebNotificationTrayTest
);
150 TEST_F(WebNotificationTrayTest
, WebNotifications
) {
151 // TODO(mukai): move this test case to ui/message_center.
152 ASSERT_TRUE(GetWidget());
154 // Add a notification.
155 AddNotification("test_id1");
156 EXPECT_EQ(1u, GetMessageCenter()->NotificationCount());
157 EXPECT_TRUE(GetMessageCenter()->FindVisibleNotificationById("test_id1"));
158 AddNotification("test_id2");
159 AddNotification("test_id2");
160 EXPECT_EQ(2u, GetMessageCenter()->NotificationCount());
161 EXPECT_TRUE(GetMessageCenter()->FindVisibleNotificationById("test_id2"));
163 // Ensure that updating a notification does not affect the count.
164 UpdateNotification("test_id2", "test_id3");
165 UpdateNotification("test_id3", "test_id3");
166 EXPECT_EQ(2u, GetMessageCenter()->NotificationCount());
167 EXPECT_FALSE(GetMessageCenter()->FindVisibleNotificationById("test_id2"));
169 // Ensure that Removing the first notification removes it from the tray.
170 RemoveNotification("test_id1");
171 EXPECT_FALSE(GetMessageCenter()->FindVisibleNotificationById("test_id1"));
172 EXPECT_EQ(1u, GetMessageCenter()->NotificationCount());
174 // Remove the remianing notification.
175 RemoveNotification("test_id3");
176 EXPECT_EQ(0u, GetMessageCenter()->NotificationCount());
177 EXPECT_FALSE(GetMessageCenter()->FindVisibleNotificationById("test_id3"));
180 TEST_F(WebNotificationTrayTest
, WebNotificationPopupBubble
) {
181 // TODO(mukai): move this test case to ui/message_center.
182 ASSERT_TRUE(GetWidget());
184 // Adding a notification should show the popup bubble.
185 AddNotification("test_id1");
186 EXPECT_TRUE(GetTray()->IsPopupVisible());
188 // Updating a notification should not hide the popup bubble.
189 AddNotification("test_id2");
190 UpdateNotification("test_id2", "test_id3");
191 EXPECT_TRUE(GetTray()->IsPopupVisible());
193 // Removing the first notification should not hide the popup bubble.
194 RemoveNotification("test_id1");
195 EXPECT_TRUE(GetTray()->IsPopupVisible());
197 // Removing the visible notification should hide the popup bubble.
198 RemoveNotification("test_id3");
199 EXPECT_FALSE(GetTray()->IsPopupVisible());
201 // Now test that we can show multiple popups and then show the message center.
202 AddNotification("test_id4");
203 AddNotification("test_id5");
204 EXPECT_TRUE(GetTray()->IsPopupVisible());
206 GetTray()->message_center_tray_
->ShowMessageCenterBubble();
207 GetTray()->message_center_tray_
->HideMessageCenterBubble();
209 EXPECT_FALSE(GetTray()->IsPopupVisible());
212 using message_center::NotificationList
;
215 // Flakily fails. http://crbug.com/229791
216 TEST_F(WebNotificationTrayTest
, DISABLED_ManyMessageCenterNotifications
) {
217 // Add the max visible notifications +1, ensure the correct visible number.
218 size_t notifications_to_add
=
219 message_center::kMaxVisibleMessageCenterNotifications
+ 1;
220 for (size_t i
= 0; i
< notifications_to_add
; ++i
) {
221 std::string id
= base::StringPrintf("test_id%d", static_cast<int>(i
));
224 bool shown
= GetTray()->message_center_tray_
->ShowMessageCenterBubble();
226 RunAllPendingInMessageLoop();
227 EXPECT_TRUE(GetTray()->message_center_bubble() != NULL
);
228 EXPECT_EQ(notifications_to_add
,
229 GetMessageCenter()->NotificationCount());
230 EXPECT_EQ(message_center::kMaxVisibleMessageCenterNotifications
,
231 GetTray()->GetMessageCenterBubbleForTest()->
232 NumMessageViewsForTest());
235 // Flakily times out. http://crbug.com/229792
236 TEST_F(WebNotificationTrayTest
, DISABLED_ManyPopupNotifications
) {
237 // Add the max visible popup notifications +1, ensure the correct num visible.
238 size_t notifications_to_add
=
239 message_center::kMaxVisiblePopupNotifications
+ 1;
240 for (size_t i
= 0; i
< notifications_to_add
; ++i
) {
241 std::string id
= base::StringPrintf("test_id%d", static_cast<int>(i
));
244 GetTray()->ShowPopups();
245 EXPECT_TRUE(GetTray()->IsPopupVisible());
246 EXPECT_EQ(notifications_to_add
,
247 GetMessageCenter()->NotificationCount());
248 NotificationList::PopupNotifications popups
=
249 GetMessageCenter()->GetPopupNotifications();
250 EXPECT_EQ(message_center::kMaxVisiblePopupNotifications
, popups
.size());
253 #if defined(OS_CHROMEOS)
254 // Display notification is ChromeOS only.
255 #define MAYBE_PopupShownOnBothDisplays PopupShownOnBothDisplays
256 #define MAYBE_PopupAndSystemTrayMultiDisplay PopupAndSystemTrayMultiDisplay
258 #define MAYBE_PopupShownOnBothDisplays DISABLED_PopupShownOnBothDisplays
259 #define MAYBE_PopupAndSystemTrayMultiDisplay \
260 DISABLED_PopupAndSystemTrayMultiDisplay
263 // Verifies if the notification appears on both displays when extended mode.
264 TEST_F(WebNotificationTrayTest
, MAYBE_PopupShownOnBothDisplays
) {
265 if (!SupportsMultipleDisplays())
268 // Enables to appear the notification for display changes.
269 test::TestSystemTrayDelegate
* tray_delegate
=
270 static_cast<test::TestSystemTrayDelegate
*>(
271 Shell::GetInstance()->system_tray_delegate());
272 tray_delegate
->set_should_show_display_notification(true);
274 UpdateDisplay("400x400,200x200");
275 // UpdateDisplay() creates the display notifications, so popup is visible.
276 EXPECT_TRUE(GetTray()->IsPopupVisible());
277 WebNotificationTray
* secondary_tray
= GetSecondaryTray();
278 ASSERT_TRUE(secondary_tray
);
279 EXPECT_TRUE(secondary_tray
->IsPopupVisible());
281 // Transition to mirroring and then back to extended display, which recreates
282 // root window controller and shelf with having notifications. This code
283 // verifies it doesn't cause crash and popups are still visible. See
284 // http://crbug.com/263664
285 DisplayManager
* display_manager
= Shell::GetInstance()->display_manager();
287 display_manager
->SetMultiDisplayMode(DisplayManager::MIRRORING
);
288 UpdateDisplay("400x400,200x200");
289 EXPECT_TRUE(GetTray()->IsPopupVisible());
290 EXPECT_FALSE(GetSecondaryTray());
292 display_manager
->SetMultiDisplayMode(DisplayManager::EXTENDED
);
293 UpdateDisplay("400x400,200x200");
294 EXPECT_TRUE(GetTray()->IsPopupVisible());
295 secondary_tray
= GetSecondaryTray();
296 ASSERT_TRUE(secondary_tray
);
297 EXPECT_TRUE(secondary_tray
->IsPopupVisible());
300 #if defined(OS_CHROMEOS)
301 // PopupAndSystemTray may fail in platforms other than ChromeOS because the
302 // RootWindow's bound can be bigger than gfx::Display's work area so that
303 // openingsystem tray doesn't affect at all the work area of popups.
304 #define MAYBE_PopupAndSystemTray PopupAndSystemTray
305 #define MAYBE_PopupAndAutoHideShelf PopupAndAutoHideShelf
306 #define MAYBE_PopupAndFullscreen PopupAndFullscreen
308 #define MAYBE_PopupAndSystemTray DISABLED_PopupAndSystemTray
309 #define MAYBE_PopupAndAutoHideShelf DISABLED_PopupAndAutoHideShelf
310 #define MAYBE_PopupAndFullscreen DISABLED_PopupAndFullscreen
313 TEST_F(WebNotificationTrayTest
, MAYBE_PopupAndSystemTray
) {
314 TestItem
* test_item
= new TestItem
;
315 GetSystemTray()->AddTrayItem(test_item
);
317 AddNotification("test_id");
318 EXPECT_TRUE(GetTray()->IsPopupVisible());
319 int bottom
= GetPopupWorkAreaBottom();
321 // System tray is created, the popup's work area should be narrowed but still
323 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW
);
324 EXPECT_TRUE(GetTray()->IsPopupVisible());
325 int bottom_with_tray
= GetPopupWorkAreaBottom();
326 EXPECT_GT(bottom
, bottom_with_tray
);
328 // System tray notification is also created, the popup's work area is narrowed
329 // even more, but still visible.
330 GetSystemTray()->ShowNotificationView(test_item
);
331 EXPECT_TRUE(GetTray()->IsPopupVisible());
332 int bottom_with_tray_notification
= GetPopupWorkAreaBottom();
333 EXPECT_GT(bottom
, bottom_with_tray_notification
);
334 EXPECT_GT(bottom_with_tray
, bottom_with_tray_notification
);
336 // Close system tray, only system tray notifications.
337 GetSystemTray()->ClickedOutsideBubble();
338 EXPECT_TRUE(GetTray()->IsPopupVisible());
339 int bottom_with_notification
= GetPopupWorkAreaBottom();
340 EXPECT_GT(bottom
, bottom_with_notification
);
341 EXPECT_LT(bottom_with_tray_notification
, bottom_with_notification
);
343 // Close the system tray notifications.
344 GetSystemTray()->HideNotificationView(test_item
);
345 EXPECT_TRUE(GetTray()->IsPopupVisible());
346 EXPECT_EQ(bottom
, GetPopupWorkAreaBottom());
349 TEST_F(WebNotificationTrayTest
, MAYBE_PopupAndAutoHideShelf
) {
350 AddNotification("test_id");
351 EXPECT_TRUE(GetTray()->IsPopupVisible());
352 int bottom
= GetPopupWorkAreaBottom();
354 // Shelf's auto-hide state won't be HIDDEN unless window exists.
355 scoped_ptr
<aura::Window
> window(
356 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4)));
357 ShelfLayoutManager
* shelf
=
358 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
359 shelf
->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
);
361 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN
, shelf
->auto_hide_state());
362 int bottom_auto_hidden
= GetPopupWorkAreaBottom();
363 EXPECT_LT(bottom
, bottom_auto_hidden
);
365 // Close the window, which shows the shelf.
367 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN
, shelf
->auto_hide_state());
368 int bottom_auto_shown
= GetPopupWorkAreaBottom();
369 EXPECT_EQ(bottom
, bottom_auto_shown
);
371 // Create the system tray during auto-hide.
372 window
.reset(CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4)));
373 TestItem
* test_item
= new TestItem
;
374 GetSystemTray()->AddTrayItem(test_item
);
375 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW
);
377 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN
, shelf
->auto_hide_state());
378 EXPECT_TRUE(GetTray()->IsPopupVisible());
379 int bottom_with_tray
= GetPopupWorkAreaBottom();
380 EXPECT_GT(bottom_auto_shown
, bottom_with_tray
);
382 // Create tray notification.
383 GetSystemTray()->ShowNotificationView(test_item
);
384 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN
, shelf
->auto_hide_state());
385 int bottom_with_tray_notification
= GetPopupWorkAreaBottom();
386 EXPECT_GT(bottom_with_tray
, bottom_with_tray_notification
);
388 // Close the system tray.
389 GetSystemTray()->ClickedOutsideBubble();
390 shelf
->UpdateAutoHideState();
391 RunAllPendingInMessageLoop();
392 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN
, shelf
->auto_hide_state());
393 int bottom_hidden_with_tray_notification
= GetPopupWorkAreaBottom();
394 EXPECT_LT(bottom_with_tray_notification
,
395 bottom_hidden_with_tray_notification
);
396 EXPECT_GT(bottom_auto_hidden
, bottom_hidden_with_tray_notification
);
398 // Close the window again, which shows the shelf.
400 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN
, shelf
->auto_hide_state());
401 int bottom_shown_with_tray_notification
= GetPopupWorkAreaBottom();
402 EXPECT_GT(bottom_hidden_with_tray_notification
,
403 bottom_shown_with_tray_notification
);
404 EXPECT_GT(bottom_auto_shown
, bottom_shown_with_tray_notification
);
407 TEST_F(WebNotificationTrayTest
, MAYBE_PopupAndFullscreen
) {
408 AddNotification("test_id");
409 EXPECT_TRUE(IsPopupVisible());
410 int bottom
= GetPopupWorkAreaBottom();
412 // Checks the work area for normal auto-hidden state.
413 scoped_ptr
<aura::Window
> window(
414 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4)));
415 ShelfLayoutManager
* shelf
=
416 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
417 shelf
->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
);
418 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN
, shelf
->auto_hide_state());
419 int bottom_auto_hidden
= GetPopupWorkAreaBottom();
420 shelf
->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER
);
422 // Put |window| into fullscreen without forcing the shelf to hide. Currently,
423 // this is used by immersive fullscreen and forces the shelf to be auto
425 wm::GetWindowState(window
.get())->set_hide_shelf_when_fullscreen(false);
426 window
->SetProperty(aura::client::kShowStateKey
, ui::SHOW_STATE_FULLSCREEN
);
427 RunAllPendingInMessageLoop();
429 // The work area for auto-hidden status of fullscreen is a bit larger
430 // since it doesn't even have the 3-pixel width.
431 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN
, shelf
->auto_hide_state());
432 int bottom_fullscreen_hidden
= GetPopupWorkAreaBottom();
433 EXPECT_EQ(bottom_auto_hidden
, bottom_fullscreen_hidden
);
435 // Move the mouse cursor at the bottom, which shows the shelf.
436 ui::test::EventGenerator
generator(Shell::GetPrimaryRootWindow());
437 gfx::Point bottom_right
=
438 Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom_right();
439 bottom_right
.Offset(-1, -1);
440 generator
.MoveMouseTo(bottom_right
);
441 shelf
->UpdateAutoHideStateNow();
442 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN
, shelf
->auto_hide_state());
443 EXPECT_EQ(bottom
, GetPopupWorkAreaBottom());
445 generator
.MoveMouseTo(
446 Shell::GetScreen()->GetPrimaryDisplay().bounds().CenterPoint());
447 shelf
->UpdateAutoHideStateNow();
448 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN
, shelf
->auto_hide_state());
449 EXPECT_EQ(bottom_auto_hidden
, GetPopupWorkAreaBottom());
452 TEST_F(WebNotificationTrayTest
, MAYBE_PopupAndSystemTrayMultiDisplay
) {
453 UpdateDisplay("800x600,600x400");
455 AddNotification("test_id");
456 int bottom
= GetPopupWorkAreaBottom();
457 int bottom_second
= GetPopupWorkAreaBottomForTray(GetSecondaryTray());
459 // System tray is created on the primary display. The popups in the secondary
460 // tray aren't affected.
461 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW
);
462 EXPECT_GT(bottom
, GetPopupWorkAreaBottom());
463 EXPECT_EQ(bottom_second
, GetPopupWorkAreaBottomForTray(GetSecondaryTray()));
466 // TODO(jonross): Replace manually creating TouchEvent with
467 // EventGenerator.PressTouch/ReleaseTouch. Currently they set a width on the
468 // touch event causing the gesture recognizer to target a different view.
469 #if defined(OS_CHROMEOS)
470 // Tests that there is visual feedback for touch presses.
471 TEST_F(WebNotificationTrayTest
, TouchFeedback
) {
472 AddNotification("test_id");
473 RunAllPendingInMessageLoop();
474 WebNotificationTray
* tray
= GetTray();
475 EXPECT_TRUE(tray
->visible());
477 ui::test::EventGenerator
generator(Shell::GetPrimaryRootWindow());
478 const int touch_id
= 0;
479 gfx::Point center_point
= tray
->GetBoundsInScreen().CenterPoint();
481 ui::TouchEvent
press(ui::ET_TOUCH_PRESSED
, center_point
, touch_id
,
483 generator
.Dispatch(&press
);
484 EXPECT_TRUE(tray
->draw_background_as_active());
486 ui::TouchEvent
release(ui::ET_TOUCH_RELEASED
, center_point
, touch_id
,
487 press
.time_stamp() + base::TimeDelta::FromMilliseconds(50));
488 generator
.Dispatch(&release
);
489 EXPECT_TRUE(tray
->draw_background_as_active());
490 EXPECT_TRUE(tray
->IsMessageCenterBubbleVisible());
492 generator
.GestureTapAt(center_point
);
493 EXPECT_FALSE(tray
->draw_background_as_active());
494 EXPECT_FALSE(tray
->IsMessageCenterBubbleVisible());
497 // Tests that while touch presses trigger visual feedback, that subsequent non
498 // tap gestures cancel the feedback without triggering the message center.
499 TEST_F(WebNotificationTrayTest
, TouchFeedbackCancellation
) {
500 AddNotification("test_id");
501 RunAllPendingInMessageLoop();
502 WebNotificationTray
* tray
= GetTray();
503 EXPECT_TRUE(tray
->visible());
505 ui::test::EventGenerator
generator(Shell::GetPrimaryRootWindow());
506 const int touch_id
= 0;
507 gfx::Rect bounds
= tray
->GetBoundsInScreen();
508 gfx::Point center_point
= bounds
.CenterPoint();
510 ui::TouchEvent
press(ui::ET_TOUCH_PRESSED
, center_point
, touch_id
,
512 generator
.Dispatch(&press
);
513 EXPECT_TRUE(tray
->draw_background_as_active());
515 gfx::Point
out_of_bounds(bounds
.x() - 1, center_point
.y());
516 ui::TouchEvent
move(ui::ET_TOUCH_MOVED
, out_of_bounds
, touch_id
,
517 press
.time_stamp()+base::TimeDelta::FromMilliseconds(50));
518 generator
.Dispatch(&move
);
519 EXPECT_FALSE(tray
->draw_background_as_active());
521 ui::TouchEvent
release(ui::ET_TOUCH_RELEASED
, out_of_bounds
, touch_id
,
522 move
.time_stamp()+base::TimeDelta::FromMilliseconds(50));
523 generator
.Dispatch(&release
);
524 EXPECT_FALSE(tray
->draw_background_as_active());
525 EXPECT_FALSE(tray
->IsMessageCenterBubbleVisible());
528 #endif // OS_CHROMEOS