Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0f1092c4
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看板
提交
0f1092c4
编写于
7月 10, 2023
作者:
W
wangzx0705
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify case code for api change
Signed-off-by:
N
wangzx0705
<
wangzx0705@thundersoft.com
>
上级
fc3edcd9
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
26 addition
and
29 deletion
+26
-29
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/AdjustSystemVolumeByStep.test.ets
...hance/src/main/ets/test/AdjustSystemVolumeByStep.test.ets
+26
-29
未找到文件。
multimedia/audio/audio_js_standard/AudioManagerEnhance/src/main/ets/test/AdjustSystemVolumeByStep.test.ets
浏览文件 @
0f1092c4
...
...
@@ -452,10 +452,8 @@ export default function audioManagerTest() {
*@tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_PROMISE_1100'
,
0
,
async
function
(
done
)
{
let
type
;
try
{
for
(
let
index
in
audio
.
AudioVolumeType
){
type
=
index
;
console
.
info
(
`####AudioVolumeType : ${index}`
);
let
minVol
=
await
audioVolumeGroupManager
.
getMinVolume
(
audio
.
AudioVolumeType
[
index
]);
await
audioVolumeGroupManager
.
setVolume
(
audio
.
AudioVolumeType
[
index
],
minVol
);
...
...
@@ -465,10 +463,17 @@ export default function audioManagerTest() {
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_DOWN
)
.
then
((
data
)
=>
{
console
.
info
(
`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`
);
})
.
catch
((
error
)
=>
{
if
(
index
==
'ALL'
&&
error
.
code
==
6800104
){
console
.
info
(
`####${index} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
return
}
else
{
console
.
log
(
`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${error.message} ${error.code}`
);
expect
(
false
)
.
assertTrue
();
done
();
return
;
}
});
await
sleep
(
20
);
let
curVol
=
await
audioVolumeGroupManager
.
getVolume
(
audio
.
AudioVolumeType
[
index
]);
...
...
@@ -482,16 +487,10 @@ export default function audioManagerTest() {
}
done
();
}
catch
(
error
){
if
(
type
==
'ALL'
&&
error
.
code
==
env
.
UNSUPORTED_OPTION_6800104
){
console
.
info
(
`####${type} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
}
else
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_PROMISE_1100: error ${error.message}, code ${error.code}`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_PROMISE_1000: error ${error.message}, code ${error.code}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
})
/**
...
...
@@ -931,19 +930,23 @@ export default function audioManagerTest() {
*@tc.level : Level 0
*/
it
(
'SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_CALLBACK_1100'
,
0
,
async
function
(
done
)
{
let
type
;
try
{
for
(
let
index
in
audio
.
AudioVolumeType
)
{
type
=
index
;
console
.
info
(
`####AudioVolumeType: ${index}`
);
let
minVol
=
await
audioVolumeGroupManager
.
getMinVolume
(
audio
.
AudioVolumeType
[
index
]);
await
audioVolumeGroupManager
.
setVolume
(
audio
.
AudioVolumeType
[
index
],
minVol
);
console
.
info
(
`####${index} setVolume :volome ${minVol}`
);
await
audioVolumeGroupManager
.
adjustSystemVolumeByStep
(
audio
.
AudioVolumeType
[
index
],
VOLUME_ADJUST_DOWN
,
(
err
,
data
)
=>
{
if
(
err
){
console
.
log
(
`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`
);
if
(
index
==
'ALL'
&&
err
.
code
==
6800104
){
console
.
info
(
`####${index} adjustSystemVolumeByStep: error ${err.message}, code ${err.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
}
else
{
console
.
log
(
`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${err.message} ${err.code}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
else
{
console
.
info
(
`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`
);
}
...
...
@@ -960,16 +963,10 @@ export default function audioManagerTest() {
}
done
();
}
catch
(
error
){
if
(
type
==
'ALL'
&&
error
.
code
==
env
.
UNSUPORTED_OPTION_6800104
){
console
.
info
(
`####${type} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`
);
expect
(
true
)
.
assertTrue
();
done
();
}
else
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_CALLBACK_1100: error ${error.message}, code ${error.code}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
})
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录