1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef SERVICE_TEST_COMMON_H 16 #define SERVICE_TEST_COMMON_H 17 #include "location_button.h" 18 #include "paste_button.h" 19 #include "save_button.h" 20 21 namespace OHOS { 22 namespace Security { 23 namespace SecurityComponent { 24 class ServiceTestCommon { 25 public: 26 static constexpr int32_t TEST_UID_1 = 1; 27 static constexpr int32_t TEST_UID_2 = 2; 28 static constexpr int32_t TEST_PID_1 = 1; 29 static constexpr int32_t TEST_PID_2 = 2; 30 static constexpr int32_t TEST_PID_3 = 3; 31 static constexpr int32_t TEST_SC_ID_1 = 1; 32 static constexpr int32_t TEST_SC_ID_2 = 2; 33 static constexpr int32_t TEST_INVALID_SC_ID = -1; 34 static constexpr int32_t SC_ID_START = 1000; 35 static constexpr int32_t SA_ID = 3506; 36 37 static constexpr float TEST_SIZE = 100.0; 38 static constexpr double TEST_COORDINATE = 100.0; 39 static constexpr double TEST_DIFF_COORDINATE = 200.0; 40 static constexpr double TEST_DIMENSION = 100.0; 41 static constexpr double TEST_INVALID_DIMENSION = -100.0; 42 static constexpr double ZERO_OFFSET = 0.0F; 43 static constexpr uint32_t TEST_INVALID_SIZE = 0; 44 static constexpr uint32_t QUARTER = 4; 45 46 static constexpr uint32_t TEST_COLOR_INVALID = 0x66000000; 47 static constexpr uint32_t TEST_COLOR_BLACK = 0xff000000; 48 static constexpr uint32_t TEST_COLOR_WHITE = 0xffffffff; 49 static constexpr uint32_t TEST_COLOR_YELLOW = 0xff7fff00; 50 static constexpr uint32_t TEST_COLOR_RED = 0xffff0000; 51 static constexpr uint32_t TEST_COLOR_BLUE = 0xff0000ff; 52 53 static constexpr uint64_t TIME_CONVERSION_UNIT = 1000; 54 static constexpr uint32_t MAX_INT_NUM = 0x7fffffff; 55 static constexpr uint32_t HAP_TOKEN_ID = 537715419; 56 static constexpr uint32_t TEST_TOKEN_ID = 1; 57 58 static void BuildLocationComponentJson(nlohmann::json& jsonComponent); 59 static void BuildSaveComponentJson(nlohmann::json& jsonComponent); 60 static void BuildPasteComponentJson(nlohmann::json& jsonComponent); 61 }; 62 } // namespace SecurityComponent 63 } // namespace Security 64 } // namespace OHOS 65 #endif // SERVICE_TEST_COMMON_H 66