| OLD | NEW |
| 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 CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 virtual ~TestNotificationTracker(); | 36 virtual ~TestNotificationTracker(); |
| 37 | 37 |
| 38 // Makes this object listen for the given notification with the given source. | 38 // Makes this object listen for the given notification with the given source. |
| 39 void ListenFor(int type, const NotificationSource& source); | 39 void ListenFor(int type, const NotificationSource& source); |
| 40 | 40 |
| 41 // Makes this object listen for notifications of the given type coming from | 41 // Makes this object listen for notifications of the given type coming from |
| 42 // any source. | 42 // any source. |
| 43 void ListenForAll(int type); | 43 void ListenForAll(int type); |
| 44 | 44 |
| 45 // Clears the list of events. | 45 // Clears the list of events. |
| 46 void Reset(); | 46 virtual void Reset(); |
| 47 | 47 |
| 48 // Given notifications type(sp, returns true if the list of notifications | 48 // Given notifications type(sp, returns true if the list of notifications |
| 49 // were exactly those listed in the given arg(s), and in the same order. | 49 // were exactly those listed in the given arg(s), and in the same order. |
| 50 // | 50 // |
| 51 // This will also reset the list so that the next call will only check for | 51 // This will also reset the list so that the next call will only check for |
| 52 // new notifications. Example: | 52 // new notifications. Example: |
| 53 // <do stuff> | 53 // <do stuff> |
| 54 // Check1AndReset(NOTIFY_A); | 54 // Check1AndReset(NOTIFY_A); |
| 55 // <do stuff> | 55 // <do stuff> |
| 56 // Check2AndReset(NOTIFY_B, NOTIFY_C) | 56 // Check2AndReset(NOTIFY_B, NOTIFY_C) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 77 | 77 |
| 78 // Lists all received since last cleared, in the order they were received. | 78 // Lists all received since last cleared, in the order they were received. |
| 79 std::vector<Event> events_; | 79 std::vector<Event> events_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); | 81 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace content | 84 } // namespace content |
| 85 | 85 |
| 86 #endif // CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ | 86 #endif // CONTENT_PUBLIC_TEST_TEST_NOTIFICATION_TRACKER_H_ |
| OLD | NEW |