提交 d73005e0 编写于 作者: L lwx1121892

<liuxueqi3@huawei.com>

Signed-off-by: Nlwx1121892 <liuxueqi3@huawei.com>
上级 a6e883dd
......@@ -15,7 +15,7 @@
import audio from '@ohos.multimedia.audio';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('audioManger_audio2', function () {
console.info('AudioFrameworkTest: Create AudioManger Object JS Framework');
......@@ -32,43 +32,43 @@ describe('audioManger_audio2', function () {
var outOfRangeVol = 28;
var longValue = '28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843';
function sleep (ms) {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function displayDeviceProp(value, index, array) {
var devRoleName;
var devTypeName;
if (value.deviceRole==1) {
if (value.deviceRole == 1) {
devRoleName = 'INPUT_DEVICE';
}
else if (value.deviceRole==2) {
else if (value.deviceRole == 2) {
devRoleName = 'OUTPUT_DEVICE ';
}
else {
devRoleName = 'ERROR : UNKNOWN : '+value.deviceRole;
devRoleName = 'ERROR : UNKNOWN : ' + value.deviceRole;
}
if (value.deviceType == 1) {
devTypeName = 'EARPIECE';
}
else if (value.deviceType == 2){
else if (value.deviceType == 2) {
devTypeName = 'SPEAKER';
}
else if (value.deviceType == 3){
else if (value.deviceType == 3) {
devTypeName = 'WIRED_HEADSET';
}
else if (value.deviceType == 7){
else if (value.deviceType == 7) {
devTypeName = 'BLUETOOTH_SCO';
}
else if (value.deviceType == 8){
else if (value.deviceType == 8) {
devTypeName = 'BLUETOOTH_A2DP';
}
else if (value.deviceType == 15){
else if (value.deviceType == 15) {
devTypeName = 'MIC';
}
else {
devTypeName = 'ERROR : UNKNOWN :'+value.deviceType;
devTypeName = 'ERROR : UNKNOWN :' + value.deviceType;
}
console.info(`AudioFrameworkTest: device role: ${devRoleName}`);
......@@ -105,11 +105,11 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioManger_001', 0, function (done) {
if(audioManager!=null){
if (audioManager != null) {
console.info('AudioFrameworkTest: getAudioManger : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: getAudioManger : FAIL');
expect(false).assertTrue();
}
......@@ -135,35 +135,35 @@ describe('audioManger_audio2', function () {
const audioManager8 = audio.getAudioManager();
const audioManager9 = audio.getAudioManager();
const audioManager10 = audio.getAudioManager();
const promise = audioManager.setVolume(audioMedia,lowVol);
const promise = audioManager.setVolume(audioMedia, lowVol);
promise.then(function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager1.setVolume(audioMedia,highVol);
audioManager1.setVolume(audioMedia, highVol);
console.info('AudioFrameworkTest:audioManager1 : Media setVolume promise: successful');
audioManager2.setVolume(audioMedia,highVol);
audioManager2.setVolume(audioMedia, highVol);
console.info('AudioFrameworkTest:audioManager2 : Media setVolume promise: successful');
audioManager3.setVolume(audioMedia,highVol);
audioManager3.setVolume(audioMedia, highVol);
console.info('AudioFrameworkTest:audioManager3 : Media setVolume promise: successful');
audioManager4.setVolume(audioMedia,lowVol);
audioManager4.setVolume(audioMedia, lowVol);
console.info('AudioFrameworkTest:audioManager4 : Media setVolume promise: successful');
audioManager5.setVolume(audioMedia,highVol);
audioManager5.setVolume(audioMedia, highVol);
console.info('AudioFrameworkTest:audioManager5 : Media setVolume promise: successful');
audioManager6.setVolume(audioMedia,lowVol);
audioManager6.setVolume(audioMedia, lowVol);
console.info('AudioFrameworkTest:audioManager6 : Media setVolume promise: successful');
audioManager7.setVolume(audioMedia,highVol);
audioManager7.setVolume(audioMedia, highVol);
console.info('AudioFrameworkTest:audioManager7 : Media setVolume promise: successful');
audioManager8.setVolume(audioMedia,lowVol);
audioManager8.setVolume(audioMedia, lowVol);
console.info('AudioFrameworkTest:audioManager8 : Media setVolume promise: successful');
audioManager9.setVolume(audioMedia,highVol);
audioManager9.setVolume(audioMedia, highVol);
console.info('AudioFrameworkTest:audioManager9 : Media setVolume promise: successful');
audioManager10.setVolume(audioMedia,lowVol);
audioManager10.setVolume(audioMedia, lowVol);
console.info('AudioFrameworkTest:audioManager10 : Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(function (data) {
if(data == lowVol){
if (data == lowVol) {
console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -184,15 +184,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_001', 0, async function (done) {
const promise = audioManager.setVolume(audioMedia,lowVol);
const promise = audioManager.setVolume(audioMedia, lowVol);
promise.then(function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(function (data) {
if(data == lowVol){
if (data == lowVol) {
console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -211,15 +211,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_002', 0, async function (done) {
const promise = audioManager.setVolume(audioMedia,maxVol);
const promise = audioManager.setVolume(audioMedia, maxVol);
promise.then(function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(function (data) {
if(data == maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -238,16 +238,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_003', 0, async function (done) {
const promise = audioManager.setVolume(audioMedia,minVol);
const promise = audioManager.setVolume(audioMedia, minVol);
promise.then(function () {
console.info('AudioFrameworkTest: Media setVolume promise: successful');
audioManager.getVolume(audioMedia).then(function (data) {
if(data == minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Media getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -267,7 +267,7 @@ describe('audioManger_audio2', 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(() => {
await audioManager.setVolume(audioMedia, outOfRangeVol).then(() => {
console.info('AudioFrameworkTest: Media setVolume Promise:Out of range: FAIL');
expect(false).assertTrue();
}).catch((err) => {
......@@ -286,24 +286,23 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_005', 0, async function (done) {
audioManager.setVolume(audioMedia,highVol, (err) => {
audioManager.setVolume(audioMedia, highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
else
{
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){
else if (value == highVol) {
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -323,24 +322,23 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_006', 0, async function (done) {
audioManager.setVolume(audioMedia,maxVol, (err) => {
audioManager.setVolume(audioMedia, maxVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
else
{
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){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -360,24 +358,23 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_007', 0, async function (done) {
audioManager.setVolume(audioMedia,minVol, (err) => {
audioManager.setVolume(audioMedia, minVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
else
{
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){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Media getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media getVolume: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -397,12 +394,12 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_008', 0, async function (done) {
audioManager.setVolume(audioMedia,outOfRangeVol, (err) => {
audioManager.setVolume(audioMedia, outOfRangeVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: setVolume: Out of range: Callback: PASS: ${err.message}`);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: setVolume: callback : Media Out of range: FAIL');
expect(false).assertTrue();
}
......@@ -419,15 +416,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_009', 0, async function (done) {
const promise = audioManager.setVolume(audioRingtone,lowVol);
const promise = audioManager.setVolume(audioRingtone, lowVol);
promise.then(function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: successful');
audioManager.getVolume(audioRingtone).then(function (data) {
if(data == lowVol){
if (data == lowVol) {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -446,15 +443,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_010', 0, async function (done) {
const promise = audioManager.setVolume(audioRingtone,maxVol);
const promise = audioManager.setVolume(audioRingtone, maxVol);
promise.then(function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: successful');
audioManager.getVolume(audioRingtone).then(function (data) {
if(data == maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -473,15 +470,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_011', 0, async function (done) {
const promise = audioManager.setVolume(audioRingtone,minVol);
const promise = audioManager.setVolume(audioRingtone, minVol);
promise.then(function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: successful');
audioManager.getVolume(audioRingtone).then(function (data) {
if(data == minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -501,7 +498,7 @@ describe('audioManger_audio2', 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(() => {
await audioManager.setVolume(audioRingtone, outOfRangeVol).then(() => {
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Out of range: FAIL');
expect(false).assertTrue();
}).catch((err) => {
......@@ -520,23 +517,23 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_013', 0, async function (done) {
audioManager.setVolume(audioRingtone,highVol, (err) => {
audioManager.setVolume(audioRingtone, highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
else{
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){
else if (value == highVol) {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -556,24 +553,24 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_014', 0, async function (done) {
audioManager.setVolume(audioRingtone,maxVol, (err) => {
audioManager.setVolume(audioRingtone, maxVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
else{
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){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -593,23 +590,23 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_015', 0, async function (done) {
audioManager.setVolume(audioRingtone,minVol, (err) => {
audioManager.setVolume(audioRingtone, minVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ${err.message}`);
expect(false).assertTrue();
}
else{
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){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -629,12 +626,12 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_016', 0, async function (done) {
audioManager.setVolume(audioRingtone,outOfRangeVol, (err) => {
audioManager.setVolume(audioRingtone, outOfRangeVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Out of range Volume: Callback: ${err.message}`);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Out of range Volume: callback : Ringtone set volume: FAIL');
expect(false).assertTrue();
}
......@@ -652,7 +649,7 @@ describe('audioManger_audio2', 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(() => {
await audioManager.setVolume(audioMedia, -1).then(() => {
// Setting negative audio volume for error Scenario
console.info('AudioFrameworkTest: Media setVolume Promise:Negative: FAIL');
expect(false).assertTrue();
......@@ -672,13 +669,13 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_018', 0, async function (done) {
audioManager.setVolume(audioMedia,-1, (err) => {
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();
}
else{
else {
console.info('AudioFrameworkTest: setVolume callback : Media Negative: FAIL');
expect(false).assertTrue();
}
......@@ -696,7 +693,7 @@ describe('audioManger_audio2', function () {
*/
it('SUB_AUDIO_MANAGER_SetVolume_019', 0, async function (done) {
console.info('AudioFrameworkTest: Ringtone setVolume promise: Negative');
await audioManager.setVolume(audioRingtone,-1).then(() => {
await audioManager.setVolume(audioRingtone, -1).then(() => {
// Setting negative audio volume for error Scenario
console.info('AudioFrameworkTest: Ringtone setVolume Promise:Negative: FAIL');
expect(false).assertTrue();
......@@ -716,13 +713,13 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_020', 0, async function (done) {
audioManager.setVolume(audioRingtone,-1, (err) => {
audioManager.setVolume(audioRingtone, -1, (err) => {
// Setting negative audio volume for error Scenario
if (err) {
console.error(`AudioFrameworkTest:Ringtone setVolume Callback:Negative: PASS : ${err.message}`);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: setVolume: Negative: callback : Ringtone set volume: FAIL');
expect(false).assertTrue();
}
......@@ -739,14 +736,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_021', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol);
const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol);
promise.then(function () {
audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) {
if(data == lowVol){
if (data == lowVol) {
console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data);
expect(false).assertTrue();
}
......@@ -765,23 +762,23 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_022', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => {
audioManager.setVolume(audio.AudioVolumeType.MEDIA, highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME : ${err.message}`);
expect(false).assertTrue();
}
else{
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){
else if (value == highVol) {
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value);
expect(false).assertTrue();
}
......@@ -801,15 +798,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_023', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol);
const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol);
promise.then(function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful');
audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) {
if(data == highVol){
if (data == highVol) {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -828,23 +825,23 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_024', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE, lowVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`);
expect(false).assertTrue();
}
else{
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){
else if (value == lowVol) {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -864,15 +861,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_025', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol);
const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol);
promise.then(function () {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,maxVol);
audioManager.setVolume(audio.AudioVolumeType.RINGTONE, maxVol);
audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) {
if(data == lowVol){
if (data == lowVol) {
console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : FAIL :' + data);
expect(false).assertTrue();
}
......@@ -891,24 +888,24 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_026', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol, (err) => {
audioManager.setVolume(audio.AudioVolumeType.MEDIA, highVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME : ${err.message}`);
expect(false).assertTrue();
}
else{
else {
console.info(`AudioFrameworkTest: callback : ENAME : Media setVolume successful `);
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol);
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){
else if (value == highVol) {
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media getVolume: ENAME : FAIL :' + value);
expect(false).assertTrue();
}
......@@ -928,16 +925,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_027', 0, async function (done) {
const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE,highVol);
const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol);
promise.then(function () {
console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful');
audioManager.setVolume(audio.AudioVolumeType.MEDIA,lowVol);
audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol);
audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) {
if(data == highVol){
if (data == highVol) {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: PASS :' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getVolume Promise: ENAME: FAIL :' + data);
expect(false).assertTrue();
}
......@@ -956,24 +953,24 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_SetVolume_028', 0, async function (done) {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE,lowVol, (err) => {
audioManager.setVolume(audio.AudioVolumeType.RINGTONE, lowVol, (err) => {
if (err) {
console.error(`AudioFrameworkTest: failed to set volume: Callback: ENAME: ${err.message}`);
expect(false).assertTrue();
}
else{
else {
console.info(`AudioFrameworkTest: callback : ENAME: Ringtone setVolume successful `);
audioManager.setVolume(audio.AudioVolumeType.MEDIA,highVol);
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){
else if (value == lowVol) {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: PASS :' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone getVolume: ENAME: FAIL :' + value);
expect(false).assertTrue();
}
......@@ -995,11 +992,11 @@ describe('audioManger_audio2', function () {
it('SUB_AUDIO_MANAGER_getMaxVolume_001', 0, async function (done) {
const promise = audioManager.getMaxVolume(audioMedia);
promise.then(function (data) {
if (data==maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1022,11 +1019,11 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`);
expect(false).assertTrue();
}
else if (value==maxVol){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1045,11 +1042,11 @@ describe('audioManger_audio2', function () {
it('SUB_AUDIO_MANAGER_getMaxVolume_003', 0, async function (done) {
const promise = audioManager.getMaxVolume(audioRingtone);
promise.then(function (data) {
if (data==maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1072,11 +1069,11 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`);
expect(false).assertTrue();
}
else if (value==maxVol){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1093,14 +1090,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_005', 0, async function (done) {
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
const promise = audioManager.getMaxVolume(audioMedia);
promise.then(function (data) {
if (data==maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1118,14 +1115,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_006', 0, async function (done) {
audioManager.setVolume(audioMedia,lowVol);
audioManager.setVolume(audioMedia, lowVol);
const promise = audioManager.getMaxVolume(audioRingtone);
promise.then(function (data) {
if (data==maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1144,18 +1141,18 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_007', 0, async function (done) {
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
audioManager.getMaxVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`);
expect(false).assertTrue();
}
else if (value==maxVol){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1172,17 +1169,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_008', 0, async function (done) {
audioManager.setVolume(audioMedia,lowVol);
audioManager.setVolume(audioMedia, lowVol);
audioManager.getMaxVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`);
expect(false).assertTrue();
}
else if (value==maxVol){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1199,14 +1196,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_009', 0, async function (done) {
audioManager.setVolume(audioMedia,lowVol);
audioManager.setVolume(audioMedia, lowVol);
const promise = audioManager.getMaxVolume(audioMedia);
promise.then(function (data) {
if (data==maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getMaxVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1224,14 +1221,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_010', 0, async function (done) {
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
const promise = audioManager.getMaxVolume(audioRingtone);
promise.then(function (data) {
if (data==maxVol){
if (data == maxVol) {
console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1249,17 +1246,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_011', 0, async function (done) {
audioManager.setVolume(audioMedia,highVol);
audioManager.setVolume(audioMedia, highVol);
audioManager.getMaxVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMaxVolume ${err.message}`);
expect(false).assertTrue();
}
else if (value==maxVol){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media: getMaxVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1276,17 +1273,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMaxVolume_012', 0, async function (done) {
audioManager.setVolume(audioRingtone,highVol);
audioManager.setVolume(audioRingtone, highVol);
audioManager.getMaxVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMaxVolume ${err.message}`);
expect(false).assertTrue();
}
else if (value==maxVol){
else if (value == maxVol) {
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone: getMaxVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1305,11 +1302,11 @@ describe('audioManger_audio2', function () {
it('SUB_AUDIO_MANAGER_getMinVolume_001', 0, async function (done) {
const promise = audioManager.getMinVolume(audioMedia);
promise.then(function (data) {
if (data==minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1332,11 +1329,11 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`);
expect().assertFail();
}
else if (value==minVol){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1355,11 +1352,11 @@ describe('audioManger_audio2', function () {
it('SUB_AUDIO_MANAGER_getMinVolume_003', 0, async function (done) {
const promise = audioManager.getMinVolume(audioRingtone);
promise.then(function (data) {
if (data==minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1383,11 +1380,11 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`);
expect().assertFail();
}
else if (value==minVol){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1404,18 +1401,18 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_005', 0, async function (done) {
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
const promise = audioManager.getMinVolume(audioMedia);
promise.then(function (data) {
if (data==minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
});
});
await promise;
done();
})
......@@ -1429,17 +1426,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_006', 0, async function (done) {
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
audioManager.getMinVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`);
expect().assertFail();
}
else if (value==minVol){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1456,14 +1453,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_007', 0, async function (done) {
audioManager.setVolume(audioMedia,highVol);
audioManager.setVolume(audioMedia, highVol);
const promise = audioManager.getMinVolume(audioRingtone);
promise.then(function (data) {
if (data==minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1481,17 +1478,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_008', 0, async function (done) {
audioManager.setVolume(audioMedia,lowVol);
audioManager.setVolume(audioMedia, lowVol);
audioManager.getMinVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`);
expect().assertFail();
}
else if (value==minVol){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1508,14 +1505,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_009', 0, async function (done) {
audioManager.setVolume(audioMedia,lowVol);
audioManager.setVolume(audioMedia, lowVol);
const promise = audioManager.getMinVolume(audioMedia);
promise.then(function (data) {
if (data==minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Media getMinVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1533,17 +1530,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_010', 0, async function (done) {
audioManager.setVolume(audioMedia,highVol);
audioManager.setVolume(audioMedia, highVol);
audioManager.getMinVolume(audioMedia, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Media : failed to getMinVolume ${err.message}`);
expect().assertFail();
}
else if (value==minVol){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Media: getMinVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Media: getMinVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1560,14 +1557,14 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_011', 0, async function (done) {
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
const promise = audioManager.getMinVolume(audioRingtone)
promise.then(function (data) {
if (data==minVol){
if (data == minVol) {
console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Ringtone getMinVolume promise : FAIL: ' + data);
expect(false).assertTrue();
}
......@@ -1585,17 +1582,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getMinVolume_012', 0, async function (done) {
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
audioManager.getMinVolume(audioRingtone, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: callback : Ringtone : failed to getMinVolume ${err.message}`);
expect().assertFail();
}
else if (value==minVol){
else if (value == minVol) {
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : PASS:' + value);
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: callback : Ringtone: getMinVolume : FAIL: ' + value);
expect(false).assertTrue();
}
......@@ -1619,11 +1616,11 @@ describe('audioManger_audio2', function () {
promise.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1649,11 +1646,11 @@ describe('audioManger_audio2', function () {
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1680,11 +1677,11 @@ describe('audioManger_audio2', function () {
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1715,11 +1712,11 @@ describe('audioManger_audio2', function () {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1748,15 +1745,15 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
......@@ -1785,15 +1782,15 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
......@@ -1818,11 +1815,11 @@ describe('audioManger_audio2', function () {
console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1847,11 +1844,11 @@ describe('audioManger_audio2', function () {
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1876,11 +1873,11 @@ describe('audioManger_audio2', function () {
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1906,14 +1903,14 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
expect(false).assertTrue();
}
......@@ -1939,15 +1936,15 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
......@@ -1973,14 +1970,14 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null){
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
expect(true).assertTrue();
}
else{
else {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
expect(false).assertTrue();
}
......@@ -2002,13 +1999,13 @@ describe('audioManger_audio2', function () {
// Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL
promise.then(function () {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL');
audioManager.getRingerMode().then(function (value){
if(value==2){
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value);
audioManager.getRingerMode().then(function (value) {
if (value == 2) {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -2028,15 +2025,15 @@ describe('audioManger_audio2', function () {
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(function (){
promise.then(function () {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT');
audioManager.getRingerMode().then(function (value){
if(value==0){
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value);
audioManager.getRingerMode().then(function (value) {
if (value == 0) {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -2056,15 +2053,15 @@ describe('audioManger_audio2', function () {
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(function (){
promise.then(function () {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE');
audioManager.getRingerMode().then(function (value){
if(value==1){
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value);
audioManager.getRingerMode().then(function (value) {
if (value == 1) {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -2089,18 +2086,18 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_NORMAL: Error: ${err.message}`);
expect().assertFail();
}
else{
else {
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`);
expect().assertFail();
}
else if(value==2){
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value);
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);
else {
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -2126,19 +2123,19 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : setRingerMode RINGER_MODE_SILENT: Error: ${err.message}`);
expect().assertFail();
}
else{
else {
audioManager.getRingerMode((err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : RINGER_MODE_SILENT: Error: ${err.message}`);
expect().assertFail();
}
if(value==0){
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value);
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);
else {
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -2171,12 +2168,12 @@ describe('audioManger_audio2', function () {
expect().assertFail();
}
if(value==1){
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value);
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);
else {
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -2198,13 +2195,13 @@ describe('audioManger_audio2', function () {
const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL);
promise.then(function () {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL');
audioManager.getRingerMode().then(function (value){
if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' +value);
audioManager.getRingerMode().then(function (value) {
if (value == audio.AudioRingMode.RINGER_MODE_NORMAL) {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -2223,15 +2220,15 @@ describe('audioManger_audio2', function () {
*/
it('SUB_AUDIO_MANAGER_setRingerMode_008', 0, async function (done) {
const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT);
promise.then(function (){
promise.then(function () {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT');
audioManager.getRingerMode().then(function (value){
if(value==audio.AudioRingMode.RINGER_MODE_SILENT){
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' +value);
audioManager.getRingerMode().then(function (value) {
if (value == audio.AudioRingMode.RINGER_MODE_SILENT) {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT: FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -2250,15 +2247,15 @@ describe('audioManger_audio2', function () {
*/
it('SUB_AUDIO_MANAGER_setRingerMode_009', 0, async function (done) {
const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE);
promise.then(function (){
promise.then(function () {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE');
audioManager.getRingerMode().then(function (value){
if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value);
audioManager.getRingerMode().then(function (value) {
if (value == audio.AudioRingMode.RINGER_MODE_VIBRATE) {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -2288,12 +2285,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : RINGER_MODE_NORMAL: Error: ${err.message}`);
expect().assertFail();
}
else if(value==audio.AudioRingMode.RINGER_MODE_NORMAL){
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: PASS :' +value);
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);
else {
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_NORMAL: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -2325,12 +2322,12 @@ describe('audioManger_audio2', function () {
expect().assertFail();
}
if(value==audio.AudioRingMode.RINGER_MODE_SILENT){
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: PASS :' +value);
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);
else {
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_SILENT: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -2362,12 +2359,12 @@ describe('audioManger_audio2', function () {
expect().assertFail();
}
if(value==audio.AudioRingMode.RINGER_MODE_VIBRATE){
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: PASS :' +value);
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);
else {
console.info('AudioFrameworkTest: Callback: setRingerMode RINGER_MODE_VIBRATE: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -2386,7 +2383,7 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_006', 0, async function (done) {
audioManager.mute(audioMedia,false, (err) => {
audioManager.mute(audioMedia, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -2398,12 +2395,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : FALSE: Media : failed to get Mute Status ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: '+data);
else if (data == false) {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2422,16 +2419,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_005', 0, async function (done) {
await audioManager.mute(audioMedia,false).then(function () {
await audioManager.mute(audioMedia, false).then(function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: FALSE');
audioManager.isMute(audioMedia).then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: PASS:'+data);
expect(true).assertTrue();
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();
else {
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
});
}).catch((err) => {
......@@ -2450,7 +2447,7 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_008', 0, async function (done) {
audioManager.mute(audioRingtone,false, (err) => {
audioManager.mute(audioRingtone, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect(false).assertTrue();
......@@ -2462,12 +2459,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : failed to get Mute Status ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: PASS: '+data);
else if (data == false) {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2486,16 +2483,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_007', 0, async function (done) {
await audioManager.mute(audioRingtone,false).then(function () {
await audioManager.mute(audioRingtone, false).then(function () {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: FALSE');
audioManager.isMute(audioRingtone).then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: PASS:'+data);
expect(true).assertTrue();
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();
else {
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
});
}).catch((err) => {
......@@ -2514,7 +2511,7 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_015', 0, async function (done) {
audioManager.mute(audio.AudioVolumeType.MEDIA,false, (err) => {
audioManager.mute(audio.AudioVolumeType.MEDIA, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect().assertFail();
......@@ -2526,12 +2523,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : FALSE: Media : ENAME: failed to get Mute Status ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: PASS: '+data);
else if (data == false) {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: ENAME: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2550,16 +2547,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_011', 0, async function (done) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(function () {
await audioManager.mute(audio.AudioVolumeType.MEDIA, false).then(function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE');
audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data);
expect(true).assertTrue();
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();
else {
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
});
}).catch((err) => {
......@@ -2578,7 +2575,7 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_016', 0, async function (done) {
audioManager.mute(audio.AudioVolumeType.RINGTONE,false, (err) => {
audioManager.mute(audio.AudioVolumeType.RINGTONE, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Set Stream Mute: Media: Callback: Error : ${err.message}`);
expect().assertFail();
......@@ -2590,12 +2587,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : FALSE: Ringtone : ENAME: failed to get Mute Status ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: '+data);
else if (data == false) {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: ENAME: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2614,16 +2611,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_014', 0, async function (done) {
await audioManager.mute(audio.AudioVolumeType.MEDIA,false).then(function () {
await audioManager.mute(audio.AudioVolumeType.MEDIA, false).then(function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: ENAME: Promise: FALSE');
audioManager.isMute(audio.AudioVolumeType.MEDIA).then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: PASS:'+data);
expect(true).assertTrue();
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();
else {
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: ENAME: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
});
}).catch((err) => {
......@@ -2642,17 +2639,17 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_017', 0, async function (done) {
await audioManager.mute(audioMedia,true).then(function () {
await audioManager.mute(audioMedia, true).then(function () {
console.log('AudioFrameworkTest: Set Stream Mute: Media: Promise: TRUE');
audioManager.setVolume(audioMedia,lowVol);
audioManager.setVolume(audioMedia, lowVol);
audioManager.isMute(audioMedia).then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: PASS:'+data);
expect(true).assertTrue();
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();
else {
console.log('AudioFrameworkTest: Promise: Is Stream Mute Media: SetVolume: FAIL: ' + data);
expect(false).assertTrue();
}
});
}).catch((err) => {
......@@ -2662,7 +2659,7 @@ describe('audioManger_audio2', function () {
done();
})
/* *
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_018
* @tc.name : mute - Media - callback - SetVolume
* @tc.desc : mute - Media - callback - Enable mute - SetVolume
......@@ -2671,27 +2668,27 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_018', 0, async function (done) {
audioManager.mute(audioMedia,true,async (err) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`);
expect().assertFail();
}
else{
audioManager.mute(audioMedia, true, async (err) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`);
expect().assertFail();
}
else {
console.log('AudioFrameworkTest: Set Stream Mute: Media: Callback : TRUE');
await sleep(100);
await audioManager.setVolume(audioMedia,highVol);
await audioManager.setVolume(audioMedia, highVol);
await sleep(100);
audioManager.isMute(audioMedia, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Media : failed to get Mute Status ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: PASS: '+data);
else if (data == false) {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Media: SetVolume: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2701,7 +2698,7 @@ describe('audioManger_audio2', function () {
});
})
/* *
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_019
* @tc.name : mute - Ringtone - Promise - SetVolume
* @tc.desc : mute - Ringtone - Promise - Enable mute - SetVolume
......@@ -2710,19 +2707,19 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_019', 0, async function (done) {
await audioManager.mute(audioRingtone,true).then(async function () {
await audioManager.mute(audioRingtone, true).then(async function () {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Promise: SetVolume');
await audioManager.setVolume(audioRingtone,highVol);
await audioManager.setVolume(audioRingtone, highVol);
await audioManager.isMute(audioRingtone).then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: Is Stream Mute Ringtone: SetVolume: PASS:'+data);
expect(true).assertTrue();
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();
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);
expect(false).assertTrue();
......@@ -2730,7 +2727,7 @@ describe('audioManger_audio2', function () {
done();
})
/* *
/* *
* @tc.number : SUB_AUDIO_MANAGER_mute_020
* @tc.name : mute - Ringtone - callback - SetVolume
* @tc.desc : mute - Ringtone - callback - Enable mute - SetVolume
......@@ -2739,25 +2736,25 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_mute_020', 0, async function (done) {
audioManager.mute(audioRingtone,true, (err) => {
if (err) {
audioManager.mute(audioRingtone, true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`);
expect().assertFail();
}
else {
console.log('AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : SetVolume');
audioManager.setVolume(audioRingtone,lowVol);
audioManager.setVolume(audioRingtone, lowVol);
audioManager.isMute(audioRingtone, (err, data) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : SetVolume: Ringtone : failed to get Mute Status ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: PASS: '+data);
else if (data == false) {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : Is Stream Mute Ringtone: SetVolume: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2779,12 +2776,12 @@ describe('audioManger_audio2', function () {
console.log('AudioFrameworkTest: Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS');
const promise = audioManager.isActive(audioMedia);
promise.then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
});
......@@ -2807,12 +2804,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : Media : isActive: failed ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Callback: isActive: Media: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2831,12 +2828,12 @@ describe('audioManger_audio2', function () {
console.log('AudioFrameworkTest: Promise : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS');
const promise = audioManager.isActive(audioRingtone);
promise.then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
});
......@@ -2859,12 +2856,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : Ringtone : isActive: failed ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2883,12 +2880,12 @@ describe('audioManger_audio2', function () {
console.log('AudioFrameworkTest: Promise : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS');
const promise = audioManager.isActive(audio.AudioVolumeType.MEDIA);
promise.then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
});
......@@ -2911,12 +2908,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : Media : ENAME: isActive: failed ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Callback: isActive: Media: ENAME: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2935,12 +2932,12 @@ describe('audioManger_audio2', function () {
console.log('AudioFrameworkTest: Promise : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS');
const promise = audioManager.isActive(audio.AudioVolumeType.RINGTONE);
promise.then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
});
......@@ -2963,12 +2960,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : Ringtone : ENAME: isActive: failed ${err.message}`);
expect().assertFail();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: PASS:'+data);
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);
else {
console.log('AudioFrameworkTest: Callback: isActive: Ringtone: ENAME: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -2987,13 +2984,13 @@ describe('audioManger_audio2', function () {
await audioManager.setMicrophoneMute(true).then(function () {
console.log('AudioFrameworkTest: setMicrophoneMute: Promise: TRUE');
audioManager.isMicrophoneMute().then(function (data) {
if(data==true){
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: PASS:'+data);
expect(true).assertTrue();
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();
else {
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
});
}).catch((err) => {
......@@ -3015,13 +3012,13 @@ describe('audioManger_audio2', function () {
await audioManager.setMicrophoneMute(false).then(function () {
console.log('AudioFrameworkTest: setMicrophoneMute: Promise: FALSE');
audioManager.isMicrophoneMute().then(function (data) {
if(data==false){
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: PASS:'+data);
expect(true).assertTrue();
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();
else {
console.log('AudioFrameworkTest: Promise: isMicrophoneMute: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
});
}).catch((err) => {
......@@ -3052,12 +3049,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : TRUE: isMicrophoneMute : Error ${err.message}`);
expect(false).assertTrue();
}
else if(data==true){
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: PASS: '+data);
else if (data == true) {
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: TRUE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -3088,12 +3085,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : FALSE: isMicrophoneMute : Error ${err.message}`);
expect(false).assertTrue();
}
else if(data==false){
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: PASS: '+data);
else if (data == false) {
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: PASS: ' + data);
expect(true).assertTrue();
}
else{
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: FAIL: '+data);
else {
console.log('AudioFrameworkTest: Callback : isMicrophoneMute: FALSE: FAIL: ' + data);
expect(false).assertTrue();
}
done();
......@@ -3112,15 +3109,15 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_001', 0, async function (done) {
await audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO,true).then(function (){
await audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO, true).then(function () {
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Activate');
audioManager.isDeviceActive(7).then(function (value){
if(value==true){
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :' +value);
audioManager.isDeviceActive(7).then(function (value) {
if (value == true) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Activate : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3140,22 +3137,22 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_002', 0, async function (done) {
await audioManager.setDeviceActive(2,false).then(function (){
await audioManager.setDeviceActive(2, false).then(function () {
// Setting device active ENUM 2 = SPEAKER
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate');
audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value){
if(value==false){
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate');
audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value) {
if (value == false) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' + value);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
})
......@@ -3169,21 +3166,21 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_003', 0, async function (done) {
await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER,true).then(function (){
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate');
audioManager.isDeviceActive(2).then(function (value){
if(value==true){
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' +value);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message);
expect(false).assertTrue();
await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true).then(function () {
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate');
audioManager.isDeviceActive(2).then(function (value) {
if (value == true) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' + value);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' + value);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message);
expect(false).assertTrue();
});
done();
})
......@@ -3197,22 +3194,22 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_004', 0, async function (done) {
await audioManager.setDeviceActive(7,false).then(function (){
await audioManager.setDeviceActive(7, false).then(function () {
// Setting device active ENUM 3 = BLUETOOTH_SCO
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate');
audioManager.isDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO).then(function (value){
if(value==false){
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : BLUETOOTH_SCO: Deactivate');
audioManager.isDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO).then(function (value) {
if (value == false) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' + value);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' + value);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL : Error :' + err.message);
expect(false).assertTrue();
});
done();
})
......@@ -3226,24 +3223,24 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_005', 0, async function (done) {
audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO,true, (err) => {
audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO, true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active');
audioManager.isDeviceActive(7,(err, value) => {
audioManager.isDeviceActive(7, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value==true){
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :' +value);
else if (value == true) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Active : FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3262,24 +3259,24 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_006', 0, async function (done) {
audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER,false, (err) => {
audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active');
audioManager.isDeviceActive(2,(err, value) => {
audioManager.isDeviceActive(2, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value==false){
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' +value);
else if (value == false) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3298,24 +3295,24 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_007', 0, async function (done) {
audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER,true, (err) => {
audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active');
audioManager.isDeviceActive(2,(err, value) => {
audioManager.isDeviceActive(2, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value==true){
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' +value);
else if (value == true) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3334,24 +3331,24 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setDeviceActive_008', 0, async function (done) {
audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO,false, (err) => {
audioManager.setDeviceActive(audio.ActiveDeviceType.BLUETOOTH_SCO, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : BLUETOOTH_SCO: Active');
audioManager.isDeviceActive(7,(err, value) => {
audioManager.isDeviceActive(7, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value==false){
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' +value);
else if (value == false) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : BLUETOOTH_SCO: Deactivate : FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3373,13 +3370,13 @@ describe('audioManger_audio2', function () {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='8 bit'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: Bits per sample : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '8 bit') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: Bits per sample : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : Bits per sample : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : Bits per sample : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3400,13 +3397,13 @@ describe('audioManger_audio2', function () {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='4800'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '4800') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3424,16 +3421,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_003', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS',longValue);
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue);
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value==longValue){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == longValue) {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3454,13 +3451,13 @@ describe('audioManger_audio2', function () {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.000000234324324324');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='10.000000234324324324'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '10.000000234324324324') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3469,25 +3466,25 @@ describe('audioManger_audio2', function () {
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_005
* @tc.name : setAudioParameter - Promise - Parameter name Number
* @tc.desc : setAudioParameter - Promise - Parameter name Number
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_005', 0, async function (done) {
/* *
* @tc.number : SUB_AUDIO_MANAGER_setAudioParameter_005
* @tc.name : setAudioParameter - Promise - Parameter name Number
* @tc.desc : setAudioParameter - Promise - Parameter name Number
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_setAudioParameter_005', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='PPNumber'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == 'PPNumber') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3508,13 +3505,13 @@ describe('audioManger_audio2', function () {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='[]\:";<>?,./~!@#$%^*()_+-={}|'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '[]\:";<>?,./~!@#$%^*()_+-={}|') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3538,18 +3535,18 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`);
expect(false).assertTrue();
}
else{
else {
audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='16 bit'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '16 bit') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3574,18 +3571,18 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`);
expect(false).assertTrue();
}
else{
else {
audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParam: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '~!@#$%^*()_+-={}|[]\:";<>?,./') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3610,18 +3607,18 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`);
expect(false).assertTrue();
}
else{
else {
audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback :getAudioParm: VOICE_PHONE_STATUS:Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='10000.21321432432432'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '10000.21321432432432') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3646,18 +3643,18 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : setAudioParameter: VOICE_PHONE_STATUS : Error: ${err.message}`);
expect(false).assertTrue();
}
else{
else {
audioManager.getAudioParameter('VOICE_PHONE_STATUS', (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Callback : getAudioParam: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='5454'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '5454') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3687,12 +3684,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value==longValue){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == longValue) {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3721,12 +3718,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='xyza'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == 'xyza') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3744,16 +3741,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioParameter_001', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit');
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='8 bit'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '8 bit') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3771,16 +3768,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioParameter_002', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800');
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='4800'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '4800') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3798,16 +3795,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioParameter_003', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue);
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue);
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value==longValue){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == longValue) {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3825,16 +3822,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioParameter_004', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.0000000000234');
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.0000000000234');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='10.0000000000234'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '10.0000000000234') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3843,25 +3840,25 @@ describe('audioManger_audio2', function () {
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_005
* @tc.name : getAudioParameter - Promise - Parameter name Number
* @tc.desc : getAudioParameter - Promise - Parameter name Number
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioParameter_005', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber');
/* *
* @tc.number : SUB_AUDIO_MANAGER_getAudioParameter_005
* @tc.name : getAudioParameter - Promise - Parameter name Number
* @tc.desc : getAudioParameter - Promise - Parameter name Number
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioParameter_005', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='PPNumber'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == 'PPNumber') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3879,16 +3876,16 @@ describe('audioManger_audio2', function () {
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_getAudioParameter_006', 0, async function (done) {
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|');
const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|');
promise.then(function () {
console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter');
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value){
if(value=='[]\:";<>?,./~!@#$%^*()_+-={}|'){
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' +value);
audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) {
if (value == '[]\:";<>?,./~!@#$%^*()_+-={}|') {
console.info('AudioFrameworkTest: Promise: getAudioParameter: VOICE_PHONE_STATUS : PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' +value);
else {
console.info('AudioFrameworkTest: Promise: getAudioParameter : VOICE_PHONE_STATUS : FAIL :' + value);
expect(false).assertTrue();
}
});
......@@ -3917,12 +3914,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='16 bit'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '16 bit') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3951,12 +3948,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='~!@#$%^*()_+-={}|[]\:";<>?,./'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '~!@#$%^*()_+-={}|[]\:";<>?,./') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -3985,12 +3982,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='10000.21321432432432'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '10000.21321432432432') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -4019,12 +4016,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='5454'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == '5454') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -4053,12 +4050,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value==longValue){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == longValue) {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -4087,12 +4084,12 @@ describe('audioManger_audio2', function () {
console.error(`AudioFrameworkTest: Callback : getAudioParameter: VOICE_PHONE_STATUS: Error: ${err.message}`);
expect(false).assertTrue();
}
else if(value=='xyza'){
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' +value);
else if (value == 'xyza') {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: PASS :' + value);
expect(true).assertTrue();
}
else{
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' +value);
else {
console.info('AudioFrameworkTest: Callback: getAudioParameter: VOICE_PHONE_STATUS: FAIL :' + value);
expect(false).assertTrue();
}
done();
......@@ -4100,4 +4097,125 @@ describe('audioManger_audio2', function () {
done();
});
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_001
* @tc.name : InterruptType - INTERRUPT_TYPE_BEGIN
* @tc.desc : InterruptType - INTERRUPT_TYPE_BEGIN
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_001', 0, async function (done) {
expect(audio.InterruptType.INTERRUPT_TYPE_BEGIN).assertEqual(1);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_002
* @tc.name : InterruptType - INTERRUPT_TYPE_END
* @tc.desc : InterruptType - INTERRUPT_TYPE_END
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_002', 0, async function (done) {
expect(audio.InterruptType.INTERRUPT_TYPE_END).assertEqual(2);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_003
* @tc.name : InterruptHint - INTERRUPT_HINT_NONE
* @tc.desc : InterruptHint - INTERRUPT_HINT_NONE
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_003', 0, async function (done) {
expect(audio.InterruptHint.INTERRUPT_HINT_NONE).assertEqual(0);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_004
* @tc.name : InterruptHint - INTERRUPT_HINT_RESUME
* @tc.desc : InterruptHint - INTERRUPT_HINT_RESUME
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_004', 0, async function (done) {
expect(audio.InterruptHint.INTERRUPT_HINT_RESUME).assertEqual(1);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_005
* @tc.name : InterruptHint - INTERRUPT_HINT_PAUSE
* @tc.desc : InterruptHint - INTERRUPT_HINT_PAUSE
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_005', 0, async function (done) {
expect(audio.InterruptHint.INTERRUPT_HINT_PAUSE).assertEqual(2);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_006
* @tc.name : InterruptHint - INTERRUPT_HINT_STOP
* @tc.desc : InterruptHint - INTERRUPT_HINT_STOP
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_006', 0, async function (done) {
expect(audio.InterruptHint.INTERRUPT_HINT_STOP).assertEqual(3);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_007
* @tc.name : InterruptHint - INTERRUPT_HINT_DUCK
* @tc.desc : InterruptHint - INTERRUPT_HINT_DUCK
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_007', 0, async function (done) {
expect(audio.InterruptHint.INTERRUPT_HINT_DUCK).assertEqual(4);
await sleep(50);
done();
})
/* *
* @tc.number : SUB_AUDIO_MANAGER_interrupt_008
* @tc.name : InterruptHint - INTERRUPT_HINT_UNDUCK
* @tc.desc : InterruptHint - INTERRUPT_HINT_UNDUCK
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_AUDIO_MANAGER_interrupt_008', 0, async function (done) {
expect(audio.InterruptHint.INTERRUPT_HINT_UNDUCK).assertEqual(5);
await sleep(50);
done();
})
})
\ No newline at end of file
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "480000",
"package": "ohos.acts.multimedia.image",
"shell-timeout": "120000"
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "480000",
"package": "ohos.acts.multimedia.image",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImageJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
"kits": [
{
"type": "ShellKit",
"run-command": [
"mkdir /data/accounts/account_0/appdata/image",
"chmod -R 666 /data/accounts/account_0/appdata/image/*"
],
"teardown-command":[
]
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./resource/image/test.tiff ->/data/accounts/account_0/appdata/image",
"./resource/image/test.123 ->/data/accounts/account_0/appdata/image",
"./resource/image/test.bmp ->/data/accounts/account_0/appdata/image",
"./resource/image/test.png ->/data/accounts/account_0/appdata/image",
"./resource/image/test.gif ->/data/accounts/account_0/appdata/image",
"./resource/image/test.jpg ->/data/accounts/account_0/appdata/image",
"./resource/image/test_exif.jpg ->/data/accounts/account_0/appdata/image",
"./resource/image/moving_test.gif ->/data/accounts/account_0/appdata/image"
]
},
{
"test-file-name": [
"ActsImageJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
{
"type": "ShellKit",
"run-command": [
"mkdir /data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache/",
"chmod -R 666 /data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache/*"
],
"teardown-command":[
]
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./resource/image/test.tiff ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/test.123 ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/test.bmp ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/test.png ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/test.gif ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/test.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/test.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/test_exif.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache",
"./resource/image/moving_test.gif ->/data/app/el2/100/base/ohos.acts.multimedia.image/haps/entry/cache"
]
}
]
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册