1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_ASH_COMPONENTS_GROWTH_MOCK_CAMPAIGNS_MANAGER_CLIENT_H_
#define CHROMEOS_ASH_COMPONENTS_GROWTH_MOCK_CAMPAIGNS_MANAGER_CLIENT_H_
#include "chromeos/ash/components/growth/campaigns_manager_client.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace growth {
// A mock implementation of CampaignsManagerClient for use in tests.
class MockCampaignsManagerClient : public CampaignsManagerClient {
public:
MockCampaignsManagerClient();
MockCampaignsManagerClient(const MockCampaignsManagerClient&) = delete;
MockCampaignsManagerClient& operator=(const MockCampaignsManagerClient&) =
delete;
~MockCampaignsManagerClient() override;
// CampaignsManagerClient:
MOCK_METHOD(void,
LoadCampaignsComponent,
(CampaignComponentLoadedCallback callback),
(override));
MOCK_METHOD(void,
AddOnTrackerInitializedCallback,
(OnTrackerInitializedCallback callback),
(override));
MOCK_METHOD(bool, IsDeviceInDemoMode, (), (const, override));
MOCK_METHOD(bool, IsCloudGamingDevice, (), (const, override));
MOCK_METHOD(bool, IsFeatureAwareDevice, (), (const, override));
MOCK_METHOD(bool,
IsAppIconOnShelf,
(const std::string& app_id),
(const, override));
MOCK_METHOD(std::string&, GetApplicationLocale, (), (const, override));
MOCK_METHOD(std::string&, GetUserLocale, (), (const, override));
MOCK_METHOD(const std::string, GetCountryCode, (), (const, override));
MOCK_METHOD(const base::Version&,
GetDemoModeAppVersion,
(),
(const, override));
MOCK_METHOD(ActionMap, GetCampaignsActions, (), (override));
MOCK_METHOD(void,
RegisterSyntheticFieldTrial,
(const std::string& trial_name, const std::string& group_name),
(const, override));
MOCK_METHOD(void,
ClearConfig,
((const std::map<std::string, std::string>& params)),
(override));
MOCK_METHOD(void,
RecordEvent,
(const std::string& event, bool trigger_campaigns),
(override));
MOCK_METHOD(bool,
WouldTriggerHelpUI,
((const std::map<std::string, std::string>& params)),
(override));
MOCK_METHOD(signin::IdentityManager*,
GetIdentityManager,
(),
(const, override));
MOCK_METHOD(void,
RecordImpressionEvents,
(int campaign_id, std::optional<int> group_id),
(override));
};
} // namespace growth
#endif // CHROMEOS_ASH_COMPONENTS_GROWTH_MOCK_CAMPAIGNS_MANAGER_CLIENT_H_
|