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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_mac.mm

Issue 2138873002: Add tests for the Display operation of the mac notification bridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_platform_bridge_mac.mm
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm
index e96756be9d07f2003944297157bc9d80f3a2cb7c..31ab0774efde0c56369544b50d76f3ad2e73a9ce 100644
--- a/chrome/browser/notifications/notification_platform_bridge_mac.mm
+++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm
@@ -91,10 +91,18 @@ NotificationPlatformBridge* NotificationPlatformBridge::Create() {
// /////////////////////////////////////////////////////////////////////////////
NotificationPlatformBridgeMac::NotificationPlatformBridgeMac(
- NSUserNotificationCenter* notification_center)
+ NSUserNotificationCenter* notification_center) {
+ NotificationPlatformBridgeMac(notification_center, true /* set_delegate */);
Peter Beverloo 2016/07/11 17:25:48 You can define a delegating constructor like: Not
Miguel Garcia 2016/07/12 16:16:24 You know I usually go with the flow with regards t
+}
+
+NotificationPlatformBridgeMac::NotificationPlatformBridgeMac(
+ NSUserNotificationCenter* notification_center,
+ bool set_delegate)
: delegate_([NotificationCenterDelegate alloc]),
notification_center_(notification_center) {
- [notification_center_ setDelegate:delegate_.get()];
+ // Setting up the delegte upsets OCMock.
Peter Beverloo 2016/07/11 17:25:48 delegte -> delegate Rather than saying that it "u
Miguel Garcia 2016/07/12 16:16:24 Now that we know why sure :)
+ if (set_delegate)
+ notification_center.delegate = delegate_.get();
Peter Beverloo 2016/07/11 17:25:48 Why did the syntax for the assignment change?
Miguel Garcia 2016/07/12 16:16:24 It was me trying some things to keep OCMock happy,
}
NotificationPlatformBridgeMac::~NotificationPlatformBridgeMac() {

Powered by Google App Engine
This is Rietveld 408576698