70 lines
2.5 KiB
C++
70 lines
2.5 KiB
C++
/*
|
|
* Copyright (c) 2023 Fancy Code.
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
#ifndef APP_MANAGER_TEST_TOOL_H
|
|
#define APP_MANAGER_TEST_TOOL_H
|
|
#include "GtestUsing.h"
|
|
#include "IAppManager.h"
|
|
#include <memory>
|
|
class AppManagerTestTool
|
|
{
|
|
public:
|
|
AppManagerTestTool();
|
|
virtual ~AppManagerTestTool() = default;
|
|
void Init(void);
|
|
void UnInit(void);
|
|
|
|
protected: // About http
|
|
void MockGetProductInfo(void);
|
|
void MockGetDeviceAttr(void);
|
|
void MockGetMediaInfo(void);
|
|
void MockGetSdCardInfo(void);
|
|
void MockGetBatteryInfo(void);
|
|
void MockSetDateTime(void);
|
|
void MockSetTimeZone(void);
|
|
void MockUploadFiles(void);
|
|
void MockGetParamValue(const std::string ¶mName);
|
|
void MockGetParamItems(const std::string ¶mName);
|
|
void MockGetCapability(void);
|
|
void MockGetLockVideoStatus(void);
|
|
void MockGetStorageInfo(void);
|
|
void MockGetStorageFileList(void);
|
|
void MockSetParamValue(void);
|
|
void MockEnterRecorder(void);
|
|
void MockAppPlayback(void);
|
|
void MockMonitorSetFileList(std::vector<AppGetFileList> &files);
|
|
|
|
protected: // About TCP
|
|
void MockAppClientConnect(void);
|
|
void MockSetRecordingStatus(const RecordingStatus &status);
|
|
void MockSetMicrophoneStatus(const MicrophoneStatus &status);
|
|
void MockSetBatteryStatus(const BatteryStatus &status, const int &batteryCapacity);
|
|
void MockSetSdCardStatus(const SdCardStatus &status);
|
|
void MockDeletedFileMessage(const std::string &file, const StorageFileType &type);
|
|
void MockCreatedFileMessage(const std::string &file, const StorageFileType &type);
|
|
|
|
private:
|
|
void AppManagerMockInit(std::shared_ptr<IAppManager> &vMock);
|
|
void AppMonitorInit(std::shared_ptr<VAppMonitor> &vMock);
|
|
|
|
private:
|
|
std::shared_ptr<IAppManager> mAppManagerMock;
|
|
std::shared_ptr<VAppMonitor> mAppMonitorMock;
|
|
void *mAppClientTool;
|
|
std::shared_ptr<VAppClient> mAppClient;
|
|
|
|
public:
|
|
static std::shared_ptr<VAppMonitor> MakeMonitorMock(void);
|
|
};
|
|
#endif |