Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e965b127
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看板
提交
e965b127
编写于
3月 06, 2023
作者:
1
15754133731
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<增加异常捕获>
Signed-off-by:
N
15754133731
<
chenjiahuan@huawei.com
>
上级
7b6d29cb
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
4394 addition
and
4394 deletion
+4394
-4394
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+4394
-4394
未找到文件。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
e965b127
...
...
@@ -20,7 +20,7 @@ import { UiDriver, BY } from '@ohos.UiTest'
export
default
function
audioFramework
()
{
describe
(
'
audioFramework
'
,
function
()
{
describe
(
'
audioFramework
'
,
function
()
{
let
TagFrmwk
=
"
AudioFrameworkTest
"
;
console
.
info
(
`
${
TagFrmwk
}
: Create AudioManger Object JS Framework`
);
let
audioManager
=
null
;
...
...
@@ -3585,15 +3585,15 @@ describe('audioFramework', function () {
});
await
audioManager
.
isDeviceActive
(
audio
.
ActiveDeviceType
.
SPEAKER
).
then
(
function
(
value
)
{
if
(
flag
==
true
&&
value
==
false
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
}
else
if
(
flag
==
false
&&
value
==
true
)
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : fail :
${
value
}
flag is
${
flag
}
`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0100 isDeviceActive : SPEAKER: Deactivate : fail :
${
value
}
flag is
${
flag
}
`
);
expect
(
false
).
assertTrue
();
}
}).
catch
((
err
)
=>
{
...
...
@@ -3642,7 +3642,7 @@ describe('audioFramework', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300
'
,
2
,
async
function
(
done
)
{
let
flag
=
true
let
outputDeviceDescription
=
await
audioManager
.
getDevices
(
audio
.
DeviceFlag
.
OUTPUT_DEVICES_FLAG
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300 outputDeviceDescription is
${
JSON
.
stringify
(
outputDeviceDescription
)}
`
);
...
...
@@ -3661,14 +3661,14 @@ describe('audioFramework', function () {
console
.
error
(
`
${
TagFrmwk
}
: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
if
(
value
==
false
&&
flag
==
true
)
{
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
}
else
if
(
value
==
true
&&
flag
==
false
)
{
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
console
.
info
(
`
${
TagFrmwk
}
: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :
${
value
}
flag is
${
flag
}
`
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300
${
TagFrmwk
}
: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :
${
value
}
flag is
${
flag
}
`
);
console
.
info
(
`SUB_MULTIMEDIA_AUDIO_MANAGER_SETDEVICEACTIVE_0300
${
TagFrmwk
}
: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :
${
value
}
flag is
${
flag
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
...
...
@@ -4680,7 +4680,7 @@ describe('audioFramework', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0100
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0100
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
1
,
(
err
,
value
)
=>
{
// Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG
...
...
@@ -4714,7 +4714,7 @@ describe('audioFramework', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0200
'
,
2
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0200
'
,
2
,
async
function
(
done
)
{
let
AudioRoutingManager
=
audioManager
.
getRoutingManager
();
AudioRoutingManager
.
getDevices
(
2
,
(
err
,
value
)
=>
{
// Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG
...
...
@@ -4919,5 +4919,5 @@ describe('audioFramework', function () {
await
sleep
(
50
);
done
();
})
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录