1 /* Copyright (c) 2014, Ford Motor Company
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following
12 * disclaimer in the documentation and/or other materials provided with the
15 * Neither the name of the Ford Motor Company nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef TEST_COMPONENTS_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
33 #define TEST_COMPONENTS_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
35 #include "gmock/gmock.h"
36 #include "policy/pt_ext_representation.h"
37 #include "rpc_base/rpc_base.h"
39 #include "mock_pt_representation.h"
41 namespace policy_table = ::rpc::policy_table_interface_base;
45 class MockPTExtRepresentation : public MockPTRepresentation,
46 public PTExtRepresentation {
48 MOCK_METHOD1(CanAppKeepContext,
49 bool(const std::string& app_id));
50 MOCK_METHOD1(CanAppStealFocus,
51 bool(const std::string& app_id));
52 MOCK_METHOD2(GetDefaultHMI,
53 bool(const std::string& app_id, std::string* default_hmi));
54 MOCK_METHOD2(GetPriority,
55 bool(const std::string& app_id, std::string* priority));
56 MOCK_METHOD0(ResetUserConsent,
58 MOCK_METHOD0(ResetDeviceConsents, bool());
59 MOCK_METHOD0(ResetAppConsents, bool());
60 MOCK_METHOD3(GetUserPermissionsForDevice,
61 bool(const std::string&, StringArray*, StringArray*));
62 MOCK_METHOD3(GetUserPermissionsForApp,
63 bool(const std::string&, const std::string&,
64 FunctionalIdType* group_types));
65 MOCK_METHOD2(GetDeviceGroupsFromPolicies,
66 bool(policy_table::Strings*, policy_table::Strings*));
67 MOCK_METHOD2(GetUserFriendlyMsg,
68 std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
69 const std::string& language));
70 MOCK_METHOD7(SetDeviceData, bool (const std::string& device_id,
71 const std::string& hardware,
72 const std::string& firmware,
73 const std::string& os,
74 const std::string& os_version,
75 const std::string& carrier,
76 const uint32_t number_of_ports));
77 MOCK_METHOD6(SetDeviceData,
78 bool(const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&));
79 MOCK_METHOD2(SetMaxNumberPorts,
80 bool(const std::string& device_id, unsigned int number_of_ports));
81 MOCK_METHOD3(SetUserPermissionsForDevice,
82 bool(const std::string&, const StringArray&, const StringArray&));
83 MOCK_METHOD1(SetUserPermissionsForApp,
84 bool(const PermissionConsent&));
85 MOCK_METHOD1(IncreaseStatisticsData,
86 bool(StatisticsType type));
87 MOCK_METHOD3(SetAppRegistrationLanguage,
88 bool(const std::string& app_id, LanguageType type, const std::string& language));
89 MOCK_METHOD3(SetMetaInfo,
90 bool(const std::string& ccpu_version, const std::string& wers_country_code, const std::string& vin));
91 MOCK_METHOD1(SetSystemLanguage,
92 bool(const std::string& language));
93 MOCK_METHOD0(GetKmFromSuccessfulExchange,
95 MOCK_METHOD0(GetDayFromScsExchange,
97 MOCK_METHOD0(GetIgnitionsFromScsExchange,
99 MOCK_CONST_METHOD1(Increment,
100 void(const std::string& type));
101 MOCK_CONST_METHOD2(Increment,
102 void(const std::string& app_id, const std::string& type));
103 MOCK_CONST_METHOD3(Set,
104 void(const std::string& app_id, const std::string& type, const std::string& value));
105 MOCK_CONST_METHOD3(Add,
106 void(const std::string& app_id, const std::string& type, int seconds));
107 MOCK_CONST_METHOD3(CountUnconsentedGroups,
108 bool(const std::string& app_id,
109 const std::string& device_id,
111 MOCK_METHOD1(GetFunctionalGroupNames,
112 bool(FunctionalGroupNames& names));
113 MOCK_CONST_METHOD1(CleanupUnpairedDevices,
114 bool(const DeviceIds& device_ids));
115 MOCK_METHOD2(ReactOnUserDevConsentForApp,
116 bool(const std::string& app_id, bool is_device_allowed));
117 MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id));
118 MOCK_METHOD2(SetIsPredata, bool(const std::string& app_id, bool is_predata));
119 MOCK_CONST_METHOD1(SetUnpairedDevice, bool(const std::string& device_id));
120 MOCK_CONST_METHOD1(UnpairedDevicesList, bool(DeviceIds* device_ids));
123 } // namespace policy
125 #endif // TEST_COMPONENTS_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_