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

Unified Diff: ui/message_center/message_center_tray_unittest.cc

Issue 101473003: Do not allow creating dummy notifier id from production, for safety. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/message_center.h ('k') | ui/message_center/notifier_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center_tray_unittest.cc
diff --git a/ui/message_center/message_center_tray_unittest.cc b/ui/message_center/message_center_tray_unittest.cc
index 6a68b2b989f4037d2b3f222ebe00a17320fb75bd..f9f10e1807eec6ccdfd9b71a5cd3dc01929e4a20 100644
--- a/ui/message_center/message_center_tray_unittest.cc
+++ b/ui/message_center/message_center_tray_unittest.cc
@@ -42,6 +42,8 @@ class MockDelegate : public MessageCenterTrayDelegate {
DISALLOW_COPY_AND_ASSIGN(MockDelegate);
};
+} // namespace
+
class MessageCenterTrayTest : public testing::Test {
public:
MessageCenterTrayTest() {}
@@ -63,6 +65,10 @@ class MessageCenterTrayTest : public testing::Test {
}
protected:
+ NotifierId DummyNotifierId() {
+ return NotifierId();
+ }
+
void AddNotification(const std::string& id) {
scoped_ptr<Notification> notification(
new Notification(message_center::NOTIFICATION_TYPE_SIMPLE,
@@ -71,7 +77,7 @@ class MessageCenterTrayTest : public testing::Test {
ASCIIToUTF16("Notification message body."),
gfx::Image(),
ASCIIToUTF16("www.test.org"),
- NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL /* delegate */));
message_center_->AddNotification(notification.Pass());
@@ -84,8 +90,6 @@ class MessageCenterTrayTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(MessageCenterTrayTest);
};
-} // namespace
-
TEST_F(MessageCenterTrayTest, BasicMessageCenter) {
ASSERT_FALSE(message_center_tray_->popups_visible());
ASSERT_FALSE(message_center_tray_->message_center_visible());
@@ -178,7 +182,7 @@ TEST_F(MessageCenterTrayTest, MessageCenterReopenPopupsForSystemPriority) {
ASCIIToUTF16("Notification message body."),
gfx::Image(),
ASCIIToUTF16("www.test.org"),
- NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL /* delegate */));
notification->SetSystemPriority();
« no previous file with comments | « ui/message_center/message_center.h ('k') | ui/message_center/notifier_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698