Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f1f38af3
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看板
提交
f1f38af3
编写于
7月 31, 2023
作者:
D
durui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
枚举覆盖
Signed-off-by:
N
durui
<
durui15@huawei.com
>
上级
785e3d66
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
95 addition
and
99 deletion
+95
-99
multimedia/avsession/avsession_js_standard/avsessionManager/src/main/js/test/AVSession.test.js
...ndard/avsessionManager/src/main/js/test/AVSession.test.js
+80
-80
multimedia/avsession/avsession_js_standard/avsessionManager/src/main/js/test/AVSessionControllerJSTest.js
...sionManager/src/main/js/test/AVSessionControllerJSTest.js
+15
-19
未找到文件。
multimedia/avsession/avsession_js_standard/avsessionManager/src/main/js/test/AVSession.test.js
浏览文件 @
f1f38af3
...
@@ -31,12 +31,12 @@ export default function AVSession() {
...
@@ -31,12 +31,12 @@ export default function AVSession() {
let
context
=
featureAbility
.
getContext
();
let
context
=
featureAbility
.
getContext
();
let
castControlCommandType
=
'
play
'
;
let
castControlCommandType
=
'
play
'
;
let
deviceInfo
=
{
let
deviceInfo
=
{
castCategory
:
0
,
castCategory
:
0
,
deviceId
:
"
deviceId
"
,
deviceId
:
"
deviceId
"
,
deviceName
:
"
deviceName
"
,
deviceName
:
"
deviceName
"
,
}
}
let
outputDeviceInfo
=
{
let
outputDeviceInfo
=
{
devices
:
[
deviceInfo
],
devices
:
[
deviceInfo
],
}
}
function
sleep
(
ms
)
{
function
sleep
(
ms
)
{
...
@@ -677,7 +677,7 @@ export default function AVSession() {
...
@@ -677,7 +677,7 @@ export default function AVSession() {
it
(
'
SUB_MULTIMEDIA_AVSESSION_SETAVPLAYBACKSTATE_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AVSESSION_SETAVPLAYBACKSTATE_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
let
PlaybackState1
=
{
let
PlaybackState1
=
{
state
:
avSession
.
PlaybackState
.
PLAYBACK_STATE_PLAY
,
state
:
avSession
.
PlaybackState
.
PLAYBACK_STATE_PLAY
,
activeItemId
:
0
,
activeItemId
:
0
,
};
};
await
session
.
setAVPlaybackState
(
PlaybackState1
).
then
(()
=>
{
await
session
.
setAVPlaybackState
(
PlaybackState1
).
then
(()
=>
{
console
.
info
(
'
TestLog: Set State successfully
'
);
console
.
info
(
'
TestLog: Set State successfully
'
);
...
@@ -1458,7 +1458,7 @@ export default function AVSession() {
...
@@ -1458,7 +1458,7 @@ export default function AVSession() {
});
});
await
sleep
(
500
);
await
sleep
(
500
);
try
{
try
{
session
.
deactivate
((
err
)
=>
{
session
.
deactivate
((
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
`TestLog: Deactivate session error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
info
(
`TestLog: Deactivate session error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
...
@@ -2863,8 +2863,8 @@ export default function AVSession() {
...
@@ -2863,8 +2863,8 @@ export default function AVSession() {
* @tc.level : Level2
* @tc.level : Level2
*/
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
let
keyItem
=
{
code
:
0x49
,
pressedTime
:
123456789
,
deviceId
:
0
};
let
keyItem
=
{
code
:
0x49
,
pressedTime
:
123456789
,
deviceId
:
0
};
let
event
=
{
action
:
2
,
key
:
keyItem
,
keys
:
[
keyItem
]
};
let
event
=
{
action
:
2
,
key
:
keyItem
,
keys
:
[
keyItem
]
};
try
{
try
{
controller
.
sendAVKeyEvent
(
event
,
(
err
,
data
)
=>
{
controller
.
sendAVKeyEvent
(
event
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
...
@@ -2891,8 +2891,8 @@ export default function AVSession() {
...
@@ -2891,8 +2891,8 @@ export default function AVSession() {
* @tc.level : Level2
* @tc.level : Level2
*/
*/
it
(
'
SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AVSESSION_SENDAVKEYEVENT_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
let
keyItem
=
{
code
:
0x49
,
pressedTime
:
123456789
,
deviceId
:
0
};
let
keyItem
=
{
code
:
0x49
,
pressedTime
:
123456789
,
deviceId
:
0
};
let
event
=
{
action
:
2
,
key
:
keyItem
,
keys
:
[
keyItem
]
};
let
event
=
{
action
:
2
,
key
:
keyItem
,
keys
:
[
keyItem
]
};
await
controller
.
sendAVKeyEvent
(
event
).
then
(()
=>
{
await
controller
.
sendAVKeyEvent
(
event
).
then
(()
=>
{
console
.
info
(
'
sendAVKeyEvent Successfully
'
);
console
.
info
(
'
sendAVKeyEvent Successfully
'
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
...
@@ -2914,7 +2914,7 @@ export default function AVSession() {
...
@@ -2914,7 +2914,7 @@ export default function AVSession() {
it
(
'
SUB_MULTIMEDIA_AVSESSION_GETREALPLAYBACKPOSITIONSYNC_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MULTIMEDIA_AVSESSION_GETREALPLAYBACKPOSITIONSYNC_0100
'
,
0
,
async
function
(
done
)
{
let
realPosition
=
-
1
;
let
realPosition
=
-
1
;
try
{
try
{
realPosition
=
controller
.
getRealPlaybackPositionSync
();
realPosition
=
controller
.
getRealPlaybackPositionSync
();
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
`TestLog: getRealPlaybackPositionSync error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
info
(
`TestLog: getRealPlaybackPositionSync error: code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
...
multimedia/avsession/avsession_js_standard/avsessionManager/src/main/js/test/AVSessionControllerJSTest.js
浏览文件 @
f1f38af3
...
@@ -33,9 +33,6 @@ export default function AVSessionControllerJsTest() {
...
@@ -33,9 +33,6 @@ export default function AVSessionControllerJsTest() {
let
receivedParam2
=
null
;
let
receivedParam2
=
null
;
let
receivedExtras
=
null
;
let
receivedExtras
=
null
;
let
receivedExtras2
=
null
;
let
receivedExtras2
=
null
;
// let value = Uint8Array = resourceManager.getRawFileContent('IMAGE_URI');
// let imageSource = imageImageSource = image.createImageSource(value.buffer);
// let imagePixel = image.PixelMap = imageSource.createPixelMap({desiredSize:{width: 150, height: 150}});
const
INVALID_STRING
=
"
invalid string
"
;
const
INVALID_STRING
=
"
invalid string
"
;
const
UPDATE_LYRICS_EVENT
=
"
dynamic_lyrics
"
;
const
UPDATE_LYRICS_EVENT
=
"
dynamic_lyrics
"
;
const
UPDATE_LYRICS_WANT_PARAMS
=
{
const
UPDATE_LYRICS_WANT_PARAMS
=
{
...
@@ -58,17 +55,16 @@ export default function AVSessionControllerJsTest() {
...
@@ -58,17 +55,16 @@ export default function AVSessionControllerJsTest() {
mediaId
:
QUEUE_ITEM_KEY_WORD
,
mediaId
:
QUEUE_ITEM_KEY_WORD
,
title
:
QUEUE_ITEM_KEY_WORD
,
title
:
QUEUE_ITEM_KEY_WORD
,
extras
:
EXTRAS
,
extras
:
EXTRAS
,
// icon: undefined,
iconUri
:
"
iconUri
"
,
iconUri
:
"
iconUri
"
,
mediaSize
:
10
,
mediaSize
:
10
,
albumTitle
:
"
albumTitle
"
,
albumTitle
:
"
albumTitle
"
,
albumCoverUri
:
"
albumCoverUri
"
,
albumCoverUri
:
"
albumCoverUri
"
,
lyricContent
:
"
lyricContent
"
,
lyricContent
:
"
lyricContent
"
,
lyricUri
:
"
lyricUri
"
,
lyricUri
:
"
lyricUri
"
,
mediaUri
:
"
mediaUri
"
,
mediaUri
:
"
mediaUri
"
,
startPosition
:
0
,
startPosition
:
0
,
creditsPosition
:
0
,
creditsPosition
:
0
,
appName
:
"
appName
"
appName
:
"
appName
"
};
};
const
QUEUE_ITEM_DESCRIPTION_ERROR
=
{
const
QUEUE_ITEM_DESCRIPTION_ERROR
=
{
mediaId
:
QUEUE_ITEM_KEY_WORD
,
mediaId
:
QUEUE_ITEM_KEY_WORD
,
...
@@ -78,13 +74,13 @@ export default function AVSessionControllerJsTest() {
...
@@ -78,13 +74,13 @@ export default function AVSessionControllerJsTest() {
iconUri
:
"
iconUri
"
,
iconUri
:
"
iconUri
"
,
mediaSize
:
10
,
mediaSize
:
10
,
albumTitle
:
"
albumTitle
"
,
albumTitle
:
"
albumTitle
"
,
albumCoverUri
:
"
albumCoverUri
"
,
albumCoverUri
:
"
albumCoverUri
"
,
lyricContent
:
"
lyricContent
"
,
lyricContent
:
"
lyricContent
"
,
lyricUri
:
"
lyricUri
"
,
lyricUri
:
"
lyricUri
"
,
mediaUri
:
"
mediaUri
"
,
mediaUri
:
"
mediaUri
"
,
startPosition
:
0
,
startPosition
:
0
,
creditsPosition
:
0
,
creditsPosition
:
0
,
appName
:
"
appName
"
appName
:
"
appName
"
};
};
const
QUEUE_ITEM
=
{
const
QUEUE_ITEM
=
{
itemId
:
QUEUE_ITEM_ID
,
itemId
:
QUEUE_ITEM_ID
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录