未验证 提交 0d912d04 编写于 作者: O openharmony_ci 提交者: Gitee

!2456 videoPlayer 测试用例修改

Merge pull request !2456 from FULIZHONG/0315player
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container { .container {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
......
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ title }} {{ $t('strings.hello') }} {{ title }}
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container { .container {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
......
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ title }} {{ $t('strings.hello') }} {{ title }}
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"./resource/audio/H264_AAC.mp4 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoplayer/" "./resource/audio/H264_AAC.mp4 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoplayer/"
] ]
}, },
{ {
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
], ],
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
"visible": true, "visible": true,
"labelId": 16777216, "labelId": 16777216,
"icon": "$media:icon", "icon": "$media:icon",
"name": "ohos.acts.multimedia.audio.audioplayer.MainAbility", "name": "ohos.acts.multimedia.video.videoplayer.MainAbility",
"description": "$string:mainability_description", "description": "$string:mainability_description",
"label": "$string:entry_MainAbility", "label": "$string:entry_MainAbility",
"type": "page", "type": "page",
...@@ -49,20 +49,21 @@ ...@@ -49,20 +49,21 @@
"tv", "tv",
"wearable" "wearable"
], ],
"mainAbility": "ohos.acts.multimedia.audio.audioplayer.MainAbility", "mainAbility": "ohos.acts.multimedia.video.videoplayer.MainAbility",
"distro": { "distro": {
"moduleType": "entry", "moduleType": "entry",
"installationFree": false, "installationFree": false,
"deliveryWithInstall": true, "deliveryWithInstall": true,
"moduleName": "entry" "moduleName": "entry"
}, },
"package": "ohos.acts.multimedia.audio.audioplayer", "package": "ohos.acts.multimedia.video.videoplayer",
"name": ".MyApplication", "name": ".MyApplication",
"js": [ "js": [
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/surfaceTest/surfaceTest" "pages/surfaceTest/surfaceTest",
"pages/surfaceTest2/surfaceTest2"
], ],
"name": "default", "name": "default",
"window": { "window": {
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container { .container {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
......
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ title }} {{ $t('strings.hello') }} {{ title }}
</text> </text>
<Xcomponent id = 'XcomponentId'
type = 'surface'
onload = 'LoadXcomponent'
style = "width:720px;height:480px;border-color:red;border-width:5px">
</Xcomponent>
</div> </div>
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -33,15 +33,9 @@ export default { ...@@ -33,15 +33,9 @@ export default {
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
this.timeout = 60000 this.timeout = 60000
configService.setConfig(this) configService.setConfig(this)
setTimeout(function() { require('../../../test/List.test')
require('../../../test/List.test') core.execute()
core.execute()
}, 2000)
}, },
onReady() { onReady() {
}, },
LoadXcomponent() {
globalThis.value = this.$element('XcomponentId').getComponentSurfaceId()
},
} }
\ No newline at end of file
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container { .container {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
......
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
VideoPlayer Test VideoPlayer Test
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<text class="title">
VideoPlayer Test
</text>
<Xcomponent id = 'XcomponentId3'
type = 'surface'
onload = 'LoadXcomponent3'
style = "width:720px;height:480px;border-color:red;border-width:5px">
</Xcomponent>
</div>
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from 'deccjsunit/index'
import Fileio from '@ohos.fileio'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
},
onReady() {
},
LoadXcomponent3() {
globalThis.value = this.$element('XcomponentId3').getXComponentSurfaceId()
},
}
\ No newline at end of file
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -48,6 +48,7 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -48,6 +48,7 @@ describe('VideoPlayerAPICallbackTest', function () {
let surfaceID = ''; let surfaceID = '';
let fdPath; let fdPath;
let fdValue; let fdValue;
let temp = 0;
let events = require('events'); let events = require('events');
let eventEmitter = new events.EventEmitter(); let eventEmitter = new events.EventEmitter();
...@@ -56,7 +57,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -56,7 +57,11 @@ describe('VideoPlayerAPICallbackTest', function () {
}) })
beforeEach(async function() { beforeEach(async function() {
console.info('case flush surfaceID start');
await toNewPage(); await toNewPage();
console.info('case flush surfaceID end');
await msleep(1000).then(() => {
}, failureCallback).catch(catchCallback);
console.info('beforeEach case'); console.info('beforeEach case');
}) })
...@@ -70,6 +75,20 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -70,6 +75,20 @@ describe('VideoPlayerAPICallbackTest', function () {
console.info('afterAll case'); console.info('afterAll case');
}) })
function msleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function failureCallback(error) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
}
function catchCallback(error) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
}
async function getFd() { async function getFd() {
fdPath = 'fd://'; fdPath = 'fd://';
await fileIO.open(AUDIO_SOURCE).then((fdNumber) => { await fileIO.open(AUDIO_SOURCE).then((fdNumber) => {
...@@ -84,7 +103,14 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -84,7 +103,14 @@ describe('VideoPlayerAPICallbackTest', function () {
} }
async function toNewPage() { async function toNewPage() {
let path = 'pages/surfaceTest/surfaceTest'; let path = '';
if (temp == 0) {
path = 'pages/surfaceTest/surfaceTest';
temp = 1;
} else {
path = 'pages/surfaceTest/surfaceTest2';
temp = 0;
}
let options = { let options = {
uri: path, uri: path,
} }
...@@ -380,14 +406,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -380,14 +406,12 @@ describe('VideoPlayerAPICallbackTest', function () {
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0100', 0, async function (done) {
await getFd(); await getFd();
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -399,14 +423,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -399,14 +423,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -418,14 +440,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -418,14 +440,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -437,14 +457,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -437,14 +457,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
STOP_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -456,14 +474,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -456,14 +474,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
RESET_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -475,14 +491,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -475,14 +491,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, SEEK_TIME, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -494,14 +508,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -494,14 +508,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
SEEK_MODE_EVENT, SEEK_TIME, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -513,14 +525,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -513,14 +525,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
SETVOLUME_EVENT, VOLUME_VALUE, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -532,14 +542,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -532,14 +542,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
SETSPEED_EVENT, SPEED_VALUE, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -551,14 +559,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -551,14 +559,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -570,14 +576,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -570,14 +576,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -589,14 +593,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -589,14 +593,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PREPARE_CALLBACK_1200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PREPARE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PREPARE_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -608,13 +610,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -608,13 +610,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -626,14 +626,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -626,14 +626,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -645,14 +643,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -645,14 +643,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -664,14 +660,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -664,14 +660,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -683,14 +677,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -683,14 +677,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -702,14 +694,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -702,14 +694,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -721,14 +711,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -721,14 +711,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -740,14 +728,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -740,14 +728,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -759,14 +745,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -759,14 +745,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -778,14 +762,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -778,14 +762,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PLAY_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -797,14 +779,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -797,14 +779,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, GETDESCRIPTION, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -816,14 +796,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -816,14 +796,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PLAY_CALLBACK_1200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PLAY_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PLAY_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -835,13 +813,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -835,13 +813,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -853,14 +829,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -853,14 +829,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -872,14 +846,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -872,14 +846,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -891,14 +863,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -891,14 +863,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -910,14 +880,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -910,14 +880,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -929,14 +897,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -929,14 +897,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -948,14 +914,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -948,14 +914,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -967,14 +931,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -967,14 +931,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -986,14 +948,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -986,14 +948,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1005,14 +965,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1005,14 +965,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1024,14 +982,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1024,14 +982,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, GETDESCRIPTION, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1043,14 +999,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1043,14 +999,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_PAUSE_CALLBACK_1200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PAUSE_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PAUSE_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1062,13 +1016,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1062,13 +1016,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1080,14 +1032,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1080,14 +1032,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1099,14 +1049,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1099,14 +1049,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1118,14 +1066,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1118,14 +1066,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1137,14 +1083,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1137,14 +1083,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1156,14 +1100,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1156,14 +1100,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1175,14 +1117,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1175,14 +1117,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1194,14 +1134,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1194,14 +1134,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1213,14 +1151,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1213,14 +1151,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1232,14 +1168,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1232,14 +1168,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1251,14 +1185,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1251,14 +1185,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, GETDESCRIPTION, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1270,14 +1202,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1270,14 +1202,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_STOP_CALLBACK_1200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, STOP_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, STOP_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1289,13 +1219,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1289,13 +1219,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1307,14 +1235,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1307,14 +1235,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1326,14 +1252,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1326,14 +1252,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1345,14 +1269,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1345,14 +1269,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1364,14 +1286,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1364,14 +1286,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1383,14 +1303,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1383,14 +1303,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1402,14 +1320,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1402,14 +1320,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1421,14 +1337,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1421,14 +1337,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1440,14 +1354,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1440,14 +1354,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1459,14 +1371,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1459,14 +1371,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1478,14 +1388,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1478,14 +1388,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, GETDESCRIPTION, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1497,14 +1405,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1497,14 +1405,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RESET_CALLBACK_1200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, RESET_EVENT, RESET_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RESET_EVENT, RESET_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1516,13 +1422,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1516,13 +1422,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1534,14 +1438,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1534,14 +1438,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1553,14 +1455,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1553,14 +1455,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1572,14 +1472,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1572,14 +1472,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1591,14 +1489,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1591,14 +1489,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1610,14 +1506,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1610,14 +1506,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1629,14 +1523,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1629,14 +1523,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1648,14 +1540,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1648,14 +1540,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1667,14 +1557,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1667,14 +1557,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1686,13 +1574,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1686,13 +1574,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1704,14 +1590,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1704,14 +1590,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, GETDESCRIPTION, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1723,14 +1607,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1723,14 +1607,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_RELEASE_CALLBACK_1200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1742,13 +1624,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1742,13 +1624,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1760,14 +1640,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1760,14 +1640,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1779,14 +1657,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1779,14 +1657,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1798,14 +1674,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1798,14 +1674,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1817,14 +1691,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1817,14 +1691,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1836,14 +1708,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1836,14 +1708,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1855,17 +1725,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1855,17 +1725,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, SEEK_EVENT,
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1877,15 +1743,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1877,15 +1743,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE,
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1897,14 +1761,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1897,14 +1761,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, SEEK_TIME, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1916,14 +1778,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1916,14 +1778,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, GETDESCRIPTION, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, GETDESCRIPTION, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1935,15 +1795,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1935,15 +1795,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, SEEK_EVENT, SEEK_TIME,
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, SEEK_EVENT, SEEK_TIME, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1955,14 +1813,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1955,14 +1813,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, -1, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, -1, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1974,14 +1830,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1974,14 +1830,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SEEK_CALLBACK_1400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, DURATION_TIME + 1000, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, DURATION_TIME + 1000, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -1993,13 +1847,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -1993,13 +1847,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2011,14 +1863,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2011,14 +1863,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2030,14 +1880,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2030,14 +1880,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2049,14 +1897,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2049,14 +1897,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2068,14 +1914,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2068,14 +1914,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2087,14 +1931,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2087,14 +1931,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2106,15 +1948,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2106,15 +1948,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, SETVOLUME_EVENT,
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2126,15 +1966,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2126,15 +1966,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, SETVOLUME_EVENT,
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2146,14 +1984,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2146,14 +1984,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, END_EVENT);
SETVOLUME_EVENT, VOLUME_VALUE, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2165,14 +2001,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2165,14 +2001,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, GETDESCRIPTION, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, GETDESCRIPTION, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2184,15 +2018,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2184,15 +2018,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, SETVOLUME_EVENT, VOLUME_VALUE,
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, SETVOLUME_EVENT, VOLUME_VALUE, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2204,14 +2036,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2204,14 +2036,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, -1, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, -1, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2223,14 +2053,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2223,14 +2053,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETVOLUME_CALLBACK_1400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, 2, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, 2, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2242,13 +2070,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2242,13 +2070,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSPEED_EVENT, SPEED_VALUE,ERROR_EVENT, RELEASE_EVENT, END_EVENT);
let mySteps = new Array(CREATE_EVENT, SETSPEED_EVENT, SPEED_VALUE,ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2260,14 +2086,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2260,14 +2086,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2279,14 +2103,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2279,14 +2103,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2298,14 +2120,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2298,14 +2120,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2317,15 +2137,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2317,15 +2137,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, SETSPEED_EVENT, SPEED_VALUE,
PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, SETSPEED_EVENT, SPEED_VALUE, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2337,15 +2155,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2337,15 +2155,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, SETSPEED_EVENT, SPEED_VALUE,
PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, SETSPEED_EVENT, SPEED_VALUE, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2357,15 +2173,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2357,15 +2173,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME,
PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2377,15 +2191,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2377,15 +2191,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, SETSPEED_EVENT,
PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2397,14 +2209,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2397,14 +2209,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, SETSPEED_EVENT, SPEED_VALUE, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
SETSPEED_EVENT, SPEED_VALUE, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2416,14 +2226,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2416,14 +2226,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, GETDESCRIPTION, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, GETDESCRIPTION, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2435,15 +2243,13 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2435,15 +2243,13 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, SETSPEED_EVENT, SPEED_VALUE,
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, SETSPEED_EVENT, SPEED_VALUE, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2455,14 +2261,12 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2455,14 +2261,12 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, -1, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, -1, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -2474,13 +2278,11 @@ describe('VideoPlayerAPICallbackTest', function () { ...@@ -2474,13 +2278,11 @@ describe('VideoPlayerAPICallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_SETSPEED_CALLBACK_1400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, 5, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, 5, ERROR_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
}) })
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -29,6 +29,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -29,6 +29,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
const SETSURFACE_EVENT = 'setDisplaySurface'; const SETSURFACE_EVENT = 'setDisplaySurface';
const GETDESCRIPTION = 'getTrackDescription'; const GETDESCRIPTION = 'getTrackDescription';
const PREPARE_EVENT = 'prepare'; const PREPARE_EVENT = 'prepare';
const PREPARE2_EVENT = 'prepare2';
const PLAY_EVENT = 'play'; const PLAY_EVENT = 'play';
const PAUSE_EVENT = 'pause'; const PAUSE_EVENT = 'pause';
const STOP_EVENT = 'stop'; const STOP_EVENT = 'stop';
...@@ -47,6 +48,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -47,6 +48,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
let surfaceID = ''; let surfaceID = '';
let fdPath; let fdPath;
let fdValue; let fdValue;
let temp = 0;
let events = require('events'); let events = require('events');
let eventEmitter = new events.EventEmitter(); let eventEmitter = new events.EventEmitter();
...@@ -55,7 +57,11 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -55,7 +57,11 @@ describe('VideoPlayerFuncCallbackTest', function () {
}) })
beforeEach(async function() { beforeEach(async function() {
console.info('case flush surfaceID start');
await toNewPage(); await toNewPage();
console.info('case flush surfaceID end');
await msleep(1000).then(() => {
}, failureCallback).catch(catchCallback);
console.info('beforeEach case'); console.info('beforeEach case');
}) })
...@@ -69,12 +75,33 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -69,12 +75,33 @@ describe('VideoPlayerFuncCallbackTest', function () {
console.info('afterAll case'); console.info('afterAll case');
}) })
function failureCallback(error) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
}
function catchCallback(error) {
expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`);
}
function sleep(time) { function sleep(time) {
for(let t = Date.now(); Date.now() - t <= time;); for(let t = Date.now(); Date.now() - t <= time;);
} }
function msleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function toNewPage() { async function toNewPage() {
let path = 'pages/surfaceTest/surfaceTest'; let path = '';
if (temp == 0) {
path = 'pages/surfaceTest/surfaceTest';
temp = 1;
} else {
path = 'pages/surfaceTest/surfaceTest2';
temp = 0;
}
let options = { let options = {
uri: path, uri: path,
} }
...@@ -138,10 +165,7 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -138,10 +165,7 @@ describe('VideoPlayerFuncCallbackTest', function () {
}); });
videoPlayer.on('videoSizeChanged', (width, height) => { videoPlayer.on('videoSizeChanged', (width, height) => {
expect(width).assertEqual(WIDTH_VALUE); console.info('case videoSizeChanged success');
expect(height).assertEqual(HEIGHT_VALUE);
console.info('case videoSizeChanged success width is ' + width);
console.info('case videoSizeChanged success height is ' + height);
}); });
videoPlayer.on('error', (error) => { videoPlayer.on('error', (error) => {
...@@ -179,6 +203,22 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -179,6 +203,22 @@ describe('VideoPlayerFuncCallbackTest', function () {
}); });
eventEmitter.on(PREPARE_EVENT, (videoPlayer, steps, done) => { eventEmitter.on(PREPARE_EVENT, (videoPlayer, steps, done) => {
steps.shift();
videoPlayer.prepare((err) => {
if (typeof (err) == 'undefined') {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare success!!');
toNextStep(videoPlayer, steps, done);
} else {
printfError(err, done);
}
});
});
eventEmitter.on(PREPARE2_EVENT, (videoPlayer, steps, done) => {
steps.shift(); steps.shift();
videoPlayer.url = fdPath; videoPlayer.url = fdPath;
videoPlayer.prepare((err) => { videoPlayer.prepare((err) => {
...@@ -407,14 +447,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -407,14 +447,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0100', 0, async function (done) {
await getFd(); await getFd();
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -426,14 +464,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -426,14 +464,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT);
PLAY_EVENT, PAUSE_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -445,14 +481,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -445,14 +481,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -464,14 +498,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -464,14 +498,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PLAY_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -483,14 +515,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -483,14 +515,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PLAY_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -502,14 +532,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -502,14 +532,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, SEEK_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -521,15 +549,13 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -521,15 +549,13 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC,
SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC, SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC,RELEASE_EVENT, END_EVENT);
SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC,RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -541,14 +567,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -541,14 +567,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT);
SETVOLUME_EVENT, VOLUME_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -560,14 +584,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -560,14 +584,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_0900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT);
SETSPEED_EVENT, SPEED_VALUE, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -579,14 +601,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -579,14 +601,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, GETDESCRIPTION, RELEASE_EVENT, END_EVENT);
GETDESCRIPTION, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -598,14 +618,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -598,14 +618,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -617,14 +635,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -617,14 +635,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -636,14 +652,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -636,14 +652,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SEEK_EVENT, SEEK_TIME, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, SEEK_EVENT, SEEK_TIME, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -655,15 +669,13 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -655,15 +669,13 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC,
PAUSE_EVENT, SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC, SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
SEEK_MODE_EVENT, SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -675,14 +687,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -675,14 +687,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, SETVOLUME_EVENT, VOLUME_VALUE, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -694,14 +704,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -694,14 +704,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, PAUSE_EVENT, SETSPEED_EVENT, SPEED_VALUE, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PAUSE_EVENT, SETSPEED_EVENT, SPEED_VALUE, PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -713,14 +721,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -713,14 +721,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1800', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
STOP_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -732,15 +738,13 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -732,15 +738,13 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_1900', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, STOP_EVENT, RESET_EVENT, PREPARE2_EVENT,
STOP_EVENT, RESET_EVENT, PREPARE_EVENT, PLAY_EVENT, RELEASE_EVENT, END_EVENT);
PLAY_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -752,14 +756,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -752,14 +756,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2000', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, 0, PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, 0, PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -771,15 +773,13 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -771,15 +773,13 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2100', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, 0, media.SeekMode.SEEK_NEXT_SYNC,
SEEK_MODE_EVENT, 0, media.SeekMode.SEEK_NEXT_SYNC, SEEK_MODE_EVENT, 0, media.SeekMode.SEEK_PREV_SYNC, PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT);
SEEK_MODE_EVENT, 0, media.SeekMode.SEEK_PREV_SYNC, PAUSE_EVENT, STOP_EVENT, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -791,14 +791,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -791,14 +791,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2200', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, DURATION_TIME, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, DURATION_TIME, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -810,15 +808,13 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -810,15 +808,13 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2300', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, DURATION_TIME, media.SeekMode.SEEK_PREV_SYNC,
SEEK_MODE_EVENT, DURATION_TIME, media.SeekMode.SEEK_PREV_SYNC, SEEK_MODE_EVENT, DURATION_TIME, media.SeekMode.SEEK_NEXT_SYNC, RELEASE_EVENT, END_EVENT);
SEEK_MODE_EVENT, DURATION_TIME, media.SeekMode.SEEK_NEXT_SYNC, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -830,14 +826,12 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -830,14 +826,12 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2400', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_EVENT, DURATION_TIME + 1, RELEASE_EVENT, END_EVENT);
SEEK_EVENT, DURATION_TIME + 1, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -849,15 +843,13 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -849,15 +843,13 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2500', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SEEK_MODE_EVENT, DURATION_TIME + 1, media.SeekMode.SEEK_PREV_SYNC,
SEEK_MODE_EVENT, DURATION_TIME + 1, media.SeekMode.SEEK_PREV_SYNC, SEEK_MODE_EVENT, DURATION_TIME + 1, media.SeekMode.SEEK_NEXT_SYNC, RELEASE_EVENT, END_EVENT);
SEEK_MODE_EVENT, DURATION_TIME + 1, media.SeekMode.SEEK_NEXT_SYNC, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -869,15 +861,13 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -869,15 +861,13 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2600', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETVOLUME_EVENT, 0, SETVOLUME_EVENT, 0.2, SETVOLUME_EVENT, 0.4, SETVOLUME_EVENT, 0.6,
SETVOLUME_EVENT, 0, SETVOLUME_EVENT, 0.2, SETVOLUME_EVENT, 0.4, SETVOLUME_EVENT, 0.6, SETVOLUME_EVENT, 0.8, SETVOLUME_EVENT, 1, RELEASE_EVENT, END_EVENT);
SETVOLUME_EVENT, 0.8, SETVOLUME_EVENT, 1, RELEASE_EVENT, END_EVENT); eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
/* * /* *
...@@ -889,16 +879,11 @@ describe('VideoPlayerFuncCallbackTest', function () { ...@@ -889,16 +879,11 @@ describe('VideoPlayerFuncCallbackTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_CALLBACK_2700', 0, async function (done) {
setTimeout(function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT,
let mySteps = new Array(CREATE_EVENT, SETSURFACE_EVENT, PREPARE_EVENT, PLAY_EVENT, SETSPEED_EVENT, media.PlaybackSpeed.SPEED_FORWARD_2_00_X, RELEASE_EVENT, END_EVENT);
SETSPEED_EVENT, media.PlaybackSpeed.SPEED_FORWARD_0_75_X, SETSPEED_EVENT, eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
media.PlaybackSpeed.SPEED_FORWARD_1_00_X, SETSPEED_EVENT, media.PlaybackSpeed.SPEED_FORWARD_1_25_X,
SETSPEED_EVENT, media.PlaybackSpeed.SPEED_FORWARD_1_75_X,
SETSPEED_EVENT, media.PlaybackSpeed.SPEED_FORWARD_2_00_X, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoPlayer, mySteps, done);
}, 1000);
}) })
}) })
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -32,12 +32,17 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -32,12 +32,17 @@ describe('VideoPlayerFuncPromiseTest', function () {
let surfaceID = ''; let surfaceID = '';
let fdPath; let fdPath;
let fdValue; let fdValue;
let temp = 0;
beforeAll(function() { beforeAll(function() {
console.info('beforeAll case'); console.info('beforeAll case');
}) })
beforeEach(async function() { beforeEach(async function() {
console.info('case flush surfaceID start');
await toNewPage(); await toNewPage();
console.info('case flush surfaceID end');
await msleep(1000).then(() => {
}, failureCallback).catch(catchCallback);
console.info('beforeEach case'); console.info('beforeEach case');
}) })
...@@ -55,6 +60,10 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -55,6 +60,10 @@ describe('VideoPlayerFuncPromiseTest', function () {
for(let t = Date.now(); Date.now() - t <= time;); for(let t = Date.now(); Date.now() - t <= time;);
} }
function msleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function failureCallback(error) { function failureCallback(error) {
expect().assertFail(); expect().assertFail();
console.info(`case error called,errMessage is ${error.message}`); console.info(`case error called,errMessage is ${error.message}`);
...@@ -66,7 +75,14 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -66,7 +75,14 @@ describe('VideoPlayerFuncPromiseTest', function () {
} }
async function toNewPage() { async function toNewPage() {
let path = 'pages/surfaceTest/surfaceTest'; let path = '';
if (temp == 0) {
path = 'pages/surfaceTest/surfaceTest';
temp = 1;
} else {
path = 'pages/surfaceTest/surfaceTest2';
temp = 0;
}
let options = { let options = {
uri: path, uri: path,
} }
...@@ -135,88 +151,86 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -135,88 +151,86 @@ describe('VideoPlayerFuncPromiseTest', function () {
*/ */
it('SUB_MEDIA_PLAYER_MULTIPLE_0100', 0, async function (done) { it('SUB_MEDIA_PLAYER_MULTIPLE_0100', 0, async function (done) {
await getFd(); await getFd();
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let testVideoPlayer1 = null;
let testVideoPlayer1 = null; let testVideoPlayer2 = null;
let testVideoPlayer2 = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { testVideoPlayer1 = video
testVideoPlayer1 = video console.info('case createVideoPlayer success ');
console.info('case createVideoPlayer success '); } else {
} else { console.info('case createVideoPlayer is failed');
console.info('case createVideoPlayer is failed'); expect().assertFail();
expect().assertFail(); }
} }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
testVideoPlayer1.url = fdPath;
testVideoPlayer1.url = fdPath; await testVideoPlayer1.setDisplaySurface(surfaceID).then(() => {
await testVideoPlayer1.setDisplaySurface(surfaceID).then(() => { console.info('case setDisplaySurface success');
console.info('case setDisplaySurface success'); expect(testVideoPlayer1.state).assertEqual('idle');
expect(testVideoPlayer1.state).assertEqual('idle'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
await testVideoPlayer1.prepare().then(() => {
await testVideoPlayer1.prepare().then(() => { console.info('case prepare called!!');
console.info('case prepare called!!'); expect(testVideoPlayer1.state).assertEqual('prepared');
expect(testVideoPlayer1.state).assertEqual('prepared'); expect(testVideoPlayer1.duration).assertEqual(DURATION_TIME);
expect(testVideoPlayer1.duration).assertEqual(DURATION_TIME); expect(testVideoPlayer1.width).assertEqual(WIDTH_VALUE);
expect(testVideoPlayer1.width).assertEqual(WIDTH_VALUE); expect(testVideoPlayer1.height).assertEqual(HEIGHT_VALUE);
expect(testVideoPlayer1.height).assertEqual(HEIGHT_VALUE); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
let startTime = testVideoPlayer1.currentTime;
let startTime = testVideoPlayer1.currentTime; await testVideoPlayer1.play().then(() => {
await testVideoPlayer1.play().then(() => { console.info('case play called!!');
console.info('case play called!!'); sleep(PLAY_TIME);
sleep(PLAY_TIME); expect(testVideoPlayer1.state).assertEqual('playing');
expect(testVideoPlayer1.state).assertEqual('playing'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback); let endTime = testVideoPlayer1.currentTime;
let endTime = testVideoPlayer1.currentTime; expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await testVideoPlayer1.release().then(() => {
await testVideoPlayer1.release().then(() => { console.info('case release called!!');
console.info('case release called!!'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback); testVideoPlayer1 = null;
testVideoPlayer1 = null;
await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { testVideoPlayer2 = video
testVideoPlayer2 = video console.info('case createVideoPlayer success ');
console.info('case createVideoPlayer success '); } else {
} else { console.info('case createVideoPlayer is failed');
console.info('case createVideoPlayer is failed'); expect().assertFail();
expect().assertFail(); }
} }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
testVideoPlayer2.url = fdPath;
testVideoPlayer2.url = fdPath; await testVideoPlayer2.setDisplaySurface(surfaceID).then(() => {
await testVideoPlayer2.setDisplaySurface(surfaceID).then(() => { console.info('case setDisplaySurface success');
console.info('case setDisplaySurface success'); expect(testVideoPlayer2.state).assertEqual('idle');
expect(testVideoPlayer2.state).assertEqual('idle'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
await testVideoPlayer2.prepare().then(() => {
await testVideoPlayer2.prepare().then(() => { console.info('case prepare called!!');
console.info('case prepare called!!'); expect(testVideoPlayer2.state).assertEqual('prepared');
expect(testVideoPlayer2.state).assertEqual('prepared'); expect(testVideoPlayer2.duration).assertEqual(DURATION_TIME);
expect(testVideoPlayer2.duration).assertEqual(DURATION_TIME); expect(testVideoPlayer2.width).assertEqual(WIDTH_VALUE);
expect(testVideoPlayer2.width).assertEqual(WIDTH_VALUE); expect(testVideoPlayer2.height).assertEqual(HEIGHT_VALUE);
expect(testVideoPlayer2.height).assertEqual(HEIGHT_VALUE); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
startTime = testVideoPlayer2.currentTime;
startTime = testVideoPlayer2.currentTime; await testVideoPlayer2.play().then(() => {
await testVideoPlayer2.play().then(() => { console.info('case play called!!');
console.info('case play called!!'); sleep(PLAY_TIME);
sleep(PLAY_TIME); expect(testVideoPlayer2.state).assertEqual('playing');
expect(testVideoPlayer2.state).assertEqual('playing'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback); endTime = testVideoPlayer2.currentTime;
endTime = testVideoPlayer2.currentTime; expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await testVideoPlayer2.release().then(() => {
await testVideoPlayer2.release().then(() => { console.info('case release called!!');
console.info('case release called!!'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback); testVideoPlayer2 = null;
testVideoPlayer2 = null; done();
done();
}, 1000);
}) })
/* * /* *
...@@ -228,49 +242,47 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -228,49 +242,47 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0100', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { console.info('case createVideoPlayer success');
console.info('case createVideoPlayer success'); videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case setDisplaySurface success');
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); } else {
console.info('case createVideoPlayer is failed');
await videoPlayer.prepare().then(() => { expect().assertFail();
console.info('case prepare called!!'); }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
expect(videoPlayer.state).assertEqual('idle');
let startTime = videoPlayer.currentTime; }, failureCallback).catch(catchCallback);
await videoPlayer.play().then(() => {
console.info('case play called!!'); await videoPlayer.prepare().then(() => {
sleep(PLAY_TIME); console.info('case prepare called!!');
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.state).assertEqual('prepared');
}, failureCallback).catch(catchCallback); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
let endTime = videoPlayer.currentTime; expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!'); startTime = videoPlayer.currentTime;
}, failureCallback).catch(catchCallback); await videoPlayer.play().then(() => {
done(); console.info('case play called!!');
}, 1000); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -282,53 +294,51 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -282,53 +294,51 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0200', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case setDisplaySurface success');
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); } else {
console.info('case createVideoPlayer is failed');
await videoPlayer.prepare().then(() => { expect().assertFail();
console.info('case prepare called!!'); }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
expect(videoPlayer.state).assertEqual('idle');
let startTime = videoPlayer.currentTime; }, failureCallback).catch(catchCallback);
await videoPlayer.play().then(() => {
console.info('case play called!!'); await videoPlayer.prepare().then(() => {
sleep(PLAY_TIME); console.info('case prepare called!!');
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.state).assertEqual('prepared');
}, failureCallback).catch(catchCallback); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
let endTime = videoPlayer.currentTime; expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
}, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => {
expect(videoPlayer.state).assertEqual('paused'); let startTime = videoPlayer.currentTime;
console.info('case pause called!!'); await videoPlayer.play().then(() => {
}, failureCallback).catch(catchCallback); console.info('case play called!!');
sleep(PLAY_TIME);
await videoPlayer.release().then(() => { expect(videoPlayer.state).assertEqual('playing');
console.info('case release called!!'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback); let endTime = videoPlayer.currentTime;
done(); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
}, 1000);
await videoPlayer.pause().then(() => {
expect(videoPlayer.state).assertEqual('paused');
console.info('case pause called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -340,62 +350,60 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -340,62 +350,60 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0300', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); await videoPlayer.play().then(() => {
console.info('case pause called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
startTime = videoPlayer.currentTime; }, failureCallback).catch(catchCallback);
await videoPlayer.play().then(() => { let endTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
console.info('case play called!!');
sleep(PLAY_TIME); await videoPlayer.pause().then(() => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('paused');
endTime = videoPlayer.currentTime; console.info('case pause called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { startTime = videoPlayer.currentTime;
console.info('case release called!!'); await videoPlayer.play().then(() => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
done(); console.info('case play called!!');
}, 1000); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -407,53 +415,51 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -407,53 +415,51 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0400', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.stop().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('stopped'); await videoPlayer.play().then(() => {
console.info('case stop called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.release().then(() => { }, failureCallback).catch(catchCallback);
console.info('case release called!!'); let endTime = videoPlayer.currentTime;
}, failureCallback).catch(catchCallback); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
done();
}, 1000); await videoPlayer.stop().then(() => {
expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -465,53 +471,51 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -465,53 +471,51 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0500', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.reset().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('idle'); await videoPlayer.play().then(() => {
console.info('case reset called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.release().then(() => { }, failureCallback).catch(catchCallback);
console.info('case release called!!'); let endTime = videoPlayer.currentTime;
}, failureCallback).catch(catchCallback); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
done();
}, 1000); await videoPlayer.reset().then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case reset called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -523,54 +527,52 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -523,54 +527,52 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0600', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.seek(SEEK_TIME).then((seekDoneTime) => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); await videoPlayer.play().then(() => {
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME); console.info('case play called!!');
console.info('case seek called and seekDoneTime is' + seekDoneTime); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { let endTime = videoPlayer.currentTime;
console.info('case release called!!'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
}, failureCallback).catch(catchCallback);
done(); await videoPlayer.seek(SEEK_TIME).then((seekDoneTime) => {
}, 1000); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -582,84 +584,82 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -582,84 +584,82 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0700', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); await videoPlayer.play().then(() => {
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME); console.info('case play called!!');
console.info('case seek called and seekDoneTime is' + seekDoneTime); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => { let endTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime); await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
await videoPlayer.seek(PREV_FRAME_TIME - 100, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => { console.info('case seek called and seekDoneTime is' + seekDoneTime);
expect(videoPlayer.state).assertEqual('playing'); }, failureCallback).catch(catchCallback);
expect(seekDoneTime).assertEqual(0);
console.info('case seek called and seekDoneTime is' + seekDoneTime); await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
await videoPlayer.seek(PREV_FRAME_TIME + 100, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => { console.info('case seek called and seekDoneTime is' + seekDoneTime);
expect(videoPlayer.state).assertEqual('playing'); }, failureCallback).catch(catchCallback);
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime); await videoPlayer.seek(PREV_FRAME_TIME - 100, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(0);
await videoPlayer.seek(NEXT_FRAME_TIME - 100, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => { console.info('case seek called and seekDoneTime is' + seekDoneTime);
expect(videoPlayer.state).assertEqual('playing'); }, failureCallback).catch(catchCallback);
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime); await videoPlayer.seek(PREV_FRAME_TIME + 100, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
await videoPlayer.seek(NEXT_FRAME_TIME + 100, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => { console.info('case seek called and seekDoneTime is' + seekDoneTime);
expect(videoPlayer.state).assertEqual('playing'); }, failureCallback).catch(catchCallback);
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME + 100);
console.info('case seek called and seekDoneTime is' + seekDoneTime); await videoPlayer.seek(NEXT_FRAME_TIME - 100, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
await videoPlayer.release().then(() => { console.info('case seek called and seekDoneTime is' + seekDoneTime);
console.info('case release called!!'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
done(); await videoPlayer.seek(NEXT_FRAME_TIME + 100, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
}, 1000); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME + 100);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -671,53 +671,51 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -671,53 +671,51 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0800', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.setVolume(1).then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); await videoPlayer.play().then(() => {
console.info('case setVolume called'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.release().then(() => { }, failureCallback).catch(catchCallback);
console.info('case release called!!'); let endTime = videoPlayer.currentTime;
}, failureCallback).catch(catchCallback); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
done();
}, 1000); await videoPlayer.setVolume(1).then(() => {
expect(videoPlayer.state).assertEqual('playing');
console.info('case setVolume called');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -729,58 +727,56 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -729,58 +727,56 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level0 * @tc.level : Level0
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_0900', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
startTime = videoPlayer.currentTime; let startTime = videoPlayer.currentTime;
await videoPlayer.setSpeed(media.PlaybackSpeed.SPEED_FORWARD_2_00_X).then((speedMode) => { await videoPlayer.play().then(() => {
expect(videoPlayer.state).assertEqual('playing'); console.info('case play called!!');
sleep(1000); sleep(PLAY_TIME);
expect(speedMode).assertEqual(media.PlaybackSpeed.SPEED_FORWARD_2_00_X); expect(videoPlayer.state).assertEqual('playing');
console.info('case setSpeed called and speedMode is ' + speedMode); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback); let endTime = videoPlayer.currentTime;
endTime = videoPlayer.currentTime; expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
expect(endTime - startTime).assertClose(2 * 1000, DELTA_TIME);
startTime = videoPlayer.currentTime;
await videoPlayer.release().then(() => { await videoPlayer.setSpeed(media.PlaybackSpeed.SPEED_FORWARD_2_00_X).then((speedMode) => {
console.info('case release called!!'); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback); sleep(1000);
done(); expect(speedMode).assertEqual(media.PlaybackSpeed.SPEED_FORWARD_2_00_X);
}, 1000); console.info('case setSpeed called and speedMode is ' + speedMode);
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(2 * 1000, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -792,47 +788,45 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -792,47 +788,45 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1000', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; let arrayDescription = null;
let arrayDescription = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback); videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
await videoPlayer.getTrackDescription().then((arrayList) => { expect(videoPlayer.state).assertEqual('idle');
console.info('case getTrackDescription called!!'); console.info('case setDisplaySurface success');
if (typeof (arrayList) != 'undefined') { }, failureCallback).catch(catchCallback);
arrayDescription = arrayList;
} else { await videoPlayer.prepare().then(() => {
console.info('case getTrackDescription is failed'); expect(videoPlayer.state).assertEqual('prepared');
expect().assertFail(); console.info('case prepare called!!');
} }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
await videoPlayer.getTrackDescription().then((arrayList) => {
for (let i = 0; i < arrayDescription.length; i++) { console.info('case getTrackDescription called!!');
printfDescription(arrayDescription[i]); if (typeof (arrayList) != 'undefined') {
arrayDescription = arrayList;
} else {
console.info('case getTrackDescription is failed');
expect().assertFail();
} }
done(); }, failureCallback).catch(catchCallback);
}, 1000);
for (let i = 0; i < arrayDescription.length; i++) {
printfDescription(arrayDescription[i]);
}
done();
}) })
/* * /* *
...@@ -844,56 +838,54 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -844,56 +838,54 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1100', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
videoPlayer.loop = true; }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME); videoPlayer.url = fdPath;
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); expect(videoPlayer.state).assertEqual('idle');
console.info('case prepare called!!'); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime; await videoPlayer.prepare().then(() => {
await videoPlayer.play().then(() => { videoPlayer.loop = true;
expect(videoPlayer.loop).assertEqual(true); expect(videoPlayer.state).assertEqual('prepared');
console.info('case play called!!'); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
sleep(PLAY_TIME); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
}, failureCallback).catch(catchCallback); console.info('case prepare called!!');
let endTime = videoPlayer.currentTime; }, failureCallback).catch(catchCallback);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
let startTime = videoPlayer.currentTime;
await videoPlayer.seek(DURATION_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => { await videoPlayer.play().then(() => {
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.loop).assertEqual(true);
expect(seekDoneTime).assertEqual(DURATION_TIME); console.info('case play called!!');
console.info('case seek called and seekDoneTime is' + seekDoneTime); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { let endTime = videoPlayer.currentTime;
console.info('case release called!!'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
}, failureCallback).catch(catchCallback);
done(); await videoPlayer.seek(DURATION_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
}, 1000); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(DURATION_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -905,58 +897,56 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -905,58 +897,56 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1200', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); await videoPlayer.play().then(() => {
console.info('case pause called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.stop().then(() => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('stopped'); let endTime = videoPlayer.currentTime;
console.info('case stop called!!'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
}, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => {
await videoPlayer.release().then(() => { expect(videoPlayer.state).assertEqual('paused');
console.info('case release called!!'); console.info('case pause called!!');
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
done();
}, 1000); await videoPlayer.stop().then(() => {
expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -968,58 +958,56 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -968,58 +958,56 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1300', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); await videoPlayer.play().then(() => {
console.info('case pause called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.reset().then(() => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('idle'); let endTime = videoPlayer.currentTime;
console.info('case reset called!!'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
}, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => {
await videoPlayer.release().then(() => { expect(videoPlayer.state).assertEqual('paused');
console.info('case release called!!'); console.info('case pause called!!');
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
done();
}, 1000); await videoPlayer.reset().then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case reset called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1031,68 +1019,66 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1031,68 +1019,66 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1400', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); await videoPlayer.play().then(() => {
console.info('case pause called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.seek(SEEK_TIME).then((seekDoneTime) => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('paused'); let endTime = videoPlayer.currentTime;
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback); await videoPlayer.pause().then(() => {
expect(videoPlayer.state).assertEqual('paused');
startTime = videoPlayer.currentTime; console.info('case pause called!!');
await videoPlayer.play().then(() => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('playing');
console.info('case play called!!'); await videoPlayer.seek(SEEK_TIME).then((seekDoneTime) => {
sleep(PLAY_TIME); expect(videoPlayer.state).assertEqual('paused');
}, failureCallback).catch(catchCallback); expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
endTime = videoPlayer.currentTime; console.info('case seek called and seekDoneTime is' + seekDoneTime);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { startTime = videoPlayer.currentTime;
console.info('case release called!!'); await videoPlayer.play().then(() => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
done(); console.info('case play called!!');
}, 1000); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1104,74 +1090,72 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1104,74 +1090,72 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1500', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); await videoPlayer.play().then(() => {
console.info('case pause called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('paused'); let endTime = videoPlayer.currentTime;
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback); await videoPlayer.pause().then(() => {
expect(videoPlayer.state).assertEqual('paused');
await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => { console.info('case pause called!!');
expect(videoPlayer.state).assertEqual('paused'); }, failureCallback).catch(catchCallback);
expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime); await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('paused');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
startTime = videoPlayer.currentTime; console.info('case seek called and seekDoneTime is' + seekDoneTime);
await videoPlayer.play().then(() => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('playing');
console.info('case play called!!'); await videoPlayer.seek(SEEK_TIME, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
sleep(PLAY_TIME); expect(videoPlayer.state).assertEqual('paused');
}, failureCallback).catch(catchCallback); expect(seekDoneTime).assertEqual(PREV_FRAME_TIME);
endTime = videoPlayer.currentTime; console.info('case seek called and seekDoneTime is' + seekDoneTime);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { startTime = videoPlayer.currentTime;
console.info('case release called!!'); await videoPlayer.play().then(() => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
done(); console.info('case play called!!');
}, 1000); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1183,67 +1167,65 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1183,67 +1167,65 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1600', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); await videoPlayer.play().then(() => {
console.info('case pause called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.setVolume(1).then(() => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('paused'); let endTime = videoPlayer.currentTime;
console.info('case setVolume called'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
}, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => {
startTime = videoPlayer.currentTime; expect(videoPlayer.state).assertEqual('paused');
await videoPlayer.play().then(() => { console.info('case pause called!!');
expect(videoPlayer.state).assertEqual('playing'); }, failureCallback).catch(catchCallback);
console.info('case play called!!');
sleep(PLAY_TIME); await videoPlayer.setVolume(1).then(() => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('paused');
endTime = videoPlayer.currentTime; console.info('case setVolume called');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { startTime = videoPlayer.currentTime;
console.info('case release called!!'); await videoPlayer.play().then(() => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
done(); console.info('case play called!!');
}, 1000); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1255,68 +1237,66 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1255,68 +1237,66 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1700', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); await videoPlayer.play().then(() => {
console.info('case pause called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.setSpeed(media.PlaybackSpeed.SPEED_FORWARD_2_00_X).then((speedMode) => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('paused'); let endTime = videoPlayer.currentTime;
expect(speedMode).assertEqual(media.PlaybackSpeed.SPEED_FORWARD_2_00_X); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
console.info('case setSpeed called and speedMode is ' + speedMode);
}, failureCallback).catch(catchCallback); await videoPlayer.pause().then(() => {
expect(videoPlayer.state).assertEqual('paused');
startTime = videoPlayer.currentTime; console.info('case pause called!!');
await videoPlayer.play().then(() => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('playing');
console.info('case play called!!'); await videoPlayer.setSpeed(media.PlaybackSpeed.SPEED_FORWARD_2_00_X).then((speedMode) => {
sleep(PLAY_TIME); expect(videoPlayer.state).assertEqual('paused');
}, failureCallback).catch(catchCallback); expect(speedMode).assertEqual(media.PlaybackSpeed.SPEED_FORWARD_2_00_X);
endTime = videoPlayer.currentTime; console.info('case setSpeed called and speedMode is ' + speedMode);
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { startTime = videoPlayer.currentTime;
console.info('case release called!!'); await videoPlayer.play().then(() => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
done(); console.info('case play called!!');
}, 1000); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1328,58 +1308,56 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1328,58 +1308,56 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1800', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1800', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.stop().then(() => {
expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.reset().then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case reset called!!'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.release().then(() => { }
console.info('case release called!!'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
done(); videoPlayer.url = fdPath;
}, 1000); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.stop().then(() => {
expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.reset().then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case reset called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1391,75 +1369,73 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1391,75 +1369,73 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1900', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_1900', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.stop().then(() => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('stopped'); await videoPlayer.play().then(() => {
console.info('case stop called!!'); console.info('case play called!!');
}, failureCallback).catch(catchCallback); sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.reset().then(() => { }, failureCallback).catch(catchCallback);
expect(videoPlayer.state).assertEqual('idle'); let endTime = videoPlayer.currentTime;
console.info('case reset called!!'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath; await videoPlayer.stop().then(() => {
await videoPlayer.prepare().then(() => { expect(videoPlayer.state).assertEqual('stopped');
expect(videoPlayer.state).assertEqual('prepared'); console.info('case stop called!!');
expect(videoPlayer.duration).assertEqual(DURATION_TIME); }, failureCallback).catch(catchCallback);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.reset().then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case reset called!!');
}, failureCallback).catch(catchCallback);
startTime = videoPlayer.currentTime; videoPlayer.url = fdPath;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { startTime = videoPlayer.currentTime;
console.info('case release called!!'); await videoPlayer.play().then(() => {
}, failureCallback).catch(catchCallback); console.info('case play called!!');
done(); sleep(PLAY_TIME);
}, 1000); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1471,64 +1447,62 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1471,64 +1447,62 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2000', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2000', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.seek(0).then((seekDoneTime) => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); await videoPlayer.play().then(() => {
expect(seekDoneTime).assertEqual(0); console.info('case play called!!');
console.info('case seek called and seekDoneTime is' + seekDoneTime); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => { let endTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('paused'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
console.info('case pause called!!');
}, failureCallback).catch(catchCallback); await videoPlayer.seek(0).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.stop().then(() => { expect(seekDoneTime).assertEqual(0);
expect(videoPlayer.state).assertEqual('stopped'); console.info('case seek called and seekDoneTime is' + seekDoneTime);
console.info('case stop called!!'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => {
await videoPlayer.release().then(() => { expect(videoPlayer.state).assertEqual('paused');
console.info('case release called!!'); console.info('case pause called!!');
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
done();
}, 1000); await videoPlayer.stop().then(() => {
expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1540,70 +1514,68 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1540,70 +1514,68 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2100', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2100', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.url = fdPath;
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('idle');
}, failureCallback).catch(catchCallback); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => { await videoPlayer.prepare().then(() => {
console.info('case play called!!'); expect(videoPlayer.state).assertEqual('prepared');
sleep(PLAY_TIME); expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.state).assertEqual('playing'); expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
}, failureCallback).catch(catchCallback); expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
let endTime = videoPlayer.currentTime; console.info('case prepare called!!');
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME); }, failureCallback).catch(catchCallback);
await videoPlayer.seek(0, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => { let startTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); await videoPlayer.play().then(() => {
expect(seekDoneTime).assertEqual(0); console.info('case play called!!');
console.info('case seek called and seekDoneTime is' + seekDoneTime); sleep(PLAY_TIME);
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
await videoPlayer.seek(0, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => { let endTime = videoPlayer.currentTime;
expect(videoPlayer.state).assertEqual('playing'); expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
expect(seekDoneTime).assertEqual(0);
console.info('case seek called and seekDoneTime is' + seekDoneTime); await videoPlayer.seek(0, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
}, failureCallback).catch(catchCallback); expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(0);
await videoPlayer.pause().then(() => { console.info('case seek called and seekDoneTime is' + seekDoneTime);
expect(videoPlayer.state).assertEqual('paused'); }, failureCallback).catch(catchCallback);
console.info('case pause called!!');
}, failureCallback).catch(catchCallback); await videoPlayer.seek(0, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
await videoPlayer.stop().then(() => { expect(seekDoneTime).assertEqual(0);
expect(videoPlayer.state).assertEqual('stopped'); console.info('case seek called and seekDoneTime is' + seekDoneTime);
console.info('case stop called!!'); }, failureCallback).catch(catchCallback);
}, failureCallback).catch(catchCallback);
await videoPlayer.pause().then(() => {
await videoPlayer.release().then(() => { expect(videoPlayer.state).assertEqual('paused');
console.info('case release called!!'); console.info('case pause called!!');
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
done();
}, 1000); await videoPlayer.stop().then(() => {
expect(videoPlayer.state).assertEqual('stopped');
console.info('case stop called!!');
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1615,63 +1587,61 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1615,63 +1587,61 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2200', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2200', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.on('playbackCompleted', () => {
console.info('case playbackCompleted called!!');
expect(videoPlayer.state).assertEqual('stopped');
videoPlayer.release().then(() => {
console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback);
});
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE); videoPlayer.on('playbackCompleted', () => {
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE); console.info('case playbackCompleted called!!');
console.info('case prepare called!!'); expect(videoPlayer.state).assertEqual('stopped');
}, failureCallback).catch(catchCallback); videoPlayer.release().then(() => {
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!'); console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
done(); });
}, 1000);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1683,69 +1653,67 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1683,69 +1653,67 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level1 * @tc.level : Level1
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2300', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2300', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.on('playbackCompleted', () => {
console.info('case playbackCompleted called!!');
expect(videoPlayer.state).assertEqual('stopped');
videoPlayer.release().then(() => {
console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback);
});
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.seek(DURATION_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(DURATION_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => { videoPlayer.on('playbackCompleted', () => {
console.info('case playbackCompleted called!!');
expect(videoPlayer.state).assertEqual('stopped');
videoPlayer.release().then(() => {
console.info('case release called!!'); console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
done(); });
}, 1000);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.seek(DURATION_TIME, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(DURATION_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1757,66 +1725,64 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1757,66 +1725,64 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2400', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2400', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.on('playbackCompleted', () => {
console.info('case playbackCompleted called!!');
expect(videoPlayer.state).assertEqual('stopped');
videoPlayer.release().then(() => {
console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback);
});
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME + 1).then((seekDoneTime) => { videoPlayer.on('playbackCompleted', () => {
expect(videoPlayer.state).assertEqual('playing'); console.info('case playbackCompleted called!!');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME); expect(videoPlayer.state).assertEqual('stopped');
console.info('case seek called and seekDoneTime is' + seekDoneTime); videoPlayer.release().then(() => {
}, (err) => {
console.info('case seek out of duration called');
done();
}).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!'); console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
done(); });
}, 1000);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME + 1).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, (err) => {
console.info('case seek out of duration called');
done();
}).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1828,64 +1794,62 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1828,64 +1794,62 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2500', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2500', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.on('playbackCompleted', () => {
console.info('case playbackCompleted called!!');
expect(videoPlayer.state).assertEqual('stopped');
videoPlayer.release().then(() => {
console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback);
});
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => { }
expect(videoPlayer.state).assertEqual('prepared'); }, failureCallback).catch(catchCallback);
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME + 1, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => { videoPlayer.on('playbackCompleted', () => {
expect(videoPlayer.state).assertEqual('playing'); console.info('case playbackCompleted called!!');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME); expect(videoPlayer.state).assertEqual('stopped');
console.info('case seek called and seekDoneTime is' + seekDoneTime); videoPlayer.release().then(() => {
console.info('case release called!!');
done();
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
});
await videoPlayer.seek(DURATION_TIME + 1, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => { videoPlayer.url = fdPath;
expect(videoPlayer.state).assertEqual('playing'); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(seekDoneTime).assertEqual(DURATION_TIME); expect(videoPlayer.state).assertEqual('idle');
console.info('case seek called and seekDoneTime is' + seekDoneTime); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback); }, failureCallback).catch(catchCallback);
}, 1000);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
await videoPlayer.seek(DURATION_TIME + 1, media.SeekMode.SEEK_PREV_SYNC).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(NEXT_FRAME_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
await videoPlayer.seek(DURATION_TIME + 1, media.SeekMode.SEEK_NEXT_SYNC).then((seekDoneTime) => {
expect(videoPlayer.state).assertEqual('playing');
expect(seekDoneTime).assertEqual(DURATION_TIME);
console.info('case seek called and seekDoneTime is' + seekDoneTime);
}, failureCallback).catch(catchCallback);
}) })
/* * /* *
...@@ -1897,55 +1861,53 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1897,55 +1861,53 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2600', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2600', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
for (let i = 0; i < 6; i++) {
await videoPlayer.setVolume(i * 0.2).then(() => {
expect(videoPlayer.state).assertEqual('playing');
console.info('case setVolume called');
}, failureCallback).catch(catchCallback);
} }
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!'); videoPlayer.url = fdPath;
}, failureCallback).catch(catchCallback); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
done(); expect(videoPlayer.state).assertEqual('idle');
}, 1000); console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(PLAY_TIME);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
for (let i = 0; i < 6; i++) {
await videoPlayer.setVolume(i * 0.2).then(() => {
expect(videoPlayer.state).assertEqual('playing');
console.info('case setVolume called');
}, failureCallback).catch(catchCallback);
}
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
/* * /* *
...@@ -1957,57 +1919,54 @@ describe('VideoPlayerFuncPromiseTest', function () { ...@@ -1957,57 +1919,54 @@ describe('VideoPlayerFuncPromiseTest', function () {
* @tc.level : Level2 * @tc.level : Level2
*/ */
it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2700', 0, async function (done) { it('SUB_MEDIA_VIDEO_PLAYER_FUNCTION_PROMISE_2700', 0, async function (done) {
setTimeout(async function() { surfaceID = globalThis.value;
surfaceID = globalThis.value; console.info('case new surfaceID is ' + surfaceID);
console.info('case new surfaceID is ' + surfaceID); let videoPlayer = null;
let videoPlayer = null; await media.createVideoPlayer().then((video) => {
await media.createVideoPlayer().then((video) => { if (typeof (video) != 'undefined') {
if (typeof (video) != 'undefined') { videoPlayer = video;
videoPlayer = video;
expect(videoPlayer.state).assertEqual('idle');
} else {
console.info('case createVideoPlayer is failed');
expect().assertFail();
}
}, failureCallback).catch(catchCallback);
videoPlayer.url = fdPath;
await videoPlayer.setDisplaySurface(surfaceID).then(() => {
expect(videoPlayer.state).assertEqual('idle'); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success'); } else {
}, failureCallback).catch(catchCallback); console.info('case createVideoPlayer is failed');
expect().assertFail();
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(1000);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
for (let i = 0; i < 5; i++) {
startTime = videoPlayer.currentTime;
await videoPlayer.setSpeed(i).then((speedMode) => {
expect(videoPlayer.state).assertEqual('playing');
expect(speedMode).assertEqual(i);
sleep(1000);
checkSpeedTime(videoPlayer, i, startTime);
console.info('case setSpeed called and speedMode is ' + speedMode);
}, failureCallback).catch(catchCallback);
} }
await videoPlayer.release().then(() => { }, failureCallback).catch(catchCallback);
console.info('case release called!!');
}, failureCallback).catch(catchCallback); videoPlayer.url = fdPath;
done(); await videoPlayer.setDisplaySurface(surfaceID).then(() => {
}, 1000); expect(videoPlayer.state).assertEqual('idle');
console.info('case setDisplaySurface success');
}, failureCallback).catch(catchCallback);
await videoPlayer.prepare().then(() => {
expect(videoPlayer.state).assertEqual('prepared');
expect(videoPlayer.duration).assertEqual(DURATION_TIME);
expect(videoPlayer.width).assertEqual(WIDTH_VALUE);
expect(videoPlayer.height).assertEqual(HEIGHT_VALUE);
console.info('case prepare called!!');
}, failureCallback).catch(catchCallback);
let startTime = videoPlayer.currentTime;
await videoPlayer.play().then(() => {
console.info('case play called!!');
sleep(1000);
expect(videoPlayer.state).assertEqual('playing');
}, failureCallback).catch(catchCallback);
let endTime = videoPlayer.currentTime;
expect(endTime - startTime).assertClose(PLAY_TIME, DELTA_TIME);
startTime = videoPlayer.currentTime;
await videoPlayer.setSpeed(media.PlaybackSpeed.SPEED_FORWARD_2_00_X).then((speedMode) => {
expect(videoPlayer.state).assertEqual('playing');
expect(speedMode).assertEqual(media.PlaybackSpeed.SPEED_FORWARD_2_00_X);
sleep(1000);
checkSpeedTime(videoPlayer, media.PlaybackSpeed.SPEED_FORWARD_2_00_X, startTime);
console.info('case setSpeed called and speedMode is ' + speedMode);
}, failureCallback).catch(catchCallback);
await videoPlayer.release().then(() => {
console.info('case release called!!');
}, failureCallback).catch(catchCallback);
done();
}) })
}) })
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container { .container {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
......
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ title }} {{ $t('strings.hello') }} {{ title }}
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -62,13 +62,13 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -62,13 +62,13 @@ describe('VideoRecorderAPICallbackTest', function () {
videoFrameHeight : 480, videoFrameHeight : 480,
videoFrameRate : 10 videoFrameRate : 10
} }
// orientationHint 0, 90, 180, 270 // rotation 0, 90, 180, 270
let videoConfig = { let videoConfig = {
audioSourceType : 1, audioSourceType : 1,
videoSourceType : 0, videoSourceType : 0,
profile : configFile, profile : configFile,
url : 'file:///data/media/API.mp4', url : 'file:///data/media/API.mp4',
orientationHint : 0, rotation : 0,
location : { latitude : 30, longitude : 130 }, location : { latitude : 30, longitude : 130 },
maxSize : 100, maxSize : 100,
maxDuration : 500 maxDuration : 500
...@@ -88,7 +88,7 @@ describe('VideoRecorderAPICallbackTest', function () { ...@@ -88,7 +88,7 @@ describe('VideoRecorderAPICallbackTest', function () {
videoSourceType : 0, videoSourceType : 0,
profile : onlyVideoProfile, profile : onlyVideoProfile,
url : 'file:///data/media/API.mp4', url : 'file:///data/media/API.mp4',
orientationHint : 0, rotation : 0,
location : { latitude : 30, longitude : 130 }, location : { latitude : 30, longitude : 130 },
maxSize : 100, maxSize : 100,
maxDuration : 500 maxDuration : 500
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License'); * Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册