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

Unified Diff: chrome/browser/notifications/notification_test_util.h

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_test_util.h
diff --git a/chrome/browser/notifications/notification_test_util.h b/chrome/browser/notifications/notification_test_util.h
index 66b01e641b5e69d91edbcdaa9c9dfa785b066c9f..5f8ce4b257080734f48c4793c2aefd059da388cd 100644
--- a/chrome/browser/notifications/notification_test_util.h
+++ b/chrome/browser/notifications/notification_test_util.h
@@ -73,4 +73,25 @@ class StubNotificationUIManager : public NotificationUIManager {
DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager);
};
+// Generates notification objects with configurable set of parameters.
+class NotificationGenerator {
+ public:
+ // Creates a custom notification.
+ static std::unique_ptr<Notification> CreateNotification(
+ const std::string& title,
+ const std::string& subtitle,
+ const std::string& context,
+ const std::string& button1,
+ const std::string& button2,
+ message_center::NotificationType type);
+
+ // Creates a completly predefined notification for |type|.
+ static std::unique_ptr<Notification> CreateNotification(
+ message_center::NotificationType type);
+
+ private:
+ // only static methods allowed.
+ DISALLOW_IMPLICIT_CONSTRUCTORS(NotificationGenerator);
+};
+
#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698