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 ad76e4642c9897e71222af5b6609e7d88456f524..ff7dbca64500a80af2a34dee2fa9852e2f0021ab 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 @@ -5544,4 +5544,18 @@ describe('audioManager', function () { await sleep(50); done(); }) + + /* * + * @tc.number : SUB_AUDIO_SAMPLE_FORMAT_F32LE_001 + * @tc.name : SAMPLE_FORMAT_F32LE + * @tc.desc : SAMPLE_FORMAT_F32LE + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('SUB_AUDIO_SAMPLE_FORMAT_F32LE_001', 0, async function (done) { + expect(audio.AudioSampleFormat.SAMPLE_FORMAT_F32LE).assertEqual(4); + await sleep(50); + done(); + }) }) \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js index 736a03a96791ca022d0996e229e3a7ec7908f592..e688a04ec07f2ff2dbf1a7991889443017e78afe 100644 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js @@ -7377,13 +7377,13 @@ describe('audioRenderer', function () { done(); }) - /* - * @tc.name:SetInterruptMode_001 - * @tc.desc:SetInterruptMode mode 0 callback,is public share mode - * @tc.type: FUNC - * @tc.require: Issue Number - */ - it("SetInterruptMode_001", 0,async function (done) { + /* + * @tc.name:SUB_AUDIO_SetInterruptMode_001 + * @tc.desc:SetInterruptMode mode 0 callback,is public share mode + * @tc.type: FUNC + * @tc.require: Issue Number + */ + it("SUB_AUDIO_SetInterruptMode_001", 0, async function (done) { var audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, @@ -7400,24 +7400,25 @@ describe('audioRenderer', function () { rendererInfo: audioRendererInfo } let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); - let mode = 0; - audioRenderer.setInterruptMode(mode,(err,data)=>{ - if(err){ - expect(true).assertEqual(false); - return done(); + let mode = audio.InterruptMode.SHARE_MODE; + audioRenderer.setInterruptMode(mode, (err, data) => { + if (err) { + expect(false).assertTrue(); + done(); + return; } - expect(true).assertEqual(true); + expect(true).assertTrue(); done(); }) }) /* - * @tc.name:SetInterruptMode_002 + * @tc.name:SUB_AUDIO_SetInterruptMode_002 * @tc.desc:SetInterruptMode mode 1 callback,is independent mode * @tc.type: FUNC * @tc.require: Issue Number */ - it("SetInterruptMode_002", 0,async function (done) { + it("SUB_AUDIO_SetInterruptMode_002", 0, async function (done) { var audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, @@ -7434,24 +7435,25 @@ describe('audioRenderer', function () { rendererInfo: audioRendererInfo } let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); - let mode = 1; - audioRenderer.setInterruptMode(mode,(err,data)=>{ - if(err){ - expect(true).assertEqual(false); - return done(); + let mode = audio.InterruptMode.INDEPENDENT_MODE; + audioRenderer.setInterruptMode(mode, (err, data) => { + if (err) { + expect(false).assertTrue(); + done(); + return; } - expect(true).assertEqual(true); + expect(true).assertTrue(); done(); }) }) /* - * @tc.name:SetInterruptMode_003 + * @tc.name:SUB_AUDIO_SetInterruptMode_003 * @tc.desc:SetInterruptMode mode 0 promise,is public share mode * @tc.type: FUNC * @tc.require: Issue Number */ - it("SetInterruptMode_003", 0,async function (done) { + it("SUB_AUDIO_SetInterruptMode_003", 0, async function (done) { var audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, @@ -7468,23 +7470,23 @@ describe('audioRenderer', function () { rendererInfo: audioRendererInfo } let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); - let mode = 0; - audioRenderer.setInterruptMode(mode).then(data=>{ - expect(true).assertEqual(true); + let mode = audio.InterruptMode.SHARE_MODE; + audioRenderer.setInterruptMode(mode).then(data => { + expect(true).assertTrue(); done(); - }).catch(err=>{ - expect(true).assertEqual(false); + }).catch(err => { + expect(false).assertTrue(); done(); }) }) /* - * @tc.name:SetInterruptMode_004 + * @tc.name:SUB_AUDIO_SetInterruptMode_004 * @tc.desc:SetInterruptMode mode 1 promise,is independent mode * @tc.type: FUNC * @tc.require: Issue Number */ - it("SetInterruptMode_004", 0,async function (done) { + it("SUB_AUDIO_SetInterruptMode_004", 0, async function (done) { var audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, @@ -7501,23 +7503,23 @@ describe('audioRenderer', function () { rendererInfo: audioRendererInfo } let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); - let mode = 1; - audioRenderer.setInterruptMode(mode).then(data=>{ - expect(true).assertEqual(true); + let mode = audio.InterruptMode.INDEPENDENT_MODE; + audioRenderer.setInterruptMode(mode).then(data => { + expect(true).assertTrue(); done(); - }).catch(err=>{ - expect(true).assertEqual(false); + }).catch(err => { + expect(false).assertTrue(); done(); }) }) /* - * @tc.name:SetInterruptMode_005 + * @tc.name:SUB_AUDIO_SetInterruptMode_005 * @tc.desc:SetInterruptMode mode '1',will catch error with type error * @tc.type: FUNC * @tc.require: Issue Number */ - it("SetInterruptMode_005", 0,async function (done) { + it("SUB_AUDIO_SetInterruptMode_005", 0, async function (done) { var audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, @@ -7535,23 +7537,23 @@ describe('audioRenderer', function () { } let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let mode = '1'; - try{ + try { let data = await audioRenderer.setInterruptMode(mode); - expect(false).assertEqual(false); + expect(false).assertTrue(); done(); - }catch(err){ + } catch (err) { expect('assertion (false) failed: type mismatch').assertEqual(err.message); done(); } }) /* - * @tc.name:SetInterruptMode_006 + * @tc.name:SUB_AUDIO_SetInterruptMode_006 * @tc.desc:SetInterruptMode mode 2,will catch error with out of border * @tc.type: FUNC * @tc.require: Issue Number */ - it("SetInterruptMode_006", 0,async function (done) { + it("SUB_AUDIO_SetInterruptMode_006", 0, async function (done) { var audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, @@ -7569,11 +7571,11 @@ describe('audioRenderer', function () { } let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let mode = 2; - try{ + try { let data = await audioRenderer.setInterruptMode(mode) - expect(true).assertEqual(true); + expect(false).assertTrue(); done(); - }catch(err){ + } catch (err) { expect(err).assertEqual(undefined); done(); }