Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ff9de41c
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ff9de41c
编写于
3月 29, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 29, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8288 【媒体子系统】新增audio覆盖
Merge pull request !8288 from 秦莉文/OpenHarmony-3.2-Release
上级
ca0fba4f
07908fe4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
838 addition
and
830 deletion
+838
-830
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
...rd/audioManager/src/main/js/test/AudioManagerApi9.test.js
+838
-830
未找到文件。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
浏览文件 @
ff9de41c
...
@@ -17,598 +17,606 @@ import audio from '@ohos.multimedia.audio';
...
@@ -17,598 +17,606 @@ import audio from '@ohos.multimedia.audio';
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
export
default
function
audioManagerApi9
()
{
export
default
function
audioManagerApi9
()
{
describe
(
'
audioManagerApi9
'
,
function
()
{
describe
(
'
audioManagerApi9
'
,
function
()
{
let
TagFrmwk
=
"
audioManagerApi9Test
"
;
let
TagFrmwk
=
"
audioManagerApi9Test
"
;
console
.
info
(
`
${
TagFrmwk
}
: Create AudioManger Object JS Framework`
);
console
.
info
(
`
${
TagFrmwk
}
: Create AudioManger Object JS Framework`
);
let
audioManager
=
null
;
let
audioManager
=
null
;
let
streamManager
=
null
;
let
streamManager
=
null
;
let
audioMedia
=
3
;
let
audioMedia
=
3
;
let
audioRingtone
=
2
;
let
audioRingtone
=
2
;
let
minVol
=
0
;
let
minVol
=
0
;
let
maxVol
=
15
;
let
maxVol
=
15
;
let
lowVol
=
5
;
let
lowVol
=
5
;
let
highVol
=
14
;
let
highVol
=
14
;
let
outOfRangeVol
=
28
;
let
outOfRangeVol
=
28
;
let
longValue
=
'
28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843
'
;
let
longValue
=
'
28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843
'
;
let
volNetworkId
=
null
;
let
volNetworkId
=
null
;
let
volGroupId
=
null
;
let
volGroupId
=
null
;
let
volMappingId
=
null
;
let
volMappingId
=
null
;
let
volGroupName
=
null
;
let
volGroupName
=
null
;
let
volConnectType
=
null
;
let
volConnectType
=
null
;
function
displayVolumeGroupProp
(
value
,
index
,
array
)
{
function
displayVolumeGroupProp
(
value
,
index
,
array
)
{
console
.
info
(
'
audioManagerApi9Test: volume group networkId:
'
+
value
.
networkId
);
console
.
info
(
'
audioManagerApi9Test: volume group networkId:
'
+
value
.
networkId
);
volNetworkId
=
value
.
networkId
;
volNetworkId
=
value
.
networkId
;
console
.
info
(
'
audioManagerApi9Test: volume group id:
'
+
value
.
groupId
);
console
.
info
(
'
audioManagerApi9Test: volume group id:
'
+
value
.
groupId
);
volGroupId
=
value
.
groupId
;
volGroupId
=
value
.
groupId
;
console
.
info
(
'
audioManagerApi9Test: volume group mappingId:
'
+
value
.
mappingId
);
console
.
info
(
'
audioManagerApi9Test: volume group mappingId:
'
+
value
.
mappingId
);
volMappingId
=
value
.
mappingId
;
volMappingId
=
value
.
mappingId
;
console
.
info
(
'
audioManagerApi9Test: volume group name:
'
+
value
.
groupName
);
console
.
info
(
'
audioManagerApi9Test: volume group name:
'
+
value
.
groupName
);
volGroupName
=
value
.
groupName
;
volGroupName
=
value
.
groupName
;
console
.
info
(
'
audioManagerApi9Test: volume group connect type:
'
+
value
.
ConnectType
);
console
.
info
(
'
audioManagerApi9Test: volume group connect type:
'
+
value
.
ConnectType
);
volConnectType
=
value
.
ConnectType
;
volConnectType
=
value
.
ConnectType
;
}
function
getAudioManager
()
{
audioManager
=
audio
.
getAudioManager
();
if
(
audioManager
!=
null
)
{
console
.
info
(
`
${
TagFrmwk
}
: getAudioManger : PASS`
);
}
}
else
{
function
getAudioManager
()
{
console
.
info
(
`
${
TagFrmwk
}
: getAudioManger : FAIL`
);
audioManager
=
audio
.
getAudioManager
();
if
(
audioManager
!=
null
)
{
console
.
info
(
`
${
TagFrmwk
}
: getAudioManger : PASS`
);
}
else
{
console
.
info
(
`
${
TagFrmwk
}
: getAudioManger : FAIL`
);
}
}
}
}
function
getStreamManager
()
{
function
getStreamManager
()
{
streamManager
=
audioManager
.
getStreamManager
();
streamManager
=
audioManager
.
getStreamManager
();
if
(
streamManager
!=
null
)
{
if
(
streamManager
!=
null
)
{
console
.
info
(
`
${
TagFrmwk
}
: getStreamManager : PASS`
);
console
.
info
(
`
${
TagFrmwk
}
: getStreamManager : PASS`
);
}
else
{
console
.
info
(
`
${
TagFrmwk
}
: getStreamManager : FAIL`
);
}
}
}
else
{
function
sleep
(
ms
)
{
console
.
info
(
`
${
TagFrmwk
}
: getStreamManager : FAIL`
);
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
)
);
}
}
}
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
beforeAll
(
async
function
()
{
console
.
info
(
`
${
TagFrmwk
}
: beforeAll: Prerequisites at the test suite level`
);
await
sleep
(
100
);
await
getAudioManager
();
getStreamManager
();
console
.
info
(
`
${
TagFrmwk
}
: beforeAll: END`
);
})
beforeEach
(
async
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
`
${
TagFrmwk
}
: beforeEach: Prerequisites at the test case level`
);
console
.
info
(
`
${
TagFrmwk
}
: beforeAll: Prerequisites at the test suite level`
);
await
sleep
(
100
);
await
sleep
(
100
);
})
await
getAudioManager
();
getStreamManager
();
console
.
info
(
`
${
TagFrmwk
}
: beforeAll: END`
);
})
after
Each
(
async
function
()
{
before
Each
(
async
function
()
{
console
.
info
(
`
${
TagFrmwk
}
: afterEach: Test case-level clearance conditions
`
);
console
.
info
(
`
${
TagFrmwk
}
: beforeEach: Prerequisites at the test case level
`
);
await
sleep
(
100
);
await
sleep
(
100
);
})
})
afterAll
(
function
()
{
afterEach
(
async
function
()
{
console
.
info
(
`
${
TagFrmwk
}
: afterAll: Test suite-level cleanup condition`
);
console
.
info
(
`
${
TagFrmwk
}
: afterEach: Test case-level clearance conditions`
);
})
await
sleep
(
100
);
})
afterAll
(
function
()
{
console
.
info
(
`
${
TagFrmwk
}
: afterAll: Test suite-level cleanup condition`
);
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ERRORS_0100
*@tc.name : AUDIO_ERRORS
*@tc.desc : AUDIO_ERRORS
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ERRORS_0100
'
,
2
,
async
function
(
done
)
{
expect
(
audio
.
AudioErrors
.
ERROR_INVALID_PARAM
).
assertEqual
(
6800101
);
expect
(
audio
.
AudioErrors
.
ERROR_NO_MEMORY
).
assertEqual
(
6800102
);
expect
(
audio
.
AudioErrors
.
ERROR_ILLEGAL_STATE
).
assertEqual
(
6800103
);
expect
(
audio
.
AudioErrors
.
ERROR_UNSUPPORTED
).
assertEqual
(
6800104
);
expect
(
audio
.
AudioErrors
.
ERROR_TIMEOUT
).
assertEqual
(
6800105
);
expect
(
audio
.
AudioErrors
.
ERROR_STREAM_LIMIT
).
assertEqual
(
6800201
);
expect
(
audio
.
AudioErrors
.
ERROR_SYSTEM
).
assertEqual
(
6800301
);
await
sleep
(
50
);
done
();
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_DEFAULT_VOLUME_GROUP_ID_0100
*@tc.number : SUB_MULTIMEDIA_AUDIO_ERRORS_0100
*@tc.name : DEFAULT_VOLUME_GROUP_ID
*@tc.name : AUDIO_ERRORS
*@tc.desc : DEFAULT_VOLUME_GROUP_ID
*@tc.desc : AUDIO_ERRORS
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_DEFAULT_VOLUME_GROUP_ID_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ERRORS_0100
'
,
2
,
async
function
(
done
)
{
expect
(
audio
.
DEFAULT_VOLUME_GROUP_ID
).
assertEqual
(
1
);
expect
(
audio
.
AudioErrors
.
ERROR_INVALID_PARAM
).
assertEqual
(
6800101
);
await
sleep
(
50
);
expect
(
audio
.
AudioErrors
.
ERROR_NO_MEMORY
).
assertEqual
(
6800102
);
done
();
expect
(
audio
.
AudioErrors
.
ERROR_ILLEGAL_STATE
).
assertEqual
(
6800103
);
})
expect
(
audio
.
AudioErrors
.
ERROR_UNSUPPORTED
).
assertEqual
(
6800104
);
expect
(
audio
.
AudioErrors
.
ERROR_TIMEOUT
).
assertEqual
(
6800105
);
expect
(
audio
.
AudioErrors
.
ERROR_STREAM_LIMIT
).
assertEqual
(
6800201
);
expect
(
audio
.
AudioErrors
.
ERROR_SYSTEM
).
assertEqual
(
6800301
);
await
sleep
(
50
);
done
();
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_DEFAULT_INTERRUPT
_GROUP_ID_0100
*@tc.number : SUB_MULTIMEDIA_DEFAULT_VOLUME
_GROUP_ID_0100
*@tc.name : DEFAULT_INTERRUPT
_GROUP_ID
*@tc.name : DEFAULT_VOLUME
_GROUP_ID
*@tc.desc : DEFAULT_INTERRUPT
_GROUP_ID
*@tc.desc : DEFAULT_VOLUME
_GROUP_ID
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_DEFAULT_INTERRUPT
_GROUP_ID_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_DEFAULT_VOLUME
_GROUP_ID_0100
'
,
2
,
async
function
(
done
)
{
expect
(
audio
.
DEFAULT_INTERRUPT
_GROUP_ID
).
assertEqual
(
1
);
expect
(
audio
.
DEFAULT_VOLUME
_GROUP_ID
).
assertEqual
(
1
);
await
sleep
(
50
);
await
sleep
(
50
);
done
();
done
();
})
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_COMUNICATIONDEVICETYPE_0100
*@tc.number : SUB_MULTIMEDIA_DEFAULT_INTERRUPT_GROUP_ID_0100
*@tc.name : COMUNICATIONDEVICETYPE
*@tc.name : DEFAULT_INTERRUPT_GROUP_ID
*@tc.desc : COMUNICATIONDEVICETYPE
*@tc.desc : DEFAULT_INTERRUPT_GROUP_ID
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_COMUNICATIONDEVICETYPE_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_DEFAULT_INTERRUPT_GROUP_ID_0100
'
,
2
,
async
function
(
done
)
{
expect
(
audio
.
CommunicationDeviceType
.
SPEAKER
).
assertEqual
(
2
);
expect
(
audio
.
DEFAULT_INTERRUPT_GROUP_ID
).
assertEqual
(
1
);
await
sleep
(
50
);
await
sleep
(
50
);
done
();
done
();
})
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0100
*@tc.number : SUB_MULTIMEDIA_COMUNICATIONDEVICETYPE_0100
* @tc.name : getVolumeGroupManager - callback
*@tc.name : COMUNICATIONDEVICETYPE
* @tc.desc : getVolumeGroupManager
*@tc.desc : COMUNICATIONDEVICETYPE
* @tc.size : MEDIUM
*@tc.size : MEDIUM
* @tc.type : Function
*@tc.type : Function
* @tc.level : Level 3
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0100
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_COMUNICATIONDEVICETYPE_0100
'
,
2
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
expect
(
audio
.
CommunicationDeviceType
.
SPEAKER
).
assertEqual
(
2
);
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
,
(
err
,
groupManager
)
=>
{
await
sleep
(
50
);
if
(
err
)
{
done
();
console
.
error
(
`audioManagerApi9Test: failed to getGroupManager: Callback:
${
err
.
message
}
`
);
})
expect
(
false
).
assertTrue
();
}
else
{
/**
if
((
typeof
groupManager
)
==
'
object
'
){
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0100
* @tc.name : getVolumeGroupManager - callback
* @tc.desc : getVolumeGroupManager
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0100
'
,
3
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
,
(
err
,
groupManager
)
=>
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to getGroupManager: Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
if
((
typeof
groupManager
)
==
'
object
'
)
{
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : PASS
'
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : FAIL
'
);
expect
(
false
).
assertTrue
();
}
}
done
();
})
})
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0200
* @tc.name : getVolumeGroupManager - prmiose
* @tc.desc : getVolumeGroupManager
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0200
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
if
((
typeof
groupManager
)
==
'
object
'
)
{
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : PASS
'
);
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : PASS
'
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
}
else
{
else
{
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : FAIL
'
);
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : FAIL
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getGroupManager: parameter err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
}
done
();
done
();
})
})
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0100
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0200
* @tc.name : group manager getVolume - MEDIA - Callback
* @tc.name : getVolumeGroupManager - prmiose
* @tc.desc : group manager getvolume
* @tc.desc : getVolumeGroupManager
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 3
* @tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0100
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_0200
'
,
3
,
async
function
(
done
)
{
let
groupManager
;
try
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
if
((
typeof
groupManager
)
==
'
object
'
){
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : PASS
'
);
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: Promise: getGroupManager : FAIL
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
}
}
catch
(
err
){
groupManager
.
getVolume
(
audio
.
AudioVolumeType
.
MEDIA
,
(
err
,
value
)
=>
{
console
.
info
(
'
audioManagerApi9Test: getGroupManager: parameter err:
'
+
err
.
message
);
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
error
(
`audioManagerApi9Test: callback : Meida: failed to get volume
${
err
.
message
}
`
);
done
();
expect
(
false
).
assertTrue
();
}
}
done
();
else
if
(
value
>=
minVol
&&
value
<=
maxVol
)
{
})
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: FAIL :
'
+
value
);
expect
(
false
).
assertTrue
();
}
done
();
});
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0100
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0200
* @tc.name : group manager getVolume - MEDIA - Callback
* @tc.name : group manager getVolume - MEDIA - Promise
* @tc.desc : group manager getvolume
* @tc.desc : group manager getvolume
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 3
* @tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0100
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0200
'
,
3
,
async
function
(
done
)
{
let
groupManager
;
try
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
value
=
await
groupManager
.
getVolume
(
audio
.
AudioVolumeType
.
MEDIA
);
}
catch
(
err
){
if
(
value
>=
minVol
&&
value
<=
maxVol
)
{
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: PASS :
'
+
value
);
expect
(
false
).
assertTrue
();
expect
(
true
).
assertTrue
();
done
();
}
}
else
{
groupManager
.
getVolume
(
audio
.
AudioVolumeType
.
MEDIA
,
(
err
,
value
)
=>
{
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: FAIL :
'
+
value
);
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
error
(
`audioManagerApi9Test: callback : Meida: failed to get volume
${
err
.
message
}
`
);
}
done
();
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
}
else
if
(
value
>=
minVol
&&
value
<=
maxVol
)
{
})
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: PASS :
'
+
value
);
expect
(
true
).
assertTrue
();
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0100
* @tc.name : getMaxVolume - RINGTONE - Callback
* @tc.desc : getMaxVolume
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0100
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
groupManager
.
getMaxVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to getMaxVolume: Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
if
(
data
==
maxVol
)
{
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMaxVolume: PASS :
'
+
data
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMaxVolume: FAIL :
'
+
data
);
expect
(
false
).
assertTrue
();
}
}
done
();
});
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
}
else
{
})
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: FAIL :
'
+
value
);
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0200
* @tc.name : getMaxVolume - RINGTONE - Promise
* @tc.desc : getMaxVolume
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0200
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
maxVolume
=
await
groupManager
.
getMaxVolume
(
audio
.
AudioVolumeType
.
RINGTONE
);
if
(
maxVolume
==
maxVol
)
{
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMaxVolume: PASS :
'
+
maxVolume
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMaxVolume: FAIL :
'
+
maxVolume
);
expect
(
false
).
assertTrue
();
}
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
done
();
done
();
});
})
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0200
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0100
* @tc.name : group manager getVolume - MEDIA - Promise
* @tc.name : getMinVolume - RINGTONE - Callback
* @tc.desc : group manager getvolume
* @tc.desc : getMinVolume
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 3
* @tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETVOLUME_0200
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0100
'
,
2
,
async
function
(
done
)
{
try
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
value
=
await
groupManager
.
getVolume
(
audio
.
AudioVolumeType
.
MEDIA
);
groupManager
.
getMinVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
(
err
,
data
)
=>
{
if
(
value
>=
minVol
&&
value
<=
maxVol
)
{
if
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: PASS :
'
+
value
);
console
.
error
(
`audioManagerApi9Test: failed to getMinVolume : Callback:
${
err
.
message
}
`
);
expect
(
true
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
else
{
if
(
data
==
minVol
)
{
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMinVolume: PASS :
'
+
data
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMinVolume: FAIL :
'
+
data
);
expect
(
false
).
assertTrue
();
}
}
done
();
});
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
}
else
{
})
console
.
info
(
'
audioManagerApi9Test: callback : Meida getVolume: FAIL :
'
+
value
);
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0200
* @tc.name : getMaxVolume - RINGTONE - Promise
* @tc.desc : getMaxVolume
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0200
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
minVolume
=
await
groupManager
.
getMinVolume
(
audio
.
AudioVolumeType
.
RINGTONE
);
if
(
minVolume
==
minVol
)
{
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMinVolume: PASS :
'
+
minVolume
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMinVolume: FAIL :
'
+
minVolume
);
expect
(
false
).
assertTrue
();
}
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
done
();
done
();
}
catch
(
err
){
})
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0100
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0100
* @tc.name : getMaxVolume - RINGTONE - Callback
* @tc.name : group manager ismute - RINGTONE - Callback
* @tc.desc : getMaxVolume
* @tc.desc : ismute - RINGTONE - Callback
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 3
* @tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0100
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0100
'
,
3
,
async
function
(
done
)
{
try
{
let
groupManager
;
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
try
{
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
groupManager
.
getMaxVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
(
err
,
data
)
=>
{
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getGroupManager mute : parameter err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
groupManager
.
isMute
(
audio
.
AudioVolumeType
.
RINGTONE
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to
getMaxVolume
: Callback:
${
err
.
message
}
`
);
console
.
error
(
`audioManagerApi9Test: failed to
isMute
: Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
else
{
else
{
if
(
data
==
maxVol
)
{
console
.
log
(
`audioManagerApi9Test: Promise:
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMaxVolume: PASS :
'
+
data
);
Is Stream GroupManager Mute RINGTONE: FALSE: PASS:`
+
data
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMaxVolume: FAIL :
'
+
data
);
expect
(
false
).
assertTrue
();
}
}
}
done
();
done
();
});
})
}
catch
(
err
){
})
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0200
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0200
* @tc.name : getMaxVolume - RINGTONE - Promise
* @tc.name : group manager ismute - RINGTONE - Promise
* @tc.desc : getMaxVolume
* @tc.desc : ismute - RINGTONE - Promise
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 3
* @tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMAXVOLUME_0200
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0200
'
,
3
,
async
function
(
done
)
{
try
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
maxVolume
=
await
groupManager
.
getMaxVolume
(
audio
.
AudioVolumeType
.
RINGTONE
);
await
groupManager
.
isMute
(
audio
.
AudioVolumeType
.
RINGTONE
).
then
(
function
(
data
)
{
if
(
maxVolume
==
maxVol
)
{
console
.
log
(
`audioManagerApi9Test: Promise:
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMaxVolume: PASS :
'
+
maxVolume
);
Is Stream GroupManager Mute RINGTONE: FALSE: PASS:`
+
data
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
done
();
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMaxVolume: FAIL :
'
+
maxVolume
);
console
.
info
(
`audioManagerApi9Test: Promise:
Is Stream GroupManager Mute RINGTONE: FALSE: ERROR:`
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
});
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getGroupManager ismute : parameter err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
}
}
catch
(
err
){
})
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
}
done
();
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0100
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100
* @tc.name : getMinVolume - RINGTONE - Callback
*@tc.name : OnVolumeChange - setVolume - RINGTONE
* @tc.desc : getMinVolume
*@tc.desc : OnVolumeChange - setVolume - RINGTONE
* @tc.size : MEDIUM
*@tc.size : MEDIUM
* @tc.type : Function
*@tc.type : Function
* @tc.level : Level 2
*@tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
await
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
7
);
groupManager
.
getMinVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
(
err
,
data
)
=>
{
audioVolumeManager
.
on
(
'
volumeChange
'
,
(
VolumeEvent
)
=>
{
console
.
info
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100 AudioVolumeType is
'
+
VolumeEvent
.
volumeType
)
console
.
info
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100 volume is
'
+
VolumeEvent
.
volume
)
console
.
info
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100 updateUi is
'
+
VolumeEvent
.
updateUi
)
expect
(
VolumeEvent
.
volumeType
).
assertEqual
(
2
);
expect
(
VolumeEvent
.
volume
).
assertEqual
(
11
);
expect
(
VolumeEvent
.
updateUi
).
assertEqual
(
false
);
done
();
});
await
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
RINGTONE
,
11
);
})
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETRINGERMODE_0100
* @tc.name : group manager getRingerMode - RINGTONE - Callback
* @tc.desc : getRingerMode - RINGTONE - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETRINGERMODE_0100
'
,
3
,
async
function
(
done
)
{
let
groupManager
;
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
}
catch
(
err
)
{
console
.
info
(
'
audioManagerApi9Test: getGroupManager mute : parameter err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
groupManager
.
getRingerMode
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to get
MinVolum
e : Callback:
${
err
.
message
}
`
);
console
.
error
(
`audioManagerApi9Test: failed to get
RingerMod
e : Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
else
{
else
{
if
(
data
==
minVol
)
{
if
(
data
==
audio
.
AudioRingMode
.
RINGER_MODE_SILENT
||
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMinVolume: PASS :
'
+
data
);
data
==
audio
.
AudioRingMode
.
RINGER_MODE_VIBRATE
||
data
==
audio
.
AudioRingMode
.
RINGER_MODE_NORMAL
)
{
console
.
log
(
`audioManagerApi9Test: Promise:
getRingerMode : PASS:`
+
data
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
}
else
{
else
{
console
.
info
(
'
audioManagerApi9Test: callback : Ringtone getMinVolume: FAIL :
'
+
data
);
console
.
log
(
`audioManagerApi9Test: Promise:
getRingerMode : FAIL: `
+
data
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
}
}
done
();
done
();
});
})
}
catch
(
err
){
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
})
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0200
* @tc.name : getMaxVolume - RINGTONE - Promise
* @tc.desc : getMaxVolume
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETMINVOLUME_0200
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
minVolume
=
await
groupManager
.
getMinVolume
(
audio
.
AudioVolumeType
.
RINGTONE
);
if
(
minVolume
==
minVol
)
{
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMinVolume: PASS :
'
+
minVolume
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
audioManagerApi9Test: promise : Ringtone getMinVolume: FAIL :
'
+
minVolume
);
expect
(
false
).
assertTrue
();
}
}
catch
(
err
){
console
.
info
(
'
audioManagerApi9Test: getVolumeGroupManager : err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
}
done
();
})
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0100
* @tc.name : group manager ismute - RINGTONE - Callback
* @tc.desc : ismute - RINGTONE - Callback
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0100
'
,
3
,
async
function
(
done
)
{
let
groupManager
;
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
}
catch
(
err
){
console
.
info
(
'
audioManagerApi9Test: getGroupManager mute : parameter err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
groupManager
.
isMute
(
audio
.
AudioVolumeType
.
RINGTONE
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to isMute : Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
log
(
`audioManagerApi9Test: Promise:
Is Stream GroupManager Mute RINGTONE: FALSE: PASS:`
+
data
);
expect
(
true
).
assertTrue
();
}
done
();
})
})
})
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0200
* @tc.name : group manager ismute - RINGTONE - Promise
* @tc.desc : ismute - RINGTONE - Promise
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ISMUTE_0200
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
await
groupManager
.
isMute
(
audio
.
AudioVolumeType
.
RINGTONE
).
then
(
function
(
data
)
{
console
.
log
(
`audioManagerApi9Test: Promise:
Is Stream GroupManager Mute RINGTONE: FALSE: PASS:`
+
data
);
expect
(
true
).
assertTrue
();
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
`audioManagerApi9Test: Promise:
Is Stream GroupManager Mute RINGTONE: FALSE: ERROR:`
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
});
}
catch
(
err
){
console
.
info
(
'
audioManagerApi9Test: getGroupManager ismute : parameter err:
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
done
();
}
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100
*@tc.name : OnVolumeChange - setVolume - MEDIA
*@tc.desc : OnVolumeChange - setVolume - MEDIA
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100
'
,
3
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
audioVolumeManager
.
on
(
'
volumeChange
'
,
(
VolumeEvent
)
=>
{});
expect
(
true
).
assertTrue
();
done
();
})
/**
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETRINGERMODE_0100
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETRINGERMODE_0200
* @tc.name : group manager getRingerMode - RINGTONE - Callback
*@tc.name : setRingerMode - Normal Mode - Promise - ENAME
* @tc.desc : getRingerMode - RINGTONE - Callback
*@tc.desc : setRingerMode - Set Ring more to Normal Mode
* @tc.size : MEDIUM
*@tc.size : MEDIUM
* @tc.type : Function
*@tc.type : Function
* @tc.level : Level 3
*@tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_GETRINGERMODE_0100
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETRINGERMODE_0200
'
,
3
,
async
function
(
done
)
{
let
groupManager
;
try
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
value
=
await
groupManager
.
getRingerMode
();
}
catch
(
err
){
if
(
value
==
audio
.
AudioRingMode
.
RINGER_MODE_SILENT
||
console
.
info
(
'
audioManagerApi9Test: getGroupManager mute : parameter err:
'
+
err
.
message
);
value
==
audio
.
AudioRingMode
.
RINGER_MODE_VIBRATE
||
expect
(
false
).
assertTrue
();
value
==
audio
.
AudioRingMode
.
RINGER_MODE_NORMAL
)
{
done
();
console
.
info
(
`
${
TagFrmwk
}
: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :
${
value
}
`
);
}
groupManager
.
getRingerMode
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to getRingerMode : Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
if
(
data
==
audio
.
AudioRingMode
.
RINGER_MODE_SILENT
||
data
==
audio
.
AudioRingMode
.
RINGER_MODE_VIBRATE
||
data
==
audio
.
AudioRingMode
.
RINGER_MODE_NORMAL
){
console
.
log
(
`audioManagerApi9Test: Promise:
getRingerMode : PASS:`
+
data
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
}
else
{
else
{
console
.
info
(
`
${
TagFrmwk
}
: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :
${
value
}
`
);
console
.
log
(
`audioManagerApi9Test: Promise:
getRingerMode : FAIL: `
+
data
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
}
}
done
();
done
();
})
})
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETRINGERMODE_0200
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONRINGMODECHANGE_0100
*@tc.name : setRingerMode - Normal Mode - Promise - ENAME
*@tc.name : OnRingMode - RINGER_MODE_NORMAL
*@tc.desc : setRingerMode - Set Ring more to Normal Mode
*@tc.desc : OnRingMode - RINGER_MODE_NORMAL
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 3
*@tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETRINGERMODE_0200
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONRINGMODECHANGE_0100
'
,
3
,
async
function
(
done
)
{
try
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
value
=
await
groupManager
.
getRingerMode
();
groupManager
.
on
(
'
ringerModeChange
'
,
(
AudioRingMode
)
=>
{
});
if
(
value
==
audio
.
AudioRingMode
.
RINGER_MODE_SILENT
||
value
==
audio
.
AudioRingMode
.
RINGER_MODE_VIBRATE
||
value
==
audio
.
AudioRingMode
.
RINGER_MODE_NORMAL
)
{
console
.
info
(
`
${
TagFrmwk
}
: Promise: setRingerMode RINGER_MODE_NORMAL: PASS :
${
value
}
`
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
else
{
done
();
console
.
info
(
`
${
TagFrmwk
}
: Promise: setRingerMode RINGER_MODE_NORMAL: FAIL :
${
value
}
`
);
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
err
.
message
)
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
}
}
catch
(
err
)
{
})
console
.
log
(
'
err :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
}
done
();
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONRINGMODECHANGE_0100
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0100
*@tc.name : OnRingMode - RINGER_MODE_NORMAL
*@tc.name : setMicrophoneMute - true - Callback
*@tc.desc : OnRingMode - RINGER_MODE_NORMAL
*@tc.desc : Enable mic mute
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 3
*@tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONRINGMODECHANGE_0100
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0100
'
,
3
,
async
function
(
done
)
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
groupManager
.
on
(
'
ringerModeChange
'
,
(
AudioRingMode
)
=>
{});
groupManager
.
setMicrophoneMute
(
true
,
(
err
,
data
)
=>
{
expect
(
true
).
assertTrue
();
if
(
err
)
{
done
();
console
.
error
(
`audioManagerApi9Test: failed to setMicrophoneMute : Callback:
${
err
.
message
}
`
);
}
catch
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
log
(
'
err :
'
+
err
.
message
)
}
expect
(
false
).
assertTrue
();
else
{
done
();
groupManager
.
isMicrophoneMute
((
err
,
data
)
=>
{
}
if
(
err
)
{
})
console
.
error
(
`audioManagerApi9Test: failed to isMicrophoneMute : Callback:
${
err
.
message
}
`
);
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0100
*@tc.name : setMicrophoneMute - true - Callback
*@tc.desc : Enable mic mute
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0100
'
,
3
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
groupManager
.
setMicrophoneMute
(
true
,(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to setMicrophoneMute : Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
groupManager
.
isMicrophoneMute
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`audioManagerApi9Test: failed to isMicrophoneMute : Callback:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
if
(
data
==
true
)
{
console
.
log
(
`
${
TagFrmwk
}
: Callback: isMicrophoneMute: TRUE: PASS:
${
data
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Callback: isMicrophoneMute: TRUE: FAIL:
${
data
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
}
else
{
done
();
if
(
data
==
true
)
{
})
console
.
log
(
`
${
TagFrmwk
}
: Callback: isMicrophoneMute: TRUE: PASS:
${
data
}
`
);
}
expect
(
true
).
assertTrue
();
});
}
else
{
})
console
.
log
(
`
${
TagFrmwk
}
: Callback: isMicrophoneMute: TRUE: FAIL:
${
data
}
`
);
expect
(
false
).
assertTrue
();
}
}
done
();
})
}
});
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0200
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0200
...
@@ -618,355 +626,355 @@ describe('audioManagerApi9', function () {
...
@@ -618,355 +626,355 @@ describe('audioManagerApi9', function () {
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 3
*@tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0200
'
,
3
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_SETMICROPHONEMUTE_0200
'
,
3
,
async
function
(
done
)
{
try
{
try
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
await
groupManager
.
setMicrophoneMute
(
true
);
await
groupManager
.
setMicrophoneMute
(
true
);
let
data
=
await
groupManager
.
isMicrophoneMute
();
let
data
=
await
groupManager
.
isMicrophoneMute
();
if
(
data
==
true
)
{
if
(
data
==
true
)
{
console
.
log
(
`
${
TagFrmwk
}
: Promise: isMicrophoneMute: TRUE: PASS:
${
data
}
`
);
console
.
log
(
`
${
TagFrmwk
}
: Promise: isMicrophoneMute: TRUE: PASS:
${
data
}
`
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
else
{
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Promise: isMicrophoneMute: TRUE: FAIL:
${
data
}
`
);
console
.
log
(
`
${
TagFrmwk
}
: Promise: isMicrophoneMute: TRUE: FAIL:
${
data
}
`
);
expect
(
false
).
assertTrue
();
}
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
err
.
message
);
expect
(
false
).
assertTrue
();
}
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONMICSTATECHANGE_0100
*@tc.name : OnMicStateChange
*@tc.desc : OnMicStateChange
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 3
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONMICSTATECHANGE_0100
'
,
2
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
try
{
await
groupManager
.
setMicrophoneMute
(
false
);
console
.
info
(
'
setMicrophoneMute success
'
)
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
err
.
message
)
expect
(
false
).
assertTrue
();
done
();
}
groupManager
.
on
(
'
micStateChange
'
,
(
MicStateChangeEvent
)
=>
{
console
.
log
(
`
${
TagFrmwk
}
: Mic State Change Event is called`
);
if
(
MicStateChangeEvent
.
mute
==
true
)
{
console
.
info
(
`
${
TagFrmwk
}
: MEDIA CallBack : PASS :
${
MicStateChangeEvent
.
mute
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`
${
TagFrmwk
}
: Audio MicStateChangeEvent is :
${
MicStateChangeEvent
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
});
try
{
await
groupManager
.
setMicrophoneMute
(
true
);
console
.
info
(
'
setMicrophoneMute success
'
)
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
err
.
message
)
expect
(
false
).
assertTrue
();
done
();
done
();
}
})
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0100
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONMICSTATECHANGE_0100
*@tc.name : isActive - Media - Promise
*@tc.name : OnMicStateChange
*@tc.desc : isActive - Media - Promise - When stream is NOT playing
*@tc.desc : OnMicStateChange
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 1
*@tc.level : Level 3
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0100
'
,
1
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONMICSTATECHANGE_0100
'
,
2
,
async
function
(
done
)
{
console
.
log
(
`
${
TagFrmwk
}
: Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`
);
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
const
PROMISE
=
streamManager
.
isActive
(
audioMedia
);
let
groupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
PROMISE
.
then
(
function
(
data
)
{
try
{
if
(
data
==
false
)
{
await
groupManager
.
setMicrophoneMute
(
false
);
console
.
log
(
`
${
TagFrmwk
}
: Promise: isActive: Media: TRUE: PASS:
${
data
}
`
);
console
.
info
(
'
setMicrophoneMute success
'
)
expect
(
true
).
assertTrue
();
}
catch
(
err
)
{
}
else
{
console
.
log
(
'
err :
'
+
err
.
message
)
console
.
log
(
`
${
TagFrmwk
}
: Promise: isActive: Media: TRUE: FAIL:
${
data
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
}
}).
catch
(
err
=>
{
groupManager
.
on
(
'
micStateChange
'
,
(
MicStateChangeEvent
)
=>
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
console
.
log
(
`
${
TagFrmwk
}
: Mic State Change Event is called`
);
expect
().
assertFail
();
});
await
PROMISE
;
done
();
})
/**
if
(
MicStateChangeEvent
.
mute
==
true
)
{
*@tc.number : SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0200
console
.
info
(
`
${
TagFrmwk
}
: MEDIA CallBack : PASS :
${
MicStateChangeEvent
.
mute
}
`
);
*@tc.name : isActive - Media - Callback
expect
(
true
).
assertTrue
();
*@tc.desc : isActive - Media - Callback - When stream is NOT playing
}
else
{
*@tc.size : MEDIUM
console
.
info
(
`
${
TagFrmwk
}
: Audio MicStateChangeEvent is :
${
MicStateChangeEvent
}
`
);
*@tc.type : Function
expect
(
false
).
assertTrue
();
*@tc.level : Level 1
}
*/
done
();
it
(
'
SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0200
'
,
1
,
function
(
done
)
{
});
console
.
log
(
`
${
TagFrmwk
}
: Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`
);
try
{
streamManager
.
isActive
(
audioMedia
,
(
err
,
data
)
=>
{
await
groupManager
.
setMicrophoneMute
(
true
);
if
(
err
)
{
console
.
info
(
'
setMicrophoneMute success
'
)
console
.
error
(
`
${
TagFrmwk
}
: Callback : Media : isActive: failed
${
err
.
message
}
`
);
}
catch
(
err
)
{
expect
().
assertFail
();
console
.
log
(
'
err :
'
+
err
.
message
)
}
else
if
(
data
==
false
)
{
console
.
log
(
`
${
TagFrmwk
}
: Callback: isActive: Media: TRUE: PASS:
${
data
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Callback: isActive: Media: TRUE: FAIL:
${
data
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
}
done
();
})
});
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
*@tc.number : SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0100
*@tc.name : setCommunicationDevice - SPEAKER - deactivate - Promise
*@tc.name : isActive - Media - Promise
*@tc.desc : setCommunicationDevice speaker - Promise
*@tc.desc : isActive - Media - Promise - When stream is NOT playing
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 1
*@tc.level : Level 1
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
'
,
1
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0100
'
,
1
,
async
function
(
done
)
{
try
{
console
.
log
(
`
${
TagFrmwk
}
: Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`
);
let
flag
=
true
;
const
PROMISE
=
streamManager
.
isActive
(
audioMedia
);
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
PROMISE
.
then
(
function
(
data
)
{
let
outputDeviceDescription
=
await
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
);
if
(
data
==
false
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
console
.
log
(
`
${
TagFrmwk
}
: Promise: isActive: Media: TRUE: PASS:
${
data
}
`
);
outputDeviceDescription is
${
JSON
.
stringify
(
outputDeviceDescription
)}
`
);
if
(
outputDeviceDescription
.
length
==
1
&&
outputDeviceDescription
[
0
].
deviceType
==
audio
.
DeviceType
.
SPEAKER
)
{
flag
=
false
;
}
await
AudioRoutingManager
.
setCommunicationDevice
(
2
,
false
).
then
(()
=>
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
Promise returned to indicate that the device is set to the active status.`
);
});
await
AudioRoutingManager
.
isCommunicationDeviceActive
(
audio
.
ActiveDeviceType
.
SPEAKER
).
then
(
function
(
value
)
{
if
(
flag
==
true
&&
value
==
false
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
}
else
if
(
flag
==
false
&&
value
==
true
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
}
else
{
else
{
console
.
log
(
`
${
TagFrmwk
}
: Promise: isActive: Media: TRUE: FAIL:
${
data
}
`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
isCommunicationDeviceActive : SPEAKER: Deactivate : fail :
${
value
}
flag is
${
flag
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
}).
catch
(
(
err
)
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
expect
(
).
assertFail
();
});
});
}
catch
(
err
)
{
await
PROMISE
;
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
done
();
expect
(
false
).
assertTrue
();
})
}
done
();
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVIC
E_0200
*@tc.number : SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIV
E_0200
*@tc.name : setCommunicationDevice - SPEAKER - deactivate
- Callback
*@tc.name : isActive - Media
- Callback
*@tc.desc : setCommunicationDevice speaker - Callback
*@tc.desc : isActive - Media - Callback - When stream is NOT playing
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 1
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0200
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0200
'
,
1
,
function
(
done
)
{
let
flag
=
true
console
.
log
(
`
${
TagFrmwk
}
: Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`
);
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
streamManager
.
isActive
(
audioMedia
,
(
err
,
data
)
=>
{
let
outputDeviceDescription
=
await
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
);
if
(
err
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0200
console
.
error
(
`
${
TagFrmwk
}
: Callback : Media : isActive: failed
${
err
.
message
}
`
);
outputDeviceDescription is
${
JSON
.
stringify
(
outputDeviceDescription
)}
`
);
expect
().
assertFail
(
);
if
(
outputDeviceDescription
.
length
==
1
&&
outputDeviceDescription
[
0
].
deviceType
==
audio
.
DeviceType
.
SPEAKER
)
{
}
else
if
(
data
==
false
)
{
flag
=
false
;
console
.
log
(
`
${
TagFrmwk
}
: Callback: isActive: Media: TRUE: PASS:
${
data
}
`
)
;
}
expect
(
true
).
assertTrue
();
AudioRoutingManager
.
setCommunicationDevice
(
audio
.
ActiveDeviceType
.
SPEAKER
,
false
,
(
err
)
=>
{
}
else
{
if
(
err
)
{
console
.
log
(
`
${
TagFrmwk
}
: Callback: isActive: Media: TRUE: FAIL:
${
data
}
`
);
console
.
error
(
`
${
TagFrmwk
}
: Device Test: Callback : setCommunicationDevice : SPEAKER: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
(
);
expect
(
false
).
assertTrue
();
}
done
();
done
();
}
else
{
});
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : setCommunicationDevice : SPEAKER: Active`
);
})
AudioRoutingManager
.
isCommunicationDeviceActive
(
2
,
(
err
,
value
)
=>
{
if
(
err
)
{
/**
console
.
error
(
`
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate: Error:
${
err
.
message
}
`
);
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
expect
(
false
).
assertTrue
();
*@tc.name : setCommunicationDevice - SPEAKER - deactivate - Promise
}
else
if
(
value
==
false
&&
flag
==
true
)
{
*@tc.desc : setCommunicationDevice speaker - Promise
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 1
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
'
,
1
,
async
function
(
done
)
{
try
{
let
flag
=
true
;
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
let
outputDeviceDescription
=
await
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
outputDeviceDescription is
${
JSON
.
stringify
(
outputDeviceDescription
)}
`
);
if
(
outputDeviceDescription
.
length
==
1
&&
outputDeviceDescription
[
0
].
deviceType
==
audio
.
DeviceType
.
SPEAKER
)
{
flag
=
false
;
}
await
AudioRoutingManager
.
setCommunicationDevice
(
2
,
false
).
then
(()
=>
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
Promise returned to indicate that the device is set to the active status.`
);
});
await
AudioRoutingManager
.
isCommunicationDeviceActive
(
audio
.
ActiveDeviceType
.
SPEAKER
).
then
(
function
(
value
)
{
if
(
flag
==
true
&&
value
==
false
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
else
if
(
value
==
true
&&
flag
==
false
)
{
}
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
else
if
(
flag
==
false
&&
value
==
true
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
}
else
{
else
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0200
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate : FAIL :
${
value
}
flag is
${
flag
}
`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0100
isCommunicationDeviceActive : SPEAKER: Deactivate : fail :
${
value
}
flag is
${
flag
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
});
});
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
}
}
}
);
done
(
);
})
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0200
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
*@tc.name : setCommunicationDevice - SPEAKER - deactivate - Callback
*@tc.desc : micStateChange
*@tc.desc : setCommunicationDevice speaker - Callback
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0200
'
,
2
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
flag
=
true
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
let
count
=
0
;
let
outputDeviceDescription
=
await
AudioRoutingManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
);
console
.
info
(
'
getVolumeGroupManager Callback START.
'
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0200
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
outputDeviceDescription is
${
JSON
.
stringify
(
outputDeviceDescription
)}
`
);
if
(
outputDeviceDescription
.
length
==
1
&&
outputDeviceDescription
[
0
].
deviceType
==
audio
.
DeviceType
.
SPEAKER
)
{
console
.
info
(
'
micStateChange is
'
+
micStateChange
.
mute
);
flag
=
false
;
count
++
;
}
})
AudioRoutingManager
.
setCommunicationDevice
(
audio
.
ActiveDeviceType
.
SPEAKER
,
false
,
(
err
)
=>
{
try
{
if
(
err
)
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
error
(
`
${
TagFrmwk
}
: Device Test: Callback : setCommunicationDevice : SPEAKER: Deactivate: Error:
${
err
.
message
}
`
);
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
expect
(
false
).
assertTrue
();
await
audioManager
.
setMicrophoneMute
(
data
);
done
();
console
.
info
(
'
Promise setMicrophoneMute PASS.
'
);
}
else
{
let
data1
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : setCommunicationDevice : SPEAKER: Active`
);
console
.
info
(
'
Promise isMicrophoneMute PASS.
'
+
data1
);
AudioRoutingManager
.
isCommunicationDeviceActive
(
2
,
(
err
,
value
)
=>
{
}
catch
(
err
)
{
if
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
console
.
error
(
`
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
false
&&
flag
==
true
)
{
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
}
else
if
(
value
==
true
&&
flag
==
false
)
{
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_SETCOMMUNICATIONDEVICE_0200
${
TagFrmwk
}
: Device Test: Callback : isCommunicationDeviceActive : SPEAKER: Deactivate : FAIL :
${
value
}
flag is
${
flag
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
});
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0100
'
,
2
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
count
=
0
;
console
.
info
(
'
getVolumeGroupManager Callback START.
'
);
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
console
.
info
(
'
micStateChange is
'
+
micStateChange
.
mute
);
count
++
;
})
try
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
await
audioManager
.
setMicrophoneMute
(
data
);
console
.
info
(
'
Promise setMicrophoneMute PASS.
'
);
let
data1
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS.
'
+
data1
);
}
catch
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
done
();
}
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
0
);
done
();
done
();
}
})
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
0
);
done
();
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
*@tc.desc : micStateChange
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0200
'
,
2
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
console
.
info
(
'
getVolumeGroupManager Callback START.
'
);
console
.
info
(
'
getVolumeGroupManager Callback START.
'
);
let
count
=
0
;
let
count
=
0
;
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
console
.
info
(
"
Updated micState:
"
+
JSON
.
stringify
(
micStateChange
));
console
.
info
(
"
Updated micState:
"
+
JSON
.
stringify
(
micStateChange
));
count
++
;
count
++
;
})
})
try
{
try
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
let
micStatus
=
!
data
;
let
micStatus
=
!
data
;
await
audioManager
.
setMicrophoneMute
(
micStatus
);
await
audioManager
.
setMicrophoneMute
(
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
micStatus
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
1
);
done
();
done
();
}
})
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
1
);
done
();
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
*@tc.desc : micStateChange
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0300
'
,
2
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
console
.
info
(
'
getVolumeGroupManager Callback START.
'
);
console
.
info
(
'
getVolumeGroupManager Callback START.
'
);
let
count
=
0
;
let
count
=
0
;
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
console
.
info
(
"
Updated micState:
"
+
JSON
.
stringify
(
micStateChange
));
console
.
info
(
"
Updated micState:
"
+
JSON
.
stringify
(
micStateChange
));
count
++
;
count
++
;
})
})
try
{
try
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
console
.
info
(
'
Promise isMicrophoneMute PASS:
'
+
data
);
let
micStatus
=
!
data
;
let
micStatus
=
!
data
;
await
audioManager
.
setMicrophoneMute
(
micStatus
);
await
audioManager
.
setMicrophoneMute
(
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
micStatus
);
await
audioManager
.
setMicrophoneMute
(
!
micStatus
);
await
audioManager
.
setMicrophoneMute
(
!
micStatus
);
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
(
!
micStatus
));
console
.
info
(
'
Promise setMicrophoneMute PASS:
'
+
(
!
micStatus
));
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
}
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
2
);
done
();
done
();
}
})
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
2
);
done
();
})
/**
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
*@tc.number : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
*@tc.name : SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
*@tc.desc : micStateChange
*@tc.desc : micStateChange
*@tc.size : MEDIUM
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.type : Function
*@tc.level : Level 2
*@tc.level : Level 2
*/
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
'
,
2
,
async
function
(
done
)
{
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
audioVolumeManager
=
audioManager
.
getVolumeManager
();
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
VolumeGroupManager
=
await
audioVolumeManager
.
getVolumeGroupManager
(
audio
.
DEFAULT_VOLUME_GROUP_ID
);
let
count
=
0
;
let
count
=
0
;
try
{
try
{
console
.
info
(
"
enter SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
"
);
console
.
info
(
"
enter SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_MICSTATECHANGE_0400
"
);
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange1
)
=>
{
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange1
)
=>
{
console
.
info
(
"
Updated micState--001:
"
+
JSON
.
stringify
(
micStateChange1
));
console
.
info
(
"
Updated micState--001:
"
+
JSON
.
stringify
(
micStateChange1
));
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
VolumeGroupManager
.
on
(
'
micStateChange
'
,
async
(
micStateChange
)
=>
{
console
.
info
(
"
Updated micState--002:
"
+
JSON
.
stringify
(
micStateChange
));
console
.
info
(
"
Updated micState--002:
"
+
JSON
.
stringify
(
micStateChange
));
count
++
count
++
})
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Second Promise isMicrophoneMute PASS:
'
+
data
);
await
audioManager
.
setMicrophoneMute
(
!
data
);
console
.
info
(
'
Second:Promise setMicrophoneMute PASS:
'
+
(
!
data
));
})
})
let
data
=
await
audioManager
.
isMicrophoneMute
();
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
info
(
'
Second
Promise isMicrophoneMute PASS:
'
+
data
);
console
.
info
(
'
First
Promise isMicrophoneMute PASS:
'
+
data
);
await
audioManager
.
setMicrophoneMute
(
!
data
);
await
audioManager
.
setMicrophoneMute
(
!
data
);
console
.
info
(
'
Second:Promise setMicrophoneMute PASS:
'
+
(
!
data
));
console
.
info
(
'
First:Promise setMicrophoneMute PASS:
'
+
(
!
data
));
})
}
catch
(
err
)
{
let
data
=
await
audioManager
.
isMicrophoneMute
();
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
console
.
info
(
'
First Promise isMicrophoneMute PASS:
'
+
data
);
expect
(
false
).
assertTrue
();
await
audioManager
.
setMicrophoneMute
(
!
data
);
done
();
console
.
info
(
'
First:Promise setMicrophoneMute PASS:
'
+
(
!
data
));
}
}
catch
(
err
)
{
await
sleep
(
2000
);
console
.
log
(
'
ERROR:
'
+
JSON
.
stringify
(
err
))
expect
(
count
).
assertEqual
(
1
);
expect
(
false
).
assertTrue
();
done
();
done
();
}
})
await
sleep
(
2000
);
expect
(
count
).
assertEqual
(
1
);
done
();
})
})
})
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录