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

!2110 videoPlayer 测试用例动态刷新surfaceID

Merge pull request !2110 from FULIZHONG/0227play
...@@ -61,7 +61,8 @@ ...@@ -61,7 +61,8 @@
"js": [ "js": [
{ {
"pages": [ "pages": [
"pages/index/index" "pages/index/index",
"pages/surfaceTest/surfaceTest"
], ],
"name": "default", "name": "default",
"window": { "window": {
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
*/ */
import {Core, ExpectExtend} from 'deccjsunit/index' import {Core, ExpectExtend} from 'deccjsunit/index'
import Fileio from '@ohos.fileio'
export default { export default {
data: { data: {
...@@ -42,13 +41,7 @@ export default { ...@@ -42,13 +41,7 @@ export default {
onReady() { onReady() {
}, },
LoadXcomponent() { LoadXcomponent() {
let surfaceid = this.$element('XcomponentId').getComponentSurfaceId() globalThis.value = this.$element('XcomponentId').getComponentSurfaceId()
this.saveSurfaceID(surfaceid);
},
saveSurfaceID(surfaceID) {
let writeStreamSync = Fileio.createStreamSync('/data/media/surfaceID.txt', 'ab+')
writeStreamSync.writeSync(surfaceID, {length : 13})
writeStreamSync.flushSync()
writeStreamSync.closeSync()
}, },
} }
\ No newline at end of file
.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;
}
}
<div class="container">
<text class="title">
VideoPlayer Test
</text>
<Xcomponent id = 'XcomponentId2'
type = 'surface'
onload = 'LoadXcomponent2'
style = "width:720px;height:480px;border-color:red;border-width:5px">
</Xcomponent>
</div>
/*
* Copyright (C) 2021 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() {
},
LoadXcomponent2() {
globalThis.value = this.$element('XcomponentId2').getComponentSurfaceId()
},
}
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require('./VideoPlayerFuncCallbackTest.test.js')
require('./VideoPlayerFuncPromiseTest.test.js') require('./VideoPlayerFuncPromiseTest.test.js')
require('./VideoPlayerAPICallbackTest.test.js') require('./VideoPlayerAPICallbackTest.test.js')
require('./VideoPlayerFuncCallbackTest.test.js')
require('./VideoPlayerEnumTest.test.js') require('./VideoPlayerEnumTest.test.js')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册