OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser/prefs/pref_change_registrar.h" | 5 #include "chrome/browser/prefs/pref_change_registrar.h" |
6 #include "chrome/test/testing_pref_service.h" | 6 #include "chrome/test/testing_pref_service.h" |
| 7 #include "content/common/content_notification_types.h" |
7 #include "content/common/notification_details.h" | 8 #include "content/common/notification_details.h" |
8 #include "content/common/notification_observer_mock.h" | 9 #include "content/common/notification_observer_mock.h" |
9 #include "content/common/notification_source.h" | 10 #include "content/common/notification_source.h" |
10 #include "content/common/notification_type.h" | |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using testing::Mock; | 14 using testing::Mock; |
15 using testing::Eq; | 15 using testing::Eq; |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // A mock provider that allows us to capture pref observer changes. | 19 // A mock provider that allows us to capture pref observer changes. |
20 class MockPrefService : public TestingPrefService { | 20 class MockPrefService : public TestingPrefService { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 RemovePrefObserver(Eq(std::string("test.pref.1")), observer())); | 109 RemovePrefObserver(Eq(std::string("test.pref.1")), observer())); |
110 EXPECT_CALL(*service(), | 110 EXPECT_CALL(*service(), |
111 RemovePrefObserver(Eq(std::string("test.pref.2")), observer())); | 111 RemovePrefObserver(Eq(std::string("test.pref.2")), observer())); |
112 registrar.RemoveAll(); | 112 registrar.RemoveAll(); |
113 EXPECT_TRUE(registrar.IsEmpty()); | 113 EXPECT_TRUE(registrar.IsEmpty()); |
114 | 114 |
115 // Explicitly check the expectations now to make sure that the RemoveAll | 115 // Explicitly check the expectations now to make sure that the RemoveAll |
116 // worked (rather than the registrar destructor doing the work). | 116 // worked (rather than the registrar destructor doing the work). |
117 Mock::VerifyAndClearExpectations(service()); | 117 Mock::VerifyAndClearExpectations(service()); |
118 } | 118 } |
OLD | NEW |