提交 3a52a96a 编写于 作者: O openharmony_ci 提交者: Gitee

!524 Updating Audio Standard JS Test scripts

Merge pull request !524 from GaganP/audioframework_Master_06SEP
......@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http:// www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
......@@ -17,9 +17,8 @@ import audio from '@ohos.multimedia.audio';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
describe('AudioFramework.test.js', async function () {
describe('audioManger', function () {
console.info('AudioFrameworkTest: Create AudioManger Object JS Framework');
const audioManager = audio.getAudioManager();
var deviceRoleValue = null;
var deviceTypeValue = null;
......@@ -31,26 +30,101 @@ describe('AudioFramework.test.js', async function () {
var lowVol = 5;
var highVol = 14;
var outOfRangeVol = 28;
var longValue = '28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843';
beforeAll(function () {
console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level, which are executed before the test suite is executed.');
console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level');
})
beforeEach(function () {
console.info('AudioFrameworkTest: beforeEach:Prerequisites at the test case level, which are executed before each test case is executed.');
console.info('AudioFrameworkTest: beforeEach: Prerequisites at the test case level');
})
afterEach(function () {
console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions, which are executed after each test case is executed.');
afterEach(function () {
console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions');
})
afterAll(function () {
console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition, which is executed after the test suite is executed');
afterAll(function () {
console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition');
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioManger_001
* @tc.name : getAudioManger is Not returned Empty
* @tc.desc : Check getAudioManger is not empty
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioManger_001', 0, function (done) {
if(audioManager!=null){
console.info('AudioFrameworkTest: getAudioManger : PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: getAudioManger : FAIL');
expect(false).assertTrue();
}
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioManger_002
* @tc.name : getAudioManger - Multiple instance
* @tc.desc : multiple times with different instance
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioManger_002', 0, async function (done) {
const audioManager1 = audio.getAudioManager();
const audioManager2 = audio.getAudioManager();
const audioManager3 = audio.getAudioManager();
const audioManager4 = audio.getAudioManager();
const audioManager5 = audio.getAudioManager();
const audioManager6 = audio.getAudioManager();
const audioManager7 = audio.getAudioManager();
const audioManager8 = audio.getAudioManager();
const audioManager9 = audio.getAudioManager();
const audioManager10 = audio.getAudioManager();
const promise = audioManager.setVolume(audioMedia,lowVol);
promise.then(async function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager1.setVolume(audioMedia,highVol);
console.info('AudioFrameworkTest:audioManager1 : Media setVolume promise: successful');
audioManager2.setVolume(audioMedia,highVol);
console.info('AudioFrameworkTest:audioManager2 : Media setVolume promise: successful');
audioManager3.setVolume(audioMedia,highVol);
console.info('AudioFrameworkTest:audioManager3 : Media setVolume promise: successful');
audioManager4.setVolume(audioMedia,lowVol);
console.info('AudioFrameworkTest:audioManager4 : Media setVolume promise: successful');
audioManager5.setVolume(audioMedia,highVol);
console.info('AudioFrameworkTest:audioManager5 : Media setVolume promise: successful');
audioManager6.setVolume(audioMedia,lowVol);
console.info('AudioFrameworkTest:audioManager6 : Media setVolume promise: successful');
audioManager7.setVolume(audioMedia,highVol);
console.info('AudioFrameworkTest:audioManager7 : Media setVolume promise: successful');
audioManager8.setVolume(audioMedia,lowVol);
console.info('AudioFrameworkTest:audioManager8 : Media setVolume promise: successful');
audioManager9.setVolume(audioMedia,highVol);
console.info('AudioFrameworkTest:audioManager9 : Media setVolume promise: successful');
audioManager10.setVolume(audioMedia,lowVol);
console.info('AudioFrameworkTest:audioManager10 : Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(async function (data) {
if(data == lowVol){
console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_001
* @tc.name : setVolume - Media - Promise
......@@ -61,7 +135,7 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_SetVolume_001', 0, async function (done) {
const promise = audioManager.setVolume(audioMedia,lowVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(async function (data) {
if(data == lowVol){
......@@ -72,12 +146,12 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
});
await promise;
done();
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_002
* @tc.name : setVolume - Media - Promise - MAX Volume
......@@ -87,11 +161,9 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_002', 0, async function (done) {
const promise = audioManager.setVolume(audioMedia,maxVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(async function (data) {
if(data == maxVol){
console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data);
......@@ -101,13 +173,12 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
});
await promise;
done();
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_003
* @tc.name : setVolume - Media - Promise - Mute Volume
......@@ -117,9 +188,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_003', 0, async function (done) {
const promise = audioManager.setVolume(audioMedia,minVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(async function (data) {
......@@ -131,13 +201,12 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_004
* @tc.name : setVolume - Media - Promise - Out of range Volume
......@@ -148,8 +217,8 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_SetVolume_004', 0, async function (done) {
console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: Setvol 100');
await audioManager.setVolume(audioMedia,outOfRangeVol).then((data) => {
console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: FAIL :' + data);
await audioManager.setVolume(audioMedia,outOfRangeVol).then(() => {
console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: FAIL');
expect(false).assertTrue();
}).catch((err) => {
console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: PASS :' + err.message);
......@@ -157,6 +226,7 @@ describe('AudioFramework.test.js', async function () {
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_005
* @tc.name : setVolume - Media - Callback
......@@ -166,32 +236,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_005', 0, async function (done) {
audioManager.setVolume(audioMedia,highVol, (err, value) => {
audioManager.setVolume(audioMedia,highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : Media setVolume successful `);
audioManager.getVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else
{
console.info(`AudioFrameworkTest: callback : Media setVolume successful `);
audioManager.getVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_006
* @tc.name : setVolume - Media - Callback - MAX Volume
......@@ -201,32 +273,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_006', 0, async function (done) {
audioManager.setVolume(audioMedia,maxVol, (err, value) => {
audioManager.setVolume(audioMedia,maxVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : Media setVolume successful `);
audioManager.getVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == maxVol){
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else
{
console.info(`AudioFrameworkTest: callback : Media setVolume successful `);
audioManager.getVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == maxVol){
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_007
* @tc.name : setVolume - Media - Callback - Mute Volume
......@@ -236,32 +310,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_007', 0, async function (done) {
audioManager.setVolume(audioMedia,minVol, (err, value) => {
audioManager.setVolume(audioMedia,minVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : Media setVolume successful `);
audioManager.getVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == minVol){
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else
{
console.info(`AudioFrameworkTest: callback : Media setVolume successful `);
audioManager.getVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == minVol){
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_008
* @tc.name : setVolume - Media - Callback - Out of range Volume
......@@ -271,20 +347,19 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_008', 0, async function (done) {
audioManager.setVolume(audioMedia,outOfRangeVol, (err, value) => {
audioManager.setVolume(audioMedia,outOfRangeVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: setVolume: Out of range: Callback: PASS: ${err.message}`);
expect(volErrorMesg).assertEqual(err.message);
}
else{
console.info('AudioFrameworkTest: setVolume: callback : Media Out of range: FAIL :' + value);
console.info('AudioFrameworkTest: setVolume: callback : Media Out of range: FAIL');
expect(false).assertTrue();
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_009
* @tc.name : setVolume - Ringtone - Promise
......@@ -295,7 +370,7 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_SetVolume_009', 0, async function (done) {
const promise = audioManager.setVolume(audioRingtone,lowVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: successful');
audioManager.getVolume(audioRingtone).then(async function (data) {
if(data == lowVol){
......@@ -306,12 +381,12 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
});
await promise;
done();
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_010
* @tc.name : setVolume - Ringtone - Promise - MAX Volume
......@@ -321,9 +396,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_010', 0, async function (done) {
const promise = audioManager.setVolume(audioRingtone,maxVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: successful');
audioManager.getVolume(audioRingtone).then(async function (data) {
if(data == maxVol){
......@@ -334,12 +408,12 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
});
await promise;
done();
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_011
* @tc.name : setVolume - Ringtone - Promise - Mute Volume
......@@ -349,9 +423,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_011', 0, async function (done) {
const promise = audioManager.setVolume(audioRingtone,minVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: successful');
audioManager.getVolume(audioRingtone).then(async function (data) {
if(data == minVol){
......@@ -367,6 +440,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_012
* @tc.name : setVolume - Ringtone - Promise - Out of range Volume
......@@ -377,8 +451,8 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_SetVolume_012', 0, async function (done) {
console.info('AudioFrameworkTest: Ringtone setVolume Promise: Out of range: Setvol 30');
await audioManager.setVolume(audioRingtone,outOfRangeVol).then((data) => {
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: FAIL :' + data);
await audioManager.setVolume(audioRingtone,outOfRangeVol).then(() => {
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: FAIL');
expect(false).assertTrue();
}).catch((err) => {
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: PASS :' + (err.message));
......@@ -386,7 +460,7 @@ describe('AudioFramework.test.js', async function () {
});
done();
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_013
* @tc.name : setVolume - Ringtone - Callback
......@@ -396,32 +470,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_013', 0, async function (done) {
audioManager.setVolume(audioRingtone,highVol, (err, value) => {
audioManager.setVolume(audioRingtone,highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `);
audioManager.getVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else{
console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `);
audioManager.getVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_014
* @tc.name : setVolume - Ringtone - Callback - MAX Volume
......@@ -431,32 +506,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_014', 0, async function (done) {
audioManager.setVolume(audioRingtone,maxVol, (err, value) => {
audioManager.setVolume(audioRingtone,maxVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `);
audioManager.getVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == maxVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else{
console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `);
audioManager.getVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == maxVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_015
* @tc.name : setVolume - Ringtone - Callback - Mute Volume
......@@ -466,32 +543,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_015', 0, async function (done) {
audioManager.setVolume(audioRingtone,minVol, (err, value) => {
audioManager.setVolume(audioRingtone,minVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `);
audioManager.getVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == minVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else{
console.info(`AudioFrameworkTest: callback : Ringtone setVolume successful `);
audioManager.getVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == minVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_016
* @tc.name : setVolume - Ringtone - Callback - Out of range Volume
......@@ -501,19 +579,19 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_016', 0, async function (done) {
audioManager.setVolume(audioRingtone,outOfRangeVol, (err, value) => {
audioManager.setVolume(audioRingtone,outOfRangeVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Out of range Volume: Callback: ${err.message}`);
expect(volErrorMesg).assertEqual(err.message);
}
else{
console.info('AudioFrameworkTest: Out of range Volume: callback : Ringtone set volume: FAIL :' + value);
console.info('AudioFrameworkTest: Out of range Volume: callback : Ringtone set volume: FAIL');
expect(false).assertTrue();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_017
* @tc.name : setVolume - Media - Promise - Negative Value
......@@ -524,16 +602,18 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_SetVolume_017', 0, async function (done) {
console.info('AudioFrameworkTest: Media setVolume promise: Negative Value -1');
await audioManager.setVolume(audioMedia,-1).then((data) => { //Setting negative audio volume for error senario
console.info('AudioFrameworkTest: Media setVolume Promise:Negetive: FAIL :' + data);
await audioManager.setVolume(audioMedia,-1).then(() => {
// Setting negative audio volume for error Scenario
console.info('AudioFrameworkTest: Media setVolume Promise:Negative: FAIL');
expect(false).assertTrue();
}).catch((err) => {
console.info('AudioFrameworkTest: Media setVolume Promise:Negetive: PASS :' + (err.message));
expect(true).assertTrue();
console.info('AudioFrameworkTest: Media setVolume Promise:Negative: PASS : ' + (err.message));
expect(volErrorMesg).assertEqual(err.message);
});
done();
})
/* *
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_018
* @tc.name : setVolume - Media - Callback - Negative Value
* @tc.desc : Setvol to -1
......@@ -542,20 +622,21 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_018', 0, async function (done) {
audioManager.setVolume(audioMedia,-1, (err, value) => { //Setting negative audio volume for error senario
audioManager.setVolume(audioMedia,-1, (err) => {
// Setting negative audio volume for error Scenario
if (err) {
console.error(`AudioFrameworkTest: setVolume Callback: Negative: PASS: ${err.message}`);
expect(true).assertTrue();
expect(volErrorMesg).assertEqual(err.message);
}
else{
console.info('AudioFrameworkTest: setVolume callback : Media Negative: FAIL :' + value);
console.info('AudioFrameworkTest: setVolume callback : Media Negative: FAIL');
expect(false).assertTrue();
}
done();
});
})
/* *
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_019
* @tc.name : setVolume - Ringtone - Promise - Negative Value
* @tc.desc : Setvol to -1
......@@ -565,8 +646,9 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_SetVolume_019', 0, async function (done) {
console.info('AudioFrameworkTest: Ringtone setVolume promise: Negative');
await audioManager.setVolume(audioRingtone,-1).then((data) => { //Setting negative audio volume for error senario
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: FAIL :' + data);
await audioManager.setVolume(audioRingtone,-1).then(() => {
// Setting negative audio volume for error Scenario
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: FAIL');
expect(false).assertTrue();
}).catch((err) => {
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: PASS :' + (err.message));
......@@ -574,7 +656,8 @@ describe('AudioFramework.test.js', async function () {
});
done();
})
/* *
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_020
* @tc.name : setVolume - Ringtone - Callback - Negative Value
* @tc.desc : Setvol to -1
......@@ -583,19 +666,20 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_020', 0, async function (done) {
audioManager.setVolume(audioRingtone,-1, (err, value) => { //Setting negative audio volume for error senario
audioManager.setVolume(audioRingtone,-1, (err) => {
// Setting negative audio volume for error Scenario
if (err) {
console.error(`AudioFrameworkTest: setVolume: Negative: Callback: ${err.message}`);
expect(volErrorMesg).assertEqual(err.message);
}
else{
console.info('AudioFrameworkTest: setVolume: Negative: callback : Ringtone set volume: FAIL :' + value);
console.info('AudioFrameworkTest: setVolume: Negative: callback : Ringtone set volume: FAIL');
expect(false).assertTrue();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_021
* @tc.name : setVolume - Media - Promise - ENAME
......@@ -605,9 +689,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_021', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol);
promise.then(async function (data) {
promise.then(async function () {
audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(async function (data) {
if(data == lowVol){
console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data);
......@@ -617,12 +700,12 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_022
* @tc.name : setVolume - Media - Callback - ENAME
......@@ -632,32 +715,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_022', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err, value) => {
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME : ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `);
audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: ENAME : failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else{
console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `);
audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: ENAME : Error ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_023
* @tc.name : setVolume - Ringtone - Promise - ENAME
......@@ -667,11 +751,9 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_023', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful');
audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(async function (data) {
if(data == highVol){
console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data);
......@@ -686,6 +768,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_024
* @tc.name : setVolume - Ringtone - Callback - ENAME
......@@ -695,30 +778,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_024', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err, value) => {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `);
audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == lowVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else{
console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `);
audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone: ENAME: failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == lowVol){
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_025
* @tc.name : setVolume - Media - Promise - Change Ringtone vol
......@@ -728,9 +814,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_025', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol);
promise.then(async function (data) {
promise.then(async function () {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,maxVol);
audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(async function (data) {
if(data == lowVol){
......@@ -741,12 +826,12 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_026
* @tc.name : setVolume - Media - Callback - Change Ringtone vol
......@@ -756,32 +841,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_026', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err, value) => {
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME : ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `);
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol);
audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: ENAME : failed to get volume ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else{
console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `);
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol);
audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media: ENAME : Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value == highVol){
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_027
* @tc.name : setVolume - Ringtone - Promise - Change Media vol
......@@ -791,13 +878,12 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_027', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol);
promise.then(async function (data) {
promise.then(async function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful');
audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol);
audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(async function (data) {
if(data == 5){
if(data == highVol){
console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data);
expect(true).assertTrue();
}
......@@ -810,6 +896,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_SetVolume_028
* @tc.name : setVolume - Ringtone - Callback - Change Media vol
......@@ -819,32 +906,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_028', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err, value) => {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`);
expect(false).assertTrue();
}
console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `);
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol);
audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: 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);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
else{
console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `);
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol);
audioManager.getVolume(audio.AudioVolumeType.RINGTONE, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: 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);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_001
* @tc.name : getMaxVolume - Media - Promise
......@@ -854,7 +943,6 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_001', 0, async function (done) {
const promise = audioManager.getMaxVolume(audioMedia);
promise.then(async function (data) {
if (data==maxVol){
......@@ -869,6 +957,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_002
* @tc.name : getMaxVolume - Media - Callback
......@@ -878,11 +967,10 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_002', 0, async function (done) {
audioManager.getMaxVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`);
return;
expect(false).assertTrue();
}
else if (value=maxVol){
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value);
......@@ -893,8 +981,7 @@ describe('AudioFramework.test.js', async function () {
expect(false).assertTrue();
}
done();
});
});
})
/* *
......@@ -920,6 +1007,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_004
* @tc.name : getMaxVolume - Ringtone - Callback
......@@ -932,7 +1020,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMaxVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`);
return;
expect(false).assertTrue();
}
else if (value==maxVol){
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value);
......@@ -945,6 +1033,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_005
* @tc.name : getMaxVolume - Media - Promise - Change Ringtone Volume and check
......@@ -969,6 +1058,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_006
* @tc.name : getMaxVolume - Ringtone - Promise - Change Media Volume and check
......@@ -994,6 +1084,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_007
* @tc.name : getMaxVolume - Media - Callback- Change Ringtone Volume and check
......@@ -1007,7 +1098,8 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMaxVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`);
return;
expect(false).assertTrue();
}
else if (value=maxVol){
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value);
......@@ -1020,6 +1112,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_008
* @tc.name : getMaxVolume - Ringtone - Callback - Callback- Change media Volume and check
......@@ -1033,7 +1126,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMaxVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`);
return;
expect(false).assertTrue();
}
else if (value==maxVol){
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value);
......@@ -1046,6 +1139,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_009
* @tc.name : getMaxVolume - Media - Promise - Change media Volume and check
......@@ -1055,7 +1149,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_009', 0, async function (done) {
audioManager.setVolume(audioMedia,5);
audioManager.setVolume(audioMedia,lowVol);
const promise = audioManager.getMaxVolume(audioMedia);
promise.then(async function (data) {
if (data==maxVol){
......@@ -1070,6 +1164,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_010
* @tc.name : getMaxVolume - Ringtone - Promise - Change Ringtone Volume and check
......@@ -1090,11 +1185,11 @@ describe('AudioFramework.test.js', async function () {
console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_011
* @tc.name : getMaxVolume - Media - Callback- Change media Volume and check
......@@ -1108,7 +1203,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMaxVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`);
return;
expect(false).assertTrue();
}
else if (value=maxVol){
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value);
......@@ -1121,6 +1216,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMaxVolume_012
* @tc.name : getMaxVolume - Ringtone - Callback - Callback- Change ringtone Volume and check
......@@ -1134,7 +1230,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMaxVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`);
return;
expect(false).assertTrue();
}
else if (value==maxVol){
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value);
......@@ -1157,7 +1253,6 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_001', 0, async function (done) {
const promise = audioManager.getMinVolume(audioMedia);
promise.then(async function (data) {
if (data==minVol){
......@@ -1172,6 +1267,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_002
* @tc.name : getMinVolume - Media - Callback
......@@ -1181,11 +1277,10 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_002', 0, async function (done) {
audioManager.getMinVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`);
return;
expect().assertFail();
}
else if (value==minVol){
console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value);
......@@ -1198,6 +1293,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_003
* @tc.name : getMinVolume - Ringtone - Promise
......@@ -1207,7 +1303,6 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_003', 0, async function (done) {
const promise = audioManager.getMinVolume(audioRingtone);
promise.then(async function (data) {
if (data==minVol){
......@@ -1223,6 +1318,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_004
* @tc.name : getMinVolume - Ringtone - Callback
......@@ -1232,11 +1328,10 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_004', 0, async function (done) {
audioManager.getMinVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`);
return;
expect().assertFail();
}
else if (value==minVol){
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value);
......@@ -1249,6 +1344,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_005
* @tc.name : getMinVolume - Media - Promise - Change Ringtone Volume and check
......@@ -1273,6 +1369,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_006
* @tc.name : getMinVolume - Media - Callback - Change Ringtone Volume and check
......@@ -1286,7 +1383,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMinVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`);
return;
expect().assertFail();
}
else if (value==minVol){
console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value);
......@@ -1299,6 +1396,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_007
* @tc.name : getMinVolume - Ringtone - Promise - Change Media Volume and check
......@@ -1323,6 +1421,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_008
* @tc.name : getMinVolume - Ringtone - Callback - Change Media Volume and check
......@@ -1336,7 +1435,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMinVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`);
return;
expect().assertFail();
}
else if (value==minVol){
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value);
......@@ -1349,6 +1448,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_009
* @tc.name : getMinVolume - Media - Promise - Change Media Volume and check
......@@ -1373,6 +1473,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_010
* @tc.name : getMinVolume - Media - Callback - Change Media Volume and check
......@@ -1386,7 +1487,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMinVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`);
return;
expect().assertFail();
}
else if (value==minVol){
console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value);
......@@ -1399,6 +1500,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_011
* @tc.name : getMinVolume - Ringtone - Promise - Change Ringtone Volume and check
......@@ -1423,6 +1525,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getMinVolume_012
* @tc.name : getMinVolume - Ringtone - Callback - Change Ringtone Volume and check
......@@ -1436,7 +1539,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.getMinVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`);
return;
expect().assertFail();
}
else if (value==minVol){
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value);
......@@ -1449,6 +1552,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_001
* @tc.name : getDevices - Output device - Promise
......@@ -1458,12 +1562,11 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_001', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
const promise = audioManager.getDevices(1); //Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG
const promise = audioManager.getDevices(1);
// Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG
promise.then(async function (value) {
console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
......@@ -1478,6 +1581,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_002
* @tc.name : getDevices - Input device - Promise
......@@ -1487,14 +1591,11 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_002', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
const promise = audioManager.getDevices(2); //Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG
const promise = audioManager.getDevices(2);
// Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG
promise.then(async function (value) {
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
......@@ -1510,6 +1611,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_003
* @tc.name : getDevices - ALL device - Promise
......@@ -1519,14 +1621,12 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_003', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
const promise = audioManager.getDevices(3); //Getting all devies connected 3 = ALL_DEVICES_FLAG
const promise = audioManager.getDevices(3);
// Getting all devies connected 3 = ALL_DEVICES_FLAG
promise.then(async function (value) {
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
......@@ -1551,32 +1651,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_004', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(1, (err, value) => { //Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG
audioManager.getDevices(1, (err, value) => {
// Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
if (err) {
console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
return;
expect().assertFail();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_005
* @tc.name : getDevices - Input device - Callback
......@@ -1586,32 +1687,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_005', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(2, (err, value) => { //Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG
audioManager.getDevices(2, (err, value) => {
// Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
if (err) {
console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
return;
}
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
expect(true).assertTrue();
expect().assertFail();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_006
* @tc.name : getDevices - ALL device - Callback
......@@ -1621,32 +1724,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_006', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(3, (err, value) => { //Getting all devies connected 3 = ALL_DEVICES_FLAG
audioManager.getDevices(3, (err, value) => {
// Getting all devies connected 3 = ALL_DEVICES_FLAG
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
if (err) {
console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
return;
}
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
expect(true).assertTrue();
expect().assertFail();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_007
* @tc.name : getDevices - Output device - Promise - ENAME
......@@ -1656,7 +1761,6 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_007', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
const promise = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG)
......@@ -1676,6 +1780,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_008
* @tc.name : getDevices - Input device - Promise - ENAME
......@@ -1685,14 +1790,10 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_008', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
const promise = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG);
promise.then(async function (value) {
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
......@@ -1708,6 +1809,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_009
* @tc.name : getDevices - ALL device - Promise - ENAME
......@@ -1717,14 +1819,10 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_009', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
const promise = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG);
promise.then(async function (value) {
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
......@@ -1740,6 +1838,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_010
* @tc.name : getDevices - Output device - Callback - ENAME
......@@ -1749,32 +1848,30 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_010', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
if (err) {
console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
return;
}
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
expect().assertFail();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_011
* @tc.name : getDevices - Input device - Callback - ENAME
......@@ -1784,32 +1881,31 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_011', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
if (err) {
console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
return;
}
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
expect(true).assertTrue();
expect().assertFail();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getDevices_012
* @tc.name : getDevices - ALL device - Callback - ENAME
......@@ -1819,32 +1915,30 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getDevices_012', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
if (err) {
console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
return;
}
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
expect(true).assertTrue();
expect().assertFail();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_001
* @tc.name : setRingerMode - Normal Mode - Promise
......@@ -1854,9 +1948,9 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_001', 0, async function (done) {
const promise = audioManager.setRingerMode(2); //Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL
promise.then(async function (value) {
const promise = audioManager.setRingerMode(2);
// Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL
promise.then(async function () {
console.info('AudioFrameworkTest: Promise: setRingerMode​ RINGER_MODE_NORMAL');
audioManager.getRingerMode().then(async function (value){
if(value==2){
......@@ -1872,6 +1966,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_002
* @tc.name : setRingerMode - Silent Mode - Promise
......@@ -1881,9 +1976,9 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_002', 0, async function (done) {
const promise = audioManager.setRingerMode(0); //Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT
promise.then(async function (value){
const promise = audioManager.setRingerMode(0);
// Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT
promise.then(async function (){
console.info('AudioFrameworkTest: Promise: setRingerMode​ RINGER_MODE_SILENT');
audioManager.getRingerMode().then(async function (value){
if(value==0){
......@@ -1899,6 +1994,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_003
* @tc.name : setRingerMode - Vibration Mode - Promise
......@@ -1908,9 +2004,9 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_003', 0, async function (done) {
const promise = audioManager.setRingerMode(1); //Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE
promise.then(async function (value){
const promise = audioManager.setRingerMode(1);
// Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE
promise.then(async function (){
console.info('AudioFrameworkTest: Promise: setRingerMode​ RINGER_MODE_VIBRATE');
audioManager.getRingerMode().then(async function (value){
if(value==1){
......@@ -1926,6 +2022,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_004
* @tc.name : setRingerMode - Normal Mode - Callback
......@@ -1935,37 +2032,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_004', 0, async function (done) {
audioManager.setRingerMode(2, (err, value) => { //Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL
audioManager.setRingerMode(2, (err) => {
// Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL
console.info('AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_NORMAL');
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_NORMAL: Error: ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_NORMAL: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value==2){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_NORMAL: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_NORMAL: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
else{
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_NORMAL: Error: ${err.message}`);
expect().assertFail();
}
else if(value==2){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_NORMAL: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_NORMAL: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_005
* @tc.name : setRingerMode - Silent Mode - Callback
......@@ -1975,37 +2069,35 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_005', 0, async function (done) {
audioManager.setRingerMode(0, (err, value) => { //Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT
audioManager.setRingerMode(0, (err) => {
// Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT
console.info('AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_SILENT');
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_SILENT: Error: ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_SILENT: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else{
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_SILENT: Error: ${err.message}`);
expect().assertFail();
}
if(value==0){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_SILENT: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_SILENT: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
if(value==0){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_SILENT: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_SILENT: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_006
* @tc.name : setRingerMode - Vibration Mode - Callback
......@@ -2015,37 +2107,35 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_006', 0, async function (done) {
audioManager.setRingerMode(1, (err, value) => { //Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE
audioManager.setRingerMode(1, (err) => {
// Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE
console.info('AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_VIBRATE');
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_VIBRATE: Error: ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_VIBRATE: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else {
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_VIBRATE: Error: ${err.message}`);
expect().assertFail();
}
if(value==1){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_VIBRATE: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_VIBRATE: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
if(value==1){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_VIBRATE: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_VIBRATE: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_007
* @tc.name : setRingerMode - Normal Mode - Promise - ENAME
......@@ -2055,9 +2145,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_007', 0, async function (done) {
const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL);
promise.then(async function (value) {
promise.then(async function () {
console.info('AudioFrameworkTest: Promise: setRingerMode​ RINGER_MODE_NORMAL');
audioManager.getRingerMode().then(async function (value){
if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){
......@@ -2073,6 +2162,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_008
* @tc.name : setRingerMode - Silent Mode - Promise - ENAME
......@@ -2082,9 +2172,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_008', 0, async function (done) {
const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT);
promise.then(async function (value){
promise.then(async function (){
console.info('AudioFrameworkTest: Promise: setRingerMode​ RINGER_MODE_SILENT');
audioManager.getRingerMode().then(async function (value){
if(value==audio.AudioRingMode.RINGER_MODE_SILENT){
......@@ -2100,6 +2189,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_009
* @tc.name : setRingerMode - Vibration Mode - Promise - NAME
......@@ -2109,9 +2199,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_009', 0, async function (done) {
const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE);
promise.then(async function (value){
promise.then(async function (){
console.info('AudioFrameworkTest: Promise: setRingerMode​ RINGER_MODE_VIBRATE');
audioManager.getRingerMode().then(async function (value){
if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){
......@@ -2127,6 +2216,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_010
* @tc.name : setRingerMode - Normal Mode - Callback - ENAME
......@@ -2136,36 +2226,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_010', 0, async function (done) {
audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL, (err, value) => {
audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL, (err) => {
console.info('AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_NORMAL');
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_NORMAL: Error: ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_NORMAL: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_NORMAL: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_NORMAL: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
else {
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ 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);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_NORMAL: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_0011
* @tc.name : setRingerMode - Silent Mode - Callback - ENAME
......@@ -2175,37 +2262,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_011', 0, async function (done) {
audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT, (err, value) => {
audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT, (err) => {
console.info('AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_SILENT');
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_SILENT: Error: ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_SILENT: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else {
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ 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);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_SILENT: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
if(value==audio.AudioRingMode.RINGER_MODE_SILENT){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_SILENT: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_SILENT: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setRingerMode_012
* @tc.name : setRingerMode - Vibration Mode - Callback
......@@ -2215,37 +2299,34 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setRingerMode_012', 0, async function (done) {
audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE, (err, value) => {
console.info('AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_VIBRATE');
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_VIBRATE: Error: ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ RINGER_MODE_VIBRATE: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else {
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : setRingerMode​ 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);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_VIBRATE: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_VIBRATE: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: setRingerMode​ RINGER_MODE_VIBRATE: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_001
* @tc.name : mute - Media - Promise
......@@ -2255,24 +2336,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_001', 0, async function (done) {
await audioManager.mute(audioMedia,true).then(async function (data) {
await audioManager.mute(audioMedia,true).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: TRUE');
audioManager.isMute(audioMedia).then(async function (data) {
if(data==true){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: TRUE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_006
* @tc.name : mute - Media - callback
......@@ -2282,7 +2364,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_006', 0, async function (done) {
audioManager.mute(audioMedia,false, (err, data) => {
audioManager.mute(audioMedia,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -2292,8 +2374,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.isMute(audioMedia, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: '+data);
......@@ -2309,6 +2390,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_002
* @tc.name : mute - Media - callback
......@@ -2318,7 +2400,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_002', 0, async function (done) {
audioManager.mute(audioMedia,true, (err, data) => {
audioManager.mute(audioMedia,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -2328,8 +2410,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.isMute(audioMedia, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : TRUE: Media : failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: TRUE: PASS: '+data);
......@@ -2345,6 +2426,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_005
* @tc.name : mute - Media - Promise
......@@ -2354,24 +2436,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_005', 0, async function (done) {
await audioManager.mute(audioMedia,false).then(async function (data) {
await audioManager.mute(audioMedia,false).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: FALSE');
audioManager.isMute(audioMedia).then(async function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_003
* @tc.name : mute - Ringtone - Promise
......@@ -2381,24 +2464,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_003', 0, async function (done) {
await audioManager.mute(audioRingtone,true).then(async function (data) {
await audioManager.mute(audioRingtone,true).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: TRUE');
audioManager.isMute(audioRingtone).then(async function (data) {
if(data==true){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: TRUE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_008
* @tc.name : mute - Ringtone - callback
......@@ -2408,8 +2492,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_008', 0, async function (done) {
audioManager.mute(audioRingtone,false, (err, data) => {
audioManager.mute(audioRingtone,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -2419,8 +2502,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.isMute(audioRingtone, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: PASS: '+data);
......@@ -2436,6 +2518,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_004
* @tc.name : mute - Ringtone - callback
......@@ -2445,8 +2528,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_004', 0, async function (done) {
audioManager.mute(audioRingtone,true, (err, data) => {
audioManager.mute(audioRingtone,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -2456,8 +2538,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.isMute(audioRingtone, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : TRUE: Ringtone : failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: TRUE: PASS: '+data);
......@@ -2473,6 +2554,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_007
* @tc.name : mute - Ringtone - Promise
......@@ -2482,25 +2564,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_007', 0, async function (done) {
await audioManager.mute(audioRingtone,false).then(async function (data) {
await audioManager.mute(audioRingtone,false).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: FALSE');
audioManager.isMute(audioRingtone).then(async function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Rington: FALSE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_009
* @tc.name : mute - Media - Promise - ENAME
......@@ -2510,24 +2592,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_009', 0, async function (done) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,true).then(async function (data) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,true).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: TRUE');
audioManager.isMute(audio.AudioVolumeType.MEDIA).then(async function (data) {
if(data==true){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: TRUE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_015
* @tc.name : mute - Media - callback - ENAME
......@@ -2537,18 +2620,17 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_015', 0, async function (done) {
audioManager.mute(audio.AudioVolumeType.MEDIA,false, (err, data) => {
audioManager.mute(audio.AudioVolumeType.MEDIA,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
expect().assertFail();
}
else {
console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Callback : FALSE');
audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : FALSE: Media : ENAME: failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: PASS: '+data);
......@@ -2564,6 +2646,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_010
* @tc.name : mute - Media - callback - ENAME:
......@@ -2573,18 +2656,17 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_010', 0, async function (done) {
audioManager.mute(audio.AudioVolumeType.MEDIA,true, (err, data) => {
audioManager.mute(audio.AudioVolumeType.MEDIA,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
expect().assertFail();
}
else {
console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Callback : TRUE');
audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : TRUE: Media : ENAME: failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: TRUE: PASS: '+data);
......@@ -2600,6 +2682,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_011
* @tc.name : mute - Media - Promise - ENAME
......@@ -2609,24 +2692,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_011', 0, async function (done) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(async function (data) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE');
audioManager.isMute(audio.AudioVolumeType.MEDIA).then(async function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_012
* @tc.name : mute - Ringtone - Promise - ENAME
......@@ -2636,24 +2720,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_012', 0, async function (done) {
await audioManager.mute(audio.AudioVolumeType.RINGTONE,true).then(async function (data) {
await audioManager.mute(audio.AudioVolumeType.RINGTONE,true).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: ENAME: Promise: TRUE');
audioManager.isMute(audio.AudioVolumeType.RINGTONE).then(async function (data) {
if(data==true){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: ENAME: TRUE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_016
* @tc.name : mute - Ringtone - callback - ENAME
......@@ -2663,19 +2748,17 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_016', 0, async function (done) {
audioManager.mute(audio.AudioVolumeType.RINGTONE,false, (err, data) => {
audioManager.mute(audio.AudioVolumeType.RINGTONE,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
expect().assertFail();
}
else {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: ENAME: Callback : FALSE');
audioManager.isMute(audio.AudioVolumeType.RINGTONE, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : ENAME: failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: '+data);
......@@ -2691,6 +2774,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_013
* @tc.name : mute - Ringtone - callback - ENAME
......@@ -2700,19 +2784,17 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_013', 0, async function (done) {
audioManager.mute(audio.AudioVolumeType.RINGTONE,true, (err, data) => {
audioManager.mute(audio.AudioVolumeType.RINGTONE,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
expect().assertFail();
}
else {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: ENAME: Callback : TRUE');
audioManager.isMute(audio.AudioVolumeType.RINGTONE, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : TRUE: Ringtone : ENAME: failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: TRUE: PASS: '+data);
......@@ -2728,6 +2810,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_014
* @tc.name : mute - Media - Promise - ENAME:
......@@ -2737,24 +2820,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_014', 0, async function (done) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(async function (data) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE');
audioManager.isMute(audio.AudioVolumeType.MEDIA).then(async function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_017
* @tc.name : mute - Media - Promise - SetVolume
......@@ -2764,25 +2848,26 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_017', 0, async function (done) {
await audioManager.mute(audioMedia,true).then(async function (data) {
await audioManager.mute(audioMedia,true).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: TRUE');
audioManager.setVolume(audioMedia,lowVol);
audioManager.isMute(audioMedia).then(async function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: ERROR:' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_018
* @tc.name : mute - Media - callback - SetVolume
......@@ -2792,18 +2877,18 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_018', 0, async function (done) {
audioManager.mute(audioMedia,true, (err, data) => {
audioManager.mute(audioMedia,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`);
expect(false).assertTrue();
}
expect().assertFail();
}
else{
console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : TRUE');
audioManager.setVolume(audioMedia,highVol);
audioManager.isMute(audioMedia, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: PASS: '+data);
......@@ -2819,6 +2904,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_019
* @tc.name : mute - Ringtone - Promise - SetVolume
......@@ -2828,18 +2914,18 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_019', 0, async function (done) {
await audioManager.mute(audioRingtone,true).then(async function (data) {
await audioManager.mute(audioRingtone,true).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: SetVolume');
audioManager.setVolume(audioRingtone,highVol);
audioManager.isMute(audioRingtone).then(async function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: FAIL: '+data);
expect(false).assertTrue();
}
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: ERROR:' + err.message);
......@@ -2847,6 +2933,7 @@ describe('AudioFramework.test.js', async function () {
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_020
* @tc.name : mute - Ringtone - callback - SetVolume
......@@ -2856,11 +2943,10 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_020', 0, async function (done) {
audioManager.mute(audioRingtone,true, (err, data) => {
audioManager.mute(audioRingtone,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`);
expect(false).assertTrue();
expect().assertFail();
}
else {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : SetVolume');
......@@ -2868,8 +2954,7 @@ describe('AudioFramework.test.js', async function () {
audioManager.isMute(audioRingtone, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to get Mute Status ${err.message}`);
expect(false).assertTrue();
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: PASS: '+data);
......@@ -2885,6 +2970,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_001
* @tc.name : isActive - Media - Promise
......@@ -2900,15 +2986,16 @@ describe('AudioFramework.test.js', async function () {
if(data==true){
console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_002
* @tc.name : isActive - Media - Callback
......@@ -2922,19 +3009,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audioMedia, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Media : isActive: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_003
* @tc.name : isActive - Ringtone - Promise
......@@ -2950,15 +3038,16 @@ describe('AudioFramework.test.js', async function () {
if(data==true){
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_004
* @tc.name : isActive - Ringtone - Callback
......@@ -2972,19 +3061,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audioRingtone, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Ringtone : isActive: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_005
* @tc.name : isActive - Media - Promise
......@@ -3000,15 +3090,16 @@ describe('AudioFramework.test.js', async function () {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_006
* @tc.name : isActive - Media - Callback
......@@ -3022,19 +3113,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audioMedia, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Media : isActive: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_007
* @tc.name : isActive - Ringtone - Promise
......@@ -3050,15 +3142,16 @@ describe('AudioFramework.test.js', async function () {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_008
* @tc.name : isActive - Ringtone - Callback
......@@ -3072,19 +3165,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audioRingtone, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Ringtone : isActive: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_009
* @tc.name : isActive - Media - Promise - ENAME
......@@ -3099,15 +3193,16 @@ describe('AudioFramework.test.js', async function () {
if(data==true){
console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_010
* @tc.name : isActive - Media - Callback - ENAME
......@@ -3121,19 +3216,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audio.AudioVolumeType.MEDIA, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Media : isActive: ENAME: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_011
* @tc.name : isActive - Ringtone - Promise - ENAME
......@@ -3149,15 +3245,16 @@ describe('AudioFramework.test.js', async function () {
if(data==true){
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_012
* @tc.name : isActive - Ringtone - Callback - ENAME
......@@ -3171,19 +3268,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audio.AudioVolumeType.RINGTONE, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Ringtone : isActive: ENAME: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_013
* @tc.name : isActive - Media - Promise - ENAME:
......@@ -3199,15 +3297,16 @@ describe('AudioFramework.test.js', async function () {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_014
* @tc.name : isActive - Media - Callback - ENAME
......@@ -3221,19 +3320,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audio.AudioVolumeType.MEDIA, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Media : ENAME: isActive: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_015
* @tc.name : isActive - Ringtone - Promise - ENAME
......@@ -3249,15 +3349,16 @@ describe('AudioFramework.test.js', async function () {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
}
});
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_isActive_016
* @tc.name : isActive - Ringtone - Callback - ENAME
......@@ -3271,19 +3372,20 @@ describe('AudioFramework.test.js', async function () {
audioManager.isActive(audio.AudioVolumeType.RINGTONE, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : Ringtone : ENAME: isActive: failed ${err.message}`);
return;
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
done();
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_001
* @tc.name : setMicrophoneMute - true - Promise
......@@ -3293,24 +3395,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setMicrophoneMute_001', 0, async function (done) {
await audioManager.setMicrophoneMute(true).then(async function (data) {
await audioManager.setMicrophoneMute(true).then(async function () {
console.log('AudioFrameworkTest: setMicrophoneMute: Promise: TRUE');
audioManager.isMicrophoneMute().then(async function (data) {
if(data==true){
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: setMicrophoneMute: TRUE: FAIL: Error :' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_002
* @tc.name : setMicrophoneMute - false - Promise
......@@ -3320,24 +3423,25 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setMicrophoneMute_002', 0, async function (done) {
await audioManager.setMicrophoneMute(false).then(async function (data) {
await audioManager.setMicrophoneMute(false).then(async function () {
console.log('AudioFrameworkTest: setMicrophoneMute: Promise: FALSE');
audioManager.isMicrophoneMute().then(async function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: PASS:'+data);
expect(true).assertTrue();
}
}
else{
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: FAIL: '+data);
expect(false).assertTrue();
}
});
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Promise: setMicrophoneMute: FALSE: FAIL: Error :' + err.message);
expect(false).assertTrue();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_003
* @tc.name : setMicrophoneMute - true - Callback
......@@ -3347,7 +3451,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setMicrophoneMute_003', 0, async function (done) {
audioManager.setMicrophoneMute(true, (err, data) => {
audioManager.setMicrophoneMute(true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : TRUE: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -3373,6 +3477,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setMicrophoneMute_004
* @tc.name : setMicrophoneMute - false - Callback
......@@ -3382,7 +3487,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setMicrophoneMute_004', 0, async function (done) {
audioManager.setMicrophoneMute(false, (err, data) => {
audioManager.setMicrophoneMute(false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: setMicrophoneMute: Callback : FALSE: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -3408,6 +3513,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_001
* @tc.name : setDeviceActive - SPEAKER - deactivate - Promise
......@@ -3417,8 +3523,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_001', 0, async function (done) {
await audioManager.setDeviceActive(1,false).then( //Setting device active ENUM 1 = SPEAKER
async function (value){
await audioManager.setDeviceActive(1,false).then(async function (){
// Setting device active ENUM 1 = SPEAKER
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate');
audioManager.isDeviceActive(audio.DeviceType.SPEAKER).then(async function (value){
if(value==false){
......@@ -3433,9 +3539,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_002
* @tc.name : setDeviceActive - SPEAKER - Activate - Promise
......@@ -3445,8 +3552,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_002', 0, async function (done) {
await audioManager.setDeviceActive(audio.DeviceType.SPEAKER,true).then(
async function (value){
await audioManager.setDeviceActive(audio.DeviceType.SPEAKER,true).then(async function (){
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate');
audioManager.isDeviceActive(1).then(async function (value){
if(value==true){
......@@ -3461,9 +3567,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_003
* @tc.name : setDeviceActive - WIRED_HEADSET - deactivate - Promise
......@@ -3473,8 +3580,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_003', 0, async function (done) {
await audioManager.setDeviceActive(2,false).then( //Setting device active ENUM 2 = WIRED_HEADSET
async function (value){
await audioManager.setDeviceActive(2,false).then(async function (){
// Setting device active ENUM 2 = WIRED_HEADSET
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : WIRED_HEADSET: Deactivate');
audioManager.isDeviceActive(audio.DeviceType.WIRED_HEADSET).then(async function (value){
if(value==false){
......@@ -3489,9 +3596,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : WIRED_HEADSET: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_004
* @tc.name : setDeviceActive - WIRED_HEADSET - Activate - Promise
......@@ -3501,8 +3609,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_004', 0, async function (done) {
await audioManager.setDeviceActive(audio.DeviceType.WIRED_HEADSET,true).then(
async function (value){
await audioManager.setDeviceActive(audio.DeviceType.WIRED_HEADSET,true).then(async function (){
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : WIRED_HEADSET: Activate');
audioManager.isDeviceActive(2).then(async function (value){
if(value==true){
......@@ -3517,9 +3624,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : WIRED_HEADSET: Activate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_005
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Promise
......@@ -3529,8 +3637,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_005', 0, async function (done) {
await audioManager.setDeviceActive(3,false).then( //Setting device active ENUM 3 = BLUETOOTH_SCO
async function (value){
await audioManager.setDeviceActive(3,false).then(async function (){
// Setting device active ENUM 3 = BLUETOOTH_SCO
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate');
audioManager.isDeviceActive(audio.DeviceType.BLUETOOTH_SCO).then(async function (value){
if(value==false){
......@@ -3545,9 +3653,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_006
* @tc.name : setDeviceActive - BLUETOOTH_SCO - Activate - Promise
......@@ -3557,8 +3666,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_006', 0, async function (done) {
await audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_SCO,true).then(
async function (value){
await audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_SCO,true).then(async function (){
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate');
audioManager.isDeviceActive(3).then(async function (value){
if(value==true){
......@@ -3573,9 +3681,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_007
* @tc.name : setDeviceActive - BLUETOOTH_A2DP - deactivate - Promise
......@@ -3585,8 +3694,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_007', 0, async function (done) {
await audioManager.setDeviceActive(4,false).then( //Setting device active ENUM 4 = BLUETOOTH_A2DP
async function (value){
await audioManager.setDeviceActive(4,false).then(async function (){
// Setting device active ENUM 4 = BLUETOOTH_A2DP
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_A2DP: Deactivate');
audioManager.isDeviceActive(audio.DeviceType.BLUETOOTH_A2DP).then(async function (value){
if(value==false){
......@@ -3601,9 +3710,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_A2DP: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_008
* @tc.name : setDeviceActive - BLUETOOTH_A2DP - Activate - Promise
......@@ -3613,8 +3723,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_008', 0, async function (done) {
await audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_A2DP,true).then(
async function (value){
await audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_A2DP,true).then(async function (){
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_A2DP: Activate');
audioManager.isDeviceActive(4).then(async function (value){
if(value==true){
......@@ -3629,9 +3738,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_A2DP: Activate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_009
* @tc.name : setDeviceActive - MIC - deactivate - Promise
......@@ -3641,8 +3751,8 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_009', 0, async function (done) {
await audioManager.setDeviceActive(5,false).then( //Setting device active ENUM 5 = MIC
async function (value){
await audioManager.setDeviceActive(5,false).then(async function (){
// Setting device active ENUM 5 = MIC
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : MIC: Deactivate');
audioManager.isDeviceActive(audio.DeviceType.MIC).then(async function (value){
if(value==false){
......@@ -3657,9 +3767,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : MIC: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_010
* @tc.name : setDeviceActive - MIC - Activate - Promise
......@@ -3669,8 +3780,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_010', 0, async function (done) {
await audioManager.setDeviceActive(audio.DeviceType.MIC,true).then(
async function (value){
await audioManager.setDeviceActive(audio.DeviceType.MIC,true).then(async function (){
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : MIC: Activate');
audioManager.isDeviceActive(5).then(async function (value){
if(value==true){
......@@ -3685,9 +3795,10 @@ describe('AudioFramework.test.js', async function () {
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : MIC: Activate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
});
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_011
* @tc.name : setDeviceActive - SPEAKER - deactivate - Callback
......@@ -3697,7 +3808,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_011', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.SPEAKER,false, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.SPEAKER,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3723,6 +3834,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_012
* @tc.name : setDeviceActive - SPEAKER - deactivate - Callback
......@@ -3732,7 +3844,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_012', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.SPEAKER,true, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.SPEAKER,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3758,6 +3870,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_013
* @tc.name : setDeviceActive - WIRED_HEADSET - deactivate - Callback
......@@ -3767,7 +3880,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_013', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.WIRED_HEADSET,false, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.WIRED_HEADSET,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3793,6 +3906,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_014
* @tc.name : setDeviceActive - WIRED_HEADSET - deactivate - Callback
......@@ -3802,7 +3916,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_014', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.WIRED_HEADSET,true, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.WIRED_HEADSET,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : WIRED_HEADSET: Active: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3828,6 +3942,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_015
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Callback
......@@ -3837,7 +3952,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_015', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_SCO,false, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_SCO,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3863,6 +3978,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_016
* @tc.name : setDeviceActive - BLUETOOTH_SCO - deactivate - Callback
......@@ -3872,7 +3988,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_016', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_SCO,true, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_SCO,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3898,6 +4014,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_017
* @tc.name : setDeviceActive - BLUETOOTH_A2DP - deactivate - Callback
......@@ -3907,7 +4024,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_017', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_A2DP,false, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_A2DP,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_A2DP: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3933,7 +4050,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
//await sleep(20);
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_018
* @tc.name : setDeviceActive - BLUETOOTH_A2DP - deactivate - Callback
......@@ -3943,7 +4060,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_018', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_A2DP,true, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.BLUETOOTH_A2DP,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_A2DP: Active: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -3969,6 +4086,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_019
* @tc.name : setDeviceActive - MIC - deactivate - Callback
......@@ -3978,7 +4096,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_019', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.MIC,false, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.MIC,false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : MIC: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -4004,6 +4122,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setDeviceActive_020
* @tc.name : setDeviceActive - MIC - deactivate - Callback
......@@ -4013,7 +4132,7 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_020', 0, async function (done) {
audioManager.setDeviceActive(audio.DeviceType.MIC,true, (err, value) => {
audioManager.setDeviceActive(audio.DeviceType.MIC,true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : MIC: Active: Error: ${err.message}`);
expect(false).assertTrue();
......@@ -4039,6 +4158,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_001
* @tc.name : setAudioParameter - Promise - Character & Number
......@@ -4049,7 +4169,7 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_001', 0, async function (done) {
const promise = audioManager.setAudioParameter('PBits per sample', '8 bit');
promise.then(async function (value) {
promise.then(async function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('PBits per sample').then(async function (value){
if(value=='8 bit'){
......@@ -4065,6 +4185,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_002
* @tc.name : setAudioParameter - Promise - Number
......@@ -4075,7 +4196,7 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_002', 0, async function (done) {
const promise = audioManager.setAudioParameter('PNumber', '4800');
promise.then(async function (value) {
promise.then(async function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('PNumber').then(async function (value){
if(value=='4800'){
......@@ -4091,6 +4212,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_003
* @tc.name : setAudioParameter - Promise - Long Number
......@@ -4100,11 +4222,11 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_003', 0, async function (done) {
const promise = audioManager.setAudioParameter('PLNumber','28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104859018439058901437587459173948590813490859018349051943076918459013489058901437509479068901458098143095890143767140938590471357140937541609749103750981094385094173950713490570914389075159079014769751875901459048095813');
promise.then(async function (value) {
const promise = audioManager.setAudioParameter('PLNumber',longValue);
promise.then(async function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('PLNumber').then(async function (value){
if(value=='28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104859018439058901437587459173948590813490859018349051943076918459013489058901437509479068901458098143095890143767140938590471357140937541609749103750981094385094173950713490570914389075159079014769751875901459048095813'){
if(value==longValue){
console.info('AudioFrameworkTest: Promise: getAudioParameter: PLNumber : PASS :' +value);
expect(true).assertTrue();
}
......@@ -4117,6 +4239,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_004
* @tc.name : setAudioParameter - Promise - Decimal
......@@ -4127,7 +4250,7 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_004', 0, async function (done) {
const promise = audioManager.setAudioParameter('PDecimal', '10.000000234324324324');
promise.then(async function (value) {
promise.then(async function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('PDecimal').then(async function (value){
if(value=='10.000000234324324324'){
......@@ -4143,6 +4266,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_005
* @tc.name : setAudioParameter - Promise - Parameter name Number
......@@ -4153,7 +4277,7 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_005', 0, async function (done) {
const promise = audioManager.setAudioParameter('1212', 'PPNumber');
promise.then(async function (value) {
promise.then(async function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('1212').then(async function (value){
if(value=='PPNumber'){
......@@ -4169,6 +4293,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_006
* @tc.name : setAudioParameter - Promise - Special Characters
......@@ -4179,7 +4304,7 @@ describe('AudioFramework.test.js', async function () {
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_006', 0, async function (done) {
const promise = audioManager.setAudioParameter('PSpecial', '[]\:";<>?,./~!@#$%^*()_+-={}|');
promise.then(async function (value) {
promise.then(async function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('PSpecial').then(async function (value){
if(value=='[]\:";<>?,./~!@#$%^*()_+-={}|'){
......@@ -4195,6 +4320,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_007
* @tc.name : setAudioParameter - Callback - Character & Number
......@@ -4204,32 +4330,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_007', 0, async function (done) {
audioManager.setAudioParameter('CBSample Rate', '16 bit', (err, value) => {
audioManager.setAudioParameter('CBSample Rate', '16 bit', (err) => {
console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter');
if (err) {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBSample Rate : Error: ${err.message}`);
expect(false).assertTrue();
return;
}
audioManager.getAudioParameter('CBSample Rate', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBSample Rate: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='16 bit'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
else{
audioManager.getAudioParameter('CBSample Rate', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBSample Rate: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='16 bit'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_008
* @tc.name : setAudioParameter - Callback - Special Character
......@@ -4239,32 +4366,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_008', 0, async function (done) {
audioManager.setAudioParameter('Special', '~!@#$%^*()_+-={}|[]\:";<>?,./', (err, value) => {
audioManager.setAudioParameter('Special', '~!@#$%^*()_+-={}|[]\:";<>?,./', (err) => {
console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter');
if (err) {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: Special : Error: ${err.message}`);
expect(false).assertTrue();
return;
}
audioManager.getAudioParameter('Special', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: Special: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
else{
audioManager.getAudioParameter('Special', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParam: Special: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_009
* @tc.name : setAudioParameter - Callback - Decimal
......@@ -4274,32 +4402,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_009', 0, async function (done) {
audioManager.setAudioParameter('CBDecimal', '10000.21321432432432', (err, value) => {
audioManager.setAudioParameter('CBDecimal', '10000.21321432432432', (err) => {
console.info('AudioFrameworkTest: Audio Parameter Test: Callback : setAudioParameter');
if (err) {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBDecimal : Error: ${err.message}`);
expect(false).assertTrue();
return;
}
audioManager.getAudioParameter('CBDecimal', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBDecimal: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='10000.21321432432432'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
else{
audioManager.getAudioParameter('CBDecimal', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback :getAudioParm: CBDecimal:Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='10000.21321432432432'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_010
* @tc.name : setAudioParameter - Callback - Number
......@@ -4309,32 +4438,33 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_010', 0, async function (done) {
audioManager.setAudioParameter('CBNumber', '5454', (err, value) => {
audioManager.setAudioParameter('CBNumber', '5454', (err) => {
console.info('AudioFrameworkTest: Audio Parameter Test: Callback :CBNumber : setAudioParameter');
if (err) {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBNumber : Error: ${err.message}`);
expect(false).assertTrue();
return;
}
audioManager.getAudioParameter('CBNumber', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBNumber: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='5454'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
else{
audioManager.getAudioParameter('CBNumber', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParam: CBNumber: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='5454'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: FAIL :' +value);
expect(false).assertTrue();
}
done();
});
}
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_011
* @tc.name : setAudioParameter - Callback - Long Number
......@@ -4344,20 +4474,18 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_011', 0, async function (done) {
audioManager.setAudioParameter('CBLNumber', '54549873894789327498327984328954897598235748278979823758947895238975847389578932784328974983274823897584728957234873289759832578947598392874798327598498275894728975892478953728947823748732894783927589748975837248973289748923758972489379832748927349879237589324789327589472789743892748932749832749832749879832749837298', (err, value) => {
audioManager.setAudioParameter('CBLNumber', longValue, (err) => {
console.info('AudioFrameworkTest: Audio Parameter Test: Callback :CBLNumber : setAudioParameter');
if (err) {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: CBLNumber : Error: ${err.message}`);
expect(false).assertTrue();
return;
}
audioManager.getAudioParameter('CBLNumber', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBLNumber: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='54549873894789327498327984328954897598235748278979823758947895238975847389578932784328974983274823897584728957234873289759832578947598392874798327598498275894728975892478953728947823748732894783927589748975837248973289748923758972489379832748927349879237589324789327589472789743892748932749832749832749879832749837298'){
else if(value==longValue){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: PASS :' +value);
expect(true).assertTrue();
}
......@@ -4370,6 +4498,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_012
* @tc.name : setAudioParameter - Callback - Parameter name Number
......@@ -4379,18 +4508,16 @@ describe('AudioFramework.test.js', async function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_012', 0, async function (done) {
audioManager.setAudioParameter('345667', 'xyza', (err, value) => {
audioManager.setAudioParameter('345667', 'xyza', (err) => {
console.info('AudioFrameworkTest: Audio Parameter Test: Callback :345667 : setAudioParameter');
if (err) {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: 345667 : Error: ${err.message}`);
expect(false).assertTrue();
return;
}
audioManager.getAudioParameter('345667', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: 345667: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='xyza'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: PASS :' +value);
......@@ -4405,6 +4532,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_001
* @tc.name : getAudioParameter - Promise - Character & Number
......@@ -4428,6 +4556,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_002
* @tc.name : getAudioParameter - Promise - Number
......@@ -4451,6 +4580,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_003
* @tc.name : getAudioParameter - Promise - Long Number
......@@ -4462,7 +4592,7 @@ describe('AudioFramework.test.js', async function () {
it('SUB_AUDIO_MANAGER_getAudioParameter_003', 0, async function (done) {
const promise = audioManager.getAudioParameter('PLNumber');
promise.then(async function (value){
if(value=='28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104859018439058901437587459173948590813490859018349051943076918459013489058901437509479068901458098143095890143767140938590471357140937541609749103750981094385094173950713490570914389075159079014769751875901459048095813'){
if(value==longValue){
console.info('AudioFrameworkTest: Promise: getAudioParameter: PLNumber : PASS :' +value);
expect(true).assertTrue();
}
......@@ -4474,6 +4604,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_004
* @tc.name : getAudioParameter - Promise - Decimal
......@@ -4497,6 +4628,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_005
* @tc.name : getAudioParameter - Promise - Parameter name Number
......@@ -4520,6 +4652,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_006
* @tc.name : getAudioParameter - Promise - Special Characters
......@@ -4543,6 +4676,7 @@ describe('AudioFramework.test.js', async function () {
await promise;
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_007
* @tc.name : getAudioParameter - Callback - Character & Number
......@@ -4556,7 +4690,6 @@ describe('AudioFramework.test.js', async function () {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBSample Rate: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='16 bit'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBSample Rate: PASS :' +value);
......@@ -4569,6 +4702,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_008
* @tc.name : getAudioParameter - Callback - Special Character
......@@ -4582,7 +4716,6 @@ describe('AudioFramework.test.js', async function () {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: Special: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: Special: PASS :' +value);
......@@ -4595,6 +4728,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_009
* @tc.name : getAudioParameter - Callback - Decimal
......@@ -4608,7 +4742,6 @@ describe('AudioFramework.test.js', async function () {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBDecimal: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='10000.21321432432432'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBDecimal: PASS :' +value);
......@@ -4621,6 +4754,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_010
* @tc.name : getAudioParameter - Callback - Number
......@@ -4634,7 +4768,6 @@ describe('AudioFramework.test.js', async function () {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBNumber: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='5454'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBNumber: PASS :' +value);
......@@ -4647,6 +4780,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_011
* @tc.name : getAudioParameter - Callback - Long Number
......@@ -4660,9 +4794,8 @@ describe('AudioFramework.test.js', async function () {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: CBLNumber: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='54549873894789327498327984328954897598235748278979823758947895238975847389578932784328974983274823897584728957234873289759832578947598392874798327598498275894728975892478953728947823748732894783927589748975837248973289748923758972489379832748927349879237589324789327589472789743892748932749832749832749879832749837298'){
else if(value==longValue){
console.info('AudioFrameworkTest: Callback: getAudioParameter: CBLNumber: PASS :' +value);
expect(true).assertTrue();
}
......@@ -4673,6 +4806,7 @@ describe('AudioFramework.test.js', async function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_012
* @tc.name : getAudioParameter - Callback - Parameter name Number
......@@ -4686,7 +4820,6 @@ describe('AudioFramework.test.js', async function () {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: 345667: Error: ${err.message}`);
expect(false).assertTrue();
return;
}
else if(value=='xyza'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: 345667: PASS :' +value);
......@@ -4700,10 +4833,6 @@ describe('AudioFramework.test.js', async function () {
});
})
function sleep (ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function displayDeviceProp(value, index, array) {
var devRoleName;
var devTypeName;
......@@ -4735,12 +4864,9 @@ describe('AudioFramework.test.js', async function () {
else {
devTypeName = 'ERROR : UNKNOWN';
}
console.info(`AudioFrameworkTest: device role: ${devRoleName}`);
deviceRoleValue = value.deviceRole;
console.info(`AudioFrameworkTest: device type: ${devTypeName}`);
deviceTypeValue = value.deviceType;
}
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册