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 #include "chrome/common/notification_observer.h" |
5 #include "chrome/common/notification_registrar.h" | 6 #include "chrome/common/notification_registrar.h" |
6 #include "chrome/common/notification_service.h" | 7 #include "chrome/common/notification_service.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 | 9 |
9 namespace { | 10 namespace { |
10 | 11 |
11 // Bogus class to act as a NotificationSource for the messages. | 12 // Bogus class to act as a NotificationSource for the messages. |
12 class TestSource {}; | 13 class TestSource {}; |
13 | 14 |
14 class TestObserver : public NotificationObserver { | 15 class TestObserver : public NotificationObserver { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 EXPECT_EQ(3, idle_test_source.notification_count()); | 155 EXPECT_EQ(3, idle_test_source.notification_count()); |
155 | 156 |
156 registrar_.Remove(&idle_test_source, NotificationType::ALL, | 157 registrar_.Remove(&idle_test_source, NotificationType::ALL, |
157 Source<TestSource>(&test_source)); | 158 Source<TestSource>(&test_source)); |
158 | 159 |
159 service->Notify(NotificationType::IDLE, | 160 service->Notify(NotificationType::IDLE, |
160 Source<TestSource>(&test_source), | 161 Source<TestSource>(&test_source), |
161 NotificationService::NoDetails()); | 162 NotificationService::NoDetails()); |
162 EXPECT_EQ(3, idle_test_source.notification_count()); | 163 EXPECT_EQ(3, idle_test_source.notification_count()); |
163 } | 164 } |
OLD | NEW |