1/* 2 * Copyright (C) 2021 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 */ 15import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' 16import accessibility from '@ohos.accessibility' 17 18export default function AccessibleCaptionConfiguration() { 19describe('AccessibleCaptionConfiguration', function () { 20 21 beforeEach(async function (done) { 22 console.info(`AccessibleCaptionConfiguration: beforeEach starts`); 23 done(); 24 }) 25 26 afterEach(async function (done) { 27 console.info(`AccessibleCaptionConfiguration: afterEach starts`); 28 done(); 29 }) 30 31 32 /* 33 * @tc.number CaptionConfiguration_0010 34 * @tc.name CaptionConfiguration_0010 35 * @tc.desc The parameter input is 'enableChange', test the captionManager.on() function, 36 * and return undefined 37 * @tc.size SmallTest 38 * @tc.type User 39 */ 40 it('CaptionConfiguration_0010', 0, async function (done) { 41 console.info('CaptionConfiguration_0010'); 42 let captionManager = accessibility.getCaptionsManager(); 43 let stateEventType = 'enableChange'; 44 let ret = captionManager.on(stateEventType, (data) => {}); 45 expect(ret).assertEqual(undefined); 46 done(); 47 }) 48 49 /* 50 * @tc.number CaptionConfiguration_0020 51 * @tc.name CaptionConfiguration_0020 52 * @tc.desc The parameter input is 'styleChange', test the captionManager.on() function, 53 * and return undefined 54 * @tc.size SmallTest 55 * @tc.type User 56 */ 57 it('CaptionConfiguration_0020', 0, async function (done) { 58 console.info('CaptionConfiguration_0020'); 59 let captionManager = accessibility.getCaptionsManager(); 60 let stateEventType = 'styleChange'; 61 let ret = captionManager.on(stateEventType, (data) => {}); 62 expect(ret).assertEqual(undefined); 63 done(); 64 }) 65 66 /* 67 * @tc.number CaptionConfiguration_0050 68 * @tc.name CaptionConfiguration_0050 69 * @tc.desc The parameter input is 'enableChange', test the captionManager.off() function, 70 * and return undefined 71 * @tc.size SmallTest 72 * @tc.type User 73 */ 74 it('CaptionConfiguration_0050', 0, async function (done) { 75 console.info('CaptionConfiguration_0050'); 76 let captionManager = accessibility.getCaptionsManager(); 77 let stateEventType = 'enableChange'; 78 let ret = captionManager.off(stateEventType, (data) => {}); 79 expect(ret).assertEqual(undefined); 80 done(); 81 }) 82 83 /* 84 * @tc.number CaptionConfiguration_0060 85 * @tc.name CaptionConfiguration_0060 86 * @tc.desc The parameter input is 'styleChange', test the captionManager.off() function, 87 * and return undefined 88 * @tc.size SmallTest 89 * @tc.type User 90 */ 91 it('CaptionConfiguration_0060', 0, async function (done) { 92 console.info('CaptionConfiguration_0060'); 93 let captionManager = accessibility.getCaptionsManager(); 94 let stateEventType = 'styleChange'; 95 let ret = captionManager.off(stateEventType, (data) => {}); 96 expect(ret).assertEqual(undefined); 97 done(); 98 }) 99}) 100} 101