From 285068243a7885e4b74e767c6501a4602b2211d6 Mon Sep 17 00:00:00 2001 From: lwx1121892 Date: Sun, 9 Oct 2022 20:13:04 +0800 Subject: [PATCH] modify Signed-off-by: lwx1121892 --- .../audio_js_standard/AudioCapturer/Test.json | 13 +- .../src/main/js/test/AudioCapturer.test.js | 5739 ++++------------- .../js/test/AudioCapturerChangeInfo.test.js | 789 +-- .../main/js/test/AudioEventManagement.test.js | 211 +- .../js/test/AudioRendererChangeInfo.test.js | 947 +-- .../audio/audio_js_standard/AudioTestBase.js | 10 +- .../src/main/js/test/AudioFramework.test.js | 1264 ++-- .../src/main/js/test/AudioRenderer.test.js | 2633 ++++---- 8 files changed, 3634 insertions(+), 7972 deletions(-) diff --git a/multimedia/audio/audio_js_standard/AudioCapturer/Test.json b/multimedia/audio/audio_js_standard/AudioCapturer/Test.json index 293b46d11..ed609acef 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturer/Test.json +++ b/multimedia/audio/audio_js_standard/AudioCapturer/Test.json @@ -17,7 +17,8 @@ { "type": "ShellKit", "run-command": [ - "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media" + "mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files", + "chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry" ], "cleanup-apps": true }, @@ -38,13 +39,9 @@ "./resource/audio/audioManager/StarWars10s-2C-16000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/", "./resource/audio/audioManager/StarWars10s-2C-22050-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/", "./resource/audio/audioManager/StarWars10s-2C-24000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/", - "./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/", - "./resource/audio/audioManager/Believer.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media", - "./resource/audio/audioManager/file_example_WAV_1MG.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media", - "./resource/audio/audioManager/safe_and_sound_32.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media", - "./resource/audio/audioManager/test.mp3 ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media", - "./resource/audio/audioManager/test.mp4 ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media" + "./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/" + ] } ] -} \ No newline at end of file +} diff --git a/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js b/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js index e65b8cc61..d31c8325f 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js +++ b/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js @@ -20,1862 +20,996 @@ import * as audioTestBase from '../../../../../AudioTestBase' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; describe('audioCapturer', function () { - let audioCapCallBack; - let audioCapPromise; + let Tag = 'AudioCpaturer'; let dirPath; + let bufferSize; + const LE24 = -1; + const LE32 = -1; + let markReachState = 'unknow'; + let periodReachState = 'unknow'; + let events = require('events'); + const CREATE_EVENT = 'create'; + const START_EVENT = 'start'; + const GET_BUFFERSIZE_EVENT = 'get_buffersize'; + const READ_EVENT = 'read'; + const STOP_EVENT = 'stop'; + const RELEASE_EVENT = 'release'; + const STATE_CHANGE_EVENT = 'on_state_change'; + const MARK_REACH_EVENT = 'on_mark_reach'; + const OFF_MARK_REACH_EVENT = 'off_mark_reach' + const PERIODR_REACH_EVENT = 'on_period_reach'; + const OFF_PERIODR_REACH_EVENT = 'off_period_reach'; + const END_EVENT = 'end'; + const GET_AUDIOTIME_EVENT = 'getAudioTime'; + const GET_CAPTURERINFO_EVENT = 'getCapturerInfo'; + const GET_STREAMINFO_EVENT = 'getStreamInfo'; + const GET_AUDIOSCENE_EVENT = 'getAudioScene'; + const ERROR_EVENT = 'error'; + let eventEmitter = new events.EventEmitter(); + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + async function toNextStep(audioCap, steps, done) { + if (steps[0] == END_EVENT) { + await sleep(1000); + if (markReachState == 'success' || markReachState == 'invalid_failure') { + console.log(`${Tag} markReachState: ${JSON.stringify(markReachState)}`); + expect(true).assertTrue(); + } else if (markReachState == 'failure') { + expect(false).assertTrue(); + } + markReachState = 'unknow';//recover state + + if (periodReachState == 'success' || periodReachState == 'invalid_failure') { + console.log(`${Tag} periodReachState: ${JSON.stringify(periodReachState)}`); + expect(true).assertTrue(); + } else if (periodReachState == 'failure') { + expect(false).assertTrue(); + } + periodReachState = 'unknow'; + + console.info(`${Tag} case done!!`); + done(); + } else { + eventEmitter.emit(steps[0], audioCap, steps, done); + } + } + eventEmitter.on(CREATE_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(CREATE_EVENT)}`); + steps.shift(); + audio.createAudioCapturer(steps[0], async (err, data) => { + console.log(`${Tag} enter createAudioCapturer`); + steps.shift(); + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} CREATE_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} create err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + steps = [END_EVENT]; + toNextStep(audioCap, steps, done); + } else { + console.log(`${Tag} create success`); + audioCap = data; + expect(audioCap.state).assertEqual(audio.AudioState.STATE_PREPARED); + toNextStep(audioCap, steps, done); + } + }); + }); + eventEmitter.on(START_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(START_EVENT)}`); + steps.shift(); + audioCap.start(async (err) => { + console.log(`${Tag} enter start`); + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} START_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} start err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + } else { + console.log(`${Tag} start success`); + expect(audioCap.state).assertEqual(audio.AudioState.STATE_RUNNING); + toNextStep(audioCap, steps, done); + } + }); + }); + eventEmitter.on(GET_BUFFERSIZE_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(GET_BUFFERSIZE_EVENT)}`); + steps.shift(); + audioCap.getBufferSize(async (err, size) => { + console.log(`${Tag} enter getBufferSize`); + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} GET_BUFFERSIZE_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} start err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + } else { + console.log(`${Tag} getBufferSize success`); + bufferSize = size; + console.log(`${Tag} bufferSize: ${JSON.stringify(bufferSize)}`); + toNextStep(audioCap, steps, done); + } + }); + }); + + eventEmitter.on(READ_EVENT, async (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(READ_EVENT)}`); + steps.shift(); + let fd = fileio.openSync(dirPath, 0o102, 0o777); + if (fd !== null) { + console.info(`${Tag} AudioFrameworkRecLog: file fd created`); + } + else { + console.info(`${Tag} AudioFrameworkRecLog: Capturer start : ERROR `); + expect(false).assertTrue(); + done(); + return; + } + + fd = fileio.openSync(dirPath, 0o2002, 0o666); + if (fd !== null) { + console.info(`${Tag} AudioFrameworkRecLog: file fd opened : Append Mode : PASS`); + } + else { + console.info(`${Tag} AudioFrameworkRecLog: file fd Open: Append Mode : FAILED`); + expect(false).assertTrue(); + done(); + return; + } + let numBuffersToCapture = 45; + while (numBuffersToCapture) { + try { + await new Promise((resolve, reject) => { + audioCap.read(bufferSize, true, async (err, buffer) => { + if (err) { + console.info(`${Tag} AudioFrameworkRecLog: Capturer release :ERROR : ${JSON.stringify(err.message)}`); + reject(err); + } else { + let number = fileio.writeSync(fd, buffer); + console.info(`${Tag} AudioFrameworkRecLog:BufferRecLog: data written: ${JSON.stringify(number)}`); + resolve(); + } + }); + }) + } catch (err) { + console.info(`${Tag} read err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + done(); + } + numBuffersToCapture--; + } + console.log(`${Tag} read success`); + toNextStep(audioCap, steps, done); + }); + + eventEmitter.on(STOP_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(STOP_EVENT)}`); + steps.shift(); + audioCap.stop(async (err) => { + console.log(`${Tag} enter stop`); + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} STOP_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} stop err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + } else { + console.log(`${Tag} stop success`); + expect(audioCap.state).assertEqual(audio.AudioState.STATE_STOPPED); + toNextStep(audioCap, steps, done); + } + }); + }); + eventEmitter.on(RELEASE_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(RELEASE_EVENT)}`); + steps.shift(); + audioCap.release(async (err) => { + console.log(`${Tag} enter release`); + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} RELEASE_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} release err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + return; + } else { + console.log(`${Tag} release success`); + expect(audioCap.state).assertEqual(audio.AudioState.STATE_RELEASED); + toNextStep(audioCap, steps, done); + } + }); + }); + eventEmitter.on(GET_AUDIOTIME_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(GET_AUDIOTIME_EVENT)}`); + steps.shift(); + audioCap.getAudioTime(async (err, audioTime) => { + console.log(`${Tag} enter getAudioTime`); + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} GET_AUDIOTIME_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} getAudioTime err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + return; + } else { + console.log(`${Tag} getAudioTime success`); + expect(audioTime).assertLarger(0); + toNextStep(audioCap, steps, done); + } + }); + }); + eventEmitter.on(GET_CAPTURERINFO_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(GET_CAPTURERINFO_EVENT)}`); + steps.shift(); + audioCap.getCapturerInfo(async (err, audioParamsGet) => { + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} GET_CAPTURERINFO_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} getCapturerInfo err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + return; + } else { + console.info(`${Tag} AudioFrameworkRecLog: Capturer CapturerInfo:`); + console.info(`${Tag} AudioFrameworkRecLog: Capturer SourceType: ${JSON.stringify(audioParamsGet.source)}`); + console.info(`${Tag} AudioFrameworkRecLog: Capturer capturerFlags: ${JSON.stringify(audioParamsGet.capturerFlags)}`); + toNextStep(audioCap, steps, done); + } + }); + }); + eventEmitter.on(GET_STREAMINFO_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(GET_STREAMINFO_EVENT)}`); + steps.shift(); + audioCap.getStreamInfo(async (err, audioParamsGet) => { + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} GET_STREAMINFO_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} getStreamInfo err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + return; + } else { + console.info(`${Tag} AudioFrameworkRecLog: Capturer getStreamInfo:`); + console.info(`${Tag} AudioFrameworkRecLog: Capturer sampleFormat: ${JSON.stringify(audioParamsGet.sampleFormat)}`); + console.info(`${Tag} AudioFrameworkRecLog: Capturer samplingRate: ${JSON.stringify(audioParamsGet.samplingRate)}`); + console.info(`${Tag} AudioFrameworkRecLog: Capturer channels: ${JSON.stringify(audioParamsGet.channels)}`); + console.info(`${Tag} AudioFrameworkRecLog: Capturer encodingType: ${JSON.stringify(audioParamsGet.encodingType)}`); + toNextStep(audioCap, steps, done); + } + }); + }); + + eventEmitter.on(GET_AUDIOSCENE_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(GET_AUDIOSCENE_EVENT)}`); + steps.shift(); + AUDIOMANAGERREC.getAudioScene(async (err, getValue) => { + if (err && steps[0] == ERROR_EVENT) { + console.log(`${Tag} GET_AUDIOSCENE_EVENT error success`); + steps.shift(); + toNextStep(audioCap, steps, done); + } else if (err) { + console.log(`${Tag} getStreamInfo err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + await releaseFun(audioCap, done); + return; + } else { + console.info(`${Tag} AudioFrameworkRecLog: getAudioScene : Value : ${JSON.stringify(getValue)}`); + toNextStep(audioCap, steps, done); + } + }); + }); + + eventEmitter.on(STATE_CHANGE_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(STATE_CHANGE_EVENT)}`); + steps.shift(); + console.log(`${Tag} STATE_CHANGE_EVENT register success`); + audioCap.on('stateChange', (AudioState) => { + console.info(`${Tag} AudioCapturerLog: Changed State to : ${JSON.stringify(AudioState)}`); + switch (AudioState) { + case audio.AudioState.STATE_NEW: + console.info(`${Tag} AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------NEW--------------`); + console.info(`${Tag} AudioFrameworkTest: Audio State is : New`); + break; + case audio.AudioState.STATE_PREPARED: + console.info(`${Tag} AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------PREPARED--------------`); + console.info(`${Tag} AudioFrameworkTest: Audio State is : Prepared`); + break; + case audio.AudioState.STATE_RUNNING: + console.info(`${Tag} AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RUNNING--------------`); + console.info(`${Tag} AudioFrameworkTest: Audio State is : Running`); + break; + case audio.AudioState.STATE_STOPPED: + console.info(`${Tag} AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------STOPPED--------------`); + console.info(`${Tag} AudioFrameworkTest: Audio State is : stopped`); + break; + case audio.AudioState.STATE_RELEASED: + console.info(`${Tag} AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RELEASED--------------`); + console.info(`${Tag} AudioFrameworkTest: Audio State is : released`); + break; + default: + console.info(`${Tag} AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------INVALID--------------`); + console.info(`${Tag} AudioFrameworkTest: Audio State is : invalid`); + break; + } + }); + toNextStep(audioCap, steps, done); + }); + + eventEmitter.on(MARK_REACH_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(MARK_REACH_EVENT)}`); + steps.shift(); + let markReachParam = steps[0]; + steps.shift(); + audioCap.on('markReach', markReachParam, (position) => { + console.log(`${Tag} position: ${JSON.stringify(position)}`); + console.log(`${Tag} markReachParam: ${JSON.stringify(markReachParam)}`); + if (position == markReachParam) { + markReachState = 'success' + console.info(`${Tag} AudioRenderLog: mark reached: ${JSON.stringify(position)}`); + } + }); + toNextStep(audioCap, steps, done); + }); + + eventEmitter.on(OFF_MARK_REACH_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(OFF_MARK_REACH_EVENT)}`); + steps.shift(); + audioCap.off('markReach'); + toNextStep(audioCap, steps, done); + }); + + eventEmitter.on(PERIODR_REACH_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(PERIODR_REACH_EVENT)}`); + steps.shift(); + let periodReachParam = steps[0]; + steps.shift(); + audioCap.on('periodReach', periodReachParam, (position) => { + console.log(`${Tag} position: ${JSON.stringify(position)}`); + console.log(`${Tag} periodReachParam: ${JSON.stringify(periodReachParam)}`); + if (position == periodReachParam) { + periodReachState = 'success' + console.info(`${Tag} AudioRenderLog: mark reached: ${JSON.stringify(position)}`); + } + }); + toNextStep(audioCap, steps, done); + }); + eventEmitter.on(OFF_PERIODR_REACH_EVENT, (audioCap, steps, done) => { + console.log(`${Tag} emit: ${JSON.stringify(OFF_PERIODR_REACH_EVENT)}`); + steps.shift(); + audioCap.off('periodReach'); + toNextStep(audioCap, steps, done); + }); + async function releaseFun(audioCap, done) { + try { + await audioCap.release(); + console.log(`${Tag} release success`); + done(); + } catch (err) { + console.log(`${Tag} release fail,err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + done(); + } + } + async function getFd(fileName) { let context = await featureAbility.getContext(); await context.getFilesDir().then((data) => { dirPath = data + '/' + fileName; - console.info('case2 dirPath is ' + dirPath); + console.info(`${Tag} case2 dirPath is ${JSON.stringify(dirPath)}`); }) } - async function closeFileDescriptor() { - await resourceManager.getResourceManager().then(async (mgr) => { - await mgr.closeRawFileDescriptor(dirPath).then(value => { - console.log('AudioFrameworkRenderLog:case closeRawFileDescriptor success for file:' + dirPath); - }).catch(error => { - console.log('AudioFrameworkRenderLog:case closeRawFileDescriptor err: ' + error); - }); - }); - } const AUDIOMANAGERREC = audio.getAudioManager(); - console.info('AudioFrameworkRecLog: Create AudioManger Object JS Framework'); + console.info(`${Tag} AudioFrameworkRecLog: Create AudioManger Object JS Framework`); beforeAll(async function () { - console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); + console.info(`${Tag} AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`); let permissionName1 = 'ohos.permission.MICROPHONE'; let permissionNameList = [permissionName1]; let appName = 'ohos.acts.multimedia.audio.audiocapturer'; await audioTestBase.applyPermission(appName, permissionNameList); await sleep(100); - console.info('AudioFrameworkTest: beforeAll: END'); + console.info(`${Tag} AudioFrameworkTest: beforeAll: END`); }) beforeEach(async function () { - console.info('AudioFrameworkTest: beforeEach: Prerequisites at the test case level'); + console.info(`${Tag} AudioFrameworkTest: beforeEach: Prerequisites at the test case level`); await sleep(1000); }) afterEach(function () { - console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions'); - closeFileDescriptor(); + console.info(`${Tag} AudioFrameworkTest: afterEach: Test case-level clearance conditions`); }) afterAll(async function () { - await sleep(1000); - console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition'); + console.info(`${Tag} AudioFrameworkTest: afterAll: Test suite-level cleanup condition`); }) - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - async function recPromise(AudioCapturerOptions, dirPath, AudioScene) { - let resultFlag = 'new'; - console.info('AudioFrameworkRecLog: Promise : Audio Recording Function'); + async function recPromise(AudioCapturerOptions, done) { let audioCap; - let isPass = false; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCap = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); + try { + audioCap = await audio.createAudioCapturer(AudioCapturerOptions); + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: success`); + } catch (err) { + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${JSON.stringify(err.message)}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; if ((sampleFormat == LE24 || sampleFormat == LE32) && err.code == 202) { - isPass = true; + done(); return; } - return resultFlag; - }); - console.log("isPass:" + isPass); - if (isPass) { - resultFlag = true; - return resultFlag; + expect(false).assertTrue(); + done(); + return; } - console.info('AudioFrameworkRecLog: AudioCapturer : Path : ' + dirPath); - - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); - - await audioCap.getStreamInfo().then(async function (audioParamsGet) { - if (audioParamsGet != undefined) { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo:'); - console.info('AudioFrameworkRecLog: Capturer sampleFormat:' + audioParamsGet.sampleFormat); - console.info('AudioFrameworkRecLog: Capturer samplingRate:' + audioParamsGet.samplingRate); - console.info('AudioFrameworkRecLog: Capturer channels:' + audioParamsGet.channels); - console.info('AudioFrameworkRecLog: Capturer encodingType:' + audioParamsGet.encodingType); + try { + let audioParamsGet = await audioCap.getStreamInfo(); + if (audioParamsGet != undefined && audioParamsGet != null) { + console.info(`${Tag} AudioFrameworkRecLog: Capturer getStreamInfo:${JSON.stringify(audioParamsGet)}`); } else { - console.info('AudioFrameworkRecLog: audioParamsGet is : ' + audioParamsGet); - console.info('AudioFrameworkRecLog: audioParams getStreamInfo are incorrect: '); - resultFlag = false; + console.info(`${Tag} AudioFrameworkRecLog: audioParamsGet are incorrect,is : ${JSON.stringify(audioParamsGet)}`); + expect(false).assertTrue(); } - }).catch((err) => { - console.log('AudioFrameworkRecLog: getStreamInfo :ERROR: ' + err.message); - resultFlag = false; - }); - if (resultFlag == false) { - console.info('AudioFrameworkRecLog: resultFlag : ' + resultFlag); - return resultFlag; + } catch (err) { + console.log(`${Tag} AudioFrameworkRecLog: getStreamInfo :ERROR: ${JSON.stringify(err.message)}`); + expect(false).assertTrue(); } - await audioCap.getCapturerInfo().then(async function (audioParamsGet) { + try { + let audioParamsGet = await audioCap.getCapturerInfo(); if (audioParamsGet != undefined) { - console.info('AudioFrameworkRecLog: Capturer CapturerInfo:'); - console.info('AudioFrameworkRecLog: Capturer SourceType:' + audioParamsGet.source); - console.info('AudioFrameworkRecLog: Capturer capturerFlags:' + audioParamsGet.capturerFlags); - } else { - console.info('AudioFrameworkRecLog: audioParamsGet is : ' + audioParamsGet); - console.info('AudioFrameworkRecLog: audioParams getCapturerInfo are incorrect: '); - resultFlag = false; - } - }).catch((err) => { - console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: ' + err.message); - resultFlag = false; - }); - if (resultFlag == false) { - console.info('AudioFrameworkRecLog: resultFlag : ' + resultFlag); - return resultFlag; - } - - await audioCap.start().then(async function () { - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - resultFlag = false; - }); - if (resultFlag == false) { - console.info('AudioFrameworkRecLog: resultFlag : ' + resultFlag); - return resultFlag; - } - - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); - - let bufferSize = await audioCap.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - - let fd = fileio.openSync(dirPath, 0o102, 0o777); - if (fd !== null) { - console.info('AudioFrameworkRecLog: file fd created'); - } - else { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : '); - resultFlag = false; - return resultFlag; - } - - fd = fileio.openSync(dirPath, 0o2002, 0o666); - if (fd !== null) { - console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); - } - else { - console.info('AudioFrameworkRecLog: file fd Open: Append Mode : FAILED'); - resultFlag = false; - return resultFlag; - } - await sleep(100); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------READ BUFFER---------'); - let buffer = await audioCap.read(bufferSize, true); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(50); - numBuffersToCapture--; - } - await sleep(1000); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); - - await audioCap.stop().then(async function () { - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - resultFlag = true; - console.info('AudioFrameworkRecLog: resultFlag : ' + resultFlag); - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - resultFlag = false; - }); - - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); - - await audioCap.release().then(async function () { - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - resultFlag = false; - }); - - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); - - return resultFlag; - - } - - - async function recCallBack(AudioCapturerOptions, dirPath, AudioScene) { - - let resultFlag = true; - console.info('AudioFrameworkRecLog: CallBack : Audio Recording Function'); - 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); - AUDIOMANAGERREC.getAudioScene((err, getValue) => { - console.info('AudioFrameworkRecLog: ---------GET AUDIO SCENE---------'); - if (err) { - console.info('AudioFrameworkRecLog: getAudioScene : ERROR : ' + err.message); - resultFlag = false; - } else { - console.info('AudioFrameworkRecLog: getAudioScene : Value : ' + getValue); - } - }); - await sleep(1000); - - audioCapCallBack.getStreamInfo(async (err, audioParamsGet) => { - console.info('AudioFrameworkRecLog: ---------GET STREAM INFO---------'); - console.log('AudioFrameworkRecLog: Entered getStreamInfo'); - if (err) { - console.log('AudioFrameworkRecLog: getStreamInfo :ERROR: ' + err.message); - resultFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo:'); - console.info('AudioFrameworkRecLog: Capturer sampleFormat:' + audioParamsGet.sampleFormat); - console.info('AudioFrameworkRecLog: Capturer samplingRate:' + audioParamsGet.samplingRate); - console.info('AudioFrameworkRecLog: Capturer channels:' + audioParamsGet.channels); - console.info('AudioFrameworkRecLog: Capturer encodingType:' + audioParamsGet.encodingType); - } - }); - await sleep(1000); - audioCapCallBack.getCapturerInfo((err, audioParamsGet) => { - console.info('AudioFrameworkRecLog: ---------GET CAPTURER INFO---------'); - if (err) { - console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: ' + err.message); - resultFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer CapturerInfo:'); - console.info('AudioFrameworkRecLog: Capturer SourceType:' + audioParamsGet.source); - console.info('AudioFrameworkRecLog: Capturer capturerFlags:' + audioParamsGet.capturerFlags); - } - }); - await sleep(1000); - audioCapCallBack.start((err, value) => { - console.info('AudioFrameworkRecLog: AudioCapturer : START SUCCESS'); - console.info('AudioFrameworkRecLog: ---------START---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - resultFlag = false; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - } - }); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 0o102, 0o777); - if (fd !== null) { - console.info('AudioFrameworkRecLog: file fd created'); - } else { - console.info('AudioFrameworkRecLog: Capturer start :ERROR '); - resultFlag = false; - return resultFlag; - } - console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); - fd = fileio.openSync(dirPath, 0o2002, 0o666); - if (fd !== null) { - console.info('AudioFrameworkRecLog: file fd opened : Append Mode :PASS'); - } else { - console.info('AudioFrameworkRecLog: file fd Open: Append Mode : FAILED'); - resultFlag = false; - return resultFlag; + console.info(`${Tag} AudioFrameworkRecLog: Capturer CapturerInfo: ${JSON.stringify(audioParamsGet)}`); + } else { + console.info(`${Tag} AudioFrameworkRecLog: audioParamsGet are incorrect , is : ${JSON.stringify(audioParamsGet)}`); + expect(false).assertTrue(); + } + } catch (err) { + console.log(`${Tag} AudioFrameworkRecLog: CapturerInfo :ERROR: ${JSON.stringify(err.message)}`); + expect(false).assertTrue(); + } + + try { + await audioCap.start(); + console.log(`${Tag} start ok`); + let bufferSize = await audioCap.getBufferSize(); + console.log(`${Tag} bufferSize: ${JSON.stringify(bufferSize)} , dirPath: ${JSON.stringify(dirPath)}`); + let fd = fileio.openSync(dirPath, 0o102, 0o777); + console.log(`${Tag} fd: ${JSON.stringify(fd)}`); + if (fd !== null) { + console.info(`${Tag} AudioFrameworkRecLog: file fd created`); + } + else { + console.info(`${Tag} AudioFrameworkRecLog: Capturer start : ERROR `); + expect(false).assertTrue(); + } + + fd = fileio.openSync(dirPath, 0o2002, 0o666); + console.log(`${Tag} fd-re: ${JSON.stringify(fd)}`); + if (fd !== null) { + console.info(`${Tag} AudioFrameworkRecLog: file fd opened : Append Mode :PASS`); + } + else { + console.info(`${Tag} AudioFrameworkRecLog: file fd Open: Append Mode : FAILED`); + expect(false).assertTrue(); + } + + let numBuffersToCapture = 45; + while (numBuffersToCapture) { + console.info(`${Tag} AudioFrameworkRecLog: ---------READ BUFFER---------`); + let buffer = await audioCap.read(bufferSize, true); + console.info(`${Tag} AudioFrameworkRecLog: ---------WRITE BUFFER---------`); + let number = fileio.writeSync(fd, buffer); + console.info(`${Tag} AudioFrameworkRecLog:BufferRecLog: data written: ${JSON.stringify(number)}`); + numBuffersToCapture--; + } + console.log(`${Tag} read ok`); + await audioCap.stop(); + console.log(`${Tag} stop ok`); + } catch (err) { + console.log(`${Tag} start-read-stop err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCap.release(); + console.log(`${Tag} release ok`); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); } - - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------READ BUFFER---------'); - let buffer = await audioCapCallBack.read(bufferSize, true); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(50); - numBuffersToCapture--; - } - //await sleep(3000); - audioCapCallBack.stop(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------STOP RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - resultFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - resultFlag = true; - console.info('AudioFrameworkRecLog: resultFlag : ' + resultFlag); - } - }); - await sleep(1000); - - audioCapCallBack.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - resultFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - resultFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - //return resultFlag; - } - }); - //await sleep(3000); - console.info('AudioFrameworkRenderLog: After all check resultFlag : ' + resultFlag); - return resultFlag; + done(); } /** *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_0100 - *@tc.name - *@tc.desc + *@tc.name : + *@tc.desc : createAudioCapturer callback *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 1 - */ + */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_0100', 1, async function (done) { - let stateFlag; let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: INVALID:' + audio.AudioState.STATE_INVALID); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: NEW:' + audio.AudioState.STATE_NEW); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: PREPARED:' + audio.AudioState.STATE_PREPARED); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: START:' + audio.AudioState.STATE_START); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: STOP:' + audio.AudioState.STATE_STOPPED); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: RELEASE:' + audio.AudioState.STATE_RELEASED); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: RUNNING:' + audio.AudioState.STATE_RUNNING); - if ((audioCapCallBack.state == audio.AudioState.STATE_PREPARED)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO PREPARED STATE : PASS---------'); - stateFlag = true; - expect(stateFlag).assertTrue(); - done(); - } - } - }); + console.log(`${Tag} AudioCapturerOptions= ${JSON.stringify(AudioCapturerOptions)}`); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, RELEASE_EVENT, END_EVENT]; + console.log(`${Tag} mySteps= ${JSON.stringify(mySteps)}`); + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_EUNM_0100 - *@tc.name : AudioCapturer-Check-STATE-PREPARED-ENUM - *@tc.desc : AudioCapturer with state prepared + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100 + *@tc.name : AudioCapturer-Check-STATE-RUNNING + *@tc.desc : AudioCapturer with state running *@tc.size : MEDIUM *@tc.type : Function - *@tc.level : Level 0 + *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_EUNM_0100', 0, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100', 1, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - } - }); - - if ((audioCapCallBack.state == 1)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO PREPARED STATE : PASS---------'); - stateFlag = true; - expect(stateFlag).assertTrue(); - done(); - } - + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, START_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100 - *@tc.name : AudioCapturer-Check-STATE-RUNNING - *@tc.desc : AudioCapturer with state running + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100 + *@tc.name : AudioCapturer-Check-STATE-STOPPED + *@tc.desc : AudioCapturer with state stopped *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100', 1, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100', 1, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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 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: ---------BEFORE CHECK AUDIO RUNNING STATE---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - await sleep(1000); - if ((audioCapCallBack.state == audio.AudioState.STATE_RUNNING)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RUNNING STATE : PASS---------'); - stateFlag = true; - } - } - }); - await sleep(1000); - await 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - } - }); - await sleep(1000); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, START_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_EUNM_0100 - *@tc.name : AudioCapturer-Check-STATE-RUNNING-ENUM - *@tc.desc : AudioCapturer with state running + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100 + *@tc.name : AudioCapturer-get_buffer_size + *@tc.desc : AudioCapturer with state stopped *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_EUNM_0100', 1, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100', 1, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - await 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: ---------BEFORE CHECK AUDIO RUNNING STATE---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RUNNING STATE : PASS---------'); - stateFlag == true; - } - } - }); - await sleep(1000); - await 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - } - }); - await sleep(1000); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, START_EVENT, GET_BUFFERSIZE_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100 - *@tc.name : AudioCapturer-Check-STATE-STOPPED - *@tc.desc : AudioCapturer with state stopped + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_0100 + *@tc.name : AudioCapturer-Check-READ_BUFFER + *@tc.desc : AudioCapturer with read buffer *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100', 1, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_0100', 1, async function (done) { + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - } - }); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); + }) - 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 '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - stateFlag = true; - } - } - }); - await sleep(1000); - audioCapCallBack.stop(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------STOP RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO STOPPED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - if ((audioCapCallBack.state == audio.AudioState.STATE_STOPPED)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO STOPPED STATE---------'); - stateFlag = true; - } - console.info('AudioFrameworkRecLog: stateFlag : ' + stateFlag); - } - }); - 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - } + /** + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_0100 + *@tc.name : AudioCapturer-Check-STATE-PREPARED + *@tc.desc : AudioCapturer with state prepared + *@tc.size : MEDIUM + *@tc.type : Function + *@tc.level : Level 0 + */ + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_0100', 0, async function (done) { + let AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + let AudioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 0 + } + let AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + let audioCapPromise; + await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + audioCapPromise = data; + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: success`); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_PREPARED); + expect(audioCapPromise.state).assertEqual(1); + }).catch((err) => { + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${JSON.stringify(err.message)}`); + expect(false).assertTrue(); }); - await sleep(1000); + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_EUNM_0100 - *@tc.name : AudioCapturer-Check-STATE-STOPPED-ENUM - *@tc.desc : AudioCapturer with state stopped + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_0100 + *@tc.name : AudioCapturer-Check-STATE-RUNNING + *@tc.desc : AudioCapturer with state running *@tc.size : MEDIUM *@tc.type : Function - *@tc.level : Level 1 + *@tc.level : Level 0 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_EUNM_0100', 1, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_0100', 0, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - } - }); - 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 '); - stateFlag == true; - } - }); - await sleep(1000); - audioCapCallBack.stop(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------STOP RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO STOPPED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - if ((audioCapCallBack.state == 3)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO STOPPED STATE---------'); - stateFlag = true; - } - console.info('AudioFrameworkRecLog: stateFlag : ' + stateFlag); - } - }); - 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - } - }); - await sleep(1000); + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + await audioCapPromise.start(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RUNNING); + expect(audioCapPromise.state).assertEqual(2); + await audioCapPromise.release(); + } catch (err) { + console.log(`${Tag} err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RELEASED_STATE_0100 - *@tc.name : AudioCapturer-Check-STATE-RELEASED - *@tc.desc : AudioCapturer with state released + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_0100 + *@tc.name : AudioCapturer-Check-STATE-STOPPED + *@tc.desc : AudioCapturer with state stopped *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RELEASED_STATE_0100', 2, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_0100', 2, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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.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 '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - stateFlag = true; - } - } - }); - await sleep(1000); - audioCapCallBack.stop(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------STOP RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - if ((audioCapCallBack.state == 3)) { - stateFlag = true; - } - console.info('AudioFrameworkRecLog: stateFlag : ' + stateFlag); - } - }); - 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 == audio.AudioState.STATE_RELEASED)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + await audioCapPromise.start(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RUNNING); + await audioCapPromise.stop(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_STOPPED); + expect(audioCapPromise.state).assertEqual(3); + await audioCapPromise.release() + } catch (err) { + console.log(`${Tag} err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RELEASED_STATE_EUNM_0100 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_0100 *@tc.name : AudioCapturer-Check-STATE-RELEASED *@tc.desc : AudioCapturer with state released *@tc.size : MEDIUM *@tc.type : Function - *@tc.level : Level 1 + *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RELEASED_STATE_EUNM_0100', 1, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_0100', 2, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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.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 '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - stateFlag = true; - } - } - }); - await sleep(1000); - audioCapCallBack.stop(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------STOP RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - if ((audioCapCallBack.state == 3)) { - stateFlag = true; - } - console.info('AudioFrameworkRecLog: stateFlag : ' + stateFlag); - } - }); - 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); + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + await audioCapPromise.start(); + await audioCapPromise.stop(); + await audioCapPromise.release(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RELEASED); + expect(audioCapPromise.state).assertEqual(4); + } catch (err) { + console.log(`${Tag} err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_BUFFER_SIZE_0100 *@tc.name : AudioCapturer-get_buffer_size *@tc.desc : AudioCapturer with state stopped *@tc.size : MEDIUM *@tc.type : Function - *@tc.level : Level 1 + *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100', 1, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_BUFFER_SIZE_0100', 2, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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.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 '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - stateFlag = true; - } - } - }); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - let bufferSize = await audioCapCallBack.getBufferSize(async (err, cbbufferSize) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK BUFFER SIZE---------'); - console.info('AudioFrameworkRecLog: buffer size: ' + cbbufferSize); - stateFlag = true - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - console.info('AudioFrameworkRecLog: ---------AFTER CHECK BUFFER SIZE : PASS---------') - } - }); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - } - }); - await sleep(1000); + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + done(); + return; + } + try { + await audioCapPromise.start(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RUNNING); + let bufferSize = await audioCapPromise.getBufferSize(); + console.info(`${Tag} AudioFrameworkRecLog: buffer size: ${JSON.stringify(bufferSize)}`); + } catch (err) { + console.log(`${Tag} start-getBufferSize err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCapPromise.release(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RELEASED); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_0100 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_READ_BUFFER_0100 *@tc.name : AudioCapturer-Check-READ_BUFFER *@tc.desc : AudioCapturer with read buffer *@tc.size : MEDIUM *@tc.type : Function - *@tc.level : Level 1 + *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_0100', 1, async function (done) { - let stateFlag; - await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_READ_BUFFER_0100', 2, async function (done) { + await getFd("capture_CB_js-44100-2C-S16LE-checkpromisereadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err : ${JSON.stringify(err)}`); + expect(false).assertTrue(); + done(); + return; + } + try { + await audioCapPromise.start(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RUNNING); + bufferSize = await audioCapPromise.getBufferSize(); + console.info(`${Tag} AudioFrameworkRecLog: buffer size: ${JSON.stringify(bufferSize)}`); + } catch (err) { + console.log(`${Tag} start-getBufferSize err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } - 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.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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { - console.info('AudioFrameworkRecLog: file fd created'); - } else { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : '); - stateFlag = false; + console.info(`${Tag} AudioFrameworkRecLog: file fd created`); + } + else { + console.info(`${Tag} AudioFrameworkRecLog: Capturer start :ERROR :`); + expect(false).assertTrue(); + done(); + return; } - console.info('AudioFrameworkRecLog: ---------OPEN FILE IN APPEND MODE---------'); + fd = fileio.openSync(dirPath, 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; + console.info(`${Tag} AudioFrameworkRecLog: file fd opened : Append Mode :PASS`); } - await sleep(1000); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - - numBuffersToCapture--; + else { + console.info(`${Tag} AudioFrameworkRecLog: file fd Open: Append Mode : FAILED`); + expect(false).assertTrue(); + done(); + return; } - 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(); - } + + try { + let numBuffersToCapture = 45; + while (numBuffersToCapture) { + let buffer = await audioCapPromise.read(bufferSize, true); + console.info(`${Tag} AudioFrameworkRecLog: ---------AFTER PROMISE READ ---------`); + let number = fileio.writeSync(fd, buffer); + console.info(`${Tag} BufferRecLog: data written: ${JSON.stringify(number)}`); + numBuffersToCapture--; } - }); - await sleep(1000); + } catch (err) { + console.info(`${Tag} AudioFrameworkRecLog: read err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + + try { + await audioCapPromise.release(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RELEASED); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_0100 - *@tc.name : AudioCapturer-Check-STATE-PREPARED - *@tc.desc : AudioCapturer with state prepared + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_0100 + *@tc.name : AudioCapturer-Set1-Media + *@tc.desc : AudioCapturer with parameter set 1 *@tc.size : MEDIUM *@tc.type : Function - *@tc.level : Level 0 + *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_0100', 0, async function (done) { - let stateFlag; + it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_0100', 2, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - - if ((audioCapPromise.state == audio.AudioState.STATE_PREPARED)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO PREPARED STATE : PASS---------'); - stateFlag = true; - expect(stateFlag).assertTrue(); - done(); - } + await getFd("capture_CB_js-44100-2C-16B.pcm"); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, GET_AUDIOSCENE_EVENT, GET_STREAMINFO_EVENT, GET_CAPTURERINFO_EVENT, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_ENUM_0100 - *@tc.name : AudioCapturer-Check-STATE-PREPARED-ENUM - *@tc.desc : AudioCapturer with state prepared - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_ENUM_0100', 0, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - - if ((audioCapPromise.state == 1)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO PREPARED STATE : PASS---------'); - stateFlag = true; - expect(stateFlag).assertTrue(); - done(); - } - - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_0100 - *@tc.name : AudioCapturer-Check-STATE-RUNNING - *@tc.desc : AudioCapturer with state running - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_0100', 0, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - if ((audioCapPromise.state == audio.AudioState.STATE_RUNNING)) { - stateFlag = true; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_ENUM_0100 - *@tc.name : AudioCapturer-Check-STATE-RUNNING-ENUM - *@tc.desc : AudioCapturer with state running - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_ENUM_0100', 0, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - if ((audioCapPromise.state == 2)) { - stateFlag = true; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_0100 - *@tc.name : AudioCapturer-Check-STATE-STOPPED - *@tc.desc : AudioCapturer with state stopped - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_0100', 2, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - if ((audioCapPromise.state == audio.AudioState.STATE_STOPPED)) { - stateFlag = true; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - - await audioCapPromise.stop().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - if ((audioCapPromise.state == audioCapPromise.AudioState.STATE_STOPPED)) { - stateFlag = true; - console.info('AudioFrameworkRecLog: resultFlag : ' + stateFlag); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_ENUM_0100 - *@tc.name : AudioCapturer-Check-STATE-STOPPED - *@tc.desc : AudioCapturer with state stopped - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_ENUM_0100', 2, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - if ((audioCapPromise.state == audio.AudioState.STATE_STOPPED)) { - stateFlag = true; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - - await audioCapPromise.stop().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - if ((audioCapPromise.state == 3)) { - stateFlag = true; - console.info('AudioFrameworkRecLog: resultFlag : ' + stateFlag); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - //return resultFlag; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_0100 - *@tc.name : AudioCapturer-Check-STATE-RELEASED - *@tc.desc : AudioCapturer with state released - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_0100', 2, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - stateFlag = true; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - - await audioCapPromise.stop().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - stateFlag = true; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - if ((audioCapPromise.state == audio.AudioState.STATE_RELEASED)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - await sleep(1000); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - }); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_ENUM_0100 - *@tc.name : AudioCapturer-Check-STATE-RELEASED-ENUM - *@tc.desc : AudioCapturer with state released - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_ENUM_0100', 2, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - stateFlag = true; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - - await audioCapPromise.stop().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - stateFlag = true; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - if ((audioCapPromise.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_BUFFER_SIZE_0100 - *@tc.name : AudioCapturer-get_buffer_size - *@tc.desc : AudioCapturer with state stopped - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_BUFFER_SIZE_0100', 2, async function (done) { - let stateFlag; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - await sleep(1000); - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - if ((audioCapPromise.state == 2)) { - stateFlag = true; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - let bufferSize = await audioCapPromise.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - stateFlag = true; - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - if ((audioCapPromise.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_READ_BUFFER_0100 - *@tc.name : AudioCapturer-Check-READ_BUFFER - *@tc.desc : AudioCapturer with read buffer - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_READ_BUFFER_0100', 2, async function (done) { - let stateFlag; - await getFd("capture_CB_js-44100-2C-S16LE-checkpromisereadbuffer.pcm"); - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - return stateFlag; - }); - await sleep(1000); - await audioCapPromise.start().then(async function () { - console.info('AudioFrameworkRecLog: ---------START---------'); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - if ((audioCapPromise.state == 2)) { - stateFlag = true; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - - console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - let bufferSize = await audioCapPromise.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - stateFlag = true; - - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE PROMISE READ ---------'); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - let buffer = await audioCapPromise.read(bufferSize, true); - console.info('AudioFrameworkRecLog: ---------AFTER PROMISE READ ---------'); - //await sleep(50); - let number = fileio.writeSync(fd, buffer); - console.info('BufferRecLog: data written: ' + number); - console.info('AudioFrameworkRecLog: ---------AFTER PROMISE WRITE ---------'); - //await sleep(100); - numBuffersToCapture--; - } - //await sleep(3000); - - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapPromise.state); - if ((audioCapPromise.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_0100 - *@tc.name : AudioCapturer-Set1-Media - *@tc.desc : AudioCapturer with parameter set 1 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_0100', 2, async function (done) { - - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let AudioCapturerOptions = { - streamInfo: AudioStreamInfo, - capturerInfo: AudioCapturerInfo - } - - await getFd("capture_CB_js-44100-2C-16B.pcm"); - let resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(1000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_ENUM_0100 - *@tc.name : AudioCapturer-Set1-Media - *@tc.desc : AudioCapturer with parameter set 1 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_ENUM_0100 + *@tc.name : AudioCapturer-Set1-Media + *@tc.desc : AudioCapturer with parameter set 1 *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 @@ -1888,23 +1022,19 @@ describe('audioCapturer', function () { sampleFormat: 1, encodingType: 0 } - let AudioCapturerInfo = { source: 1, capturerFlags: 0 } - let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getFd("capture_CB_js-44100-2C-16B.pcm"); - let resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(1000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, ERROR_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -1922,25 +1052,17 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getFd("capture_js-44100-2C-16B.pcm"); - let resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(AudioCapturerOptions, done); }) /** @@ -1958,25 +1080,17 @@ describe('audioCapturer', function () { sampleFormat: 1, encodingType: 0 } - let AudioCapturerInfo = { - source: 1, + source: 0, capturerFlags: 0 } - let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getFd("capture_js-44100-2C-16B.pcm"); - let resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(AudioCapturerOptions, done); }) /** @@ -2004,13 +1118,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-44100-1C-16LE.pcm"); - let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions44100, done); }) /** @@ -2029,7 +1137,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo44100 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions44100 = { @@ -2038,14 +1146,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-44100-1C-16LE.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions44100, done); }) /** @@ -2073,13 +1174,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-96000-1C-S24LE.pcm"); - let resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions96000, done); }) /** @@ -2098,7 +1193,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo96000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions96000 = { @@ -2107,13 +1202,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-96000-1C-S24LE.pcm"); - let resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions96000, done); }) /** @@ -2141,13 +1230,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-48000-2C-1S32LE.pcm"); - let resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions48000, done); }) /** @@ -2166,7 +1249,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo48000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions48000 = { @@ -2175,13 +1258,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-48000-2C-1S32LE.pcm"); - let resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions48000, done); }) /** @@ -2209,13 +1286,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-8000-1C-8B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions8000, done); }) /** @@ -2234,7 +1305,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo8000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions8000 = { @@ -2243,13 +1314,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-8000-1C-8B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions8000, done); }) /** @@ -2277,13 +1342,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-11025-2C-16B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions11025, done); }) /** @@ -2302,23 +1361,16 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo11025 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions11025 = { streamInfo: audioStreamInfo11025, - capturerInfo: audioCapturerInfo11025, - } - - await getFd("capture_js-11025-2C-16B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); + capturerInfo: audioCapturerInfo11025, + } - done(); + await getFd("capture_js-11025-2C-16B.pcm"); + await recPromise(audioCapturerOptions11025, done); }) /** @@ -2346,13 +1398,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-12000-1C-24B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions12000, done); }) /** @@ -2371,7 +1417,7 @@ describe('audioCapturer', function () { encodingType: 0 }; let audioCapturerInfo12000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions12000 = { @@ -2380,13 +1426,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-12000-1C-24B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions12000, done); }) /** @@ -2414,13 +1454,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-16000-2C-32B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions16000, done); }) /** @@ -2439,7 +1473,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo16000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions16000 = { @@ -2448,13 +1482,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-16000-2C-32B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions16000, done); }) /** @@ -2482,13 +1510,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-22050-1C-8B.pcm"); - let resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions22050, done); }) /** @@ -2507,7 +1529,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo22050 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions22050 = { @@ -2516,14 +1538,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-22050-1C-8B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions22050, done); }) /** @@ -2551,14 +1566,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-24000-2C-16B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions24000, done); }) /** @@ -2577,7 +1585,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo24000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions24000 = { @@ -2586,14 +1594,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-24000-2C-16B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions24000, done); }) /** @@ -2621,14 +1622,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-32000-1C-24B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions32000, done); }) /** @@ -2647,7 +1641,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo32000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions32000 = { @@ -2656,14 +1650,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-32000-1C-24B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions32000, done); }) /** @@ -2691,14 +1678,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-64000-2C-32B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions64000, done); }) @@ -2718,7 +1698,7 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo64000 = { - source: 1, + source: 0, capturerFlags: 0 } let audioCapturerOptions64000 = { @@ -2727,14 +1707,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-64000-2C-32B.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions64000, done); }) /** @@ -2762,12 +1735,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-44100-1C-16LE.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_DEFAULT); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); + await recPromise(audioCapturerOptions44100, done); }) /** @@ -2795,14 +1763,7 @@ describe('audioCapturer', function () { } await getFd("capture_js-44100-1C-16LE.pcm"); - - let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, 0); - await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); - - expect(resultFlag).assertTrue(); - - done(); + await recPromise(audioCapturerOptions44100, done); }) /** @@ -2814,7 +1775,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_START_0100', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -2822,86 +1782,17 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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.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); - await audioCapCallBack.getAudioTime().then(async function (audioTime) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime AFTER START : Success' + audioTime); - if (audioTime != 0) { - stateFlag = true; - expect(stateFlag).assertTrue(); - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - await sleep(1000); - await audioCapCallBack.getAudioTime().then(async function (audioTime) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime : Success' + audioTime); - if (audioTime != 0) { - stateFlag = true; - expect(stateFlag).assertTrue(); - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - 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); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, START_EVENT, GET_AUDIOTIME_EVENT, GET_AUDIOTIME_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -2913,158 +1804,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_READ_WRITE_0100', 2, async function (done) { - let stateFlag; - await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let 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.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); - await audioCapCallBack.getAudioTime().then(async function (audioTime) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime AFTER WRITE : Success' + audioTime); - if (audioTime != 0) { - stateFlag = true; - } else { - stateFlag = false; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - await audioCapCallBack.getAudioTime().then(async function (audioTime1) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime AFTER WRITE : Success' + audioTime1); - if (audioTime1 != 0) { - stateFlag = true; - } else { - stateFlag = false; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - numBuffersToCapture--; - } - await sleep(3000); - - await audioCapCallBack.getAudioTime().then(async function (audioTime2) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime AFTER WRITE : Success' + audioTime2); - if (audioTime2 != 0) { - stateFlag = true; - } else { - stateFlag = false; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - 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_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_STOP_0100 - *@tc.name : AudioCapturer-GET_AUDIO_TIME - *@tc.desc : AudioCapturer GET_AUDIO_TIME - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_STOP_0100', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -3072,709 +1811,335 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - - let 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.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); - await audioCapCallBack.getAudioTime().then(async function (audioTime) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime AFTER WRITE : Success' + audioTime); - if (audioTime != 0) { - stateFlag = true; - } else { - stateFlag = false; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - await audioCapCallBack.getAudioTime().then(async function (audioTime1) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime AFTER WRITE : Success' + audioTime1); - if (audioTime1 != 0) { - stateFlag = true; - } else { - stateFlag = false; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - numBuffersToCapture--; - } - await sleep(3000); - audioCapCallBack.stop(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 STOP STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - if ((audioCapCallBack.state == 3)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO STOP STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - done(); - } - } - }); - await sleep(1000); - await audioCapCallBack.getAudioTime().then(async function (audioTime2) { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime AFTER WRITE : Success' + audioTime2); - if (audioTime2 != 0) { - stateFlag == true; - } else { - stateFlag == false; - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - 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(); - } else { - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - }) - - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_AUDIO_TIME_0100 - *@tc.name : AudioCapturer-GET_AUDIO_TIME - *@tc.desc : AudioCapturer GET_AUDIO_TIME - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_AUDIO_TIME_0100', 2, async function (done) { - let stateFlag; - let audioCapCallBack; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - await audioCapCallBack.start().then(async function () { - console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer start :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - await audioCapCallBack.getAudioTime(async (err, audioTime) => { - if (err) { - console.info('AudioFrameworkRecLog: AudioCapturer Not Created : Fail : Stream Type: FAIL'); - } else { - console.info('AudioFrameworkRecLog: AudioCapturer getAudioTime : Success' + audioTime); - if (audioTime != 0) { - stateFlag = true; - } else { - stateFlag = false; - } + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + console.log(`${Tag} createAudioCapturer ok`); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + + try { + await audioCapPromise.start(); + console.log(`${Tag} start ok`); + let audioTime = await audioCapPromise.getAudioTime(); + console.log(`${Tag} audioTime: ${JSON.stringify(audioTime)}`); + expect(audioTime).assertLarger(0); + + let bufferSize = await audioCapPromise.getBufferSize(); + console.log(`${Tag} AudioFrameworkRecLog: buffer size: ${JSON.stringify(bufferSize)}`); + let fd = fileio.openSync(dirPath, 0o102, 0o777); + console.log(`${Tag} fd: ${JSON.stringify(fd)}`); + if (fd !== null) { + console.log(`${Tag} AudioFrameworkRecLog: file fd created`); + } else { + console.log(`${Tag} AudioFrameworkRecLog: Capturer start :ERROR :`); + expect(false).assertTrue(); + done(); + return; } - }); - 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; + + fd = fileio.openSync(dirPath, 0o2002, 0o666); + console.log(`${Tag} fd1: ${JSON.stringify(fd)}`); + if (fd !== null) { + console.log(`${Tag} AudioFrameworkRecLog: file fd opened : Append Mode :PASS`); } 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(); - } else { - stateFlag = false; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } + console.log(`${Tag} AudioFrameworkRecLog: file fd Open: Append Mode : FAILED`); + expect(false).assertTrue(); + done(); + return; + } + let numBuffersToCapture = 45; + while (numBuffersToCapture) { + let buffer = await audioCapPromise.read(bufferSize, true); + let audioTime1 = await audioCapPromise.getAudioTime(); + console.log(`${Tag} audioTime1: ${JSON.stringify(audioTime1)}`); + expect(audioTime1).assertLarger(0); + let number = fileio.writeSync(fd, buffer); + console.info(`${Tag} AudioFrameworkRecLog:BufferRecLog: data written: ${JSON.stringify(number)}`); + numBuffersToCapture--; } - }); + let audioTime2 = await audioCapPromise.getAudioTime(); + console.log(`${Tag} audioTime2: ${JSON.stringify(audioTime2)}`); + expect(audioTime2).assertLarger(0); + } catch (err) { + console.log(`${Tag} start-getAudioTime-getBufferSize-read-getAudioTimein- err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCapPromise.release(); + } catch (err) { + console.log(`${Tag} err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOP_BEFORE_START_0100 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_STOP_0100 *@tc.name : AudioCapturer-GET_AUDIO_TIME *@tc.desc : AudioCapturer GET_AUDIO_TIME *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOP_BEFORE_START_0100', 2, async function (done) { - let stateFlag; - let audioCapPromise; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_STOP_0100', 2, async function (done) { + await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO NEW STATE---------'); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS' + audioCapCallBack.state); - stateFlag == true; - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - await sleep(1000); - await audioCapPromise.stop().then(async function () { - console.info('AudioFrameworkRecLog: AudioCapturer STOPED : UNSUCCESS' + audioCapCallBack.state); - if (audioCapCallBack.state == 1) { - stateFlag = true; - } else { - stateFlag = false; + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + console.log(`${Tag} createAudioCapturer ok`); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + + try { + await audioCapPromise.start(); + console.log(`${Tag} start ok`); + let audioTime = await audioCapPromise.getAudioTime(); + console.log(`${Tag} audioTime: ${JSON.stringify(audioTime)}`); + expect(audioTime).assertLarger(0); + + let bufferSize = await audioCapPromise.getBufferSize(); + console.log(`${Tag} AudioFrameworkRecLog: buffer size: ${JSON.stringify(bufferSize)}`); + let fd = fileio.openSync(dirPath, 0o102, 0o777); + console.log(`${Tag} fd: ${JSON.stringify(fd)}`); + if (fd !== null) { + console.log(`${Tag} AudioFrameworkRecLog: file fd created`); + } + else { + console.log(`${Tag} AudioFrameworkRecLog: Capturer start :ERROR :`); + expect(false).assertTrue(); + done(); + return; } - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop :ERROR : ' + err.message); - stateFlag = false; - }); - await sleep(1000); - audioCapPromise.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(); - } + + fd = fileio.openSync(dirPath, 0o2002, 0o666); + console.log(`${Tag} fd1: ${JSON.stringify(fd)}`); + if (fd !== null) { + console.log(`${Tag} AudioFrameworkRecLog: file fd opened : Append Mode :PASS`); } - }); - await sleep(1000); + else { + console.log(`${Tag} AudioFrameworkRecLog: file fd Open: Append Mode : FAILED`); + expect(false).assertTrue(); + done(); + return; + } + let numBuffersToCapture = 45; + while (numBuffersToCapture) { + let buffer = await audioCapPromise.read(bufferSize, true); + let audioTime1 = await audioCapPromise.getAudioTime(); + console.log(`${Tag} audioTime1: ${JSON.stringify(audioTime1)}`); + expect(audioTime1).assertLarger(0); + let number = fileio.writeSync(fd, buffer); + console.info(`${Tag} AudioFrameworkRecLog:BufferRecLog: data written: ${JSON.stringify(number)}`); + numBuffersToCapture--; + } + } catch (err) { + console.log(`${Tag} start-getAudioTime-getBufferSize-read-getAudioTimein- err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try{ + await audioCapPromise.stop(); + let audioTime2 = await audioCapPromise.getAudioTime(); + console.log(`${Tag} audioTime2: ${JSON.stringify(audioTime2)}`); + expect(audioTime2).assertLarger(0); + } catch (err) { + console.log(`${Tag} stop-getAudioTimein- err: ${JSON.stringify(err)}`); + expect(true).assertTrue(); + } + + try { + await audioCapPromise.release(); + } catch (err) { + console.log(`${Tag} err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASE_BEFORE_START_0100 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_AUDIO_TIME_0100 *@tc.name : AudioCapturer-GET_AUDIO_TIME *@tc.desc : AudioCapturer GET_AUDIO_TIME *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASE_BEFORE_START_0100', 2, async function (done) { - let stateFlag; - let audioCapPromise; + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_AUDIO_TIME_0100', 2, async function (done) { let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { - audioCapPromise = data; - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO NEW STATE---------'); - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS' + audioCapCallBack.state); - stateFlag = true; - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - }); - await sleep(1000); - await audioCapPromise.release().then(async function () { - console.info('AudioFrameworkRecLog: Capturer released :SUCCESS '); - stateFlag = true; - }).catch((err) => { - console.info('AudioFrameworkRecLog: Capturer stop :ERROR : ' + err.message); - stateFlag = false; - expect(stateFlag).assertTrue(); - }); - await sleep(1000); - audioCapPromise.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 : ' + audioCapPromise.state); - if ((audioCapPromise.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - stateFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + try { + await audioCapPromise.start(); + let audioTime = await audioCapPromise.getAudioTime(); + console.log(`${Tag} audioTime: ${JSON.stringify(audioTime)}`) + expect(audioTime).assertLarger(0); + } catch (err) { + console.log(`${Tag} start-getAudioTime err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCapPromise.release(); + } catch (err) { + console.log(`${Tag} err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_0100 - *@tc.name : AudioRec-Set1 - *@tc.desc : record audio with parameter set 1 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOP_BEFORE_START_0100 + *@tc.name : AudioCapturer-GET_AUDIO_TIME + *@tc.desc : AudioCapturer createAudioCapturer->stop->release *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_0100', 2, async function (done) { - let audioCapGetgetStreamInfo; - let setFlag; - let audioStreamInfo44100 = { + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOP_BEFORE_START_0100', 2, async function (done) { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - - let audioCapturerInfo44100 = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptionsInvalid = { - streamInfo: audioStreamInfo44100, - capturerInfo: audioCapturerInfo44100, + let AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo } - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetStreamInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - await audioCapGetgetStreamInfo.getStreamInfo().then(async function (audioParamsGet) { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo:'); - console.info('AudioFrameworkRecLog: Capturer sampleFormat:' + audioParamsGet.sampleFormat); - console.info('AudioFrameworkRecLog: Capturer samplingRate:' + audioParamsGet.samplingRate); - console.info('AudioFrameworkRecLog: Capturer channels:' + audioParamsGet.channels); - console.info('AudioFrameworkRecLog: Capturer encodingType:' + audioParamsGet.encodingType); - setFlag = true; - if (setFlag) { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo: PASS'); - } - }).catch((err) => { - console.log('AudioFrameworkRecLog: getStreamInfo :ERROR: ' + err.message); - setFlag = false - }); - await sleep(1000); - audioCapGetgetStreamInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetStreamInfo.state); - if ((audioCapGetgetStreamInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_ENUM_0100 - *@tc.name : AudioRec-Set1 - *@tc.desc : record audio with parameter set 1 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_ENUM_0100', 2, async function (done) { - let audioCapGetgetStreamInfo; - let setFlag; - let audioStreamInfo44100 = { - samplingRate: 44100, - channels: 1, - sampleFormat: 1, - encodingType: 0, - }; - let audioCapturerInfo44100 = { - source: 1, - capturerFlags: 0 - } - let AudioCapturerOptionsInvalid = { - streamInfo: audioStreamInfo44100, - capturerInfo: audioCapturerInfo44100, + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + console.log(`${Tag} createAudioCapturer ok`); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + + try { + await audioCapPromise.stop(); + console.log(`${Tag} stop ok`); + } catch (err) { + console.log(`${Tag} stop err: ${JSON.stringify(err)}`); + expect(err.code).assertEqual(200); } - - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetStreamInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - await audioCapGetgetStreamInfo.getStreamInfo().then(async function (audioParamsGet) { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo:'); - console.info('AudioFrameworkRecLog: Capturer sampleFormat:' + audioParamsGet.sampleFormat); - console.info('AudioFrameworkRecLog: Capturer samplingRate:' + audioParamsGet.samplingRate); - console.info('AudioFrameworkRecLog: Capturer channels:' + audioParamsGet.channels); - console.info('AudioFrameworkRecLog: Capturer encodingType:' + audioParamsGet.encodingType); - setFlag = true; - if (setFlag) { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo: PASS'); - } - }).catch((err) => { - console.log('AudioFrameworkRecLog: getStreamInfo :ERROR: ' + err.message); - setFlag = false; - expect(setFlag).assertTrue(); - }); - await sleep(1000); - audioCapGetgetStreamInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetStreamInfo.state); - if ((audioCapGetgetStreamInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - - + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_0200 - *@tc.name : AudioRec-Set1 - *@tc.desc : record audio with parameter set 1 + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASE_BEFORE_START_0100 + *@tc.name : AudioCapturer-GET_AUDIO_TIME + *@tc.desc : AudioCapturer GET_AUDIO_TIME *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_0200', 2, async function (done) { - let audioCapGetgetStreamInfo; - let setFlag; - let audioStreamInfo44100 = { + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASE_BEFORE_START_0100', 2, async function (done) { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - - let audioCapturerInfo44100 = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptionsInvalid = { - streamInfo: audioStreamInfo44100, - capturerInfo: audioCapturerInfo44100, + let AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo } - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetStreamInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - audioCapGetgetStreamInfo.getStreamInfo(async (err, audioParamsGet) => { - console.info('AudioFrameworkRecLog: ---------GET STREAM INFO---------'); - console.log('AudioFrameworkRecLog: Entered getStreamInfo'); - if (err) { - console.log('AudioFrameworkRecLog: getStreamInfo :ERROR: ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo:'); - console.info('AudioFrameworkRecLog: Capturer sampleFormat:' + audioParamsGet.sampleFormat); - console.info('AudioFrameworkRecLog: Capturer samplingRate:' + audioParamsGet.samplingRate); - console.info('AudioFrameworkRecLog: Capturer channels:' + audioParamsGet.channels); - console.info('AudioFrameworkRecLog: Capturer encodingType:' + audioParamsGet.encodingType); - setFlag = true; - } - await sleep(100); - done(); - }); - - audioCapGetgetStreamInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetStreamInfo.state); - if ((audioCapGetgetStreamInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_ENUM_0200 - *@tc.name : AudioRec-Set1 - *@tc.desc : record audio with parameter set 1 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_ENUM_0200', 2, async function (done) { - let audioCapGetgetStreamInfo; - let setFlag; - let audioStreamInfo44100 = { - samplingRate: 44100, - channels: 1, - sampleFormat: 1, - encodingType: 0, - }; - let audioCapturerInfo44100 = { - source: 1, - capturerFlags: 0 - } - let AudioCapturerOptionsInvalid = { - streamInfo: audioStreamInfo44100, - capturerInfo: audioCapturerInfo44100, + let audioCapPromise; + try { + audioCapPromise = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + + try { + await audioCapPromise.release(); + expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_RELEASED); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCapPromise.release(); + } catch (err) { + console.log(`${Tag} re-release err: ${JSON.stringify(err)}`); + expect(true).assertTrue(); } - - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetStreamInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - audioCapGetgetStreamInfo.getStreamInfo(async (err, audioParamsGet) => { - console.info('AudioFrameworkRecLog: ---------GET STREAM INFO---------'); - console.log('AudioFrameworkRecLog: Entered getStreamInfo'); - if (err) { - console.log('AudioFrameworkRecLog: getStreamInfo :ERROR: ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer getStreamInfo:'); - console.info('AudioFrameworkRecLog: Capturer sampleFormat:' + audioParamsGet.sampleFormat); - console.info('AudioFrameworkRecLog: Capturer samplingRate:' + audioParamsGet.samplingRate); - console.info('AudioFrameworkRecLog: Capturer channels:' + audioParamsGet.channels); - console.info('AudioFrameworkRecLog: Capturer encodingType:' + audioParamsGet.encodingType); - setFlag = true; - } - await sleep(1000); - }); - - audioCapGetgetStreamInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetStreamInfo.state); - if ((audioCapGetgetStreamInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); - + done(); }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_0300 + *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_0100 *@tc.name : AudioRec-Set1 *@tc.desc : record audio with parameter set 1 *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_0300', 2, async function (done) { - let audioCapGetgetCapturerInfo; - let setFlag; + it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_0100', 2, async function (done) { let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -3785,68 +2150,47 @@ describe('audioCapturer', function () { let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 - } - let AudioCapturerOptionsInvalid = { - streamInfo: audioStreamInfo44100, - capturerInfo: audioCapturerInfo44100, - } - - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetCapturerInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - await audioCapGetgetCapturerInfo.getCapturerInfo().then(async function (audioParamsGet) { - console.info('AudioFrameworkRecLog: Capturer CapturerInfo:'); - console.info('AudioFrameworkRecLog: Capturer SourceType:' + audioParamsGet.source); - console.info('AudioFrameworkRecLog: Capturer capturerFlags:' + audioParamsGet.capturerFlags); - setFlag = true; - }).catch((err) => { - console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: ' + err.message); - setFlag = false; - }); - await sleep(1000); - audioCapGetgetCapturerInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetCapturerInfo.state); - if ((audioCapGetgetCapturerInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + } + let AudioCapturerOptions = { + streamInfo: audioStreamInfo44100, + capturerInfo: audioCapturerInfo44100, + } + + let audioCap; + try { + audioCap = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + try { + let audioParamsGet = await audioCap.getStreamInfo(); + console.info(`${Tag} AudioFrameworkRecLog: Capturer getStreamInfo:${JSON.stringify(audioParamsGet)}`); + } catch (err) { + console.log(`${Tag} getStreamInfo err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCap.release(); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_ENUM_0300 + *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_ENUM_0100 *@tc.name : AudioRec-Set1 *@tc.desc : record audio with parameter set 1 *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_ENUM_0300', 2, async function (done) { - let audioCapGetgetCapturerInfo; - let setFlag; + it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_ENUM_0100', 2, async function (done) { let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, @@ -3854,146 +2198,154 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo44100 = { - source: 1, + source: 0, capturerFlags: 0 } - let AudioCapturerOptionsInvalid = { + let AudioCapturerOptions = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetCapturerInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - await audioCapGetgetCapturerInfo.getCapturerInfo().then(async function (audioParamsGet) { - console.info('AudioFrameworkRecLog: Capturer CapturerInfo:'); - console.info('AudioFrameworkRecLog: Capturer SourceType:' + audioParamsGet.source); - console.info('AudioFrameworkRecLog: Capturer capturerFlags:' + audioParamsGet.capturerFlags); - setFlag = true; - }).catch((err) => { - setFlag = false; - console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: ' + err.message); - }); - await sleep(1000); - audioCapGetgetCapturerInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetCapturerInfo.state); - if ((audioCapGetgetCapturerInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + let audioCap; + try { + audioCap = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + try { + let audioParamsGet = await audioCap.getStreamInfo(); + console.info(`${Tag} AudioFrameworkRecLog: Capturer getStreamInfo:${JSON.stringify(audioParamsGet)}`); + } catch (err) { + console.log(`${Tag} getStreamInfo err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCap.release(); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + console.log(`${Tag} audioCap.state: ${JSON.stringify(audioCap.state)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_CAPTURER_INFO_0400 + *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_0200 *@tc.name : AudioRec-Set1 *@tc.desc : record audio with parameter set 1 *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_CAPTURER_INFO_0400', 2, async function (done) { - let audioCapGetgetCapturerInfo; - let setFlag; + it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_0200', 2, async function (done) { let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let AudioCapturerOptionsInvalid = { + let AudioCapturerOptions = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetCapturerInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - audioCapGetgetCapturerInfo.getCapturerInfo(async (err, audioParamsGet) => { - console.info('AudioFrameworkRecLog: ---------GET CAPTURER INFO---------'); + let audioCap; + try { + audioCap = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + + try { + let audioParamsGet = await audioCap.getStreamInfo(); + console.info(`${Tag} AudioFrameworkRecLog: Capturer getStreamInfo:${JSON.stringify(audioParamsGet)}`); + } catch (err) { + console.log(`${Tag} getStreamInfo err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + + audioCap.release((err) => { if (err) { - console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer CapturerInfo:'); - console.info('AudioFrameworkRecLog: Capturer SourceType:' + audioParamsGet.source); - console.info('AudioFrameworkRecLog: Capturer capturerFlags:' + audioParamsGet.capturerFlags); - setFlag = true; - await sleep(100); + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); done(); + return; } - }); - await sleep(1000); - audioCapGetgetCapturerInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetCapturerInfo.state); - if ((audioCapGetgetCapturerInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + expect(audioCap.state).assertEqual(audio.AudioState.STATE_RELEASED); + done(); + }) + }) + + /** + *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_0300 + *@tc.name : AudioRec-Set1 + *@tc.desc : record audio with parameter set 1 + *@tc.size : MEDIUM + *@tc.type : Function + *@tc.level : Level 2 + */ + it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_0300', 2, async function (done) { + let audioStreamInfo44100 = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + + let audioCapturerInfo44100 = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 0 + } + let AudioCapturerOptions = { + streamInfo: audioStreamInfo44100, + capturerInfo: audioCapturerInfo44100, + } + + let audioCap; + try { + audioCap = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } + + try { + let audioParamsGet = await audioCap.getCapturerInfo(); + console.info(`${Tag} AudioFrameworkRecLog: Capturer CapturerInfo: ${JSON.stringify(audioParamsGet)}`); + } catch (err) { + console.log(`${Tag} getStreamInfo err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + try { + await audioCap.release(); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_ENUM_0400 + *@tc.number : SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_ENUM_0300 *@tc.name : AudioRec-Set1 *@tc.desc : record audio with parameter set 1 *@tc.size : MEDIUM *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_ENUM_0400', 2, async function (done) { - let audioCapGetgetCapturerInfo; - let setFlag; + it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_ENUM_0300', 2, async function (done) { let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, @@ -4001,60 +2353,38 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo44100 = { - source: 1, + source: 0, capturerFlags: 0 } - let AudioCapturerOptionsInvalid = { + let AudioCapturerOptions = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { - if (data != undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); - audioCapGetgetCapturerInfo = data; - } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); - } - }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); - done(); - }); - await sleep(1000); - audioCapGetgetCapturerInfo.getCapturerInfo(async (err, audioParamsGet) => { - console.info('AudioFrameworkRecLog: ---------GET CAPTURER INFO---------'); - if (err) { - console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: Capturer CapturerInfo:'); - console.info('AudioFrameworkRecLog: Capturer SourceType:' + audioParamsGet.source); - console.info('AudioFrameworkRecLog: Capturer capturerFlags:' + audioParamsGet.capturerFlags); - setFlag = true; - await sleep(1000); - done(); - } - }); + let audioCap; + try { + audioCap = await audio.createAudioCapturer(AudioCapturerOptions); + } catch (err) { + console.log(`${Tag} createAudioCapturer err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + return done(); + } - audioCapGetgetCapturerInfo.release(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------RELEASE RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - setFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO RELASED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapGetgetCapturerInfo.state); - if ((audioCapGetgetCapturerInfo.state == 4)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO RELEASED STATE---------'); - setFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + setFlag); - expect(setFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + try { + let audioParamsGet = await audioCap.getCapturerInfo(); + console.info(`${Tag} AudioFrameworkRecLog: Capturer CapturerInfo: ${JSON.stringify(audioParamsGet)}`); + } catch (err) { + console.log(`${Tag} getStreamInfo err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + + try { + await audioCap.release(); + } catch (err) { + console.log(`${Tag} release err: ${JSON.stringify(err)}`); + expect(false).assertTrue(); + } + done(); }) /** @@ -4073,25 +2403,24 @@ describe('audioCapturer', function () { encodingType: 0, }; let audioCapturerInfo44100 = { - source: 1, + source: 0, capturerFlags: 0 } let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } - - let audioCap; - await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { if (data == undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Unsuccess : ${JSON.stringify(data)}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Success: ${JSON.stringify(data)}`); + expect(false).assertTrue(); } }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${JSON.stringify(err.message)}`); + expect(true).assertTrue(); }); done(); }) @@ -4122,14 +2451,16 @@ describe('audioCapturer', function () { await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { if (data == undefined) { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Unsuccess :' + data); + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Unsuccess : ${JSON.stringify(data)}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkRecLog: AudioCapturer Created : Success:' + data.state); + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Success: ${JSON.stringify(data)}`); + expect(false).assertTrue(); } }).catch((err) => { - console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${JSON.stringify(err.message)}`); + expect(true).assertTrue(); }); done(); }) @@ -4143,8 +2474,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0100', 2, async function (done) { - let stateFlag; - let audioCapCallBack; let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -4159,94 +2488,10 @@ describe('audioCapturer', function () { 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('stateChange', (AudioState) => { - console.info('AudioCapturerLog: Changed State to : ' + AudioState) - switch (AudioState) { - case audio.AudioState.STATE_NEW: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------NEW--------------'); - console.info('AudioFrameworkTest: Audio State is : New'); - break; - case audio.AudioState.STATE_PREPARED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------PREPARED--------------'); - console.info('AudioFrameworkTest: Audio State is : Prepared'); - break; - case audio.AudioState.STATE_RUNNING: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RUNNING--------------'); - console.info('AudioFrameworkTest: Audio State is : Running'); - break; - case audio.AudioState.STATE_STOPPED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------STOPPED--------------'); - console.info('AudioFrameworkTest: Audio State is : stopped'); - break; - case audio.AudioState.STATE_RELEASED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RELEASED--------------'); - console.info('AudioFrameworkTest: Audio State is : released'); - break; - default: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------INVALID--------------'); - console.info('AudioFrameworkTest: Audio State is : invalid'); - break; - } - }); - 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 '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - stateFlag == true; - } - } - }); - await sleep(1000); - audioCapCallBack.stop(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------STOP RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO STOPPED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - if ((audioCapCallBack.state == audio.AudioState.STATE_STOPPED)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO STOPPED STATE---------'); - stateFlag == true; - } - console.info('AudioFrameworkRecLog: stateFlag : ' + stateFlag); - } - }); - 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - }); - await sleep(1000); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, STATE_CHANGE_EVENT, START_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -4258,89 +2503,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0200', 2, async function (done) { - let stateFlag; - let audioCapCallBack; - let AudioStreamInfo = { - samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, - channels: audio.AudioChannel.CHANNEL_2, - sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, - encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW - } - let AudioCapturerInfo = { - source: audio.SourceType.SOURCE_TYPE_MIC, - capturerFlags: 0 - } - let 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('stateChange', (AudioState) => { - console.info('AudioCapturerLog: Changed State to : ' + AudioState) - switch (AudioState) { - case audio.AudioState.STATE_NEW: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------NEW--------------'); - console.info('AudioFrameworkTest: Audio State is : New'); - break; - case audio.AudioState.STATE_PREPARED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------PREPARED--------------'); - console.info('AudioFrameworkTest: Audio State is : Prepared'); - break; - case audio.AudioState.STATE_RUNNING: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RUNNING--------------'); - console.info('AudioFrameworkTest: Audio State is : Running'); - break; - case audio.AudioState.STATE_STOPPED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------STOPPED--------------'); - console.info('AudioFrameworkTest: Audio State is : stopped'); - break; - case audio.AudioState.STATE_RELEASED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RELEASED--------------'); - console.info('AudioFrameworkTest: Audio State is : released'); - break; - default: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------INVALID--------------'); - console.info('AudioFrameworkTest: Audio State is : invalid'); - break; - } - }); - 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - }); - await sleep(1000); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300 - *@tc.name : AudioCapturer-Check-STATE-STOPPED - *@tc.desc : AudioCapturer with state stopped - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300', 2, async function (done) { - let stateFlag; - let audioCapCallBack; let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -4351,80 +2513,43 @@ describe('audioCapturer', function () { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('stateChange', (AudioState) => { - console.info('AudioCapturerLog: Changed State to : ' + AudioState) - switch (AudioState) { - case audio.AudioState.STATE_NEW: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------NEW--------------'); - console.info('AudioFrameworkTest: Audio State is : New'); - break; - case audio.AudioState.STATE_PREPARED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------PREPARED--------------'); - console.info('AudioFrameworkTest: Audio State is : Prepared'); - break; - case audio.AudioState.STATE_RUNNING: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RUNNING--------------'); - console.info('AudioFrameworkTest: Audio State is : Running'); - break; - case audio.AudioState.STATE_STOPPED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------STOPPED--------------'); - console.info('AudioFrameworkTest: Audio State is : stopped'); - break; - case audio.AudioState.STATE_RELEASED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RELEASED--------------'); - console.info('AudioFrameworkTest: Audio State is : released'); - break; - default: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------INVALID--------------'); - console.info('AudioFrameworkTest: Audio State is : invalid'); - break; - } - }); - 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 '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - stateFlag == true; - } - } - }); - 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - }); - await sleep(1000); + let AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, STATE_CHANGE_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); + }) + + /** + *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300 + *@tc.name : AudioCapturer-Check-STATE-STOPPED + *@tc.desc : AudioCapturer with state stopped + *@tc.size : MEDIUM + *@tc.type : Function + *@tc.level : Level 2 + */ + it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300', 2, async function (done) { + let AudioStreamInfo = { + samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, + channels: audio.AudioChannel.CHANNEL_2, + sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, + encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW + } + let AudioCapturerInfo = { + source: audio.SourceType.SOURCE_TYPE_MIC, + capturerFlags: 0 + } + let AudioCapturerOptions = { + streamInfo: AudioStreamInfo, + capturerInfo: AudioCapturerInfo + } + + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, STATE_CHANGE_EVENT, START_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -4436,8 +2561,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0400', 2, async function (done) { - let stateFlag; - let audioCapCallBack; let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, @@ -4452,95 +2575,10 @@ describe('audioCapturer', function () { 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('stateChange', (AudioState) => { - console.info('AudioCapturerLog: Changed State to : ' + AudioState) - switch (AudioState) { - case audio.AudioState.STATE_NEW: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------NEW--------------'); - console.info('AudioFrameworkTest: Audio State is : New'); - break; - case audio.AudioState.STATE_PREPARED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------PREPARED--------------'); - console.info('AudioFrameworkTest: Audio State is : Prepared'); - break; - case audio.AudioState.STATE_RUNNING: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RUNNING--------------'); - console.info('AudioFrameworkTest: Audio State is : Running'); - break; - case audio.AudioState.STATE_STOPPED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------STOPPED--------------'); - console.info('AudioFrameworkTest: Audio State is : stopped'); - break; - case audio.AudioState.STATE_RELEASED: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------RELEASED--------------'); - console.info('AudioFrameworkTest: Audio State is : released'); - break; - default: - console.info('AudioFrameworkTest:--------CHANGE IN AUDIO STATE----------INVALID--------------'); - console.info('AudioFrameworkTest: Audio State is : invalid'); - break; - } - }); - 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 '); - await sleep(1000); - if ((audioCapCallBack.state == 2)) { - stateFlag == true; - } - } - }); - await sleep(1000); - - audioCapCallBack.stop(async (err, value) => { - console.info('AudioFrameworkRecLog: ---------STOP RECORD---------'); - if (err) { - console.info('AudioFrameworkRecLog: Capturer stop:ERROR : ' + err.message); - stateFlag = false; - } else { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK AUDIO STOPPED STATE---------'); - console.info('AudioFrameworkRecLog: Capturer stopped : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - if ((audioCapCallBack.state == audio.AudioState.STATE_STOPPED)) { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK AUDIO STOPPED STATE---------'); - stateFlag == true; - } - console.info('AudioFrameworkRecLog: stateFlag : ' + stateFlag); - } - }); - 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: Capturer release : SUCCESS'); - console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); - stateFlag = true; - console.info('AudioFrameworkRenderLog: stateFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - }); - await sleep(1000); + let audioCap = null; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, STATE_CHANGE_EVENT, START_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -4552,7 +2590,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0100', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -4560,125 +2597,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', 5000, (position) => { - if (position == 5000) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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(); - } else { - stateFlag = false; - console.info('AudioFrameworkRenderLog: resultFlag : ' + stateFlag); - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + let audioCap = null; + let markReachParam = 5000; + markReachState = 'failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -4690,7 +2622,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0200', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -4698,119 +2629,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', 1000, (position) => { - if (position == 1000) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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; - expect(stateFlag).assertTrue(); - done(); - } - } - }); - await sleep(1000); + let audioCap = null; + let markReachParam = 1000; + markReachState = 'failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -4822,7 +2654,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0300', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -4830,120 +2661,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', 10000, (position) => { - if (position == 10000) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); + let audioCap = null; + let markReachParam = 10000; + markReachState = 'failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -4955,7 +2686,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0400', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -4963,120 +2693,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', 100, (position) => { - if (position == 100) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); + let audioCap = null; + let markReachParam = 100; + markReachState = 'failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -5088,7 +2718,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0500', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -5096,123 +2725,22 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', 1, (position) => { - if (position == 1) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); + let audioCap = null; + let markReachParam = 1; + markReachState = 'failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) - /** *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0600 *@tc.name : AudioCapturer-Check-READ_BUFFER @@ -5222,7 +2750,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0600', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -5230,123 +2757,22 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', 0, (position) => { - if (position == 0) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); + let audioCap = null; + let markReachParam = 0; + markReachState = 'invalid_failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) - /** *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0700 *@tc.name : AudioCapturer-Check-READ_BUFFER @@ -5356,7 +2782,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0700', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -5364,120 +2789,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', 1234567890, (position) => { - if (position == 1234567890) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); + let audioCap = null; + let markReachParam = 1234567890; + markReachState = 'invalid_failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -5489,7 +2814,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0800', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -5497,120 +2821,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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('markReach', -2, (position) => { - if (position == -2) { - console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); - console.info('AudioRenderLog: mark reached: ' + position); - stateFlag = true; - } else { - stateFlag = false; - expect(stateFlag).assertTrue(); - done(); - } - }); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); + let audioCap = null; + let markReachParam = -2; + markReachState = 'invalid_failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -5622,7 +2846,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0100', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -5630,142 +2853,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); - } - + let audioCap = null; + let periodReachParam = 1000; + periodReachState = 'failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, PERIODR_REACH_EVENT, periodReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_PERIODR_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -5777,7 +2878,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0200', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -5785,142 +2885,20 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); - } - + let audioCap = null; + let periodReachParam = 1; + periodReachState = 'failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, PERIODR_REACH_EVENT, periodReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_PERIODR_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) /** @@ -5932,7 +2910,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0300', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -5940,145 +2917,22 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); - } - + let audioCap = null; + let periodReachParam = -2; + periodReachState = 'invalid_failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, PERIODR_REACH_EVENT, periodReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_PERIODR_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) - /** *@tc.number : SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0400 *@tc.name : AudioCapturer-Check-READ_BUFFER @@ -6088,7 +2942,6 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0400', 2, async function (done) { - let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, @@ -6096,141 +2949,19 @@ describe('audioCapturer', function () { sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - let 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); - 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---------'); - let bufferSize = await audioCapCallBack.getBufferSize(); - console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - await sleep(1000); - console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - let fd = fileio.openSync(dirPath, 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(dirPath, 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); - let numBuffersToCapture = 45; - while (numBuffersToCapture) { - console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); - await new Promise((resolve, reject) => { - audioCapCallBack.read(bufferSize, true, async (err, buffer) => { - if (err) { - console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); - stateFlag = false; - reject(err); - } else { - console.info('AudioFrameworkRecLog: ---------AFTER CHECK CB READ BUFFER---------'); - console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); - await sleep(50); - console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - let number = fileio.writeSync(fd, buffer); - console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); - await sleep(100); - stateFlag = true; - resolve(); - } - }); - }) - 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); - } - + let audioCap = null; + let periodReachParam = 223750; + periodReachState = 'invalid_failure'; + let mySteps = [CREATE_EVENT, AudioCapturerOptions, PERIODR_REACH_EVENT, periodReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_PERIODR_REACH_EVENT, RELEASE_EVENT, END_EVENT]; + eventEmitter.emit(mySteps[0], audioCap, mySteps, done); }) }) diff --git a/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js b/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js index 246876b1f..d92214059 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js +++ b/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js @@ -20,52 +20,52 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from describe('audioCapturerChange', function () { let audioStreamManager; let audioStreamManagerCB; - let Tag = "AFCapLog : "; + let Tag = "AFCapLog"; const audioManager = audio.getAudioManager(); - console.info(Tag + 'Create AudioManger Object JS Framework'); + console.info(`${Tag}: Create AudioManger Object JS Framework`); beforeAll(async function () { - console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); + console.info(`AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`); let permissionName1 = 'ohos.permission.MICROPHONE'; let permissionNameList = [permissionName1]; let appName = 'ohos.acts.multimedia.audio.audiocapturerchangeInfo'; await audioTestBase.applyPermission(appName, permissionNameList); await sleep(100); - console.info('AudioFrameworkTest: beforeAll: END'); + console.info(`AudioFrameworkTest: beforeAll: END`); await sleep(100); - await audioManager.getStreamManager().then(async function (data) { + await audioManager.getStreamManager().then((data) => { audioStreamManager = data; - console.info(Tag + ' Get AudioStream Manager : Success '); + console.info(`${Tag}: Get AudioStream Manager : Success `); }).catch((err) => { - console.info(Tag + ' Get AudioStream Manager : ERROR : ' + err.message); + console.info(`${Tag}: Get AudioStream Manager : ERROR :${err.message}`); }); audioManager.getStreamManager((err, data) => { if (err) { - console.error(Tag + ' Get AudioStream Manager : ERROR : ' + err.message); + console.error(`${Tag}: Get AudioStream Manager : ERROR :${err.message}`); } else { audioStreamManagerCB = data; - console.info(Tag + ' Get AudioStream Manager : Success '); + console.info(`${Tag}: Get AudioStream Manager : Success `); } }); await sleep(1000); - console.info(Tag + ' beforeAll: END'); + console.info(`${Tag}: beforeAll: END`); }) beforeEach(async function () { - console.info(Tag + ' beforeEach: Prerequisites at the test case level'); + console.info(`${Tag}: beforeEach: Prerequisites at the test case level`); await sleep(1000); }) afterEach(function () { - console.info(Tag + ' afterEach: Test case-level clearance conditions'); + console.info(`${Tag}: afterEach: Test case-level clearance conditions`); }) afterAll(async function () { await sleep(1000); - console.info(Tag + ' afterAll: Test suite-level cleanup condition'); + console.info(`${Tag}: afterAll: Test suite-level cleanup condition`); }) function sleep(ms) { @@ -101,22 +101,22 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', async (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag} : ## CapChange on is called for element ${i} ##`); + console.info(`${Tag} : StreamId for ${i} is: ${AudioCapturerChangeInfoArray[i].streamId}`); + console.info(`${Tag} : ClientUid for ${i} is: ${AudioCapturerChangeInfoArray[i].clientUid}`); + console.info(`${Tag} : Content for ${i} is: ${AudioCapturerChangeInfoArray[i].capturerInfo.source}`); + console.info(`${Tag} : Stream for ${i} is: ${AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags}`); + console.info(`${Tag} : Flag ${i} is: ${AudioCapturerChangeInfoArray[i].capturerState}`);; let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag} : Id: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id}`); + console.info(`${Tag} : Type: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType}`); + console.info(`${Tag} : Role: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); + console.info(`${Tag} : Name: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name}`); + console.info(`${Tag} : Addr: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address}`); + console.info(`${Tag} : SR: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); + console.info(`${Tag} : C: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); + console.info(`${Tag} : CM: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 1 && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); @@ -166,52 +166,40 @@ describe('audioCapturerChange', function () { let audioCap; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); audioStreamManagerCB.on('audioCapturerChange', async (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 2 && devDescriptor != null) { resultFlag = true; - console.info(Tag + '[CAPTURER-CHANGE-ON-002] ResultFlag for element ' + i + ' is: ' + resultFlag); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-002] ResultFlag for element ${i} is: ${resultFlag}`); audioStreamManagerCB.off('audioCapturerChange'); - console.info(Tag + '[CAPTURER-CHANGE-ON-002] ######### CapturerChange Off is called #########'); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-002] ######### CapturerChange Off is called #########`); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); done(); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); } } }); - await audioCap.start().then(async function () { - console.info(Tag + 'Capturer started :SUCCESS '); + await audioCap.start().then(() => { + console.info(`${Tag}: Capturer started :Success `); }).catch((err) => { - console.info(Tag + 'Capturer start :ERROR : ' + err.message); + console.info(`${Tag}: Capturer start :ERROR :${err.message}`); }); }) @@ -246,65 +234,53 @@ describe('audioCapturerChange', function () { let audioCap; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); - await audioCap.start().then(async function () { - console.info(Tag + 'Capturer started :SUCCESS '); + await audioCap.start().then(() => { + console.info(`${Tag}: Capturer started :Success `); }).catch((err) => { - console.info(Tag + 'Capturer start :ERROR : ' + err.message); + console.info(`${Tag}: Capturer start :ERROR :${err.message}`); }); await sleep(100); audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 3 && devDescriptor != null) { resultFlag = true; - console.info(Tag + '[CAPTURER-CHANGE-ON-003] ResultFlag for element ' + i + ' is: ' + resultFlag); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-003] ResultFlag for element ${i} is: ${resultFlag}`); } } }); await sleep(100); - await audioCap.stop().then(async function () { - console.info(Tag + 'Capturer stopped : SUCCESS'); + await audioCap.stop().then(() => { + console.info(`${Tag}: Capturer stopped : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer stop:ERROR : ' + err.message); + console.info(`${Tag}: Capturer stop:ERROR :${err.message}`); }); await sleep(100); audioStreamManager.off('audioCapturerChange'); await sleep(100); - console.info(Tag + '[CAPTURER-CHANGE-ON-003] ######### CapturerChange Off is called #########'); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-003] ######### CapturerChange Off is called #########`); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); expect(resultFlag).assertTrue(); @@ -342,65 +318,53 @@ describe('audioCapturerChange', function () { let audioCap; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); - await audioCap.start().then(async function () { - console.info(Tag + 'Capturer started :SUCCESS '); + await audioCap.start().then(() => { + console.info(`${Tag}: Capturer started :Success `); }).catch((err) => { - console.info(Tag + 'Capturer start :ERROR : ' + err.message); + console.info(`${Tag}: Capturer start :ERROR :${err.message}`); }); - await audioCap.stop().then(async function () { - console.info(Tag + 'Capturer stopped : SUCCESS'); + await audioCap.stop().then(() => { + console.info(`${Tag}: Capturer stopped : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer stop:ERROR : ' + err.message); + console.info(`${Tag}: Capturer stop:ERROR :${err.message}`); }); await sleep(100); audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 4 && devDescriptor != null) { resultFlag = true; - console.info(Tag + '[CAPTURER-CHANGE-ON-004] ResultFlag for element ' + i + ' is: ' + resultFlag); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-004] ResultFlag for element ${i} is: ${resultFlag}`); } } }); await sleep(100); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); await sleep(100); audioStreamManagerCB.off('audioCapturerChange'); await sleep(100); - console.info(Tag + '[CAPTURER-CHANGE-ON-004] ######### CapturerChange Off is called #########'); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-004] ######### CapturerChange Off is called #########`); expect(resultFlag).assertTrue(); done(); @@ -437,22 +401,10 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerInfo.source == 0 && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); @@ -503,49 +455,37 @@ describe('audioCapturerChange', function () { audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerInfo.source == 7 && devDescriptor != null) { resultFlag = true; - console.info(Tag + '[CAPTURER-CHANGE-ON-006] ResultFlag for element ' + i + ' is: ' + resultFlag); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-006] ResultFlag for element ${i} is: ${resultFlag}`); } } }); await sleep(100); - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); await sleep(100); audioStreamManagerCB.off('audioCapturerChange'); await sleep(100); - console.info(Tag + '[CAPTURER-CHANGE-ON-006] ######### CapturerChange Off is called #########'); + console.info(`${Tag}: [CAPTURER-CHANGE-ON-006] ######### CapturerChange Off is called #########`); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); expect(resultFlag).assertTrue(); @@ -581,22 +521,10 @@ describe('audioCapturerChange', function () { } audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].streamId != undefined && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); @@ -644,24 +572,12 @@ describe('audioCapturerChange', function () { } audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let clientUid = AudioCapturerChangeInfoArray[i].clientUid; let capFlags = AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags; let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (clientUid != undefined && capFlags == 0 && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); @@ -708,12 +624,7 @@ describe('audioCapturerChange', function () { } audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -721,14 +632,7 @@ describe('audioCapturerChange', function () { let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(Tag + 'Id:' + i + ':' + Id); - console.info(Tag + 'Type:' + i + ':' + dType); - console.info(Tag + 'Role:' + i + ':' + dRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + sRate); - console.info(Tag + 'CC:' + i + ':' + cCount); - console.info(Tag + 'CM:' + i + ':' + cMask); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) { audioStreamManager.off('audioCapturerChange'); expect(true).assertTrue(); @@ -779,21 +683,9 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } audioStreamManager.off('audioCapturerChange'); expect(true).assertTrue(); @@ -850,21 +742,9 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } audioStreamManager.off('audioCapturerChange'); expect(true).assertTrue(); @@ -872,10 +752,10 @@ describe('audioCapturerChange', function () { } }); await sleep(100); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); }) @@ -920,21 +800,9 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } audioStreamManager.off('audioCapturerChange'); expect(true).assertTrue(); @@ -943,10 +811,10 @@ describe('audioCapturerChange', function () { }); await sleep(100); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); }) @@ -991,21 +859,9 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } audioStreamManager.off('audioCapturerChange'); expect(true).assertTrue(); @@ -1014,10 +870,10 @@ describe('audioCapturerChange', function () { }); await sleep(100); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); }) @@ -1051,12 +907,7 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -1064,14 +915,7 @@ describe('audioCapturerChange', function () { let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(Tag + 'Id:' + i + ':' + Id); - console.info(Tag + 'Type:' + i + ':' + dType); - console.info(Tag + 'Role:' + i + ':' + dRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + sRate); - console.info(Tag + 'CC:' + i + ':' + cCount); - console.info(Tag + 'CM:' + i + ':' + cMask); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) { audioStreamManager.off('audioCapturerChange'); expect(true).assertTrue(); @@ -1118,31 +962,19 @@ describe('audioCapturerChange', function () { } audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1150,28 +982,17 @@ describe('audioCapturerChange', function () { await sleep(100); await audioStreamManagerCB.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) { - console.info('AFCapturerChangeLog: [GET_CAP_STA_1_PR] **** Get Promise Called ****'); + console.info(`AFCapturerChangeLog: [GET_CAP_STA_1_PR] **** Get Promise Called ****`); if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 1 && devDescriptor != null) { audioStreamManagerCB.off('audioCapturerChange'); - console.info('audioCapturerChange off success '); + console.info(`audioCapturerChange off Success `); expect(true).assertTrue(); done(); } @@ -1183,10 +1004,10 @@ describe('audioCapturerChange', function () { done(); }); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1220,41 +1041,30 @@ describe('audioCapturerChange', function () { } let audioCap; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); await sleep(100); audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.start().then(async function () { - console.info(Tag + 'Capturer started :SUCCESS '); + await audioCap.start().then(() => { + console.info(`${Tag}: Capturer started :Success `); }).catch((err) => { - console.info(Tag + 'Capturer start :ERROR : ' + err.message); + console.info(`${Tag}: Capturer start :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1262,24 +1072,13 @@ describe('audioCapturerChange', function () { await sleep(100); await audioStreamManager.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) { - console.info(Tag + '[GET_CAPTURER_STATE_2_PROMISE] **** Get Promise Called ****'); + console.info(`${Tag}: [GET_CAPTURER_STATE_2_PROMISE] **** Get Promise Called ****`); if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 2 && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); @@ -1294,10 +1093,10 @@ describe('audioCapturerChange', function () { done(); }); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1332,71 +1131,49 @@ describe('audioCapturerChange', function () { let audioCap; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); - await audioCap.start().then(async function () { - console.info(Tag + 'Capturer started :SUCCESS '); + await audioCap.start().then(() => { + console.info(`${Tag}: Capturer started :Success `); }).catch((err) => { - console.info(Tag + 'Capturer start :ERROR : ' + err.message); + console.info(`${Tag}: Capturer start :ERROR :${err.message}`); }); await sleep(100); audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.stop().then(async function () { - console.info(Tag + 'Capturer stopped : SUCCESS'); + await audioCap.stop().then(() => { + console.info(`${Tag}: Capturer stopped : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer stop:ERROR : ' + err.message); + console.info(`${Tag}: Capturer stop:ERROR :${err.message}`); }); await sleep(100); await audioStreamManager.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) { - console.info(Tag + '[GET_CAPTURER_STATE_3_PROMISE] **** Get Promise Called ****'); + console.info(`${Tag}: [GET_CAPTURER_STATE_3_PROMISE] **** Get Promise Called ****`); if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 3 && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); @@ -1411,10 +1188,10 @@ describe('audioCapturerChange', function () { done(); }); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1450,44 +1227,29 @@ describe('audioCapturerChange', function () { let resultFlag = false; audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); await sleep(100); await audioStreamManagerCB.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) { - console.info('AFCapturerChangeLog: [GET_CAP_DD_PR] **** Get Promise Called ****'); + console.info(`AFCapturerChangeLog: [GET_CAP_DD_PR] **** Get Promise Called ****`); if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -1495,14 +1257,7 @@ describe('audioCapturerChange', function () { let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(Tag + 'Id:' + i + ':' + Id); - console.info(Tag + 'Type:' + i + ':' + dType); - console.info(Tag + 'Role:' + i + ':' + dRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + sRate); - console.info(Tag + 'CC:' + i + ':' + cCount); - console.info(Tag + 'CM:' + i + ':' + cMask); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) { audioStreamManagerCB.off('audioCapturerChange'); expect(true).assertTrue(); @@ -1512,14 +1267,14 @@ describe('audioCapturerChange', function () { } } }).catch((err) => { - console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message); + console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`); resultFlag = false; }); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); }); expect(resultFlag).assertTrue(); @@ -1556,68 +1311,46 @@ describe('audioCapturerChange', function () { let resultFlag = false; audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); await sleep(100); audioStreamManager.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => { - console.info(Tag + '[GET_CAPTURER_STATE_1_CALLBACK] **** Get Callback Called ****'); + console.info(`${Tag}: [GET_CAPTURER_STATE_1_CALLBACK] **** Get Callback Called ****`); await sleep(100); if (err) { - console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message); + console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`); resultFlag = false; } else { if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 1 && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); done(); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1659,78 +1392,56 @@ describe('audioCapturerChange', function () { let audioCap; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); await sleep(100); audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.start().then(async function () { - console.info(Tag + 'Capturer started :SUCCESS '); + await audioCap.start().then(() => { + console.info(`${Tag}: Capturer started :Success `); }).catch((err) => { - console.info(Tag + 'Capturer start :ERROR : ' + err.message); + console.info(`${Tag}: Capturer start :ERROR :${err.message}`); }); await sleep(100); audioStreamManagerCB.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => { - console.info(Tag + '[GET_CAPTURER_STATE_2_CALLBACK] **** Get Callback Called ****'); + console.info(`${Tag}: [GET_CAPTURER_STATE_2_CALLBACK] **** Get Callback Called ****`); await sleep(100); if (err) { - console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message); + console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`); resultFlag = false; } else { if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 2 && devDescriptor != null) { audioStreamManagerCB.off('audioCapturerChange'); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); done(); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1772,85 +1483,63 @@ describe('audioCapturerChange', function () { let audioCap; - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); }); - await audioCap.start().then(async function () { - console.info(Tag + 'Capturer started :SUCCESS '); + await audioCap.start().then(() => { + console.info(`${Tag}: Capturer started :Success `); }).catch((err) => { - console.info(Tag + 'Capturer start :ERROR : ' + err.message); + console.info(`${Tag}: Capturer start :ERROR :${err.message}`); }); await sleep(100); audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.stop().then(async function () { - console.info(Tag + 'Capturer stopped : SUCCESS'); + await audioCap.stop().then(() => { + console.info(`${Tag}: Capturer stopped : SUCCESS`); }).catch((err) => { - console.info(Tag + 'Capturer stop:ERROR : ' + err.message); + console.info(`${Tag}: Capturer stop:ERROR :${err.message}`); }); await sleep(100); audioStreamManager.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => { - console.info(Tag + '[GET_CAPTURER_STATE_3_CALLBACK] **** Get Callback Called ****'); + console.info(`${Tag}: [GET_CAPTURER_STATE_3_CALLBACK] **** Get Callback Called ****`); await sleep(100); if (err) { - console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message); + console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`); resultFlag = false; } else { if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioCapturerChangeInfoArray[i].capturerState == 3 && devDescriptor != null) { audioStreamManager.off('audioCapturerChange'); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); done(); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1890,31 +1579,20 @@ describe('audioCapturerChange', function () { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##'); - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id); - console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType); - console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole); - console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]); - console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]); - console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { + await audio.createAudioCapturer(AudioCapturerOptions).then((data) => { audioCap = data; - console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS'); + console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message); + console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`); expect(false).assertTrue(); done(); }); @@ -1922,20 +1600,16 @@ describe('audioCapturerChange', function () { await sleep(100); audioStreamManager.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => { - console.info(Tag + '[GET_CAPTURER_DD_CALLBACK] **** Get Callback Called ****'); + console.info(`${Tag}: [GET_CAPTURER_DD_CALLBACK] **** Get Callback Called ****`); await sleep(100); if (err) { - console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message); + console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`); resultFlag = false; } else { if (AudioCapturerChangeInfoArray != null) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { - console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); - console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); - console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); - console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); - console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); + console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -1943,21 +1617,14 @@ describe('audioCapturerChange', function () { let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(Tag + 'Id:' + i + ':' + Id); - console.info(Tag + 'Type:' + i + ':' + dType); - console.info(Tag + 'Role:' + i + ':' + dRole); - console.info(Tag + 'Nam:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name); - console.info(Tag + '' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address); - console.info(Tag + 'SR:' + i + ':' + sRate); - console.info(Tag + 'CC:' + i + ':' + cCount); - console.info(Tag + 'CM:' + i + ':' + cMask); + console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) { audioStreamManager.off('audioCapturerChange'); - await audioCap.release().then(async function () { - console.info(Tag + 'Capturer release : SUCCESS'); + await audioCap.release().then(function () { + console.info(`${Tag}: Capturer release : SUCCESS`); done(); }).catch((err) => { - console.info(Tag + 'Capturer release :ERROR : ' + err.message); + console.info(`${Tag}: Capturer release :ERROR :${err.message}`); expect(false).assertTrue(); done(); }); diff --git a/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js b/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js index 0dd54c276..aaefb1ae7 100644 --- a/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js +++ b/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js @@ -17,7 +17,8 @@ import audio from '@ohos.multimedia.audio'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; describe('audioEventManagement', function () { - console.info('AudioFrameworkTest: Create AudioManger Object JS Framework'); + let TagFrmwk = "AudioFrameworkTest"; + console.info(`${TagFrmwk}: Create AudioManger Object JS Framework`); let audioManager = null; let deviceRoleValue = null; let deviceTypeValue = null; @@ -27,10 +28,10 @@ describe('audioEventManagement', function () { function getAudioManager() { audioManager = audio.getAudioManager(); if (audioManager != null) { - console.info('AudioFrameworkTest: getAudioManger : PASS'); + console.info(`${TagFrmwk}: getAudioManger : PASS`); } else { - console.info('AudioFrameworkTest: getAudioManger : FAIL'); + console.info(`${TagFrmwk}: getAudioManger : FAIL`); } } function displayDeviceProp(value, index, array) { @@ -65,29 +66,29 @@ describe('audioEventManagement', function () { devTypeName = 'ERROR : UNKNOWN :' + value.deviceType; } - console.info(`AudioFrameworkTest: device role: ${devRoleName}`); + console.info(`${TagFrmwk}: device role: ${devRoleName}`); deviceRoleValue = value.deviceRole; - console.info(`AudioFrameworkTest: device type: ${devTypeName}`); + console.info(`${TagFrmwk}: device type: ${devTypeName}`); deviceTypeValue = value.deviceType; } beforeAll(async function () { - console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); + console.info(`${TagFrmwk}: beforeAll: Prerequisites at the test suite level`); await getAudioManager(); }) beforeEach(function () { - console.info('AudioFrameworkTest: beforeEach: Prerequisites at the test case level'); + console.info(`${TagFrmwk}: beforeEach: Prerequisites at the test case level`); }) afterEach(async function () { - console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions'); + console.info(`${TagFrmwk}: afterEach: Test case-level clearance conditions`); await sleep(1000); }) - afterAll(async function () { - console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition'); + afterAll(function () { + console.info(`${TagFrmwk}: afterAll: Test suite-level cleanup condition`); }) @@ -103,14 +104,14 @@ describe('audioEventManagement', function () { const PROMISE = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }); @@ -129,14 +130,14 @@ describe('audioEventManagement', function () { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_OUTPUT_ENUM_0100', 0, async function (done) { const PROMISE = audioManager.getDevices(1) PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }); @@ -155,14 +156,14 @@ describe('audioEventManagement', function () { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INPUT_0100', 0, async function (done) { const PROMISE = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }); @@ -181,15 +182,15 @@ describe('audioEventManagement', function () { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INTPUT_ENUM_0100', 0, async function (done) { const PROMISE = audioManager.getDevices(2); PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }); @@ -208,15 +209,15 @@ describe('audioEventManagement', function () { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_0100', 0, async function (done) { const PROMISE = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }); @@ -235,15 +236,15 @@ describe('audioEventManagement', function () { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_ENUM_0100', 0, async function (done) { const PROMISE = audioManager.getDevices(3); PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }); @@ -259,22 +260,22 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 0 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100', 0, function (done) { audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } @@ -290,22 +291,22 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100', 2, function (done) { audioManager.getDevices(1, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } @@ -321,23 +322,23 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 0 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100', 0, function (done) { audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -353,23 +354,23 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 0 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100', 0, function (done) { audioManager.getDevices(2, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -385,22 +386,22 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 0 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100', 0, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100', 0, function (done) { audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -416,22 +417,22 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100', 2, function (done) { audioManager.getDevices(3, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -450,19 +451,19 @@ describe('audioEventManagement', function () { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_DEACTIVATE_0100', 2, async function (done) { await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, false).then(function () { // Setting device active ENUM 2 = SPEAKER - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate'); + console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate`); audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value) { if (value == false) { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error : ${err.message}`); expect(false).assertTrue(); }); done(); @@ -478,23 +479,23 @@ describe('audioEventManagement', function () { */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_DEACTIVATE_ENUM_0100', 2, async function (done) { await audioManager.setDeviceActive(2, true).then(function () { - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Active'); + console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Active`); }); await audioManager.setDeviceActive(2, false).then(function () { // Setting device active ENUM 2 = SPEAKER - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate'); + console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate`); audioManager.isDeviceActive(2).then(function (value) { if (value == false) { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error : ${err.message}`); expect(false).assertTrue(); }); done(); @@ -510,19 +511,19 @@ describe('audioEventManagement', function () { */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_ACTIVATE_0100', 2, async function (done) { await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true).then(function () { - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate'); + console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Activate`); audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value) { if (value == true) { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL : ${value}`); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error : ${err.message}`); expect(false).assertTrue(); }); done(); @@ -538,19 +539,19 @@ describe('audioEventManagement', function () { */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_ACTIVATE_ENUM_0100', 2, async function (done) { await audioManager.setDeviceActive(2, true).then(function () { - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate'); + console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Activate`); audioManager.isDeviceActive(2).then(function (value) { if (value == true) { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL : ${value}`); expect(false).assertTrue(); } }); }).catch((err) => { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error : ${err.message}`); expect(false).assertTrue(); }); done(); @@ -564,25 +565,25 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_DEACTIVATE_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_DEACTIVATE_0100', 2, function (done) { audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`); audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == false) { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`); expect(false).assertTrue(); } done(); @@ -602,26 +603,26 @@ describe('audioEventManagement', function () { */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_DEACTIVATE_ENUM_0100', 2, async function (done) { await audioManager.setDeviceActive(2, true).then(function () { - console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER : Active'); + console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER : Active`); }); audioManager.setDeviceActive(2, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`); audioManager.isDeviceActive(2, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == false) { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`); expect(false).assertTrue(); } done(); @@ -640,25 +641,25 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_0100', 2, function (done) { audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`); audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == true) { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL : ${value}`); expect(false).assertTrue(); } done(); @@ -676,25 +677,25 @@ describe('audioEventManagement', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_ENUM_0100 ', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_ENUM_0100 ', 2, function (done) { audioManager.setDeviceActive(2, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`); audioManager.isDeviceActive(2, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == true) { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS : ${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL : ${value}`); expect(false).assertTrue(); } done(); diff --git a/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js b/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js index 0493fd1f4..d22fb8841 100644 --- a/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js +++ b/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js @@ -20,43 +20,43 @@ describe('audioRendererChange', function () { let audioStreamManager; let audioStreamManagerCB; - let Tag = 'AFRenLog : '; + let Tag = 'AFRenLog'; const AUDIOMANAGER = audio.getAudioManager(); - console.info(`${Tag} : 'Create AudioManger Object JS Framework`); + console.info(`${Tag} : Create AudioManger Object JS Framework`); beforeAll(async function () { - await AUDIOMANAGER.getStreamManager().then(async function (data) { + await AUDIOMANAGER.getStreamManager().then(function (data) { audioStreamManager = data; - console.info(`${Tag} : 'Get AudioStream Manager : Success `); + console.info(`${Tag} : Get AudioStream Manager : Success `); }).catch((err) => { - console.info(`${Tag} : 'Get AudioStream Manager : ERROR : ${err.message}`); + console.info(`${Tag} : Get AudioStream Manager : ERROR : ${err.message}`); }); AUDIOMANAGER.getStreamManager((err, data) => { if (err) { - console.error(`${Tag} : 'Get AudioStream Manager : ERROR : ${err.message}`); + console.error(`${Tag} : Get AudioStream Manager : ERROR : ${err.message}`); } else { audioStreamManagerCB = data; - console.info(`${Tag} : 'Get AudioStream Manager : Success `); + console.info(`${Tag} : Get AudioStream Manager : Success `); } }); await sleep(1000); - console.info(`${Tag} : 'beforeAll: Prerequisites at the test suite level`); + console.info(`${Tag} : beforeAll: Prerequisites at the test suite level`); }) beforeEach(async function () { - console.info(`${Tag} : 'beforeEach: Prerequisites at the test case level`); + console.info(`${Tag} : beforeEach: Prerequisites at the test case level`); await sleep(1000); }) afterEach(function () { - console.info(`${Tag} : 'afterEach: Test case-level clearance conditions`); + console.info(`${Tag} : afterEach: Test case-level clearance conditions`); }) - afterAll(async function () { - console.info(`${Tag} : 'afterAll: Test suite-level cleanup condition`); + afterAll(function () { + console.info(`${Tag} : afterAll: Test suite-level cleanup condition`); }) function sleep(ms) { @@ -121,7 +121,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -134,7 +134,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-001] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -176,7 +176,7 @@ describe('audioRendererChange', function () { let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -187,23 +187,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 2 && devDescriptor != null) { resultFlag = true; @@ -214,7 +201,7 @@ describe('audioRendererChange', function () { await sleep(100); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS `); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); @@ -227,16 +214,16 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [RENDERER-CHANGE-ON-002] ######### RendererChange Off is called #########`); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { - console.info(`${Tag} : 'Renderer release :ERROR : ${err.message}`); + console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); }); expect(resultFlag).assertTrue(); done(); @@ -274,14 +261,14 @@ describe('audioRendererChange', function () { let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS `); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); @@ -291,23 +278,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 3 && devDescriptor != null) { resultFlag = true; @@ -318,7 +292,7 @@ describe('audioRendererChange', function () { await sleep(100); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); @@ -330,7 +304,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-003] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -372,20 +346,20 @@ describe('audioRendererChange', function () { let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS }`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); }); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS}`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); @@ -396,22 +370,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { console.info(`${Tag} : ## RendererChange on is called for ${i} ##}`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 4 && devDescriptor != null) { resultFlag = true; @@ -422,7 +384,7 @@ describe('audioRendererChange', function () { await sleep(100); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -469,14 +431,14 @@ describe('audioRendererChange', function () { let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); @@ -487,22 +449,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { console.info(`${Tag} : ## RendererChange on is called for ${i} ##}`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 5 && devDescriptor != null) { resultFlag = true; @@ -513,7 +463,7 @@ describe('audioRendererChange', function () { await sleep(100); - await audioRen.pause().then(async function () { + await audioRen.pause().then(function () { console.info(`${Tag} : renderInstant Pause :SUCCESS `); }).catch((err) => { console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`); @@ -525,13 +475,13 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-005] ######### RendererChange Off is called #########`); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -573,23 +523,10 @@ describe('audioRendererChange', function () { audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.content == 5 && devDescriptor != null) { resultFlag = true; @@ -599,7 +536,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -611,7 +548,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-006] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -654,23 +591,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.content == 0 && devDescriptor != null) { resultFlag = true; @@ -680,7 +604,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -692,7 +616,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-007] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -735,23 +659,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.content == 1 && devDescriptor != null) { resultFlag = true; @@ -761,7 +672,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -773,7 +684,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-008] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -816,23 +727,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.content == 2 && devDescriptor != null) { resultFlag = true; @@ -842,7 +740,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -854,7 +752,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-009] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -897,23 +795,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.content == 3 && devDescriptor != null) { resultFlag = true; @@ -923,7 +808,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -936,7 +821,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-010] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -979,23 +864,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.content == 4 && devDescriptor != null) { resultFlag = true; @@ -1005,7 +877,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1018,7 +890,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-011] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1061,23 +933,10 @@ describe('audioRendererChange', function () { audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 0 && devDescriptor != null) { resultFlag = true; @@ -1087,7 +946,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1100,7 +959,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-012] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1143,23 +1002,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 1 && devDescriptor != null) { resultFlag = true; @@ -1169,7 +1015,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1182,7 +1028,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-013] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1225,23 +1071,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 2 && devDescriptor != null) { resultFlag = true; @@ -1251,7 +1084,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1264,7 +1097,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-014] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1307,23 +1140,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 6 && devDescriptor != null) { resultFlag = true; @@ -1333,7 +1153,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1345,7 +1165,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-015] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1388,23 +1208,10 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].streamId != undefined && devDescriptor != null) { resultFlag = true; @@ -1414,7 +1221,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1426,7 +1233,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-015] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1469,25 +1276,12 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let clientUid = AudioRendererChangeInfoArray[i].clientUid; let renFlags = AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags; let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (clientUid != undefined && renFlags == 0 && devDescriptor != null) { resultFlag = true; @@ -1498,7 +1292,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1510,7 +1304,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-015] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1553,13 +1347,7 @@ describe('audioRendererChange', function () { audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -1567,14 +1355,7 @@ describe('audioRendererChange', function () { let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(`${Tag} : Id: ${i} ${Id}`); - console.info(`${Tag} : Type: ${i} ${dType}`); - console.info(`${Tag} : Role: ${i} ${dRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${sRate}`); - console.info(`${Tag} : CC: ${i} ${cCount}`); - console.info(`${Tag} : CM: ${i} ${cMask}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) { resultFlag = true; } @@ -1583,7 +1364,7 @@ describe('audioRendererChange', function () { }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1596,7 +1377,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [RENDERER-CHANGE-ON-018] ######### RendererChange Off is called #########`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1640,22 +1421,9 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } resultFlag = false; } @@ -1667,14 +1435,14 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [RENDERER-CHANGE-OFF-001] ######### RendererChange Off is called #########`); console.info(`${Tag} : [RENDERER-CHANGE-OFF-001] ResultFlag is: ${resultFlag}`); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1714,7 +1482,7 @@ describe('audioRendererChange', function () { let resultFlag = true; let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -1725,22 +1493,9 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } resultFlag = false; } @@ -1752,13 +1507,13 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [RENDERER-CHANGE-OFF-002] ######### RendererChange Off is called #########`); console.info(`${Tag} : [RENDERER-CHANGE-OFF-002] ResultFlag is: ${resultFlag}`); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1797,14 +1552,14 @@ describe('audioRendererChange', function () { let resultFlag = true; let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); @@ -1814,22 +1569,9 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } resultFlag = false; } @@ -1841,13 +1583,13 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [RENDERER-CHANGE-OFF-003] ######### RendererChange Off is called #########`); console.info(`${Tag} : [RENDERER-CHANGE-OFF-003] ResultFlag is: ${resultFlag}`); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1888,20 +1630,20 @@ describe('audioRendererChange', function () { let resultFlag = true; let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); }); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); @@ -1911,22 +1653,9 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ######### RendererChange on is called for ${i} ##########`); - console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } resultFlag = false; } @@ -1938,7 +1667,7 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ######### RendererChange Off is called #########`); console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ResultFlag is: ${resultFlag}`); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -1979,14 +1708,14 @@ describe('audioRendererChange', function () { let resultFlag = true; let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); @@ -1996,22 +1725,9 @@ describe('audioRendererChange', function () { audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } resultFlag = false; } @@ -2023,19 +1739,19 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [RENDERER-CHANGE-OFF-005] ######### RendererChange Off is called #########`); console.info(`${Tag} : [RENDERER-CHANGE-OFF-005] ResultFlag is: ${resultFlag}`); - await audioRen.pause().then(async function () { + await audioRen.pause().then(function () { console.info(`${Tag} : renderInstant Pause :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`); }); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2079,13 +1795,7 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -2093,14 +1803,7 @@ describe('audioRendererChange', function () { let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(`${Tag} : Id: ${i} ${Id}`); - console.info(`${Tag} : Type: ${i} ${dType}`); - console.info(`${Tag} : Role: ${i} ${dRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${sRate}`); - console.info(`${Tag} : CC: ${i} ${cCount}`); - console.info(`${Tag} : CM: ${i} ${cMask}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) { resultFlag = false; } @@ -2114,14 +1817,14 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [RENDERER-CHANGE-OFF-006] ######### RendererChange Off is called #########`); console.info(`${Tag} : [RENDERER-CHANGE-OFF-006] ResultFlag is: ${resultFlag}`); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2162,28 +1865,15 @@ describe('audioRendererChange', function () { let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -2196,22 +1886,10 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [GET_RENDERER_STATE_1_PROMISE] ######### Get Promise is called ##########`); if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 1 && devDescriptor != null) { resultFlag = true; @@ -2228,7 +1906,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [GET_RENDERER_STATE_1_PROMISE] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2270,7 +1948,7 @@ describe('audioRendererChange', function () { let audioCap; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -2281,28 +1959,15 @@ describe('audioRendererChange', function () { audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.start().then(async function () { + await audioCap.start().then(function () { console.info(`${Tag} : Renderer started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer start :ERROR : ${err.message}`); @@ -2314,22 +1979,10 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [GET_RENDERER_STATE_2_PROMISE] ######### Get Promise is called ##########`); if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 2 && devDescriptor != null) { resultFlag = true; @@ -2346,7 +1999,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [GET_RENDERER_STATE_2_PROMISE] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2389,14 +2042,14 @@ describe('audioRendererChange', function () { let audioCap; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRenderer Created : ERROR : ${err.message}`); }); - await audioCap.start().then(async function () { + await audioCap.start().then(function () { console.info(`${Tag} : Renderer started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer start :ERROR : ${err.message}`); @@ -2406,29 +2059,16 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.stop().then(async function () { + await audioCap.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); @@ -2440,22 +2080,10 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [GET_RENDERER_STATE_3_PROMISE] ######### Get Promise is called ##########`); if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 3 && devDescriptor != null) { resultFlag = true; @@ -2472,7 +2100,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [GET_RENDERER_STATE_3_PROMISE] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2515,14 +2143,14 @@ describe('audioRendererChange', function () { let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); @@ -2532,29 +2160,16 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioRen.pause().then(async function () { + await audioRen.pause().then(function () { console.info(`${Tag} : renderInstant Pause :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`); @@ -2566,22 +2181,10 @@ describe('audioRendererChange', function () { console.info(`${Tag} : [GET_RENDERER_STATE_5_PROMISE] ######### Get Promise is called ##########`); if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 5 && devDescriptor != null) { resultFlag = true; @@ -2598,13 +2201,13 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [GET_RENDERER_STATE_5_PROMISE] ######### RendererChange Off is called #########`); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2645,28 +2248,15 @@ describe('audioRendererChange', function () { let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -2676,15 +2266,10 @@ describe('audioRendererChange', function () { await sleep(100); await audioStreamManager.getCurrentAudioRendererInfoArray().then(function (AudioRendererChangeInfoArray) { - console.info(`${Tag} : '[GET_RENDERER_DD_PROMISE] ######### Get Promise is called ##########`); + console.info(`${Tag} : [GET_RENDERER_DD_PROMISE] ######### Get Promise is called ##########`); if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -2692,14 +2277,7 @@ describe('audioRendererChange', function () { let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(`${Tag} : Id: ${i} ${Id}`); - console.info(`${Tag} : Type: ${i} ${dType}`); - console.info(`${Tag} : Role: ${i} ${dRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${sRate}`); - console.info(`${Tag} : CC: ${i} ${cCount}`); - console.info(`${Tag} : CM: ${i} ${cMask}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) { resultFlag = true; } @@ -2713,9 +2291,9 @@ describe('audioRendererChange', function () { audioStreamManager.off('audioRendererChange'); await sleep(100); - console.info(`${Tag} : '[GET_RENDERER_DD_PROMISE] ######### RendererChange Off is called #########`); + console.info(`${Tag} : [GET_RENDERER_DD_PROMISE] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2756,28 +2334,15 @@ describe('audioRendererChange', function () { let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -2796,22 +2361,10 @@ describe('audioRendererChange', function () { else { if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 1 && devDescriptor != null) { resultFlag = true; @@ -2828,7 +2381,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [GET_RENDERER_STATE_1_CALLBACK] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2870,7 +2423,7 @@ describe('audioRendererChange', function () { let audioCap; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -2881,28 +2434,15 @@ describe('audioRendererChange', function () { audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.start().then(async function () { + await audioCap.start().then(function () { console.info(`${Tag} : Renderer started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer start :ERROR : ${err.message}`); @@ -2920,22 +2460,10 @@ describe('audioRendererChange', function () { else { if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 2 && devDescriptor != null) { resultFlag = true; @@ -2952,7 +2480,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [GET_RENDERER_STATE_2_CALLBACK] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -2994,14 +2522,14 @@ describe('audioRendererChange', function () { let audioCap; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRenderer Created : ERROR : ${err.message}`); }); - await audioCap.start().then(async function () { + await audioCap.start().then(function () { console.info(`${Tag} : Renderer started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer start :ERROR : ${err.message}`); @@ -3011,29 +2539,16 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioCap.stop().then(async function () { + await audioCap.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); @@ -3051,22 +2566,10 @@ describe('audioRendererChange', function () { else { if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 3 && devDescriptor != null) { resultFlag = true; @@ -3083,7 +2586,7 @@ describe('audioRendererChange', function () { await sleep(100); console.info(`${Tag} : [GET_RENDERER_STATE_3_CALLBACK] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -3125,14 +2628,14 @@ describe('audioRendererChange', function () { let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`); }); - await audioRen.start().then(async function () { + await audioRen.start().then(function () { console.info(`${Tag} : renderInstant started :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`); @@ -3142,29 +2645,16 @@ describe('audioRendererChange', function () { audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audioRen.pause().then(async function () { + await audioRen.pause().then(function () { console.info(`${Tag} : renderInstant Pause :SUCCESS`); }).catch((err) => { console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`); @@ -3182,22 +2672,10 @@ describe('audioRendererChange', function () { else { if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } if (AudioRendererChangeInfoArray[i].rendererState == 5 && devDescriptor != null) { resultFlag = true; @@ -3214,13 +2692,13 @@ describe('audioRendererChange', function () { await sleep(100); console.info('AFRendLog: [GET_REN_STA_5_CB] ## RenCh Off is called ##'); - await audioRen.stop().then(async function () { + await audioRen.stop().then(function () { console.info(`${Tag} : Renderer stopped : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { + await audioRen.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); @@ -3261,28 +2739,15 @@ describe('audioRendererChange', function () { let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : ## RendererChange on is called for ${i} ##`); - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`); - console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`); - console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`); - console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`); - console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`); - console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); } } }); await sleep(100); - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioCap = data; console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`); }).catch((err) => { @@ -3292,7 +2757,7 @@ describe('audioRendererChange', function () { await sleep(100); audioStreamManager.getCurrentAudioRendererInfoArray(async (err, AudioRendererChangeInfoArray) => { - console.info(`${Tag} : '[GET_RENDERER_DD_CALLBACK] **** Get Callback Called ****`); + console.info(`${Tag} : [GET_RENDERER_DD_CALLBACK] **** Get Callback Called ****`); await sleep(100); if (err) { console.log(`${Tag} : getCurrentAudioRendererInfoArray :ERROR: ${err.message}`); @@ -3301,12 +2766,7 @@ describe('audioRendererChange', function () { else { if (AudioRendererChangeInfoArray != null) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { - console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`); - console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`); - console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`); - console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`); - console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`); - console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`); + console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; @@ -3314,14 +2774,7 @@ describe('audioRendererChange', function () { let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; - console.info(`${Tag} : Id: ${i} ${Id}`); - console.info(`${Tag} : Type: ${i} ${dType}`); - console.info(`${Tag} : Role: ${i} ${dRole}`); - console.info(`${Tag} : Nam: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`); - console.info(`${Tag} : ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`); - console.info(`${Tag} : SR: ${i} ${sRate}`); - console.info(`${Tag} : CC: ${i} ${cCount}`); - console.info(`${Tag} : CM: ${i} ${cMask}`); + console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`); if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) { resultFlag = true; } @@ -3335,9 +2788,9 @@ describe('audioRendererChange', function () { audioStreamManager.off('audioRendererChange'); await sleep(100); - console.info(`${Tag} : '[GET_RENDERER_DD_CALLBACK] ######### RendererChange Off is called #########`); + console.info(`${Tag} : [GET_RENDERER_DD_CALLBACK] ######### RendererChange Off is called #########`); - await audioCap.release().then(async function () { + await audioCap.release().then(function () { console.info(`${Tag} : Renderer release : SUCCESS`); }).catch((err) => { console.info(`${Tag} : Renderer release :ERROR : ${err.message}`); diff --git a/multimedia/audio/audio_js_standard/AudioTestBase.js b/multimedia/audio/audio_js_standard/AudioTestBase.js index 83200678b..a35d2e7ef 100644 --- a/multimedia/audio/audio_js_standard/AudioTestBase.js +++ b/multimedia/audio/audio_js_standard/AudioTestBase.js @@ -21,20 +21,20 @@ import account from '@ohos.account.osAccount'; // apply permission for test hap export async function applyPermission(applictionName, permissionNames) { let userId = await account.getAccountManager().getOsAccountLocalIdFromProcess(); - console.info('userid is :' + userId) + console.info(`userid is :${userId}`) let appInfo = await bundle.getApplicationInfo(applictionName, 0, userId); let atManager = abilityAccessCtrl.createAtManager(); if (atManager != null) { let tokenID = appInfo.accessTokenId; - console.info('[permission] case accessTokenID is ' + tokenID); + console.info(`[permission] case accessTokenID is ${tokenID}`); for (let i = 0; i < permissionNames.length; i++) { await atManager.grantUserGrantedPermission(tokenID, permissionNames[i], 1).then((result) => { - console.info('[permission] case grantUserGrantedPermission success :' + result); + console.info(`[permission] case grantUserGrantedPermission success : ${result}`); }).catch((err) => { - console.info('[permission] case grantUserGrantedPermission failed :' + err); + console.info(`[permission] case grantUserGrantedPermission failed : ${err}`); }); } } else { - console.info('[permission] case apply permission failed, createAtManager failed'); + console.info(`[permission] case apply permission failed, createAtManager failed`); } } \ No newline at end of file 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 f2f86107d..6609e7c8c 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,7 +18,8 @@ import * as audioTestBase from '../../../../../AudioTestBase' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; describe('audioFramework', function () { - console.info('AudioFrameworkTest: Create AudioManger Object JS Framework'); + let TagFrmwk = "AudioFrameworkTest"; + console.info(`${TagFrmwk}: Create AudioManger Object JS Framework`); let audioManager = null; let dRValue = null; let dTValue = null; @@ -39,10 +40,10 @@ describe('audioFramework', function () { function getAudioManager() { audioManager = audio.getAudioManager(); if (audioManager != null) { - console.info('AudioFrameworkTest: getAudioManger : PASS'); + console.info(`${TagFrmwk}: getAudioManger : PASS`); } else { - console.info('AudioFrameworkTest: getAudioManger : FAIL'); + console.info(`${TagFrmwk}: getAudioManger : FAIL`); } } function sleep(ms) { @@ -81,26 +82,21 @@ describe('audioFramework', function () { devTypeName = 'ERROR : UNKNOWN :' + value.deviceType; } - console.info(`AudioFrameworkTest: device role: ${devRoleName}`); + console.info(`${TagFrmwk}: device role: ${devRoleName}`); dRValue = value.deviceRole; - console.info(`AudioFrameworkTest: device type: ${devTypeName}`); + console.info(`${TagFrmwk}: device type: ${devTypeName}`); dTValue = value.deviceType; - console.info('AudioFrameworkTest: device Id:' + value.id); devId = value.id; - console.info('AudioFrameworkTest: device Name:' + value.name); devName = value.name; - console.info('AudioFrameworkTest: device Address:' + value.address); devAddr = value.address; - console.info('AudioFrameworkTest: device sample Rates:' + value.sampleRates[0]); sRate = value.sampleRates[0]; - console.info('AudioFrameworkTest: device channel Counts:' + value.channelCounts[0]); cCount = value.channelCounts[0]; - console.info('AudioFrameworkTest: device channel Masks:' + value.channelMasks); cMask = value.channelMasks; + console.info(`${TagFrmwk}: device info: ${value}`); } beforeAll(async function () { - console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); + console.info(`${TagFrmwk}: beforeAll: Prerequisites at the test suite level`); let permissionName1 = 'ohos.permission.MICROPHONE'; let permissionName2 = 'ohos.permission.ACCESS_NOTIFICATION_POLICY'; let permissionName3 = 'ohos.permission.MODIFY_AUDIO_SETTINGS'; @@ -109,21 +105,21 @@ describe('audioFramework', function () { await audioTestBase.applyPermission(appName, permissionNameList); await sleep(100); await getAudioManager(); - console.info('AudioFrameworkTest: beforeAll: END'); + console.info(`${TagFrmwk}: beforeAll: END`); }) beforeEach(async function () { - console.info('AudioFrameworkTest: beforeEach: Prerequisites at the test case level'); + console.info(`${TagFrmwk}: beforeEach: Prerequisites at the test case level`); await sleep(100); }) afterEach(async function () { - console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions'); + console.info(`${TagFrmwk}: afterEach: Test case-level clearance conditions`); await sleep(100); }) afterAll(function () { - console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition'); + console.info(`${TagFrmwk}: afterAll: Test suite-level cleanup condition`); }) /** @@ -147,37 +143,37 @@ describe('audioFramework', function () { const AUDIOMANAGER9 = audio.getAudioManager(); const AUDIOMANAGER10 = audio.getAudioManager(); await audioManager.setVolume(audioMedia, lowVol); - console.info('AudioFrameworkTest: Media setVolume promise: successful'); + console.info(`${TagFrmwk}: Media setVolume promise: successful`); await AUDIOMANAGER1.setVolume(audioMedia, highVol); - console.info('AudioFrameworkTest:audioManager1 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager1 : Media setVolume promise: successful`); await AUDIOMANAGER2.setVolume(audioMedia, highVol); - console.info('AudioFrameworkTest:audioManager2 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager2 : Media setVolume promise: successful`); await AUDIOMANAGER3.setVolume(audioMedia, highVol); - console.info('AudioFrameworkTest:audioManager3 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager3 : Media setVolume promise: successful`); await AUDIOMANAGER4.setVolume(audioMedia, lowVol); - console.info('AudioFrameworkTest:audioManager4 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager4 : Media setVolume promise: successful`); await AUDIOMANAGER5.setVolume(audioMedia, highVol); - console.info('AudioFrameworkTest:audioManager5 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager5 : Media setVolume promise: successful`); await AUDIOMANAGER6.setVolume(audioMedia, lowVol); - console.info('AudioFrameworkTest:audioManager6 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager6 : Media setVolume promise: successful`); await AUDIOMANAGER7.setVolume(audioMedia, highVol); - console.info('AudioFrameworkTest:audioManager7 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager7 : Media setVolume promise: successful`); await AUDIOMANAGER8.setVolume(audioMedia, lowVol); - console.info('AudioFrameworkTest:audioManager8 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager8 : Media setVolume promise: successful`); await AUDIOMANAGER9.setVolume(audioMedia, highVol); - console.info('AudioFrameworkTest:audioManager9 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager9 : Media setVolume promise: successful`); await AUDIOMANAGER10.setVolume(audioMedia, lowVol); - console.info('AudioFrameworkTest:audioManager10 : Media setVolume promise: successful'); + console.info(`${TagFrmwk}:audioManager10 : Media setVolume promise: successful`); let data = await audioManager.getVolume(audioMedia); if (data == lowVol) { - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { - console.info('AudioFrameworkTest: Media getVolume Promise: Error :' + err.message); + console.info(`${TagFrmwk}: Media getVolume Promise: Error :${err.message}`); expect(false).assertTrue(); } done(); @@ -194,13 +190,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0100', 1, async function (done) { try { await audioManager.setVolume(audioMedia, lowVol); - console.info('AudioFrameworkTest: Media setVolume promise: successful'); + console.info(`${TagFrmwk}: Media setVolume promise: successful`); let data = await audioManager.getVolume(audioMedia); if (data == lowVol) { - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -223,10 +219,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, maxVol); let data = await audioManager.getVolume(audioMedia); if (data == maxVol) { - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -249,10 +245,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, minVol); let data = await audioManager.getVolume(audioMedia); if (data == minVol) { - console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -272,10 +268,10 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0400', 2, async function (done) { await audioManager.setVolume(audioMedia, outOfRangeVol).then(() => { - console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: FAIL'); + console.info(`${TagFrmwk}: Media setVolume Promise:Out of range: FAIL`); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: PASS :' + err.message); + console.info(`${TagFrmwk}: Media setVolume Promise:Out of range: PASS :${err.message}`); expect(true).assertTrue(); }); done(); @@ -289,23 +285,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0500', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0500', 2, function (done) { audioManager.setVolume(audioMedia, highVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : Media setVolume successful `); + console.info(`${TagFrmwk}: callback : Media setVolume successful `); audioManager.getVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == highVol) { - console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -322,23 +318,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0600', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0600', 2, function (done) { audioManager.setVolume(audioMedia, maxVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : Media setVolume successful `); + console.info(`${TagFrmwk}: callback : Media setVolume successful `); audioManager.getVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -355,23 +351,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0700', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0700', 2, function (done) { audioManager.setVolume(audioMedia, minVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : Media setVolume successful `); + console.info(`${TagFrmwk}: callback : Media setVolume successful `); audioManager.getVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -388,13 +384,13 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0800', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0800', 2, function (done) { audioManager.setVolume(audioMedia, outOfRangeVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: setVolume: Out of range: Callback: PASS: ${err.message}`); + console.error(`${TagFrmwk}: setVolume: Out of range: Callback: PASS: ${err.message}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: setVolume: callback : Media Out of range: FAIL'); + console.info(`${TagFrmwk}: setVolume: callback : Media Out of range: FAIL`); expect(false).assertTrue(); } done(); @@ -414,10 +410,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, lowVol); let data = await audioManager.getVolume(audioRingtone); if (data == lowVol) { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -440,10 +436,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, maxVol); let data = await audioManager.getVolume(audioRingtone); if (data == maxVol) { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -466,10 +462,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, minVol); let data = await audioManager.getVolume(audioRingtone); if (data == minVol) { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -488,12 +484,12 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1200', 2, async function (done) { - console.info('AudioFrameworkTest: Ringtone setVolume Promise: Out of range: Setvol 30'); + console.info(`${TagFrmwk}: Ringtone setVolume Promise: Out of range: Setvol 30`); await audioManager.setVolume(audioRingtone, outOfRangeVol).then(() => { - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: FAIL'); + console.info(`${TagFrmwk}: Ringtone setVolume Promise:Out of range: FAIL`); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: PASS :' + (err.message)); + console.info(`${TagFrmwk}: Ringtone setVolume Promise:Out of range: PASS : ${err.message}`); expect(true).assertTrue(); }); done(); @@ -510,21 +506,21 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1300', 2, async function (done) { audioManager.setVolume(audioRingtone, highVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); + console.info(`${TagFrmwk}: callback : Ringtone setVolume successful `); audioManager.getVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == highVol) { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -541,23 +537,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1400', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1400', 2, function (done) { audioManager.setVolume(audioRingtone, maxVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); + console.info(`${TagFrmwk}: callback : Ringtone setVolume successful `); audioManager.getVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -574,23 +570,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1500', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1500', 2, function (done) { audioManager.setVolume(audioRingtone, minVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `); + console.info(`${TagFrmwk}: callback : Ringtone setVolume successful `); audioManager.getVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -607,13 +603,13 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1600', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1600', 2, function (done) { audioManager.setVolume(audioRingtone, outOfRangeVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: Out of range Volume: Callback: ${err.message}`); + console.error(`${TagFrmwk}: Out of range Volume: Callback: ${err.message}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Out of range Volume: callback : Ringtone set volume: FAIL'); + console.info(`${TagFrmwk}: Out of range Volume: callback : Ringtone set volume: FAIL`); expect(false).assertTrue(); } done(); @@ -629,13 +625,13 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1700', 2, async function (done) { - console.info('AudioFrameworkTest: Media setVolume promise: Negative Value -1'); + console.info(`${TagFrmwk}: Media setVolume promise: Negative Value -1`); await audioManager.setVolume(audioMedia, -1).then(() => { // Setting negative audio volume for error Scenario - console.info('AudioFrameworkTest: Media setVolume Promise:Negative: FAIL'); + console.info(`${TagFrmwk}: Media setVolume Promise:Negative: FAIL`); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Media setVolume Promise:Negative: PASS : ' + (err.message)); + console.info(`${TagFrmwk}: Media setVolume Promise:Negative: PASS : ${err.message}`); expect(true).assertTrue(); }); done(); @@ -649,14 +645,14 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1800', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1800', 2, function (done) { audioManager.setVolume(audioMedia, -1, (err) => { // Setting negative audio volume for error Scenario if (err) { - console.error(`AudioFrameworkTest: setVolume Callback: Negative: PASS: ${err.message}`); + console.error(`${TagFrmwk}: setVolume Callback: Negative: PASS: ${err.message}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: setVolume callback : Media Negative: FAIL'); + console.info(`${TagFrmwk}: setVolume callback : Media Negative: FAIL`); expect(false).assertTrue(); } done(); @@ -672,13 +668,13 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1900', 2, async function (done) { - console.info('AudioFrameworkTest: Ringtone setVolume promise: Negative'); + console.info(`${TagFrmwk}: Ringtone setVolume promise: Negative`); await audioManager.setVolume(audioRingtone, -1).then(() => { // Setting negative audio volume for error Scenario - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: FAIL'); + console.info(`${TagFrmwk}: Ringtone setVolume Promise:Negative: FAIL`); expect(false).assertTrue(); }).catch((err) => { - console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: PASS :' + (err.message)); + console.info(`${TagFrmwk}: Ringtone setVolume Promise:Negative: PASS : ${err.message}`); expect(true).assertTrue(); }); done(); @@ -692,14 +688,14 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2000', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2000', 2, function (done) { audioManager.setVolume(audioRingtone, -1, (err) => { // Setting negative audio volume for error Scenario if (err) { - console.error(`AudioFrameworkTest:Ringtone setVolume Callback:Negative: PASS : ${err.message}`); + console.error(`${TagFrmwk}:Ringtone setVolume Callback:Negative: PASS : ${err.message}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: setVolume: Negative: callback : Ringtone set volume: FAIL'); + console.info(`${TagFrmwk}: setVolume: Negative: callback : Ringtone set volume: FAIL`); expect(false).assertTrue(); } done(); @@ -719,10 +715,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); let data = await audioManager.getVolume(audio.AudioVolumeType.MEDIA); if (data == lowVol) { - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: ENAME : PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: ENAME : FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -740,23 +736,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2200', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2200', 2, function (done) { audioManager.setVolume(audio.AudioVolumeType.MEDIA, highVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME : ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ENAME : ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `); + console.info(`${TagFrmwk}: callback : ENAME : Media setVolume successful `); audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: ENAME : Error ${err.message}`); + console.error(`${TagFrmwk}: callback : Media: ENAME : Error ${err.message}`); expect(false).assertTrue(); } else if (value == highVol) { - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: ENAME : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: ENAME : FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -778,10 +774,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); let data = await audioManager.getVolume(audio.AudioVolumeType.RINGTONE); if (data == highVol) { - console.info('AudioFrameworkTest: RINGTONE getVolume Promise: ENAME : PASS :' + data); + console.info(`${TagFrmwk}: RINGTONE getVolume Promise: ENAME : PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: RINGTONE getVolume Promise: ENAME : FAIL :' + data); + console.info(`${TagFrmwk}: RINGTONE getVolume Promise: ENAME : FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -799,23 +795,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2400', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2400', 2, function (done) { audioManager.setVolume(audio.AudioVolumeType.RINGTONE, lowVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ENAME: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `); + console.info(`${TagFrmwk}: callback : ENAME: Ringtone setVolume successful `); audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone: ENAME: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == lowVol) { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: ENAME: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: ENAME: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -838,10 +834,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.RINGTONE, maxVol) let data = await audioManager.getVolume(audio.AudioVolumeType.MEDIA); if (data == lowVol) { - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: ENAME : PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data); + console.info(`${TagFrmwk}: Media getVolume Promise: ENAME : FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -859,29 +855,29 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2600', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2600', 2, function (done) { audioManager.setVolume(audio.AudioVolumeType.MEDIA, highVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume MEDIA: Callback: ENAME : ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume MEDIA: Callback: ENAME : ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `); + console.info(`${TagFrmwk}: callback : ENAME : Media setVolume successful `); audioManager.setVolume(audio.AudioVolumeType.RINGTONE, lowVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume RINGTONE: Callback: ENAME : ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume RINGTONE: Callback: ENAME : ${err.message}`); expect(false).assertTrue(); done(); } else { audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media: ENAME : Error: ${err.message}`); + console.error(`${TagFrmwk}: callback : Media: ENAME : Error: ${err.message}`); expect(false).assertTrue(); } else if (value == highVol) { - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: ENAME : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value); + console.info(`${TagFrmwk}: callback : Media getVolume: ENAME : FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -903,14 +899,14 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2700', 2, async function (done) { try { await audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); - console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful'); + console.info(`${TagFrmwk}: Ringtone setVolume promise: ENAME: successful`); await audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); let data = await audioManager.getVolume(audio.AudioVolumeType.RINGTONE); if (data == highVol) { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: ENAME: PASS :${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :' + data); + console.info(`${TagFrmwk}: Ringtone getVolume Promise: ENAME: FAIL :${data}`); expect(false).assertTrue(); } } catch (err) { @@ -928,29 +924,29 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2800', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2800', 2, function (done) { audioManager.setVolume(audio.AudioVolumeType.RINGTONE, lowVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`); + console.error(`${TagFrmwk}: failed to set volume: Callback: ENAME: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `); + console.info(`${TagFrmwk}: callback : ENAME: Ringtone setVolume successful `); audioManager.setVolume(audio.AudioVolumeType.MEDIA, highVol, (err) => { if (err) { - console.error(`AudioFrameworkTest: failed to setVolume: Callback: ENAME: ${err.message}`); + console.error(`${TagFrmwk}: failed to setVolume: Callback: ENAME: ${err.message}`); expect(false).assertTrue(); done(); } else { audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone: ENAME: failed to get volume ${err.message}`); expect(false).assertTrue(); } else if (value == lowVol) { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: ENAME: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value); + console.info(`${TagFrmwk}: callback : Ringtone getVolume: ENAME: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -973,10 +969,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMaxVolume(audioMedia); PROMISE.then(function (data) { if (data == maxVol) { - console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Media getMaxVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Media getMaxVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }); @@ -992,16 +988,16 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0200', 1, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0200', 1, function (done) { audioManager.getMaxVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Media: getMaxVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Media: getMaxVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1020,10 +1016,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMaxVolume(audioRingtone); PROMISE.then(function (data) { if (data == maxVol) { - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Ringtone getMaxVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Ringtone getMaxVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1042,16 +1038,16 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0400', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0400', 2, function (done) { audioManager.getMaxVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMaxVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMaxVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1071,10 +1067,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMaxVolume(audioMedia); PROMISE.then(function (data) { if (data == maxVol) { - console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Media getMaxVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Media getMaxVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1098,10 +1094,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, lowVol); let data = await audioManager.getMaxVolume(audioRingtone); if (data == maxVol) { - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Ringtone getMaxVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Ringtone getMaxVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } } catch (err) { @@ -1123,13 +1119,13 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, lowVol); audioManager.getMaxVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Media: getMaxVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Media: getMaxVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1148,13 +1144,13 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, lowVol); audioManager.getMaxVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMaxVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMaxVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1174,10 +1170,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, lowVol); let data = await audioManager.getMaxVolume(audioMedia); if (data == maxVol) { - console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Media getMaxVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Media getMaxVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } } catch (err) { @@ -1200,10 +1196,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, lowVol); let data = await audioManager.getMaxVolume(audioRingtone); if (data == maxVol) { - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Ringtone getMaxVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Ringtone getMaxVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } } catch (err) { @@ -1225,13 +1221,13 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, highVol); audioManager.getMaxVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Media: getMaxVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Media: getMaxVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1250,13 +1246,13 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, highVol); audioManager.getMaxVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone : failed to getMaxVolume ${err.message}`); expect(false).assertTrue(); } else if (value == maxVol) { - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMaxVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMaxVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1275,10 +1271,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMinVolume(audioMedia); PROMISE.then(function (data) { if (data == minVol) { - console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Media getMinVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Media getMinVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1297,16 +1293,16 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0200', 1, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0200', 1, function (done) { audioManager.getMinVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Media: getMinVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Media: getMinVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1325,10 +1321,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMinVolume(audioRingtone); PROMISE.then(function (data) { if (data == minVol) { - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Ringtone getMinVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Ringtone getMinVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1347,16 +1343,16 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0400', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0400', 2, function (done) { audioManager.getMinVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMinVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMinVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1382,10 +1378,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMinVolume(audioMedia); PROMISE.then(function (data) { if (data == minVol) { - console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Media getMinVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Media getMinVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1414,13 +1410,13 @@ describe('audioFramework', function () { } audioManager.getMinVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Media: getMinVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Media: getMinVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1446,10 +1442,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMinVolume(audioRingtone); PROMISE.then(function (data) { if (data == minVol) { - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Ringtone getMinVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Ringtone getMinVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1478,13 +1474,13 @@ describe('audioFramework', function () { } audioManager.getMinVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMinVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMinVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1510,10 +1506,10 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMinVolume(audioMedia); PROMISE.then(function (data) { if (data == minVol) { - console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Media getMinVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Media getMinVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1542,13 +1538,13 @@ describe('audioFramework', function () { } audioManager.getMinVolume(audioMedia, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Media : failed to getMinVolume ${err.message}`); expect().assertFail(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Media: getMinVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Media: getMinVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1574,11 +1570,11 @@ describe('audioFramework', function () { const PROMISE = audioManager.getMinVolume(audioRingtone) PROMISE.then(function (data) { if (data == minVol) { - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); + console.info(`${TagFrmwk}: Ringtone getMinVolume promise : PASS:${data}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data); + console.info(`${TagFrmwk}: Ringtone getMinVolume promise : FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -1607,14 +1603,14 @@ describe('audioFramework', function () { } audioManager.getMinVolume(audioRingtone, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`); + console.error(`${TagFrmwk}: callback : Ringtone : failed to getMinVolume ${err.message}`); expect().assertFail(); } else if (value == minVol) { - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMinVolume : PASS:${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value); + console.info(`${TagFrmwk}: callback : Ringtone: getMinVolume : FAIL: ${value}`); expect(false).assertTrue(); } done(); @@ -1633,13 +1629,13 @@ describe('audioFramework', function () { const PROMISE = audioManager.getDevices(1); // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }).catch(err => { @@ -1662,13 +1658,13 @@ describe('audioFramework', function () { const PROMISE = audioManager.getDevices(2); // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }).catch(err => { @@ -1691,13 +1687,13 @@ describe('audioFramework', function () { const PROMISE = audioManager.getDevices(3); // Getting all devies connected 3 = ALL_DEVICES_FLAG PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }).catch(err => { @@ -1715,22 +1711,22 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0400', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0400', 2, function (done) { audioManager.getDevices(1, (err, value) => { // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } @@ -1746,22 +1742,22 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0500', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0500', 2, function (done) { audioManager.getDevices(2, (err, value) => { // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -1777,23 +1773,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0600', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0600', 2, function (done) { audioManager.getDevices(3, (err, value) => { // Getting all devies connected 3 = ALL_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -1812,13 +1808,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0700', 2, async function (done) { const PROMISE = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }).catch(err => { @@ -1840,13 +1836,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0800', 2, async function (done) { const PROMISE = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }).catch(err => { @@ -1868,14 +1864,14 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0900', 2, async function (done) { const PROMISE = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); PROMISE.then(function (value) { - console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } }).catch(err => { @@ -1894,20 +1890,20 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1000', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1000', 2, function (done) { audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } @@ -1923,20 +1919,20 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1100', 2, function (done) { audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -1952,20 +1948,20 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1200', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1200', 2, function (done) { audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -1986,10 +1982,10 @@ describe('audioFramework', function () { await audioManager.setRingerMode(2); let value = await audioManager.getRingerMode(); if (value == 2) { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -2012,10 +2008,10 @@ describe('audioFramework', function () { await audioManager.setRingerMode(0); let value = await audioManager.getRingerMode(); if (value == 0) { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_SILENT: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -2038,10 +2034,10 @@ describe('audioFramework', function () { await audioManager.setRingerMode(1); let value = await audioManager.getRingerMode(); if (value == 1) { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -2059,24 +2055,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0400', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0400', 2, function (done) { audioManager.setRingerMode(2, (err) => { // Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL'); + console.info(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_NORMAL`); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); done(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else if (value == 2) { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -2093,25 +2089,25 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0500', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0500', 2, function (done) { audioManager.setRingerMode(0, (err) => { // Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT'); + console.info(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_SILENT`); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); done(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } if (value == 0) { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_SILENT: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -2128,25 +2124,25 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0600', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0600', 2, function (done) { audioManager.setRingerMode(1, (err) => { // Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE'); + console.info(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_VIBRATE`); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); done(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } if (value == 1) { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -2168,10 +2164,10 @@ describe('audioFramework', function () { await audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL); let value = await audioManager.getRingerMode(); if (value == audio.AudioRingMode.RINGER_MODE_NORMAL) { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -2194,10 +2190,10 @@ describe('audioFramework', function () { await audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT); let value = await audioManager.getRingerMode(); if (value == audio.AudioRingMode.RINGER_MODE_SILENT) { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_SILENT: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -2220,10 +2216,10 @@ describe('audioFramework', function () { await audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE); let value = await audioManager.getRingerMode(); if (value == audio.AudioRingMode.RINGER_MODE_VIBRATE) { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value); + console.info(`${TagFrmwk}: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -2241,23 +2237,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_1000', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_1000', 2, function (done) { audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL, (err) => { - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL'); + console.info(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_NORMAL`); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); done(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`); expect().assertFail(); } else if (value == audio.AudioRingMode.RINGER_MODE_NORMAL) { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -2274,24 +2270,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_1100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_1100', 2, function (done) { audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT, (err) => { - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT'); + console.info(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_SILENT`); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); done(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : RINGER_MODE_SILENT: Error: ${err.message}`); expect().assertFail(); } if (value == audio.AudioRingMode.RINGER_MODE_SILENT) { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_SILENT: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -2308,24 +2304,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_1200', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_1200', 2, function (done) { audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE, (err, value) => { - console.info('AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE'); + console.info(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_VIBRATE`); if (err) { - console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setRingerMode RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); done(); } else { audioManager.getRingerMode((err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : RINGER_MODE_VIBRATE: Error: ${err.message}`); expect().assertFail(); } if (value == audio.AudioRingMode.RINGER_MODE_VIBRATE) { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -2346,15 +2342,15 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, highVol); audioManager.mute(audioMedia, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + console.error(`${TagFrmwk}: Failed to mute the stream. ${err.message}`); expect(false).assertTrue(); done(); return; } - console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Callback invoked to indicate that the stream is muted.`); audioManager.mute(audioMedia, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`${TagFrmwk}: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); done(); } else { @@ -2366,19 +2362,19 @@ describe('audioFramework', function () { } else if (value == highVol) { audioManager.isMute(audioMedia, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -2400,9 +2396,9 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audioMedia, lowVol); await audioManager.mute(audioMedia, true) - console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Promise returned to indicate that the stream is muted.`); await audioManager.mute(audioMedia, false) - console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: FALSE'); + console.log(`${TagFrmwk}: Set Stream Mute: Media: Promise: FALSE`); let value = await audioManager.getVolume(audioMedia) console.info("AudioFrameworkTest: value is " + value); if (value == lowVol) { @@ -2412,10 +2408,10 @@ describe('audioFramework', function () { } let data = await audioManager.isMute(audioMedia) if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute Media: FALSE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute Media: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } } catch (err) { @@ -2437,15 +2433,15 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, highVol); audioManager.mute(audioRingtone, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + console.error(`${TagFrmwk}: Failed to mute the stream. ${err.message}`); expect(false).assertTrue(); done(); return; } - console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Callback invoked to indicate that the stream is muted.`); audioManager.mute(audioRingtone, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`${TagFrmwk}: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); done(); } else { @@ -2457,19 +2453,19 @@ describe('audioFramework', function () { } else if (value == highVol) { audioManager.isMute(audioRingtone, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -2491,7 +2487,7 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audioRingtone, lowVol); await audioManager.mute(audioRingtone, true); - console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Promise returned to indicate that the stream is muted.`); await audioManager.mute(audioRingtone, false); let value = await audioManager.getVolume(audioRingtone); console.info("AudioFrameworkTest: value is " + value); @@ -2526,15 +2522,15 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.MEDIA, highVol); audioManager.mute(audio.AudioVolumeType.MEDIA, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + console.error(`${TagFrmwk}: Failed to mute the stream. ${err.message}`); expect(false).assertTrue(); done(); return; } - console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Callback invoked to indicate that the stream is muted.`); audioManager.mute(audio.AudioVolumeType.MEDIA, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`${TagFrmwk}: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); done(); } else { @@ -2546,20 +2542,20 @@ describe('audioFramework', function () { } else if (value == highVol) { audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -2581,7 +2577,7 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); await audioManager.mute(audio.AudioVolumeType.MEDIA, true); - console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Promise returned to indicate that the stream is muted.`); await audioManager.mute(audio.AudioVolumeType.MEDIA, false); let value = await audioManager.getVolume(audio.AudioVolumeType.MEDIA); console.info("AudioFrameworkTest: value is " + value); @@ -2592,7 +2588,7 @@ describe('audioFramework', function () { } let data = await audioManager.isMute(audio.AudioVolumeType.MEDIA); if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute Media: FALSE: PASS:${data}`); expect(true).assertTrue(); } } catch (err) { @@ -2614,15 +2610,15 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); audioManager.mute(audio.AudioVolumeType.RINGTONE, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + console.error(`${TagFrmwk}: Failed to mute the stream. ${err.message}`); expect(false).assertTrue(); done(); return; } - console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Callback invoked to indicate that the stream is muted.`); audioManager.mute(audio.AudioVolumeType.RINGTONE, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`); + console.error(`${TagFrmwk}: Set Stream Mute: Media: Callback: Error : ${err.message}`); expect(false).assertTrue(); done(); } else { @@ -2634,19 +2630,19 @@ describe('audioFramework', function () { } else if (value == highVol) { audioManager.isMute(audio.AudioVolumeType.RINGTONE, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : FALSE: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -2668,7 +2664,7 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audio.AudioVolumeType.RINGTONE, lowVol); await audioManager.mute(audio.AudioVolumeType.RINGTONE, true); - console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Promise returned to indicate that the stream is muted.`); await audioManager.mute(audio.AudioVolumeType.RINGTONE, false); let value = await audioManager.getVolume(audio.AudioVolumeType.RINGTONE); console.info("AudioFrameworkTest: value is " + value); @@ -2679,7 +2675,7 @@ describe('audioFramework', function () { } let data = await audioManager.isMute(audio.AudioVolumeType.RINGTONE) if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute Ringtone: FALSE: PASS:${data}`); expect(true).assertTrue(); } } catch (err) { @@ -2701,15 +2697,15 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, highVol); audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + console.error(`${TagFrmwk}: Failed to mute the stream. ${err.message}`); expect(false).assertTrue(); done(); return; } - console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Callback invoked to indicate that the stream is muted.`); audioManager.mute(audio.AudioVolumeType.VOICE_CALL, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: VOICE_CALL: Callback: Error : ${err.message}`); + console.error(`${TagFrmwk}: Set Stream Mute: VOICE_CALL: Callback: Error : ${err.message}`); expect(false).assertTrue(); done(); } else { @@ -2721,19 +2717,19 @@ describe('audioFramework', function () { } else if (value == highVol) { audioManager.isMute(audio.AudioVolumeType.VOICE_CALL, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: VOICE_CALL : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : FALSE: VOICE_CALL : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: FALSE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_CALL: FALSE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_CALL: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -2755,7 +2751,7 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, lowVol); await audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true); - console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Promise returned to indicate that the stream is muted.`); await audioManager.mute(audio.AudioVolumeType.VOICE_CALL, false); let value = await audioManager.getVolume(audio.AudioVolumeType.VOICE_CALL); console.info("AudioFrameworkTest: value is " + value); @@ -2766,7 +2762,7 @@ describe('audioFramework', function () { } let data = await audioManager.isMute(audio.AudioVolumeType.VOICE_CALL); if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: FALSE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute VOICE_CALL: FALSE: PASS:${data}`); expect(true).assertTrue(); } } catch (err) { @@ -2788,15 +2784,15 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, highVol); audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Failed to mute the stream. ${err.message}`); + console.error(`${TagFrmwk}: Failed to mute the stream. ${err.message}`); expect(false).assertTrue(); done(); return; } - console.log('AudioFrameworkTest: Callback invoked to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Callback invoked to indicate that the stream is muted.`); audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Callback: Error : ${err.message}`); + console.error(`${TagFrmwk}: Set Stream Mute: VOICE_ASSISTANT: Callback: Error : ${err.message}`); expect(false).assertTrue(); done(); } @@ -2810,19 +2806,19 @@ describe('audioFramework', function () { else if (value == highVol) { audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: VOICE_ASSISTANT : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : FALSE: VOICE_ASSISTANT : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: FALSE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_ASSISTANT: FALSE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_ASSISTANT: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -2844,7 +2840,7 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, lowVol); await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true); - console.log('AudioFrameworkTest: Promise returned to indicate that the stream is muted.'); + console.log(`${TagFrmwk}: Promise returned to indicate that the stream is muted.`); await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, false); let value = await audioManager.getVolume(audio.AudioVolumeType.VOICE_ASSISTANT); console.info("AudioFrameworkTest: value is " + value); @@ -2855,7 +2851,7 @@ describe('audioFramework', function () { } let data = await audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT); if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: FALSE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute VOICE_ASSISTANT: FALSE: PASS:${data}`); expect(true).assertTrue(); } } catch (err) { @@ -2887,10 +2883,10 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, lowVol); let data = await audioManager.isMute(audioMedia); if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute Media: SetVolume: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute Media: SetVolume: FAIL: ${data}`); expect(false).assertTrue(); } } catch (err) { @@ -2912,11 +2908,11 @@ describe('audioFramework', function () { await audioManager.setVolume(audioMedia, lowVol); audioManager.mute(audioMedia, true, async (err) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`); expect().assertFail(); done(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : TRUE'); + console.log(`${TagFrmwk}: Set Stream Mute: Media: Callback : TRUE`); audioManager.getVolume(audioMedia, async (err, value) => { if (err) { console.error(`Failed to obtain the volume. ${err.message}`); @@ -2932,22 +2928,22 @@ describe('audioFramework', function () { } audioManager.isMute(audioMedia, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: Media : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: SetVolume: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Media: SetVolume: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -2968,7 +2964,7 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audioRingtone, lowVol); await audioManager.mute(audioRingtone, true); - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: SetVolume'); + console.log(`${TagFrmwk}: Set Stream Mute: Ringtone: Promise: SetVolume`); let value = await audioManager.getVolume(audioRingtone); console.info("AudioFrameworkTest: value is " + value); if (value == 0) { @@ -2980,7 +2976,7 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, highVol); let data = await audioManager.isMute(audioRingtone); if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute Ringtone: SetVolume: PASS:${data}`); expect(true).assertTrue(); } } catch (err) { @@ -3002,11 +2998,11 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, highVol); audioManager.mute(audioRingtone, true, async (err) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`); expect().assertFail(); done(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : SetVolume'); + console.log(`${TagFrmwk}: Set Stream Mute: Ringtone: Callback : SetVolume`); audioManager.getVolume(audioRingtone, async (err, value) => { if (err) { console.error(`Failed to obtain the volume. ${err.message}`); @@ -3016,19 +3012,19 @@ describe('audioFramework', function () { await audioManager.setVolume(audioRingtone, lowVol); audioManager.isMute(audioRingtone, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: Ringtone : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Ringtone: SetVolume: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute Ringtone: SetVolume: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -3059,7 +3055,7 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.VOICE_CALL, lowVol); let data = await audioManager.isMute(audio.AudioVolumeType.VOICE_CALL); if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_CALL: SetVolume: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute VOICE_CALL: SetVolume: PASS:${data}`); expect(true).assertTrue(); } } catch (err) { @@ -3088,12 +3084,12 @@ describe('audioFramework', function () { } audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true, async (err) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_CALL : failed to set Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: VOICE_CALL : failed to set Mute Status ${err.message}`); expect().assertFail(); done(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: VOICE_CALL: Callback : SetVolume'); + console.log(`${TagFrmwk}: Set Stream Mute: VOICE_CALL: Callback : SetVolume`); audioManager.getVolume(audio.AudioVolumeType.VOICE_CALL, async (err, value) => { if (err) { console.error(`Failed to obtain the volume. ${err.message}`); @@ -3110,19 +3106,19 @@ describe('audioFramework', function () { } audioManager.isMute(audio.AudioVolumeType.VOICE_CALL, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_CALL : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: VOICE_CALL : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: SetVolume: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_CALL: SetVolume: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_CALL: SetVolume: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_CALL: SetVolume: FAIL: ${data}`); expect(false).assertTrue(); } done(); }); } else { - console.info(`AudioFrameworkTest: mute fail: value ${value}`); + console.info(`${TagFrmwk}: mute fail: value ${value}`); expect(false).assertTrue(); done(); } @@ -3144,7 +3140,7 @@ describe('audioFramework', function () { try { await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, highVol); await audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true); - console.log('AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Promise: TRUE'); + console.log(`${TagFrmwk}: Set Stream Mute: VOICE_ASSISTANT: Promise: TRUE`); let value = await audioManager.getVolume(audio.AudioVolumeType.VOICE_ASSISTANT); console.info("AudioFrameworkTest: value is " + value); if (value == 0) { @@ -3155,7 +3151,7 @@ describe('audioFramework', function () { await audioManager.setVolume(audio.AudioVolumeType.VOICE_ASSISTANT, lowVol); let data = await audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT); if (data == false) { - console.log('AudioFrameworkTest: Promise: Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS:' + data); + console.log(`${TagFrmwk}: Promise: Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS:${data}`); expect(true).assertTrue(); } } catch (err) { @@ -3184,11 +3180,11 @@ describe('audioFramework', function () { } audioManager.mute(audio.AudioVolumeType.VOICE_ASSISTANT, true, async (err) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_ASSISTANT : failed to set Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: VOICE_ASSISTANT : failed to set Mute Status ${err.message}`); expect().assertFail(); done(); } else { - console.log('AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Callback : SetVolume'); + console.log(`${TagFrmwk}: Set Stream Mute: VOICE_ASSISTANT: Callback : SetVolume`); try { let value = await audioManager.getVolume(audio.AudioVolumeType.VOICE_ASSISTANT); if (value == 0) { @@ -3206,13 +3202,13 @@ describe('audioFramework', function () { } audioManager.isMute(audio.AudioVolumeType.VOICE_ASSISTANT, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : SetVolume: VOICE_ASSISTANT : failed to get Mute Status ${err.message}`); + console.error(`${TagFrmwk}: Callback : SetVolume: VOICE_ASSISTANT : failed to get Mute Status ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: FAIL: ${data}`); expect(false).assertTrue(); } done(); @@ -3230,14 +3226,14 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0100', 1, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log(`${TagFrmwk}: 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('AudioFrameworkTest: Promise: isActive: Media: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: isActive: Media: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: isActive: Media: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -3256,17 +3252,17 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0200', 1, async function (done) { - console.log('AudioFrameworkTest: Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0200', 1, function (done) { + console.log(`${TagFrmwk}: Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`); audioManager.isActive(audioMedia, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Media : isActive: failed ${err.message}`); + console.error(`${TagFrmwk}: Callback : Media : isActive: failed ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Callback: isActive: Media: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback: isActive: Media: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } done(); @@ -3282,14 +3278,14 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0300', 2, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log(`${TagFrmwk}: 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('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: isActive: Ringtone: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: isActive: Ringtone: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -3308,17 +3304,17 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0400', 2, async function (done) { - console.log('AudioFrameworkTest: Callback : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0400', 2, function (done) { + console.log(`${TagFrmwk}: Callback : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`); audioManager.isActive(audioRingtone, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Ringtone : isActive: failed ${err.message}`); + console.error(`${TagFrmwk}: Callback : Ringtone : isActive: failed ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Callback: isActive: Ringtone: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback: isActive: Ringtone: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } done(); @@ -3334,14 +3330,14 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0500', 2, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log(`${TagFrmwk}: Promise : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`); const PROMISE = audioManager.isActive(audio.AudioVolumeType.MEDIA); PROMISE.then(function (data) { if (data == false) { - console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: isActive: Media: ENAME: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: isActive: Media: ENAME: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -3360,16 +3356,16 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0600', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0600', 2, function (done) { audioManager.isActive(audio.AudioVolumeType.MEDIA, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Media : ENAME: isActive: failed ${err.message}`); + console.error(`${TagFrmwk}: Callback : Media : ENAME: isActive: failed ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Callback: isActive: Media: ENAME: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback: isActive: Media: ENAME: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } done(); @@ -3385,14 +3381,14 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0700', 2, async function (done) { - console.log('AudioFrameworkTest: Promise : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + console.log(`${TagFrmwk}: Promise : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`); const PROMISE = audioManager.isActive(audio.AudioVolumeType.RINGTONE); PROMISE.then(function (data) { if (data == false) { - console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: isActive: Ringtone: ENAME: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: isActive: Ringtone: ENAME: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } }).catch(err => { @@ -3411,17 +3407,17 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0800', 2, async function (done) { - console.log('AudioFrameworkTest: Callback : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); + it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0800', 2, function (done) { + console.log(`${TagFrmwk}: Callback : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`); audioManager.isActive(audio.AudioVolumeType.RINGTONE, (err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : Ringtone : ENAME: isActive: failed ${err.message}`); + console.error(`${TagFrmwk}: Callback : Ringtone : ENAME: isActive: failed ${err.message}`); expect().assertFail(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Callback: isActive: Ringtone: ENAME: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback: isActive: Ringtone: ENAME: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } done(); @@ -3441,10 +3437,10 @@ describe('audioFramework', function () { await audioManager.setMicrophoneMute(true); let data = await audioManager.isMicrophoneMute(); if (data == true) { - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: isMicrophoneMute: TRUE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: isMicrophoneMute: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } } catch (err) { @@ -3467,14 +3463,14 @@ describe('audioFramework', function () { await audioManager.setMicrophoneMute(false); let data = await audioManager.isMicrophoneMute(); if (data == false) { - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: PASS:' + data); + console.log(`${TagFrmwk}: Promise: isMicrophoneMute: FALSE: PASS:${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Promise: isMicrophoneMute: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } } catch (err) { - console.info('Error :' + err.message); + console.info(`Error :${err.message}`); expect(false).assertTrue(); } done(); @@ -3488,24 +3484,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETMICROPHONEMUTE_0300', 1, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETMICROPHONEMUTE_0300', 1, function (done) { audioManager.setMicrophoneMute(true, (err) => { if (err) { - console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : TRUE: Error : ${err.message}`); + console.error(`${TagFrmwk}: setMicrophoneMute: Callback : TRUE: Error : ${err.message}`); expect(false).assertTrue(); done(); } else { - console.log('AudioFrameworkTest: setMicrophoneMute: Callback : TRUE'); + console.log(`${TagFrmwk}: setMicrophoneMute: Callback : TRUE`); audioManager.isMicrophoneMute((err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : TRUE: isMicrophoneMute : Error ${err.message}`); + console.error(`${TagFrmwk}: Callback : TRUE: isMicrophoneMute : Error ${err.message}`); expect(false).assertTrue(); } else if (data == true) { - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : isMicrophoneMute: TRUE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : isMicrophoneMute: TRUE: FAIL: ${data}`); expect(false).assertTrue(); } done(); @@ -3522,24 +3518,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 1 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETMICROPHONEMUTE_0400', 1, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETMICROPHONEMUTE_0400', 1, function (done) { audioManager.setMicrophoneMute(false, (err) => { if (err) { - console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : FALSE: Error : ${err.message}`); + console.error(`${TagFrmwk}: setMicrophoneMute: Callback : FALSE: Error : ${err.message}`); expect(false).assertTrue(); done(); } else { - console.log('AudioFrameworkTest: setMicrophoneMute: Callback : FALSE'); + console.log(`${TagFrmwk}: setMicrophoneMute: Callback : FALSE`); audioManager.isMicrophoneMute((err, data) => { if (err) { - console.error(`AudioFrameworkTest: Callback : FALSE: isMicrophoneMute : Error ${err.message}`); + console.error(`${TagFrmwk}: Callback : FALSE: isMicrophoneMute : Error ${err.message}`); expect(false).assertTrue(); } else if (data == false) { - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: PASS: ' + data); + console.log(`${TagFrmwk}: Callback : isMicrophoneMute: FALSE: PASS: ${data}`); expect(true).assertTrue(); } else { - console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: FAIL: ' + data); + console.log(`${TagFrmwk}: Callback : isMicrophoneMute: FALSE: FAIL: ${data}`); expect(false).assertTrue(); } done(); @@ -3560,24 +3556,24 @@ describe('audioFramework', function () { try { let flag = true; let outputDeviceDescription = await audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG); - console.info('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 outputDeviceDescription is ' + JSON.stringify(outputDeviceDescription)); + console.info(`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 outputDeviceDescription is ${JSON.stringify(outputDeviceDescription)}`); if (outputDeviceDescription.length == 1 && outputDeviceDescription[0].deviceType == audio.DeviceType.SPEAKER) { flag = false; } await audioManager.setDeviceActive(2, false).then(() => { - console.info('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 Promise returned to indicate that the device is set to the active status.'); + console.info(`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 Promise returned to indicate that the device is set to the active status.`); }); await audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value) { if (flag == true && value == false) { - console.info('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :' + value + 'flag is ' + flag); + console.info(`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :${value } flag is ${flag}`); expect(true).assertTrue(); } else if (flag == false && value == true) { - console.info('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :' + value + 'flag is ' + flag); + console.info(`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :${value } flag is ${flag}`); expect(true).assertTrue(); } else { - console.info('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : fail :' + value + 'flag is ' + flag); + console.info(`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : fail :${value } flag is ${flag}`); expect(false).assertTrue(); } }).catch((err) => { @@ -3604,10 +3600,10 @@ describe('audioFramework', function () { await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true); let value = await audioManager.isDeviceActive(2); if (value == true) { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -3626,33 +3622,33 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300', 2,async function (done) { let flag = true let outputDeviceDescription = await audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG); - console.info('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300 outputDeviceDescription is ' + JSON.stringify(outputDeviceDescription)); + console.info(`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300 outputDeviceDescription is ${JSON.stringify(outputDeviceDescription)}`); if (outputDeviceDescription.length == 1 && outputDeviceDescription[0].deviceType == audio.DeviceType.SPEAKER) { flag = false; } audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, false, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`); audioManager.isDeviceActive(2, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == false && flag == true) { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' + value + 'flag is ' + flag); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :${value } flag is ${flag}`); expect(true).assertTrue(); } else if (value == true && flag == false) { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' + value + 'flag is ' + flag);//1�? + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :${value } flag is ${flag}`); expect(true).assertTrue(); } else { - console.info('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300 AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :value' + value + 'flag is ' + flag); + console.info(`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300 ${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :${value } flag is ${flag}`); expect(false).assertTrue(); } done(); @@ -3669,24 +3665,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0400', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0400', 2, function (done) { audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true, (err) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); done(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active'); + console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`); audioManager.isDeviceActive(2, (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); + console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == true) { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' + value); + console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -3709,10 +3705,10 @@ describe('audioFramework', function () { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit'); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '8 bit') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: Bits per sample : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: Bits per sample : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : Bits per sample : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : Bits per sample : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -3733,13 +3729,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0200', 1, async function (done) { try { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800'); - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Promise : setAudioParameter`); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '4800') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -3760,13 +3756,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0300', 2, async function (done) { try { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue); - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Promise : setAudioParameter`); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == longValue) { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -3787,13 +3783,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0400', 2, async function (done) { try { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.000000234324324324'); - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Promise : setAudioParameter`); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '10.000000234324324324') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -3816,10 +3812,10 @@ describe('audioFramework', function () { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber'); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == 'PPNumber') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -3840,13 +3836,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0600', 2, async function (done) { try { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|'); - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Promise : setAudioParameter`); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '[]\:";<>?,./~!@#$%^*()_+-={}|') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -3864,25 +3860,25 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0700', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0700', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '16 bit', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); } else { audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '16 bit') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -3899,23 +3895,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0800', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0800', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '~!@#$%^*()_+-={}|[]\:";<>?,./', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); } else { audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParam: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParam: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '~!@#$%^*()_+-={}|[]\:";<>?,./') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -3932,23 +3928,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0900', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0900', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10000.21321432432432', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); } else { audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback :getAudioParm: VOICE_PHONE_STATUS:Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback :getAudioParm: VOICE_PHONE_STATUS:Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '10000.21321432432432') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -3965,23 +3961,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_1000', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_1000', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '5454', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); } else { audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParam: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParam: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '5454') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -3998,23 +3994,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_1100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_1100', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue, (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == longValue) { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4030,23 +4026,23 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_1200', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_1200', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'xyza', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == 'xyza') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4067,10 +4063,10 @@ describe('audioFramework', function () { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit'); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '8 bit') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -4091,13 +4087,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0200', 2, async function (done) { try { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800'); - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Promise : setAudioParameter`); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '4800') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -4120,10 +4116,10 @@ describe('audioFramework', function () { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == longValue) { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -4146,10 +4142,10 @@ describe('audioFramework', function () { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.0000000000234'); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '10.0000000000234') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -4172,10 +4168,10 @@ describe('audioFramework', function () { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber'); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == 'PPNumber') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -4196,13 +4192,13 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0600', 2, async function (done) { try { await audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|'); - console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Promise : setAudioParameter`); let value = await audioManager.getAudioParameter('VOICE_PHONE_STATUS'); if (value == '[]\:";<>?,./~!@#$%^*()_+-={}|') { - console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value); + console.info(`${TagFrmwk}: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :${value}`); expect(false).assertTrue(); } } catch (err) { @@ -4220,24 +4216,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0700', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0700', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '16 bit', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); return; } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '16 bit') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4253,24 +4249,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0800', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0800', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '~!@#$%^*()_+-={}|[]\:";<>?,./', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); return; } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '~!@#$%^*()_+-={}|[]\:";<>?,./') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4286,24 +4282,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0900', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0900', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10000.21321432432432', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); return; } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '10000.21321432432432') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4319,24 +4315,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_1000', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_1000', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', '5454', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); return; } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == '5454') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4352,24 +4348,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_1100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_1100', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue, (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); return; } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == longValue) { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4387,24 +4383,24 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_1200', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_1200', 2, function (done) { audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'xyza', (err) => { - console.info('AudioFrameworkTest: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter'); + console.info(`${TagFrmwk}: Audio Parameter Test: Callback :VOICE_PHONE_STATUS : setAudioParameter`); if (err) { - console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`); expect(false).assertTrue(); done(); return; } audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => { if (err) { - console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); + console.error(`${TagFrmwk}: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`); expect(false).assertTrue(); } else if (value == 'xyza') { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :${value}`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value); + console.info(`${TagFrmwk}: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :${value}`); expect(false).assertTrue(); } done(); @@ -4423,21 +4419,17 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0100', 1, async function (done) { audioManager = audio.getAudioManager(); audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); if (VolumeEvent.volume == lowVol) { - console.info('AudioFrameworkTest: MEDIA CallBack : PASS :' + VolumeEvent.volume); + console.info(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); expect(false).assertTrue(); break; } @@ -4464,21 +4456,17 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0200', 1, async function (done) { audioManager = audio.getAudioManager(); audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); if (VolumeEvent.volume == lowVol) { - console.info('AudioFrameworkTest: RINGTONE CallBack : PASS :' + VolumeEvent.volume); + console.info(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); expect(false).assertTrue(); break; } @@ -4505,21 +4493,17 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0300', 2, async function (done) { audioManager = audio.getAudioManager(); audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); if (VolumeEvent.volume == lowVol) { - console.info('AudioFrameworkTest: VOICE_CALL CallBack : PASS :' + VolumeEvent.volume); + console.info(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); expect(false).assertTrue(); break; } @@ -4546,21 +4530,17 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0400', 2, async function (done) { audioManager = audio.getAudioManager(); audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); if (VolumeEvent.volume == lowVol) { - console.info('AudioFrameworkTest: VOICE_ASSISTANT CallBack : PASS :' + VolumeEvent.volume); + console.info(`${TagFrmwk}: 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); + console.info(`${TagFrmwk}: Audio VolumeEvent is : ${VolumeEvent}`); expect(false).assertTrue(); break; } @@ -4587,14 +4567,14 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0100', 1, async function (done) { audioManager.on('ringerModeChange', (ringerMode) => { - console.log('AudioFrameworkTest: RingerModeChange is called'); + console.log(`${TagFrmwk}: RingerModeChange is called`); switch (ringerMode) { case audio.AudioRingMode.RINGER_MODE_SILENT: - console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_SILENT : ' + ringerMode); + console.info(`${TagFrmwk}: Ringer Mode Changed to : RINGER_MODE_SILENT : ${ringerMode}`); expect(true).assertTrue(); break; default: - console.info('AudioFrameworkTest: Ringer Mode Changed : UNKNOWN ' + ringerMode); + console.info(`${TagFrmwk}: Ringer Mode Changed : UNKNOWN ${ringerMode}`); expect(false).assertTrue(); break; } @@ -4613,14 +4593,14 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0200', 1, async function (done) { audioManager.on('ringerModeChange', (ringerMode) => { - console.log('AudioFrameworkTest: RingerModeChange is called'); + console.log(`${TagFrmwk}: RingerModeChange is called`); switch (ringerMode) { case audio.AudioRingMode.RINGER_MODE_VIBRATE: - console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_VIBRATE : ' + ringerMode); + console.info(`${TagFrmwk}: Ringer Mode Changed to : RINGER_MODE_VIBRATE : ${ringerMode}`); expect(true).assertTrue(); break; default: - console.info('AudioFrameworkTest: Ringer Mode Changed : UNKNOWN ' + ringerMode); + console.info(`${TagFrmwk}: Ringer Mode Changed : UNKNOWN ${ringerMode}`); expect(false).assertTrue(); break; } @@ -4646,14 +4626,14 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0300', 2, async function (done) { audioManager.on('ringerModeChange', (ringerMode) => { - console.log('AudioFrameworkTest: RingerModeChange is called'); + console.log(`${TagFrmwk}: RingerModeChange is called`); switch (ringerMode) { case audio.AudioRingMode.RINGER_MODE_NORMAL: - console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_NORMAL : ' + ringerMode); + console.info(`${TagFrmwk}: Ringer Mode Changed to : RINGER_MODE_NORMAL : ${ringerMode}`); expect(true).assertTrue(); break; default: - console.info('AudioFrameworkTest: Ringer Mode Changed : UNKNOWN ' + ringerMode); + console.info(`${TagFrmwk}: Ringer Mode Changed : UNKNOWN ${ringerMode}`); expect(false).assertTrue(); break; } @@ -4921,25 +4901,25 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0100', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0100', 2,async function (done) { let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(1, (err, value) => { // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest:Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}:Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } @@ -4955,24 +4935,24 @@ describe('audioFramework', function () { *@tc.type : Function *@tc.level : Level 2 */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0200', 2, async function (done) { + it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0200', 2,async function (done) { let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(2, (err, value) => { // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest:Callback:INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}:Callback:INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -4992,20 +4972,20 @@ describe('audioFramework', function () { let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(3, (err, value) => { // Getting all devies connected 3 = ALL_DEVICES_FLAG - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest:Callback:ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}:Callback:ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -5024,20 +5004,20 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0400', 2, async function (done) { let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest:Callback:OUTPUT_DEVICES_FLAG:failed to get devices ${err.message}`); + console.error(`${TagFrmwk}:Callback:OUTPUT_DEVICES_FLAG:failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } @@ -5056,19 +5036,19 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0500', 2, async function (done) { let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest:Callback:INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}:Callback:INPUT_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -5087,19 +5067,19 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0600', 2, async function (done) { let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); if (err) { - console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); + console.error(`${TagFrmwk}: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`); expect().assertFail(); } else { - console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL'); + console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`); expect(false).assertTrue(); } } @@ -5118,14 +5098,14 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0700', 2, async function (done) { let AudioRoutingManager = await audioManager.getRoutingManager(); let value = await AudioRoutingManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG); - console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices OUTPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices:OUTPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices:OUTPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices:OUTPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices:OUTPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } done(); @@ -5142,19 +5122,19 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800', 2, async function (done) { audioManager.getRoutingManager(async (err, AudioRoutingManager) => { if (err) { - console.error(`AudioFrameworkTest: Callback: failed to get RoutingManager ${err.message}`); + console.error(`${TagFrmwk}: Callback: failed to get RoutingManager ${err.message}`); expect().assertFail(); } else { let value = await AudioRoutingManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG) - console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } @@ -5173,20 +5153,20 @@ describe('audioFramework', function () { it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900', 2, async function (done) { audioManager.getRoutingManager(async (err, AudioRoutingManager) => { if (err) { - console.error(`AudioFrameworkTest:Callback:failed to get RoutingManager ${err.message}`); + console.error(`${TagFrmwk}:Callback:failed to get RoutingManager ${err.message}`); expect().assertFail(); } else { let value = await AudioRoutingManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG) - console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); + console.info(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`); expect(true).assertTrue(); } else { - console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL'); + console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`); expect(false).assertTrue(); } } diff --git a/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js b/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js index e81dbf720..03c52c904 100644 --- a/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js +++ b/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js @@ -24,25 +24,28 @@ describe('audioRenderer', function () { let fdRead; let readPath; const AUDIOMANAGER = audio.getAudioManager(); - console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework'); + console.info(`${TagFrmwkRender}: Create AudioManger Object JS Framework`); + let TagFrmwkRender = "AudioFrameworkRenderLog"; + let TagFrmwk = "AudioFrameworkTest"; + let TagFrmwkAudioScene = "AudioFrameworkAudioScene"; let fdPath; let filePath; - beforeAll(async function () { - console.info('AudioFrameworkRenderLog: beforeAll: Prerequisites at the test suite level'); + beforeAll(function () { + console.info(`${TagFrmwkRender}: beforeAll: Prerequisites at the test suite level`); }) beforeEach(async function () { - console.info('AudioFrameworkRenderLog: beforeEach: Prerequisites at the test case level'); + console.info(`${TagFrmwkRender}: beforeEach: Prerequisites at the test case level`); await sleep(1000); }) afterEach(function () { - console.info('AudioFrameworkRenderLog: afterEach: Test case-level clearance conditions'); + console.info(`${TagFrmwkRender}: afterEach: Test case-level clearance conditions`); }) afterAll(async function () { - console.info('AudioFrameworkRenderLog: afterAll: Test suite-level cleanup condition'); + console.info(`${TagFrmwkRender}: afterAll: Test suite-level cleanup condition`); }) function sleep(ms) { @@ -51,48 +54,48 @@ describe('audioRenderer', function () { async function closeFileDescriptor(fileName) { await resourceManager.getResourceManager().then(async (mgr) => { await mgr.closeRawFileDescriptor(fileName).then(value => { - console.log('AudioFrameworkRenderLog:case closeRawFileDescriptor success for file:' + fileName); + console.log(`${TagFrmwkRender}:case closeRawFileDescriptor success for file:${fileName}`); }).catch(error => { - console.log('AudioFrameworkRenderLog:case closeRawFileDescriptor err: ' + error); + console.log(`${TagFrmwkRender}:case closeRawFileDescriptor err: ${error}`); }); }); } async function getFdRead(pathName, done) { let context = await featureAbility.getContext(); - console.info("case0 context is " + context); + console.info(`case0 context is : ${context}`); await context.getFilesDir().then((data) => { - console.info("case1 getFilesDir is path " + data); + console.info(`case1 getFilesDir is path : ${data}`); filePath = data + '/' + pathName; - console.info('case4 filePath is ' + filePath); + console.info(`case4 filePath is : ${filePath}`); }) fdPath = 'fd://'; await fileio.open(filePath).then((fdNumber) => { fdPath = fdPath + '' + fdNumber; fdRead = fdNumber; - console.info('[fileIO]case open fd success,fdPath is ' + fdPath); - console.info('[fileIO]case open fd success,fdRead is ' + fdRead); + console.info(`[fileIO]case open fd success,fdPath is : ${fdPath}`); + console.info(`[fileIO]case open fd success,fdRead is : ${fdRead}`); }, (err) => { - console.info('[fileIO]case open fd failed'); - }).catch((err) => { - console.info('[fileIO]case catch open fd failed'); + console.info(`[fileIO]case open fd failed : ${err}`); + }).catch((error) => { + console.info(`[fileIO]case catch open fd error : ${error}`); }); } async function playbackPromise(AudioRendererOptions, pathName, AudioScene) { let resultFlag = 'new'; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then(function (data) { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data value: ' + JSON.stringify(data)); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS data state: ${Object.keys(data)}`); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS data value: ${JSON.stringify(data)}`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -102,145 +105,138 @@ describe('audioRenderer', function () { } return resultFlag; }); - console.log("isPass:" + isPass); + console.log(`isPass:${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } - console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + pathName); + console.info(`${TagFrmwkRender}: AudioRenderer : Path : ${pathName}`); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then(function (audioParamsGet) { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: getStreamInfo :ERROR: ${err.message}`); resultFlag = false; }); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize; - await audioRen.getBufferSize().then(async function (data) { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + await audioRen.getBufferSize().then((data) => { + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err) => { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; }); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case2: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case2: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case3: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case3: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); if (rlen > (totalSize / 2)) { - await AUDIOMANAGER.getAudioScene().then(async function (data) { - console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : Value : ' + data); + await AUDIOMANAGER.getAudioScene().then((data) =>{ + console.info(`${TagFrmwkRender}:AudioFrameworkAudioScene: getAudioScene : Value : ${data}`); }).catch((err) => { - console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}:AudioFrameworkAudioScene: getAudioScene : ERROR : ${err.message}`); resultFlag = false; }); } } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); resultFlag = false; }); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); resultFlag = true; - console.info('AudioFrameworkRenderLog: resultFlagRen : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlagRen : ${resultFlag}`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } async function playbackPromise_93(AudioRendererOptions, pathName, AudioScene) { let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -250,127 +246,114 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - //let audioTime = Date.now(); let audioTimeStart; - /*let audioTimeEnd; - let audioTimeMiddle;*/ - // console.info('AudioFrameworkRenderLog: Current Time in NANOSeconds : '+audioTime); - await audioRen.getAudioTime().then(async function (data) { - // audioTime = Date.now(); - audioTimeStart = data / 1000000000;//-audioTime)/1000000000; - console.info('AudioFrameworkRenderLog: getAudioTime : After Start : Converted: ' + audioTimeStart); + await audioRen.getAudioTime().then((data) => { + audioTimeStart = data / 1000000000; + console.info(`${TagFrmwkRender}: getAudioTime : After Start : Converted: ${audioTimeStart}`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: getAudioTime : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getAudioTime : ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - //let gettime = audioTimeMiddle-audioTimeStart; if (audioTimeStart != 0) { - console.info('AudioFrameworkRenderLog: getAudioTime : PASS : ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : PASS : ${audioTimeStart}`); } else { - console.info('AudioFrameworkRenderLog: getAudioTime : FAIL : ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : FAIL : ${audioTimeStart}`); resultFlag = false; } - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } async function playbackPromise_94(AudioRendererOptions, pathName, AudioScene) { let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -380,124 +363,113 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - // let audioTime = Date.now(); let audioTimeStart; - //let audioTimeEnd; - //let audioTimeMiddle; - //console.info('AudioFrameworkRenderLog: Current Time in NANOSeconds : '+audioTime); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; let gettime = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); - await audioRen.getAudioTime().then(async function (data) { + await audioRen.getAudioTime().then((data) => { audioTimeStart = data / 1000000000; - console.info('AudioFrameworkRenderLog: getAudioTime : After Start : Converted: ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : After Start : Converted: ${audioTimeStart}`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: getAudioTime : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getAudioTime : ERROR : ${err.message}`); resultFlag = false; }); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); if (audioTimeStart != 0) { - console.info('AudioFrameworkRenderLog: getAudioTime : PASS : ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : PASS : ${audioTimeStart}`); } else { - console.info('AudioFrameworkRenderLog: getAudioTime : FAIL : ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : FAIL : ${audioTimeStart}`); resultFlag = false; } - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } async function playbackPromise_95(AudioRendererOptions, pathName, AudioScene) { let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -507,108 +479,91 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); let audioTimeStart; - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - await audioRen.getAudioTime().then(async function (data) { + await audioRen.getAudioTime().then((data) => { audioTimeStart = data / 1000000000; - console.info('AudioFrameworkRenderLog: getAudioTime : After Start : Converted: ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : After Start : Converted: ${audioTimeStart}`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: getAudioTime : ERROR : ' + err.message); - resultFlag = false; + resultFlag = true; + console.info(`${TagFrmwkRender}: getAudioTime : ERROR : ${err.message}`); }); if (audioTimeStart != 0) { - console.info('AudioFrameworkRenderLog: getAudioTime : PASS : ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : PASS : ${audioTimeStart}`); } else { - console.info('AudioFrameworkRenderLog: getAudioTime : FAIL : ' + audioTimeStart); + console.info(`${TagFrmwkRender}: getAudioTime : FAIL : ${audioTimeStart}`); resultFlag = false; } - 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); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; } @@ -616,11 +571,11 @@ describe('audioRenderer', function () { let resultFlag = false; let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -630,79 +585,79 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } audioRen.on('markReach', 55, (position) => { - console.log('AudioFrameworkTest: markReach Event is called : ' + position); + console.log(`${TagFrmwk}: markReach Event is called : ${position}`); resultFlag = true; }) - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize; - await audioRen.getBufferSize().then(async function (data) { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + await audioRen.getBufferSize().then((data) => { + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err) => { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; }); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); - console.info('AudioFrameworkRenderLog:case 2-1:AudioFrameworkRenderLog: File Path: '); + console.info(`${TagFrmwkRender}:case 2-1:AudioFrameworkRenderLog: File Path: `); ss.readSync(discardHeader); - console.info('AudioFrameworkRenderLog:case 2-2:AudioFrameworkRenderLog: File Path: '); + console.info(`${TagFrmwkRender}:case 2-2:AudioFrameworkRenderLog: File Path: `); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; } @@ -710,11 +665,11 @@ describe('audioRenderer', function () { let resultFlag = false; let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -724,80 +679,80 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } audioRen.on('markReach', 55, (position) => { - console.log('AudioFrameworkTest: markReach Event is called : ' + position); + console.log(`${TagFrmwk}: markReach Event is called : ${position}`); audioRen.off('markReach'); audioRen.on('markReach', 100, (position) => { - console.log('AudioFrameworkTest: markReach Event is called : ' + position); + console.log(`${TagFrmwk}: markReach Event is called : ${position}`); resultFlag = true; }); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize; - await audioRen.getBufferSize().then(async function (data) { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + await audioRen.getBufferSize().then((data) => { + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err) => { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; }); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; } @@ -805,11 +760,11 @@ describe('audioRenderer', function () { let resultFlag = false; let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -819,80 +774,80 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } audioRen.on('markReach', 55, (position) => { - console.log('AudioFrameworkTest: markReach Event is called : ' + position); + console.log(`${TagFrmwk}: markReach Event is called : ${position}`); resultFlag = true; audioRen.on('markReach', 73, (position) => { - console.log('AudioFrameworkTest: markReach Event is called : ' + position); - resultFlag = false; + console.log(`${TagFrmwk}: markReach Event is called : ${position}`); + resultFlag = true; }); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize; - await audioRen.getBufferSize().then(async function (data) { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + await audioRen.getBufferSize().then((data) => { + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err) => { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; }); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; } @@ -900,11 +855,11 @@ describe('audioRenderer', function () { let resultFlag = false; let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -914,77 +869,77 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } audioRen.on('periodReach', 55, (position) => { - console.log('AudioFrameworkTest: periodReach Event is called : ' + position); + console.log(`${TagFrmwk}: periodReach Event is called : ${position}`); resultFlag = true; audioRen.off('periodReach'); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize; - await audioRen.getBufferSize().then(async function (data) { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + await audioRen.getBufferSize().then((data) => { + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err) => { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; }); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; } @@ -992,11 +947,11 @@ describe('audioRenderer', function () { let resultFlag = false; let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -1006,83 +961,82 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } audioRen.on('periodReach', 55, (position) => { - console.log('AudioFrameworkTest: periodReach Event is called : ' + position); - // resultFlag = true; + console.log(`${TagFrmwk}: periodReach Event is called : ${position}`); audioRen.off('periodReach'); audioRen.on('periodReach', 100, (position) => { - console.log('AudioFrameworkTest: periodReach Event is called : ' + position); + console.log(`${TagFrmwk}: periodReach Event is called : ${position}`); resultFlag = true; audioRen.off('periodReach'); }); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize; - await audioRen.getBufferSize().then(async function (data) { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + await audioRen.getBufferSize().then((data) => { + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err) => { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; }); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; } @@ -1090,11 +1044,11 @@ describe('audioRenderer', function () { let resultFlag = false; let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -1104,151 +1058,144 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; return resultFlag; } audioRen.on('periodReach', 55, (position) => { - console.log('AudioFrameworkTest: periodReach Event is called : ' + position); + console.log(`${TagFrmwk}: periodReach Event is called : ${position}`); resultFlag = true; audioRen.on('periodReach', 73, (position) => { - console.log('AudioFrameworkTest: periodReach Event is called : ' + position); + console.log(`${TagFrmwk}: periodReach Event is called : ${position}`); resultFlag = false; }); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize; - await audioRen.getBufferSize().then(async function (data) { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + await audioRen.getBufferSize().then((data) => { + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; }).catch((err) => { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; }); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; } async function playbackPromise_113(AudioRendererOptions, pathName) { let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await AUDIOMANAGER.getAudioScene().then(async function (data) { - console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); + await AUDIOMANAGER.getAudioScene().then((data) =>{ + console.info(`${TagFrmwkAudioScene}: getAudioScene : Value : ${data}`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getAudioScene : ERROR : ${err.message}`); resultFlag = false; }); } @@ -1256,56 +1203,56 @@ describe('audioRenderer', function () { audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_DOUBLE, (err) => { if (err) { - console.info('AudioFrameworkAudioScene: setRenderRate : RENDER_RATE_DOUBLE : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: setRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: setRenderRate : RENDER_RATE_DOUBLE : SUCCESS'); + console.info(`${TagFrmwkRender}: setRenderRate : RENDER_RATE_DOUBLE : SUCCESS`); } }); } } - console.info('AudioFrameworkRenderLog: Renderer after read'); + console.info(`${TagFrmwkRender}: Renderer after read`); audioRen.getRenderRate((err, data) => { if (err) { - console.info('AudioFrameworkAudioScene: getRenderRate : RENDER_RATE_DOUBLE : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: 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); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_DOUBLE : PASS : ${data}`); } else { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_DOUBLE : FAIL : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_DOUBLE : FAIL : ${data}`); resultFlag = false; } }); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } @@ -1313,119 +1260,111 @@ describe('audioRenderer', function () { let resultFlag = 'new'; - console.info('AudioFrameworkRenderLog: CALLBACK : Audio Playback Function'); + console.info(`${TagFrmwkRender}: CALLBACK : Audio Playback Function`); let audioRen; audio.createAudioRenderer(AudioRendererOptions, (err, data) => { if (err) { - console.error(`AudioFrameworkRenderLog: AudioRender Created : Error: ${err.message}`); + console.error(`${TagFrmwkRender}: AudioRender Created : Error: ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : SUCCESS`); audioRen = data; } }); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } await sleep(100); - console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + pathName); + console.info(`${TagFrmwkRender}: AudioRenderer : Path : ${pathName}`); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: Callback : Audio Playback Function'); + console.info(`${TagFrmwkRender}: CALLBACK : Audio Playback Function`); audioRen.start((err) => { if (err) { - console.error(`AudioFrameworkRenderLog: Renderer start failed: Error: ${err.message}`); + console.error(`${TagFrmwkRender}: Renderer start failed: Error: ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: Renderer started'); + console.info(`${TagFrmwkRender}: Renderer started`); } }); await sleep(100); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let samplingRate; audioRen.getStreamInfo(async (err, audioParamsGet) => { await sleep(100); if (err) { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: getStreamInfo :ERROR: ${err.message}`); resultFlag = false; } else { - 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); + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); samplingRate = audioParamsGet.samplingRate; } }); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } audioRen.getRendererInfo(async (err, audioParamsGet) => { await sleep(100); if (err) { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; } else { - 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); + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); } }); await sleep(100); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } let bufferSize; await audioRen.getBufferSize((err, data) => { if (err) { - console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getBufferSize :ERROR : ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); + console.info(`${TagFrmwkRender}: getBufferSize :SUCCESS ${data}`); bufferSize = data; } }); await sleep(100); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 4: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 4: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; let aa = fileio.fstatSync(fdRead); - console.log('case 6 : ' + aa); - console.info('AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.log(`case 6 : ${aa}`); + console.info(`${TagFrmwkRender}: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; let rlen = 0; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); await sleep(100); - // let waitTime = (totalSize/88200); let waitTime; switch (samplingRate) { case 44100: @@ -1467,18 +1406,18 @@ describe('audioRenderer', function () { } await sleep(100); - console.info('AudioFrameworkRenderLog: waitTime : ' + waitTime); + console.info(`${TagFrmwkRender}: waitTime : ${waitTime}`); while (rlen < totalSize / 10) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf, (err, data) => { if (err) { - console.error(`AudioFrameworkRenderLog: Buff write: Error: ${err.message}`); + console.error(`${TagFrmwkRender}: Buff write: Error: ${err.message}`); resultFlag = false; } else { - console.info('BufferAudioFramework: Buff write successful : '); + console.info(`${TagFrmwkRender}:BufferAudioFramework: Buff write successful`); resultFlag = true; } }); @@ -1486,53 +1425,53 @@ describe('audioRenderer', function () { } await sleep(100); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } ss.closeSync(); audioRen.drain((err, state) => { if (err) { - console.error(`AudioFrameworkRenderLog: Renderer drain failed: Error: ${err.message}`); + console.error(`${TagFrmwkRender}: Renderer drain failed: Error: ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: Renderer drained'); + console.info(`${TagFrmwkRender}: Renderer drained`); } }); await sleep(100); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } audioRen.stop((err, state) => { if (err) { - console.error(`AudioFrameworkRenderLog: Renderer stop failed: Error: ${err.message}`); + console.error(`${TagFrmwkRender}: Renderer stop failed: Error: ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: Renderer stopped'); + console.info(`${TagFrmwkRender}: Renderer stopped`); resultFlag = true; - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); } }); await sleep(100); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); if (resultFlag == false) { - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); return resultFlag; } audioRen.release((err, state) => { if (err) { - console.error(`AudioFrameworkRenderLog: Renderer release failed: Error: ${err.message}`); + console.error(`${TagFrmwkRender}: Renderer release failed: Error: ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: Renderer released'); + console.info(`${TagFrmwkRender}: Renderer released`); } }); await sleep(100); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); return resultFlag; @@ -1570,7 +1509,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1608,7 +1547,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise_93(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1647,7 +1586,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise_94(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1685,7 +1624,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise_95(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1718,12 +1657,11 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); let resultFlag = await playbackPromise_102(AudioRendererOptions, filePath); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1756,12 +1694,12 @@ describe('audioRenderer', function () { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); let resultFlag = await playbackPromise_103(AudioRendererOptions, filePath); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1795,12 +1733,11 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); let resultFlag = await playbackPromise_104(AudioRendererOptions, filePath); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1837,7 +1774,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise_105(AudioRendererOptions, filePath); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1870,12 +1807,12 @@ describe('audioRenderer', function () { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); let resultFlag = await playbackPromise_106(AudioRendererOptions, filePath); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1909,12 +1846,11 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); let resultFlag = await playbackPromise_107(AudioRendererOptions, filePath); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -1951,7 +1887,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); @@ -1989,7 +1925,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); @@ -2027,7 +1963,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2064,7 +2000,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2101,7 +2037,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2138,7 +2074,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2175,7 +2111,7 @@ describe('audioRenderer', function () { await getFdRead(readPath, done); let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(100); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2215,14 +2151,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2263,14 +2199,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2310,14 +2246,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2357,14 +2293,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2405,14 +2341,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2452,14 +2388,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2499,14 +2435,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2546,14 +2482,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.VOICE_ASSISTANT).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive VOICE_ASSISTANT: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive VOICE_ASSISTANT: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive VOICE_ASSISTANT: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive VOICE_ASSISTANT: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2593,14 +2529,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2641,14 +2577,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2688,14 +2624,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2735,14 +2671,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2782,14 +2718,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2829,14 +2765,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.VOICE_CALL).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive VOICE_CALL: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive VOICE_CALL: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive VOICE_CALL: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive VOICE_CALL: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2876,14 +2812,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2923,14 +2859,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -2970,14 +2906,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3017,14 +2953,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3064,14 +3000,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3112,14 +3048,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3160,14 +3096,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive RENGITONE: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive RENGITONE: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3208,14 +3144,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3256,14 +3192,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive Media: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive Media: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3303,14 +3239,14 @@ describe('audioRenderer', function () { await sleep(2000); AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: PASS : ${data}`); } else { - console.log('AudioFrameworkTest: Promise : isActive RINGTONE: FAIL :' + data); + console.log(`${TagFrmwk}: Promise : isActive RINGTONE: FAIL : ${data}`); } }); await sleep(9000); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -3348,11 +3284,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3362,7 +3298,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3370,34 +3306,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -3436,11 +3369,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3450,7 +3383,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3458,34 +3391,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -3526,11 +3456,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3540,7 +3470,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3548,34 +3478,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -3616,11 +3543,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3630,7 +3557,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3638,34 +3565,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -3706,11 +3630,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3720,7 +3644,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3728,34 +3652,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -3796,11 +3717,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3810,7 +3731,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3818,34 +3739,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -3886,11 +3804,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3900,7 +3818,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3908,34 +3826,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -3976,11 +3891,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -3990,7 +3905,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -3998,34 +3913,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4066,11 +3978,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4080,7 +3992,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4088,34 +4000,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4156,11 +4065,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4170,7 +4079,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4178,34 +4087,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4246,11 +4152,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4260,7 +4166,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4268,34 +4174,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4336,11 +4239,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4350,7 +4253,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4358,34 +4261,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4426,11 +4326,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4440,7 +4340,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4448,34 +4348,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4516,11 +4413,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4530,7 +4427,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4538,34 +4435,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4606,11 +4500,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4620,7 +4514,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4628,34 +4522,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4696,11 +4587,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4710,7 +4601,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4718,34 +4609,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4786,11 +4674,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4800,7 +4688,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4808,34 +4696,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4876,11 +4761,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4890,7 +4775,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4898,34 +4783,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -4966,11 +4848,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -4980,7 +4862,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -4988,34 +4870,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -5056,11 +4935,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5070,7 +4949,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5078,34 +4957,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -5146,11 +5022,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5160,7 +5036,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5168,34 +5044,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -5236,11 +5109,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5250,7 +5123,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5258,34 +5131,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -5326,11 +5196,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5340,7 +5210,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5348,34 +5218,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -5416,11 +5283,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5430,7 +5297,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5438,34 +5305,31 @@ describe('audioRenderer', function () { return; } - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); if (audioParamsGet.content == AudioRendererInfo.content) { - console.info('AudioFrameworkRenderLog: Renderer content type: PASS: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: PASS: ${audioParamsGet.content}`); } else { - console.info('AudioFrameworkRenderLog: Renderer content type: FAIL: ' + audioParamsGet.content); + console.info(`${TagFrmwkRender}: Renderer content type: FAIL: ${dioParamsGet.content}`); resultFlag = false; } if (audioParamsGet.usage == AudioRendererInfo.usage) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.usage}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.usage); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.usage}`); resultFlag = false; } if (audioParamsGet.rendererFlags == AudioRendererInfo.rendererFlags) { - console.info('AudioFrameworkRenderLog: Renderer usage type: PASS: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: PASS: ${audioParamsGet.rendererFlags}`); } else { - console.info('AudioFrameworkRenderLog: Renderer usage type: FAIL: ' + audioParamsGet.rendererFlags); + console.info(`${TagFrmwkRender}: Renderer usage type: FAIL: ${audioParamsGet.rendererFlags}`); resultFlag = false; } }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); @@ -5505,11 +5369,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5519,7 +5383,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5528,17 +5392,17 @@ describe('audioRenderer', function () { } if (audioRen.state == audio.AudioState.STATE_PREPARED) { - console.info('AudioFrameworkRenderLog: Audio State : STATE_PREPARED : PASS : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_PREPARED : PASS : ${audioRen.state}`); } else { - console.info('AudioFrameworkRenderLog: Audio State : STATE_PREPARED : FAIL : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_PREPARED : FAIL : ${audioRen.state}`); resultFlag = false; } - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); expect(resultFlag).assertTrue(); @@ -5577,11 +5441,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5591,7 +5455,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5599,33 +5463,33 @@ describe('audioRenderer', function () { return; } - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); if (audioRen.state == audio.AudioState.STATE_RUNNING) { - console.info('AudioFrameworkRenderLog: Audio State : STATE_RUNNING : PASS : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_RUNNING : PASS : ${audioRen.state}`); } else { - console.info('AudioFrameworkRenderLog: Audio State : STATE_RUNNING : FAIL : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_RUNNING : FAIL : ${audioRen.state}`); resultFlag = false; } - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); expect(resultFlag).assertTrue(); @@ -5664,11 +5528,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5678,7 +5542,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5686,35 +5550,35 @@ describe('audioRenderer', function () { return; } - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); if (audioRen.state == audio.AudioState.STATE_STOPPED) { - console.info('AudioFrameworkRenderLog: Audio State : STATE_STOPPED : PASS : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_STOPPED : PASS : ${audioRen.state}`); } else { - console.info('AudioFrameworkRenderLog: Audio State : STATE_STOPPED : FAIL : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_STOPPED : FAIL : ${audioRen.state}`); resultFlag = false; } - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); expect(resultFlag).assertTrue(); @@ -5753,11 +5617,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5767,7 +5631,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5775,35 +5639,35 @@ describe('audioRenderer', function () { return; } - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(500); if (audioRen.state == audio.AudioState.STATE_RELEASED) { - console.info('AudioFrameworkRenderLog: Audio State : STATE_RELEASED : PASS : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_RELEASED : PASS : ${audioRen.state}`); } else { - console.info('AudioFrameworkRenderLog: Audio State : STATE_RELEASED : FAIL : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_RELEASED : FAIL : ${audioRen.state}`); resultFlag = false; } @@ -5843,11 +5707,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5857,7 +5721,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5865,43 +5729,43 @@ describe('audioRenderer', function () { return; } - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.pause().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant Pause :SUCCESS '); + await audioRen.pause().then(() => { + console.info(`${TagFrmwkRender}: renderInstant Pause :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant Pause :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant Pause :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); if (audioRen.state == audio.AudioState.STATE_PAUSED) { - console.info('AudioFrameworkRenderLog: Audio State : STATE_PAUSED : PASS : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_PAUSED : PASS : ${audioRen.state}`); } else { - console.info('AudioFrameworkRenderLog: Audio State : STATE_PAUSED : FAIL : ' + audioRen.state); + console.info(`${TagFrmwkRender}: Audio State : STATE_PAUSED : FAIL : ${audioRen.state}`); resultFlag = false; } - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); await sleep(500); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(500) @@ -5939,21 +5803,20 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - // let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -5963,7 +5826,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -5971,115 +5834,108 @@ describe('audioRenderer', function () { return; } - console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + readPath); + console.info(`${TagFrmwkRender}: AudioRenderer : Path : ${readPath}`); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await AUDIOMANAGER.getAudioScene().then(async function (data) { - console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); + await AUDIOMANAGER.getAudioScene().then((data) =>{ + console.info(`${TagFrmwkAudioScene}: getAudioScene : Value : ${data}`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getAudioScene : ERROR : ${err.message}`); resultFlag = false; }); } if (rlen > (totalSize / 8)) { - await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_DOUBLE).then(async function () { - console.info('AudioFrameworkRenderLog: setRenderRate : RENDER_RATE_DOUBLE : SUCCESS'); + await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_DOUBLE).then(() => { + console.info(`${TagFrmwkRender}: setRenderRate : RENDER_RATE_DOUBLE : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: setRenderRate : RENDER_RATE_DOUBLE : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: setRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`); resultFlag = false; }); } } - console.info('AudioFrameworkRenderLog: Renderer after read'); - await audioRen.getRenderRate().then(async function (data) { + console.info(`${TagFrmwkRender}: Renderer after read`); + await audioRen.getRenderRate().then((data) => { if (data == audio.AudioRendererRate.RENDER_RATE_DOUBLE) { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_DOUBLE : PASS : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_DOUBLE : PASS : ${data}`); } else { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_DOUBLE : FAIL : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_DOUBLE : FAIL : ${data}`); resultFlag = false; } }).catch((err) => { - console.info('AudioFrameworkAudioScene: getRenderRate : RENDER_RATE_DOUBLE : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`); resultFlag = false; }); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); await sleep(500) @@ -6118,21 +5974,20 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-24000-3SW.wav' await getFdRead(readPath, done); let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -6142,7 +5997,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -6150,114 +6005,107 @@ describe('audioRenderer', function () { return; } - console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + readPath); + console.info(`${TagFrmwkRender}: AudioRenderer : Path : ${readPath}`); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await AUDIOMANAGER.getAudioScene().then(async function (data) { - console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); + await AUDIOMANAGER.getAudioScene().then((data) =>{ + console.info(`${TagFrmwkAudioScene}: getAudioScene : Value : ${data}`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getAudioScene : ERROR : ${err.message}`); resultFlag = false; }); } if (rlen > (totalSize / 8)) { - await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_HALF).then(async function () { - console.info('AudioFrameworkRenderLog: setRenderRate : RENDER_RATE_HALF : SUCCESS'); + await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_HALF).then(() => { + console.info(`${TagFrmwkRender}: setRenderRate : RENDER_RATE_HALF : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: setRenderRate : RENDER_RATE_HALF : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: setRenderRate : RENDER_RATE_HALF : ERROR : ${err.message}`); resultFlag = false; }); } } - console.info('AudioFrameworkRenderLog: Renderer after read'); - await audioRen.getRenderRate().then(async function (data) { + console.info(`${TagFrmwkRender}: Renderer after read`); + await audioRen.getRenderRate().then((data) => { if (data == audio.AudioRendererRate.RENDER_RATE_HALF) { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_HALF : PASS : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_HALF : PASS : ${data}`); } else { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_HALF : FAIL : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_HALF : FAIL : ${data}`); resultFlag = false; } }).catch((err) => { - console.info('AudioFrameworkAudioScene: getRenderRate : RENDER_RATE_HALF : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_HALF : ERROR : ${err.message}`); resultFlag = false; }); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); await sleep(500) @@ -6296,125 +6144,121 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-1C-44100-2SW.wav' await getFdRead(readPath, done); let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + readPath); + console.info(`${TagFrmwkRender}: AudioRenderer : Path : ${readPath}`); - 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}:BufferAudioFramework: bytes read from file: ${rlen}`); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await AUDIOMANAGER.getAudioScene().then(async function (data) { - console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); + await AUDIOMANAGER.getAudioScene().then((data) =>{ + console.info(`${TagFrmwkAudioScene}: getAudioScene : Value : ${data}`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getAudioScene : ERROR : ${err.message}`); resultFlag = false; }); } if (rlen > (totalSize / 8)) { - await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_DOUBLE).then(async function () { - console.info('AudioFrameworkRenderLog: setRenderRate : RENDER_RATE_DOUBLE : SUCCESS'); + await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_DOUBLE).then(() => { + console.info(`${TagFrmwkRender}: setRenderRate : RENDER_RATE_DOUBLE : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: setRenderRate : RENDER_RATE_DOUBLE : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: setRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`); resultFlag = false; }); } } - await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL).then(async function () { - console.info('AudioFrameworkRenderLog: setRenderRate : RENDER_RATE_NORMAL : SUCCESS'); + await audioRen.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL).then(() => { + console.info(`${TagFrmwkRender}: setRenderRate : RENDER_RATE_NORMAL : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: setRenderRate : RENDER_RATE_NORMAL : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: setRenderRate : RENDER_RATE_NORMAL : ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: Renderer after read'); - await audioRen.getRenderRate().then(async function (data) { + console.info(`${TagFrmwkRender}: Renderer after read`); + await audioRen.getRenderRate().then((data) => { if (data == audio.AudioRendererRate.RENDER_RATE_NORMAL) { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_NORMAL : PASS : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : PASS : ${data}`); } else { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_NORMAL : FAIL : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : FAIL : ${data}`); resultFlag = false; } }).catch((err) => { - console.info('AudioFrameworkAudioScene: getRenderRate : RENDER_RATE_NORMAL : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_NORMAL : ERROR : ${err.message}`); resultFlag = false; }); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); await sleep(500) @@ -6452,21 +6296,20 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - // let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-1C-96000-4SW.wav' await getFdRead(readPath, done); let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; let resultFlag = true; - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -6476,7 +6319,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -6484,107 +6327,100 @@ describe('audioRenderer', function () { return; } - console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + readPath); + console.info(`${TagFrmwkRender}: AudioRenderer : Path : ${readPath}`); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: 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); + await audioRen.getStreamInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer getStreamInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: getStreamInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: 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); + await audioRen.getRendererInfo().then((audioParamsGet) => { + console.info(`${TagFrmwkRender}: Renderer RendererInfo: ${JSON.stringify(audioParamsGet)}`); }).catch((err) => { - console.log('AudioFrameworkRenderLog: RendererInfo :ERROR: ' + err.message); + console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); resultFlag = false; }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); let bufferSize = await audioRen.getBufferSize(); - console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); + console.info(`${TagFrmwkRender}: buffer size: ${bufferSize}`); let ss = fileio.fdopenStreamSync(fdRead, 'r'); - console.info('AudioFrameworkRenderLog:case 2:AudioFrameworkRenderLog: File Path: ' + ss); + console.info(`${TagFrmwkRender}:case 2:AudioFrameworkRenderLog: File Path: ${ss}`); let discardHeader = new ArrayBuffer(44); ss.readSync(discardHeader); let totalSize = fileio.fstatSync(fdRead).size; - console.info('AudioFrameworkRenderLog:case 3 : AudioFrameworkRenderLog: File totalSize size: ' + totalSize); + console.info(`${TagFrmwkRender}:case 3 : AudioFrameworkRenderLog: File totalSize size: ${totalSize}`); totalSize = totalSize - 44; - console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); + console.info(`${TagFrmwkRender}: File size : Removing header: ${totalSize}`); let rlen = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); - console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); + console.info(`${TagFrmwkRender}: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); + await AUDIOMANAGER.getAudioScene().then((data) =>{ + console.info(`${TagFrmwkAudioScene}: getAudioScene : Value : ${data}`); }).catch((err) => { - console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getAudioScene : ERROR : ${err.message}`); resultFlag = false; }); } } - console.info('AudioFrameworkRenderLog: Renderer after read'); - await audioRen.getRenderRate().then(async function (data) { + console.info(`${TagFrmwkRender}: Renderer after read`); + await audioRen.getRenderRate().then((data) => { if (data == audio.AudioRendererRate.RENDER_RATE_NORMAL) { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_NORMAL : PASS : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : PASS : ${data}`); } else { - console.info('AudioFrameworkRenderLog: getRenderRate : RENDER_RATE_NORMAL : FAIL : ' + data); + console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : FAIL : ${data}`); resultFlag = false; } }).catch((err) => { - console.info('AudioFrameworkAudioScene: getRenderRate : RENDER_RATE_NORMAL : ERROR : ' + err.message); + console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_NORMAL : ERROR : ${err.message}`); resultFlag = false; }); - await audioRen.drain().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + await audioRen.drain().then(() => { + console.info(`${TagFrmwkRender}: Renderer drained : SUCCESS`); }).catch((err) => { - console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + console.error(`${TagFrmwkRender}: Renderer drain: ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); await sleep(500) @@ -6623,12 +6459,11 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-1C-32000-1SW.wav' await getFdRead(readPath, done); let resultFlag = await playbackPromise_113(AudioRendererOptions, filePath); await sleep(100) - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); expect(resultFlag).assertTrue(); await closeFileDescriptor(readPath); done(); @@ -6662,22 +6497,20 @@ describe('audioRenderer', function () { rendererInfo: AudioRendererInfo } - //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; - readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); let resultFlag = true; - console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + readPath); + console.info(`${TagFrmwkRender}: AudioRenderer : Path : ${readPath}`); - console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); + console.info(`${TagFrmwkRender}: Promise : Audio Playback Function`); let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -6687,7 +6520,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -6695,28 +6528,28 @@ describe('audioRenderer', function () { return; } - await audioRen.getAudioTime().then(async function (data) { - console.info('AudioFrameworkRenderLog: getAudioTime : Value : ' + data); + await audioRen.getAudioTime().then((data) => { + console.info(`${TagFrmwkRender}: getAudioTime : Value : ${data}`); resultFlag = true; if (data > 0) { - console.info('AudioFrameworkRenderLog: getAudioTime : PASS : ' + data); + console.info(`${TagFrmwkRender}: getAudioTime : PASS : ${data}`); } else { - console.info('AudioFrameworkRenderLog: getAudioTime : FAIL : ' + data); + console.info(`${TagFrmwkRender}: getAudioTime : FAIL : ${data}`); } }).catch((err) => { - console.info('AudioFrameworkRenderLog: getAudioTime : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: getAudioTime : ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); - console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); + console.info(`${TagFrmwkRender}: AudioRenderer : STATE : ${audioRen.state}`); - console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); + console.info(`${TagFrmwkRender}: resultFlag : ${resultFlag}`); await sleep(500); @@ -6757,11 +6590,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -6771,7 +6604,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -6781,23 +6614,23 @@ describe('audioRenderer', function () { audioRen.on('stateChange', (AudioState) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: Volume Change Event is called`); switch (AudioState) { - case audio.AudioState.STATE_PREPARED: - console.info('AudioFrameworkTest: state : STATE_NEW'); + case audio.AudioState.STATE_RELEASED: + console.info(`${TagFrmwk}: state : STATE_NEW`); resultFlag = true; break; default: - console.info('AudioFrameworkTest: state : ' + AudioState); + console.info(`${TagFrmwk}: state : ${AudioState}`); break; } }); - - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await sleep(1000); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(1000); expect(resultFlag).assertTrue(); @@ -6836,11 +6669,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -6850,7 +6683,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -6860,38 +6693,38 @@ describe('audioRenderer', function () { audioRen.on('stateChange', (AudioState) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: Volume Change Event is called`); switch (AudioState) { case audio.AudioState.STATE_RUNNING: - console.info('AudioFrameworkTest: state : STATE_RUNNING'); + console.info(`${TagFrmwk}: state : STATE_RUNNING`); resultFlag = true; break; default: - console.info('AudioFrameworkTest: state : ' + AudioState); + console.info(`${TagFrmwk}: state : ${AudioState}`); break; } }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(1000); @@ -6931,11 +6764,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -6945,7 +6778,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -6955,40 +6788,40 @@ describe('audioRenderer', function () { audioRen.on('stateChange', (AudioState) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: Volume Change Event is called`); switch (AudioState) { case audio.AudioState.STATE_STOPPED: - console.info('AudioFrameworkTest: state : STATE_STOPPED'); + console.info(`${TagFrmwk}: state : STATE_STOPPED`); resultFlag = true; break; default: - console.info('AudioFrameworkTest: state : ' + AudioState); + console.info(`${TagFrmwk}: state : ${AudioState}`); break; } }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(500); @@ -7028,11 +6861,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -7042,7 +6875,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -7052,40 +6885,40 @@ describe('audioRenderer', function () { audioRen.on('stateChange', (AudioState) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: Volume Change Event is called`); switch (AudioState) { case audio.AudioState.STATE_RELEASED: - console.info('AudioFrameworkTest: state : STATE_RELEASED'); + console.info(`${TagFrmwk}: state : STATE_RELEASED`); resultFlag = true; break; default: - console.info('AudioFrameworkTest: state : ' + AudioState); + console.info(`${TagFrmwk}: state : ${AudioState}`); break; } }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(500); @@ -7125,11 +6958,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -7139,7 +6972,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -7148,46 +6981,46 @@ describe('audioRenderer', function () { } audioRen.on('stateChange', (AudioState) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: Volume Change Event is called`); switch (AudioState) { case audio.AudioState.STATE_PAUSED: - console.info('AudioFrameworkTest: state : STATE_PAUSED'); + console.info(`${TagFrmwk}: state : STATE_PAUSED`); resultFlag = true; break; default: - console.info('AudioFrameworkTest: state : ' + AudioState); + console.info(`${TagFrmwk}: state : ${AudioState}`); break; } }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.pause().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant Pause :SUCCESS '); + await audioRen.pause().then(() => { + console.info(`${TagFrmwkRender}: renderInstant Pause :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant Pause :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant Pause :ERROR : ${err.message}`); resultFlag = false; }); await sleep(500); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); await sleep(500); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(500) @@ -7283,11 +7116,11 @@ describe('audioRenderer', function () { let audioRen; let isPass = false; - await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { + await audio.createAudioRenderer(AudioRendererOptions).then((data) => { audioRen = data; - console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); + console.info(`${TagFrmwkRender}: AudioRender Created : Success : Stream Type: SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: AudioRender Created : ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: AudioRender Created : ERROR : ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE; let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat; @@ -7297,7 +7130,7 @@ describe('audioRenderer', function () { } resultFlag = false; }); - console.log("isPass:" + isPass); + console.log(`isPass: ${isPass}`); if (isPass) { resultFlag = true; expect(resultFlag).assertTrue(); @@ -7306,22 +7139,22 @@ describe('audioRenderer', function () { } audioRen.on('stateChange', (AudioState) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); + console.log(`${TagFrmwk}: Volume Change Event is called`); switch (AudioState) { case audio.AudioState.STATE_PAUSED: - console.info('AudioFrameworkTest: state : STATE_PAUSED'); + console.info(`${TagFrmwk}: state : STATE_PAUSED`); resultFlag = true; break; default: - console.info('AudioFrameworkTest: state : ' + AudioState); + console.info(`${TagFrmwk}: state : ${AudioState}`); break; } }); - await audioRen.start().then(async function () { - console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); + await audioRen.start().then(() => { + console.info(`${TagFrmwkRender}: renderInstant started :SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant start :ERROR : ${err.message}`); resultFlag = false; }); @@ -7329,26 +7162,26 @@ describe('audioRenderer', function () { audioRen.pause((err) => { if (err) { - console.info('AudioFrameworkRenderLog: renderInstant Pause :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: renderInstant Pause :ERROR : ${err.message}`); resultFlag = false; } else { - console.info('AudioFrameworkRenderLog: renderInstant Pause :SUCCESS '); + console.info(`${TagFrmwkRender}: renderInstant Pause :SUCCESS`); } }); await sleep(500); - await audioRen.stop().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer stopped : SUCCESS'); + await audioRen.stop().then(() => { + console.info(`${TagFrmwkRender}: Renderer stopped : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer stop:ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer stop:ERROR : ${err.message}`); }); await sleep(500); - await audioRen.release().then(async function () { - console.info('AudioFrameworkRenderLog: Renderer release : SUCCESS'); + await audioRen.release().then(() => { + console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`); }).catch((err) => { - console.info('AudioFrameworkRenderLog: Renderer release :ERROR : ' + err.message); + console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`); }); await sleep(500) @@ -7400,12 +7233,12 @@ describe('audioRenderer', function () { let mode = audio.InterruptMode.SHARE_MODE; audioRenderer.setInterruptMode(mode, (err, data) => { if (err) { - console.info(`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`); + console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`); expect(false).assertTrue(); done(); return; } - console.info(`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`); + console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`); expect(true).assertTrue(); done(); }) @@ -7437,12 +7270,12 @@ describe('audioRenderer', function () { let mode = audio.InterruptMode.INDEPENDENT_MODE; audioRenderer.setInterruptMode(mode, (err, data) => { if (err) { - console.info(`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE CALLBACK: error: ${err.message}`); + console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: error: ${err.message}`); expect(false).assertTrue(); done(); return; } - console.info(`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS`); + console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS`); expect(true).assertTrue(); done(); }) @@ -7473,11 +7306,11 @@ describe('audioRenderer', function () { let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let mode = audio.InterruptMode.SHARE_MODE; audioRenderer.setInterruptMode(mode).then(data => { - console.info(`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE PROMISE: SUCCESS`); + console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE PROMISE: SUCCESS`); expect(true).assertTrue(); done(); }).catch(err => { - console.info(`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE PROMISE: error: ${err.message}`); + console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE PROMISE: error: ${err.message}`); expect(false).assertTrue(); done(); }) @@ -7508,11 +7341,11 @@ describe('audioRenderer', function () { let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let mode = audio.InterruptMode.INDEPENDENT_MODE; audioRenderer.setInterruptMode(mode).then(data => { - console.info(`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE PROMISE: SUCCESS`); + console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: SUCCESS`); expect(true).assertTrue(); done(); }).catch(err => { - console.info(`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE PROMISE: error: ${err.message}`); + console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: error: ${err.message}`); expect(false).assertTrue(); done(); }) @@ -7544,11 +7377,11 @@ describe('audioRenderer', function () { let mode = '1'; try { let data = await audioRenderer.setInterruptMode(mode); - console.info(`AudioFrameworkRenderLog: SetInterruptMode STRING PROMISE: SUCCESS`); + console.info(`${TagFrmwkRender}: SetInterruptMode STRING PROMISE: SUCCESS`); expect(false).assertTrue(); done(); } catch (err) { - console.info(`AudioFrameworkRenderLog: SetInterruptMode STRING PROMISE: error: ${err.message}`); + console.info(`${TagFrmwkRender}: SetInterruptMode STRING PROMISE: error: ${err.message}`); expect(true).assertTrue(); done(); } @@ -7580,11 +7413,11 @@ describe('audioRenderer', function () { let mode = 2; try { let data = await audioRenderer.setInterruptMode(mode); - console.info(`AudioFrameworkRenderLog: SetInterruptMode OUT OF BORDER PROMISE: SUCCESS`); + console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: SUCCESS`); expect(true).assertTrue(); done(); } catch (err) { - console.info(`AudioFrameworkRenderLog: SetInterruptMode OUT OF BORDER PROMISE: ERROR: ${err.message}`); + console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: ERROR: ${err.message}`); expect(false).assertTrue(); done(); } -- GitLab