| 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 CHROME_BROWSER_PROTECTOR_MOCK_PROTECTOR_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PROTECTOR_MOCK_PROTECTOR_SERVICE_H_ |
| 6 #define CHROME_BROWSER_PROTECTOR_MOCK_PROTECTOR_SERVICE_H_ | 6 #define CHROME_BROWSER_PROTECTOR_MOCK_PROTECTOR_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/protector/protector_service.h" | 9 #include "chrome/browser/protector/protector_service.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| 11 | 11 |
| 12 namespace protector { | 12 namespace protector { |
| 13 | 13 |
| 14 class MockProtectorService : public ProtectorService { | 14 class MockProtectorService : public ProtectorService { |
| 15 public: | 15 public: |
| 16 // Creates and returns the MockProtectorService instance associated with | 16 // Creates and returns the MockProtectorService instance associated with |
| 17 // |profile|. Should be called before any calls to | 17 // |profile|. Should be called before any calls to |
| 18 // ProtectorServiceFactory::GetForProfile are made, otherwise a (non-mocked) | 18 // ProtectorServiceFactory::GetForProfile are made, otherwise a (non-mocked) |
| 19 // ProtectorService instance will be associated with |profile|. | 19 // ProtectorService instance will be associated with |profile|. |
| 20 static MockProtectorService* BuildForProfile(Profile* profile); | 20 static MockProtectorService* BuildForProfile(Profile* profile); |
| 21 | 21 |
| 22 explicit MockProtectorService(Profile* profile); | 22 explicit MockProtectorService(Profile* profile); |
| 23 virtual ~MockProtectorService(); | 23 virtual ~MockProtectorService(); |
| 24 | 24 |
| 25 MOCK_METHOD1(ShowChange, void(BaseSettingChange*)); | 25 MOCK_METHOD1(ShowChange, void(BaseSettingChange*)); |
| 26 MOCK_CONST_METHOD0(IsShowingChange, bool()); | 26 MOCK_CONST_METHOD0(IsShowingChange, bool()); |
| 27 | 27 |
| 28 MOCK_METHOD0(DismissChange, void()); | 28 MOCK_METHOD1(DismissChange, void(BaseSettingChange* change)); |
| 29 MOCK_METHOD1(ApplyChange, void(Browser*)); | 29 MOCK_METHOD2(ApplyChange, void(BaseSettingChange* change, Browser*)); |
| 30 MOCK_METHOD1(DiscardChange, void(Browser*)); | 30 MOCK_METHOD2(DiscardChange, void(BaseSettingChange* change, Browser*)); |
| 31 | 31 |
| 32 MOCK_METHOD2(OpenTab, void(const GURL&, Browser*)); | 32 MOCK_METHOD2(OpenTab, void(const GURL&, Browser*)); |
| 33 | 33 |
| 34 MOCK_METHOD1(OnApplyChange, void(Browser*)); | 34 MOCK_METHOD2(OnApplyChange, void(SettingsChangeGlobalError* error, Browser*)); |
| 35 MOCK_METHOD1(OnDiscardChange, void(Browser*)); | 35 MOCK_METHOD2(OnDiscardChange, void(SettingsChangeGlobalError* error, |
| 36 MOCK_METHOD0(OnDecisionTimeout, void()); | 36 Browser*)); |
| 37 MOCK_METHOD0(OnRemovedFromProfile, void()); | 37 MOCK_METHOD1(OnDecisionTimeout, void(SettingsChangeGlobalError* error)); |
| 38 MOCK_METHOD1(OnRemovedFromProfile, void(SettingsChangeGlobalError* error)); |
| 38 | 39 |
| 39 MOCK_METHOD0(Shutdown, void()); | 40 MOCK_METHOD0(Shutdown, void()); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace protector | 43 } // namespace protector |
| 43 | 44 |
| 44 #endif // CHROME_BROWSER_PROTECTOR_MOCK_PROTECTOR_SERVICE_H_ | 45 #endif // CHROME_BROWSER_PROTECTOR_MOCK_PROTECTOR_SERVICE_H_ |
| OLD | NEW |