1 /* 2 * Copyright (c) 2022 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 16 #ifndef REMOTE_TOKEN_KIT_TEST_H 17 #define REMOTE_TOKEN_KIT_TEST_H 18 19 #include <gtest/gtest.h> 20 #include "access_token.h" 21 #ifdef TOKEN_SYNC_ENABLE 22 #include "device_manager.h" 23 #endif 24 #include "permission_def.h" 25 #include "permission_state_full.h" 26 27 namespace OHOS { 28 namespace Security { 29 namespace AccessToken { 30 #ifdef TOKEN_SYNC_ENABLE 31 class TestDmInitCallback final : public OHOS::DistributedHardware::DmInitCallback { OnRemoteDied()32 void OnRemoteDied() override 33 {} 34 }; 35 #endif 36 37 class RemoteTokenKitTest : public testing::Test { 38 public: 39 static void SetUpTestCase(); 40 41 static void TearDownTestCase(); 42 43 void SetUp(); 44 45 void TearDown(); 46 unsigned int GetAccessTokenID(int userID, std::string bundleName, int instIndex); 47 void DeleteTestToken() const; 48 void AllocTestToken() const; 49 uint64_t selfTokenId_; 50 std::string udid_; 51 std::string networkId_; 52 }; 53 } // namespace AccessToken 54 } // namespace Security 55 } // namespace OHOS 56 #endif // REMOTE_TOKEN_KIT_TEST_H