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 9349ed754ef95e1bd0e22a5f9d0cc0b8ef32dff2..20d42d14f222c1e34895f96f530f16ac914bb034 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 @@ -5112,231 +5112,6 @@ describe('audioFramework', function () { done(); }) - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800 - *@tc.name : getDevices - INPUT device - Promise - ENAME - *@tc.desc : getDevices - INPUT device - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800', 2, function (done) { - audioManager.getRoutingManager(async (err, AudioRoutingManager) => { - if (err) { - 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(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`); - value.forEach(displayDeviceProp); - - if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && - cMask != null) { - console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`); - expect(true).assertTrue(); - } else { - console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`); - expect(false).assertTrue(); - } - } - done(); - }); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900 - *@tc.name : getDevices - ALL device - Promise - ENAME - *@tc.desc : getDevices - ALL device - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900', 2, function (done) { - audioManager.getRoutingManager(async (err, AudioRoutingManager) => { - if (err) { - 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(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`); - value.forEach(displayDeviceProp); - - if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && - cMask != null) { - console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`); - expect(true).assertTrue(); - } - else { - console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`); - expect(false).assertTrue(); - } - } - done(); - }); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100 - *@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100 - *@tc.desc : micStateChange - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100', 2, async function (done) { - try { - var routingManager = await audioManager.getRoutingManager(); - } catch (err) { - console.error(`${TagFrmwk}:Callback:failed to get RoutingManager ${err.message}`); - expect(false).assertTrue(); - } - let count = 0; - console.info('getRoutingManager Callback START.'); - routingManager.on('micStateChange', async (micStateChange) => { - - console.info('micStateChange is '+micStateChange.mute); - count++; - }) - - try { - let data = await audioManager.isMicrophoneMute(); - console.info('Promise isMicrophoneMute PASS:' + data); - await audioManager.setMicrophoneMute(data); - console.info('Promise setMicrophoneMute PASS.'); - let data1 = await audioManager.isMicrophoneMute(); - console.info('Promise isMicrophoneMute PASS.' + data1); - } catch (err) { - console.log('ERROR:' + JSON.stringify(err)) - expect(false).assertTrue(); - done(); - } - await sleep(2000); - expect(count).assertEqual(0); - done(); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200 - *@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200 - *@tc.desc : micStateChange - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200', 2, async function (done) { - try { - var routingManager = await audioManager.getRoutingManager(); - } catch (err) { - console.error(`${TagFrmwk}:Callback:failed to get RoutingManager ${err.message}`); - expect(false).assertTrue(); - } - console.info('getRoutingManager Callback START.'); - let count = 0; - routingManager.on('micStateChange', async (micStateChange) => { - console.info("Updated micState:" + JSON.stringify(micStateChange)); - count++; - }) - - try { - let data = await audioManager.isMicrophoneMute(); - console.info('Promise isMicrophoneMute PASS:' + data); - let micStatus = !data; - await audioManager.setMicrophoneMute(micStatus); - console.info('Promise setMicrophoneMute PASS:' + micStatus); - } catch (err) { - console.log('ERROR:' + JSON.stringify(err)) - expect(false).assertTrue(); - done(); - } - await sleep(2000); - expect(count).assertEqual(1); - done(); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300 - *@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300 - *@tc.desc : micStateChange - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300', 2, async function (done) { - try { - var routingManager = await audioManager.getRoutingManager(); - } catch (err) { - console.error(`${TagFrmwk}:Callback:failed to get RoutingManager ${err.message}`); - expect(false).assertTrue(); - } - console.info('getRoutingManager Callback START.'); - let count = 0; - routingManager.on('micStateChange', async (micStateChange) => { - console.info("Updated micState:" + JSON.stringify(micStateChange)); - count++; - }) - - try { - let data = await audioManager.isMicrophoneMute(); - console.info('Promise isMicrophoneMute PASS:' + data); - let micStatus = !data; - await audioManager.setMicrophoneMute(micStatus); - console.info('Promise setMicrophoneMute PASS:' + micStatus); - await audioManager.setMicrophoneMute(!micStatus); - console.info('Promise setMicrophoneMute PASS:' + (!micStatus)); - } catch (err) { - console.log('ERROR:' + JSON.stringify(err)) - expect(false).assertTrue(); - done(); - } - await sleep(2000); - expect(count).assertEqual(2); - done(); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400 - *@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400 - *@tc.desc : micStateChange - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400', 2, async function (done) { - try { - var routingManager = await audioManager.getRoutingManager(); - } catch (err) { - console.error(`${TagFrmwk}:Callback:failed to get RoutingManager ${err.message}`); - expect(false).assertTrue(); - } - let count = 0; - try { - console.info("enter SUB_AUDIO_MANAGER_micStateChange_004"); - routingManager.on('micStateChange', async (micStateChange1) => { - console.info("Updated micState--001:" + JSON.stringify(micStateChange1)); - routingManager.on('micStateChange', async (micStateChange) => { - console.info("Updated micState--002:" + JSON.stringify(micStateChange)); - count++ - }) - let data = await audioManager.isMicrophoneMute(); - console.info('Second Promise isMicrophoneMute PASS:' + data); - await audioManager.setMicrophoneMute(!data); - console.info('Second:Promise setMicrophoneMute PASS:' + (!data)); - }) - let data = await audioManager.isMicrophoneMute(); - console.info('First Promise isMicrophoneMute PASS:' + data); - await audioManager.setMicrophoneMute(!data); - console.info('First:Promise setMicrophoneMute PASS:' + (!data)); - } catch (err) { - console.log('ERROR:' + JSON.stringify(err)) - expect(false).assertTrue(); - done(); - } - - await sleep(2000); - expect(count).assertEqual(1); - done(); - }) - /** *@tc.number : SUB_MULTIMEDIA_AUDIO_DEVICEFALG_0100 *@tc.name : NONE_DEVICES_FLAG