Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e214d1ba
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看板
提交
e214d1ba
编写于
3月 07, 2023
作者:
1
15754133731
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<audio用例整改>
Signed-off-by:
N
15754133731
<
chenjiahuan@huawei.com
>
上级
ea58e0dd
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
1194 addition
and
1009 deletion
+1194
-1009
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
...rd/audioManager/src/main/js/test/AudioManagerApi9.test.js
+1194
-822
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
...dard/audioRenderer/src/main/js/test/AudioRenderer.test.js
+0
-187
未找到文件。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioManagerApi9.test.js
浏览文件 @
e214d1ba
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js
浏览文件 @
e214d1ba
...
...
@@ -29,10 +29,6 @@ describe('audioRenderer', function () {
let
TagFrmwkAudioScene
=
"
AudioFrameworkAudioScene
"
;
let
fdPath
;
let
filePath
;
let
minVol
=
0
;
let
maxVol
=
1
;
let
lowVol
=
1
;
let
highVol
=
9
;
let
stringParameter
=
"
invalid_parameter
"
;
console
.
info
(
`
${
TagFrmwkRender
}
: Create AudioManger Object JS Framework`
);
...
...
@@ -10411,187 +10407,4 @@ describe('audioRenderer', function () {
});
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_2900
*@tc.name : mute - ALARM - Promise - SetVolume
*@tc.desc : mute - ALARM - Promise - Enable mute -SetVolume
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_2900
'
,
2
,
async
function
(
done
)
{
try
{
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ALARM
,
highVol
);
await
AUDIOMANAGER
.
mute
(
audio
.
AudioVolumeType
.
ALARM
,
true
);
console
.
log
(
`
${
TagFrmwk
}
: Set Stream Mute: ALARM: Promise: TRUE`
);
let
value
=
await
AUDIOMANAGER
.
getVolume
(
audio
.
AudioVolumeType
.
ALARM
);
console
.
info
(
"
AudioFrameworkTest: value is
"
+
value
);
if
(
value
==
9
)
{
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ALARM
,
lowVol
);
let
data
=
await
AUDIOMANAGER
.
isMute
(
audio
.
AudioVolumeType
.
ALARM
);
if
(
data
==
true
)
{
console
.
log
(
`
${
TagFrmwk
}
: Promise: Is Stream Mute ALARM: SetVolume: PASS:
${
data
}
`
);
expect
(
true
).
assertTrue
();
}
}
catch
(
err
)
{
console
.
info
(
'
err :
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
}
await
AUDIOMANAGER
.
mute
(
audio
.
AudioVolumeType
.
ALARM
,
false
);
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_3000
*@tc.name : mute - ALARM - callback - SetVolume
*@tc.desc : mute - ALARM - callback - Enable mute - SetVolume
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_3000
'
,
2
,
async
function
(
done
)
{
try
{
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ALARM
,
highVol
);
}
catch
(
err
)
{
console
.
log
(
'
setVolume err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
return
;
}
AUDIOMANAGER
.
mute
(
audio
.
AudioVolumeType
.
ALARM
,
true
,
async
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: ALARM : failed to set Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Set Stream Mute: ALARM: Callback : SetVolume`
);
try
{
let
value
=
await
AUDIOMANAGER
.
getVolume
(
audio
.
AudioVolumeType
.
ALARM
);
if
(
value
==
9
)
{
console
.
info
(
"
AudioFrameworkTest: value is
"
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ALARM
,
lowVol
);
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
return
;
}
AUDIOMANAGER
.
isMute
(
audio
.
AudioVolumeType
.
ALARM
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: ALARM : failed to get Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
}
else
if
(
data
==
false
)
{
console
.
log
(
`
${
TagFrmwk
}
: Callback : Is Stream Mute ALARM: SetVolume: PASS:
${
data
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Callback : Is Stream Mute ALARM: SetVolume: FAIL:
${
data
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
});
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_3100
*@tc.name : mute - ACCESSIBILITY - Promise - SetVolume
*@tc.desc : mute - ACCESSIBILITY - Promise - Enable mute -SetVolume
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_3100
'
,
2
,
async
function
(
done
)
{
try
{
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
lowVol
);
await
AUDIOMANAGER
.
mute
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
true
);
console
.
log
(
`
${
TagFrmwk
}
: Set Stream Mute: ACCESSIBILITY: Promise: TRUE`
);
let
value
=
await
AUDIOMANAGER
.
getVolume
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
);
console
.
info
(
"
AudioFrameworkTest: value is
"
+
value
);
if
(
value
==
1
)
{
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
lowVol
);
let
data
=
await
AUDIOMANAGER
.
isMute
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
);
if
(
data
==
true
)
{
console
.
log
(
`
${
TagFrmwk
}
: Promise: Is Stream Mute ACCESSIBILITY: SetVolume: PASS:
${
data
}
`
);
expect
(
true
).
assertTrue
();
}
}
catch
(
err
)
{
console
.
info
(
'
err :
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
}
await
AUDIOMANAGER
.
mute
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
false
);
done
();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_3200
*@tc.name : mute - ACCESSIBILITY - callback - SetVolume
*@tc.desc : mute - ACCESSIBILITY - callback - Enable mute - SetVolume
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_3200
'
,
2
,
async
function
(
done
)
{
try
{
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
lowVol
);
}
catch
(
err
)
{
console
.
log
(
'
setVolume err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
return
;
}
AUDIOMANAGER
.
mute
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
true
,
async
(
err
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: ACCESSIBILITY : failed to set Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Set Stream Mute: ACCESSIBILITY: Callback : SetVolume`
);
try
{
let
value
=
await
AUDIOMANAGER
.
getVolume
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
);
if
(
value
==
1
)
{
console
.
info
(
"
AudioFrameworkTest: value is
"
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
await
AUDIOMANAGER
.
setVolume
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
lowVol
);
}
catch
(
err
)
{
console
.
log
(
'
err :
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
return
;
}
AUDIOMANAGER
.
isMute
(
audio
.
AudioVolumeType
.
ACCESSIBILITY
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`
${
TagFrmwk
}
: Callback : SetVolume: ACCESSIBILITY : failed to get Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
}
else
if
(
data
==
false
)
{
console
.
log
(
`
${
TagFrmwk
}
: Callback : Is Stream Mute ACCESSIBILITY: SetVolume: PASS:
${
data
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
log
(
`
${
TagFrmwk
}
: Callback : Is Stream Mute ACCESSIBILITY: SetVolume: FAIL:
${
data
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
});
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录