1a3e0fd82Sopenharmony_ci/* 2a3e0fd82Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 3a3e0fd82Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4a3e0fd82Sopenharmony_ci * you may not use this file except in compliance with the License. 5a3e0fd82Sopenharmony_ci * You may obtain a copy of the License at 6a3e0fd82Sopenharmony_ci * 7a3e0fd82Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8a3e0fd82Sopenharmony_ci * 9a3e0fd82Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10a3e0fd82Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11a3e0fd82Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12a3e0fd82Sopenharmony_ci * See the License for the specific language governing permissions and 13a3e0fd82Sopenharmony_ci * limitations under the License. 14a3e0fd82Sopenharmony_ci */ 15a3e0fd82Sopenharmony_ci 16a3e0fd82Sopenharmony_ci#ifndef GRAPHIC_LITE_TEST_MESSAGE_H 17a3e0fd82Sopenharmony_ci#define GRAPHIC_LITE_TEST_MESSAGE_H 18a3e0fd82Sopenharmony_ci 19a3e0fd82Sopenharmony_ci#include <algorithm> 20a3e0fd82Sopenharmony_ci#include <functional> 21a3e0fd82Sopenharmony_ci#include <list> 22a3e0fd82Sopenharmony_ci#include <memory> 23a3e0fd82Sopenharmony_ci#include <string> 24a3e0fd82Sopenharmony_ci#include <vector> 25a3e0fd82Sopenharmony_ci 26a3e0fd82Sopenharmony_cinamespace OHOS { 27a3e0fd82Sopenharmony_cienum TestEventID : uint8_t { 28a3e0fd82Sopenharmony_ci TEST_CLICK_EVENT, 29a3e0fd82Sopenharmony_ci TEST_MOVE_EVENT, 30a3e0fd82Sopenharmony_ci}; 31a3e0fd82Sopenharmony_ci 32a3e0fd82Sopenharmony_cienum TestMode: uint8_t { 33a3e0fd82Sopenharmony_ci TEST_MODE_BASE = 1, 34a3e0fd82Sopenharmony_ci TEST_MODE_RUN, 35a3e0fd82Sopenharmony_ci}; 36a3e0fd82Sopenharmony_ci 37a3e0fd82Sopenharmony_cistruct TestSteps { 38a3e0fd82Sopenharmony_ci std::string viewID; 39a3e0fd82Sopenharmony_ci TestEventID eventID; 40a3e0fd82Sopenharmony_ci std::vector<int> eventValue; 41a3e0fd82Sopenharmony_ci bool saveCheckPoint; 42a3e0fd82Sopenharmony_ci}; 43a3e0fd82Sopenharmony_ci 44a3e0fd82Sopenharmony_cistruct TestMsgInfo { 45a3e0fd82Sopenharmony_ci std::string className; 46a3e0fd82Sopenharmony_ci std::vector<std::string> pageNav; 47a3e0fd82Sopenharmony_ci std::vector<TestSteps> steps; 48a3e0fd82Sopenharmony_ci}; 49a3e0fd82Sopenharmony_ci 50a3e0fd82Sopenharmony_cistruct TestConfigInfo { 51a3e0fd82Sopenharmony_ci TestConfigInfo() 52a3e0fd82Sopenharmony_ci { 53a3e0fd82Sopenharmony_ci testMode = TEST_MODE_BASE; 54a3e0fd82Sopenharmony_ci } 55a3e0fd82Sopenharmony_ci TestMode testMode; 56a3e0fd82Sopenharmony_ci std::string baseDir; 57a3e0fd82Sopenharmony_ci std::string runDir; 58a3e0fd82Sopenharmony_ci std::string logDir; 59a3e0fd82Sopenharmony_ci}; 60a3e0fd82Sopenharmony_ci 61a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_MAIN_ID = "main_id"; 62a3e0fd82Sopenharmony_ciconst std::string JOSN_VALUE_TEST_MODE = "test_mode"; 63a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_BASE_DIR = "base_dir"; 64a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_RUN_DIR = "run_dir"; 65a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_LOG_DIR = "log_dir"; 66a3e0fd82Sopenharmony_ci 67a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_TEST_INFO = "testInfo"; 68a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_CLASS_NAME = "className"; 69a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_PAGE_NAV = "pageNav"; 70a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_TEST_STEPS = "testSteps"; 71a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_VIEW_ID = "viewID"; 72a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_EVENT_ID = "eventID"; 73a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_EVENT_VALUE = "eventValue"; 74a3e0fd82Sopenharmony_ciconst std::string JSON_VALUE_SAVE_CHECK_POINT = "saveCheckPoint"; 75a3e0fd82Sopenharmony_ci 76a3e0fd82Sopenharmony_ciconst size_t EVENT_VALUE_SIZE_TWO = 2; 77a3e0fd82Sopenharmony_ci 78a3e0fd82Sopenharmony_ciconst size_t S_C_MAIN_ID_SEND_CONFIG_INFO = 1; // Send config information 79a3e0fd82Sopenharmony_ciconst size_t C_S_MAIN_ID_REQUEST_TEST_INFO = 2; // Request to start test 80a3e0fd82Sopenharmony_ciconst size_t S_C_MAIN_ID_SEND_TEST_INFO = 3; // Distribute test data 81a3e0fd82Sopenharmony_ciconst size_t C_S_MAIN_ID_TEST_FINISH_INFO = 4; // Test a set of data 82a3e0fd82Sopenharmony_ciconst size_t S_C_MAIN_ID_All_TESTS_COMPLETE = 5; // All tests completed 83a3e0fd82Sopenharmony_ci} // namespace OHOS 84a3e0fd82Sopenharmony_ci 85a3e0fd82Sopenharmony_ci#endif // GRAPHIC_LITE_TEST_MESSAGE_H 86