diff --git a/multimedia/audio/audio_js_standard/audioManager/Test.json b/multimedia/audio/audio_js_standard/audioManager/Test.json index f1ff31d4c906241d97fb71a7aa7adc530131bbed..6891014f3217a3e876a5bc9e2d0c2350de258470 100755 --- a/multimedia/audio/audio_js_standard/audioManager/Test.json +++ b/multimedia/audio/audio_js_standard/audioManager/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "4800000", + "test-timeout": "200000", "package": "ohos.acts.multimedia.audio.audiomanager", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/config.json b/multimedia/audio/audio_js_standard/audioManager/src/main/config.json index f37ba1d704393d0fcea6f3aad989b5fdeb65d79c..cc29d5d6c4fdf4148f367e2848729b15aa0bf9c8 100755 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/config.json +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/config.json @@ -1,60 +1,74 @@ { "app": { - "bundleName": "ohos.acts.multimedia.audio.audiomanager", - "vendor": "acts", - "version": { - "code": 1, - "name": "1.0" - }, "apiVersion": { - "compatible": 6, - "target": 5 - } + "compatible": 6, + "releaseType": "Beta1", + "target": 7 + }, + "vendor": "acts", + "bundleName": "ohos.acts.multimedia.audio.audiomanager", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": { + "default": { + "debug": true + } }, - "deviceConfig": {}, "module": { - "package": "ohos.acts.multimedia.audio.audiomanager", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ + "abilities": [ { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] + "iconId": 16777218, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "descriptionId": 16777217, + "visible": true, + "labelId": 16777216, + "icon": "$media:icon", + "name": "ohos.acts.multimedia.audio.audiomanager.MainAbility", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "homeAbility": true, + "launchType": "standard" } - ], - "visible": true, - "name": "ohos.acts.multimedia.audio.audiomanager.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] + ], + "deviceType": [ + "phone", + "tablet", + "tv", + "wearable" + ], + "mainAbility": "ohos.acts.multimedia.audio.audiomanager.MainAbility", + "distro": { + "moduleType": "entry", + "installationFree": false, + "deliveryWithInstall": true, + "moduleName": "entry" + }, + "package": "ohos.acts.multimedia.audio.audiomanager", + "name": ".MyApplication", + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] } } \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java b/multimedia/audio/audio_js_standard/audioManager/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..84cb3efd1dba0d92d906a3624192afd6b887499a --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayer; + + import ohos.ace.ability.AceAbility; + import ohos.aafwk.content.Intent; + +/* + * java MainAbility + */ + + public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java b/multimedia/audio/audio_js_standard/audioManager/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..a735d0a33e16bdb4ae0194d12fb865e64207b88e --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayer; + + import ohos.aafwk.ability.AbilityPackage; + +/* + * java MyApplication + */ + + public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js index 7a4d66704c29e5cfda976b49b2bf984632c06095..1952095fa2a9064ceb61df7df62b69a26df49b3a 100755 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js @@ -18,19 +18,19 @@ import audio from '@ohos.multimedia.audio'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; describe('audioManger', function () { - console.info('AudioFrameworkTest: Create AudioManger Object JS Framework'); + console.info('Create AudioManger Object JS Framework'); const audioManager = audio.getAudioManager(); - var deviceRoleValue = null; - var deviceTypeValue = null; - var volErrorMesg = 'Error, Operation not supported or Failed'; - var audioMedia = 3; - var audioRingtone = 2; - var minVol = 0; - var maxVol = 15; - var lowVol = 5; - var highVol = 14; - var outOfRangeVol = 28; - var longValue = '28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843'; + var DEVICE_ROLE_VALUE = null; + var DEVICE_TYPE_VALUE = null; + var VOL_ERROR_MESG = 'Error, Operation not supported or Failed'; + var AUDIO_MEDIA = 3; + var AUDIO_RINGTONE = 2; + var MIN_VOL = 0; + var MAX_VOL = 15; + var LOW_VOL = 5; + var HIGH_VOL = 14; + var OUT_OF_RANGE_VOL = 28; + var LONG_VALUE = '28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843'; function displayDeviceProp(value, index, array) { var devRoleName; @@ -68,56 +68,57 @@ describe('audioManger', function () { } console.info(`AudioFrameworkTest: device role: ${devRoleName}`); - deviceRoleValue = value.deviceRole; + DEVICE_ROLE_VALUE = value.deviceRole; console.info(`AudioFrameworkTest: device type: ${devTypeName}`); - deviceTypeValue = value.deviceType; + DEVICE_TYPE_VALUE = value.deviceType; } beforeAll(function () { - console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); + console.info('beforeAll: Prerequisites at the test suite level'); }) beforeEach(function () { - console.info('AudioFrameworkTest: beforeEach: Prerequisites at the test case level'); + console.info('beforeEach: Prerequisites at the test case level'); }) afterEach(function () { - console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions'); + console.info('afterEach: Test case-level clearance conditions'); }) afterAll(function () { - console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition'); + console.info('afterAll: Test suite-level cleanup condition'); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioManger_001 - * @tc.name : getAudioManger is Not returned Empty - * @tc.desc : Check getAudioManger is not empty - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_AUDIO_MANAGER_getAudioManger_001', 0, function (done) { + * @tc.number : SUB_AUDIO_MANAGER_getAudioManger_001 + * @tc.name : getAudioManger is Not returned Empty + * @tc.desc : Check getAudioManger is not empty + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + + it('SUB_AUDIO_MANAGER_getAudioManger_001', 0, function () { if(audioManager!=null){ - console.info('AudioFrameworkTest: getAudioManger : PASS'); + console.info('getAudioManger : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: getAudioManger : FAIL'); + console.info('getAudioManger : FAIL'); expect(false).assertTrue(); } - done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioManger_002 - * @tc.name : getAudioManger - Multiple instance - * @tc.desc : multiple times with different instance - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioManger_002 + * @tc.name : getAudioManger - Multiple instance + * @tc.desc : multiple times with different instance + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioManger_002', 0, async function (done) { const audioManager1 = audio.getAudioManager(); const audioManager2 = audio.getAudioManager(); @@ -129,40 +130,40 @@ describe('audioManger', function () { const audioManager8 = audio.getAudioManager(); const audioManager9 = audio.getAudioManager(); const audioManager10 = audio.getAudioManager(); - const promise = audioManager.setVolume(audioMedia,lowVol); + const promise = audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Media setVolume promise: successful'); - audioManager1.setVolume(audioMedia,highVol); + console.info('Media setVolume promise: successful'); + audioManager1.setVolume(AUDIO_MEDIA,HIGH_VOL); console.info('AudioFrameworkTest:audioManager1 : Media setVolume promise: successful'); - audioManager2.setVolume(audioMedia,highVol); + audioManager2.setVolume(AUDIO_MEDIA,HIGH_VOL); console.info('AudioFrameworkTest:audioManager2 : Media setVolume promise: successful'); - audioManager3.setVolume(audioMedia,highVol); + audioManager3.setVolume(AUDIO_MEDIA,HIGH_VOL); console.info('AudioFrameworkTest:audioManager3 : Media setVolume promise: successful'); - audioManager4.setVolume(audioMedia,lowVol); + audioManager4.setVolume(AUDIO_MEDIA,LOW_VOL); console.info('AudioFrameworkTest:audioManager4 : Media setVolume promise: successful'); - audioManager5.setVolume(audioMedia,highVol); + audioManager5.setVolume(AUDIO_MEDIA,HIGH_VOL); console.info('AudioFrameworkTest:audioManager5 : Media setVolume promise: successful'); - audioManager6.setVolume(audioMedia,lowVol); + audioManager6.setVolume(AUDIO_MEDIA,LOW_VOL); console.info('AudioFrameworkTest:audioManager6 : Media setVolume promise: successful'); - audioManager7.setVolume(audioMedia,highVol); + audioManager7.setVolume(AUDIO_MEDIA,HIGH_VOL); console.info('AudioFrameworkTest:audioManager7 : Media setVolume promise: successful'); - audioManager8.setVolume(audioMedia,lowVol); + audioManager8.setVolume(AUDIO_MEDIA,LOW_VOL); console.info('AudioFrameworkTest:audioManager8 : Media setVolume promise: successful'); - audioManager9.setVolume(audioMedia,highVol); + audioManager9.setVolume(AUDIO_MEDIA,HIGH_VOL); console.info('AudioFrameworkTest:audioManager9 : Media setVolume promise: successful'); - audioManager10.setVolume(audioMedia,lowVol); + audioManager10.setVolume(AUDIO_MEDIA,LOW_VOL); console.info('AudioFrameworkTest:audioManager10 : Media setVolume promise: successful'); - audioManager.getVolume(audioMedia).then(function (data) { - if(data == lowVol){ - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + audioManager.getVolume(AUDIO_MEDIA).then(function (data) { + if(data == LOW_VOL){ + console.info('Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info('Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }).catch((err) => { - console.info('AudioFrameworkTest: Media getVolume Promise: Error :' + err.message); + console.info('Media getVolume Promise: Error :' + err.message); }); }); await promise; @@ -170,24 +171,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_001 - * @tc.name : setVolume - Media - Promise - * @tc.desc : Setvol to 1 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_001 + * @tc.name : setVolume - Media - Promise + * @tc.desc : Setvol to 1 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_001', 0, async function (done) { - const promise = audioManager.setVolume(audioMedia,lowVol); + const promise = audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Media setVolume promise: successful'); - audioManager.getVolume(audioMedia).then(function (data) { - if(data == lowVol){ - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + console.info('Media setVolume promise: successful'); + audioManager.getVolume(AUDIO_MEDIA).then(function (data) { + if(data == LOW_VOL){ + console.info('Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info('Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -197,24 +199,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_002 - * @tc.name : setVolume - Media - Promise - MAX Volume - * @tc.desc : Setvol to 15 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_002 + * @tc.name : setVolume - Media - Promise - MAX Volume + * @tc.desc : Setvol to 15 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_002', 0, async function (done) { - const promise = audioManager.setVolume(audioMedia,maxVol); + const promise = audioManager.setVolume(AUDIO_MEDIA,MAX_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Media setVolume promise: successful'); - audioManager.getVolume(audioMedia).then(function (data) { - if(data == maxVol){ - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + console.info('Media setVolume promise: successful'); + audioManager.getVolume(AUDIO_MEDIA).then(function (data) { + if(data == MAX_VOL){ + console.info('Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info('Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -224,25 +227,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_003 - * @tc.name : setVolume - Media - Promise - Mute Volume - * @tc.desc : Setvol to 0 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_003 + * @tc.name : setVolume - Media - Promise - Mute Volume + * @tc.desc : Setvol to 0 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_003', 0, async function (done) { - const promise = audioManager.setVolume(audioMedia,minVol); + const promise = audioManager.setVolume(AUDIO_MEDIA,MIN_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Media setVolume promise: successful'); + console.info('Media setVolume promise: successful'); - audioManager.getVolume(audioMedia).then(function (data) { - if(data == minVol){ - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + audioManager.getVolume(AUDIO_MEDIA).then(function (data) { + if(data == MIN_VOL){ + console.info('Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info('Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -252,53 +256,55 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_004 - * @tc.name : setVolume - Media - Promise - Out of range Volume - * @tc.desc : Setvol to 28 (More than 15) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_004 + * @tc.name : setVolume - Media - Promise - Out of range Volume + * @tc.desc : Setvol to 28 (More than 15) + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_004', 0, async function (done) { - console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: Setvol 100'); - await audioManager.setVolume(audioMedia,outOfRangeVol).then(() => { - console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: FAIL'); + console.info('Media setVolume Promise:Out of range: Setvol 100'); + await audioManager.setVolume(AUDIO_MEDIA,OUT_OF_RANGE_VOL).then(() => { + console.info('Media setVolume Promise:Out of range: FAIL'); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: PASS :' + err.message); - expect(volErrorMesg).assertEqual(err.message); + console.info('Media setVolume Promise:Out of range: PASS :' + err.message); + expect(VOL_ERROR_MESG).assertEqual(err.message); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_005 - * @tc.name : setVolume - Media - Callback - * @tc.desc : Setvol to 14 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_005 + * @tc.name : setVolume - Media - Callback + * @tc.desc : Setvol to 14 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_005', 0, async function (done) { - audioManager.setVolume(audioMedia,highVol, (err) => { + audioManager.setVolume(AUDIO_MEDIA,HIGH_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else { console.info(`AudioFrameworkTest: callback : Media setVolume successful `); - audioManager.getVolume(audioMedia, (err, value) => { + audioManager.getVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); + console.error(`Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == highVol){ - console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); + else if(value == HIGH_VOL){ + console.info('callback : Media getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); + console.info('callback : Media getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -309,33 +315,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_006 - * @tc.name : setVolume - Media - Callback - MAX Volume - * @tc.desc : Setvol to 15 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_006 + * @tc.name : setVolume - Media - Callback - MAX Volume + * @tc.desc : Setvol to 15 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_006', 0, async function (done) { - audioManager.setVolume(audioMedia,maxVol, (err) => { + audioManager.setVolume(AUDIO_MEDIA,MAX_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else { console.info(`AudioFrameworkTest: callback : Media setVolume successful `); - audioManager.getVolume(audioMedia, (err, value) => { + audioManager.getVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); + console.error(`Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == maxVol){ - console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); + else if(value == MAX_VOL){ + console.info('callback : Media getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); + console.info('callback : Media getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -346,33 +353,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_007 - * @tc.name : setVolume - Media - Callback - Mute Volume - * @tc.desc : Setvol to 0 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_007 + * @tc.name : setVolume - Media - Callback - Mute Volume + * @tc.desc : Setvol to 0 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_007', 0, async function (done) { - audioManager.setVolume(audioMedia,minVol, (err) => { + audioManager.setVolume(AUDIO_MEDIA,MIN_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else { console.info(`AudioFrameworkTest: callback : Media setVolume successful `); - audioManager.getVolume(audioMedia, (err, value) => { + audioManager.getVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); + console.error(`Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == minVol){ - console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); + else if(value == MIN_VOL){ + console.info('callback : Media getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); + console.info('callback : Media getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -383,21 +391,22 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_008 - * @tc.name : setVolume - Media - Callback - Out of range Volume - * @tc.desc : Setvol to 20 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_008 + * @tc.name : setVolume - Media - Callback - Out of range Volume + * @tc.desc : Setvol to 20 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_008', 0, async function (done) { - audioManager.setVolume(audioMedia,outOfRangeVol, (err) => { + audioManager.setVolume(AUDIO_MEDIA,OUT_OF_RANGE_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: setVolume: Out of range: Callback: PASS: ${err.message}`); - expect(volErrorMesg).assertEqual(err.message); + console.error(`setVolume: Out of range: Callback: PASS: ${err.message}`); + expect(VOL_ERROR_MESG).assertEqual(err.message); } else{ - console.info('AudioFrameworkTest: setVolume: callback : Media Out of range: FAIL'); + console.info('setVolume: callback : Media Out of range: FAIL'); expect(false).assertTrue(); } done(); @@ -405,24 +414,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_009 - * @tc.name : setVolume - Ringtone - Promise - * @tc.desc : Setvol to 5 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_009 + * @tc.name : setVolume - Ringtone - Promise + * @tc.desc : Setvol to 5 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_009', 0, async function (done) { - const promise = audioManager.setVolume(audioRingtone,lowVol); + const promise = audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); - audioManager.getVolume(audioRingtone).then(function (data) { - if(data == lowVol){ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); + console.info('Ringtone setVolume promise: successful'); + audioManager.getVolume(AUDIO_RINGTONE).then(function (data) { + if(data == LOW_VOL){ + console.info('Ringtone getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); + console.info('Ringtone getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -432,24 +442,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_010 - * @tc.name : setVolume - Ringtone - Promise - MAX Volume - * @tc.desc : Setvol to 15 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_010 + * @tc.name : setVolume - Ringtone - Promise - MAX Volume + * @tc.desc : Setvol to 15 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_010', 0, async function (done) { - const promise = audioManager.setVolume(audioRingtone,maxVol); + const promise = audioManager.setVolume(AUDIO_RINGTONE,MAX_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); - audioManager.getVolume(audioRingtone).then(function (data) { - if(data == maxVol){ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); + console.info('Ringtone setVolume promise: successful'); + audioManager.getVolume(AUDIO_RINGTONE).then(function (data) { + if(data == MAX_VOL){ + console.info('Ringtone getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); + console.info('Ringtone getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -459,24 +470,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_011 - * @tc.name : setVolume - Ringtone - Promise - Mute Volume - * @tc.desc : Setvol to 0 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_011 + * @tc.name : setVolume - Ringtone - Promise - Mute Volume + * @tc.desc : Setvol to 0 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_011', 0, async function (done) { - const promise = audioManager.setVolume(audioRingtone,minVol); + const promise = audioManager.setVolume(AUDIO_RINGTONE,MIN_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); - audioManager.getVolume(audioRingtone).then(function (data) { - if(data == minVol){ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); + console.info('Ringtone setVolume promise: successful'); + audioManager.getVolume(AUDIO_RINGTONE).then(function (data) { + if(data == MIN_VOL){ + console.info('Ringtone getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); + console.info('Ringtone getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -486,52 +498,54 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_012 - * @tc.name : setVolume - Ringtone - Promise - Out of range Volume - * @tc.desc : Setvol to 30 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_012 + * @tc.name : setVolume - Ringtone - Promise - Out of range Volume + * @tc.desc : Setvol to 30 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_012', 0, async function (done) { - console.info('AudioFrameworkTest: Ringtone setVolume Promise: Out of range: Setvol 30'); - await audioManager.setVolume(audioRingtone,outOfRangeVol).then(() => { - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: FAIL'); + console.info('Ringtone setVolume Promise: Out of range: Setvol 30'); + await audioManager.setVolume(AUDIO_RINGTONE,OUT_OF_RANGE_VOL).then(() => { + console.info('Ringtone setVolume Promise:Out of range: FAIL'); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: PASS :' + (err.message)); - expect(volErrorMesg).assertEqual(err.message); + console.info('Ringtone setVolume Promise:Out of range: PASS :' + (err.message)); + expect(VOL_ERROR_MESG).assertEqual(err.message); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_013 - * @tc.name : setVolume - Ringtone - Callback - * @tc.desc : Setvol to 7 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_013 + * @tc.name : setVolume - Ringtone - Callback + * @tc.desc : Setvol to 7 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_013', 0, async function (done) { - audioManager.setVolume(audioRingtone,highVol, (err) => { + audioManager.setVolume(AUDIO_RINGTONE,HIGH_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); - audioManager.getVolume(audioRingtone, (err, value) => { + audioManager.getVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); + console.error(`Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == highVol){ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); + else if(value == HIGH_VOL){ + console.info('callback : Ringtone getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); + console.info('callback : Ringtone getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -542,33 +556,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_014 - * @tc.name : setVolume - Ringtone - Callback - MAX Volume - * @tc.desc : Setvol to 15 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_014 + * @tc.name : setVolume - Ringtone - Callback - MAX Volume + * @tc.desc : Setvol to 15 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_014', 0, async function (done) { - audioManager.setVolume(audioRingtone,maxVol, (err) => { + audioManager.setVolume(AUDIO_RINGTONE,MAX_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); - audioManager.getVolume(audioRingtone, (err, value) => { + audioManager.getVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); + console.error(`Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == maxVol){ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); + else if(value == MAX_VOL){ + console.info('callback : Ringtone getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); + console.info('callback : Ringtone getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -579,32 +594,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_015 - * @tc.name : setVolume - Ringtone - Callback - Mute Volume - * @tc.desc : Setvol to 0 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_015 + * @tc.name : setVolume - Ringtone - Callback - Mute Volume + * @tc.desc : Setvol to 0 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_015', 0, async function (done) { - audioManager.setVolume(audioRingtone,minVol, (err) => { + audioManager.setVolume(AUDIO_RINGTONE,MIN_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); - audioManager.getVolume(audioRingtone, (err, value) => { + audioManager.getVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); + console.error(`Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == minVol){ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); + else if(value == MIN_VOL){ + console.info('callback : Ringtone getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); + console.info('callback : Ringtone getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -615,21 +631,22 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_016 - * @tc.name : setVolume - Ringtone - Callback - Out of range Volume - * @tc.desc : Setvol to 28 (more than max volume 15) - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_016 + * @tc.name : setVolume - Ringtone - Callback - Out of range Volume + * @tc.desc : Setvol to 28 (more than max volume 15) + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_016', 0, async function (done) { - audioManager.setVolume(audioRingtone,outOfRangeVol, (err) => { + audioManager.setVolume(AUDIO_RINGTONE,OUT_OF_RANGE_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: Out of range Volume: Callback: ${err.message}`); - expect(volErrorMesg).assertEqual(err.message); + console.error(`Out of range Volume: Callback: ${err.message}`); + expect(VOL_ERROR_MESG).assertEqual(err.message); } else{ - console.info('AudioFrameworkTest: Out of range Volume: callback : Ringtone set volume: FAIL'); + console.info('Out of range Volume: callback : Ringtone set volume: FAIL'); expect(false).assertTrue(); } done(); @@ -637,43 +654,45 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_017 - * @tc.name : setVolume - Media - Promise - Negative Value - * @tc.desc : Setvol to -1 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_017 + * @tc.name : setVolume - Media - Promise - Negative Value + * @tc.desc : Setvol to -1 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_017', 0, async function (done) { - console.info('AudioFrameworkTest: Media setVolume promise: Negative Value -1'); - await audioManager.setVolume(audioMedia,-1).then(() => { + console.info('Media setVolume promise: Negative Value -1'); + await audioManager.setVolume(AUDIO_MEDIA,-1).then(() => { // Setting negative audio volume for error Scenario - console.info('AudioFrameworkTest: Media setVolume Promise:Negative: FAIL'); + console.info('Media setVolume Promise:Negative: FAIL'); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Media setVolume Promise:Negative: PASS : ' + (err.message)); - expect(volErrorMesg).assertEqual(err.message); + console.info('Media setVolume Promise:Negative: PASS : ' + (err.message)); + expect(VOL_ERROR_MESG).assertEqual(err.message); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_018 - * @tc.name : setVolume - Media - Callback - Negative Value - * @tc.desc : Setvol to -1 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_018 + * @tc.name : setVolume - Media - Callback - Negative Value + * @tc.desc : Setvol to -1 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_018', 0, async function (done) { - audioManager.setVolume(audioMedia,-1, (err) => { + audioManager.setVolume(AUDIO_MEDIA,-1, (err) => { // Setting negative audio volume for error Scenario if (err) { - console.error(`AudioFrameworkTest: setVolume Callback: Negative: PASS: ${err.message}`); - expect(volErrorMesg).assertEqual(err.message); + console.error(`setVolume Callback: Negative: PASS: ${err.message}`); + expect(VOL_ERROR_MESG).assertEqual(err.message); } else{ - console.info('AudioFrameworkTest: setVolume callback : Media Negative: FAIL'); + console.info('setVolume callback : Media Negative: FAIL'); expect(false).assertTrue(); } done(); @@ -681,43 +700,45 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_019 - * @tc.name : setVolume - Ringtone - Promise - Negative Value - * @tc.desc : Setvol to -1 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_019 + * @tc.name : setVolume - Ringtone - Promise - Negative Value + * @tc.desc : Setvol to -1 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_019', 0, async function (done) { - console.info('AudioFrameworkTest: Ringtone setVolume promise: Negative'); - await audioManager.setVolume(audioRingtone,-1).then(() => { + console.info('Ringtone setVolume promise: Negative'); + await audioManager.setVolume(AUDIO_RINGTONE,-1).then(() => { // Setting negative audio volume for error Scenario - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: FAIL'); + console.info('Ringtone setVolume Promise:Negative: FAIL'); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: PASS :' + (err.message)); - expect(volErrorMesg).assertEqual(err.message); + console.info('Ringtone setVolume Promise:Negative: PASS :' + (err.message)); + expect(VOL_ERROR_MESG).assertEqual(err.message); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_020 - * @tc.name : setVolume - Ringtone - Callback - Negative Value - * @tc.desc : Setvol to -1 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_020 + * @tc.name : setVolume - Ringtone - Callback - Negative Value + * @tc.desc : Setvol to -1 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_020', 0, async function (done) { - audioManager.setVolume(audioRingtone,-1, (err) => { + audioManager.setVolume(AUDIO_RINGTONE,-1, (err) => { // Setting negative audio volume for error Scenario if (err) { console.error(`AudioFrameworkTest:Ringtone setVolume Callback:Negative: PASS : ${err.message}`); - expect(volErrorMesg).assertEqual(err.message); + expect(VOL_ERROR_MESG).assertEqual(err.message); } else{ - console.info('AudioFrameworkTest: setVolume: Negative: callback : Ringtone set volume: FAIL'); + console.info('setVolume: Negative: callback : Ringtone set volume: FAIL'); expect(false).assertTrue(); } done(); @@ -732,16 +753,17 @@ describe('audioManger', function () { * @tc.type : Function * @tc.level : Level 0 */ + it('SUB_AUDIO_MANAGER_SetVolume_021', 0, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol); + const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,LOW_VOL); promise.then(function () { audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) { - if(data == lowVol){ - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data); + if(data == LOW_VOL){ + console.info('Media getVolume Promise: ENAME : PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data); + console.info('Media getVolume Promise: ENAME : FAIL :' + data); expect(false).assertTrue(); } }); @@ -751,32 +773,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_022 - * @tc.name : setVolume - Media - Callback - ENAME - * @tc.desc : Setvol to 14 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_022 + * @tc.name : setVolume - Media - Callback - ENAME + * @tc.desc : Setvol to 14 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_022', 0, async function (done) { - audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => { + audioManager.setVolume(audio.AudioVolumeType.MEDIA,HIGH_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME : ${err.message}`); + console.error(`failed to set volume: Callback: ENAME : ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `); audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: ENAME : Error ${err.message}`); + console.error(`Media: ENAME : Error ${err.message}`); expect(false).assertTrue(); } - else if(value == highVol){ - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value); + else if(value == HIGH_VOL){ + console.info('callback : Media getVolume: ENAME : PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value); + console.info('callback : Media getVolume: ENAME : FAIL :' + value); expect(false).assertTrue(); } done(); @@ -787,24 +810,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_023 - * @tc.name : setVolume - Ringtone - Promise - ENAME - * @tc.desc : Setvol to 14 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_023 + * @tc.name : setVolume - Ringtone - Promise - ENAME + * @tc.desc : Setvol to 14 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_023', 0, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol); + const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,HIGH_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful'); + console.info('Ringtone setVolume promise: ENAME: successful'); audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) { - if(data == highVol){ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data); + if(data == HIGH_VOL){ + console.info('Ringtone getVolume Promise: ENAME: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :' + data); + console.info('Ringtone getVolume Promise: ENAME: FAIL :' + data); expect(false).assertTrue(); } }); @@ -814,32 +838,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_024 - * @tc.name : setVolume - Ringtone - Callback - ENAME - * @tc.desc : Setvol to 5 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_024 + * @tc.name : setVolume - Ringtone - Callback - ENAME + * @tc.desc : Setvol to 5 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_024', 0, async function (done) { - audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => { + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,LOW_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`); + console.error(`failed to set volume: Callback: ENAME: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `); audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`); + console.error(`Ringtone: ENAME: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == lowVol){ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value); + else if(value == LOW_VOL){ + console.info('callback : Ringtone getVolume: ENAME: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value); + console.info('callback : Ringtone getVolume: ENAME: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -857,17 +882,18 @@ describe('audioManger', function () { * @tc.type : Function * @tc.level : Level 0 */ + it('SUB_AUDIO_MANAGER_SetVolume_025', 0, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol); + const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,LOW_VOL); promise.then(function () { - audioManager.setVolume(audio.AudioVolumeType.RINGTONE,maxVol); + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,MAX_VOL); audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) { - if(data == lowVol){ - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data); + if(data == LOW_VOL){ + console.info('Media getVolume Promise: ENAME : PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data); + console.info('Media getVolume Promise: ENAME : FAIL :' + data); expect(false).assertTrue(); } }); @@ -877,33 +903,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_026 - * @tc.name : setVolume - Media - Callback - Change Ringtone vol - * @tc.desc : Setvol to 14 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_026 + * @tc.name : setVolume - Media - Callback - Change Ringtone vol + * @tc.desc : Setvol to 14 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_026', 0, async function (done) { - audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => { + audioManager.setVolume(audio.AudioVolumeType.MEDIA,HIGH_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME : ${err.message}`); + console.error(`failed to set volume: Callback: ENAME : ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `); - audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol); + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,LOW_VOL); audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: ENAME : Error: ${err.message}`); + console.error(`Media: ENAME : Error: ${err.message}`); expect(false).assertTrue(); } - else if(value == highVol){ - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value); + else if(value == HIGH_VOL){ + console.info('callback : Media getVolume: ENAME : PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value); + console.info('callback : Media getVolume: ENAME : FAIL :' + value); expect(false).assertTrue(); } done(); @@ -914,25 +941,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_027 - * @tc.name : setVolume - Ringtone - Promise - Change Media vol - * @tc.desc : Setvol to 14 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_027 + * @tc.name : setVolume - Ringtone - Promise - Change Media vol + * @tc.desc : Setvol to 14 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_027', 0, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol); + const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,HIGH_VOL); promise.then(function () { - console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful'); - audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol); + console.info('Ringtone setVolume promise: ENAME: successful'); + audioManager.setVolume(audio.AudioVolumeType.MEDIA,LOW_VOL); audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) { - if(data == highVol){ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data); + if(data == HIGH_VOL){ + console.info('Ringtone getVolume Promise: ENAME: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :' + data); + console.info('Ringtone getVolume Promise: ENAME: FAIL :' + data); expect(false).assertTrue(); } }); @@ -942,33 +970,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_SetVolume_028 - * @tc.name : setVolume - Ringtone - Callback - Change Media vol - * @tc.desc : Setvol to 5 - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_SetVolume_028 + * @tc.name : setVolume - Ringtone - Callback - Change Media vol + * @tc.desc : Setvol to 5 + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SetVolume_028', 0, async function (done) { - audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => { + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,LOW_VOL, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`); + console.error(`failed to set volume: Callback: ENAME: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `); - audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol); + audioManager.setVolume(audio.AudioVolumeType.MEDIA,HIGH_VOL); audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`); + console.error(`Ringtone: ENAME: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == lowVol){ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value); + else if(value == LOW_VOL){ + console.info('callback : Ringtone getVolume: ENAME: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value); + console.info('callback : Ringtone getVolume: ENAME: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -979,22 +1008,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_001 - * @tc.name : getMaxVolume - Media - Promise - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_001 + * @tc.name : getMaxVolume - Media - Promise + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_001', 0, async function (done) { - const promise = audioManager.getMaxVolume(audioMedia); + const promise = audioManager.getMaxVolume(AUDIO_MEDIA); promise.then(function (data) { - if (data==maxVol){ - console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); + if (data==MAX_VOL){ + console.info('Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); + console.info('Media getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1003,25 +1033,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_002 - * @tc.name : getMaxVolume - Media - Callback - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_002 + * @tc.name : getMaxVolume - Media - Callback + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_002', 0, async function (done) { - audioManager.getMaxVolume(audioMedia, (err, value) => { + audioManager.getMaxVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); + console.error(`Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value=maxVol){ - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); + else if (value=MAX_VOL){ + console.info('callback : Media: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); + console.info('callback : Media: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1029,22 +1060,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_003 - * @tc.name : getMaxVolume - Ringtone - Promise - * @tc.desc : getMaxVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_003 + * @tc.name : getMaxVolume - Ringtone - Promise + * @tc.desc : getMaxVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_003', 0, async function (done) { - const promise = audioManager.getMaxVolume(audioRingtone); + const promise = audioManager.getMaxVolume(AUDIO_RINGTONE); promise.then(function (data) { - if (data==maxVol){ - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); + if (data==MAX_VOL){ + console.info('Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); + console.info('Ringtone getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1053,25 +1085,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_004 - * @tc.name : getMaxVolume - Ringtone - Callback - * @tc.desc : getMaxVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_004 + * @tc.name : getMaxVolume - Ringtone - Callback + * @tc.desc : getMaxVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_004', 0, async function (done) { - audioManager.getMaxVolume(audioRingtone, (err, value) => { + audioManager.getMaxVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value==maxVol){ - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); + else if (value==MAX_VOL){ + console.info('callback : Ringtone: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info('callback : Ringtone: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1079,23 +1112,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_005 - * @tc.name : getMaxVolume - Media - Promise - Change Ringtone Volume and check - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_005 + * @tc.name : getMaxVolume - Media - Promise - Change Ringtone Volume and check + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_005', 0, async function (done) { - audioManager.setVolume(audioRingtone,lowVol); - const promise = audioManager.getMaxVolume(audioMedia); + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + const promise = audioManager.getMaxVolume(AUDIO_MEDIA); promise.then(function (data) { - if (data==maxVol){ - console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); + if (data==MAX_VOL){ + console.info('Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); + console.info('Media getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1104,23 +1138,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_006 - * @tc.name : getMaxVolume - Ringtone - Promise - Change Media Volume and check - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_006 + * @tc.name : getMaxVolume - Ringtone - Promise - Change Media Volume and check + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_006', 0, async function (done) { - audioManager.setVolume(audioMedia,lowVol); - const promise = audioManager.getMaxVolume(audioRingtone); + audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); + const promise = audioManager.getMaxVolume(AUDIO_RINGTONE); promise.then(function (data) { - if (data==maxVol){ - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); + if (data==MAX_VOL){ + console.info('Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); + console.info('Ringtone getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } @@ -1130,27 +1165,28 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_007 - * @tc.name : getMaxVolume - Media - Callback- Change Ringtone Volume and check - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_007 + * @tc.name : getMaxVolume - Media - Callback- Change Ringtone Volume and check + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_007', 0, async function (done) { - audioManager.setVolume(audioRingtone,lowVol); - audioManager.getMaxVolume(audioMedia, (err, value) => { + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + audioManager.getMaxVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); + console.error(`Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value=maxVol){ - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); + else if (value=MAX_VOL){ + console.info('callback : Media: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); + console.info('callback : Media: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1158,26 +1194,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_008 - * @tc.name : getMaxVolume - Ringtone - Callback - Callback- Change media Volume and check - * @tc.desc : getMaxVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_008 + * @tc.name : getMaxVolume - Ringtone - Callback - Callback- Change media Volume and check + * @tc.desc : getMaxVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_008', 0, async function (done) { - audioManager.setVolume(audioMedia,lowVol); - audioManager.getMaxVolume(audioRingtone, (err, value) => { + audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); + audioManager.getMaxVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value==maxVol){ - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); + else if (value==MAX_VOL){ + console.info('callback : Ringtone: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info('callback : Ringtone: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1185,23 +1222,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_009 - * @tc.name : getMaxVolume - Media - Promise - Change media Volume and check - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_009 + * @tc.name : getMaxVolume - Media - Promise - Change media Volume and check + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_009', 0, async function (done) { - audioManager.setVolume(audioMedia,lowVol); - const promise = audioManager.getMaxVolume(audioMedia); + audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); + const promise = audioManager.getMaxVolume(AUDIO_MEDIA); promise.then(function (data) { - if (data==maxVol){ - console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); + if (data==MAX_VOL){ + console.info('Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); + console.info('Media getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1210,23 +1248,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_010 - * @tc.name : getMaxVolume - Ringtone - Promise - Change Ringtone Volume and check - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_010 + * @tc.name : getMaxVolume - Ringtone - Promise - Change Ringtone Volume and check + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_010', 0, async function (done) { - audioManager.setVolume(audioRingtone,lowVol); - const promise = audioManager.getMaxVolume(audioRingtone); + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + const promise = audioManager.getMaxVolume(AUDIO_RINGTONE); promise.then(function (data) { - if (data==maxVol){ - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); + if (data==MAX_VOL){ + console.info('Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); + console.info('Ringtone getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1235,26 +1274,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_011 - * @tc.name : getMaxVolume - Media - Callback- Change media Volume and check - * @tc.desc : getMaxVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_011 + * @tc.name : getMaxVolume - Media - Callback- Change media Volume and check + * @tc.desc : getMaxVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_011', 0, async function (done) { - audioManager.setVolume(audioMedia,highVol); - audioManager.getMaxVolume(audioMedia, (err, value) => { + audioManager.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager.getMaxVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); + console.error(`Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value=maxVol){ - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); + else if (value=MAX_VOL){ + console.info('callback : Media: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); + console.info('callback : Media: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1262,26 +1302,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_012 - * @tc.name : getMaxVolume - Ringtone - Callback - Callback- Change ringtone Volume and check - * @tc.desc : getMaxVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_012 + * @tc.name : getMaxVolume - Ringtone - Callback - Callback- Change ringtone Volume and check + * @tc.desc : getMaxVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMaxVolume_012', 0, async function (done) { - audioManager.setVolume(audioRingtone,highVol); - audioManager.getMaxVolume(audioRingtone, (err, value) => { + audioManager.setVolume(AUDIO_RINGTONE,HIGH_VOL); + audioManager.getMaxVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value==maxVol){ - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); + else if (value==MAX_VOL){ + console.info('callback : Ringtone: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info('callback : Ringtone: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1289,22 +1330,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_001 - * @tc.name : getMinVolume - Media - Promise - * @tc.desc : getMinVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_001 + * @tc.name : getMinVolume - Media - Promise + * @tc.desc : getMinVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_001', 0, async function (done) { - const promise = audioManager.getMinVolume(audioMedia); + const promise = audioManager.getMinVolume(AUDIO_MEDIA); promise.then(function (data) { - if (data==minVol){ - console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); + if (data==MIN_VOL){ + console.info('Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); + console.info('Media getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1313,25 +1355,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_002 - * @tc.name : getMinVolume - Media - Callback - * @tc.desc : getMinVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_002 + * @tc.name : getMinVolume - Media - Callback + * @tc.desc : getMinVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_002', 0, async function (done) { - audioManager.getMinVolume(audioMedia, (err, value) => { + audioManager.getMinVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); + console.error(`Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==minVol){ - console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); + else if (value==MIN_VOL){ + console.info('callback : Media: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); + console.info('callback : Media: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1339,22 +1382,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_003 - * @tc.name : getMinVolume - Ringtone - Promise - * @tc.desc : getMinVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_003 + * @tc.name : getMinVolume - Ringtone - Promise + * @tc.desc : getMinVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_003', 0, async function (done) { - const promise = audioManager.getMinVolume(audioRingtone); + const promise = audioManager.getMinVolume(AUDIO_RINGTONE); promise.then(function (data) { - if (data==minVol){ - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); + if (data==MIN_VOL){ + console.info('Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); + console.info('Ringtone getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } @@ -1364,25 +1408,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_004 - * @tc.name : getMinVolume - Ringtone - Callback - * @tc.desc : getMinVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_004 + * @tc.name : getMinVolume - Ringtone - Callback + * @tc.desc : getMinVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_004', 0, async function (done) { - audioManager.getMinVolume(audioRingtone, (err, value) => { + audioManager.getMinVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); + console.error(`Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==minVol){ - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); + else if (value==MIN_VOL){ + console.info('callback : Ringtone: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info('callback : Ringtone: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1390,23 +1435,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_005 - * @tc.name : getMinVolume - Media - Promise - Change Ringtone Volume and check - * @tc.desc : getMinVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_005 + * @tc.name : getMinVolume - Media - Promise - Change Ringtone Volume and check + * @tc.desc : getMinVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_005', 0, async function (done) { - audioManager.setVolume(audioRingtone,lowVol); - const promise = audioManager.getMinVolume(audioMedia); + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + const promise = audioManager.getMinVolume(AUDIO_MEDIA); promise.then(function (data) { - if (data==minVol){ - console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); + if (data==MIN_VOL){ + console.info('Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); + console.info('Media getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1415,26 +1461,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_006 - * @tc.name : getMinVolume - Media - Callback - Change Ringtone Volume and check - * @tc.desc : getMinVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_006 + * @tc.name : getMinVolume - Media - Callback - Change Ringtone Volume and check + * @tc.desc : getMinVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_006', 0, async function (done) { - audioManager.setVolume(audioRingtone,lowVol); - audioManager.getMinVolume(audioMedia, (err, value) => { + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + audioManager.getMinVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); + console.error(`Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==minVol){ - console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); + else if (value==MIN_VOL){ + console.info('callback : Media: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); + console.info('callback : Media: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1442,23 +1489,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_007 - * @tc.name : getMinVolume - Ringtone - Promise - Change Media Volume and check - * @tc.desc : getMinVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_007 + * @tc.name : getMinVolume - Ringtone - Promise - Change Media Volume and check + * @tc.desc : getMinVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_007', 0, async function (done) { - audioManager.setVolume(audioMedia,highVol); - const promise = audioManager.getMinVolume(audioRingtone); + audioManager.setVolume(AUDIO_MEDIA,HIGH_VOL); + const promise = audioManager.getMinVolume(AUDIO_RINGTONE); promise.then(function (data) { - if (data==minVol){ - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); + if (data==MIN_VOL){ + console.info('Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); + console.info('Ringtone getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1467,26 +1515,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_008 - * @tc.name : getMinVolume - Ringtone - Callback - Change Media Volume and check - * @tc.desc : getMinVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_008 + * @tc.name : getMinVolume - Ringtone - Callback - Change Media Volume and check + * @tc.desc : getMinVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_008', 0, async function (done) { - audioManager.setVolume(audioMedia,lowVol); - audioManager.getMinVolume(audioRingtone, (err, value) => { + audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); + audioManager.getMinVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); + console.error(`Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==minVol){ - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); + else if (value==MIN_VOL){ + console.info('callback : Ringtone: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info('callback : Ringtone: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1494,23 +1543,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_009 - * @tc.name : getMinVolume - Media - Promise - Change Media Volume and check - * @tc.desc : getMinVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_009 + * @tc.name : getMinVolume - Media - Promise - Change Media Volume and check + * @tc.desc : getMinVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_009', 0, async function (done) { - audioManager.setVolume(audioMedia,lowVol); - const promise = audioManager.getMinVolume(audioMedia); + audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); + const promise = audioManager.getMinVolume(AUDIO_MEDIA); promise.then(function (data) { - if (data==minVol){ - console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); + if (data==MIN_VOL){ + console.info('Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); + console.info('Media getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1519,26 +1569,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_010 - * @tc.name : getMinVolume - Media - Callback - Change Media Volume and check - * @tc.desc : getMinVolume for Media - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_010 + * @tc.name : getMinVolume - Media - Callback - Change Media Volume and check + * @tc.desc : getMinVolume for Media + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_010', 0, async function (done) { - audioManager.setVolume(audioMedia,highVol); - audioManager.getMinVolume(audioMedia, (err, value) => { + audioManager.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager.getMinVolume(AUDIO_MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); + console.error(`Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==minVol){ - console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); + else if (value==MIN_VOL){ + console.info('callback : Media: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); + console.info('callback : Media: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1546,23 +1597,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_011 - * @tc.name : getMinVolume - Ringtone - Promise - Change Ringtone Volume and check - * @tc.desc : getMinVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_011 + * @tc.name : getMinVolume - Ringtone - Promise - Change Ringtone Volume and check + * @tc.desc : getMinVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_011', 0, async function (done) { - audioManager.setVolume(audioRingtone,lowVol); - const promise = audioManager.getMinVolume(audioRingtone) + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + const promise = audioManager.getMinVolume(AUDIO_RINGTONE) promise.then(function (data) { - if (data==minVol){ - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); + if (data==MIN_VOL){ + console.info('Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); + console.info('Ringtone getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1571,26 +1623,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_012 - * @tc.name : getMinVolume - Ringtone - Callback - Change Ringtone Volume and check - * @tc.desc : getMinVolume for Ringtone - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getMinVolume_012 + * @tc.name : getMinVolume - Ringtone - Callback - Change Ringtone Volume and check + * @tc.desc : getMinVolume for Ringtone + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getMinVolume_012', 0, async function (done) { - audioManager.setVolume(audioRingtone,lowVol); - audioManager.getMinVolume(audioRingtone, (err, value) => { + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + audioManager.getMinVolume(AUDIO_RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); + console.error(`Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==minVol){ - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); + else if (value==MIN_VOL){ + console.info('callback : Ringtone: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info('callback : Ringtone: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1598,27 +1651,28 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_001 - * @tc.name : getDevices - Output device - Promise - * @tc.desc : getDevices - Output device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_001 + * @tc.name : getDevices - Output device - Promise + * @tc.desc : getDevices - Output device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_001', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; const promise = audioManager.getDevices(1); // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG promise.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info('Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1627,28 +1681,29 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_002 - * @tc.name : getDevices - Input device - Promise - * @tc.desc : getDevices - Input device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_002 + * @tc.name : getDevices - Input device - Promise + * @tc.desc : getDevices - Input device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_002', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; const promise = audioManager.getDevices(2); // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG promise.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); + console.info('Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info('Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1657,29 +1712,30 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_003 - * @tc.name : getDevices - ALL device - Promise - * @tc.desc : getDevices - ALL device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_003 + * @tc.name : getDevices - ALL device - Promise + * @tc.desc : getDevices - ALL device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_003', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; const promise = audioManager.getDevices(3); // Getting all devies connected 3 = ALL_DEVICES_FLAG promise.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); + console.info('Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Promise: getDevices : ALL_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info('Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1687,34 +1743,35 @@ describe('audioManger', function () { done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_004 - * @tc.name : getDevices - Output device - Callback - * @tc.desc : getDevices - Output device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_004 + * @tc.name : getDevices - Output device - Callback + * @tc.desc : getDevices - Output device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_004', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; audioManager.getDevices(1, (err, value) => { // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); if (err) { - console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } } @@ -1723,35 +1780,36 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_005 - * @tc.name : getDevices - Input device - Callback - * @tc.desc : getDevices - Input device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_005 + * @tc.name : getDevices - Input device - Callback + * @tc.desc : getDevices - Input device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_005', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; audioManager.getDevices(2, (err, value) => { // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('Callback: getDevices INPUT_DEVICES_FLAG'); if (err) { - console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('Callback: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info('Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -1760,35 +1818,36 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_006 - * @tc.name : getDevices - ALL device - Callback - * @tc.desc : getDevices - ALL device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_006 + * @tc.name : getDevices - ALL device - Callback + * @tc.desc : getDevices - ALL device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_006', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; audioManager.getDevices(3, (err, value) => { // Getting all devies connected 3 = ALL_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info('Callback: getDevices ALL_DEVICES_FLAG'); if (err) { - console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info('Callback: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Callback: getDevices : ALL_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info('Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -1797,27 +1856,28 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_007 - * @tc.name : getDevices - Output device - Promise - ENAME - * @tc.desc : getDevices - Output device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_007 + * @tc.name : getDevices - Output device - Promise - ENAME + * @tc.desc : getDevices - Output device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_007', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; const promise = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) promise.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info('Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1826,27 +1886,28 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_008 - * @tc.name : getDevices - Input device - Promise - ENAME - * @tc.desc : getDevices - Input device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_008 + * @tc.name : getDevices - Input device - Promise - ENAME + * @tc.desc : getDevices - Input device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_008', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; const promise = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); promise.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); + console.info('Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info('Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1855,27 +1916,28 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_009 - * @tc.name : getDevices - ALL device - Promise - ENAME - * @tc.desc : getDevices - ALL device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_009 + * @tc.name : getDevices - ALL device - Promise - ENAME + * @tc.desc : getDevices - ALL device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_009', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; const promise = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); promise.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); + console.info('Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Promise: getDevices : ALL_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info('Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1884,31 +1946,32 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_010 - * @tc.name : getDevices - Output device - Callback - ENAME - * @tc.desc : getDevices - Output device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_010 + * @tc.name : getDevices - Output device - Callback - ENAME + * @tc.desc : getDevices - Output device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_010', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); if (err) { - console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } } @@ -1917,32 +1980,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_011 - * @tc.name : getDevices - Input device - Callback - ENAME - * @tc.desc : getDevices - Input device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_011 + * @tc.name : getDevices - Input device - Callback - ENAME + * @tc.desc : getDevices - Input device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_011', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('Callback: getDevices INPUT_DEVICES_FLAG'); if (err) { - console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('Callback: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info('Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -1951,31 +2015,32 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getDevices_012 - * @tc.name : getDevices - ALL device - Callback - ENAME - * @tc.desc : getDevices - ALL device - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getDevices_012 + * @tc.name : getDevices - ALL device - Callback - ENAME + * @tc.desc : getDevices - ALL device + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getDevices_012', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; + DEVICE_ROLE_VALUE = null; + DEVICE_TYPE_VALUE = null; audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info('Callback: getDevices ALL_DEVICES_FLAG'); if (err) { - console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info('Callback: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (deviceTypeValue != null && deviceRoleValue != null){ - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ + console.info('Callback: getDevices : ALL_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info('Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -1984,25 +2049,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_001 - * @tc.name : setRingerMode - Normal Mode - Promise - * @tc.desc : setRingerMode - Set Ring more to Normal Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_001 + * @tc.name : setRingerMode - Normal Mode - Promise + * @tc.desc : setRingerMode - Set Ring more to Normal Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_001', 0, async function (done) { const promise = audioManager.setRingerMode(2); // Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL promise.then(function () { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL'); + console.info('Promise: setRingerMode RINGER_MODE_NORMAL'); audioManager.getRingerMode().then(function (value){ if(value==2){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2012,25 +2078,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_002 - * @tc.name : setRingerMode - Silent Mode - Promise - * @tc.desc : setRingerMode - Set Ring more to Silent Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_002 + * @tc.name : setRingerMode - Silent Mode - Promise + * @tc.desc : setRingerMode - Set Ring more to Silent Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_002', 0, async function (done) { const promise = audioManager.setRingerMode(0); // Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT promise.then(function (){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT'); + console.info('Promise: setRingerMode RINGER_MODE_SILENT'); audioManager.getRingerMode().then(function (value){ if(value==0){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2040,25 +2107,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_003 - * @tc.name : setRingerMode - Vibration Mode - Promise - * @tc.desc : setRingerMode - Set Ring more to Vibration Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_003 + * @tc.name : setRingerMode - Vibration Mode - Promise + * @tc.desc : setRingerMode - Set Ring more to Vibration Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_003', 0, async function (done) { const promise = audioManager.setRingerMode(1); // Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE promise.then(function (){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE'); + console.info('Promise: setRingerMode RINGER_MODE_VIBRATE'); audioManager.getRingerMode().then(function (value){ if(value==1){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2068,33 +2136,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_004 - * @tc.name : setRingerMode - Normal Mode - Callback - * @tc.desc : setRingerMode - Set Ring more to Normal Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_004 + * @tc.name : setRingerMode - Normal Mode - Callback + * @tc.desc : setRingerMode - Set Ring more to Normal Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_004', 0, async function (done) { audioManager.setRingerMode(2, (err) => { // Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL'); + console.info('Callback : setRingerMode RINGER_MODE_NORMAL'); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else{ audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else if(value==2){ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2105,34 +2174,35 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_005 - * @tc.name : setRingerMode - Silent Mode - Callback - * @tc.desc : setRingerMode - Set Ring more to Silent Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_005 + * @tc.name : setRingerMode - Silent Mode - Callback + * @tc.desc : setRingerMode - Set Ring more to Silent Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_005', 0, async function (done) { audioManager.setRingerMode(0, (err) => { // Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT'); + console.info('Callback : setRingerMode RINGER_MODE_SILENT'); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } else{ audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } if(value==0){ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2143,34 +2213,35 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_006 - * @tc.name : setRingerMode - Vibration Mode - Callback - * @tc.desc : setRingerMode - Set Ring more to Vibration Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_006 + * @tc.name : setRingerMode - Vibration Mode - Callback + * @tc.desc : setRingerMode - Set Ring more to Vibration Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_006', 0, async function (done) { audioManager.setRingerMode(1, (err) => { // Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE'); + console.info('Callback : setRingerMode RINGER_MODE_VIBRATE'); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } if(value==1){ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2181,24 +2252,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_007 - * @tc.name : setRingerMode - Normal Mode - Promise - ENAME - * @tc.desc : setRingerMode - Set Ring more to Normal Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_007 + * @tc.name : setRingerMode - Normal Mode - Promise - ENAME + * @tc.desc : setRingerMode - Set Ring more to Normal Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_007', 0, async function (done) { const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL); promise.then(function () { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL'); + console.info('Promise: setRingerMode RINGER_MODE_NORMAL'); audioManager.getRingerMode().then(function (value){ if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2208,24 +2280,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_008 - * @tc.name : setRingerMode - Silent Mode - Promise - ENAME - * @tc.desc : setRingerMode - Set Ring more to Silent Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_008 + * @tc.name : setRingerMode - Silent Mode - Promise - ENAME + * @tc.desc : setRingerMode - Set Ring more to Silent Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_008', 0, async function (done) { const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT); promise.then(function (){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT'); + console.info('Promise: setRingerMode RINGER_MODE_SILENT'); audioManager.getRingerMode().then(function (value){ if(value==audio.AudioRingMode.RINGER_MODE_SILENT){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2235,24 +2308,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_009 - * @tc.name : setRingerMode - Vibration Mode - Promise - NAME - * @tc.desc : setRingerMode - Set Ring more to Vibration Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_009 + * @tc.name : setRingerMode - Vibration Mode - Promise - NAME + * @tc.desc : setRingerMode - Set Ring more to Vibration Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_009', 0, async function (done) { const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE); promise.then(function (){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE'); + console.info('Promise: setRingerMode RINGER_MODE_VIBRATE'); audioManager.getRingerMode().then(function (value){ if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2262,32 +2336,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_010 - * @tc.name : setRingerMode - Normal Mode - Callback - ENAME - * @tc.desc : setRingerMode - Set Ring more to Normal Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_010 + * @tc.name : setRingerMode - Normal Mode - Callback - ENAME + * @tc.desc : setRingerMode - Set Ring more to Normal Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_010', 0, async function (done) { audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL, (err) => { - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL'); + console.info('Callback : setRingerMode RINGER_MODE_NORMAL'); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2298,33 +2373,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_0011 - * @tc.name : setRingerMode - Silent Mode - Callback - ENAME - * @tc.desc : setRingerMode - Set Ring more to Silent Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_0011 + * @tc.name : setRingerMode - Silent Mode - Callback - ENAME + * @tc.desc : setRingerMode - Set Ring more to Silent Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_011', 0, async function (done) { audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT, (err) => { - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT'); + console.info('Callback : setRingerMode RINGER_MODE_SILENT'); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } if(value==audio.AudioRingMode.RINGER_MODE_SILENT){ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2335,33 +2411,34 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_012 - * @tc.name : setRingerMode - Vibration Mode - Callback - * @tc.desc : setRingerMode - Set Ring more to Vibration Mode - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setRingerMode_012 + * @tc.name : setRingerMode - Vibration Mode - Callback + * @tc.desc : setRingerMode - Set Ring more to Vibration Mode + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setRingerMode_012', 0, async function (done) { audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE, (err, value) => { - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE'); + console.info('Callback : setRingerMode RINGER_MODE_VIBRATE'); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2372,32 +2449,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_006 - * @tc.name : mute - Media - callback - * @tc.desc : mute - Media - callback - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_006 + * @tc.name : mute - Media - callback + * @tc.desc : mute - Media - callback - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_006', 0, async function (done) { - audioManager.mute(audioMedia,false, (err) => { + audioManager.mute(AUDIO_MEDIA,false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : FALSE'); - audioManager.isMute(audioMedia, (err, data) => { + console.log('Set Stream Mute: Media: Callback : FALSE'); + audioManager.isMute(AUDIO_MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); + console.error(`FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: '+data); + console.log('Callback : Is Stream Mute Media: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: '+data); + console.log('Callback : Is Stream Mute Media: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2408,60 +2486,62 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_005 - * @tc.name : mute - Media - Promise - * @tc.desc : mute - Media - Promise - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_005 + * @tc.name : mute - Media - Promise + * @tc.desc : mute - Media - Promise - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_005', 0, async function (done) { - await audioManager.mute(audioMedia,false).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: FALSE'); - audioManager.isMute(audioMedia).then(function (data) { + await audioManager.mute(AUDIO_MEDIA,false).then(function () { + console.log('Set Stream Mute: Media: Promise: FALSE'); + audioManager.isMute(AUDIO_MEDIA).then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:'+data); + console.log('Promise: Is Stream Mute Media: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: FAIL: '+data); + console.log('Promise: Is Stream Mute Media: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: ERROR:' + err.message); + console.info('Promise: Is Stream Mute Media: FALSE: ERROR:' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_008 - * @tc.name : mute - Ringtone - callback - * @tc.desc : mute - Ringtone - callback - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_008 + * @tc.name : mute - Ringtone - callback + * @tc.desc : mute - Ringtone - callback - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_008', 0, async function (done) { - audioManager.mute(audioRingtone,false, (err) => { + audioManager.mute(AUDIO_RINGTONE,false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : FALSE'); - audioManager.isMute(audioRingtone, (err, data) => { + console.log('Set Stream Mute: Ringtone: Callback : FALSE'); + audioManager.isMute(AUDIO_RINGTONE, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : failed to get Mute Status ${err.message}`); + console.error(`FALSE: Ringtone : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: PASS: '+data); + console.log('Callback : Is Stream Mute Ringtone: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: FAIL: '+data); + console.log('Callback : Is Stream Mute Ringtone: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2472,60 +2552,62 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_007 - * @tc.name : mute - Ringtone - Promise - * @tc.desc : mute - Ringtone - Promise - disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_007 + * @tc.name : mute - Ringtone - Promise + * @tc.desc : mute - Ringtone - Promise - disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_007', 0, async function (done) { - await audioManager.mute(audioRingtone,false).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: FALSE'); - audioManager.isMute(audioRingtone).then(function (data) { + await audioManager.mute(AUDIO_RINGTONE,false).then(function () { + console.log('Set Stream Mute: Ringtone: Promise: FALSE'); + audioManager.isMute(AUDIO_RINGTONE).then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: PASS:'+data); + console.log('Promise: Is Stream Mute Ringtone: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: FAIL: '+data); + console.log('Promise: Is Stream Mute Ringtone: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Rington: FALSE: ERROR:' + err.message); + console.info('Promise: Is Stream Mute Rington: FALSE: ERROR:' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_015 - * @tc.name : mute - Media - callback - ENAME - * @tc.desc : mute - Media - callback - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_015 + * @tc.name : mute - Media - callback - ENAME + * @tc.desc : mute - Media - callback - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_015', 0, async function (done) { audioManager.mute(audio.AudioVolumeType.MEDIA,false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`Set Stream Mute: Media: Callback: Error : ${err.message}`); expect().assertFail(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Callback : FALSE'); + console.log('Set Stream Mute: Media: ENAME: Callback : FALSE'); audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Media : ENAME: failed to get Mute Status ${err.message}`); + console.error(`FALSE: Media : ENAME: failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: PASS: '+data); + console.log('Callback : Is Stream Mute Media: ENAME: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); + console.log('Callback : Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2536,60 +2618,62 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_011 - * @tc.name : mute - Media - Promise - ENAME - * @tc.desc : mute - Media - Promise - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_011 + * @tc.name : mute - Media - Promise - ENAME + * @tc.desc : mute - Media - Promise - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_011', 0, async function (done) { await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE'); + console.log('Set Stream Mute: Media: ENAME: Promise: FALSE'); audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); + console.log('Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); + console.log('Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); + console.info('Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_016 - * @tc.name : mute - Ringtone - callback - ENAME - * @tc.desc : mute - Ringtone - callback - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_016 + * @tc.name : mute - Ringtone - callback - ENAME + * @tc.desc : mute - Ringtone - callback - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_016', 0, async function (done) { audioManager.mute(audio.AudioVolumeType.RINGTONE,false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`Set Stream Mute: Media: Callback: Error : ${err.message}`); expect().assertFail(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: ENAME: Callback : FALSE'); + console.log('Set Stream Mute: Ringtone: ENAME: Callback : FALSE'); audioManager.isMute(audio.AudioVolumeType.RINGTONE, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : ENAME: failed to get Mute Status ${err.message}`); + console.error(`FALSE: Ringtone : ENAME: failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: '+data); + console.log('Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: FAIL: '+data); + console.log('Callback : Is Stream Mute Ringtone: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2600,90 +2684,93 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_014 - * @tc.name : mute - Media - Promise - ENAME: - * @tc.desc : mute - Media - Promise - Disable mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_014 + * @tc.name : mute - Media - Promise - ENAME: + * @tc.desc : mute - Media - Promise - Disable mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_014', 0, async function (done) { await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE'); + console.log('Set Stream Mute: Media: ENAME: Promise: FALSE'); audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); + console.log('Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); + console.log('Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); + console.info('Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_017 - * @tc.name : mute - Media - Promise - SetVolume - * @tc.desc : mute - Media - Promise - Enable mute -SetVolume - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_017 + * @tc.name : mute - Media - Promise - SetVolume + * @tc.desc : mute - Media - Promise - Enable mute -SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_017', 0, async function (done) { - await audioManager.mute(audioMedia,true).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: TRUE'); - audioManager.setVolume(audioMedia,lowVol); - audioManager.isMute(audioMedia).then(function (data) { + await audioManager.mute(AUDIO_MEDIA,true).then(function () { + console.log('Set Stream Mute: Media: Promise: TRUE'); + audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); + audioManager.isMute(AUDIO_MEDIA).then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: PASS:'+data); + console.log('Promise: Is Stream Mute Media: SetVolume: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: FAIL: '+data); + console.log('Promise: Is Stream Mute Media: SetVolume: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: ERROR:' + err.message); + console.info('Promise: Is Stream Mute Media: SetVolume: ERROR:' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_018 - * @tc.name : mute - Media - callback - SetVolume - * @tc.desc : mute - Media - callback - Enable mute - SetVolume - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_018 + * @tc.name : mute - Media - callback - SetVolume + * @tc.desc : mute - Media - callback - Enable mute - SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_018', 0, async function (done) { - audioManager.mute(audioMedia,true, (err) => { + audioManager.mute(AUDIO_MEDIA,true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`); + console.error(`SetVolume: Media : failed to set Mute Status ${err.message}`); expect().assertFail(); } else{ - console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : TRUE'); - audioManager.setVolume(audioMedia,highVol); - audioManager.isMute(audioMedia, (err, data) => { + console.log('Set Stream Mute: Media: Callback : TRUE'); + audioManager.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager.isMute(AUDIO_MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to get Mute Status ${err.message}`); + console.error(`SetVolume: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: PASS: '+data); + console.log('Callback : Is Stream Mute Media: SetVolume: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: FAIL: '+data); + console.log('Callback : Is Stream Mute Media: SetVolume: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2694,62 +2781,64 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_019 - * @tc.name : mute - Ringtone - Promise - SetVolume - * @tc.desc : mute - Ringtone - Promise - Enable mute - SetVolume - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_019 + * @tc.name : mute - Ringtone - Promise - SetVolume + * @tc.desc : mute - Ringtone - Promise - Enable mute - SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_019', 0, async function (done) { - await audioManager.mute(audioRingtone,true).then(function () { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: SetVolume'); - audioManager.setVolume(audioRingtone,highVol); - audioManager.isMute(audioRingtone).then(function (data) { + await audioManager.mute(AUDIO_RINGTONE,true).then(function () { + console.log('Set Stream Mute: Ringtone: Promise: SetVolume'); + audioManager.setVolume(AUDIO_RINGTONE,HIGH_VOL); + audioManager.isMute(AUDIO_RINGTONE).then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: PASS:'+data); + console.log('Promise: Is Stream Mute Ringtone: SetVolume: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: FAIL: '+data); + console.log('Promise: Is Stream Mute Ringtone: SetVolume: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: ERROR:' + err.message); + console.info('Promise: Is Stream Mute Ringtone: SetVolume: ERROR:' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_mute_020 - * @tc.name : mute - Ringtone - callback - SetVolume - * @tc.desc : mute - Ringtone - callback - Enable mute - SetVolume - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_mute_020 + * @tc.name : mute - Ringtone - callback - SetVolume + * @tc.desc : mute - Ringtone - callback - Enable mute - SetVolume + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_mute_020', 0, async function (done) { - audioManager.mute(audioRingtone,true, (err) => { + audioManager.mute(AUDIO_RINGTONE,true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`); + console.error(`SetVolume: Ringtone : failed to set Mute Status ${err.message}`); expect().assertFail(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : SetVolume'); - audioManager.setVolume(audioRingtone,lowVol); - audioManager.isMute(audioRingtone, (err, data) => { + console.log('Set Stream Mute: Ringtone: Callback : SetVolume'); + audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); + audioManager.isMute(AUDIO_RINGTONE, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to get Mute Status ${err.message}`); + console.error(`SetVolume: Ringtone : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: PASS: '+data); + console.log('Callback : Is Stream Mute Ringtone: SetVolume: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: FAIL: '+data); + console.log('Callback : Is Stream Mute Ringtone: SetVolume: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2760,23 +2849,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_005 - * @tc.name : isActive - Media - Promise - * @tc.desc : isActive - Media - Promise - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_005 + * @tc.name : isActive - Media - Promise + * @tc.desc : isActive - Media - Promise - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_005', 0, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(audioMedia); + console.log('Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + const promise = audioManager.isActive(AUDIO_MEDIA); promise.then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: PASS:'+data); + console.log('Promise: isActive: Media: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: FAIL: '+data); + console.log('Promise: isActive: Media: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -2785,26 +2875,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_006 - * @tc.name : isActive - Media - Callback - * @tc.desc : isActive - Media - Callback - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_006 + * @tc.name : isActive - Media - Callback + * @tc.desc : isActive - Media - Callback - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_006', 0, async function (done) { - console.log('AudioFrameworkTest: Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - audioManager.isActive(audioMedia, (err, data) => { + console.log('Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + audioManager.isActive(AUDIO_MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Media : isActive: failed ${err.message}`); + console.error(`Media : isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: PASS:'+data); + console.log('Callback: isActive: Media: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: FAIL: '+data); + console.log('Callback: isActive: Media: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2812,23 +2903,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_007 - * @tc.name : isActive - Ringtone - Promise - * @tc.desc : isActive - Ringtone - Promise - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_007 + * @tc.name : isActive - Ringtone - Promise + * @tc.desc : isActive - Ringtone - Promise - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_007', 0, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(audioRingtone); + console.log('Promise : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + const promise = audioManager.isActive(AUDIO_RINGTONE); promise.then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: PASS:'+data); + console.log('Promise: isActive: Ringtone: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: FAIL: '+data); + console.log('Promise: isActive: Ringtone: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -2837,26 +2929,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_008 - * @tc.name : isActive - Ringtone - Callback - * @tc.desc : isActive - Ringtone - Callback - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_008 + * @tc.name : isActive - Ringtone - Callback + * @tc.desc : isActive - Ringtone - Callback - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_008', 0, async function (done) { - console.log('AudioFrameworkTest: Callback : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - audioManager.isActive(audioRingtone, (err, data) => { + console.log('Callback : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + audioManager.isActive(AUDIO_RINGTONE, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Ringtone : isActive: failed ${err.message}`); + console.error(`Ringtone : isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: PASS:'+data); + console.log('Callback: isActive: Ringtone: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: FAIL: '+data); + console.log('Callback: isActive: Ringtone: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2864,23 +2957,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_013 - * @tc.name : isActive - Media - Promise - ENAME: - * @tc.desc : isActive - Media - Promise - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_013 + * @tc.name : isActive - Media - Promise - ENAME: + * @tc.desc : isActive - Media - Promise - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_013', 0, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('Promise : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); const promise = audioManager.isActive(audio.AudioVolumeType.MEDIA); promise.then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: PASS:'+data); + console.log('Promise: isActive: Media: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: FAIL: '+data); + console.log('Promise: isActive: Media: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -2889,26 +2983,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_014 - * @tc.name : isActive - Media - Callback - ENAME - * @tc.desc : isActive - Media - Callback - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_014 + * @tc.name : isActive - Media - Callback - ENAME + * @tc.desc : isActive - Media - Callback - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_014', 0, async function (done) { - console.log('AudioFrameworkTest: Callback : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('Callback : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); audioManager.isActive(audio.AudioVolumeType.MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Media : ENAME: isActive: failed ${err.message}`); + console.error(`Media : ENAME: isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: PASS:'+data); + console.log('Callback: isActive: Media: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: FAIL: '+data); + console.log('Callback: isActive: Media: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2916,23 +3011,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_015 - * @tc.name : isActive - Ringtone - Promise - ENAME - * @tc.desc : isActive - Ringtone - Promise - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_015 + * @tc.name : isActive - Ringtone - Promise - ENAME + * @tc.desc : isActive - Ringtone - Promise - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_015', 0, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('Promise : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); const promise = audioManager.isActive(audio.AudioVolumeType.RINGTONE); promise.then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: PASS:'+data); + console.log('Promise: isActive: Ringtone: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); + console.log('Promise: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -2941,26 +3037,27 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_isActive_016 - * @tc.name : isActive - Ringtone - Callback - ENAME - * @tc.desc : isActive - Ringtone - Callback - When stream is NOT playing - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_isActive_016 + * @tc.name : isActive - Ringtone - Callback - ENAME + * @tc.desc : isActive - Ringtone - Callback - When stream is NOT playing + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_isActive_016', 0, async function (done) { - console.log('AudioFrameworkTest: Callback : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('Callback : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); audioManager.isActive(audio.AudioVolumeType.RINGTONE, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Ringtone : ENAME: isActive: failed ${err.message}`); + console.error(`Ringtone : ENAME: isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: PASS:'+data); + console.log('Callback: isActive: Ringtone: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); + console.log('Callback: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2968,88 +3065,91 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_001 - * @tc.name : setMicrophoneMute - true - Promise - * @tc.desc : Enable mic mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_001 + * @tc.name : setMicrophoneMute - true - Promise + * @tc.desc : Enable mic mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setMicrophoneMute_001', 0, async function (done) { await audioManager.setMicrophoneMute(true).then(function () { - console.log('AudioFrameworkTest: setMicrophoneMute: Promise: TRUE'); + console.log('setMicrophoneMute: Promise: TRUE'); audioManager.isMicrophoneMute().then(function (data) { if(data==true){ - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: PASS:'+data); + console.log('Promise: isMicrophoneMute: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: FAIL: '+data); + console.log('Promise: isMicrophoneMute: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: setMicrophoneMute: TRUE: FAIL: Error :' + err.message); + console.info('Promise: setMicrophoneMute: TRUE: FAIL: Error :' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_002 - * @tc.name : setMicrophoneMute - false - Promise - * @tc.desc : Disable mic mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_002 + * @tc.name : setMicrophoneMute - false - Promise + * @tc.desc : Disable mic mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setMicrophoneMute_002', 0, async function (done) { await audioManager.setMicrophoneMute(false).then(function () { - console.log('AudioFrameworkTest: setMicrophoneMute: Promise: FALSE'); + console.log('setMicrophoneMute: Promise: FALSE'); audioManager.isMicrophoneMute().then(function (data) { if(data==false){ - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: PASS:'+data); + console.log('Promise: isMicrophoneMute: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: FAIL: '+data); + console.log('Promise: isMicrophoneMute: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Promise: setMicrophoneMute: FALSE: FAIL: Error :' + err.message); + console.info('Promise: setMicrophoneMute: FALSE: FAIL: Error :' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_003 - * @tc.name : setMicrophoneMute - true - Callback - * @tc.desc : Enable mic mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_003 + * @tc.name : setMicrophoneMute - true - Callback + * @tc.desc : Enable mic mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setMicrophoneMute_003', 0, async function (done) { audioManager.setMicrophoneMute(true, (err) => { if (err) { - console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : TRUE: Error : ${err.message}`); + console.error(`setMicrophoneMute: Callback : TRUE: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: setMicrophoneMute: Callback : TRUE'); + console.log('setMicrophoneMute: Callback : TRUE'); audioManager.isMicrophoneMute((err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : TRUE: isMicrophoneMute : Error ${err.message}`); + console.error(`TRUE: isMicrophoneMute : Error ${err.message}`); expect(false).assertTrue(); } else if(data==true){ - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: PASS: '+data); + console.log('Callback : isMicrophoneMute: TRUE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: FAIL: '+data); + console.log('Callback : isMicrophoneMute: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -3060,32 +3160,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_004 - * @tc.name : setMicrophoneMute - false - Callback - * @tc.desc : Disable mic mute - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_004 + * @tc.name : setMicrophoneMute - false - Callback + * @tc.desc : Disable mic mute + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setMicrophoneMute_004', 0, async function (done) { audioManager.setMicrophoneMute(false, (err) => { if (err) { - console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : FALSE: Error : ${err.message}`); + console.error(`setMicrophoneMute: Callback : FALSE: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('AudioFrameworkTest: setMicrophoneMute: Callback : FALSE'); + console.log('setMicrophoneMute: Callback : FALSE'); audioManager.isMicrophoneMute((err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: isMicrophoneMute : Error ${err.message}`); + console.error(`FALSE: isMicrophoneMute : Error ${err.message}`); expect(false).assertTrue(); } else if(data==false){ - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: PASS: '+data); + console.log('Callback : isMicrophoneMute: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: FAIL: '+data); + console.log('Callback : isMicrophoneMute: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -3096,146 +3197,151 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_001 - * @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Promise - * @tc.desc : Activate BLUETOOTH_SCO - Promise - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_001 + * @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Promise + * @tc.desc : Activate BLUETOOTH_SCO - Promise + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_001', 0, async function (done) { await audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO,true).then(function (){ - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate'); + console.info('Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate'); audioManager.isDeviceActive(7).then(function (value){ if(value==true){ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :' +value); + console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :' +value); + console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL : Error :' + err.message); + console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL : Error :' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_002 - * @tc.name : setDeviceActive - SPEAKER - deactivate - Promise - * @tc.desc : Deactivate speaker - Promise - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_002 + * @tc.name : setDeviceActive - SPEAKER - deactivate - Promise + * @tc.desc : Deactivate speaker - Promise + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_002', 0, async function (done) { await audioManager.setDeviceActive(2,false).then(function (){ // Setting device active ENUM 2 = SPEAKER - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate'); + console.info('Device Test: Promise : setDeviceActive : SPEAKER: Deactivate'); audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value){ if(value==false){ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); + console.info('Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); + console.info('Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message); + console.info('Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_003 - * @tc.name : setDeviceActive - SPEAKER - Activate - Promise - * @tc.desc : Activate speaker - Promise - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_003 + * @tc.name : setDeviceActive - SPEAKER - Activate - Promise + * @tc.desc : Activate speaker - Promise + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_003', 0, async function (done) { await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER,true).then(function (){ - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate'); + console.info('Device Test: Promise : setDeviceActive : SPEAKER: Activate'); audioManager.isDeviceActive(2).then(function (value){ if(value==true){ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' +value); + console.info('Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' +value); + console.info('Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message); + console.info('Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_004 - * @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Promise - * @tc.desc : Deactivate BLUETOOTH_SCO - Promise - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_004 + * @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Promise + * @tc.desc : Deactivate BLUETOOTH_SCO - Promise + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_004', 0, async function (done) { await audioManager.setDeviceActive(7,false).then(function (){ // Setting device active ENUM 3 = BLUETOOTH_SCO - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate'); + console.info('Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate'); audioManager.isDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO).then(function (value){ if(value==false){ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); + console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); + console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :' + err.message); + console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :' + err.message); expect(false).assertTrue(); }); done(); }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_005 - * @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Callback - * @tc.desc : Activate BLUETOOTH_SCO - Callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_005 + * @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Callback + * @tc.desc : Activate BLUETOOTH_SCO - Callback + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_005', 0, async function (done) { audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO,true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); + console.error(`Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); + console.info('Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); audioManager.isDeviceActive(7,(err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); + console.error(`Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==true){ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :' +value); + console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :' +value); + console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3246,32 +3352,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_006 - * @tc.name : setDeviceActive - SPEAKER - deactivate - Callback - * @tc.desc : Deactivate speaker - Callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_006 + * @tc.name : setDeviceActive - SPEAKER - deactivate - Callback + * @tc.desc : Deactivate speaker - Callback + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_006', 0, async function (done) { audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER,false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info('Device Test: Callback : setDeviceActive : SPEAKER: Active'); audioManager.isDeviceActive(2,(err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==false){ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); + console.info('Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); + console.info('Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3282,32 +3389,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_007 - * @tc.name : setDeviceActive - SPEAKER - deactivate - Callback - * @tc.desc : Activate speaker - Callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_007 + * @tc.name : setDeviceActive - SPEAKER - deactivate - Callback + * @tc.desc : Activate speaker - Callback + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_007', 0, async function (done) { audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER,true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info('Device Test: Callback : setDeviceActive : SPEAKER: Active'); audioManager.isDeviceActive(2,(err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==true){ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' +value); + console.info('Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' +value); + console.info('Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3318,32 +3426,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_008 - * @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Callback - * @tc.desc : Deactivate BLUETOOTH_SCO - Callback - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_008 + * @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Callback + * @tc.desc : Deactivate BLUETOOTH_SCO - Callback + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setDeviceActive_008', 0, async function (done) { audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO,false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); + console.error(`Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); + console.info('Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); audioManager.isDeviceActive(7,(err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); + console.error(`Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==false){ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); + console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); + console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3354,24 +3463,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_001 - * @tc.name : setAudioParameter - Promise - Character & Number - * @tc.desc : setAudioParameter - Promise - Character & Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_001 + * @tc.name : setAudioParameter - Promise - Character & Number + * @tc.desc : setAudioParameter - Promise - Character & Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_001', 0, async function (done) { const promise = audioManager.setAudioParameter('PBits per sample', '8 bit'); promise.then(function () { - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info('Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PBits per sample').then(function (value){ if(value=='8 bit'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: Bits per sample : PASS :' +value); + console.info('Promise: getAudioParameter: Bits per sample : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : Bits per sample : FAIL :' +value); + console.info('Promise: getAudioParameter : Bits per sample : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3381,24 +3491,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_002 - * @tc.name : setAudioParameter - Promise - Number - * @tc.desc : setAudioParameter - Promise - Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_002 + * @tc.name : setAudioParameter - Promise - Number + * @tc.desc : setAudioParameter - Promise - Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_002', 0, async function (done) { const promise = audioManager.setAudioParameter('PNumber', '4800'); promise.then(function () { - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info('Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PNumber').then(function (value){ if(value=='4800'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PNumber : PASS :' +value); + console.info('Promise: getAudioParameter: PNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PNumber : FAIL :' +value); + console.info('Promise: getAudioParameter : PNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3408,24 +3519,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_003 - * @tc.name : setAudioParameter - Promise - Long Number - * @tc.desc : setAudioParameter - Promise - Long Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_003 + * @tc.name : setAudioParameter - Promise - Long Number + * @tc.desc : setAudioParameter - Promise - Long Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_003', 0, async function (done) { - const promise = audioManager.setAudioParameter('PLNumber',longValue); + const promise = audioManager.setAudioParameter('PLNumber',LONG_VALUE); promise.then(function () { - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info('Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PLNumber').then(function (value){ - if(value==longValue){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PLNumber : PASS :' +value); + if(value==LONG_VALUE){ + console.info('Promise: getAudioParameter: PLNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PLNumber : FAIL :' +value); + console.info('Promise: getAudioParameter : PLNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3435,24 +3547,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_004 - * @tc.name : setAudioParameter - Promise - Decimal - * @tc.desc : setAudioParameter - Promise - Decimal - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_004 + * @tc.name : setAudioParameter - Promise - Decimal + * @tc.desc : setAudioParameter - Promise - Decimal + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_004', 0, async function (done) { const promise = audioManager.setAudioParameter('PDecimal', '10.000000234324324324'); promise.then(function () { - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info('Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PDecimal').then(function (value){ if(value=='10.000000234324324324'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PDecimal : PASS :' +value); + console.info('Promise: getAudioParameter: PDecimal : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PDecimal : FAIL :' +value); + console.info('Promise: getAudioParameter : PDecimal : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3462,24 +3575,24 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_005 - * @tc.name : setAudioParameter - Promise - Parameter name Number - * @tc.desc : setAudioParameter - Promise - Parameter name Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_005 + * @tc.name : setAudioParameter - Promise - Parameter name Number + * @tc.desc : setAudioParameter - Promise - Parameter name Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ it('SUB_AUDIO_MANAGER_setAudioParameter_005', 0, async function (done) { const promise = audioManager.setAudioParameter('1212', 'PPNumber'); promise.then(function () { - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info('Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('1212').then(function (value){ if(value=='PPNumber'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: 1212 : PASS :' +value); + console.info('Promise: getAudioParameter: 1212 : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : 1212 : FAIL :' +value); + console.info('Promise: getAudioParameter : 1212 : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3489,24 +3602,25 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_006 - * @tc.name : setAudioParameter - Promise - Special Characters - * @tc.desc : setAudioParameter - Promise - Special Characters - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_006 + * @tc.name : setAudioParameter - Promise - Special Characters + * @tc.desc : setAudioParameter - Promise - Special Characters + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_006', 0, async function (done) { const promise = audioManager.setAudioParameter('PSpecial', '[]\:";<>?,./~!@#$%^*()_+-={}|'); promise.then(function () { - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info('Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PSpecial').then(function (value){ if(value=='[]\:";<>?,./~!@#$%^*()_+-={}|'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PSpecial : PASS :' +value); + console.info('Promise: getAudioParameter: PSpecial : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PSpecial : FAIL :' +value); + console.info('Promise: getAudioParameter : PSpecial : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3516,32 +3630,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_007 - * @tc.name : setAudioParameter - Callback - Character & Number - * @tc.desc : setAudioParameter - Callback - Character & Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_007 + * @tc.name : setAudioParameter - Callback - Character & Number + * @tc.desc : setAudioParameter - Callback - Character & Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_007', 0, async function (done) { audioManager.setAudioParameter('CBSample Rate', '16 bit', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); + console.info('Audio Parameter Test: Callback : setAudioParameter'); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBSample Rate : Error: ${err.message}`); + console.error(`setAudioParameter: CBSample Rate : Error: ${err.message}`); expect(false).assertTrue(); } else{ audioManager.getAudioParameter('CBSample Rate', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBSample Rate: Error: ${err.message}`); + console.error(`getAudioParameter: CBSample Rate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='16 bit'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: PASS :' +value); + console.info('Callback: getAudioParameter: CBSample Rate: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: FAIL :' +value); + console.info('Callback: getAudioParameter: CBSample Rate: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3552,32 +3667,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_008 - * @tc.name : setAudioParameter - Callback - Special Character - * @tc.desc : setAudioParameter - Callback - Special Character - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_008 + * @tc.name : setAudioParameter - Callback - Special Character + * @tc.desc : setAudioParameter - Callback - Special Character + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_008', 0, async function (done) { audioManager.setAudioParameter('Special', '~!@#$%^*()_+-={}|[]\:";<>?,./', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); + console.info('Audio Parameter Test: Callback : setAudioParameter'); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: Special : Error: ${err.message}`); + console.error(`setAudioParameter: Special : Error: ${err.message}`); expect(false).assertTrue(); } else{ audioManager.getAudioParameter('Special', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParam: Special: Error: ${err.message}`); + console.error(`getAudioParam: Special: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: PASS :' +value); + console.info('Callback: getAudioParameter: Special: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: FAIL :' +value); + console.info('Callback: getAudioParameter: Special: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3588,32 +3704,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_009 - * @tc.name : setAudioParameter - Callback - Decimal - * @tc.desc : setAudioParameter - Callback - Decimal - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_009 + * @tc.name : setAudioParameter - Callback - Decimal + * @tc.desc : setAudioParameter - Callback - Decimal + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_009', 0, async function (done) { audioManager.setAudioParameter('CBDecimal', '10000.21321432432432', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); + console.info('Audio Parameter Test: Callback : setAudioParameter'); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBDecimal : Error: ${err.message}`); + console.error(`setAudioParameter: CBDecimal : Error: ${err.message}`); expect(false).assertTrue(); } else{ audioManager.getAudioParameter('CBDecimal', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback :getAudioParm: CBDecimal:Error: ${err.message}`); + console.error(`getAudioParm: CBDecimal:Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='10000.21321432432432'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: PASS :' +value); + console.info('Callback: getAudioParameter: CBDecimal: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: FAIL :' +value); + console.info('Callback: getAudioParameter: CBDecimal: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3624,32 +3741,33 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_010 - * @tc.name : setAudioParameter - Callback - Number - * @tc.desc : setAudioParameter - Callback - Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_010 + * @tc.name : setAudioParameter - Callback - Number + * @tc.desc : setAudioParameter - Callback - Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_010', 0, async function (done) { audioManager.setAudioParameter('CBNumber', '5454', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :CBNumber : setAudioParameter'); + console.info('Audio Parameter Test: Callback :CBNumber : setAudioParameter'); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBNumber : Error: ${err.message}`); + console.error(`setAudioParameter: CBNumber : Error: ${err.message}`); expect(false).assertTrue(); } else{ audioManager.getAudioParameter('CBNumber', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParam: CBNumber: Error: ${err.message}`); + console.error(`getAudioParam: CBNumber: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='5454'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: PASS :' +value); + console.info('Callback: getAudioParameter: CBNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: FAIL :' +value); + console.info('Callback: getAudioParameter: CBNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3660,31 +3778,32 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_011 - * @tc.name : setAudioParameter - Callback - Long Number - * @tc.desc : setAudioParameter - Callback - Long Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_011 + * @tc.name : setAudioParameter - Callback - Long Number + * @tc.desc : setAudioParameter - Callback - Long Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_011', 0, async function (done) { - audioManager.setAudioParameter('CBLNumber', longValue, (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :CBLNumber : setAudioParameter'); + audioManager.setAudioParameter('CBLNumber', LONG_VALUE, (err) => { + console.info('Audio Parameter Test: Callback :CBLNumber : setAudioParameter'); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBLNumber : Error: ${err.message}`); + console.error(`setAudioParameter: CBLNumber : Error: ${err.message}`); expect(false).assertTrue(); } audioManager.getAudioParameter('CBLNumber', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBLNumber: Error: ${err.message}`); + console.error(`getAudioParameter: CBLNumber: Error: ${err.message}`); expect(false).assertTrue(); } - else if(value==longValue){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: PASS :' +value); + else if(value==LONG_VALUE){ + console.info('Callback: getAudioParameter: CBLNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: FAIL :' +value); + console.info('Callback: getAudioParameter: CBLNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3694,31 +3813,32 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_012 - * @tc.name : setAudioParameter - Callback - Parameter name Number - * @tc.desc : setAudioParameter - Callback - Parameter name Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_012 + * @tc.name : setAudioParameter - Callback - Parameter name Number + * @tc.desc : setAudioParameter - Callback - Parameter name Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_setAudioParameter_012', 0, async function (done) { audioManager.setAudioParameter('345667', 'xyza', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :345667 : setAudioParameter'); + console.info('Audio Parameter Test: Callback :345667 : setAudioParameter'); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: 345667 : Error: ${err.message}`); + console.error(`setAudioParameter: 345667 : Error: ${err.message}`); expect(false).assertTrue(); } audioManager.getAudioParameter('345667', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: 345667: Error: ${err.message}`); + console.error(`getAudioParameter: 345667: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='xyza'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: PASS :' +value); + console.info('Callback: getAudioParameter: 345667: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: FAIL :' +value); + console.info('Callback: getAudioParameter: 345667: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3728,22 +3848,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_001 - * @tc.name : getAudioParameter - Promise - Character & Number - * @tc.desc : getAudioParameter - Promise - Character & Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_001 + * @tc.name : getAudioParameter - Promise - Character & Number + * @tc.desc : getAudioParameter - Promise - Character & Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_001', 0, async function (done) { const promise = audioManager.getAudioParameter('PBits per sample'); promise.then(function (value){ if(value=='8 bit'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: Bits per sample : PASS :' +value); + console.info('Promise: getAudioParameter: Bits per sample : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : Bits per sample : FAIL :' +value); + console.info('Promise: getAudioParameter : Bits per sample : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3752,22 +3873,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_002 - * @tc.name : getAudioParameter - Promise - Number - * @tc.desc : getAudioParameter - Promise - Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_002 + * @tc.name : getAudioParameter - Promise - Number + * @tc.desc : getAudioParameter - Promise - Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_002', 0, async function (done) { const promise = audioManager.getAudioParameter('PNumber'); promise.then(function (value){ if(value=='4800'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PNumber : PASS :' +value); + console.info('Promise: getAudioParameter: PNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PNumber : FAIL :' +value); + console.info('Promise: getAudioParameter : PNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3776,22 +3898,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_003 - * @tc.name : getAudioParameter - Promise - Long Number - * @tc.desc : getAudioParameter - Promise - Long Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_003 + * @tc.name : getAudioParameter - Promise - Long Number + * @tc.desc : getAudioParameter - Promise - Long Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_003', 0, async function (done) { const promise = audioManager.getAudioParameter('PLNumber'); promise.then(function (value){ - if(value==longValue){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PLNumber : PASS :' +value); + if(value==LONG_VALUE){ + console.info('Promise: getAudioParameter: PLNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PLNumber : FAIL :' +value); + console.info('Promise: getAudioParameter : PLNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3800,22 +3923,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_004 - * @tc.name : getAudioParameter - Promise - Decimal - * @tc.desc : getAudioParameter - Promise - Decimal - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_004 + * @tc.name : getAudioParameter - Promise - Decimal + * @tc.desc : getAudioParameter - Promise - Decimal + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_004', 0, async function (done) { const promise = audioManager.getAudioParameter('PDecimal'); promise.then(function (value){ if(value=='10.000000234324324324'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PDecimal : PASS :' +value); + console.info('Promise: getAudioParameter: PDecimal : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PDecimal : FAIL :' +value); + console.info('Promise: getAudioParameter : PDecimal : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3824,22 +3948,22 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_005 - * @tc.name : getAudioParameter - Promise - Parameter name Number - * @tc.desc : getAudioParameter - Promise - Parameter name Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_005 + * @tc.name : getAudioParameter - Promise - Parameter name Number + * @tc.desc : getAudioParameter - Promise - Parameter name Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ it('SUB_AUDIO_MANAGER_getAudioParameter_005', 0, async function (done) { const promise = audioManager.getAudioParameter('1212'); promise.then(function (value){ if(value=='PPNumber'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: 1212 : PASS :' +value); + console.info('Promise: getAudioParameter: 1212 : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : 1212 : FAIL :' +value); + console.info('Promise: getAudioParameter : 1212 : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3848,22 +3972,23 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_006 - * @tc.name : getAudioParameter - Promise - Special Characters - * @tc.desc : getAudioParameter - Promise - Special Characters - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_006 + * @tc.name : getAudioParameter - Promise - Special Characters + * @tc.desc : getAudioParameter - Promise - Special Characters + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_006', 0, async function (done) { const promise = audioManager.getAudioParameter('PSpecial'); promise.then(function (value){ if(value=='[]\:";<>?,./~!@#$%^*()_+-={}|'){ - console.info('AudioFrameworkTest: Promise: getAudioParameter: PSpecial : PASS :' +value); + console.info('Promise: getAudioParameter: PSpecial : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Promise: getAudioParameter : PSpecial : FAIL :' +value); + console.info('Promise: getAudioParameter : PSpecial : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3872,25 +3997,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_007 - * @tc.name : getAudioParameter - Callback - Character & Number - * @tc.desc : getAudioParameter - Callback - Character & Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_007 + * @tc.name : getAudioParameter - Callback - Character & Number + * @tc.desc : getAudioParameter - Callback - Character & Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_007', 0, async function (done) { audioManager.getAudioParameter('CBSample Rate', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBSample Rate: Error: ${err.message}`); + console.error(`getAudioParameter: CBSample Rate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='16 bit'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: PASS :' +value); + console.info('Callback: getAudioParameter: CBSample Rate: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: FAIL :' +value); + console.info('Callback: getAudioParameter: CBSample Rate: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3898,25 +4024,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_008 - * @tc.name : getAudioParameter - Callback - Special Character - * @tc.desc : getAudioParameter - Callback - Special Character - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_008 + * @tc.name : getAudioParameter - Callback - Special Character + * @tc.desc : getAudioParameter - Callback - Special Character + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_008', 0, async function (done) { audioManager.getAudioParameter('Special', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: Special: Error: ${err.message}`); + console.error(`getAudioParameter: Special: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: PASS :' +value); + console.info('Callback: getAudioParameter: Special: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: FAIL :' +value); + console.info('Callback: getAudioParameter: Special: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3924,25 +4051,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_009 - * @tc.name : getAudioParameter - Callback - Decimal - * @tc.desc : getAudioParameter - Callback - Decimal - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_009 + * @tc.name : getAudioParameter - Callback - Decimal + * @tc.desc : getAudioParameter - Callback - Decimal + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_009', 0, async function (done) { audioManager.getAudioParameter('CBDecimal', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBDecimal: Error: ${err.message}`); + console.error(`getAudioParameter: CBDecimal: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='10000.21321432432432'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: PASS :' +value); + console.info('Callback: getAudioParameter: CBDecimal: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: FAIL :' +value); + console.info('Callback: getAudioParameter: CBDecimal: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3950,25 +4078,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_010 - * @tc.name : getAudioParameter - Callback - Number - * @tc.desc : getAudioParameter - Callback - Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_010 + * @tc.name : getAudioParameter - Callback - Number + * @tc.desc : getAudioParameter - Callback - Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_010', 0, async function (done) { audioManager.getAudioParameter('CBNumber', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBNumber: Error: ${err.message}`); + console.error(`getAudioParameter: CBNumber: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='5454'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: PASS :' +value); + console.info('Callback: getAudioParameter: CBNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: FAIL :' +value); + console.info('Callback: getAudioParameter: CBNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3976,25 +4105,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_011 - * @tc.name : getAudioParameter - Callback - Long Number - * @tc.desc : getAudioParameter - Callback - Long Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_011 + * @tc.name : getAudioParameter - Callback - Long Number + * @tc.desc : getAudioParameter - Callback - Long Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_011', 0, async function (done) { audioManager.getAudioParameter('CBLNumber', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBLNumber: Error: ${err.message}`); + console.error(`getAudioParameter: CBLNumber: Error: ${err.message}`); expect(false).assertTrue(); } - else if(value==longValue){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: PASS :' +value); + else if(value==LONG_VALUE){ + console.info('Callback: getAudioParameter: CBLNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: FAIL :' +value); + console.info('Callback: getAudioParameter: CBLNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -4002,25 +4132,26 @@ describe('audioManger', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_012 - * @tc.name : getAudioParameter - Callback - Parameter name Number - * @tc.desc : getAudioParameter - Callback - Parameter name Number - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_012 + * @tc.name : getAudioParameter - Callback - Parameter name Number + * @tc.desc : getAudioParameter - Callback - Parameter name Number + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_getAudioParameter_012', 0, async function (done) { audioManager.getAudioParameter('345667', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: 345667: Error: ${err.message}`); + console.error(`getAudioParameter: 345667: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='xyza'){ - console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: PASS :' +value); + console.info('Callback: getAudioParameter: 345667: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: FAIL :' +value); + console.info('Callback: getAudioParameter: 345667: FAIL :' +value); expect(false).assertTrue(); } done(); diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioPerf.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioPerf.test.js index 50ad0315fd8acf5e77b093a32ad3a58e175edf6f..37a29f75b4677b33e643dca402fee24109b19511 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioPerf.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioPerf.test.js @@ -19,10 +19,10 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' describe('audioApiResponseTime', function () { console.info('AudioFrameworkTestPerf: Running AudioManger API Perfomance Test'); - var audioMedia = 3; - var audioRingtone = 2; - var maxVol = 15; - var lowVol = 5; + var AUDIO_MEDIA = 3; + var AUDIO_RINGTONE = 2; + var MAX_VOL = 15; + var LOW_VOL = 5; var MAXNUM = 1000; var err; @@ -43,18 +43,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_001 - * @tc.name : API Response - setVolume - Promise - * @tc.desc : Check setVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_001 + * @tc.name : API Response - setVolume - Promise + * @tc.desc : Check setVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_001', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.setVolume(audioRingtone,maxVol); + audioManagerPerf.setVolume(AUDIO_RINGTONE,MAX_VOL); }; let waitTime = new Date().getTime()-startTime; let avgTime = waitTime/MAXNUM; @@ -72,18 +73,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_002 - * @tc.name : API Response - setVolume - CallBack - * @tc.desc : Check setVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_002 + * @tc.name : API Response - setVolume - CallBack + * @tc.desc : Check setVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_002', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.setVolume(audioMedia,lowVol,(err, value) => { + audioManagerPerf.setVolume(AUDIO_MEDIA,LOW_VOL,(err, value) => { if (err) { console.error(`AudioFrameworkTestPerf: callback : ERROR : ${err.message}`); expect(false).assertTrue(); @@ -106,18 +108,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_003 - * @tc.name : API Response - getVolume - Promise - * @tc.desc : Check getVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_003 + * @tc.name : API Response - getVolume - Promise + * @tc.desc : Check getVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_003', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.getVolume(audioRingtone); + audioManagerPerf.getVolume(AUDIO_RINGTONE); }; let waitTime = new Date().getTime()-startTime; let avgTime = waitTime/MAXNUM; @@ -135,18 +138,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_004 - * @tc.name : API Response - getVolume - CallBack - * @tc.desc : Check getVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_004 + * @tc.name : API Response - getVolume - CallBack + * @tc.desc : Check getVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_004', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.getVolume(audioMedia,(err, value) => { + audioManagerPerf.getVolume(AUDIO_MEDIA,(err, value) => { if (err) { console.error(`AudioFrameworkTestPerf: callback : ERROR : ${err.message}`); expect(false).assertTrue(); @@ -169,18 +173,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_005 - * @tc.name : API Response - getMinVolume - Promise - * @tc.desc : Check getMinVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_005 + * @tc.name : API Response - getMinVolume - Promise + * @tc.desc : Check getMinVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_005', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.getMinVolume(audioMedia); + audioManagerPerf.getMinVolume(AUDIO_MEDIA); }; let waitTime = new Date().getTime()-startTime; let avgTime = waitTime/MAXNUM; @@ -198,18 +203,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_006 - * @tc.name : API Response - getMinVolume - CallBack - * @tc.desc : Check getMinVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_006 + * @tc.name : API Response - getMinVolume - CallBack + * @tc.desc : Check getMinVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_006', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.getMinVolume(audioRingtone,(err, value) => { + audioManagerPerf.getMinVolume(AUDIO_RINGTONE,(err, value) => { if (err) { console.error(`AudioFrameworkTestPerf: callback : ERROR : ${err.message}`); expect(false).assertTrue(); @@ -232,18 +238,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_007 - * @tc.name : API Response - getMaxVolume - Promise - * @tc.desc : Check getMaxVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_007 + * @tc.name : API Response - getMaxVolume - Promise + * @tc.desc : Check getMaxVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_007', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.getMaxVolume(audioMedia); + audioManagerPerf.getMaxVolume(AUDIO_MEDIA); }; let waitTime = new Date().getTime()-startTime; let avgTime = waitTime/MAXNUM; @@ -261,18 +268,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_008 - * @tc.name : API Response - getMaxVolume - CallBack - * @tc.desc : Check getMaxVolume API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_008 + * @tc.name : API Response - getMaxVolume - CallBack + * @tc.desc : Check getMaxVolume API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_008', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.getMaxVolume(audioRingtone,(err, value) => { + audioManagerPerf.getMaxVolume(AUDIO_RINGTONE,(err, value) => { if (err) { console.error(`AudioFrameworkTestPerf: callback : ERROR : ${err.message}`); expect(false).assertTrue(); @@ -295,18 +303,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_009 - * @tc.name : API Response - mute - Promise - * @tc.desc : Check mute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_009 + * @tc.name : API Response - mute - Promise + * @tc.desc : Check mute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_009', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.mute(audioMedia,true); + audioManagerPerf.mute(AUDIO_MEDIA,true); }; let waitTime = new Date().getTime()-startTime; let avgTime = waitTime/MAXNUM; @@ -324,18 +333,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_010 - * @tc.name : API Response - mute - CallBack - * @tc.desc : Check mute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_010 + * @tc.name : API Response - mute - CallBack + * @tc.desc : Check mute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_010', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.mute(audioRingtone,true,(err, value) => { + audioManagerPerf.mute(AUDIO_RINGTONE,true,(err, value) => { if (err) { console.error(`AudioFrameworkTestPerf: callback : ERROR : ${err.message}`); expect(false).assertTrue(); @@ -358,18 +368,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_011 - * @tc.name : API Response - isMute - Promise - * @tc.desc : Check isMute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_011 + * @tc.name : API Response - isMute - Promise + * @tc.desc : Check isMute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_011', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.isMute(audioMedia); + audioManagerPerf.isMute(AUDIO_MEDIA); }; let waitTime = new Date().getTime()-startTime; let avgTime = waitTime/MAXNUM; @@ -387,18 +398,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_012 - * @tc.name : API Response - isMute - CallBack - * @tc.desc : Check isMute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_012 + * @tc.name : API Response - isMute - CallBack + * @tc.desc : Check isMute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_012', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.isMute(audioRingtone,(err, value) => { + audioManagerPerf.isMute(AUDIO_RINGTONE,(err, value) => { if (err) { console.error(`AudioFrameworkTestPerf: callback : ERROR : ${err.message}`); expect(false).assertTrue(); @@ -421,18 +433,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_013 - * @tc.name : API Response - isActive - Promise - * @tc.desc : Check isActive API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_013 + * @tc.name : API Response - isActive - Promise + * @tc.desc : Check isActive API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_013', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.isActive(audioMedia); + audioManagerPerf.isActive(AUDIO_MEDIA); }; let waitTime = new Date().getTime()-startTime; let avgTime = waitTime/MAXNUM; @@ -450,18 +463,19 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_014 - * @tc.name : API Response - isActive - CallBack - * @tc.desc : Check isActive API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_014 + * @tc.name : API Response - isActive - CallBack + * @tc.desc : Check isActive API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_014', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); for (let i = 0; i < MAXNUM; i++) { - audioManagerPerf.isActive(audioRingtone,(err, value) => { + audioManagerPerf.isActive(AUDIO_RINGTONE,(err, value) => { if (err) { console.error(`AudioFrameworkTestPerf: callback : ERROR : ${err.message}`); expect(false).assertTrue(); @@ -484,13 +498,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_015 - * @tc.name : API Response - setMicrophoneMute - Promise - * @tc.desc : Check setMicrophoneMute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_015 + * @tc.name : API Response - setMicrophoneMute - Promise + * @tc.desc : Check setMicrophoneMute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_015', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -513,13 +528,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_016 - * @tc.name : API Response - setMicrophoneMute - CallBack - * @tc.desc : Check setMicrophoneMute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_016 + * @tc.name : API Response - setMicrophoneMute - CallBack + * @tc.desc : Check setMicrophoneMute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_016', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -547,13 +563,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_017 - * @tc.name : API Response - isMicrophoneMute - Promise - * @tc.desc : Check isMicrophoneMute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_017 + * @tc.name : API Response - isMicrophoneMute - Promise + * @tc.desc : Check isMicrophoneMute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_017', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -576,13 +593,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_018 - * @tc.name : API Response - isMicrophoneMute - CallBack - * @tc.desc : Check isMicrophoneMute API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_018 + * @tc.name : API Response - isMicrophoneMute - CallBack + * @tc.desc : Check isMicrophoneMute API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_018', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -610,13 +628,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_019 - * @tc.name : API Response - setRingerMode - Promise - * @tc.desc : Check setRingerMode API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_019 + * @tc.name : API Response - setRingerMode - Promise + * @tc.desc : Check setRingerMode API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_019', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -639,13 +658,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_020 - * @tc.name : API Response - setRingerMode - CallBack - * @tc.desc : Check setRingerMode API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_020 + * @tc.name : API Response - setRingerMode - CallBack + * @tc.desc : Check setRingerMode API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_020', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -673,13 +693,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_021 - * @tc.name : API Response - getRingerMode - Promise - * @tc.desc : Check getRingerMode API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_021 + * @tc.name : API Response - getRingerMode - Promise + * @tc.desc : Check getRingerMode API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_021', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -702,13 +723,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_022 - * @tc.name : API Response - getRingerMode - CallBack - * @tc.desc : Check getRingerMode API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_022 + * @tc.name : API Response - getRingerMode - CallBack + * @tc.desc : Check getRingerMode API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_022', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -736,13 +758,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_023 - * @tc.name : API Response - setAudioParameter - Promise - * @tc.desc : Check setAudioParameter API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_023 + * @tc.name : API Response - setAudioParameter - Promise + * @tc.desc : Check setAudioParameter API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_023', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -765,13 +788,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_024 - * @tc.name : API Response - setAudioParameter - CallBack - * @tc.desc : Check setAudioParameter API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_024 + * @tc.name : API Response - setAudioParameter - CallBack + * @tc.desc : Check setAudioParameter API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_024', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -799,13 +823,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_025 - * @tc.name : API Response - getAudioParameter - Promise - * @tc.desc : Check getAudioParameter API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_025 + * @tc.name : API Response - getAudioParameter - Promise + * @tc.desc : Check getAudioParameter API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_025', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -828,13 +853,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_026 - * @tc.name : API Response - getAudioParameter - CallBack - * @tc.desc : Check getAudioParameter API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_026 + * @tc.name : API Response - getAudioParameter - CallBack + * @tc.desc : Check getAudioParameter API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_026', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -862,13 +888,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_027 - * @tc.name : API Response - getDevices - Promise - * @tc.desc : Check getDevices API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_027 + * @tc.name : API Response - getDevices - Promise + * @tc.desc : Check getDevices API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_027', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -891,13 +918,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_028 - * @tc.name : API Response - getDevices - CallBack - * @tc.desc : Check getDevices API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_028 + * @tc.name : API Response - getDevices - CallBack + * @tc.desc : Check getDevices API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_028', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -925,13 +953,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_029 - * @tc.name : API Response - setDeviceActive - Promise - * @tc.desc : Check setDeviceActive API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_029 + * @tc.name : API Response - setDeviceActive - Promise + * @tc.desc : Check setDeviceActive API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_029', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -954,13 +983,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_030 - * @tc.name : API Response - setDeviceActive - CallBack - * @tc.desc : Check setDeviceActive API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_030 + * @tc.name : API Response - setDeviceActive - CallBack + * @tc.desc : Check setDeviceActive API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_030', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -988,13 +1018,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_031 - * @tc.name : API Response - isDeviceActive - Promise - * @tc.desc : Check isDeviceActive API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_031 + * @tc.name : API Response - isDeviceActive - Promise + * @tc.desc : Check isDeviceActive API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_031', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); @@ -1017,13 +1048,14 @@ describe('audioApiResponseTime', function () { }) /* * - * @tc.number : SUB_AUDIO_MANAGER_Performance_032 - * @tc.name : API Response - isDeviceActive - CallBack - * @tc.desc : Check isDeviceActive API Response time - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ + * @tc.number : SUB_AUDIO_MANAGER_Performance_032 + * @tc.name : API Response - isDeviceActive - CallBack + * @tc.desc : Check isDeviceActive API Response time + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_Performance_032', 0, function (done) { let audioManagerPerf = audio.getAudioManager(); let startTime = new Date().getTime(); diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js index 0c0e87f6717c66799acb50dd96416b6a92978ce7..5c0a73836138ed71fdc8c5d48ba93fc849139c9d 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/List.test.js @@ -13,8 +13,5 @@ * limitations under the License. */ -// require('./AudioPerf.test.js') + require('./AudioFramework.test.js') -//require('./AudioFramework.test-Gitee.js') -//require('./AudioCapturer.test.js') -//require('./AudioRenderer.test.js') \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioPlayer/Test.json b/multimedia/audio/audio_js_standard/audioPlayer/Test.json index 544b9b7e8cc165eaf987c2f7ca441ddeaba676e6..4673a360700197802c5f9061e8e80fd4cc4e345d 100755 --- a/multimedia/audio/audio_js_standard/audioPlayer/Test.json +++ b/multimedia/audio/audio_js_standard/audioPlayer/Test.json @@ -2,9 +2,9 @@ "description": "Configuration for audioPlayer Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "3000000", + "test-timeout": "2000000", "package": "ohos.acts.multimedia.audio.audioplayer", - "shell-timeout": "60000" + "shell-timeout": "60000" }, "kits": [ { @@ -12,40 +12,33 @@ "pre-push": [ ], "push": [ - "resource/audio/01.mp3 ->/data/media/", - "resource/audio/02.mp3 ->/data/media/", - "resource/audio/03.mp3 ->/data/media/", - "resource/audio/04.mp3 ->/data/media/", - "resource/audio/47.mp4 ->/data/media/", - "resource/audio/49.mp4 ->/data/media/", - "resource/audio/50.mp4 ->/data/media/", - "resource/audio/51.mp4 ->/data/media/", - "resource/audio/54.mp4 ->/data/media/", - "resource/audio/55.m4a ->/data/media/", - "resource/audio/57.m4a ->/data/media/", - "resource/audio/58.m4a ->/data/media/", - "resource/audio/59.m4a ->/data/media/", - "resource/audio/62.m4a ->/data/media/", - "resource/audio/64.mp4 ->/data/media/", - "resource/audio/65.mp4 ->/data/media/", - "resource/audio/66.mp4 ->/data/media/", - "resource/audio/67.mp4 ->/data/media/", - "resource/audio/92.mp4 ->/data/media/", - "resource/audio/93.mp4 ->/data/media/", - "resource/audio/94.mp4 ->/data/media/", - "resource/audio/96.mp4 ->/data/media/", - "resource/audio/97.mp4 ->/data/media/", - "resource/audio/98.mp4 ->/data/media/" + "./resource/audio/01.mp3 ->/data/media/", + "./resource/audio/02.mp3 ->/data/media/", + "./resource/audio/03.mp3 ->/data/media/", + "./resource/audio/04.mp3 ->/data/media/", + "./resource/audio/47.mp4 ->/data/media/", + "./resource/audio/49.mp4 ->/data/media/", + "./resource/audio/50.mp4 ->/data/media/", + "./resource/audio/51.mp4 ->/data/media/", + "./resource/audio/54.mp4 ->/data/media/", + "./resource/audio/55.m4a ->/data/media/", + "./resource/audio/57.m4a ->/data/media/", + "./resource/audio/58.m4a ->/data/media/", + "./resource/audio/59.m4a ->/data/media/", + "./resource/audio/62.m4a ->/data/media/", + "./resource/audio/64.mp4 ->/data/media/", + "./resource/audio/65.mp4 ->/data/media/", + "./resource/audio/66.mp4 ->/data/media/", + "./resource/audio/67.mp4 ->/data/media/", + "./resource/audio/92.mp4 ->/data/media/", + "./resource/audio/93.mp4 ->/data/media/", + "./resource/audio/94.mp4 ->/data/media/", + "./resource/audio/96.mp4 ->/data/media/", + "./resource/audio/97.mp4 ->/data/media/", + "./resource/audio/98.mp4 ->/data/media/" ] }, - { - "test-file-name": [ - "AudioPlayerJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { + { "type": "ShellKit", "run-command": [ "chmod -R 666 /data/media/*", @@ -54,6 +47,13 @@ "teardown-command":[ "setenforce 1" ] + }, + { + "test-file-name": [ + "AudioPlayerJsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true } ] -} \ No newline at end of file +} diff --git a/multimedia/audio/audio_js_standard/audioPlayer/src/main/config.json b/multimedia/audio/audio_js_standard/audioPlayer/src/main/config.json index 47b56d76fcd045082003655309d485b6a7f6f589..bdca282276cfed06c18ce52e4169465a6dd3cba9 100755 --- a/multimedia/audio/audio_js_standard/audioPlayer/src/main/config.json +++ b/multimedia/audio/audio_js_standard/audioPlayer/src/main/config.json @@ -1,60 +1,74 @@ { "app": { - "bundleName": "ohos.acts.multimedia.audio.audioplayer", - "vendor": "acts", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 6, - "target": 5 - } + "apiVersion": { + "compatible": 6, + "releaseType": "Beta1", + "target": 7 + }, + "vendor": "acts", + "bundleName": "ohos.acts.multimedia.audio.audioplayer", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": { + "default": { + "debug": true + } }, - "deviceConfig": {}, "module": { - "package": "ohos.acts.multimedia.audio.audioplayer", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ + "abilities": [ { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] + "iconId": 16777218, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "descriptionId": 16777217, + "visible": true, + "labelId": 16777216, + "icon": "$media:icon", + "name": "ohos.acts.multimedia.audio.audioplayer.MainAbility", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "homeAbility": true, + "launchType": "standard" } - ], - "visible": true, - "name": "ohos.acts.multimedia.audio.audioplayer.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] + ], + "deviceType": [ + "phone", + "tablet", + "tv", + "wearable" + ], + "mainAbility": "ohos.acts.multimedia.audio.audioplayer.MainAbility", + "distro": { + "moduleType": "entry", + "installationFree": false, + "deliveryWithInstall": true, + "moduleName": "entry" + }, + "package": "ohos.acts.multimedia.audio.audioplayer", + "name": ".MyApplication", + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] } } \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java b/multimedia/audio/audio_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..84cb3efd1dba0d92d906a3624192afd6b887499a --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayer; + + import ohos.ace.ability.AceAbility; + import ohos.aafwk.content.Intent; + +/* + * java MainAbility + */ + + public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java b/multimedia/audio/audio_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..a735d0a33e16bdb4ae0194d12fb865e64207b88e --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayer; + + import ohos.aafwk.ability.AbilityPackage; + +/* + * java MyApplication + */ + + public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js b/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js index a99a2e109cff8e9fbff679f09156cb18f2ea5a79..d1300ece3a4d0c3e26a61e171df020091983b745 100644 --- a/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js +++ b/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js @@ -74,9 +74,10 @@ describe('PlayerLocalTestAudioFUNC', function () { } } - function nextStep(mySteps) { + function nextStep(mySteps,done) { if (mySteps[0] == END_STATE) { - isTimeOut = true; + done(); + console.info('case to done'); return; } switch (mySteps[0]) { @@ -125,18 +126,16 @@ describe('PlayerLocalTestAudioFUNC', function () { } } - function setSrcCallback(mySteps) { + function setCallback(mySteps, done) { + console.info(`case setCallback`); audioPlayer.on('dataLoad', () => { mySteps.shift(); console.info(`case dataLoad called`); expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.state).assertEqual('paused'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setPlayCallback(mySteps) { audioPlayer.on('play', () => { mySteps.shift(); console.info(`case play called`); @@ -148,31 +147,22 @@ describe('PlayerLocalTestAudioFUNC', function () { return; } expect(audioPlayer.state).assertEqual('playing'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setPauseCallback(mySteps) { audioPlayer.on('pause', () => { mySteps.shift(); console.info(`case pause called`); console.info(`case pause currentTime is ${audioPlayer.currentTime}`); expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.state).assertEqual('paused'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setResetCallback(mySteps) { audioPlayer.on('reset', () => { mySteps.shift(); console.info(`case reset called`); expect(audioPlayer.state).assertEqual('idle'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setStopCallback(mySteps) { audioPlayer.on('stop', () => { if (mySteps[0] == RESET_STATE) { console.info(`case reset stop called`); @@ -183,11 +173,8 @@ describe('PlayerLocalTestAudioFUNC', function () { expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.state).assertEqual('stopped'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setSeekCallback(mySteps) { audioPlayer.on('timeUpdate', (seekDoneTime) => { if (typeof (seekDoneTime) == 'undefined') { console.info(`case seek filed,errcode is ${seekDoneTime}`); @@ -207,12 +194,9 @@ describe('PlayerLocalTestAudioFUNC', function () { sleep(PLAY_STATE); } if ((seekDoneTime < audioPlayer.duration) || (audioPlayer.state == 'paused')) { - nextStep(mySteps); + nextStep(mySteps,done); } }); - } - - function setVolumeCallback(mySteps) { audioPlayer.on('volumeChange', () => { console.info(`case setvolume called`); mySteps.shift(); @@ -220,21 +204,15 @@ describe('PlayerLocalTestAudioFUNC', function () { if (audioPlayer.state == 'playing') { sleep(PLAY_TIME); } - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setFinishCallback(mySteps) { audioPlayer.on('finish', () => { mySteps.shift(); expect(audioPlayer.state).assertEqual('stopped'); expect(audioPlayer.currentTime).assertClose(audioPlayer.duration, DELTA_TIME); console.info(`case finish called`); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setErrorCallback(mySteps) { audioPlayer.on('error', (err) => { console.info(`case error called,errName is ${err.name}`); console.info(`case error called,errCode is ${err.code}`); @@ -247,28 +225,9 @@ describe('PlayerLocalTestAudioFUNC', function () { mySteps.shift(); mySteps.shift(); } - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setCallback(mySteps, done) { - console.info(`case setCallback`); - setSrcCallback(mySteps); - setPlayCallback(mySteps); - setPauseCallback(mySteps); - setResetCallback(mySteps); - setStopCallback(mySteps); - setSeekCallback(mySteps); - setVolumeCallback(mySteps); - setFinishCallback(mySteps); - setErrorCallback(mySteps); - setTimeout(function() { - if (!isTimeOut) { - console.info(`case is time out!`); - expect().assertFail(); - } - done(); - }, TIME_OUT); + }; /* * @@ -279,7 +238,9 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0100', 0, async function (done) { + console.info(`case update`); let mySteps = new Array(SRC_STATE, PLAY_STATE, END_STATE); initAudioPlayer(); setCallback(mySteps, done); @@ -294,6 +255,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -309,6 +271,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -324,6 +287,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0500', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -339,6 +303,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0600', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, PAUSE_STATE, END_STATE); initAudioPlayer(); @@ -354,6 +319,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0700', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, END_STATE); initAudioPlayer(); @@ -369,6 +335,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0800', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, STOP_STATE, END_STATE); initAudioPlayer(); @@ -384,6 +351,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_0900', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RESET_STATE, SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE); @@ -400,6 +368,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1000', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, RESET_STATE, SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE); @@ -416,6 +385,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1100', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RESET_STATE, SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE); @@ -432,6 +402,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -447,6 +418,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -462,6 +434,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1400', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, PAUSE_STATE, END_STATE); initAudioPlayer(); @@ -477,6 +450,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1500', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME, PLAY_STATE, FINISH_STATE, END_STATE); @@ -493,6 +467,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1600', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, PAUSE_STATE, END_STATE); initAudioPlayer(); @@ -508,6 +483,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1700', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, RESET_STATE, END_STATE); initAudioPlayer(); @@ -523,6 +499,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1800', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, STOP_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -538,6 +515,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_1900', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, 0, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -553,6 +531,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2000', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, 0, RESET_STATE, END_STATE); initAudioPlayer(); @@ -568,6 +547,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2100', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME / RAND_NUM, STOP_STATE, END_STATE); @@ -584,6 +564,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE); initAudioPlayer(); @@ -599,6 +580,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, SEEK_STATE, 0, STOP_STATE, END_STATE); initAudioPlayer(); @@ -614,6 +596,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2400', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, 0, ERROR_STATE, RESET_STATE, SRC_STATE, PLAY_STATE, END_STATE); @@ -630,6 +613,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2500', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE); initAudioPlayer(); @@ -645,6 +629,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level 3 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2600', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, SEEK_TIME, ERROR_STATE, PAUSE_STATE, ERROR_STATE, RESET_STATE, END_STATE); @@ -661,6 +646,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level 3 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2700', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, SEEK_STATE, SEEK_TIME, ERROR_STATE, RESET_STATE, SRC_STATE, PLAY_STATE, END_STATE); @@ -677,6 +663,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2800', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME, FINISH_STATE, END_STATE); initAudioPlayer(); @@ -692,6 +679,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level 3 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_2900', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME, FINISH_STATE, END_STATE); @@ -708,6 +696,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3000', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME / RAND_NUM, END_STATE); initAudioPlayer(); @@ -723,6 +712,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, 0, PLAY_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -738,6 +728,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME, PLAY_STATE, FINISH_STATE, RESET_STATE, END_STATE); @@ -754,6 +745,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level 3 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3400', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME, PLAY_STATE, FINISH_STATE, RESET_STATE, END_STATE); @@ -770,6 +762,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level 3 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3500', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, DURATION_TIME + DELTA_TIME, FINISH_STATE, PLAY_STATE, RESET_STATE, END_STATE); @@ -786,6 +779,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3600', 0, async function (done) { let playCount = 0; let seekCount = 0; @@ -852,6 +846,7 @@ describe('PlayerLocalTestAudioFUNC', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_AUDIO_Function_04_3700', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, VOLUME_STATE, 0, VOLUME_STATE, MAX_VOLUME, RESET_STATE, END_STATE); diff --git a/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js b/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js index 4dec6b3a5d06f92897e4ed3dc1ba13d04a218895..1702989160671f0dd53b35e3058fe80229d198bd 100644 --- a/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js +++ b/multimedia/audio/audio_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js @@ -45,16 +45,15 @@ describe('PlayerLocalTestAudioFormat', function () { for(let t = Date.now(); Date.now() - t <= time;); } - function setSrcCallback(audioPlayer) { + function playSource(audioSource, done) { + let audioPlayer = media.createAudioPlayer(); + audioPlayer.src = audioSource; audioPlayer.on('dataLoad', () => { console.info('case set source success'); expect(audioPlayer.state).assertEqual('paused'); expect(audioPlayer.currentTime).assertEqual(0); audioPlayer.play(); }); - } - - function setPlayCallback(audioPlayer) { audioPlayer.on('play', () => { console.info('case start to play'); expect(audioPlayer.state).assertEqual('playing'); @@ -65,17 +64,16 @@ describe('PlayerLocalTestAudioFormat', function () { audioPlayer.seek(SEEK_TIME); } }); - } - - function setPauseCallback(audioPlayer) { audioPlayer.on('pause', () => { console.info('case now is paused'); expect(audioPlayer.state).assertEqual('paused'); audioPlayer.setVolume(MAX_VOLUME); }); - } - - function setResetCallback(audioPlayer, done) { + audioPlayer.on('stop', () => { + console.info('case stop success'); + expect(audioPlayer.state).assertEqual('stopped'); + audioPlayer.reset(); + }); audioPlayer.on('reset', () => { console.info('case reset success'); expect(audioPlayer.state).assertEqual('idle'); @@ -83,17 +81,6 @@ describe('PlayerLocalTestAudioFormat', function () { audioPlayer = undefined; done(); }); - } - - function setStopCallback(audioPlayer) { - audioPlayer.on('stop', () => { - console.info('case stop success'); - expect(audioPlayer.state).assertEqual('stopped'); - audioPlayer.reset(); - }); - } - - function setSeekCallback(audioPlayer, done) { audioPlayer.on('timeUpdate', (seekDoneTime) => { if (typeof (seekDoneTime) == "undefined") { console.info(`case seek filed,errcode is ${seekDoneTime}`); @@ -112,25 +99,16 @@ describe('PlayerLocalTestAudioFormat', function () { expect(audioPlayer.duration).assertEqual(seekDoneTime); } }); - } - - function setVolumeCallback(audioPlayer) { audioPlayer.on('volumeChange', () => { console.info('case set volume value to ' + MAX_VOLUME); audioPlayer.play(); isToSeek = true; }); - } - - function setFinishCallback(audioPlayer) { audioPlayer.on('finish', () => { console.info('case play end'); expect(audioPlayer.state).assertEqual('stopped'); audioPlayer.stop(); }); - } - - function setErrorCallback(audioPlayer, done) { audioPlayer.on('error', (err) => { console.info(`case error called,errName is ${err.name}`); console.info(`case error called,errCode is ${err.code}`); @@ -141,26 +119,6 @@ describe('PlayerLocalTestAudioFormat', function () { }); } - function playSource(audioSource, done) { - let audioPlayer = media.createAudioPlayer(); - if (typeof (audioPlayer) == 'undefined') { - console.info('case create player is faild'); - expect().assertFail(); - done(); - return; - } - setSrcCallback(audioPlayer); - setPlayCallback(audioPlayer); - setPauseCallback(audioPlayer); - setResetCallback(audioPlayer, done); - setStopCallback(audioPlayer); - setSeekCallback(audioPlayer, done); - setVolumeCallback(audioPlayer); - setFinishCallback(audioPlayer); - setErrorCallback(audioPlayer, done); - audioPlayer.src = audioSource; - } - /* * * @tc.number : SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0100 * @tc.name : 001.Playing mp3 streams @@ -173,6 +131,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0100', 0, async function (done) { playSource(BASIC_PATH + '01.mp3', done); }) @@ -189,6 +148,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0200', 0, async function (done) { playSource(BASIC_PATH + '02.mp3', done); }) @@ -205,6 +165,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0300', 0, async function (done) { playSource(BASIC_PATH + '03.mp3', done); }) @@ -221,6 +182,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP3_01_0400', 0, async function (done) { playSource(BASIC_PATH + '04.mp3', done); }) @@ -237,6 +199,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0100', 0, async function (done) { playSource(BASIC_PATH + '47.mp4', done); }) @@ -254,6 +217,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0300', 0, async function (done) { playSource(BASIC_PATH + '49.mp4', done); }) @@ -270,6 +234,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0400', 0, async function (done) { playSource(BASIC_PATH + '50.mp4', done); }) @@ -286,6 +251,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0500', 0, async function (done) { playSource(BASIC_PATH + '51.mp4', done); }) @@ -302,6 +268,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0600', 0, async function (done) { playSource(BASIC_PATH + '54.mp4', done); }) @@ -318,6 +285,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0700', 0, async function (done) { playSource(BASIC_PATH + '64.mp4', done); }) @@ -334,6 +302,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0800', 0, async function (done) { playSource(BASIC_PATH + '65.mp4', done); }) @@ -350,6 +319,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_0900', 0, async function (done) { playSource(BASIC_PATH + '66.mp4', done); }) @@ -366,6 +336,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1000', 0, async function (done) { playSource(BASIC_PATH + '67.mp4', done); }) @@ -382,6 +353,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1100', 0, async function (done) { playSource(BASIC_PATH + '92.mp4', done); }) @@ -398,6 +370,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1200', 0, async function (done) { playSource(BASIC_PATH + '93.mp4', done); }) @@ -414,6 +387,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1300', 0, async function (done) { playSource(BASIC_PATH + '94.mp4', done); }) @@ -430,6 +404,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1400', 0, async function (done) { playSource(BASIC_PATH + '96.mp4', done); }) @@ -446,6 +421,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1500', 0, async function (done) { playSource(BASIC_PATH + '97.mp4', done); }) @@ -462,6 +438,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_MP4_01_1600', 0, async function (done) { playSource(BASIC_PATH + '98.mp4', done); }) @@ -478,6 +455,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0100', 0, async function (done) { playSource(BASIC_PATH + '55.m4a', done); }) @@ -495,6 +473,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0300', 0, async function (done) { playSource(BASIC_PATH + '57.m4a', done); }) @@ -511,6 +490,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0400', 0, async function (done) { playSource(BASIC_PATH + '58.m4a', done); }) @@ -527,6 +507,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0500', 0, async function (done) { playSource(BASIC_PATH + '59.m4a', done); }) @@ -543,6 +524,7 @@ describe('PlayerLocalTestAudioFormat', function () { * @tc.type : Function test * @tc.level : Level0 */ + it('SUB_MEDIA_PLAYER_LOCAL_Format_M4A_01_0700', 0, async function (done) { playSource(BASIC_PATH + '62.m4a', done); }) diff --git a/multimedia/audio/audio_js_standard/audioPlayer_API/Test.json b/multimedia/audio/audio_js_standard/audioPlayer_API/Test.json index fc80660e91bc5480009260caa6319663a099a700..7477c27502d9a0d2f22e4939eea84644a205f271 100755 --- a/multimedia/audio/audio_js_standard/audioPlayer_API/Test.json +++ b/multimedia/audio/audio_js_standard/audioPlayer_API/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audioPlayerApi Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "3000000", + "test-timeout": "2000000", "package": "ohos.acts.multimedia.audio.audioplayerapi", "shell-timeout": "60000" }, @@ -12,39 +12,32 @@ "pre-push": [ ], "push": [ - "resource/audio/01.mp3 ->/data/media/", - "resource/audio/02.mp3 ->/data/media/", - "resource/audio/03.mp3 ->/data/media/", - "resource/audio/04.mp3 ->/data/media/", - "resource/audio/47.mp4 ->/data/media/", - "resource/audio/49.mp4 ->/data/media/", - "resource/audio/50.mp4 ->/data/media/", - "resource/audio/51.mp4 ->/data/media/", - "resource/audio/54.mp4 ->/data/media/", - "resource/audio/55.m4a ->/data/media/", - "resource/audio/57.m4a ->/data/media/", - "resource/audio/58.m4a ->/data/media/", - "resource/audio/59.m4a ->/data/media/", - "resource/audio/62.m4a ->/data/media/", - "resource/audio/64.mp4 ->/data/media/", - "resource/audio/65.mp4 ->/data/media/", - "resource/audio/66.mp4 ->/data/media/", - "resource/audio/67.mp4 ->/data/media/", - "resource/audio/92.mp4 ->/data/media/", - "resource/audio/93.mp4 ->/data/media/", - "resource/audio/94.mp4 ->/data/media/", - "resource/audio/96.mp4 ->/data/media/", - "resource/audio/97.mp4 ->/data/media/", - "resource/audio/98.mp4 ->/data/media/" + "./resource/audio/01.mp3 ->/data/media/", + "./resource/audio/02.mp3 ->/data/media/", + "./resource/audio/03.mp3 ->/data/media/", + "./resource/audio/04.mp3 ->/data/media/", + "./resource/audio/47.mp4 ->/data/media/", + "./resource/audio/49.mp4 ->/data/media/", + "./resource/audio/50.mp4 ->/data/media/", + "./resource/audio/51.mp4 ->/data/media/", + "./resource/audio/54.mp4 ->/data/media/", + "./resource/audio/55.m4a ->/data/media/", + "./resource/audio/57.m4a ->/data/media/", + "./resource/audio/58.m4a ->/data/media/", + "./resource/audio/59.m4a ->/data/media/", + "./resource/audio/62.m4a ->/data/media/", + "./resource/audio/64.mp4 ->/data/media/", + "./resource/audio/65.mp4 ->/data/media/", + "./resource/audio/66.mp4 ->/data/media/", + "./resource/audio/67.mp4 ->/data/media/", + "./resource/audio/92.mp4 ->/data/media/", + "./resource/audio/93.mp4 ->/data/media/", + "./resource/audio/94.mp4 ->/data/media/", + "./resource/audio/96.mp4 ->/data/media/", + "./resource/audio/97.mp4 ->/data/media/", + "./resource/audio/98.mp4 ->/data/media/" ] }, - { - "test-file-name": [ - "AudioPlayerApiJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, { "type": "ShellKit", "run-command": [ @@ -54,6 +47,13 @@ "teardown-command":[ "setenforce 1" ] + }, + { + "test-file-name": [ + "AudioPlayerApiJsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true } ] } \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/config.json b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/config.json index be538938268f0ce139731dd634a1907fb75d043b..79cbba9484460328d6259c480dbcc11841fa55f0 100755 --- a/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/config.json +++ b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/config.json @@ -1,60 +1,74 @@ { - "app": { - "bundleName": "ohos.acts.multimedia.audio.audioplayerapi", - "vendor": "acts", - "version": { - "code": 1, - "name": "1.0" + "app": { + "apiVersion": { + "compatible": 6, + "releaseType": "Beta1", + "target": 7 + }, + "vendor": "acts", + "bundleName": "ohos.acts.multimedia.audio.audioplayerapi", + "version": { + "code": 1000000, + "name": "1.0.0" + } }, - "apiVersion": { - "compatible": 6, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.acts.multimedia.audio.audioplayerapi", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" + "deviceConfig": { + "default": { + "debug": true + } }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } + "module": { + "abilities": [ + { + "iconId": 16777218, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "descriptionId": 16777217, + "visible": true, + "labelId": 16777216, + "icon": "$media:icon", + "name": "ohos.acts.multimedia.audio.audioplayerapi.MainAbility", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "homeAbility": true, + "launchType": "standard" + } ], - "visible": true, - "name": "ohos.acts.multimedia.audio.audioplayerapi.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" + "deviceType": [ + "phone", + "tablet", + "tv", + "wearable" ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } + "mainAbility": "ohos.acts.multimedia.audio.audioplayerapi.MainAbility", + "distro": { + "moduleType": "entry", + "installationFree": false, + "deliveryWithInstall": true, + "moduleName": "entry" + }, + "package": "ohos.acts.multimedia.audio.audioplayerapi", + "name": ".MyApplication", + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } } \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/java/ohos/acts/multimedia/audio/audioplayerapi/MainAbility.java b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/java/ohos/acts/multimedia/audio/audioplayerapi/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..4ef720132f1f38774c2e743e090a78bda6182787 --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/java/ohos/acts/multimedia/audio/audioplayerapi/MainAbility.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayerapi; + + import ohos.ace.ability.AceAbility; + import ohos.aafwk.content.Intent; + +/* + * java MainAbility + */ + + public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/java/ohos/acts/multimedia/audio/audioplayerapi/MyApplication.java b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/java/ohos/acts/multimedia/audio/audioplayerapi/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..30836c8d15b281d30fd2f559ac6e5fcf46e09ba9 --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/java/ohos/acts/multimedia/audio/audioplayerapi/MyApplication.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayerapi; + + import ohos.aafwk.ability.AbilityPackage; + +/* + * java MyApplication + */ + + public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/js/test/PlayerLocalTestAudioAPI.test.js b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/js/test/PlayerLocalTestAudioAPI.test.js index 6a91e1f0339b7d2b1ae2165dab6b1cd821aa7b88..926ad35a345a3660c3b025a3ab59b63b36fd6cce 100644 --- a/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/js/test/PlayerLocalTestAudioAPI.test.js +++ b/multimedia/audio/audio_js_standard/audioPlayer_API/src/main/js/test/PlayerLocalTestAudioAPI.test.js @@ -74,9 +74,10 @@ describe('PlayerLocalTestAudioAPI', function () { } } - function nextStep(mySteps) { + function nextStep(mySteps,done) { if (mySteps[0] == END_STATE) { - isTimeOut = true; + done(); + console.info('case to done'); return; } switch (mySteps[0]) { @@ -127,21 +128,20 @@ describe('PlayerLocalTestAudioAPI', function () { } } - function setSrcCallback(mySteps) { + function setCallback(mySteps, done) { + console.info(`case setCallback`); audioPlayer.on('dataLoad', () => { mySteps.shift(); console.info(`case dataLoad called`); expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.state).assertEqual('paused'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setPlayCallback(mySteps) { audioPlayer.on('play', () => { mySteps.shift(); console.info(`case play called`); + sleep(PLAY_TIME); console.info(`case play currentTime is ${audioPlayer.currentTime}`); expect(audioPlayer.duration).assertEqual(DURATION_TIME); if (mySteps[0] == FINISH_STATE) { @@ -149,31 +149,22 @@ describe('PlayerLocalTestAudioAPI', function () { return; } expect(audioPlayer.state).assertEqual('playing'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setPauseCallback(mySteps) { audioPlayer.on('pause', () => { mySteps.shift(); console.info(`case pause called`); console.info(`case pause currentTime is ${audioPlayer.currentTime}`); expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.state).assertEqual('paused'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setResetCallback(mySteps) { audioPlayer.on('reset', () => { mySteps.shift(); console.info(`case reset called`); expect(audioPlayer.state).assertEqual('idle'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setStopCallback(mySteps) { audioPlayer.on('stop', () => { if (mySteps[0] == RESET_STATE) { console.info(`case reset stop called`); @@ -184,11 +175,8 @@ describe('PlayerLocalTestAudioAPI', function () { expect(audioPlayer.currentTime).assertEqual(0); expect(audioPlayer.duration).assertEqual(DURATION_TIME); expect(audioPlayer.state).assertEqual('stopped'); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setSeekCallback(mySteps) { audioPlayer.on('timeUpdate', (seekDoneTime) => { if (typeof (seekDoneTime) == 'undefined') { console.info(`case seek filed,errcode is ${seekDoneTime}`); @@ -208,12 +196,9 @@ describe('PlayerLocalTestAudioAPI', function () { sleep(PLAY_STATE); } if ((seekDoneTime < audioPlayer.duration) || (audioPlayer.state == 'paused')) { - nextStep(mySteps); + nextStep(mySteps,done); } }); - } - - function setVolumeCallback(mySteps) { audioPlayer.on('volumeChange', () => { console.info(`case setvolume called`); mySteps.shift(); @@ -221,21 +206,15 @@ describe('PlayerLocalTestAudioAPI', function () { if (audioPlayer.state == 'playing') { sleep(PLAY_TIME); } - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setFinishCallback(mySteps) { audioPlayer.on('finish', () => { mySteps.shift(); expect(audioPlayer.state).assertEqual('stopped'); expect(audioPlayer.currentTime).assertClose(audioPlayer.duration, DELTA_TIME); console.info(`case finish called`); - nextStep(mySteps); + nextStep(mySteps,done); }); - } - - function setErrorCallback(mySteps) { audioPlayer.on('error', (err) => { console.info(`case error called,errName is ${err.name}`); console.info(`case error called,errCode is ${err.code}`); @@ -252,29 +231,10 @@ describe('PlayerLocalTestAudioAPI', function () { } else { mySteps.shift(); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); } }); - } - - function setCallback(mySteps, done) { - console.info(`case setCallback`); - setSrcCallback(mySteps); - setPlayCallback(mySteps); - setPauseCallback(mySteps); - setResetCallback(mySteps); - setStopCallback(mySteps); - setSeekCallback(mySteps); - setVolumeCallback(mySteps); - setFinishCallback(mySteps); - setErrorCallback(mySteps); - setTimeout(function() { - if (!isTimeOut) { - console.info(`case is time out!`); - expect(isTimeOut).assertTrue(); - } - done(); - }, TIME_OUT); + }; /* * @@ -285,7 +245,9 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0100', 0, async function (done) { + console.info(`case update`); let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, PLAY_STATE, END_STATE); initAudioPlayer(); setCallback(mySteps, done); @@ -300,6 +262,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, PLAY_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -315,6 +278,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, PLAY_STATE, END_STATE); initAudioPlayer(); @@ -330,6 +294,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Play_API_0400', 0, async function (done) { let mySteps = new Array(SRC_STATE, RESET_STATE, PLAY_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -345,6 +310,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0100', 0, async function (done) { let mySteps = new Array(PAUSE_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -360,6 +326,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, END_STATE); initAudioPlayer(); @@ -375,6 +342,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0300', 0, async function (done) { let mySteps = new Array(PLAY_STATE, STOP_STATE, PAUSE_STATE, ERROR_STATE, END_STATE); initAudioPlayer(); @@ -390,6 +358,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Pause_API_0400', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, PAUSE_STATE, END_STATE); initAudioPlayer(); @@ -405,6 +374,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0100', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, END_STATE); initAudioPlayer(); @@ -420,6 +390,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, STOP_STATE, END_STATE); initAudioPlayer(); @@ -435,6 +406,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Stop_API_0300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, STOP_STATE, END_STATE); initAudioPlayer(); @@ -450,6 +422,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0100', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, END_STATE); initAudioPlayer(); @@ -465,12 +438,14 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, SEEK_STATE, SEEK_TIME, END_STATE); initAudioPlayer(); setCallback(mySteps, done); audioPlayer.src = AUDIO_SOURCE; }) + /* * * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0300 * @tc.name : 03.seek(0) @@ -479,6 +454,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Seek_API_0300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, 0, END_STATE); initAudioPlayer(); @@ -494,6 +470,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Reset_API_0100', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -509,6 +486,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Reset_API_0200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RESET_STATE, END_STATE); initAudioPlayer(); @@ -524,12 +502,14 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0100', 0, async function (done) { var mySteps = new Array(VOLUME_STATE, VOLUME_VALUE, ERROR_STATE, END_STATE); initAudioPlayer(); setCallback(mySteps, done); audioPlayer.setVolume(VOLUME_VALUE); }) + /* * * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0200 * @tc.name : 02.play->setVolume @@ -538,12 +518,14 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0200', 0, async function (done) { var mySteps = new Array(SRC_STATE, PLAY_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE); initAudioPlayer(); setCallback(mySteps, done); audioPlayer.src = AUDIO_SOURCE; }) + /* * * @tc.number : SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0300 * @tc.name : 03.pause->setVolume @@ -552,6 +534,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_SetVolume_API_0300', 0, async function (done) { var mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, VOLUME_STATE, VOLUME_VALUE, END_STATE); initAudioPlayer(); @@ -567,6 +550,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0100', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -582,6 +566,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0200', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, PAUSE_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -597,6 +582,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0300', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, STOP_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -612,6 +598,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0400', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, SEEK_STATE, SEEK_TIME, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -627,6 +614,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Release_API_0400', 0, async function (done) { let mySteps = new Array(SRC_STATE, PLAY_STATE, RESET_STATE, RELEASE_STATE, END_STATE); initAudioPlayer(); @@ -642,6 +630,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Time_API_0100', 0, async function (done) { initAudioPlayer(); expect(audioPlayer.src).assertEqual(undefined); @@ -660,6 +649,7 @@ describe('PlayerLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_PLAYER_AudioPlayer_Time_API_0200', 0, async function (done) { initAudioPlayer(); audioPlayer.src = AUDIO_SOURCE; diff --git a/multimedia/audio/audio_js_standard/audioRecorder/Test.json b/multimedia/audio/audio_js_standard/audioRecorder/Test.json index cff6cf481367feb76250a2ca96ffc2e8b3996eab..7675546c9dce7f5b4835b5003d7ad45fbe00bb90 100644 --- a/multimedia/audio/audio_js_standard/audioRecorder/Test.json +++ b/multimedia/audio/audio_js_standard/audioRecorder/Test.json @@ -2,11 +2,21 @@ "description": "Configuration for audioRecorder Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "3000000", + "test-timeout": "1000000", "package": "ohos.acts.multimedia.audio.audiorecorder", "shell-timeout": "60000" }, "kits": [ + { + "type": "ShellKit", + "run-command": [ + "chmod -R 777 /data/accounts/account_0/appdata/recorder/*", + "setenforce 0" + ], + "teardown-command":[ + "setenforce 1" + ] + }, { "test-file-name": [ "AudioRecorderJsTest.hap" diff --git a/multimedia/audio/audio_js_standard/audioRecorder/src/main/config.json b/multimedia/audio/audio_js_standard/audioRecorder/src/main/config.json index c174b1630c79b8d7818a47189ecd2b00025ece5e..78acb01910d7bef0959a7ffb83b9ead3452bfb6f 100644 --- a/multimedia/audio/audio_js_standard/audioRecorder/src/main/config.json +++ b/multimedia/audio/audio_js_standard/audioRecorder/src/main/config.json @@ -1,60 +1,74 @@ { "app": { - "bundleName": "ohos.acts.multimedia.audio.audiorecorder", - "vendor": "acts", - "version": { - "code": 1, - "name": "1.0" - }, "apiVersion": { - "compatible": 6, - "target": 5 - } + "compatible": 6, + "releaseType": "Beta1", + "target": 7 + }, + "vendor": "acts", + "bundleName": "ohos.acts.multimedia.audio.audiorecorder", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": { + "default": { + "debug": true + } }, - "deviceConfig": {}, "module": { - "package": "ohos.acts.multimedia.audio.audiorecorder", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ + "abilities": [ { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] + "iconId": 16777218, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "descriptionId": 16777217, + "visible": true, + "labelId": 16777216, + "icon": "$media:icon", + "name": "ohos.acts.multimedia.audio.audiorecorder.MainAbility", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "homeAbility": true, + "launchType": "standard" } - ], - "visible": true, - "name": "ohos.acts.multimedia.audio.audiorecorder.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] + ], + "deviceType": [ + "phone", + "tablet", + "tv", + "wearable" + ], + "mainAbility": "ohos.acts.multimedia.audio.audiorecorder.MainAbility", + "distro": { + "moduleType": "entry", + "installationFree": false, + "deliveryWithInstall": true, + "moduleName": "entry" + }, + "package": "ohos.acts.multimedia.audio.audiorecorder", + "name": ".MyApplication", + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] } } \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java b/multimedia/audio/audio_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..84cb3efd1dba0d92d906a3624192afd6b887499a --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayer; + + import ohos.ace.ability.AceAbility; + import ohos.aafwk.content.Intent; + +/* + * java MainAbility + */ + + public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java b/multimedia/audio/audio_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..a735d0a33e16bdb4ae0194d12fb865e64207b88e --- /dev/null +++ b/multimedia/audio/audio_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package ohos.acts.multimedia.audio.audioplayer; + + import ohos.aafwk.ability.AbilityPackage; + +/* + * java MyApplication + */ + + public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } + } diff --git a/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js b/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js index cff24bbbde551cd449d363c27d2eeb2df59ffc73..d3f1310340d43a5d17c5db1e840f1667e9c6df32 100644 --- a/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js +++ b/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js @@ -52,10 +52,10 @@ describe('RecorderLocalTestAudioAPI', function () { audioRecorder = media.createAudioRecorder(); } - function nextStep(mySteps) { + function nextStep(mySteps,done) { if (mySteps[0] == END_STATE) { - console.info('case end!!!'); - isTimeOut = true; + done(); + console.info('case to done'); return; } switch (mySteps[0]) { @@ -95,72 +95,58 @@ describe('RecorderLocalTestAudioAPI', function () { } } - function setErrorCallback(mySteps) { - audioRecorder.on('error', (err) => { - console.info(`case error called,errName is ${err.name}`); - console.info(`case error called,errCode is ${err.code}`); - console.info(`case error called,errMessage is ${err.message}`); - console.info('case err returned in error() case callback'); - mySteps.shift(); - expect(mySteps[0]).assertEqual(ERROR_STATE); - mySteps.shift(); - nextStep(mySteps); - }); - } - - function setCallback(mySteps, done) { + function setCallback(mySteps, done) { audioRecorder.on('prepare', () => { console.info('setCallback prepare() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('start', () => { console.info('setCallback start() case callback is called'); + sleep(RECORDER_TIME); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('pause', () => { console.info('setCallback pause() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('resume', () => { console.info('setCallback resume() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('stop', () => { console.info('setCallback stop() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('reset', () => { console.info('setCallback reset() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('release', () => { console.info('setCallback release() case callback is called'); mySteps.shift(); - nextStep(mySteps); - audioRecorder = undefined; + nextStep(mySteps,done); }); - - setErrorCallback(mySteps); - setTimeout(function() { - if (!isTimeOut) { - console.info('case is time out!'); - expect(isTimeOut).assertTrue(); - } - mySteps = undefined; - done(); - }, TIME_OUT); + audioRecorder.on('error', (err) => { + console.info(`case error called,errName is ${err.name}`); + console.info(`case error called,errCode is ${err.code}`); + console.info(`case error called,errMessage is ${err.message}`); + mySteps.shift(); + expect(mySteps[0]).assertEqual(ERROR_STATE); + mySteps.shift(); + nextStep(mySteps,done); + }); } beforeAll(function () { @@ -188,6 +174,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_createAudioRecorder_API_0100', 0, async function (done) { let testAudioRecorder; expect(testAudioRecorder).assertNull(); @@ -204,6 +191,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100', 0, async function (done) { let testAudioRecorder= media.createAudioRecorder(); expect(testAudioRecorder != null).assertTrue(); @@ -219,6 +207,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(START_STATE, ERROR_STATE, PRE_STATE, END_STATE); @@ -234,6 +223,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, PRE_STATE, END_STATE); @@ -249,6 +239,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, END_STATE); @@ -264,6 +255,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, PRE_STATE, ERROR_STATE, STOP_STATE, @@ -280,6 +272,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, PRE_STATE, ERROR_STATE, PRE_STATE, ERROR_STATE, END_STATE); @@ -295,6 +288,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(START_STATE, ERROR_STATE, END_STATE); @@ -310,6 +304,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, END_STATE); @@ -325,6 +320,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0500', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE, END_STATE); @@ -340,6 +336,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, START_STATE, ERROR_STATE, END_STATE); @@ -355,6 +352,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, START_STATE, ERROR_STATE, @@ -371,6 +369,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Start_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, START_STATE, START_STATE, END_STATE); @@ -386,6 +385,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(STOP_STATE, ERROR_STATE, END_STATE); @@ -401,6 +401,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, END_STATE); @@ -416,6 +417,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, END_STATE); @@ -431,6 +433,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, STOP_STATE, ERROR_STATE, END_STATE); @@ -446,6 +449,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, STOP_STATE, ERROR_STATE, RESET_STATE, PRE_STATE, START_STATE, STOP_STATE, @@ -462,6 +466,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Stop_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, STOP_STATE, ERROR_STATE, @@ -478,6 +483,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(RESET_STATE, END_STATE); @@ -493,6 +499,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, RESET_STATE, END_STATE); @@ -508,6 +515,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, END_STATE); @@ -523,6 +531,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RESET_STATE, END_STATE); @@ -538,6 +547,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0800', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, RESET_STATE, PRE_STATE, START_STATE, RESET_STATE, PRE_STATE, START_STATE, @@ -554,6 +564,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Reset_API_0900', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RESET_STATE, RESET_STATE, END_STATE); @@ -569,6 +580,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0100', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(RELEASE_STATE, END_STATE); @@ -584,6 +596,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0200', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, RELEASE_STATE, END_STATE); @@ -599,6 +612,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0300', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RELEASE_STATE, END_STATE); @@ -614,6 +628,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0600', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, STOP_STATE, RELEASE_STATE, END_STATE); @@ -629,6 +644,7 @@ describe('RecorderLocalTestAudioAPI', function () { * @tc.type : Reliability * @tc.level : Level2 */ + it('SUB_MEDIA_RECORDER_AudioRecorder_Release_API_0700', 0, async function (done) { initAudioRecorder(); let mySteps = new Array(PRE_STATE, START_STATE, RESET_STATE, RELEASE_STATE, END_STATE); diff --git a/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js b/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js index ad6b610e5b018e84fa53634a57a74abf765e947e..5ead0c2fe77300c7ee23cc3d1376639a8f4e2e26 100644 --- a/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js +++ b/multimedia/audio/audio_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js @@ -77,9 +77,10 @@ describe('RecorderLocalTestAudioFUNC', function () { console.info('afterAll case'); }) - function nextStep(mySteps) { + function nextStep(mySteps,done) { if (mySteps[0] == END_STATE) { - isTimeOut = true; + done(); + console.info('case to done'); return; } switch (mySteps[0]) { @@ -118,72 +119,59 @@ describe('RecorderLocalTestAudioFUNC', function () { break; } } - - function setErrorCallback(mySteps) { - audioRecorder.on('error', (err) => { - console.info(`case error called,errName is ${err.name}`); - console.info(`case error called,errCode is ${err.code}`); - console.info(`case error called,errMessage is ${err.message}`); - mySteps.shift(); - expect(mySteps[0]).assertEqual(ERROR_STATE); - mySteps.shift(); - nextStep(mySteps); - }); - } function setCallback(mySteps, done) { audioRecorder.on('prepare', () => { console.info('setCallback prepare() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('start', () => { console.info('setCallback start() case callback is called'); sleep(RECORDER_TIME); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('pause', () => { console.info('setCallback pause() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('resume', () => { console.info('setCallback resume() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('stop', () => { console.info('setCallback stop() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('reset', () => { console.info('setCallback reset() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); audioRecorder.on('release', () => { console.info('setCallback release() case callback is called'); mySteps.shift(); - nextStep(mySteps); + nextStep(mySteps,done); }); - - setErrorCallback(mySteps); - setTimeout(function() { - if (!isTimeOut) { - console.info('case is time out!'); - expect(isTimeOut).assertTrue(); - } - mySteps = undefined; - done(); - }, TIME_OUT); + audioRecorder.on('error', (err) => { + console.info(`case error called,errName is ${err.name}`); + console.info(`case error called,errCode is ${err.code}`); + console.info(`case error called,errMessage is ${err.message}`); + mySteps.shift(); + expect(mySteps[0]).assertEqual(ERROR_STATE); + mySteps.shift(); + nextStep(mySteps,done); + }); } /* * @@ -194,6 +182,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0100', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test1.m4a'; initAudioRecorder(); @@ -210,6 +199,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0210', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test2.m4a'; audioConfig.numberOfChannels = CHANNEL_ONE; @@ -227,6 +217,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0220', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test3.m4a'; audioConfig.numberOfChannels = CHANNEL_TWO; @@ -244,6 +235,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0310', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test4.m4a'; audioConfig.audioSampleRate = 8000; // samplerate 8000 @@ -262,6 +254,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0320', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test5.mp4'; audioConfig.audioSampleRate = 32000; // samplerate 32000 @@ -281,6 +274,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0330', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test6.mp4'; audioConfig.audioSampleRate = 44100; // samplerate 44100 @@ -300,6 +294,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0340', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test7.m4a'; audioConfig.audioSampleRate = 64000; // samplerate 64000 @@ -319,6 +314,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0340', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test8.m4a'; audioConfig.audioSampleRate = 96000; // samplerate 96000 @@ -338,6 +334,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0410', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test9.mp4'; audioConfig.audioSampleRate = 22050; // samplerate 22050 @@ -358,6 +355,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0420', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test10.mp4'; audioConfig.audioSampleRate = 44100; // samplerate 44100 @@ -378,6 +376,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0430', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test11.m4a'; audioConfig.audioSampleRate = 44100; // samplerate 44100 @@ -398,6 +397,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0440', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test12.m4a'; audioConfig.audioSampleRate = 44100; // samplerate 44100 @@ -418,6 +418,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Codec_AAC_Function_0450', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test13.m4a'; audioConfig.audioSampleRate = 44100; // samplerate 44100 @@ -438,6 +439,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Format_MP4_Function_0200', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test14.mp4'; audioConfig.audioEncodeBitRate = 22050; // samplerate 22050 @@ -458,6 +460,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_Format_MP4_Function_0200', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test15.m4a'; audioConfig.audioEncodeBitRate = 22050; // samplerate 22050 @@ -478,6 +481,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_0100', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test16.m4a'; audioConfig.fileFormat = FORMAT_M4A; @@ -495,6 +499,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_0500', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test17.m4a'; audioConfig.fileFormat = FORMAT_M4A; @@ -512,6 +517,7 @@ describe('RecorderLocalTestAudioFUNC', function () { * @tc.type : Function * @tc.level : Level0 */ + it('SUB_MEDIA_RECORDER_LOCAL_AUDIO_Function_06_1100', 0, async function (done) { audioConfig.uri = BASIC_PATH + 'test18.mp4'; audioConfig.fileFormat = FORMAT_MP4;