Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
04d097da
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看板
未验证
提交
04d097da
编写于
12月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6957 [Beta 4] Added xts testcases for av_session
Merge pull request !6957 from Li Yuhang/add_xts_av_session_1217_Beta4
上级
e66c2788
4d8dc502
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
209 addition
and
3 deletion
+209
-3
multimedia/avsession/avsession_js_standard/avsessionManager/src/main/js/test/AVSession.test.js
...ndard/avsessionManager/src/main/js/test/AVSession.test.js
+209
-3
未找到文件。
multimedia/avsession/avsession_js_standard/avsessionManager/src/main/js/test/AVSession.test.js
浏览文件 @
04d097da
...
@@ -1323,7 +1323,7 @@ export default function AVSession() {
...
@@ -1323,7 +1323,7 @@ export default function AVSession() {
/* *
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONACTIVATE_PROMISE_0100
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONACTIVATE_PROMISE_0100
* @tc.name : SESSIONACTIVATE_0100
* @tc.name : SESSIONACTIVATE_
PROMISE_
0100
* @tc.desc : Testing set session active - promise
* @tc.desc : Testing set session active - promise
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -1354,7 +1354,7 @@ export default function AVSession() {
...
@@ -1354,7 +1354,7 @@ export default function AVSession() {
/* *
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONDEACTIVATE_PROMISE_0100
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONDEACTIVATE_PROMISE_0100
* @tc.name : SESSIONDEACTIVATE_0100
* @tc.name : SESSIONDEACTIVATE_
PROMISE_
0100
* @tc.desc : Testing deactivate session- promise
* @tc.desc : Testing deactivate session- promise
* @tc.size : MediumTest
* @tc.size : MediumTest
* @tc.type : Function
* @tc.type : Function
...
@@ -1392,6 +1392,92 @@ export default function AVSession() {
...
@@ -1392,6 +1392,92 @@ export default function AVSession() {
done
();
done
();
})
})
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONACTIVATE_CALLBACK_0100
* @tc.name : SESSIONACTIVATE_CALLBACK_0100
* @tc.desc : Testing set session active - callback
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_SESSIONACTIVATE_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
try
{
session
.
activate
((
err
)
=>
{
if
(
err
)
{
console
.
info
(
`TestLog: Set active error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
TestLog: Set session active successfully
'
);
}
})
}
catch
(
err
)
{
console
.
info
(
`TestLog: Set active error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
await
sleep
(
500
);
await
controller
.
isActive
().
then
((
data
)
=>
{
if
(
data
)
{
console
.
info
(
'
TestLog: session is active
'
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
TestLog: session is directive
'
);
expect
(
false
).
assertTrue
();
}
}).
catch
((
err
)
=>
{
console
.
info
(
`TestLog: AVSessionTest error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONDEACTIVATE_CALLBACK_0100
* @tc.name : SESSIONDEACTIVATE_CALLBACK_0100
* @tc.desc : Testing deactivate session- callback
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_SESSIONDEACTIVATE_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
await
session
.
activate
().
then
(()
=>
{
console
.
info
(
'
TestLog: Set session active
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
`TestLog: Set active error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
});
await
sleep
(
500
);
try
{
session
.
deactivate
((
err
)
=>
{
if
(
err
)
{
console
.
info
(
`TestLog: Deactivate session error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
TestLog: Deactivate session
'
);
}
})
}
catch
(
err
)
{
console
.
info
(
`TestLog: Deactivate session error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
await
sleep
(
500
);
await
controller
.
isActive
().
then
((
data
)
=>
{
if
(
data
)
{
console
.
info
(
'
TestLog: session deactivate failed
'
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
TestLog: session deactivate successfully
'
);
expect
(
true
).
assertTrue
();
}
}).
catch
((
err
)
=>
{
console
.
info
(
`TestLog: AVSessionTest error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONDESTROY_PROMISE_0100
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SESSIONDESTROY_PROMISE_0100
* @tc.name : SESSIONDESTROY_0100
* @tc.name : SESSIONDESTROY_0100
...
@@ -2764,5 +2850,125 @@ export default function AVSession() {
...
@@ -2764,5 +2850,125 @@ export default function AVSession() {
})
})
done
();
done
();
})
})
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_CALLBACK_0100
* @tc.name : SENDAVKEYEVENT_CALLBACK_0100
* @tc.desc : Testing set key event
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
let
keyItem
=
{
code
:
0x49
,
pressedTime
:
123456789
,
deviceId
:
0
};
let
event
=
{
action
:
2
,
key
:
keyItem
,
keys
:
[
keyItem
]};
try
{
controller
.
sendAVKeyEvent
(
event
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`TestLog: sendAVKeyEvent error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
sendAVKeyEvent Successfully
'
);
expect
(
true
).
assertTrue
();
}
})
}
catch
(
err
)
{
console
.
info
(
`TestLog: sendAVKeyEvent error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_PROMISE_0100
* @tc.name : SENDAVKEYEVENT_PROMISE_0100
* @tc.desc : Testing set key event
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
let
keyItem
=
{
code
:
0x49
,
pressedTime
:
123456789
,
deviceId
:
0
};
let
event
=
{
action
:
2
,
key
:
keyItem
,
keys
:
[
keyItem
]};
await
controller
.
sendAVKeyEvent
(
event
).
then
(()
=>
{
console
.
info
(
'
sendAVKeyEvent Successfully
'
);
expect
(
true
).
assertTrue
();
}).
catch
((
err
)
=>
{
console
.
info
(
`TestLog: sendAVKeyEvent error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_GETREALPLAYBACKPOSITIONSYNC_0100
* @tc.name : GETREALPLAYBACKPOSITIONSYNC_0100
* @tc.desc : Testing get real playback position
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_GETREALPLAYBACKPOSITIONSYNC_0100
'
,
0
,
async
function
(
done
)
{
let
realPosition
=
-
1
;
try
{
realPosition
=
controller
.
getRealPlaybackPositionSync
();
}
catch
(
err
)
{
console
.
info
(
`TestLog: getRealPlaybackPositionSync error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
if
(
realPosition
<
0
)
{
console
.
info
(
`TestLog: getRealPlaybackPositionSync error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`TestLog: getRealPlaybackPositionSync Successfully, positon:
${
realPosition
}
`
);
expect
(
true
).
assertTrue
();
}
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_GETVALIDCOMMANDS_PROMISE_0100
* @tc.name : GETVALIDCOMMANDS_PROMISE_0100
* @tc.desc : Testing get valid commands - promise
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_GETVALIDCOMMANDS_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
await
controller
.
getValidCommands
().
then
((
data
)
=>
{
console
.
info
(
`TestLog: getValidCommands Successfully, the length
${
data
.
length
}
`
);
expect
(
true
).
assertTrue
();
}).
catch
((
err
)
=>
{
console
.
info
(
`TestLog: getValidCommands error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
});
done
();
})
/* *
* @tc.number : SUB_MULTIMEDIA_AVSESSION_GETVALIDCOMMANDS_CALLBACK_0100
* @tc.name : GETVALIDCOMMANDS_CALLBACK_0100
* @tc.desc : Testing get valid commands - callback
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level2
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_GETVALIDCOMMANDS_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
try
{
controller
.
getValidCommands
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`TestLog: getValidCommands error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
`TestLog: getValidCommands Successfully, the length
${
data
.
length
}
`
);
expect
(
true
).
assertTrue
();
}
})
}
catch
(
err
)
{
console
.
info
(
`TestLog: getValidCommands error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
}
done
();
})
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录