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 1952095fa2a9064ceb61df7df62b69a26df49b3a..26a2b05d0e4c1f45f485122530a9f3142e6e7137 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,23 @@ import audio from '@ohos.multimedia.audio'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; describe('audioManger', function () { - console.info('Create AudioManger Object JS Framework'); + console.info('AudioFrameworkTest: Create AudioManger Object JS Framework'); const audioManager = audio.getAudioManager(); - 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'; + 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'; + + function sleep (ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } function displayDeviceProp(value, index, array) { var devRoleName; @@ -68,57 +72,58 @@ describe('audioManger', function () { } console.info(`AudioFrameworkTest: device role: ${devRoleName}`); - DEVICE_ROLE_VALUE = value.deviceRole; + deviceRoleValue = value.deviceRole; console.info(`AudioFrameworkTest: device type: ${devTypeName}`); - DEVICE_TYPE_VALUE = value.deviceType; + deviceTypeValue = value.deviceType; } beforeAll(function () { - console.info('beforeAll: Prerequisites at the test suite level'); + console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); }) - beforeEach(function () { - console.info('beforeEach: Prerequisites at the test case level'); + beforeEach(async function () { + console.info('AudioFrameworkTest: beforeEach: Prerequisites at the test case level'); + await sleep(100); }) - afterEach(function () { - console.info('afterEach: Test case-level clearance conditions'); + afterEach(async function () { + console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions'); + await sleep(100); }) afterAll(function () { - console.info('afterAll: Test suite-level cleanup condition'); + console.info('AudioFrameworkTest: 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 () { + * @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) { if(audioManager!=null){ - console.info('getAudioManger : PASS'); + console.info('AudioFrameworkTest: getAudioManger : PASS'); expect(true).assertTrue(); } else{ - console.info('getAudioManger : FAIL'); + console.info('AudioFrameworkTest: 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(); @@ -130,40 +135,40 @@ describe('audioManger', function () { const audioManager8 = audio.getAudioManager(); const audioManager9 = audio.getAudioManager(); const audioManager10 = audio.getAudioManager(); - const promise = audioManager.setVolume(AUDIO_MEDIA,LOW_VOL); + const promise = audioManager.setVolume(audioMedia,lowVol); promise.then(function () { - console.info('Media setVolume promise: successful'); - audioManager1.setVolume(AUDIO_MEDIA,HIGH_VOL); + console.info('AudioFrameworkTest: Media setVolume promise: successful'); + audioManager1.setVolume(audioMedia,highVol); console.info('AudioFrameworkTest:audioManager1 : Media setVolume promise: successful'); - audioManager2.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager2.setVolume(audioMedia,highVol); console.info('AudioFrameworkTest:audioManager2 : Media setVolume promise: successful'); - audioManager3.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager3.setVolume(audioMedia,highVol); console.info('AudioFrameworkTest:audioManager3 : Media setVolume promise: successful'); - audioManager4.setVolume(AUDIO_MEDIA,LOW_VOL); + audioManager4.setVolume(audioMedia,lowVol); console.info('AudioFrameworkTest:audioManager4 : Media setVolume promise: successful'); - audioManager5.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager5.setVolume(audioMedia,highVol); console.info('AudioFrameworkTest:audioManager5 : Media setVolume promise: successful'); - audioManager6.setVolume(AUDIO_MEDIA,LOW_VOL); + audioManager6.setVolume(audioMedia,lowVol); console.info('AudioFrameworkTest:audioManager6 : Media setVolume promise: successful'); - audioManager7.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager7.setVolume(audioMedia,highVol); console.info('AudioFrameworkTest:audioManager7 : Media setVolume promise: successful'); - audioManager8.setVolume(AUDIO_MEDIA,LOW_VOL); + audioManager8.setVolume(audioMedia,lowVol); console.info('AudioFrameworkTest:audioManager8 : Media setVolume promise: successful'); - audioManager9.setVolume(AUDIO_MEDIA,HIGH_VOL); + audioManager9.setVolume(audioMedia,highVol); console.info('AudioFrameworkTest:audioManager9 : Media setVolume promise: successful'); - audioManager10.setVolume(AUDIO_MEDIA,LOW_VOL); + audioManager10.setVolume(audioMedia,lowVol); console.info('AudioFrameworkTest:audioManager10 : Media setVolume promise: successful'); - audioManager.getVolume(AUDIO_MEDIA).then(function (data) { - if(data == LOW_VOL){ - console.info('Media getVolume Promise: PASS :' + data); + audioManager.getVolume(audioMedia).then(function (data) { + if(data == lowVol){ + console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Media getVolume Promise: FAIL :' + data); + console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }).catch((err) => { - console.info('Media getVolume Promise: Error :' + err.message); + console.info('AudioFrameworkTest: Media getVolume Promise: Error :' + err.message); }); }); await promise; @@ -171,25 +176,24 @@ 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(AUDIO_MEDIA,LOW_VOL); + const promise = audioManager.setVolume(audioMedia,lowVol); promise.then(function () { - console.info('Media setVolume promise: successful'); - audioManager.getVolume(AUDIO_MEDIA).then(function (data) { - if(data == LOW_VOL){ - console.info('Media getVolume Promise: PASS :' + data); + console.info('AudioFrameworkTest: Media setVolume promise: successful'); + audioManager.getVolume(audioMedia).then(function (data) { + if(data == lowVol){ + console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Media getVolume Promise: FAIL :' + data); + console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -199,25 +203,24 @@ 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(AUDIO_MEDIA,MAX_VOL); + const promise = audioManager.setVolume(audioMedia,maxVol); promise.then(function () { - console.info('Media setVolume promise: successful'); - audioManager.getVolume(AUDIO_MEDIA).then(function (data) { - if(data == MAX_VOL){ - console.info('Media getVolume Promise: PASS :' + data); + console.info('AudioFrameworkTest: Media setVolume promise: successful'); + audioManager.getVolume(audioMedia).then(function (data) { + if(data == maxVol){ + console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Media getVolume Promise: FAIL :' + data); + console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -227,26 +230,25 @@ 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(AUDIO_MEDIA,MIN_VOL); + const promise = audioManager.setVolume(audioMedia,minVol); promise.then(function () { - console.info('Media setVolume promise: successful'); + console.info('AudioFrameworkTest: Media setVolume promise: successful'); - audioManager.getVolume(AUDIO_MEDIA).then(function (data) { - if(data == MIN_VOL){ - console.info('Media getVolume Promise: PASS :' + data); + audioManager.getVolume(audioMedia).then(function (data) { + if(data == minVol){ + console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Media getVolume Promise: FAIL :' + data); + console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -256,55 +258,53 @@ 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('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'); + 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'); expect(false).assertTrue(); }).catch((err) => { - console.info('Media setVolume Promise:Out of range: PASS :' + err.message); - expect(VOL_ERROR_MESG).assertEqual(err.message); + console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: PASS :' + err.message); + expect(volErrorMesg).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(AUDIO_MEDIA,HIGH_VOL, (err) => { + audioManager.setVolume(audioMedia,highVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ${err.message}`); + console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else { console.info(`AudioFrameworkTest: callback : Media setVolume successful `); - audioManager.getVolume(AUDIO_MEDIA, (err, value) => { + audioManager.getVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == HIGH_VOL){ - console.info('callback : Media getVolume: PASS :' + value); + else if(value == highVol){ + console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media getVolume: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -315,34 +315,33 @@ 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(AUDIO_MEDIA,MAX_VOL, (err) => { + audioManager.setVolume(audioMedia,maxVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ${err.message}`); + console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else { console.info(`AudioFrameworkTest: callback : Media setVolume successful `); - audioManager.getVolume(AUDIO_MEDIA, (err, value) => { + audioManager.getVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == MAX_VOL){ - console.info('callback : Media getVolume: PASS :' + value); + else if(value == maxVol){ + console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media getVolume: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -353,34 +352,33 @@ 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(AUDIO_MEDIA,MIN_VOL, (err) => { + audioManager.setVolume(audioMedia,minVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ${err.message}`); + console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else { console.info(`AudioFrameworkTest: callback : Media setVolume successful `); - audioManager.getVolume(AUDIO_MEDIA, (err, value) => { + audioManager.getVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == MIN_VOL){ - console.info('callback : Media getVolume: PASS :' + value); + else if(value == minVol){ + console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media getVolume: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -391,22 +389,21 @@ 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(AUDIO_MEDIA,OUT_OF_RANGE_VOL, (err) => { + audioManager.setVolume(audioMedia,outOfRangeVol, (err) => { if (err) { - console.error(`setVolume: Out of range: Callback: PASS: ${err.message}`); - expect(VOL_ERROR_MESG).assertEqual(err.message); + console.error(`AudioFrameworkTest: setVolume: Out of range: Callback: PASS: ${err.message}`); + expect(volErrorMesg).assertEqual(err.message); } else{ - console.info('setVolume: callback : Media Out of range: FAIL'); + console.info('AudioFrameworkTest: setVolume: callback : Media Out of range: FAIL'); expect(false).assertTrue(); } done(); @@ -414,25 +411,24 @@ 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(AUDIO_RINGTONE,LOW_VOL); + const promise = audioManager.setVolume(audioRingtone,lowVol); promise.then(function () { - console.info('Ringtone setVolume promise: successful'); - audioManager.getVolume(AUDIO_RINGTONE).then(function (data) { - if(data == LOW_VOL){ - console.info('Ringtone getVolume Promise: PASS :' + data); + console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); + audioManager.getVolume(audioRingtone).then(function (data) { + if(data == lowVol){ + console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getVolume Promise: FAIL :' + data); + console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -442,25 +438,24 @@ 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(AUDIO_RINGTONE,MAX_VOL); + const promise = audioManager.setVolume(audioRingtone,maxVol); promise.then(function () { - console.info('Ringtone setVolume promise: successful'); - audioManager.getVolume(AUDIO_RINGTONE).then(function (data) { - if(data == MAX_VOL){ - console.info('Ringtone getVolume Promise: PASS :' + data); + console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); + audioManager.getVolume(audioRingtone).then(function (data) { + if(data == maxVol){ + console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getVolume Promise: FAIL :' + data); + console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -470,25 +465,24 @@ 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(AUDIO_RINGTONE,MIN_VOL); + const promise = audioManager.setVolume(audioRingtone,minVol); promise.then(function () { - console.info('Ringtone setVolume promise: successful'); - audioManager.getVolume(AUDIO_RINGTONE).then(function (data) { - if(data == MIN_VOL){ - console.info('Ringtone getVolume Promise: PASS :' + data); + console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); + audioManager.getVolume(audioRingtone).then(function (data) { + if(data == minVol){ + console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getVolume Promise: FAIL :' + data); + console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); expect(false).assertTrue(); } }); @@ -498,54 +492,52 @@ 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('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'); + 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'); expect(false).assertTrue(); }).catch((err) => { - console.info('Ringtone setVolume Promise:Out of range: PASS :' + (err.message)); - expect(VOL_ERROR_MESG).assertEqual(err.message); + console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: PASS :' + (err.message)); + expect(volErrorMesg).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(AUDIO_RINGTONE,HIGH_VOL, (err) => { + audioManager.setVolume(audioRingtone,highVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ${err.message}`); + console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); - audioManager.getVolume(AUDIO_RINGTONE, (err, value) => { + audioManager.getVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == HIGH_VOL){ - console.info('callback : Ringtone getVolume: PASS :' + value); + else if(value == highVol){ + console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone getVolume: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -556,34 +548,33 @@ 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(AUDIO_RINGTONE,MAX_VOL, (err) => { + audioManager.setVolume(audioRingtone,maxVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ${err.message}`); + console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); - audioManager.getVolume(AUDIO_RINGTONE, (err, value) => { + audioManager.getVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == MAX_VOL){ - console.info('callback : Ringtone getVolume: PASS :' + value); + else if(value == maxVol){ + console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone getVolume: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -594,33 +585,32 @@ 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(AUDIO_RINGTONE,MIN_VOL, (err) => { + audioManager.setVolume(audioRingtone,minVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ${err.message}`); + console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); } else{ console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); - audioManager.getVolume(AUDIO_RINGTONE, (err, value) => { + audioManager.getVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == MIN_VOL){ - console.info('callback : Ringtone getVolume: PASS :' + value); + else if(value == minVol){ + console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone getVolume: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -631,22 +621,21 @@ 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(AUDIO_RINGTONE,OUT_OF_RANGE_VOL, (err) => { + audioManager.setVolume(audioRingtone,outOfRangeVol, (err) => { if (err) { - console.error(`Out of range Volume: Callback: ${err.message}`); - expect(VOL_ERROR_MESG).assertEqual(err.message); + console.error(`AudioFrameworkTest: Out of range Volume: Callback: ${err.message}`); + expect(volErrorMesg).assertEqual(err.message); } else{ - console.info('Out of range Volume: callback : Ringtone set volume: FAIL'); + console.info('AudioFrameworkTest: Out of range Volume: callback : Ringtone set volume: FAIL'); expect(false).assertTrue(); } done(); @@ -654,45 +643,43 @@ 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('Media setVolume promise: Negative Value -1'); - await audioManager.setVolume(AUDIO_MEDIA,-1).then(() => { + console.info('AudioFrameworkTest: Media setVolume promise: Negative Value -1'); + await audioManager.setVolume(audioMedia,-1).then(() => { // Setting negative audio volume for error Scenario - console.info('Media setVolume Promise:Negative: FAIL'); + console.info('AudioFrameworkTest: Media setVolume Promise:Negative: FAIL'); expect(false).assertTrue(); }).catch((err) => { - console.info('Media setVolume Promise:Negative: PASS : ' + (err.message)); - expect(VOL_ERROR_MESG).assertEqual(err.message); + console.info('AudioFrameworkTest: Media setVolume Promise:Negative: PASS : ' + (err.message)); + expect(volErrorMesg).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(AUDIO_MEDIA,-1, (err) => { + audioManager.setVolume(audioMedia,-1, (err) => { // Setting negative audio volume for error Scenario if (err) { - console.error(`setVolume Callback: Negative: PASS: ${err.message}`); - expect(VOL_ERROR_MESG).assertEqual(err.message); + console.error(`AudioFrameworkTest: setVolume Callback: Negative: PASS: ${err.message}`); + expect(volErrorMesg).assertEqual(err.message); } else{ - console.info('setVolume callback : Media Negative: FAIL'); + console.info('AudioFrameworkTest: setVolume callback : Media Negative: FAIL'); expect(false).assertTrue(); } done(); @@ -700,45 +687,43 @@ 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('Ringtone setVolume promise: Negative'); - await audioManager.setVolume(AUDIO_RINGTONE,-1).then(() => { + console.info('AudioFrameworkTest: Ringtone setVolume promise: Negative'); + await audioManager.setVolume(audioRingtone,-1).then(() => { // Setting negative audio volume for error Scenario - console.info('Ringtone setVolume Promise:Negative: FAIL'); + console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: FAIL'); expect(false).assertTrue(); }).catch((err) => { - console.info('Ringtone setVolume Promise:Negative: PASS :' + (err.message)); - expect(VOL_ERROR_MESG).assertEqual(err.message); + console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: PASS :' + (err.message)); + expect(volErrorMesg).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(AUDIO_RINGTONE,-1, (err) => { + audioManager.setVolume(audioRingtone,-1, (err) => { // Setting negative audio volume for error Scenario if (err) { console.error(`AudioFrameworkTest:Ringtone setVolume Callback:Negative: PASS : ${err.message}`); - expect(VOL_ERROR_MESG).assertEqual(err.message); + expect(volErrorMesg).assertEqual(err.message); } else{ - console.info('setVolume: Negative: callback : Ringtone set volume: FAIL'); + console.info('AudioFrameworkTest: setVolume: Negative: callback : Ringtone set volume: FAIL'); expect(false).assertTrue(); } done(); @@ -753,17 +738,16 @@ 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,LOW_VOL); + const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol); promise.then(function () { audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) { - if(data == LOW_VOL){ - console.info('Media getVolume Promise: ENAME : PASS :' + data); + if(data == lowVol){ + console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Media getVolume Promise: ENAME : FAIL :' + data); + console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data); expect(false).assertTrue(); } }); @@ -773,33 +757,32 @@ 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,HIGH_VOL, (err) => { + audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ENAME : ${err.message}`); + console.error(`AudioFrameworkTest: 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(`Media: ENAME : Error ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media: ENAME : Error ${err.message}`); expect(false).assertTrue(); } - else if(value == HIGH_VOL){ - console.info('callback : Media getVolume: ENAME : PASS :' + value); + else if(value == highVol){ + console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media getVolume: ENAME : FAIL :' + value); + console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value); expect(false).assertTrue(); } done(); @@ -810,25 +793,24 @@ 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,HIGH_VOL); + const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol); promise.then(function () { - console.info('Ringtone setVolume promise: ENAME: successful'); + console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful'); audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) { - if(data == HIGH_VOL){ - console.info('Ringtone getVolume Promise: ENAME: PASS :' + data); + if(data == highVol){ + console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getVolume Promise: ENAME: FAIL :' + data); + console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :' + data); expect(false).assertTrue(); } }); @@ -838,33 +820,32 @@ 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,LOW_VOL, (err) => { + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ENAME: ${err.message}`); + console.error(`AudioFrameworkTest: 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(`Ringtone: ENAME: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == LOW_VOL){ - console.info('callback : Ringtone getVolume: ENAME: PASS :' + value); + else if(value == lowVol){ + console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone getVolume: ENAME: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -882,18 +863,17 @@ 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,LOW_VOL); + const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol); promise.then(function () { - audioManager.setVolume(audio.AudioVolumeType.RINGTONE,MAX_VOL); + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,maxVol); audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) { - if(data == LOW_VOL){ - console.info('Media getVolume Promise: ENAME : PASS :' + data); + if(data == lowVol){ + console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Media getVolume Promise: ENAME : FAIL :' + data); + console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data); expect(false).assertTrue(); } }); @@ -903,34 +883,33 @@ 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,HIGH_VOL, (err) => { + audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ENAME : ${err.message}`); + console.error(`AudioFrameworkTest: 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,LOW_VOL); + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol); audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => { if (err) { - console.error(`Media: ENAME : Error: ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media: ENAME : Error: ${err.message}`); expect(false).assertTrue(); } - else if(value == HIGH_VOL){ - console.info('callback : Media getVolume: ENAME : PASS :' + value); + else if(value == highVol){ + console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media getVolume: ENAME : FAIL :' + value); + console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value); expect(false).assertTrue(); } done(); @@ -941,26 +920,25 @@ 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,HIGH_VOL); + const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol); promise.then(function () { - console.info('Ringtone setVolume promise: ENAME: successful'); - audioManager.setVolume(audio.AudioVolumeType.MEDIA,LOW_VOL); + console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful'); + audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol); audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) { - if(data == HIGH_VOL){ - console.info('Ringtone getVolume Promise: ENAME: PASS :' + data); + if(data == highVol){ + console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getVolume Promise: ENAME: FAIL :' + data); + console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :' + data); expect(false).assertTrue(); } }); @@ -970,34 +948,33 @@ 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,LOW_VOL, (err) => { + audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => { if (err) { - console.error(`failed to set volume: Callback: ENAME: ${err.message}`); + console.error(`AudioFrameworkTest: 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,HIGH_VOL); + audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol); audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => { if (err) { - console.error(`Ringtone: ENAME: failed to get volume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`); expect(false).assertTrue(); } - else if(value == LOW_VOL){ - console.info('callback : Ringtone getVolume: ENAME: PASS :' + value); + else if(value == lowVol){ + console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone getVolume: ENAME: FAIL :' + value); + console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value); expect(false).assertTrue(); } done(); @@ -1008,23 +985,22 @@ 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(AUDIO_MEDIA); + const promise = audioManager.getMaxVolume(audioMedia); promise.then(function (data) { - if (data==MAX_VOL){ - console.info('Media getMaxVolume promise : PASS:' + data); + if (data==maxVol){ + console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Media getMaxVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1033,50 +1009,48 @@ 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(AUDIO_MEDIA, (err, value) => { + audioManager.getMaxVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media : failed to getMaxVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value=MAX_VOL){ - console.info('callback : Media: getMaxVolume : PASS:' + value); + else if (value==maxVol){ + console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media: getMaxVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); - }); - }) - - /* * - * @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(AUDIO_RINGTONE); + const promise = audioManager.getMaxVolume(audioRingtone); promise.then(function (data) { - if (data==MAX_VOL){ - console.info('Ringtone getMaxVolume promise : PASS:' + data); + if (data==maxVol){ + console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getMaxVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1085,26 +1059,25 @@ 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(AUDIO_RINGTONE, (err, value) => { + audioManager.getMaxVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value==MAX_VOL){ - console.info('callback : Ringtone: getMaxVolume : PASS:' + value); + else if (value==maxVol){ + console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1112,24 +1085,23 @@ 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(AUDIO_RINGTONE,LOW_VOL); - const promise = audioManager.getMaxVolume(AUDIO_MEDIA); + audioManager.setVolume(audioRingtone,lowVol); + const promise = audioManager.getMaxVolume(audioMedia); promise.then(function (data) { - if (data==MAX_VOL){ - console.info('Media getMaxVolume promise : PASS:' + data); + if (data==maxVol){ + console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Media getMaxVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1138,55 +1110,53 @@ 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(AUDIO_MEDIA,LOW_VOL); - const promise = audioManager.getMaxVolume(AUDIO_RINGTONE); + audioManager.setVolume(audioMedia,lowVol); + const promise = audioManager.getMaxVolume(audioRingtone); promise.then(function (data) { - if (data==MAX_VOL){ - console.info('Ringtone getMaxVolume promise : PASS:' + data); + if (data==maxVol){ + console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getMaxVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } - + }); await promise; done(); }) /* * - * @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(AUDIO_RINGTONE,LOW_VOL); - audioManager.getMaxVolume(AUDIO_MEDIA, (err, value) => { + audioManager.setVolume(audioRingtone,lowVol); + audioManager.getMaxVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media : failed to getMaxVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value=MAX_VOL){ - console.info('callback : Media: getMaxVolume : PASS:' + value); + else if (value==maxVol){ + console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media: getMaxVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1194,27 +1164,26 @@ 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(AUDIO_MEDIA,LOW_VOL); - audioManager.getMaxVolume(AUDIO_RINGTONE, (err, value) => { + audioManager.setVolume(audioMedia,lowVol); + audioManager.getMaxVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value==MAX_VOL){ - console.info('callback : Ringtone: getMaxVolume : PASS:' + value); + else if (value==maxVol){ + console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1222,24 +1191,23 @@ 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(AUDIO_MEDIA,LOW_VOL); - const promise = audioManager.getMaxVolume(AUDIO_MEDIA); + audioManager.setVolume(audioMedia,lowVol); + const promise = audioManager.getMaxVolume(audioMedia); promise.then(function (data) { - if (data==MAX_VOL){ - console.info('Media getMaxVolume promise : PASS:' + data); + if (data==maxVol){ + console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Media getMaxVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1248,24 +1216,23 @@ 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(AUDIO_RINGTONE,LOW_VOL); - const promise = audioManager.getMaxVolume(AUDIO_RINGTONE); + audioManager.setVolume(audioRingtone,lowVol); + const promise = audioManager.getMaxVolume(audioRingtone); promise.then(function (data) { - if (data==MAX_VOL){ - console.info('Ringtone getMaxVolume promise : PASS:' + data); + if (data==maxVol){ + console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getMaxVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1274,27 +1241,26 @@ 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(AUDIO_MEDIA,HIGH_VOL); - audioManager.getMaxVolume(AUDIO_MEDIA, (err, value) => { + audioManager.setVolume(audioMedia,highVol); + audioManager.getMaxVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media : failed to getMaxVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value=MAX_VOL){ - console.info('callback : Media: getMaxVolume : PASS:' + value); + else if (value==maxVol){ + console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media: getMaxVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1302,51 +1268,49 @@ 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(AUDIO_RINGTONE,HIGH_VOL); - audioManager.getMaxVolume(AUDIO_RINGTONE, (err, value) => { + audioManager.setVolume(audioRingtone,highVol); + audioManager.getMaxVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } - else if (value==MAX_VOL){ - console.info('callback : Ringtone: getMaxVolume : PASS:' + value); + else if (value==maxVol){ + console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); }); }) - + /* * - * @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(AUDIO_MEDIA); + const promise = audioManager.getMinVolume(audioMedia); promise.then(function (data) { - if (data==MIN_VOL){ - console.info('Media getMinVolume promise : PASS:' + data); + if (data==minVol){ + console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Media getMinVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1355,26 +1319,25 @@ 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(AUDIO_MEDIA, (err, value) => { + audioManager.getMinVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media : failed to getMinVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==MIN_VOL){ - console.info('callback : Media: getMinVolume : PASS:' + value); + else if (value==minVol){ + console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media: getMinVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1382,52 +1345,50 @@ 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(AUDIO_RINGTONE); + const promise = audioManager.getMinVolume(audioRingtone); promise.then(function (data) { - if (data==MIN_VOL){ - console.info('Ringtone getMinVolume promise : PASS:' + data); + if (data==minVol){ + console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getMinVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } - + }); await promise; done(); }) /* * - * @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(AUDIO_RINGTONE, (err, value) => { + audioManager.getMinVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone : failed to getMinVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==MIN_VOL){ - console.info('callback : Ringtone: getMinVolume : PASS:' + value); + else if (value==minVol){ + console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1435,24 +1396,23 @@ 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(AUDIO_RINGTONE,LOW_VOL); - const promise = audioManager.getMinVolume(AUDIO_MEDIA); + audioManager.setVolume(audioRingtone,lowVol); + const promise = audioManager.getMinVolume(audioMedia); promise.then(function (data) { - if (data==MIN_VOL){ - console.info('Media getMinVolume promise : PASS:' + data); + if (data==minVol){ + console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Media getMinVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1461,52 +1421,50 @@ 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(AUDIO_RINGTONE,LOW_VOL); - audioManager.getMinVolume(AUDIO_MEDIA, (err, value) => { + audioManager.setVolume(audioRingtone,lowVol); + audioManager.getMinVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media : failed to getMinVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==MIN_VOL){ - console.info('callback : Media: getMinVolume : PASS:' + value); + else if (value==minVol){ + console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media: getMinVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); }); }) - + /* * - * @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(AUDIO_MEDIA,HIGH_VOL); - const promise = audioManager.getMinVolume(AUDIO_RINGTONE); + audioManager.setVolume(audioMedia,highVol); + const promise = audioManager.getMinVolume(audioRingtone); promise.then(function (data) { - if (data==MIN_VOL){ - console.info('Ringtone getMinVolume promise : PASS:' + data); + if (data==minVol){ + console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getMinVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1515,27 +1473,26 @@ 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(AUDIO_MEDIA,LOW_VOL); - audioManager.getMinVolume(AUDIO_RINGTONE, (err, value) => { + audioManager.setVolume(audioMedia,lowVol); + audioManager.getMinVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone : failed to getMinVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==MIN_VOL){ - console.info('callback : Ringtone: getMinVolume : PASS:' + value); + else if (value==minVol){ + console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1543,53 +1500,51 @@ 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(AUDIO_MEDIA,LOW_VOL); - const promise = audioManager.getMinVolume(AUDIO_MEDIA); + audioManager.setVolume(audioMedia,lowVol); + const promise = audioManager.getMinVolume(audioMedia); promise.then(function (data) { - if (data==MIN_VOL){ - console.info('Media getMinVolume promise : PASS:' + data); + if (data==minVol){ + console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Media getMinVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); - } + } }); await promise; done(); }) /* * - * @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(AUDIO_MEDIA,HIGH_VOL); - audioManager.getMinVolume(AUDIO_MEDIA, (err, value) => { + audioManager.setVolume(audioMedia,highVol); + audioManager.getMinVolume(audioMedia, (err, value) => { if (err) { - console.error(`Media : failed to getMinVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==MIN_VOL){ - console.info('callback : Media: getMinVolume : PASS:' + value); + else if (value==minVol){ + console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Media: getMinVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1597,24 +1552,23 @@ 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(AUDIO_RINGTONE,LOW_VOL); - const promise = audioManager.getMinVolume(AUDIO_RINGTONE) + audioManager.setVolume(audioRingtone,lowVol); + const promise = audioManager.getMinVolume(audioRingtone) promise.then(function (data) { - if (data==MIN_VOL){ - console.info('Ringtone getMinVolume promise : PASS:' + data); + if (data==minVol){ + console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); } else{ - console.info('Ringtone getMinVolume promise : FAIL: ' + data); + console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); expect(false).assertTrue(); } }); @@ -1623,27 +1577,26 @@ 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(AUDIO_RINGTONE,LOW_VOL); - audioManager.getMinVolume(AUDIO_RINGTONE, (err, value) => { + audioManager.setVolume(audioRingtone,lowVol); + audioManager.getMinVolume(audioRingtone, (err, value) => { if (err) { - console.error(`Ringtone : failed to getMinVolume ${err.message}`); + console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } - else if (value==MIN_VOL){ - console.info('callback : Ringtone: getMinVolume : PASS:' + value); + else if (value==minVol){ + console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); expect(true).assertTrue(); } else{ - console.info('callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); expect(false).assertTrue(); } done(); @@ -1651,28 +1604,27 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; - const promise = audioManager.getDevices(1); + deviceRoleValue = null; + deviceTypeValue = null; + const promise = audioManager.getDevices(1); // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG promise.then(function (value) { - console.info('Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1681,29 +1633,28 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; - const promise = audioManager.getDevices(2); + deviceRoleValue = null; + deviceTypeValue = null; + const promise = audioManager.getDevices(2); // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG promise.then(function (value) { - console.info('Promise: getDevices INPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1712,30 +1663,29 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; - const promise = audioManager.getDevices(3); + deviceRoleValue = null; + deviceTypeValue = null; + const promise = audioManager.getDevices(3); // Getting all devies connected 3 = ALL_DEVICES_FLAG promise.then(function (value) { - console.info('Promise: getDevices ALL_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1743,35 +1693,34 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; - audioManager.getDevices(1, (err, value) => { + deviceRoleValue = null; + deviceTypeValue = null; + audioManager.getDevices(1, (err, value) => { // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG - console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); if (err) { - console.error(`Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } } @@ -1780,36 +1729,35 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; - audioManager.getDevices(2, (err, value) => { + deviceRoleValue = null; + deviceTypeValue = null; + audioManager.getDevices(2, (err, value) => { // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG - console.info('Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); if (err) { - console.error(`Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -1818,36 +1766,35 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; - audioManager.getDevices(3, (err, value) => { + deviceRoleValue = null; + deviceTypeValue = null; + audioManager.getDevices(3, (err, value) => { // Getting all devies connected 3 = ALL_DEVICES_FLAG - console.info('Callback: getDevices ALL_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); if (err) { - console.error(`Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('Callback: getDevices ALL_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -1856,28 +1803,27 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; + deviceRoleValue = null; + deviceTypeValue = null; const promise = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) promise.then(function (value) { - console.info('Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1886,58 +1832,56 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; + deviceRoleValue = null; + deviceTypeValue = null; const promise = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); promise.then(function (value) { - console.info('Promise: getDevices INPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); await promise; done(); }) - + /* * - * @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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; + deviceRoleValue = null; + deviceTypeValue = null; const promise = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); promise.then(function (value) { - console.info('Promise: getDevices ALL_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } }); @@ -1946,32 +1890,31 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; + deviceRoleValue = null; + deviceTypeValue = null; audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { - console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); if (err) { - console.error(`Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); expect(true).assertTrue(); } else{ - console.info('Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); expect(false).assertTrue(); } } @@ -1980,33 +1923,32 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; + deviceRoleValue = null; + deviceTypeValue = null; audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { - console.info('Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); if (err) { - console.error(`Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('Callback: getDevices INPUT_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -2015,32 +1957,31 @@ 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) { - DEVICE_ROLE_VALUE = null; - DEVICE_TYPE_VALUE = null; + deviceRoleValue = null; + deviceTypeValue = null; audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { - console.info('Callback: getDevices ALL_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); if (err) { - console.error(`Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else{ - console.info('Callback: getDevices ALL_DEVICES_FLAG'); + console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); - if (DEVICE_TYPE_VALUE != null && DEVICE_ROLE_VALUE != null){ - console.info('Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + if (deviceTypeValue != null && deviceRoleValue != null){ + console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); expect(true).assertTrue(); } else{ - console.info('Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); expect(false).assertTrue(); } } @@ -2049,26 +1990,25 @@ 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); + const promise = audioManager.setRingerMode(2); // Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL promise.then(function () { - console.info('Promise: setRingerMode RINGER_MODE_NORMAL'); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL'); audioManager.getRingerMode().then(function (value){ if(value==2){ - console.info('Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2078,26 +2018,25 @@ 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); + const promise = audioManager.setRingerMode(0); // Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT promise.then(function (){ - console.info('Promise: setRingerMode RINGER_MODE_SILENT'); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT'); audioManager.getRingerMode().then(function (value){ if(value==0){ - console.info('Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2107,26 +2046,25 @@ 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); + const promise = audioManager.setRingerMode(1); // Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE promise.then(function (){ - console.info('Promise: setRingerMode RINGER_MODE_VIBRATE'); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE'); audioManager.getRingerMode().then(function (value){ if(value==1){ - console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2136,34 +2074,33 @@ 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) => { + audioManager.setRingerMode(2, (err) => { // Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL - console.info('Callback : setRingerMode RINGER_MODE_NORMAL'); + console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL'); if (err) { - console.error(`setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); - } + } else{ audioManager.getRingerMode((err, value) => { if (err) { - console.error(`RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else if(value==2){ - console.info('Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2174,35 +2111,34 @@ 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) => { + audioManager.setRingerMode(0, (err) => { // Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT - console.info('Callback : setRingerMode RINGER_MODE_SILENT'); + console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT'); if (err) { - console.error(`setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); - } + } else{ audioManager.getRingerMode((err, value) => { if (err) { - console.error(`RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } if(value==0){ - console.info('Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2213,35 +2149,34 @@ 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) => { + audioManager.setRingerMode(1, (err) => { // Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE - console.info('Callback : setRingerMode RINGER_MODE_VIBRATE'); + console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE'); if (err) { - console.error(`setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); - } + } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } if(value==1){ - console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2252,25 +2187,24 @@ 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('Promise: setRingerMode RINGER_MODE_NORMAL'); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL'); audioManager.getRingerMode().then(function (value){ if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){ - console.info('Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2280,25 +2214,24 @@ 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('Promise: setRingerMode RINGER_MODE_SILENT'); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT'); audioManager.getRingerMode().then(function (value){ if(value==audio.AudioRingMode.RINGER_MODE_SILENT){ - console.info('Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2308,25 +2241,24 @@ 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('Promise: setRingerMode RINGER_MODE_VIBRATE'); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE'); audioManager.getRingerMode().then(function (value){ if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){ - console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } }); @@ -2336,33 +2268,32 @@ 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('Callback : setRingerMode RINGER_MODE_NORMAL'); + console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL'); if (err) { - console.error(`setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); - } + } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){ - console.info('Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2373,34 +2304,33 @@ 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('Callback : setRingerMode RINGER_MODE_SILENT'); + console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT'); if (err) { - console.error(`setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); - } + } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } if(value==audio.AudioRingMode.RINGER_MODE_SILENT){ - console.info('Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2411,34 +2341,33 @@ 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('Callback : setRingerMode RINGER_MODE_VIBRATE'); + console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE'); if (err) { - console.error(`setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); - } + } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){ - console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -2449,33 +2378,32 @@ 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(AUDIO_MEDIA,false, (err) => { + audioManager.mute(audioMedia,false, (err) => { if (err) { - console.error(`Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('Set Stream Mute: Media: Callback : FALSE'); - audioManager.isMute(AUDIO_MEDIA, (err, data) => { + console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : FALSE'); + audioManager.isMute(audioMedia, (err, data) => { if (err) { - console.error(`FALSE: Media : failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback : Is Stream Mute Media: FALSE: PASS: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : Is Stream Mute Media: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2486,62 +2414,60 @@ 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(AUDIO_MEDIA,false).then(function () { - console.log('Set Stream Mute: Media: Promise: FALSE'); - audioManager.isMute(AUDIO_MEDIA).then(function (data) { + await audioManager.mute(audioMedia,false).then(function () { + console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: FALSE'); + audioManager.isMute(audioMedia).then(function (data) { if(data==false){ - console.log('Promise: Is Stream Mute Media: FALSE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: Is Stream Mute Media: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: Is Stream Mute Media: FALSE: ERROR:' + err.message); + console.info('AudioFrameworkTest: 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(AUDIO_RINGTONE,false, (err) => { + audioManager.mute(audioRingtone,false, (err) => { if (err) { - console.error(`Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('Set Stream Mute: Ringtone: Callback : FALSE'); - audioManager.isMute(AUDIO_RINGTONE, (err, data) => { + console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : FALSE'); + audioManager.isMute(audioRingtone, (err, data) => { if (err) { - console.error(`FALSE: Ringtone : failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback : Is Stream Mute Ringtone: FALSE: PASS: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : Is Stream Mute Ringtone: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2552,62 +2478,60 @@ 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(AUDIO_RINGTONE,false).then(function () { - console.log('Set Stream Mute: Ringtone: Promise: FALSE'); - audioManager.isMute(AUDIO_RINGTONE).then(function (data) { + await audioManager.mute(audioRingtone,false).then(function () { + console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: FALSE'); + audioManager.isMute(audioRingtone).then(function (data) { if(data==false){ - console.log('Promise: Is Stream Mute Ringtone: FALSE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: Is Stream Mute Ringtone: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: Is Stream Mute Rington: FALSE: ERROR:' + err.message); + console.info('AudioFrameworkTest: 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(`Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect().assertFail(); } else { - console.log('Set Stream Mute: Media: ENAME: Callback : FALSE'); + console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Callback : FALSE'); audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, data) => { if (err) { - console.error(`FALSE: Media : ENAME: failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : FALSE: Media : ENAME: failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback : Is Stream Mute Media: ENAME: FALSE: PASS: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2618,62 +2542,60 @@ 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('Set Stream Mute: Media: ENAME: Promise: FALSE'); + console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE'); audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) { if(data==false){ - console.log('Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); + console.info('AudioFrameworkTest: 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(`Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect().assertFail(); } else { - console.log('Set Stream Mute: Ringtone: ENAME: Callback : FALSE'); + console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: ENAME: Callback : FALSE'); audioManager.isMute(audio.AudioVolumeType.RINGTONE, (err, data) => { if (err) { - console.error(`FALSE: Ringtone : ENAME: failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : ENAME: failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : Is Stream Mute Ringtone: ENAME: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2684,93 +2606,92 @@ 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('Set Stream Mute: Media: ENAME: Promise: FALSE'); + console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE'); audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) { if(data==false){ - console.log('Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message); + console.info('AudioFrameworkTest: 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(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) { + 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) { if(data==false){ - console.log('Promise: Is Stream Mute Media: SetVolume: PASS:'+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: Is Stream Mute Media: SetVolume: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: Is Stream Mute Media: SetVolume: ERROR:' + err.message); + console.info('AudioFrameworkTest: 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(AUDIO_MEDIA,true, (err) => { + audioManager.mute(audioMedia,true,async (err) => { if (err) { - console.error(`SetVolume: Media : failed to set Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`); expect().assertFail(); } else{ - console.log('Set Stream Mute: Media: Callback : TRUE'); - audioManager.setVolume(AUDIO_MEDIA,HIGH_VOL); - audioManager.isMute(AUDIO_MEDIA, (err, data) => { + console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : TRUE'); + await sleep(100); + await audioManager.setVolume(audioMedia,highVol); + await sleep(100); + audioManager.isMute(audioMedia, (err, data) => { if (err) { - console.error(`SetVolume: Media : failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback : Is Stream Mute Media: SetVolume: PASS: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : Is Stream Mute Media: SetVolume: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2781,64 +2702,62 @@ 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(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) { + await audioManager.mute(audioRingtone,true).then(async function () { + console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: SetVolume'); + await audioManager.setVolume(audioRingtone,highVol); + await audioManager.isMute(audioRingtone).then(function (data) { if(data==false){ - console.log('Promise: Is Stream Mute Ringtone: SetVolume: PASS:'+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: Is Stream Mute Ringtone: SetVolume: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: Is Stream Mute Ringtone: SetVolume: ERROR:' + err.message); + console.info('AudioFrameworkTest: 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(AUDIO_RINGTONE,true, (err) => { + audioManager.mute(audioRingtone,true, (err) => { if (err) { - console.error(`SetVolume: Ringtone : failed to set Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`); expect().assertFail(); } else { - console.log('Set Stream Mute: Ringtone: Callback : SetVolume'); - audioManager.setVolume(AUDIO_RINGTONE,LOW_VOL); - audioManager.isMute(AUDIO_RINGTONE, (err, data) => { + console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : SetVolume'); + audioManager.setVolume(audioRingtone,lowVol); + audioManager.isMute(audioRingtone, (err, data) => { if (err) { - console.error(`SetVolume: Ringtone : failed to get Mute Status ${err.message}`); + console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback : Is Stream Mute Ringtone: SetVolume: PASS: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : Is Stream Mute Ringtone: SetVolume: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2849,24 +2768,23 @@ 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('Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(AUDIO_MEDIA); + console.log('AudioFrameworkTest: Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + const promise = audioManager.isActive(audioMedia); promise.then(function (data) { if(data==false){ - console.log('Promise: isActive: Media: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: isActive: Media: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -2875,27 +2793,26 @@ 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('Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - audioManager.isActive(AUDIO_MEDIA, (err, data) => { + console.log('AudioFrameworkTest: Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + audioManager.isActive(audioMedia, (err, data) => { if (err) { - console.error(`Media : isActive: failed ${err.message}`); + console.error(`AudioFrameworkTest: Callback : Media : isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback: isActive: Media: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Callback: isActive: Media: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2903,24 +2820,23 @@ 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('Promise : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(AUDIO_RINGTONE); + console.log('AudioFrameworkTest: Promise : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + const promise = audioManager.isActive(audioRingtone); promise.then(function (data) { if(data==false){ - console.log('Promise: isActive: Ringtone: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: isActive: Ringtone: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -2929,27 +2845,26 @@ 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('Callback : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - audioManager.isActive(AUDIO_RINGTONE, (err, data) => { + console.log('AudioFrameworkTest: Callback : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + audioManager.isActive(audioRingtone, (err, data) => { if (err) { - console.error(`Ringtone : isActive: failed ${err.message}`); + console.error(`AudioFrameworkTest: Callback : Ringtone : isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback: isActive: Ringtone: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Callback: isActive: Ringtone: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -2957,24 +2872,23 @@ 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('Promise : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('AudioFrameworkTest: 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('Promise: isActive: Media: ENAME: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: isActive: Media: ENAME: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -2983,27 +2897,26 @@ 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('Callback : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('AudioFrameworkTest: 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(`Media : ENAME: isActive: failed ${err.message}`); + console.error(`AudioFrameworkTest: Callback : Media : ENAME: isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback: isActive: Media: ENAME: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Callback: isActive: Media: ENAME: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -3011,24 +2924,23 @@ 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('Promise : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('AudioFrameworkTest: 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('Promise: isActive: Ringtone: ENAME: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); @@ -3037,27 +2949,26 @@ 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('Callback : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log('AudioFrameworkTest: 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(`Ringtone : ENAME: isActive: failed ${err.message}`); + console.error(`AudioFrameworkTest: Callback : Ringtone : ENAME: isActive: failed ${err.message}`); expect().assertFail(); } else if(data==false){ - console.log('Callback: isActive: Ringtone: ENAME: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Callback: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -3065,91 +2976,88 @@ 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('setMicrophoneMute: Promise: TRUE'); + console.log('AudioFrameworkTest: setMicrophoneMute: Promise: TRUE'); audioManager.isMicrophoneMute().then(function (data) { if(data==true){ - console.log('Promise: isMicrophoneMute: TRUE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: isMicrophoneMute: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: setMicrophoneMute: TRUE: FAIL: Error :' + err.message); + console.info('AudioFrameworkTest: 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('setMicrophoneMute: Promise: FALSE'); + console.log('AudioFrameworkTest: setMicrophoneMute: Promise: FALSE'); audioManager.isMicrophoneMute().then(function (data) { if(data==false){ - console.log('Promise: isMicrophoneMute: FALSE: PASS:'+data); + console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: PASS:'+data); expect(true).assertTrue(); } else{ - console.log('Promise: isMicrophoneMute: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: FAIL: '+data); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Promise: setMicrophoneMute: FALSE: FAIL: Error :' + err.message); + console.info('AudioFrameworkTest: 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(`setMicrophoneMute: Callback : TRUE: Error : ${err.message}`); + console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : TRUE: Error : ${err.message}`); expect(false).assertTrue(); } - else { - console.log('setMicrophoneMute: Callback : TRUE'); + else { + console.log('AudioFrameworkTest: setMicrophoneMute: Callback : TRUE'); audioManager.isMicrophoneMute((err, data) => { if (err) { - console.error(`TRUE: isMicrophoneMute : Error ${err.message}`); + console.error(`AudioFrameworkTest: Callback : TRUE: isMicrophoneMute : Error ${err.message}`); expect(false).assertTrue(); } else if(data==true){ - console.log('Callback : isMicrophoneMute: TRUE: PASS: '+data); + console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : isMicrophoneMute: TRUE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -3160,33 +3068,32 @@ 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(`setMicrophoneMute: Callback : FALSE: Error : ${err.message}`); + console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : FALSE: Error : ${err.message}`); expect(false).assertTrue(); } else { - console.log('setMicrophoneMute: Callback : FALSE'); + console.log('AudioFrameworkTest: setMicrophoneMute: Callback : FALSE'); audioManager.isMicrophoneMute((err, data) => { if (err) { - console.error(`FALSE: isMicrophoneMute : Error ${err.message}`); + console.error(`AudioFrameworkTest: Callback : FALSE: isMicrophoneMute : Error ${err.message}`); expect(false).assertTrue(); } else if(data==false){ - console.log('Callback : isMicrophoneMute: FALSE: PASS: '+data); + console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: PASS: '+data); expect(true).assertTrue(); } else{ - console.log('Callback : isMicrophoneMute: FALSE: FAIL: '+data); + console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: FAIL: '+data); expect(false).assertTrue(); } done(); @@ -3197,151 +3104,146 @@ 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('Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate'); + console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate'); audioManager.isDeviceActive(7).then(function (value){ if(value==true){ - console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL : Error :' + err.message); + console.info('AudioFrameworkTest: 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('Device Test: Promise : setDeviceActive : SPEAKER: Deactivate'); + console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate'); audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value){ if(value==false){ - console.info('Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message); + console.info('AudioFrameworkTest: 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('Device Test: Promise : setDeviceActive : SPEAKER: Activate'); + console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate'); audioManager.isDeviceActive(2).then(function (value){ if(value==true){ - console.info('Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message); + console.info('AudioFrameworkTest: 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('Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate'); + console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate'); audioManager.isDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO).then(function (value){ if(value==false){ - console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :' + err.message); + console.info('AudioFrameworkTest: 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(`Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); + console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); audioManager.isDeviceActive(7,(err, value) => { if (err) { - console.error(`Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==true){ - console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3352,33 +3254,32 @@ 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(`Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); audioManager.isDeviceActive(2,(err, value) => { if (err) { - console.error(`Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==false){ - console.info('Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3389,33 +3290,32 @@ 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(`Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); audioManager.isDeviceActive(2,(err, value) => { if (err) { - console.error(`Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==true){ - console.info('Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3426,33 +3326,32 @@ 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(`Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); + console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); audioManager.isDeviceActive(7,(err, value) => { if (err) { - console.error(`Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value==false){ - console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); + console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3463,25 +3362,24 @@ 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('Audio Parameter Test: Promise : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PBits per sample').then(function (value){ if(value=='8 bit'){ - console.info('Promise: getAudioParameter: Bits per sample : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: Bits per sample : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : Bits per sample : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : Bits per sample : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3491,25 +3389,24 @@ 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('Audio Parameter Test: Promise : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PNumber').then(function (value){ if(value=='4800'){ - console.info('Promise: getAudioParameter: PNumber : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: PNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PNumber : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3519,25 +3416,24 @@ 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',LONG_VALUE); + const promise = audioManager.setAudioParameter('PLNumber',longValue); promise.then(function () { - console.info('Audio Parameter Test: Promise : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PLNumber').then(function (value){ - if(value==LONG_VALUE){ - console.info('Promise: getAudioParameter: PLNumber : PASS :' +value); + if(value==longValue){ + console.info('AudioFrameworkTest: Promise: getAudioParameter: PLNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PLNumber : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PLNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3547,25 +3443,24 @@ 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('Audio Parameter Test: Promise : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PDecimal').then(function (value){ if(value=='10.000000234324324324'){ - console.info('Promise: getAudioParameter: PDecimal : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: PDecimal : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PDecimal : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PDecimal : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3575,24 +3470,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('Audio Parameter Test: Promise : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('1212').then(function (value){ if(value=='PPNumber'){ - console.info('Promise: getAudioParameter: 1212 : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: 1212 : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : 1212 : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : 1212 : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3602,25 +3497,24 @@ 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('Audio Parameter Test: Promise : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('PSpecial').then(function (value){ if(value=='[]\:";<>?,./~!@#$%^*()_+-={}|'){ - console.info('Promise: getAudioParameter: PSpecial : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: PSpecial : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PSpecial : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PSpecial : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3630,33 +3524,32 @@ 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('Audio Parameter Test: Callback : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); if (err) { - console.error(`setAudioParameter: CBSample Rate : Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBSample Rate : Error: ${err.message}`); expect(false).assertTrue(); } - else{ + else{ audioManager.getAudioParameter('CBSample Rate', (err, value) => { if (err) { - console.error(`getAudioParameter: CBSample Rate: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBSample Rate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='16 bit'){ - console.info('Callback: getAudioParameter: CBSample Rate: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBSample Rate: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3667,33 +3560,32 @@ 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('Audio Parameter Test: Callback : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); if (err) { - console.error(`setAudioParameter: Special : Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setAudioParameter: Special : Error: ${err.message}`); expect(false).assertTrue(); } - else{ + else{ audioManager.getAudioParameter('Special', (err, value) => { if (err) { - console.error(`getAudioParam: Special: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParam: Special: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){ - console.info('Callback: getAudioParameter: Special: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: Special: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3704,33 +3596,32 @@ 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('Audio Parameter Test: Callback : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); if (err) { - console.error(`setAudioParameter: CBDecimal : Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBDecimal : Error: ${err.message}`); expect(false).assertTrue(); } - else{ + else{ audioManager.getAudioParameter('CBDecimal', (err, value) => { if (err) { - console.error(`getAudioParm: CBDecimal:Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback :getAudioParm: CBDecimal:Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='10000.21321432432432'){ - console.info('Callback: getAudioParameter: CBDecimal: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBDecimal: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3741,33 +3632,32 @@ 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('Audio Parameter Test: Callback :CBNumber : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Callback :CBNumber : setAudioParameter'); if (err) { - console.error(`setAudioParameter: CBNumber : Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBNumber : Error: ${err.message}`); expect(false).assertTrue(); } - else{ + else{ audioManager.getAudioParameter('CBNumber', (err, value) => { if (err) { - console.error(`getAudioParam: CBNumber: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParam: CBNumber: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='5454'){ - console.info('Callback: getAudioParameter: CBNumber: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBNumber: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3778,32 +3668,31 @@ 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', LONG_VALUE, (err) => { - console.info('Audio Parameter Test: Callback :CBLNumber : setAudioParameter'); + audioManager.setAudioParameter('CBLNumber', longValue, (err) => { + console.info('AudioFrameworkTest: Audio Parameter Test: Callback :CBLNumber : setAudioParameter'); if (err) { - console.error(`setAudioParameter: CBLNumber : Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBLNumber : Error: ${err.message}`); expect(false).assertTrue(); - } + } audioManager.getAudioParameter('CBLNumber', (err, value) => { if (err) { - console.error(`getAudioParameter: CBLNumber: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBLNumber: Error: ${err.message}`); expect(false).assertTrue(); } - else if(value==LONG_VALUE){ - console.info('Callback: getAudioParameter: CBLNumber: PASS :' +value); + else if(value==longValue){ + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBLNumber: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3813,32 +3702,31 @@ 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('Audio Parameter Test: Callback :345667 : setAudioParameter'); + console.info('AudioFrameworkTest: Audio Parameter Test: Callback :345667 : setAudioParameter'); if (err) { - console.error(`setAudioParameter: 345667 : Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : setAudioParameter: 345667 : Error: ${err.message}`); expect(false).assertTrue(); - } + } audioManager.getAudioParameter('345667', (err, value) => { if (err) { - console.error(`getAudioParameter: 345667: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: 345667: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='xyza'){ - console.info('Callback: getAudioParameter: 345667: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: 345667: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -3848,23 +3736,22 @@ 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('Promise: getAudioParameter: Bits per sample : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: Bits per sample : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : Bits per sample : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : Bits per sample : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3873,23 +3760,22 @@ 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('Promise: getAudioParameter: PNumber : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: PNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PNumber : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3898,23 +3784,22 @@ 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==LONG_VALUE){ - console.info('Promise: getAudioParameter: PLNumber : PASS :' +value); + if(value==longValue){ + console.info('AudioFrameworkTest: Promise: getAudioParameter: PLNumber : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PLNumber : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PLNumber : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3923,23 +3808,22 @@ 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('Promise: getAudioParameter: PDecimal : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: PDecimal : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PDecimal : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PDecimal : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3948,22 +3832,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('Promise: getAudioParameter: 1212 : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: 1212 : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : 1212 : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : 1212 : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3972,23 +3856,22 @@ 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('Promise: getAudioParameter: PSpecial : PASS :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter: PSpecial : PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Promise: getAudioParameter : PSpecial : FAIL :' +value); + console.info('AudioFrameworkTest: Promise: getAudioParameter : PSpecial : FAIL :' +value); expect(false).assertTrue(); } }); @@ -3997,26 +3880,25 @@ 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(`getAudioParameter: CBSample Rate: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBSample Rate: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='16 bit'){ - console.info('Callback: getAudioParameter: CBSample Rate: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBSample Rate: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -4024,26 +3906,25 @@ 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(`getAudioParameter: Special: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: Special: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){ - console.info('Callback: getAudioParameter: Special: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: Special: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -4051,26 +3932,25 @@ 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(`getAudioParameter: CBDecimal: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBDecimal: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='10000.21321432432432'){ - console.info('Callback: getAudioParameter: CBDecimal: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBDecimal: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -4078,26 +3958,25 @@ 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(`getAudioParameter: CBNumber: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBNumber: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='5454'){ - console.info('Callback: getAudioParameter: CBNumber: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBNumber: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -4105,26 +3984,25 @@ 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(`getAudioParameter: CBLNumber: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBLNumber: Error: ${err.message}`); expect(false).assertTrue(); } - else if(value==LONG_VALUE){ - console.info('Callback: getAudioParameter: CBLNumber: PASS :' +value); + else if(value==longValue){ + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: CBLNumber: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: FAIL :' +value); expect(false).assertTrue(); } done(); @@ -4132,30 +4010,409 @@ 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(`getAudioParameter: 345667: Error: ${err.message}`); + console.error(`AudioFrameworkTest: Callback : getAudioParameter: 345667: Error: ${err.message}`); expect(false).assertTrue(); } else if(value=='xyza'){ - console.info('Callback: getAudioParameter: 345667: PASS :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: PASS :' +value); expect(true).assertTrue(); } else{ - console.info('Callback: getAudioParameter: 345667: FAIL :' +value); + console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: FAIL :' +value); expect(false).assertTrue(); } done(); }); }) + /* * + * @tc.number : SUB_AUDIO_MANAGER_onVolumeChange_001 + * @tc.name : OnVolumeChange - setVolume - MEDIA + * @tc.desc : OnVolumeChange - setVolume - MEDIA + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_onVolumeChange_001', 0, async function (done) { + + audioManager.on('volumeChange',(VolumeEvent) => { + + console.log('AudioFrameworkTest: Volume Change Event is called'); + + switch (VolumeEvent.volumeType) { + case audio.AudioVolumeType.MEDIA: + console.info('AudioFrameworkTest: Audio Volume Type : MEDIA'); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + if(VolumeEvent.volume == lowVol){ + console.info('AudioFrameworkTest: MEDIA CallBack : PASS :' + VolumeEvent.volume); + expect(true).assertTrue(); + } + break; + default: + console.info('AudioFrameworkTest: Audio Volume Type : '+VolumeEvent.volumeType); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + expect(false).assertTrue(); + break; + } + }); + await audioManager.setVolume(audioMedia,lowVol); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_onVolumeChange_002 + * @tc.name : OnVolumeChange - setVolume - RINGTONE + * @tc.desc : OnVolumeChange - setVolume - RINGTONE + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_onVolumeChange_002', 0, async function (done) { + + audioManager.on('volumeChange',(VolumeEvent) => { + + console.log('AudioFrameworkTest: Volume Change Event is called'); + + switch (VolumeEvent.volumeType) { + case audio.AudioVolumeType.RINGTONE: + console.info('AudioFrameworkTest: Audio Volume Type : RINGTONE'); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + if(VolumeEvent.volume == lowVol){ + console.info('AudioFrameworkTest: RINGTONE CallBack : PASS :' + VolumeEvent.volume); + expect(true).assertTrue(); + } + break; + default: + console.info('AudioFrameworkTest: Audio Volume Type : '+VolumeEvent.volumeType); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + expect(false).assertTrue(); + break; + } + }); + await audioManager.setVolume(audioRingtone,lowVol); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_onVolumeChange_003 + * @tc.name : OnVolumeChange - setVolume - VOICE_CALL + * @tc.desc : OnVolumeChange - setVolume - VOICE_CALL + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_onVolumeChange_003', 0, async function (done) { + + audioManager.on('volumeChange',(VolumeEvent) => { + + console.log('AudioFrameworkTest: Volume Change Event is called'); + + switch (VolumeEvent.volumeType) { + case audio.AudioVolumeType.VOICE_CALL: + console.info('AudioFrameworkTest: Audio Volume Type : VOICE_CALL'); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + if(VolumeEvent.volume == minVol){ + console.info('AudioFrameworkTest: VOICE_CALL CallBack : PASS :' + VolumeEvent.volume); + expect(true).assertTrue(); + } + break; + default: + console.info('AudioFrameworkTest: Audio Volume Type : '+VolumeEvent.volumeType); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + expect(false).assertTrue(); + break; + } + }); + await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL,lowVol); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_onVolumeChange_004 + * @tc.name : OnVolumeChange - setVolume - VOICE_ASSISTANT + * @tc.desc : OnVolumeChange - setVolume - VOICE_ASSISTANT + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_onVolumeChange_004', 0, async function (done) { + + audioManager.on('volumeChange',(VolumeEvent) => { + + console.log('AudioFrameworkTest: Volume Change Event is called'); + + switch (VolumeEvent.volumeType) { + case audio.AudioVolumeType.VOICE_ASSISTANT: + console.info('AudioFrameworkTest: Audio Volume Type : VOICE_ASSISTANT'); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + if(VolumeEvent.volume == minVol){ + console.info('AudioFrameworkTest: VOICE_ASSISTANT CallBack : PASS :' + VolumeEvent.volume); + expect(true).assertTrue(); + } + break; + default: + console.info('AudioFrameworkTest: Audio Volume Type : '+VolumeEvent.volumeType); + console.info('AudioFrameworkTest: Audio Volume Number : '+VolumeEvent.volume); + console.info('AudioFrameworkTest: Audio Volume Update UI : '+VolumeEvent.updateUi); + expect(false).assertTrue(); + break; + } + }); + await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT,lowVol); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_RingerModeChange_001 + * @tc.name : RingerModeChange - RINGER_MODE_SILENT + * @tc.desc : RingerModeChange - RINGER_MODE_SILENT + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_RingerModeChange_001', 0, async function (done) { + + audioManager.on('ringerModeChange',(ringerMode) => { + + console.log('AudioFrameworkTest: RingerModeChange is called'); + + switch (ringerMode) { + case audio.AudioRingMode.RINGER_MODE_SILENT: + console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_SILENT : '+ringerMode); + expect(true).assertTrue(); + break; + default: + console.info('AudioFrameworkTest: Ringer Mode Changed : UNKNOWN '+ringerMode); + expect(false).assertTrue(); + break; + } + }); + await audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_RingerModeChange_002 + * @tc.name : RingerModeChange - RINGER_MODE_VIBRATE + * @tc.desc : RingerModeChange - RINGER_MODE_VIBRATE + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_RingerModeChange_002', 0, async function (done) { + + audioManager.on('ringerModeChange',(ringerMode) => { + + console.log('AudioFrameworkTest: RingerModeChange is called'); + + switch (ringerMode) { + case audio.AudioRingMode.RINGER_MODE_VIBRATE: + console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_VIBRATE : '+ringerMode); + expect(true).assertTrue(); + break; + default: + console.info('AudioFrameworkTest: Ringer Mode Changed : UNKNOWN '+ringerMode); + expect(false).assertTrue(); + break; + } + }); + await audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_RingerModeChange_001 + * @tc.name : RingerModeChange - RINGER_MODE_SILENT + * @tc.desc : RingerModeChange - RINGER_MODE_SILENT + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_RingerModeChange_001', 0, async function (done) { + + audioManager.on('ringerModeChange',(ringerMode) => { + console.log('AudioFrameworkTest: RingerModeChange is called'); + switch (ringerMode) { + case audio.AudioRingMode.RINGER_MODE_NORMAL: + console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_NORMAL : '+ringerMode); + expect(true).assertTrue(); + break; + default: + console.info('AudioFrameworkTest: Ringer Mode Changed : UNKNOWN '+ringerMode); + expect(false).assertTrue(); + break; + } + }); + await audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_001 + * @tc.name : InterruptType - INTERRUPT_TYPE_BEGIN + * @tc.desc : InterruptType - INTERRUPT_TYPE_BEGIN + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_001', 0, async function (done) { + + expect(audio.InterruptType.INTERRUPT_TYPE_BEGIN).assertEqual(1); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_002 + * @tc.name : InterruptType - INTERRUPT_TYPE_END + * @tc.desc : InterruptType - INTERRUPT_TYPE_END + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_002', 0, async function (done) { + + expect(audio.InterruptType.INTERRUPT_TYPE_END).assertEqual(2); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_003 + * @tc.name : InterruptHint - INTERRUPT_HINT_NONE + * @tc.desc : InterruptHint - INTERRUPT_HINT_NONE + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_003', 0, async function (done) { + + expect(audio.InterruptHint.INTERRUPT_HINT_NONE).assertEqual(0); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_004 + * @tc.name : InterruptHint - INTERRUPT_HINT_RESUME + * @tc.desc : InterruptHint - INTERRUPT_HINT_RESUME + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_004', 0, async function (done) { + + expect(audio.InterruptHint.INTERRUPT_HINT_RESUME).assertEqual(1); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_005 + * @tc.name : InterruptHint - INTERRUPT_HINT_PAUSE + * @tc.desc : InterruptHint - INTERRUPT_HINT_PAUSE + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_005', 0, async function (done) { + + expect(audio.InterruptHint.INTERRUPT_HINT_PAUSE).assertEqual(2); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_006 + * @tc.name : InterruptHint - INTERRUPT_HINT_STOP + * @tc.desc : InterruptHint - INTERRUPT_HINT_STOP + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_006', 0, async function (done) { + + expect(audio.InterruptHint.INTERRUPT_HINT_STOP).assertEqual(3); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_007 + * @tc.name : InterruptHint - INTERRUPT_HINT_DUCK + * @tc.desc : InterruptHint - INTERRUPT_HINT_DUCK + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_007', 0, async function (done) { + + expect(audio.InterruptHint.INTERRUPT_HINT_DUCK).assertEqual(4); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_008 + * @tc.name : InterruptHint - INTERRUPT_HINT_UNDUCK + * @tc.desc : InterruptHint - INTERRUPT_HINT_UNDUCK + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_008', 0, async function (done) { + + expect(audio.InterruptHint.INTERRUPT_HINT_UNDUCK).assertEqual(5); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_009 + * @tc.name : InterruptForceType - INTERRUPT_FORCE + * @tc.desc : InterruptForceType - INTERRUPT_FORCE + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_009', 0, async function (done) { + + expect(audio.InterruptForceType.INTERRUPT_FORCE).assertEqual(0); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_interrupt_010 + * @tc.name : InterruptForceType - INTERRUPT_SHARE + * @tc.desc : InterruptForceType - INTERRUPT_SHARE + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_interrupt_009', 0, async function (done) { + + expect(audio.InterruptForceType.INTERRUPT_SHARE).assertEqual(1); + await sleep(50); + done(); + }) + + }) \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js index e25000b08494d709d64f69ddebbed3dee639ca2d..61756caddd0793b41de691a277528438af782700 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js @@ -7855,4 +7855,350 @@ describe('audioRenderer', function () { }) + /* * + * @tc.number : SUB_AUDIO_RENDERER_Play_audio_108 + * @tc.name : AudioState - STATE_INVALID + * @tc.desc : AudioState - STATE_INVALID + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_RENDERER_Play_audio_108', 0, async function (done) { + + expect(audio.AudioState.STATE_INVALID).assertEqual(-1); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_RENDERER_Play_audio_109 + * @tc.name : AudioState - STATE_NEW + * @tc.desc : AudioState - STATE_NEW + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_RENDERER_Play_audio_109', 0, async function (done) { + + expect(audio.AudioState.STATE_NEW).assertEqual(0); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_RENDERER_Play_audio_110 + * @tc.name : AudioSampleFormat - STATE_FORMAT_INVALID + * @tc.desc : AudioSampleFormat - STATE_FORMAT_INVALID + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_RENDERER_Play_audio_110', 0, async function (done) { + + expect(audio.AudioSampleFormat.SAMPLE_FORMAT_INVALID).assertEqual(-1); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_RENDERER_Play_audio_111 + * @tc.name : SourceType - SOURCE_TYPE_INVALID + * @tc.desc : SourceType - SOURCE_TYPE_INVALID + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_RENDERER_Play_audio_111', 0, async function (done) { + + expect(audio.SourceType.SOURCE_TYPE_INVALID).assertEqual(-1); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_RENDERER_Play_audio_112 + * @tc.name : AudioRenderer - Pause - Callback + * @tc.desc : AudioRenderer - Pause - Callback + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_RENDERER_Play_audio_112', 0,async function (done) { + var AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + var AudioRendererInfo = { + content: audio.ContentType.CONTENT_TYPE_RINGTONE, + usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, + rendererFlags: 1 + } + + var AudioRendererOptions = { + streamInfo: AudioStreamInfo, + rendererInfo: AudioRendererInfo + } + var resultFlag = false; + + var audioRen; + await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + audioRen = data; + console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : '+err.message); + resultFlag = false; + }); + audioRen.on('stateChange',(AudioState) => { + + console.log('AudioFrameworkTest: Volume Change Event is called'); + + switch (AudioState) { + case audio.AudioState.STATE_PAUSED: + console.info('AudioFrameworkTest: state : STATE_PAUSED'); + resultFlag = true; + break; + default: + console.info('AudioFrameworkTest: state : '+AudioState); + break; + } + }); + await audioRen.start().then(async function () { + console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : '+err.message); + resultFlag=false; + }); + + await sleep(2000); + + audioRen.pause((err) => { + if (err) { + console.info('AudioFrameworkRenderLog: renderInstant Pause :ERROR : '+err.message); + resultFlag=false; + } + else{ + console.info('AudioFrameworkRenderLog: renderInstant Pause :SUCCESS '); + } + }); + await sleep(500); + + await audioRen.stop().then(async function () { + console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : '+err.message); + }); + await sleep(500); + + await audioRen.release().then(async function () { + console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: Renderer release :ERROR : '+err.message); + }); + await sleep(500) + + expect(resultFlag).assertTrue(); + + done(); + + }) + + /* * + * @tc.number : SUB_AUDIO_RENDERER_Play_audio_113 + * @tc.name : AudioRenderer - SetRenderRate - RENDER_RATE_DOUBLE - Callback + * @tc.desc : AudioRenderer - SetRenderRate - RENDER_RATE_DOUBLE - Callback + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_RENDERER_Play_audio_113', 0,async function (done) { + + var AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + var AudioRendererInfo = { + content: audio.ContentType.CONTENT_TYPE_RINGTONE, + usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, + rendererFlags: 1 + } + + var AudioRendererOptions = { + streamInfo: AudioStreamInfo, + rendererInfo: AudioRendererInfo + } + + var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + var AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; + + var resultFlag = true; + console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + + var audioRen; + await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + audioRen = data; + console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : '+err.message); + resultFlag=false; + }); + + console.info('AudioFrameworkRenderLog: AudioRenderer : Path : '+fpath); + + console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : '+audioRen.state); + + await audioManager.setAudioScene(AudioScene).then(async function () { + console.info('AudioFrameworkRenderLog: setAudioScene : SUCCESS '); + await audioManager.getAudioScene().then(async function (data) { + console.info('AudioFrameworkRenderLog: getAudioScene : Value : '+data); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: getAudioScene : ERROR : '+err.message); + resultFlag=false; + }); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: setAudioScene : ERROR : '+err.message); + resultFlag=false; + }); + + console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : '+audioRen.state); + + await audioRen.getStreamInfo().then(async function (audioParamsGet) { + console.info('AudioFrameworkRenderLog: Renderer getStreamInfo:'); + console.info('AudioFrameworkRenderLog: Renderer sampleFormat:' + audioParamsGet.sampleFormat); + console.info('AudioFrameworkRenderLog: Renderer samplingRate:' + audioParamsGet.samplingRate); + console.info('AudioFrameworkRenderLog: Renderer channels:' + audioParamsGet.channels); + console.info('AudioFrameworkRenderLog: Renderer encodingType:' + audioParamsGet.encodingType); + }).catch((err) => { + console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: '+err.message); + resultFlag = false; + }); + + await audioRen.getRendererInfo().then(async function (audioParamsGet) { + console.info('AudioFrameworkRenderLog: Renderer RendererInfo:'); + console.info('AudioFrameworkRenderLog: Renderer content type:' + audioParamsGet.content); + console.info('AudioFrameworkRenderLog: Renderer usage:' + audioParamsGet.usage); + console.info('AudioFrameworkRenderLog: Renderer rendererFlags:' + audioParamsGet.rendererFlags); + }).catch((err) => { + console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: '+err.message); + resultFlag = false; + }); + + await audioRen.start().then(async function () { + console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : '+err.message); + resultFlag=false; + }); + + + console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : '+audioRen.state); + + var bufferSize = await audioRen.getBufferSize(); + console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + + let ss = fileio.createStreamSync(fpath, 'r'); + console.info('AudioFrameworkRenderLog: File Path: ' + fpath); + let discardHeader = new ArrayBuffer(44); + ss.readSync(discardHeader); + let totalSize = fileio.statSync(fpath).size; + console.info('AudioFrameworkRenderLog: File totalSize size: ' +totalSize); + totalSize = totalSize-44; + console.info('AudioFrameworkRenderLog: File size : Removing header: ' +totalSize); + let rlen = 0; + while (rlen < totalSize) { + let buf = new ArrayBuffer(bufferSize); + rlen += ss.readSync(buf); + console.info('BufferAudioFramework: bytes read from file: ' +rlen); + await audioRen.write(buf); + if (rlen > (totalSize/2)){ + await audioManager.getAudioScene().then(async function (data) { + console.info('AudioFrameworkAudioScene: getAudioScene : Value : '+data); + }).catch((err) => { + console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : '+err.message); + resultFlag=false; + }); + } + if (rlen > (totalSize/2)){ + + audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_DOUBLE, (err) => { + if (err) { + console.info('AudioFrameworkAudioScene: setRenderRate : RENDER_RATE_DOUBLE : ERROR : '+err.message); + resultFlag=false; + } + else { + console.info('AudioFrameworkRenderLog: setRenderRate : RENDER_RATE_DOUBLE : SUCCESS'); + } + }); + } + } + console.info('AudioFrameworkRenderLog: Renderer after read'); + + audioRen.getRenderRate((err, data) => { + if (err) { + console.info('AudioFrameworkAudioScene: getRenderRate : RENDER_RATE_DOUBLE : ERROR : '+err.message); + resultFlag=false; + } + else if (data == audio.AudioRendererRate.RENDER_RATE_DOUBLE){ + console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_DOUBLE : PASS : '+data); + } + else{ + console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_DOUBLE : FAIL : '+data); + resultFlag=false; + } + }); + + await audioRen.drain().then(async function () { + console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + }).catch((err) => { + console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : '+err.message); + }); + + console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : '+audioRen.state); + + await audioRen.stop().then(async function () { + console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : '+err.message); + }); + + console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : '+audioRen.state); + + await audioRen.release().then(async function () { + console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + }).catch((err) => { + console.info('AudioFrameworkRenderLog: Renderer release :ERROR : '+err.message); + }); + + console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : '+audioRen.state); + + console.info('AudioFrameworkRenderLog: resultFlag : '+resultFlag); + + await sleep(500) + + expect(resultFlag).assertTrue(); + + done(); + + }) + + /* * + * @tc.number : SUB_AUDIO_RENDERER_Play_audio_114 + * @tc.name : AudioEncodingType - ENCODING_TYPE_INVALID + * @tc.desc : AudioEncodingType - ENCODING_TYPE_INVALID + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_RENDERER_Play_audio_114', 0, async function (done) { + + expect(audio.AudioEncodingType.ENCODING_TYPE_INVALID).assertEqual(-1); + await sleep(50); + done(); + }) + }) \ No newline at end of file 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 b52be32fec14c053a7324fdd02a2ebbedae75c20..bd8f457db1f222908b3e3f64d38b9b3af2f323c1 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 @@ -14,7 +14,7 @@ */ require('./AudioFramework.test.js') -require('./AudioPerf.test.js') +//require('./AudioPerf.test.js') require('./AudioRenderer.test.js') require('./SR000GHLLV.test.js') require('./AudioCall.test.js') diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/RingtonePlayer.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/RingtonePlayer.test.js index 94475214b490e8fba5a40e4b11592e44a8c96a27..73f2e285510fc43263a81129ff77e29f0bd064fc 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/RingtonePlayer.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/RingtonePlayer.test.js @@ -39,7 +39,7 @@ describe('audioManager',async function () { console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); console.info('AudioFrameworkTest: before get scanner instance'); let scannerObj = mediaLibrary.getScannerInstance(); - let path = "/data/media"; + let path = "/storage/media/100/local/files/media"; console.info('AudioFrameworkTest: before scan file'); const scanPromise = await scannerObj.scanDir(path); console.info('AudioFrameworkTest: before scan file'); @@ -97,7 +97,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager002', 0,async function(done){ console.log('AudioFrameworkTestSSMM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',0).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',0).then(function(){ console.info('AudioFrameworkTestSSM:enum: Set Ringtone Uri : SUCCESS: '); expect(true).assertTrue(); }).catch((err) => { @@ -144,7 +144,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_004', 0,async function(done){ console.log('AudioFrameworkTestSSMM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',multiSIM).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',multiSIM).then(function(){ console.info('AudioFrameworkTestSSM: enum: Set Ringtone Uri : SUCCESS: '); expect(true).assertTrue(); }).catch((err) => { @@ -191,7 +191,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_006', 0,async function(done){ console.log('AudioFrameworkTestSSMM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ console.info('AudioFrameworkTestSSM:ENAME: Set Ringtone Uri : SUCCESS: '); expect(true).assertTrue(); }).catch((err) => { @@ -266,7 +266,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_009', 0,async function(done){ console.log('AudioFrameworkTestSSM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM).then( function() { + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM).then( function() { console.info('AudioFrameworkTestSSM:Callback : ENAME: Set Ringtone Uri : SUCCESS: '); expect(true).assertTrue(); }).catch((err) => { @@ -355,7 +355,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_013', 0,async function(done){ console.log('AudioFrameworkTestRM: Set System Ringtone Uri'); - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',1,async(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',1,async(err) => { if(err) { console.error('AudioFrameworkTestSSM :enum: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); @@ -379,7 +379,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_014', 0,async function(done){ console.log('AudioFrameworkTestRM: Set System Ringtone Uri'); - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',0,async(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',0,async(err) => { if(err) { console.error('AudioFrameworkTestSSM: Callback :enum: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); @@ -514,7 +514,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_019', 0,async function(done){ console.log('AudioFrameworkTestRM: Set System Ringtone Uri'); - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM,async(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM,async(err) => { if(err) { console.error('AudioFrameworkTestSSM: Callback :ENAME: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); @@ -625,7 +625,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_023', 0,async function(done){ console.log('AudioFrameworkTestSSM: setSystemNotificationUri'); - await systemSoundManager.setSystemNotificationUri(null,'/data/media/test.mp3').then( function() { + await systemSoundManager.setSystemNotificationUri(null,'/storage/media/100/local/files/media/test.mp3').then( function() { console.info('AudioFrameworkTestSSM:Callback : setSystemNotificationUri : SUCCESS'); expect(true).assertTrue(); }).catch((err) => { @@ -646,7 +646,7 @@ describe('audioManager',async function () { it('SUB_AUDIO_MANAGER_SystemSoundManager_024', 0,async function(done){ console.log('AudioFrameworkTestRM: getSystemNotificationUri'); await systemSoundManager.getSystemNotificationUri(null).then(async function(data) { - if (data == '/data/media/test.mp3') { + if (data == '/storage/media/100/local/files/media/test.mp3') { console.info('AudioFrameworkTestSSM:enum: getSystemNotificationUri : SUCCESS : '+data); expect(true).assertTrue(); } @@ -687,7 +687,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_026', 0,async function(done){ console.log('AudioFrameworkTestRM: setSystemNotificationUri'); - systemSoundManager.setSystemNotificationUri(null,'/data/media/test.mp4',async(err) => { + systemSoundManager.setSystemNotificationUri(null,'/storage/media/100/local/files/media/test.mp4',async(err) => { if(err) { console.error('AudioFrameworkTestSSM : setSystemNotificationUri :ERROR: '+err.message); expect(false).assertTrue(); @@ -716,7 +716,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestSSM: Callback : getSystemNotificationUri :ERROR: '+err.message); expect(false).assertTrue(); } - else if(data == '/data/media/test.mp4'){ + else if(data == '/storage/media/100/local/files/media/test.mp4'){ console.info('AudioFrameworkTestSSM:Callback : getSystemNotificationUri : SUCCESS: '+data); expect(true).assertTrue(); } @@ -763,7 +763,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_029', 0,async function(done){ console.log('AudioFrameworkTestSSM: setSystemAlarmUri'); - await systemSoundManager.setSystemAlarmUri(null,'/data/media/test.mp3').then( function() { + await systemSoundManager.setSystemAlarmUri(null,'/storage/media/100/local/files/media/test.mp3').then( function() { console.info('AudioFrameworkTestSSM:Callback : setSystemAlarmUri : SUCCESS'); expect(true).assertTrue(); }).catch((err) => { @@ -784,7 +784,7 @@ describe('audioManager',async function () { it('SUB_AUDIO_MANAGER_SystemSoundManager_030', 0,async function(done){ console.log('AudioFrameworkTestRM: getSystemAlarmUri'); await systemSoundManager.getSystemAlarmUri(null).then(async function(data) { - if (data == '/data/media/test.mp3') { + if (data == '/storage/media/100/local/files/media/test.mp3') { console.info('AudioFrameworkTestSSM:enum: getSystemAlarmUri : SUCCESS :'+data); expect(true).assertTrue(); } @@ -825,7 +825,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_SystemSoundManager_032', 0,async function(done){ console.log('AudioFrameworkTestRM: setSystemAlarmUri'); - systemSoundManager.setSystemAlarmUri(null,'/data/media/test.mp4',async(err) => { + systemSoundManager.setSystemAlarmUri(null,'/storage/media/100/local/files/media/test.mp4',async(err) => { if(err) { console.error('AudioFrameworkTestSSM : setSystemAlarmUri :ERROR: '+err.message); expect(false).assertTrue(); @@ -854,7 +854,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestSSM: Callback : getSystemAlarmUri :ERROR: '+err.message); expect(false).assertTrue(); } - else if(data == '/data/media/test.mp4'){ + else if(data == '/storage/media/100/local/files/media/test.mp4'){ console.info('AudioFrameworkTestSSM:Callback : getSystemAlarmUri : SUCCESS: '+data); expect(true).assertTrue(); } @@ -891,6 +891,46 @@ describe('audioManager',async function () { done(); }) + /* * + * @tc.number : SUB_AUDIO_MANAGER_SystemSoundManager_035 + * @tc.name : getSystemRingtonePlayer - ERROR - Negative + * @tc.desc : getSystemRingtonePlayer - ERROR - Negative + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SystemSoundManager_035', 0,async function(done){ + console.log('AudioFrameworkTestRM: Get System Ringtone Player'); + await systemSoundManager.getSystemRingtonePlayer(null,-1).then(async function(data) { + console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : SUCCESS: ' + data); + expect(false).assertTrue(); + }).catch((err) => { + console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' + (err.message)); + expect(true).assertTrue(); + }); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_SystemSoundManager_036 + * @tc.name : getSystemRingtonePlayer - ERROR - OutOfRange + * @tc.desc : getSystemRingtonePlayer - ERROR - OutOfRange + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_SystemSoundManager_036', 0,async function(done){ + console.log('AudioFrameworkTestRM: Get System Ringtone Player'); + await systemSoundManager.getSystemRingtonePlayer(null,2).then(async function(data) { + console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : SUCCESS: ' + data); + expect(false).assertTrue(); + }).catch((err) => { + console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' + (err.message)); + expect(true).assertTrue(); + }); + done(); + }) + /* * * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_001 * @tc.name : setSystemRingtoneUri - promise RINGTONE_TYPE_DEFAULT ENAME @@ -901,10 +941,10 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_001', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - const promise = systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT); + const promise = systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set SUCCESS: ' + data); expect(true).assertTrue(); @@ -958,10 +998,10 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_003', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - const promise = systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT); + const promise = systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_MULTISIM).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set SUCCESS: ' + data); expect(true).assertTrue(); @@ -1118,10 +1158,10 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_009', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - const promise = systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',0); + const promise = systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',0); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,0).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set :enum SUCCESS: ' + data); expect(true).assertTrue(); @@ -1190,7 +1230,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_011',0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',-1).then(function () { + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',-1).then(function () { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set : enum : SUCCESS: '); expect(false).assertTrue(); }).catch((err) => { @@ -1235,7 +1275,7 @@ describe('audioManager',async function () { const promise = systemSoundManager.setSystemRingtoneUri(null,'xyz@123',0); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,0).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set :enum SUCCESS: ' + data); expect(false).assertTrue(); @@ -1266,10 +1306,10 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_014', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - const promise = systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT); + const promise = systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set :ENAME SUCCESS: ' + data); expect(true).assertTrue(); @@ -1352,10 +1392,10 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_017', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - const promise = systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM); + const promise = systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_MULTISIM).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set :ENAME SUCCESS: ' + data); expect(true).assertTrue(); @@ -1435,7 +1475,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_020', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',2).then(function (){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',2).then(function (){ }).catch((err) => { console.info('AudioFrameworkTestSSM: Ringtone set SRC Path set: enum ERROR: ' + err.message); expect(true).assertTrue(); @@ -1475,10 +1515,10 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_022', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - const promise = systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',1); + const promise = systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',1); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,1).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set :enum SUCCESS: ' + data); expect(true).assertTrue(); @@ -1542,10 +1582,10 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_024', 0,async function(done){ console.info('AudioFrameworkTestSSM: Starting Set RM path'); - const promise = systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',multiSIM); + const promise = systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',multiSIM); promise.then(function () { systemSoundManager.getSystemRingtoneUri(null,multiSIM).then(function (data) { - if(data == '/data/StarWars10s-1C-44100-2SW.wav') + if(data == '/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestSSM: Ringtone SRC Path set :enum SUCCESS: ' + data); expect(true).assertTrue(); @@ -1715,7 +1755,7 @@ describe('audioManager',async function () { }; console.log('AudioFrameworkTestRM: Configure RingtonePlayer : lowVol: Loop False'); - await ringtonePlayer.configure(ringtoneOptions).then (function() { + await ringtonePlayer.configure(ringtoneOptions).then(function() { console.log('AudioFrameworkTestRM: Configure RingtonePlayer : SUCCESS : '+ringtonePlayer.state); expect(true).assertTrue(); }).catch((err) => { @@ -1741,7 +1781,7 @@ describe('audioManager',async function () { }; console.log('AudioFrameworkTestRM: Configure RingtonePlayer : Vol outOfRangeVol : Loop False'); - await ringtonePlayer.configure(ringtoneOptions).then (function() { + await ringtonePlayer.configure(ringtoneOptions).then(function() { console.log('AudioFrameworkTestRM: Configure RingtonePlayer : SUCCESS :FAIL '+ringtonePlayer.state); expect(false).assertTrue(); }).catch((err) => { @@ -1767,7 +1807,7 @@ describe('audioManager',async function () { }; console.log('AudioFrameworkTestRM: Configure RingtonePlayer : Vol outOfRangeVol : Loop True'); - await ringtonePlayer.configure(ringtoneOptions).then (function() { + await ringtonePlayer.configure(ringtoneOptions).then(function() { console.log('AudioFrameworkTestRM: Configure RingtonePlayer : SUCCESS : '+ringtonePlayer.state); expect(false).assertTrue(); }).catch((err) => { @@ -1898,7 +1938,7 @@ describe('audioManager',async function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_RingtoneManager_036', 0,async function(done){ - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT,(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_DEFAULT,(err) => { if (err){ console.error('AudioFrameworkTestRM :Callback : Failed to set system ringtone '+err.message); } @@ -1909,7 +1949,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestRM :Callback: Failed to get system Ringtone Uri: ERROR '+err.message); expect(false).assertTrue(); } - else if(data=='/data/StarWars10s-1C-44100-2SW.wav') { + else if(data=='/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestRM :Callback: Get system Ringtone Uri : SUCCESS'); expect(true).assertTrue(); } @@ -2139,7 +2179,7 @@ describe('audioManager',async function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_RingtoneManager_043', 0,async function(done){ - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',0,(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',0,(err) => { if (err){ console.error('AudioFrameworkTestRM :Callback : Failed to set system ringtone '+err.message); expect(false).assertTrue(); @@ -2151,7 +2191,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestRM :Callback: enum: Get system Ringtone Uri: ERROR '+err.message); expect(false).assertTrue(); } - else if(data=='/data/StarWars10s-1C-44100-2SW.wav') { + else if(data=='/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestRM :Callback:enum: Get system Ringtone Uri : SUCCESS'); expect(true).assertTrue(); } @@ -2222,7 +2262,7 @@ describe('audioManager',async function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_RingtoneManager_045', 0,async function(done){ - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',-1,async(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',-1,async(err) => { if (err){ console.error('AudioFrameworkTestRM :Callback : Failed to set system ringtone '+err.message); expect(true).assertTrue(); @@ -2259,44 +2299,6 @@ describe('audioManager',async function () { }); }) - - -// /* * -// * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_049 -// * @tc.name : setSystemRingtoneUri - Callback Invalid - RINGTONE_TYPE_DEFAULT -// * @tc.desc : setSystemRingtoneUri - Callback Invalid uri -// * @tc.size : MEDIUM -// * @tc.type : Function -// * @tc.level : Level 0 -// */ -// it('SUB_AUDIO_MANAGER_RingtoneManager_049', 0,async function(done){ -// systemSoundManager.setSystemRingtoneUri(null,'xyz123',audio.RingtoneType.RINGTONE_TYPE_DEFAULT,async(err) => { -// if (err){ -// console.error('AudioFrameworkTestRM :Callback : Failed to set system ringtone '+err.message); -// } -// else{ -// console.info('AudioFrameworkTestRM :Callback: Set system Ringtone SUCCESS'); -// systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT, async(err,data) => { -// if (err){ -// console.error('AudioFrameworkTestRM :Callback: Failed to get system Ringtone Uri: ERROR '+err.message); -// expect(true).assertTrue(); -// } -// else if(data=='/data/StarWars10s-1C-44100-2SW.wav') { -// console.info('AudioFrameworkTestRM :Callback: Get system Ringtone Uri : PASS'); -// expect(false).assertTrue(); -// } -// else{ -// console.info('AudioFrameworkTestRM :Callback: Get system Ringtone Uri : FAIL'); -// expect(false).assertTrue(); -// } -// done(); -// await sleep(1000); -// }); -// } -// done(); -// }); -// }) - /* * * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_047 * @tc.name : getSystemRingtonePlayer -Callback Get State RINGTONE_TYPE_MULTISIM @@ -2459,7 +2461,7 @@ describe('audioManager',async function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_RingtoneManager_052', 0,async function(done){ - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',2,async(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',2,async(err) => { if (err){ console.error('AudioFrameworkTestRM :Callback : Failed to set system ringtone '+err.message); expect(true).assertTrue(); @@ -2517,7 +2519,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestRM :Callback: Failed to get system Ringtone Uri: ERROR '+err.message); expect(true).assertTrue(); } - else if(data=='/data/StarWars10s-1C-44100-2SW.wav') { + else if(data=='/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestRM :Callback: Get system Ringtone Uri : PASS'); expect(false).assertTrue(); } @@ -2542,7 +2544,7 @@ describe('audioManager',async function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_RingtoneManager_055', 0,async function(done){ - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',1,(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',1,(err) => { if (err){ console.error('AudioFrameworkTestRM :Callback : Failed to set system ringtone '+err.message); } @@ -2553,7 +2555,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestRM :Callback: enum: Failed to get system Ringtone Uri: ERROR '+err.message); expect(false).assertTrue(); } - else if(data=='/data/StarWars10s-1C-44100-2SW.wav'){ + else if(data=='/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav'){ console.info('AudioFrameworkTestRM :Callback:enum: Get system Ringtone Uri : SUCCESS'); expect(true).assertTrue(); } @@ -2812,7 +2814,7 @@ describe('audioManager',async function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_RingtoneManager_063', 0,async function(done){ - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM,async (err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM,async (err) => { if (err){ console.error('AudioFrameworkTestRM :Callback :ENAME: Failed to set system ringtone '+err.message); } @@ -2823,7 +2825,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestRM :Callback: ENAME: Failed to get system Ringtone Uri: ERROR '+err.message); expect(false).assertTrue(); } - else if(data=='/data/StarWars10s-1C-44100-2SW.wav') { + else if(data=='/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestRM :Callback: ENAME: Get system Ringtone Uri : PASS'); expect(true).assertTrue(); } @@ -2881,7 +2883,6 @@ describe('audioManager',async function () { expect(true).assertTrue(); } await sleep(1000); -// done(); }); }); }); @@ -2995,7 +2996,7 @@ describe('audioManager',async function () { ringtonePlayer.start().then(async function () { console.log('AudioFrameworkTestRM: Start RingtonePlayer : SUCCESS : '+ringtonePlayer.state); await sleep(1000); - ringtonePlayer.stop().then (function () { + ringtonePlayer.stop().then(function () { console.log('AudioFrameworkTestRM : Stop RingtonePlayer : SUCCESS :'+ringtonePlayer.state); expect(true).assertTrue(); }).catch((err) => { @@ -3114,7 +3115,7 @@ describe('audioManager',async function () { await ringtonePlayer.release().then(async function () { console.log('AudioFrameworkTestRM: Release RingtonePlayer : SUCCESS : '+ringtonePlayer.state); await sleep(2000); - await ringtonePlayer.start().then (function () { + await ringtonePlayer.start().then(function () { console.log('AudioFrameworkTestRM : Start RingtonePlayer : SUCCESS :'+ringtonePlayer.state); expect(false).assertTrue(); }).catch((err) => { @@ -3184,7 +3185,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_074', 0,async function(done){ console.log('AudioFrameworkTestSSMM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',1).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',1).then(function(){ console.info('AudioFrameworkTestSSM:enum:1:Set Ringtone Uri : SUCCESS: '); }).catch((err) => { console.error('AudioFrameworkTestSSM:enum:1:Set System Ringtone Uri :ERROR: '+err.message); @@ -3227,13 +3228,12 @@ describe('audioManager',async function () { expect(false).assertTrue(); } else if (data!==null){ - console.log('AudioFrameworkTestRM : Ringtone info content: Pass :'+data.content); - expect(true).assertTrue(); + console.log('AudioFrameworkTestRM : Ringtone info content: Pass :'+data.content); + expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTestRM : Ringtone info content: Fail :'+data.content); - expect(false).assertTrue(); - await sleep(100); + expect(false).assertTrue(); + await sleep(100); } }) done(); @@ -3273,13 +3273,12 @@ describe('audioManager',async function () { expect(false).assertTrue(); } else if (data!==null){ - console.log('AudioFrameworkTestRM : Ringtone info usage: Pass :'+data.content); - expect(true).assertTrue(); + console.log('AudioFrameworkTestRM : Ringtone info usage: Pass :'+data.content); + expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTestRM :Ringtone info usage: Fail :'+data.content); - expect(false).assertTrue(); - await sleep(100); + expect(false).assertTrue(); + await sleep(100); } }) done(); @@ -3295,8 +3294,8 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_079', 0,async function(done){ await ringtonePlayer.getAudioRendererInfo().then(function(data){ - console.info('AudioFrameworkTestRM : Ringtone info rendererFlags : '+data.rendererFlags); - expect(true).assertTrue(); + console.info('AudioFrameworkTestRM : Ringtone info rendererFlags : '+data.rendererFlags); + expect(true).assertTrue(); }).catch((err) => { console.log('AudioFrameworkTestRM : Ringtone info rendererFlags : '+err.message); expect(false).assertTrue(); @@ -3319,78 +3318,17 @@ describe('audioManager',async function () { expect(false).assertTrue(); } else if (data!==null){ - console.log('AudioFrameworkTestRM : Ringtone info rendererFlags: Pass :'+data.rendererFlags); - expect(true).assertTrue(); + console.log('AudioFrameworkTestRM : Ringtone info rendererFlags: Pass :'+data.rendererFlags); + expect(true).assertTrue(); } else{ - console.log('AudioFrameworkTestRM :Ringtone info rendererFlags: Fail :'+data.rendererFlags); - expect(false).assertTrue(); - await sleep(100); + expect(false).assertTrue(); + await sleep(100); } }); done(); }) -// /* * -// * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_081 -// * @tc.name : setSystemRingtoneUri - Promise- Null uri -Start -// * @tc.desc : setSystemRingtoneUri - Promise -// * @tc.size : MEDIUM -// * @tc.type : Function -// * @tc.level : Level 0 -// */ -// it('SUB_AUDIO_MANAGER_RingtoneManager_081', 0,async function(done){ -// console.log('AudioFrameworkTestSSMM: Set System Ringtone Uri'); -// await systemSoundManager.setSystemRingtoneUri(null,null,defaultRingtoneType).then(function(){ -// console.info('AudioFrameworkTestSSM: enum: Set Ringtone Uri : SUCCESS: '); -// ringtonePlayer.start().then(async function () { -// console.log('AudioFrameworkTestRM: Start RingtonePlayer : SUCCESS : '+ringtonePlayer.state); -// expect(false).assertTrue(); -// }).catch((err) => { -// console.log('AudioFrameworkTestRM: Start RingtonePlayer :ERROR: '+err.message); -// expect(true).assertTrue(); -// }); -// }).catch((err) => { -// console.error('AudioFrameworkTestSSM: enum: Set System Ringtone Uri :ERROR: '+err.message); -// expect(true).assertTrue(); -// }); -// done(); -// }) -// -// /* * -// * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_082 -// * @tc.name : setSystemRingtoneUri - Callback null uri Start -// * @tc.desc : setSystemRingtoneUri - Callback -// * @tc.size : MEDIUM -// * @tc.type : Function -// * @tc.level : Level 0 -// */ -// it('SUB_AUDIO_MANAGER_RingtoneManager_082', 0,async function(done){ -// console.log('AudioFrameworkTestRM: Set System Ringtone Uri'); -// systemSoundManager.setSystemRingtoneUri(null,null,0,async(err) => { -// if(err){ -// console.error('AudioFrameworkTestSSM: enum: Set System Ringtone Uri :ERROR: '+err.message); -// expect(true).assertTrue(); -// } -// else{ -// console.info('AudioFrameworkTestSSM: enum: Set Ringtone Uri : SUCCESS: '); -// console.log('AudioFrameworkTestRM: Start RingtonePlayer'); -// ringtonePlayer.start(async(err) => { -// if (err){ -// console.error('AudioFrameworkTestRM: Callback : Start RingtonePlayer :ERROR: '+err.message); -// expect(false).assertTrue(); -// } -// else{ -// console.log('AudioFrameworkTestRM: Callback : Start RingtonePlayer :SUCCESS : '+ringtonePlayer.state); -// expect(false).assertTrue(); -// } -// await sleep(1000); -// }); -// } -// }); -// done(); -// }) - /* * * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_083 * @tc.name : setSystemRingtoneUri - Promise invalid uri RINGTONE_TYPE_DEFAULT enum 0 @@ -3429,7 +3367,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_084', 0,async function(done){ console.log('AudioFrameworkTestSSMM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',-1).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',-1).then(function(){ console.info('AudioFrameworkTestSSM:enum: Negative Value :Set Ringtone Uri : SUCCESS: '); ringtonePlayer.start().then(async function () { @@ -3456,7 +3394,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_085', 0,async function(done){ console.log('AudioFrameworkTestRM: Set System Ringtone Uri'); - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',-1,(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',-1,(err) => { if(err) { console.error('AudioFrameworkTestRM: Callback :enum: Set System Ringtone Uri :ERROR: '+err.message); expect(true).assertTrue(); @@ -3489,7 +3427,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_085', 0,async function(done){ console.log('AudioFrameworkTestRM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',-1).then(function () { + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',-1).then(function () { console.log('AudioFrameworkTestRM: Set System Ringtone Uri : SUCCESS'); expect(false).assertTrue(); }).catch((err) => { @@ -3542,7 +3480,7 @@ describe('audioManager',async function () { * @tc.level : Level 0 */ it('SUB_AUDIO_MANAGER_RingtoneManager_087', 0,async function(done){ - systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM,(err) => { + systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',audio.RingtoneType.RINGTONE_TYPE_MULTISIM,(err) => { if (err){ console.error('AudioFrameworkTestRM :Callback : Failed to set system ringtone '+err.message); expect(false).assertTrue(); @@ -3555,7 +3493,7 @@ describe('audioManager',async function () { console.error('AudioFrameworkTestRM :Callback: enum: Failed to get system Ringtone Uri: ERROR '+err.message); expect(true).assertTrue(); } - else if(data=='/data/StarWars10s-1C-44100-2SW.wav') { + else if(data=='/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav') { console.info('AudioFrameworkTestRM :Callback:enum: Get system Ringtone Uri : SUCCESS'); expect(false).assertTrue(); } @@ -3581,7 +3519,7 @@ describe('audioManager',async function () { */ it('SUB_AUDIO_MANAGER_RingtoneManager_088', 0,async function(done){ console.log('AudioFrameworkTestSSMM: Set System Ringtone Uri'); - await systemSoundManager.setSystemRingtoneUri(null,'/data/StarWars10s-1C-44100-2SW.wav',0).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/StarWars10s-1C-44100-2SW.wav',0).then(function(){ console.info('AudioFrameworkTestSSM:enum:0:Set Ringtone Uri : SUCCESS: '); }).catch((err) => { console.error('AudioFrameworkTestSSM:enum:0:Set System Ringtone Uri :ERROR: '+err.message); @@ -3659,14 +3597,14 @@ describe('audioManager',async function () { console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' +err.message); expect(false).assertTrue(); }); - await systemSoundManager.setSystemRingtoneUri(null,'/data/media/test.mp3',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/media/test.mp3',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ console.info('AudioFrameworkTestSSM:enum: Set Ringtone Uri : SUCCESS: '); }).catch((err) => { console.error('AudioFrameworkTestSSM:enum: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); }); await systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { - if (data == '/data/media/test.mp3') { + if (data == '/storage/media/100/local/files/media/test.mp3') { console.info('AudioFrameworkTestSSM: enum Get Ringtone Uri : DEFAULT : SUCCESS: ' + data); } else { @@ -3739,14 +3677,14 @@ describe('audioManager',async function () { console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' +err.message); expect(false).assertTrue(); }); - await systemSoundManager.setSystemRingtoneUri(null,'/data/media/test.mp4',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/media/test.mp4',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ console.info('AudioFrameworkTestSSM:enum: Set Ringtone Uri : SUCCESS: '); }).catch((err) => { console.error('AudioFrameworkTestSSM:enum: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); }); await systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { - if (data == '/data/media/test.mp4') { + if (data == '/storage/media/100/local/files/media/test.mp4') { console.info('AudioFrameworkTestSSM: enum Get Ringtone Uri : DEFAULT : SUCCESS: ' + data); } else { @@ -3819,14 +3757,14 @@ describe('audioManager',async function () { console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' + (err.message)); expect(false).assertTrue(); }); - await systemSoundManager.setSystemRingtoneUri(null,'/data/media/test.mp3',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/media/test.mp3',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ console.info('AudioFrameworkTestSSM:enum: Set Ringtone Uri : SUCCESS: '); }).catch((err) => { console.error('AudioFrameworkTestSSM:enum: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); }); await systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { - if (data == '/data/media/test.mp3') { + if (data == '/storage/media/100/local/files/media/test.mp3') { console.info('AudioFrameworkTestSSM: enum Get Ringtone Uri : DEFAULT : SUCCESS: ' + data); } else { @@ -3903,14 +3841,14 @@ describe('audioManager',async function () { console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' + (err.message)); expect(false).assertTrue(); }); - await systemSoundManager.setSystemRingtoneUri(null,'/data/media/test.mp3',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/media/test.mp3',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ console.info('AudioFrameworkTestSSM:enum: Set Ringtone Uri : SUCCESS: '); }).catch((err) => { console.error('AudioFrameworkTestSSM:enum: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); }); await systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { - if (data == '/data/media/test.mp3') { + if (data == '/storage/media/100/local/files/media/test.mp3') { console.info('AudioFrameworkTestSSM: enum Get Ringtone Uri : DEFAULT : SUCCESS: ' + data); } else { @@ -3946,8 +3884,8 @@ describe('audioManager',async function () { /* * * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_094 - * @tc.name : Ringtone-Player - wav -Get Title - * @tc.desc : Configure & get title - Callback + * @tc.name : Ringtone-Player - mp4 -Get Title + * @tc.desc : Configure & get title * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 @@ -3966,14 +3904,14 @@ describe('audioManager',async function () { console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' + (err.message)); expect(false).assertTrue(); }); - await systemSoundManager.setSystemRingtoneUri(null,'/data/media/test.mp4',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/media/test.mp4',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ console.info('AudioFrameworkTestSSM:enum: Set Ringtone Uri : SUCCESS: '); }).catch((err) => { console.error('AudioFrameworkTestSSM:enum: Set System Ringtone Uri :ERROR: '+err.message); expect(false).assertTrue(); }); await systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { - if (data == '/data/media/test.mp4') { + if (data == '/storage/media/100/local/files/media/test.mp4') { console.info('AudioFrameworkTestSSM: enum Get Ringtone Uri : DEFAULT : SUCCESS: ' + data); } else { @@ -4006,6 +3944,70 @@ describe('audioManager',async function () { done(); }); + /* * + * @tc.number : SUB_AUDIO_MANAGER_RingtoneManager_095 + * @tc.name : Ringtone-Player - mp4 -Get Title - Callback + * @tc.desc : Configure & get title + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_RingtoneManager_095', 0,async function(done){ + var ringtonePlayerTemp; + var resultFlag; + + console.log('AudioFrameworkTestRM: Get System Ringtone Player'); + await systemSoundManager.getSystemRingtonePlayer(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(async function(data) { + ringtonePlayerTemp = data; + if (ringtonePlayerTemp !=null) { + console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : SUCCESS: ' + data); + } + }).catch((err) => { + console.info('AudioFrameworkTestSSM:ENAME: get Ringtone Player : ERROR :' + (err.message)); + expect(false).assertTrue(); + }); + await systemSoundManager.setSystemRingtoneUri(null,'/storage/media/100/local/files/media/test.mp4',audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function(){ + console.info('AudioFrameworkTestSSM:enum: Set Ringtone Uri : SUCCESS: '); + }).catch((err) => { + console.error('AudioFrameworkTestSSM:enum: Set System Ringtone Uri :ERROR: '+err.message); + expect(false).assertTrue(); + }); + await systemSoundManager.getSystemRingtoneUri(null,audio.RingtoneType.RINGTONE_TYPE_DEFAULT).then(function (data) { + if (data == '/storage/media/100/local/files/media/test.mp4') { + console.info('AudioFrameworkTestSSM: enum Get Ringtone Uri : DEFAULT : SUCCESS: ' + data); + } + else { + console.info('AudioFrameworkTestSSM: enum Get Ringtone Uri :DEFAULT : FAIL: ' + data); + } + }).catch((err) => { + console.info('AudioFrameworkTestSSM: enum Ringtone Get Ringtone ERROR: ' + err.message); + expect(false).assertTrue(); + }); + + ringtonePlayerTemp.getTitle((err, data) => { + if (err) { + console.error(`AudioFrameworkTestRM: getTitle : ERROR : ${err.message}`); + expect(false).assertTrue(); + } + else { + if (data == 'Galway') { + console.log('AudioFrameworkTestRM: TITLE : PASS : ' + data); + resultFlag = true; + } + else { + console.log('AudioFrameworkTestRM: TITLE : FAIL : ' + data); + resultFlag = false; + } + } + }); + + await sleep(100); + expect(resultFlag).assertTrue(); + console.log('AudioFrameworkTestRM: Release RingtonePlayer'); + await ringtonePlayerTemp.release(); + done(); + }); + }); diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHLLV.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHLLV.test.js index 59661bae4b24437452152ce0b79b0614ddbe1c9e..ae4b243d4b6a770eabf27225fa2fdc3ea14d6958 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHLLV.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHLLV.test.js @@ -57,7 +57,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition'); }) - function sleep (ms) { + function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -1483,7 +1483,7 @@ describe('audioCapturer', function () { expect(stateFlag).assertTrue(); done(); //return resultFlag; - }).catch ((err) => { + }).catch((err) => { console.info('AudioFrameworkRecLog: Capturer start :ERROR : '+err.message); stateFlag=false; }); @@ -1652,7 +1652,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRenderLog: stateFlag : '+stateFlag); expect(stateFlag).assertTrue(); done(); - }).catch ((err) => { + }).catch((err) => { console.info('AudioFrameworkRecLog: Capturer stop:ERROR : '+err.message); stateFlag=false }); @@ -3800,7 +3800,7 @@ describe('audioCapturer', function () { } } }); - await sleep (1000); + await sleep(1000); }) @@ -4237,7 +4237,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: Capturer encodingType:' + audioParamsGet.encodingType); setFlag = true; } - await sleep (100); + await sleep(100); done(); }); @@ -4462,7 +4462,7 @@ describe('audioCapturer', function () { setFlag = true; }).catch((err) => { setFlag = false; - console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: '+err.message);; + console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: '+err.message); }); await sleep(1000); audioCapGetgetCapturerInfo.release(async (err, value) => { @@ -4538,7 +4538,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: Capturer SourceType:' + audioParamsGet.source); console.info('AudioFrameworkRecLog: Capturer capturerFlags:' + audioParamsGet.capturerFlags); setFlag = true; - await sleep (100); + await sleep(100); done(); } }); @@ -5232,7 +5232,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); + await sleep(1000); audioCapCallBack.on('markReach', 5000, (position) => { if (position == 5000) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); @@ -5244,7 +5244,7 @@ describe('audioCapturer', function () { done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -5320,6 +5320,8 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); + audioCapCallBack.off('markReach'); + await sleep(1000); audioCapCallBack.release(async(err,value) => { console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); if (err){ @@ -5382,7 +5384,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); + await sleep(1000); audioCapCallBack.on('markReach', 1000, (position) => { if (position == 1000) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); @@ -5394,7 +5396,7 @@ describe('audioCapturer', function () { done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -5470,6 +5472,8 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); + audioCapCallBack.off('markReach'); + await sleep(1000); audioCapCallBack.release(async(err,value) => { console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); if (err){ @@ -5525,7 +5529,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); + await sleep(1000); audioCapCallBack.on('markReach', 10000, (position) => { if (position == 10000) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); @@ -5537,7 +5541,7 @@ describe('audioCapturer', function () { done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -5613,6 +5617,8 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); + audioCapCallBack.off('markReach'); + await sleep(1000); audioCapCallBack.release(async(err,value) => { console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); if (err){ @@ -5669,7 +5675,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); + await sleep(1000); audioCapCallBack.on('markReach', 100, (position) => { if (position == 100) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); @@ -5681,7 +5687,7 @@ describe('audioCapturer', function () { done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -5757,6 +5763,8 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); + audioCapCallBack.off('markReach'); + await sleep(1000); audioCapCallBack.release(async(err,value) => { console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); if (err){ @@ -5813,7 +5821,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); + await sleep(1000); audioCapCallBack.on('markReach', 1, (position) => { if (position == 1) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); @@ -5825,7 +5833,7 @@ describe('audioCapturer', function () { done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -5901,6 +5909,8 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); + audioCapCallBack.off('markReach'); + await sleep(1000); audioCapCallBack.release(async(err,value) => { console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); if (err){ @@ -5923,14 +5933,14 @@ describe('audioCapturer', function () { /* * - * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_LARGEVALUE_REACH_081 + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_0_REACH_080 * @tc.name : AudioCapturer-Check-READ_BUFFER * @tc.desc : AudioCapturer with read buffer * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0*/ - it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_LARGEVALUE_REACH_081', 0, async function (done) { + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_0_REACH_080', 0, async function (done) { var stateFlag ; var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; var AudioStreamInfo = { @@ -5958,9 +5968,9 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); - audioCapCallBack.on('markReach', 1234567890, (position) => { - if (position == 1234567890) { + await sleep(1000); + audioCapCallBack.on('markReach', 0, (position) => { + if (position == 0) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); console.info('AudioRenderLog: mark reached: ' + position); stateFlag = true; @@ -5970,7 +5980,7 @@ describe('audioCapturer', function () { done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -6046,6 +6056,8 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); + audioCapCallBack.off('markReach'); + await sleep(1000); audioCapCallBack.release(async(err,value) => { console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); if (err){ @@ -6067,16 +6079,15 @@ describe('audioCapturer', function () { }) - /* * - * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1000_084 + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_LARGEVALUE_REACH_081 * @tc.name : AudioCapturer-Check-READ_BUFFER * @tc.desc : AudioCapturer with read buffer * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0*/ - it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1000_084', 0, async function (done) { + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_LARGEVALUE_REACH_081', 0, async function (done) { var stateFlag ; var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; var AudioStreamInfo = { @@ -6104,17 +6115,19 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); - audioCapCallBack.on('periodReach',1000, (position) => { - if (position == "1000") { + await sleep(1000); + audioCapCallBack.on('markReach', 1234567890, (position) => { + if (position == 1234567890) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true ; + stateFlag = true; } else { stateFlag = false; + expect(stateFlag).assertTrue(); + done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -6190,58 +6203,37 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); - if (stateFlag == true) { - audioCapCallBack.release(async(err,value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err){ - console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); - stateFlag=false; - } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); - if ((audioCapCallBack.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - } else { - audioCapCallBack.release(async(err,value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err){ - console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); - stateFlag=false; - expect(stateFlag).assertTrue(); - } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); - if ((audioCapCallBack.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); - stateFlag=false; - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - } - + audioCapCallBack.off('markReach'); + await sleep(1000); + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + stateFlag = true; + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); }) /* * - * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1_085 + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_NEGATIVEVALUE_REACH_082 * @tc.name : AudioCapturer-Check-READ_BUFFER * @tc.desc : AudioCapturer with read buffer * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0*/ - it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1_085', 0, async function (done) { + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_NEGATIVEVALUE_REACH_082', 0, async function (done) { var stateFlag ; var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; var AudioStreamInfo = { @@ -6269,17 +6261,19 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); - audioCapCallBack.on('periodReach',1, (position) => { - if (position == "1") { + await sleep(1000); + audioCapCallBack.on('markReach', -2, (position) => { + if (position == -2) { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true ; + stateFlag = true; } else { stateFlag = false; + expect(stateFlag).assertTrue(); + done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -6355,58 +6349,38 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); - if (stateFlag == true) { - audioCapCallBack.release(async(err,value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err){ - console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); - stateFlag=false; - } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); - if ((audioCapCallBack.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - } else { - audioCapCallBack.release(async(err,value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err){ - console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); - stateFlag=false; - expect(stateFlag).assertTrue(); - } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); - if ((audioCapCallBack.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); - stateFlag=false; - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - } - + audioCapCallBack.off('markReach'); + await sleep(1000); + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + stateFlag = true; + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); }) + /* * - * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_223750_086 + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_STRINGVALUE_REACH_083 * @tc.name : AudioCapturer-Check-READ_BUFFER * @tc.desc : AudioCapturer with read buffer * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0*/ - it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_223750_086', 0, async function (done) { + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_STRINGVALUE_REACH_083', 0, async function (done) { var stateFlag ; var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; var AudioStreamInfo = { @@ -6434,17 +6408,19 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); } }); - await sleep (1000); - audioCapCallBack.on('periodReach',223750, (position) => { - if (position == 223750) { + await sleep(1000); + audioCapCallBack.on('markReach', "HARSHA", (position) => { + if (position == "HARSHA") { console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: periodReach: ' + position); - stateFlag = true ; + console.info('AudioRenderLog: mark reached: ' + position); + stateFlag = true; } else { stateFlag = false; + expect(stateFlag).assertTrue(); + done(); } }); - await sleep (1000); + await sleep(1000); audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); if (err){ @@ -6520,6 +6496,822 @@ describe('audioCapturer', function () { numBuffersToCapture--; } await sleep(3000); + audioCapCallBack.off('markReach'); + await sleep(1000); + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + stateFlag = true; + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + }) + + + /* * + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1000_084 + * @tc.name : AudioCapturer-Check-READ_BUFFER + * @tc.desc : AudioCapturer with read buffer + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0*/ + + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1000_084', 0, async function (done) { + var stateFlag ; + var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; + var AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + var AudioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 1 + } + + var AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + + audio.createAudioCapturer(AudioCapturerOptions,async(err,value) => { + if (err){ + console.info('AudioFrameworkRecLog: AudioCapturer Not Created : Fail : Stream Type: FAIL'); + } else { + audioCapCallBack = value; + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + } + }); + await sleep(1000); + audioCapCallBack.on('periodReach',1000, (position) => { + if (position == "1000") { + console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); + console.info('AudioRenderLog: mark reached: ' + position); + stateFlag = true ; + } else { + stateFlag = false; + } + }); + await sleep(1000); + audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { + console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); + if (err){ + console.info('AudioFrameworkRecLog: setAudioScene : ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: setAudioScene : SUCCESS '); + console.info('AudioFrameworkRecLog: setAudioScene : Value : '+setValue); + console.info('AudioFrameworkRecLog: getAudioScene : Value : startawait'); + console.info('AudioFrameworkRecLog: getAudioScene : Value : initaitestart'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + if ((audioCapCallBack.state == 1)) { + stateFlag = true; + } + } + }); + await sleep(1000); + audioCapCallBack.start(async (err,value) => { + console.info('AudioFrameworkRecLog: AudioCapturer : START SUCCESS'); + console.info('AudioFrameworkRecLog: ---------START---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); + if ((audioCapCallBack.state == 2)) { + stateFlag = true; + } + } + }); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); + var bufferSize = await audioCapCallBack.getBufferSize(); + console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); + var fd = fileio.openSync(fpath, 0o102, 0o777); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd created'); + }else{ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '); + stateFlag=false; + } + console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); + fd = fileio.openSync(fpath, 0o2002, 0o666); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); + } else { + console.info('AudioFrameworkRecLog: file fd Open: Append Mode : FAILED'); + stateFlag=false; + } + await sleep(1000); + var numBuffersToCapture = 250; + while (numBuffersToCapture) { + console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); + audioCapCallBack.read(bufferSize, true,async(err,buffer) => { + if (err) { + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); + console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : '+buffer); + await sleep(50); + console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); + var number = fileio.writeSync(fd, buffer); + console.info('BufferRecLog: data written: ' + number); + await sleep(100); + stateFlag=true; + } + }); + numBuffersToCapture--; + } + await sleep(3000); + audioCapCallBack.off('periodReach'); + await sleep(1000); + if (stateFlag == true) { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + stateFlag = true; + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } else { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + expect(stateFlag).assertTrue(); + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + stateFlag=false; + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } + + }) + + /* * + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1_085 + * @tc.name : AudioCapturer-Check-READ_BUFFER + * @tc.desc : AudioCapturer with read buffer + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0*/ + + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_1_085', 0, async function (done) { + var stateFlag ; + var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; + var AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + var AudioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 1 + } + + var AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + + audio.createAudioCapturer(AudioCapturerOptions,async(err,value) => { + if (err){ + console.info('AudioFrameworkRecLog: AudioCapturer Not Created : Fail : Stream Type: FAIL'); + } else { + audioCapCallBack = value; + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + } + }); + await sleep(1000); + audioCapCallBack.on('periodReach',1, (position) => { + if (position == "1") { + console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); + console.info('AudioRenderLog: mark reached: ' + position); + stateFlag = true ; + } else { + stateFlag = false; + } + }); + await sleep(1000); + audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { + console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); + if (err){ + console.info('AudioFrameworkRecLog: setAudioScene : ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: setAudioScene : SUCCESS '); + console.info('AudioFrameworkRecLog: setAudioScene : Value : '+setValue); + console.info('AudioFrameworkRecLog: getAudioScene : Value : startawait'); + console.info('AudioFrameworkRecLog: getAudioScene : Value : initaitestart'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + if ((audioCapCallBack.state == 1)) { + stateFlag = true; + } + } + }); + await sleep(1000); + audioCapCallBack.start(async (err,value) => { + console.info('AudioFrameworkRecLog: AudioCapturer : START SUCCESS'); + console.info('AudioFrameworkRecLog: ---------START---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); + if ((audioCapCallBack.state == 2)) { + stateFlag = true; + } + } + }); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); + var bufferSize = await audioCapCallBack.getBufferSize(); + console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); + var fd = fileio.openSync(fpath, 0o102, 0o777); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd created'); + }else{ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '); + stateFlag=false; + } + console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); + fd = fileio.openSync(fpath, 0o2002, 0o666); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); + } else { + console.info('AudioFrameworkRecLog: file fd Open: Append Mode : FAILED'); + stateFlag=false; + } + await sleep(1000); + var numBuffersToCapture = 250; + while (numBuffersToCapture) { + console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); + audioCapCallBack.read(bufferSize, true,async(err,buffer) => { + if (err) { + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); + console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : '+buffer); + await sleep(50); + console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); + var number = fileio.writeSync(fd, buffer); + console.info('BufferRecLog: data written: ' + number); + await sleep(100); + stateFlag=true; + } + }); + numBuffersToCapture--; + } + await sleep(3000); + audioCapCallBack.off('periodReach'); + await sleep(1000); + if (stateFlag == true) { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + stateFlag = true; + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } else { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + expect(stateFlag).assertTrue(); + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + stateFlag=false; + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } + + }) + + /* * + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_NEGATIVE_086 + * @tc.name : AudioCapturer-Check-READ_BUFFER + * @tc.desc : AudioCapturer with read buffer + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0*/ + + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_NEGATIVE_086', 0, async function (done) { + var stateFlag ; + var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; + var AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + var AudioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 1 + } + + var AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + + audio.createAudioCapturer(AudioCapturerOptions,async(err,value) => { + if (err){ + console.info('AudioFrameworkRecLog: AudioCapturer Not Created : Fail : Stream Type: FAIL'); + } else { + audioCapCallBack = value; + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + } + }); + await sleep(1000); + audioCapCallBack.on('periodReach',-2, (position) => { + if (position == -2) { + console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); + console.info('AudioRenderLog: mark reached: ' + position); + stateFlag = true ; + } else { + stateFlag = false; + } + }); + await sleep(1000); + audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { + console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); + if (err){ + console.info('AudioFrameworkRecLog: setAudioScene : ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: setAudioScene : SUCCESS '); + console.info('AudioFrameworkRecLog: setAudioScene : Value : '+setValue); + console.info('AudioFrameworkRecLog: getAudioScene : Value : startawait'); + console.info('AudioFrameworkRecLog: getAudioScene : Value : initaitestart'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + if ((audioCapCallBack.state == 1)) { + stateFlag = true; + } + } + }); + await sleep(1000); + audioCapCallBack.start(async (err,value) => { + console.info('AudioFrameworkRecLog: AudioCapturer : START SUCCESS'); + console.info('AudioFrameworkRecLog: ---------START---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); + if ((audioCapCallBack.state == 2)) { + stateFlag = true; + } + } + }); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); + var bufferSize = await audioCapCallBack.getBufferSize(); + console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); + var fd = fileio.openSync(fpath, 0o102, 0o777); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd created'); + }else{ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '); + stateFlag=false; + } + console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); + fd = fileio.openSync(fpath, 0o2002, 0o666); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); + } else { + console.info('AudioFrameworkRecLog: file fd Open: Append Mode : FAILED'); + stateFlag=false; + } + await sleep(1000); + var numBuffersToCapture = 250; + while (numBuffersToCapture) { + console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); + audioCapCallBack.read(bufferSize, true,async(err,buffer) => { + if (err) { + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); + console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : '+buffer); + await sleep(50); + console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); + var number = fileio.writeSync(fd, buffer); + console.info('BufferRecLog: data written: ' + number); + await sleep(100); + stateFlag=true; + } + }); + numBuffersToCapture--; + } + await sleep(3000); + audioCapCallBack.off('periodReach'); + await sleep(1000); + if (stateFlag == true) { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + stateFlag = true; + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } else { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + expect(stateFlag).assertTrue(); + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + stateFlag=false; + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } + + }) + + + /* * + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_223750_087 + * @tc.name : AudioCapturer-Check-READ_BUFFER + * @tc.desc : AudioCapturer with read buffer + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0*/ + + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_223750_087', 0, async function (done) { + var stateFlag ; + var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; + var AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + var AudioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 1 + } + + var AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + + audio.createAudioCapturer(AudioCapturerOptions,async(err,value) => { + if (err){ + console.info('AudioFrameworkRecLog: AudioCapturer Not Created : Fail : Stream Type: FAIL'); + } else { + audioCapCallBack = value; + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + } + }); + await sleep(1000); + audioCapCallBack.on('periodReach',223750, (position) => { + if (position == 223750) { + console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); + console.info('AudioRenderLog: periodReach: ' + position); + stateFlag = true ; + } else { + stateFlag = false; + } + }); + await sleep(1000); + audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { + console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); + if (err){ + console.info('AudioFrameworkRecLog: setAudioScene : ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: setAudioScene : SUCCESS '); + console.info('AudioFrameworkRecLog: setAudioScene : Value : '+setValue); + console.info('AudioFrameworkRecLog: getAudioScene : Value : startawait'); + console.info('AudioFrameworkRecLog: getAudioScene : Value : initaitestart'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + if ((audioCapCallBack.state == 1)) { + stateFlag = true; + } + } + }); + await sleep(1000); + audioCapCallBack.start(async (err,value) => { + console.info('AudioFrameworkRecLog: AudioCapturer : START SUCCESS'); + console.info('AudioFrameworkRecLog: ---------START---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); + if ((audioCapCallBack.state == 2)) { + stateFlag = true; + } + } + }); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); + var bufferSize = await audioCapCallBack.getBufferSize(); + console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); + var fd = fileio.openSync(fpath, 0o102, 0o777); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd created'); + }else{ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '); + stateFlag=false; + } + console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); + fd = fileio.openSync(fpath, 0o2002, 0o666); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); + } else { + console.info('AudioFrameworkRecLog: file fd Open: Append Mode : FAILED'); + stateFlag=false; + } + await sleep(1000); + var numBuffersToCapture = 250; + while (numBuffersToCapture) { + console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); + audioCapCallBack.read(bufferSize, true,async(err,buffer) => { + if (err) { + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); + console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : '+buffer); + await sleep(50); + console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); + var number = fileio.writeSync(fd, buffer); + console.info('BufferRecLog: data written: ' + number); + await sleep(100); + stateFlag=true; + } + }); + numBuffersToCapture--; + } + await sleep(3000); + audioCapCallBack.off('periodReach'); + await sleep(1000); + if (stateFlag == true) { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + stateFlag = true; + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } else { + audioCapCallBack.release(async(err,value) => { + console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + expect(stateFlag).assertTrue(); + } else {console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); + console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + if ((audioCapCallBack.state == 4)) { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); + console.info('AudioFrameworkRenderLog: resultFlag : '+stateFlag); + stateFlag=false; + expect(stateFlag).assertTrue(); + done(); + } + } + }); + await sleep(1000); + } + + }) + + /* * + * @tc.number : SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_STRING_088 + * @tc.name : AudioCapturer-Check-READ_BUFFER + * @tc.desc : AudioCapturer with read buffer + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0*/ + + it('SUB_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_STRING_088', 0, async function (done) { + var stateFlag ; + var fpath = dirPath+'/capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm'; + var AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + var AudioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 1 + } + + var AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + + audio.createAudioCapturer(AudioCapturerOptions,async(err,value) => { + if (err){ + console.info('AudioFrameworkRecLog: AudioCapturer Not Created : Fail : Stream Type: FAIL'); + } else { + audioCapCallBack = value; + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + } + }); + await sleep(1000); + audioCapCallBack.on('periodReach',"Harsha", (position) => { + if (position == "Harsha") { + console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); + console.info('AudioRenderLog: periodReach: ' + position); + stateFlag = true ; + } else { + stateFlag = false; + } + }); + await sleep(1000); + audioManagerRec.setAudioScene(audio.AudioScene.AUDIO_SCENE_VOICE_CHAT,async(err,setValue) => { + console.info('AudioFrameworkRecLog: ---------SET AUDIO SCENE---------'); + if (err){ + console.info('AudioFrameworkRecLog: setAudioScene : ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: setAudioScene : SUCCESS '); + console.info('AudioFrameworkRecLog: setAudioScene : Value : '+setValue); + console.info('AudioFrameworkRecLog: getAudioScene : Value : startawait'); + console.info('AudioFrameworkRecLog: getAudioScene : Value : initaitestart'); + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'+audioCapCallBack.state); + if ((audioCapCallBack.state == 1)) { + stateFlag = true; + } + } + }); + await sleep(1000); + audioCapCallBack.start(async (err,value) => { + console.info('AudioFrameworkRecLog: AudioCapturer : START SUCCESS'); + console.info('AudioFrameworkRecLog: ---------START---------'); + if (err){ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: AudioCapturer : STATE : '+audioCapCallBack.state); + console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); + if ((audioCapCallBack.state == 2)) { + stateFlag = true; + } + } + }); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); + var bufferSize = await audioCapCallBack.getBufferSize(); + console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); + await sleep(1000); + console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); + var fd = fileio.openSync(fpath, 0o102, 0o777); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd created'); + }else{ + console.info('AudioFrameworkRecLog: Capturer start :ERROR : '); + stateFlag=false; + } + console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); + fd = fileio.openSync(fpath, 0o2002, 0o666); + if (fd !== null) { + console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); + } else { + console.info('AudioFrameworkRecLog: file fd Open: Append Mode : FAILED'); + stateFlag=false; + } + await sleep(1000); + var numBuffersToCapture = 250; + while (numBuffersToCapture) { + console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); + audioCapCallBack.read(bufferSize, true,async(err,buffer) => { + if (err) { + console.info('AudioFrameworkRecLog: Capturer release :ERROR : '+err.message); + stateFlag=false; + } else { + console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); + console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : '+buffer); + await sleep(50); + console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); + var number = fileio.writeSync(fd, buffer); + console.info('BufferRecLog: data written: ' + number); + await sleep(100); + stateFlag=true; + } + }); + numBuffersToCapture--; + } + await sleep(3000); + audioCapCallBack.off('periodReach'); + await sleep(1000); if (stateFlag == true) { audioCapCallBack.release(async(err,value) => { console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHQBN.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHQBN.test.js index eeaec8175a67106a131d39b0f4eac3f44f23f93b..9ce02ddd2611c122d5a2c5bf8985364076d97bce 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHQBN.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/SR000GHQBN.test.js @@ -1303,7 +1303,7 @@ describe('audioManger', function () { it('SUB_AUDIO_MANAGER_ON_setDeviceActive_SPEAKER_037', 0, async function (done) { await audioManager.setDeviceActive(audio.DeviceType.SPEAKER,false).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Activate: Error: ${err.message}`); }); var setflag ; @@ -1330,7 +1330,7 @@ describe('audioManger', function () { }); await audioManager.setDeviceActive(audio.DeviceType.SPEAKER,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Activate: Error: ${err.message}`); }); done(); @@ -1367,7 +1367,7 @@ describe('audioManger', function () { }); await audioManager.setDeviceActive(2,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Activate: Error: ${err.message}`); }); }) @@ -1400,7 +1400,7 @@ describe('audioManger', function () { }); await audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Activate: Error: ${err.message}`); }); done(); @@ -1437,7 +1437,7 @@ describe('audioManger', function () { }); await audioManager.setDeviceActive(7,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Activate: Error: ${err.message}`); }); done(); @@ -1472,7 +1472,7 @@ describe('audioManger', function () { }); await audioManager.setDeviceActive(audio.ActiveDeviceType.WIRED_HEADSET,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Activate: Error: ${err.message}`); }); done(); @@ -1515,7 +1515,7 @@ describe('audioManger', function () { }); await audioManager.setDeviceActive(3,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Activate: Error: ${err.message}`); }); done(); @@ -1543,19 +1543,19 @@ describe('audioManger', function () { await sleep(1000); await audioManager.setDeviceActive(audio.ActiveDeviceType.WIRED_HEADSET,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Activate: Error: ${err.message}`); }); await sleep(5000); await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Activate: Error: ${err.message}`); }); await sleep(5000); await audioManager.setDeviceActive(audio.ActiveDeviceType.WIRED_HEADSET,true).then(function (){ console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Active Again'); - }).catch ((err) => { + }).catch((err) => { console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Activate Again: Error: ${err.message}`); }); await sleep(5000); @@ -1577,4 +1577,36 @@ describe('audioManger', function () { done(); }) + /* * + * @tc.number : SUB_AUDIO_MANAGER_DeviceType_001 + * @tc.name : DeviceType - INVALID + * @tc.desc : DeviceType - INVALID + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_DeviceType_001', 0, async function (done) { + + expect(audio.DeviceType.INVALID).assertEqual(0); + await sleep(50); + done(); + }) + + /* * + * @tc.number : SUB_AUDIO_MANAGER_DeviceType_002 + * @tc.name : DeviceType - WIRED_HEADSET + * @tc.desc : DeviceType - WIRED_HEADSET + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_MANAGER_DeviceType_001', 0, async function (done) { + + expect(audio.DeviceType.WIRED_HEADSET).assertEqual(3); + await sleep(50); + done(); + }) + + + }) \ No newline at end of file