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

Unified Diff: ui/message_center/cocoa/tray_view_controller_unittest.mm

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/cocoa/tray_controller_unittest.mm ('k') | ui/message_center/message_center.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/cocoa/tray_view_controller_unittest.mm
diff --git a/ui/message_center/cocoa/tray_view_controller_unittest.mm b/ui/message_center/cocoa/tray_view_controller_unittest.mm
index 03207d965d2959edf9d1097740861c1136710a60..cb649f9bdf65d03755b2a0427e57fdc6e5b9e999 100644
--- a/ui/message_center/cocoa/tray_view_controller_unittest.mm
+++ b/ui/message_center/cocoa/tray_view_controller_unittest.mm
@@ -16,6 +16,8 @@
#include "ui/message_center/notification.h"
#include "ui/message_center/notifier_settings.h"
+namespace message_center {
+
class TrayViewControllerTest : public ui::CocoaTest {
public:
TrayViewControllerTest()
@@ -53,6 +55,10 @@ class TrayViewControllerTest : public ui::CocoaTest {
}
protected:
+ message_center::NotifierId DummyNotifierId() {
+ return message_center::NotifierId();
+ }
+
message_center::MessageCenter* center_; // Weak, global.
base::MessageLoop message_loop_;
@@ -71,7 +77,7 @@ TEST_F(TrayViewControllerTest, AddRemoveOne) {
ASCIIToUTF16("This is a simple test."),
gfx::Image(),
string16(),
- message_center::NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL));
center_->AddNotification(notification_data.Pass());
@@ -105,7 +111,7 @@ TEST_F(TrayViewControllerTest, AddThreeClearAll) {
ASCIIToUTF16("This is a simple test."),
gfx::Image(),
string16(),
- message_center::NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL));
center_->AddNotification(notification.Pass());
@@ -116,7 +122,7 @@ TEST_F(TrayViewControllerTest, AddThreeClearAll) {
ASCIIToUTF16("This is a simple test."),
gfx::Image(),
string16(),
- message_center::NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL));
center_->AddNotification(notification.Pass());
@@ -127,7 +133,7 @@ TEST_F(TrayViewControllerTest, AddThreeClearAll) {
ASCIIToUTF16("This is a simple test."),
gfx::Image(),
string16(),
- message_center::NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL));
center_->AddNotification(notification.Pass());
@@ -160,7 +166,7 @@ TEST_F(TrayViewControllerTest, NoClearAllWhenNoNotifications) {
ASCIIToUTF16("This is a simple test."),
gfx::Image(),
string16(),
- message_center::NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL));
center_->AddNotification(notification.Pass());
@@ -179,7 +185,7 @@ TEST_F(TrayViewControllerTest, NoClearAllWhenNoNotifications) {
ASCIIToUTF16("This is a simple test."),
gfx::Image(),
string16(),
- message_center::NotifierId(),
+ DummyNotifierId(),
message_center::RichNotificationData(),
NULL));
center_->AddNotification(notification.Pass());
@@ -199,8 +205,6 @@ TEST_F(TrayViewControllerTest, NoClearAllWhenNoNotifications) {
NSMinX([[tray_ pauseButton] frame]));
}
-namespace message_center {
-
namespace {
Notifier* NewNotifier(const std::string& id,
« no previous file with comments | « ui/message_center/cocoa/tray_controller_unittest.mm ('k') | ui/message_center/message_center.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698