diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 21:20:23 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 21:20:23 +0000 |
commit | e8eecbf087af308f5dd0440923ea85f877041e2b (patch) | |
tree | 826649a0d1c60cde50480f7560078cbc5d15f742 /ui/message_center/message_center_tray_unittest.cc | |
parent | d9551eaa68a55f771798771f05ee8a9e88d73b3b (diff) | |
download | chromium_src-e8eecbf087af308f5dd0440923ea85f877041e2b.zip chromium_src-e8eecbf087af308f5dd0440923ea85f877041e2b.tar.gz chromium_src-e8eecbf087af308f5dd0440923ea85f877041e2b.tar.bz2 |
Introduces SYSTEM_PRIORITY
This new priority is expected for system-level high priority notifications
such like low-battery notifications.
BUG=244525
TEST=covered by the new test cases
R=dewittj@chromium.org
Review URL: https://chromiumcodereview.appspot.com/15777008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center/message_center_tray_unittest.cc')
-rw-r--r-- | ui/message_center/message_center_tray_unittest.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ui/message_center/message_center_tray_unittest.cc b/ui/message_center/message_center_tray_unittest.cc index 0235fa7..431c4913c0 100644 --- a/ui/message_center/message_center_tray_unittest.cc +++ b/ui/message_center/message_center_tray_unittest.cc @@ -154,6 +154,38 @@ TEST_F(MessageCenterTrayTest, MessageCenterClosesPopups) { ASSERT_FALSE(message_center_tray_->message_center_visible()); } +TEST_F(MessageCenterTrayTest, MessageCenterReopenPopupsForSystemPriority) { + ASSERT_FALSE(message_center_tray_->popups_visible()); + ASSERT_FALSE(message_center_tray_->message_center_visible()); + + scoped_ptr<Notification> notification( + new Notification(message_center::NOTIFICATION_TYPE_SIMPLE, + "MessageCenterReopnPopupsForSystemPriority", + ASCIIToUTF16("Test Web Notification"), + ASCIIToUTF16("Notification message body."), + gfx::Image(), + ASCIIToUTF16("www.test.org"), + "" /* extension id */, + NULL /* optional_fields */, + NULL /* delegate */)); + notification->SetSystemPriority(); + message_center_->AddNotification(notification.Pass()); + + ASSERT_TRUE(message_center_tray_->popups_visible()); + ASSERT_FALSE(message_center_tray_->message_center_visible()); + + bool shown = message_center_tray_->ShowMessageCenterBubble(); + EXPECT_TRUE(shown); + + ASSERT_FALSE(message_center_tray_->popups_visible()); + ASSERT_TRUE(message_center_tray_->message_center_visible()); + + message_center_tray_->HideMessageCenterBubble(); + + ASSERT_TRUE(message_center_tray_->popups_visible()); + ASSERT_FALSE(message_center_tray_->message_center_visible()); +} + TEST_F(MessageCenterTrayTest, ShowBubbleFails) { // Now the delegate will signal that it was unable to show a bubble. delegate_->show_popups_success_ = false; |