Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c76403dd
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看板
未验证
提交
c76403dd
编写于
3月 07, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 07, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7843 【媒体子系统】增加try catch捕获UiDriver异常
Merge pull request !7843 from 秦莉文/monthly_20221018
上级
f13340eb
e965b127
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
5818 addition
and
5793 deletion
+5818
-5793
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
...dard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
+15
-10
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
...angeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
+1357
-1352
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
...dard/audioManager/src/main/js/test/AudioFramework.test.js
+4395
-4390
multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
..._js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
+14
-9
multimedia/media/media_js_standard/MediaTestBase.js
multimedia/media/media_js_standard/MediaTestBase.js
+37
-32
未找到文件。
multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js
浏览文件 @
c76403dd
...
...
@@ -449,17 +449,22 @@ export default function audioCapturer() {
})
}
async
function
driveFn
()
{
console
.
info
(
`come in driveFn`
);
let
driver
=
await
UiDriver
.
create
();
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
);
await
sleep
(
100
);
console
.
info
(
`UiDriver start`
);
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
));
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
);
await
sleep
(
100
);
await
button
.
click
();
try
{
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`case come in driveFn 222`
)
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
await
sleep
(
100
);
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
));
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
);
await
sleep
(
100
);
await
button
.
click
();
}
catch
(
err
)
{
console
.
info
(
'
err is
'
+
err
);
return
;
}
}
beforeAll
(
async
function
()
{
await
getPermission
();
await
driveFn
();
...
...
multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js
浏览文件 @
c76403dd
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js
浏览文件 @
c76403dd
此差异已折叠。
点击以展开。
multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js
浏览文件 @
c76403dd
...
...
@@ -40,15 +40,20 @@ describe('audioVoip', function () {
})
}
async
function
driveFn
()
{
console
.
info
(
`come in driveFn`
);
let
driver
=
await
UiDriver
.
create
();
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
);
await
sleep
(
100
);
console
.
info
(
`UiDriver start`
);
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
));
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
);
await
sleep
(
100
);
await
button
.
click
();
try
{
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`case come in driveFn 222`
)
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
await
sleep
(
100
);
console
.
info
(
`UiDriver start`
);
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
));
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
);
await
sleep
(
100
);
await
button
.
click
();
}
catch
(
err
)
{
console
.
info
(
'
err is
'
+
err
);
return
;
}
}
beforeAll
(
async
function
()
{
...
...
multimedia/media/media_js_standard/MediaTestBase.js
浏览文件 @
c76403dd
...
...
@@ -14,7 +14,7 @@
*/
import
resourceManager
from
'
@ohos.resourceManager
'
;
import
{
expect
}
from
'
deccjsunit/index
'
import
{
expect
}
from
'
deccjsunit/index
'
import
router
from
'
@system.router
'
import
mediaLibrary
from
'
@ohos.multimedia.mediaLibrary
'
import
fileio
from
'
@ohos.fileio
'
...
...
@@ -31,18 +31,23 @@ export async function getPermission(permissionNames) {
export
async
function
driveFn
(
num
)
{
console
.
info
(
`case come in driveFn 111`
)
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`case come in driveFn 222`
)
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
await
msleepAsync
(
2000
)
console
.
info
(
`UiDriver start`
)
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
try
{
let
driver
=
await
UiDriver
.
create
()
console
.
info
(
`case come in driveFn 222`
)
console
.
info
(
`driver is
${
JSON
.
stringify
(
driver
)}
`
)
await
msleepAsync
(
2000
)
console
.
info
(
`UiDriver start`
)
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
let
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
允许
'
))
console
.
info
(
`button is
${
JSON
.
stringify
(
button
)}
`
)
await
msleepAsync
(
2000
)
await
button
.
click
()
}
await
msleepAsync
(
2000
)
await
button
.
click
()
}
catch
(
err
)
{
console
.
info
(
'
err is
'
+
err
);
return
;
}
await
msleepAsync
(
2000
)
}
// File operation
...
...
@@ -50,7 +55,7 @@ export async function getFileDescriptor(fileName) {
let
fileDescriptor
=
undefined
;
await
resourceManager
.
getResourceManager
().
then
(
async
(
mgr
)
=>
{
await
mgr
.
getRawFileDescriptor
(
fileName
).
then
(
value
=>
{
fileDescriptor
=
{
fd
:
value
.
fd
,
offset
:
value
.
offset
,
length
:
value
.
length
};
fileDescriptor
=
{
fd
:
value
.
fd
,
offset
:
value
.
offset
,
length
:
value
.
length
};
console
.
log
(
'
case getRawFileDescriptor success fileName:
'
+
fileName
);
}).
catch
(
error
=>
{
console
.
log
(
'
case getRawFileDescriptor err:
'
+
error
);
...
...
@@ -61,7 +66,7 @@ export async function getFileDescriptor(fileName) {
export
async
function
closeFileDescriptor
(
fileName
)
{
await
resourceManager
.
getResourceManager
().
then
(
async
(
mgr
)
=>
{
await
mgr
.
closeRawFileDescriptor
(
fileName
).
then
(()
=>
{
await
mgr
.
closeRawFileDescriptor
(
fileName
).
then
(()
=>
{
console
.
log
(
'
case closeRawFileDescriptor
'
+
fileName
);
}).
catch
(
error
=>
{
console
.
log
(
'
case closeRawFileDescriptor err:
'
+
error
);
...
...
@@ -98,7 +103,7 @@ export async function closeFdNumber(fdNumber) {
// wait synchronously
export
function
msleep
(
time
)
{
for
(
let
t
=
Date
.
now
();
Date
.
now
()
-
t
<=
time
;);
for
(
let
t
=
Date
.
now
();
Date
.
now
()
-
t
<=
time
;);
}
// wait asynchronously
...
...
@@ -127,21 +132,21 @@ export function catchCallback(error) {
export
function
checkDescription
(
actualDescription
,
descriptionKey
,
descriptionValue
)
{
for
(
let
i
=
0
;
i
<
descriptionKey
.
length
;
i
++
)
{
let
property
=
actualDescription
[
descriptionKey
[
i
]];
console
.
info
(
'
case key is
'
+
descriptionKey
[
i
]);
console
.
info
(
'
case actual value is
'
+
property
);
console
.
info
(
'
case hope value is
'
+
descriptionValue
[
i
]);
console
.
info
(
'
case key is
'
+
descriptionKey
[
i
]);
console
.
info
(
'
case actual value is
'
+
property
);
console
.
info
(
'
case hope value is
'
+
descriptionValue
[
i
]);
expect
(
property
).
assertEqual
(
descriptionValue
[
i
]);
}
}
export
function
printDescription
(
obj
)
{
let
description
=
""
;
for
(
let
i
in
obj
)
{
export
function
printDescription
(
obj
)
{
let
description
=
""
;
for
(
let
i
in
obj
)
{
let
property
=
obj
[
i
];
console
.
info
(
'
case key is
'
+
i
);
console
.
info
(
'
case value is
'
+
property
);
description
+=
i
+
"
=
"
+
property
+
"
\n
"
;
}
console
.
info
(
'
case key is
'
+
i
);
console
.
info
(
'
case value is
'
+
property
);
description
+=
i
+
"
=
"
+
property
+
"
\n
"
;
}
}
export
async
function
toNewPage
(
pagePath1
,
pagePath2
,
page
)
{
...
...
@@ -167,8 +172,8 @@ export async function clearRouter() {
export
async
function
getFd
(
pathName
)
{
let
fdObject
=
{
fileAsset
:
null
,
fdNumber
:
null
fileAsset
:
null
,
fdNumber
:
null
}
let
displayName
=
pathName
;
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
();
...
...
@@ -179,8 +184,8 @@ export async function getFd(pathName) {
if
(
dataUri
!=
undefined
)
{
let
args
=
dataUri
.
id
.
toString
();
let
fetchOp
=
{
selections
:
fileKeyObj
.
ID
+
"
=?
"
,
selectionArgs
:
[
args
],
selections
:
fileKeyObj
.
ID
+
"
=?
"
,
selectionArgs
:
[
args
],
}
let
fetchFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
fdObject
.
fileAsset
=
await
fetchFileResult
.
getAllObject
();
...
...
@@ -192,8 +197,8 @@ export async function getFd(pathName) {
export
async
function
getAudioFd
(
pathName
)
{
let
fdObject
=
{
fileAsset
:
null
,
fdNumber
:
null
fileAsset
:
null
,
fdNumber
:
null
}
let
displayName
=
pathName
;
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
();
...
...
@@ -204,8 +209,8 @@ export async function getAudioFd(pathName) {
if
(
dataUri
!=
undefined
)
{
let
args
=
dataUri
.
id
.
toString
();
let
fetchOp
=
{
selections
:
fileKeyObj
.
ID
+
"
=?
"
,
selectionArgs
:
[
args
],
selections
:
fileKeyObj
.
ID
+
"
=?
"
,
selectionArgs
:
[
args
],
}
let
fetchFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
fdObject
.
fileAsset
=
await
fetchFileResult
.
getAllObject
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录