1/* 2 * Copyright (C) 2024 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 16import hilog from '@ohos.hilog'; 17import testNapi from 'libentry.so' 18// @ts-nocheck 19import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' 20 21export default function abilityTest() { 22 describe('ActsAbilityTest', () => { 23 enum Drm_ErrorCode { 24 DRM_ERR_OK = 0, 25 DRM_CAPI_ERR_BASE = 24700500, 26 DRM_ERR_NO_MEMORY = 24700501, 27 DRM_ERR_OPERATION_NOT_PERMITTED = 24700502, 28 DRM_ERR_INVALID_VAL = 24700503, 29 DRM_ERR_IO = 24700504, 30 DRM_ERR_TIMEOUT = 24700505, 31 DRM_ERR_UNKNOWN = 24700506, 32 DRM_ERR_SERVICE_DIED = 24700507, 33 DRM_ERR_INVALID_STATE = 24700508, 34 DRM_ERR_UNSUPPORTED = 24700509, 35 DRM_ERR_MAX_SYSTEM_NUM_REACHED = 24700510, 36 DRM_ERR_MAX_SESSION_NUM_REACHED = 24700511, 37 DRM_ERR_EXTEND_START = 24700600 38 } 39 40 /* * 41 * @tc.number : SUB_MULTIMEDIA_AVCODEC_C_API_001 42 * @tc.name : Test_VideoDecoder_SetDecryptionConfig 43 * @tc.desc : 码流解密配置 44 * @tc.size : MediumTest 45 * @tc.type : Function test 46 * @tc.level : Level0 47 */ 48 it('SUB_MULTIMEDIA_AVCODEC_C_API_001', 0, async (done: Function) => { 49 let c = testNapi.Test_VideoDecoder_SetDecryptionConfig("ptr","ptr",false); 50 expect(c).assertEqual(Drm_ErrorCode.DRM_ERR_OK); 51 done(); 52 }) 53 /* * 54 * @tc.number : SUB_MULTIMEDIA_AVSOURCE_C_API_001 55 * @tc.name : Test_AVDemuxer_GetMediaKeySystemInfo 56 * @tc.desc : AVDemuxer参数获取 57 * @tc.size : MediumTest 58 * @tc.type : Function test 59 * @tc.level : Level0 60 */ 61 it('SUB_MULTIMEDIA_AVSOURCE_C_API_001', 0, async (done: Function) => { 62 let c = testNapi.Test_AVDemuxer_GetMediaKeySystemInfo("ptr","ptr"); 63 expect(c).assertEqual(Drm_ErrorCode.DRM_ERR_OK); 64 done(); 65 }) 66 /* * 67 * @tc.number : SUB_MULTIMEDIA_AVSOURCE_C_API_002 68 * @tc.name : Test_AVDemuxer_SetMediaKeySystemInfoCallback 69 * @tc.desc : AVDemuxer参数获取 70 * @tc.size : MediumTest 71 * @tc.type : Function test 72 * @tc.level : Level0 73 */ 74 it('SUB_MULTIMEDIA_AVSOURCE_C_API_002', 0, async (done: Function) => { 75 let c = testNapi.Test_AVDemuxer_SetMediaKeySystemInfoCallback("ptr","ptr"); 76 expect(c).assertEqual(Drm_ErrorCode.DRM_ERR_OK); 77 done(); 78 }) 79 80 /* * 81 * @tc.number : SUB_MULTIMEDIA_AVCODEC_C_API_005 82 * @tc.name : Test_VideoDecoder_SetDecryptionConfig 83 * @tc.desc : 图库picker 84 * @tc.size : MediumTest 85 * @tc.type : Function test 86 * @tc.level : Level0 87 */ 88 it('SUB_MULTIMEDIA_PICKER_C_API_005', 0, async (done: Function) => { 89 let phAccessHelper:photoAccessHelper.PhotoAccessHelper = photoAccessHelper.getPhotoAccessHelper(mContext); 90 let destUri1: string = await phAccessHelper.createAssetWithShortTermPermission(photoCreationConfig1); 91 92 this.pickerController.setPhotoBrowserItem(this.selectedUris[0], PhotoBrowserRange.SELECTED_ONLY); 93 this.pickerController.setPhotoBrowserItem(uri, PhotoBrowserRange.ALL); 94 this.pickerController.setPhotoBrowserItem(uri, PhotoBrowserRange.SELECTED_ONLY); 95 this.pickerController.setPhotoBrowserItem(uri, PhotoBrowserRange.period); 96 this.pickerController.setPhotoBrowserItem(uri, PhotoBrowserRange.photoSource); 97 this.pickerController.setPhotoBrowserItem(uri, PhotoSource.ALL); 98 this.pickerController.setPhotoBrowserItem(uri, PhotoSource.SCREENSHOT); 99 100 router.back(); 101 console.info("testPicer21 finish"); 102 events_emitter.off(event.eventId); 103 done(); 104 }) 105 106 }) 107}