Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3b5d5f2d
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看板
提交
3b5d5f2d
编写于
8月 24, 2022
作者:
Q
qinliwen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<audio xts修改>
Signed-off-by:
N
qinliwen
<
qinliwen3@huawei.com
>
上级
b5ba4a85
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
29 deletion
+38
-29
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+21
-19
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
...ndard/audioManager/src/main/js/test/AudioRenderer.test.js
+17
-10
未找到文件。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
3b5d5f2d
...
...
@@ -3150,7 +3150,7 @@ describe('audioManager', function () {
}
else
{
console
.
log
(
'
AudioFrameworkTest: Set Stream Mute: Media: Callback : TRUE
'
);
audioManager
.
getVolume
(
audioMedia
,
(
err
,
value
)
=>
{
audioManager
.
getVolume
(
audioMedia
,
async
(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to obtain the volume.
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
...
...
@@ -3242,7 +3242,7 @@ describe('audioManager', function () {
}
else
{
console
.
log
(
'
AudioFrameworkTest: Set Stream Mute: Ringtone: Callback : SetVolume
'
);
audioManager
.
getVolume
(
audioRingtone
,
(
err
,
value
)
=>
{
audioManager
.
getVolume
(
audioRingtone
,
async
(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to obtain the volume.
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
...
...
@@ -3334,7 +3334,7 @@ describe('audioManager', function () {
}
else
{
console
.
log
(
'
AudioFrameworkTest: Set Stream Mute: VOICE_CALL: Callback : SetVolume
'
);
audioManager
.
getVolume
(
audio
.
AudioVolumeType
.
VOICE_CALL
,
(
err
,
value
)
=>
{
audioManager
.
getVolume
(
audio
.
AudioVolumeType
.
VOICE_CALL
,
async
(
err
,
value
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to obtain the volume.
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
...
...
@@ -3428,27 +3428,29 @@ describe('audioManager', function () {
console
.
log
(
'
AudioFrameworkTest: Set Stream Mute: VOICE_ASSISTANT: Callback : SetVolume
'
);
await
audioManager
.
getVolume
(
audio
.
AudioVolumeType
.
VOICE_ASSISTANT
).
then
((
value
)
=>
{
if
(
value
==
0
)
{
await
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
VOICE_ASSISTANT
,
lowVol
);
audioManager
.
isMute
(
audio
.
AudioVolumeType
.
VOICE_ASSISTANT
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Callback : SetVolume: VOICE_ASSISTANT : failed to get Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
}
else
if
(
data
==
false
)
{
console
.
log
(
'
AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS:
'
+
data
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
log
(
'
AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: FAIL:
'
+
data
);
expect
(
false
).
assertTrue
();
}
});
console
.
info
(
"
AudioFrameworkTest: value is
"
+
value
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`AudioFrameworkTest: mute fail: value
${
value
}
`
);
expect
(
false
).
assertTrue
();
}
});
await
audioManager
.
setVolume
(
audio
.
AudioVolumeType
.
VOICE_ASSISTANT
,
lowVol
);
audioManager
.
isMute
(
audio
.
AudioVolumeType
.
VOICE_ASSISTANT
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`AudioFrameworkTest: Callback : SetVolume: VOICE_ASSISTANT : failed to get Mute Status
${
err
.
message
}
`
);
expect
().
assertFail
();
}
else
if
(
data
==
false
)
{
console
.
log
(
'
AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: PASS:
'
+
data
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
log
(
'
AudioFrameworkTest: Callback : Is Stream Mute VOICE_ASSISTANT: SetVolume: FAIL:
'
+
data
);
expect
(
false
).
assertTrue
();
}
done
();
});
}
done
();
});
...
...
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioRenderer.test.js
浏览文件 @
3b5d5f2d
...
...
@@ -7206,7 +7206,6 @@ describe('audioRenderer', function () {
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_108
'
,
0
,
async
function
(
done
)
{
expect
(
audio
.
AudioState
.
STATE_INVALID
).
assertEqual
(
-
1
);
await
sleep
(
50
);
done
();
...
...
@@ -7221,7 +7220,6 @@ describe('audioRenderer', function () {
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_109
'
,
0
,
async
function
(
done
)
{
expect
(
audio
.
AudioState
.
STATE_NEW
).
assertEqual
(
0
);
await
sleep
(
50
);
done
();
...
...
@@ -7236,7 +7234,6 @@ describe('audioRenderer', function () {
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_110
'
,
0
,
async
function
(
done
)
{
expect
(
audio
.
AudioSampleFormat
.
SAMPLE_FORMAT_INVALID
).
assertEqual
(
-
1
);
await
sleep
(
50
);
done
();
...
...
@@ -7251,7 +7248,6 @@ describe('audioRenderer', function () {
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_111
'
,
0
,
async
function
(
done
)
{
expect
(
audio
.
SourceType
.
SOURCE_TYPE_INVALID
).
assertEqual
(
-
1
);
await
sleep
(
50
);
done
();
...
...
@@ -7371,7 +7367,6 @@ describe('audioRenderer', function () {
* @tc.level : Level 0
*/
it
(
'
SUB_AUDIO_RENDERER_Play_audio_114
'
,
0
,
async
function
(
done
)
{
expect
(
audio
.
AudioEncodingType
.
ENCODING_TYPE_INVALID
).
assertEqual
(
-
1
);
await
sleep
(
50
);
done
();
...
...
@@ -7403,10 +7398,12 @@ describe('audioRenderer', function () {
let
mode
=
audio
.
InterruptMode
.
SHARE_MODE
;
audioRenderer
.
setInterruptMode
(
mode
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE CALLBACK: error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`
);
expect
(
true
).
assertTrue
();
done
();
})
...
...
@@ -7438,10 +7435,12 @@ describe('audioRenderer', function () {
let
mode
=
audio
.
InterruptMode
.
INDEPENDENT_MODE
;
audioRenderer
.
setInterruptMode
(
mode
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE CALLBACK: error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS`
);
expect
(
true
).
assertTrue
();
done
();
})
...
...
@@ -7472,9 +7471,11 @@ describe('audioRenderer', function () {
let
audioRenderer
=
await
audio
.
createAudioRenderer
(
audioRendererOptions
);
let
mode
=
audio
.
InterruptMode
.
SHARE_MODE
;
audioRenderer
.
setInterruptMode
(
mode
).
then
(
data
=>
{
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE PROMISE: SUCCESS`
);
expect
(
true
).
assertTrue
();
done
();
}).
catch
(
err
=>
{
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode SHARE_MODE PROMISE: error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
})
...
...
@@ -7505,9 +7506,11 @@ describe('audioRenderer', function () {
let
audioRenderer
=
await
audio
.
createAudioRenderer
(
audioRendererOptions
);
let
mode
=
audio
.
InterruptMode
.
INDEPENDENT_MODE
;
audioRenderer
.
setInterruptMode
(
mode
).
then
(
data
=>
{
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE PROMISE: SUCCESS`
);
expect
(
true
).
assertTrue
();
done
();
}).
catch
(
err
=>
{
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode INDEPENDENT_MODE PROMISE: error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
})
...
...
@@ -7539,17 +7542,19 @@ describe('audioRenderer', function () {
let
mode
=
'
1
'
;
try
{
let
data
=
await
audioRenderer
.
setInterruptMode
(
mode
);
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode STRING PROMISE: SUCCESS`
);
expect
(
false
).
assertTrue
();
done
();
}
catch
(
err
)
{
expect
(
'
assertion (false) failed: type mismatch
'
).
assertEqual
(
err
.
message
);
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode STRING PROMISE: error:
${
err
.
message
}
`
);
expect
(
true
).
assertTrue
();
done
();
}
})
/*
* @tc.name:SUB_AUDIO_SetInterruptMode_006
* @tc.desc:SetInterruptMode mode 2,
will catch error with out of border
* @tc.desc:SetInterruptMode mode 2,
set it to default SHARE_MODE
* @tc.type: FUNC
* @tc.require: Issue Number
*/
...
...
@@ -7572,11 +7577,13 @@ describe('audioRenderer', function () {
let
audioRenderer
=
await
audio
.
createAudioRenderer
(
audioRendererOptions
);
let
mode
=
2
;
try
{
let
data
=
await
audioRenderer
.
setInterruptMode
(
mode
)
expect
(
false
).
assertTrue
();
let
data
=
await
audioRenderer
.
setInterruptMode
(
mode
);
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode OUT OF BORDER PROMISE: SUCCESS`
);
expect
(
true
).
assertTrue
();
done
();
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
undefined
);
console
.
info
(
`AudioFrameworkRenderLog: SetInterruptMode OUT OF BORDER PROMISE: ERROR:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
done
();
}
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录