提交 f1f38af3 编写于 作者: D durui

枚举覆盖

Signed-off-by: Ndurui <durui15@huawei.com>
上级 785e3d66
...@@ -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();
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册