OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEST_TEST_NOTIFICATION_TRACKER_H_ | 5 #ifndef CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ |
6 #define CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ | 6 #define CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 NotificationType type; | 25 NotificationType type; |
26 NotificationSource source; | 26 NotificationSource source; |
27 NotificationDetails details; | 27 NotificationDetails details; |
28 }; | 28 }; |
29 | 29 |
30 // By default, it won't listen for any notifications. You'll need to call | 30 // By default, it won't listen for any notifications. You'll need to call |
31 // ListenFor for the notifications you are interested in. | 31 // ListenFor for the notifications you are interested in. |
32 TestNotificationTracker(); | 32 TestNotificationTracker(); |
33 | 33 |
34 ~TestNotificationTracker(); | 34 virtual ~TestNotificationTracker(); |
35 | 35 |
36 // Makes this object listen for the given notification with the given source. | 36 // Makes this object listen for the given notification with the given source. |
37 void ListenFor(NotificationType type, const NotificationSource& source); | 37 void ListenFor(NotificationType type, const NotificationSource& source); |
38 | 38 |
39 // Makes this object listen for notifications of the given type coming from | 39 // Makes this object listen for notifications of the given type coming from |
40 // any source. | 40 // any source. |
41 void ListenForAll(NotificationType type); | 41 void ListenForAll(NotificationType type); |
42 | 42 |
43 // Clears the list of events. | 43 // Clears the list of events. |
44 void Reset(); | 44 void Reset(); |
(...skipping 28 matching lines...) Expand all Loading... |
73 private: | 73 private: |
74 NotificationRegistrar registrar_; | 74 NotificationRegistrar registrar_; |
75 | 75 |
76 // Lists all received since last cleared, in the order they were received. | 76 // Lists all received since last cleared, in the order they were received. |
77 std::vector<Event> events_; | 77 std::vector<Event> events_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); | 79 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); |
80 }; | 80 }; |
81 | 81 |
82 #endif // CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ | 82 #endif // CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ |
OLD | NEW |