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

Side by Side Diff: ui/message_center/views/message_popup_collection_unittest.cc

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows side Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/message_center/views/message_popup_collection.h" 5 #include "ui/message_center/views/message_popup_collection.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 TEST_F(MessagePopupCollectionTest, DetectMouseHover) { 351 TEST_F(MessagePopupCollectionTest, DetectMouseHover) {
352 std::string id0 = AddNotification(); 352 std::string id0 = AddNotification();
353 std::string id1 = AddNotification(); 353 std::string id1 = AddNotification();
354 WaitForTransitionsDone(); 354 WaitForTransitionsDone();
355 355
356 views::WidgetDelegateView* toast0 = GetToast(id0); 356 views::WidgetDelegateView* toast0 = GetToast(id0);
357 EXPECT_TRUE(toast0 != NULL); 357 EXPECT_TRUE(toast0 != NULL);
358 views::WidgetDelegateView* toast1 = GetToast(id1); 358 views::WidgetDelegateView* toast1 = GetToast(id1);
359 EXPECT_TRUE(toast1 != NULL); 359 EXPECT_TRUE(toast1 != NULL);
360 360
361 ui::MouseEvent event(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), 0); 361 ui::MouseEvent event(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), 0, 0);
362 362
363 // Test that mouse detection logic works in presence of out-of-order events. 363 // Test that mouse detection logic works in presence of out-of-order events.
364 toast0->OnMouseEntered(event); 364 toast0->OnMouseEntered(event);
365 EXPECT_TRUE(MouseInCollection()); 365 EXPECT_TRUE(MouseInCollection());
366 toast1->OnMouseEntered(event); 366 toast1->OnMouseEntered(event);
367 EXPECT_TRUE(MouseInCollection()); 367 EXPECT_TRUE(MouseInCollection());
368 toast0->OnMouseExited(event); 368 toast0->OnMouseExited(event);
369 EXPECT_TRUE(MouseInCollection()); 369 EXPECT_TRUE(MouseInCollection());
370 toast1->OnMouseExited(event); 370 toast1->OnMouseExited(event);
371 EXPECT_FALSE(MouseInCollection()); 371 EXPECT_FALSE(MouseInCollection());
(...skipping 14 matching lines...) Expand all
386 TEST_F(MessagePopupCollectionTest, DetectMouseHoverWithUserClose) { 386 TEST_F(MessagePopupCollectionTest, DetectMouseHoverWithUserClose) {
387 std::string id0 = AddNotification(); 387 std::string id0 = AddNotification();
388 std::string id1 = AddNotification(); 388 std::string id1 = AddNotification();
389 WaitForTransitionsDone(); 389 WaitForTransitionsDone();
390 390
391 views::WidgetDelegateView* toast0 = GetToast(id0); 391 views::WidgetDelegateView* toast0 = GetToast(id0);
392 EXPECT_TRUE(toast0 != NULL); 392 EXPECT_TRUE(toast0 != NULL);
393 views::WidgetDelegateView* toast1 = GetToast(id1); 393 views::WidgetDelegateView* toast1 = GetToast(id1);
394 ASSERT_TRUE(toast1 != NULL); 394 ASSERT_TRUE(toast1 != NULL);
395 395
396 ui::MouseEvent event(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), 0); 396 ui::MouseEvent event(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), 0, 0);
397 toast1->OnMouseEntered(event); 397 toast1->OnMouseEntered(event);
398 static_cast<MessageCenterObserver*>(collection())->OnNotificationRemoved( 398 static_cast<MessageCenterObserver*>(collection())->OnNotificationRemoved(
399 id1, true); 399 id1, true);
400 400
401 EXPECT_FALSE(MouseInCollection()); 401 EXPECT_FALSE(MouseInCollection());
402 std::string id2 = AddNotification(); 402 std::string id2 = AddNotification();
403 403
404 WaitForTransitionsDone(); 404 WaitForTransitionsDone();
405 views::WidgetDelegateView* toast2 = GetToast(id2); 405 views::WidgetDelegateView* toast2 = GetToast(id2);
406 EXPECT_TRUE(toast2 != NULL); 406 EXPECT_TRUE(toast2 != NULL);
407 } 407 }
408 408
409 409
410 } // namespace test 410 } // namespace test
411 } // namespace message_center 411 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698