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

Side by Side Diff: ui/message_center/notification_list_unittest.cc

Issue 2126433002: Use container::back() and container::pop_back() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-increment Created 4 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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/notification_list.h" 5 #include "ui/message_center/notification_list.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 for (size_t i = 0; i < kMaxVisiblePopupNotifications; ++i, ++iter) { 288 for (size_t i = 0; i < kMaxVisiblePopupNotifications; ++i, ++iter) {
289 EXPECT_EQ(ids[i], (*iter)->id()) << i; 289 EXPECT_EQ(ids[i], (*iter)->id()) << i;
290 } 290 }
291 291
292 for (NotificationList::PopupNotifications::const_iterator iter = 292 for (NotificationList::PopupNotifications::const_iterator iter =
293 popups.begin(); iter != popups.end(); ++iter) { 293 popups.begin(); iter != popups.end(); ++iter) {
294 notification_list()->MarkSinglePopupAsShown((*iter)->id(), false); 294 notification_list()->MarkSinglePopupAsShown((*iter)->id(), false);
295 } 295 }
296 popups.clear(); 296 popups.clear();
297 popups = GetPopups(); 297 popups = GetPopups();
298 EXPECT_EQ(1u, popups.size()); 298 ASSERT_EQ(1u, popups.size());
299 EXPECT_EQ(ids[ids.size() - 1], (*popups.begin())->id()); 299 EXPECT_EQ(ids.back(), (*popups.begin())->id());
300 } 300 }
301 301
302 TEST_F(NotificationListTest, Priority) { 302 TEST_F(NotificationListTest, Priority) {
303 ASSERT_EQ(0u, notification_list()->NotificationCount(blockers())); 303 ASSERT_EQ(0u, notification_list()->NotificationCount(blockers()));
304 ASSERT_EQ(0u, notification_list()->UnreadCount(blockers())); 304 ASSERT_EQ(0u, notification_list()->UnreadCount(blockers()));
305 305
306 // Default priority has the limit on the number of the popups. 306 // Default priority has the limit on the number of the popups.
307 for (size_t i = 0; i <= kMaxVisiblePopupNotifications; ++i) 307 for (size_t i = 0; i <= kMaxVisiblePopupNotifications; ++i)
308 AddNotification(); 308 AddNotification();
309 EXPECT_EQ(kMaxVisiblePopupNotifications + 1, 309 EXPECT_EQ(kMaxVisiblePopupNotifications + 1,
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 NotifierId(), RichNotificationData(), NULL)); 662 NotifierId(), RichNotificationData(), NULL));
663 notification_list()->AddNotification(std::move(updated_notification)); 663 notification_list()->AddNotification(std::move(updated_notification));
664 664
665 EXPECT_FALSE(notification_list()->HasNotificationOfType( 665 EXPECT_FALSE(notification_list()->HasNotificationOfType(
666 id, message_center::NOTIFICATION_TYPE_SIMPLE)); 666 id, message_center::NOTIFICATION_TYPE_SIMPLE));
667 EXPECT_TRUE(notification_list()->HasNotificationOfType( 667 EXPECT_TRUE(notification_list()->HasNotificationOfType(
668 id, message_center::NOTIFICATION_TYPE_PROGRESS)); 668 id, message_center::NOTIFICATION_TYPE_PROGRESS));
669 } 669 }
670 670
671 } // namespace message_center 671 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc ('k') | ui/message_center/popup_timers_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698