1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SERVICE_H_ 7 #pragma once 8 9 #include <string> 10 #include <vector> 11 12 #include "chrome/browser/extensions/extension_service.h" 13 // Needed to keep gmock happy. 14 #include "chrome/browser/extensions/extension_sync_data.h" 15 #include "testing/gmock/include/gmock/gmock.h" 16 17 class MockExtensionService : public ExtensionServiceInterface { 18 public: 19 MockExtensionService(); 20 virtual ~MockExtensionService(); 21 22 MOCK_CONST_METHOD0(extensions, const ExtensionList*()); 23 MOCK_CONST_METHOD0(disabled_extensions, const ExtensionList*()); 24 MOCK_METHOD0(pending_extension_manager, PendingExtensionManager*()); 25 MOCK_METHOD3(UpdateExtension, void(const std::string&, 26 const FilePath&, 27 const GURL&)); 28 MOCK_CONST_METHOD2(GetExtensionById, 29 const Extension*(const std::string&, bool)); 30 MOCK_METHOD3(UninstallExtension, 31 bool(const std::string&, bool, std::string*)); 32 MOCK_CONST_METHOD1(IsExtensionEnabled, bool(const std::string&)); 33 MOCK_CONST_METHOD1(IsExternalExtensionUninstalled, 34 bool(const std::string&)); 35 MOCK_METHOD1(EnableExtension, void(const std::string&)); 36 MOCK_METHOD1(DisableExtension, void(const std::string&)); 37 MOCK_METHOD1(UpdateExtensionBlacklist, 38 void(const std::vector<std::string>&)); 39 MOCK_METHOD0(CheckAdminBlacklist, void()); 40 MOCK_CONST_METHOD1(IsIncognitoEnabled, bool(const std::string&)); 41 MOCK_METHOD2(SetIsIncognitoEnabled, void(const std::string&, bool)); 42 MOCK_METHOD0(CheckForUpdatesSoon, void()); 43 MOCK_METHOD2(ProcessSyncData, 44 void(const ExtensionSyncData&, 45 PendingExtensionInfo::ShouldAllowInstallPredicate 46 should_allow_install)); 47 }; 48 49 #endif // CHROME_BROWSER_EXTENSIONS_MOCK_EXTENSION_SERVICE_H_ 50