未验证 提交 906fb124 编写于 作者: O openharmony_ci 提交者: Gitee

!2510 videoPlayer 测试用例去除setTimeOut调用并修改部分内源检视问题

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