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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 private: 67 private:
68 using NotificationPair = std::pair<Notification, ProfileID>; 68 using NotificationPair = std::pair<Notification, ProfileID>;
69 std::vector<NotificationPair> notifications_; 69 std::vector<NotificationPair> notifications_;
70 70
71 base::Closure notification_added_callback_; 71 base::Closure notification_added_callback_;
72 72
73 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager); 73 DISALLOW_COPY_AND_ASSIGN(StubNotificationUIManager);
74 }; 74 };
75 75
76 // Generates notification objects with configurable set of parameters.
77 class NotificationGenerator {
78 public:
79 // Creates a custom notification.
80 static std::unique_ptr<Notification> CreateNotification(
81 const std::string& title,
82 const std::string& subtitle,
83 const std::string& context,
84 const std::string& button1,
85 const std::string& button2,
86 message_center::NotificationType type);
87
88 // Creates a completly predefined notification for |type|.
89 static std::unique_ptr<Notification> CreateNotification(
90 message_center::NotificationType type);
91
92 private:
93 // only static methods allowed.
94 DISALLOW_IMPLICIT_CONSTRUCTORS(NotificationGenerator);
95 };
96
76 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_ 97 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698