提交 919a6d87 编写于 作者: Z zxg-gitee

图形子系统增加webGL测试用例,zhaoxiaoguang2@huawei.com

Signed-off-by: Nzxg-gitee <zhaoxiaoguang2@huawei.com>
上级 5200aefe
...@@ -15,7 +15,10 @@ import("//build/ohos_var.gni") ...@@ -15,7 +15,10 @@ import("//build/ohos_var.gni")
group("graphic") { group("graphic") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ "windowstandard:window_hap_test" ] deps = [
"webGL:webGL_hap_test",
"windowstandard:window_hap_test",
]
} else { } else {
deps = [ deps = [
"appaccount:appaccount_hap", "appaccount:appaccount_hap",
......
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("webGL_hap_test") {
hap_profile = "./src/main/config.json"
deps = [
":window_js_assets",
":window_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsWebGLHapTest"
}
ohos_js_assets("window_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("window_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"package": "com.test.webGL",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsWebGLHapTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.test.webGL",
"vendor": "test",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "com.test.webGL",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.test.webGL.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard",
"isVisible": "true"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
/*
* 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<canvas ref="canvas1" id="canvas1" style="width: 400px;height:200px;background-color:brown;"></canvas>
<canvas ref="canvas2" id="canvas2" style="width: 400px;height:200px;background-color:royalblue;"></canvas>
</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'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow(){
global.el = this.$refs.canvas1;
global.el2 = this.$refs.canvas2;
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id':'extend'
})
core.addService('expect',expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../test/List.test.js')
core.execute()
}
}
/*
* 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.
*/
require('./webGL.test.js')
因为 它太大了无法显示 source diff 。你可以改为 查看blob
{
"string": [
{
"name": "app_name",
"value": "webGL"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册