OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 |
| 11 #include "chrome/common/notification_observer.h" |
11 #include "chrome/common/notification_registrar.h" | 12 #include "chrome/common/notification_registrar.h" |
12 #include "chrome/common/notification_service.h" | 13 #include "chrome/common/notification_service.h" |
13 | 14 |
14 // Provides an easy way for tests to verify that a given set of notifications | 15 // Provides an easy way for tests to verify that a given set of notifications |
15 // was received during test execution. | 16 // was received during test execution. |
16 class TestNotificationTracker : public NotificationObserver { | 17 class TestNotificationTracker : public NotificationObserver { |
17 public: | 18 public: |
18 // Records one received notification. | 19 // Records one received notification. |
19 struct Event { | 20 struct Event { |
20 Event(); | 21 Event(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 private: | 72 private: |
72 NotificationRegistrar registrar_; | 73 NotificationRegistrar registrar_; |
73 | 74 |
74 // Lists all received since last cleared, in the order they were received. | 75 // Lists all received since last cleared, in the order they were received. |
75 std::vector<Event> events_; | 76 std::vector<Event> events_; |
76 | 77 |
77 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); | 78 DISALLOW_COPY_AND_ASSIGN(TestNotificationTracker); |
78 }; | 79 }; |
79 | 80 |
80 #endif // CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ | 81 #endif // CHROME_TEST_TEST_NOTIFICATION_TRACKER_H_ |
OLD | NEW |