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

!7174 【OpenHarmony 4.0.1.2】【master】【图形子系统】【TOD】【rk3568】【必现】修改webgl测试用例

Merge pull request !7174 from guoenquan/master
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -16,16 +16,18 @@ import("//test/xts/tools/build/suite.gni") ...@@ -16,16 +16,18 @@ import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("webGL_hap_test") { ohos_js_hap_suite("webGL_hap_test") {
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
deps = [ deps = [
":window_js_assets", ":webGL_js_assets",
":window_resources", ":webGL_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsWebGLHapTest" hap_name = "ActsWebGLHapTest"
} }
ohos_js_assets("window_js_assets") { ohos_js_assets("webGL_js_assets") {
source_dir = "./src/main/js/default" js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
} }
ohos_resources("window_resources") { ohos_resources("webGL_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
} }
{ {
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "OHJSUnitTest",
"test-timeout": "1200000", "test-timeout": "1200000",
"package": "com.test.webGL", "shell-timeout": "800000",
"shell-timeout": "60000" "bundle-name": "com.test.webGL",
"package-name": "com.test.webGL",
"testcase-timeout": "300000"
}, },
"kits": [ "kits": [
{ {
...@@ -17,7 +19,8 @@ ...@@ -17,7 +19,8 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"hilog -Q pidoff" "power-shell wakeup",
"power-shell setmode 602"
] ]
} }
] ]
......
...@@ -26,38 +26,70 @@ ...@@ -26,38 +26,70 @@
"moduleType": "entry" "moduleType": "entry"
}, },
"abilities": [ "abilities": [
{ {
"visible": true, "skills": [
"skills": [ {
{ "entities": [
"entities": [ "entity.system.home"
"entity.system.home" ],
], "actions": [
"actions": [ "action.system.home"
"action.system.home" ]
] }
} ],
"orientation": "unspecified",
"formsEnabled": false,
"name": "com.test.webGL.MainAbility",
"srcLanguage": "js",
"srcPath": "MainAbility",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"label": "$string:MainAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
},
{
"orientation": "unspecified",
"formsEnabled": false,
"name": ".TestAbility",
"srcLanguage": "js",
"srcPath": "TestAbility",
"icon": "$media:icon",
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
"visible": true,
"launchType": "standard"
}
], ],
"name": "com.test.webGL.MainAbility", "js": [
"icon": "$media:icon", {
"description": "$string:mainability_description", "pages": [
"label": "$string:app_name", "pages/index/index"
"type": "page", ],
"launchType": "standard", "name": "default",
"isVisible": "true" "window": {
} "designWidth": 720,
], "autoDesignWidth": false
"js": [ }
{ },
"pages": [ {
"pages/index/index" "pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
], ],
"name": "default", "testRunner": {
"window": { "name": "OpenHarmonyTestRunner",
"designWidth": 720, "srcPath": "TestRunner"
"autoDesignWidth": false },
} "mainAbility": ".MainAbility",
} "srcPath": ""
]
} }
} }
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* 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.
*/ */
export default { export default {
onCreate() { onCreate() {
console.info('AceApplication onCreate'); console.info('AceApplication onCreate');
}, },
onDestroy() { onDestroy() {
console.info('AceApplication onDestroy'); console.info('AceApplication onDestroy');
} }
}; };
...@@ -2,6 +2,4 @@ ...@@ -2,6 +2,4 @@
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ title }} {{ $t('strings.hello') }} {{ title }}
</text> </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> </div>
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* 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('./WebGL.test01.js') export default {
require('./WebGL.test02.js') data: {
require('./WebGL.test03.js') title: ""
require('./WebGL.test04.js') },
require('./WebGL.test05.js') onInit() {
require('./WebGL.test06.js') this.title = this.$t('strings.world');
require('./WebGL.test07.js') }
require('./WebGL.test08.js') }
require('./WebGL.test09.js')
require('./WebGL.test10.js')
require('./WebGL.test11.js')
require('./WebGL.test12.js')
require('./WebGL.test13.js')
require('./WebGL.test14.js')
require('./WebGL.test15.js')
\ No newline at end of file
/*
* 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('TestApplication onCreate');
},
onDestroy() {
console.info('TestApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files":{}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files":{}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<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>
...@@ -12,30 +12,24 @@ ...@@ -12,30 +12,24 @@
* 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.
*/ */
import {Core,ExpectExtend} from 'deccjsunit/index'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/List.test'
export default { export default {
data: { data:{
title: "" title:""
}, },
onInit() { onInit(){
this.title = this.$t('strings.world'); this.title = this.$t('strings.world');
}, },
onShow(){ onShow(){
global.el = this.$refs.canvas1; global.el = this.$refs.canvas1;
global.el2 = this.$refs.canvas2; global.el2 = this.$refs.canvas2;
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
const core = Core.getInstance() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
const expectExtend = new ExpectExtend({ console.info('start run testcase!!!')
'id':'extend' Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
})
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) 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s itName',
'-s level', '-s testType', '-s size', '-s timeout',
'-s package', '-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams += ' ' + key + ' ' + parameters[key]
}
}
return targetParams.trim()
}
export default {
onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare')
},
onRun() {
console.log('OpenHarmonyTestRunner onRun run')
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug)
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult);
console.info('executeShellCommand : data : ' + data.exitCode);
})
}
};
/*
* 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 webgl1Test_webgl1 from './WebGL.test01.js'
import webgl1Test_webgl2 from './WebGL.test02.js'
import webgl1Test_webgl3 from './WebGL.test03.js'
import webgl1Test_webgl4 from './WebGL.test04.js'
import webgl1Test_webgl5 from './WebGL.test05.js'
import webgl1Test_webgl6 from './WebGL.test06.js'
import webgl1Test_webgl7 from './WebGL.test07.js'
import webgl1Test_webgl8 from './WebGL.test08.js'
import webgl1Test_webgl9 from './WebGL.test09.js'
import webgl1Test_webgl10 from './WebGL.test10.js'
import webgl1Test_webgl11 from './WebGL.test11.js'
import webgl1Test_webgl12 from './WebGL.test12.js'
import webgl1Test_webgl13 from './WebGL.test13.js'
import webgl1Test_webgl14 from './WebGL.test14.js'
import webgl1Test_webgl15 from './WebGL.test15.js'
export default function testsuite(){
webgl1Test_webgl1()
webgl1Test_webgl2()
webgl1Test_webgl3()
webgl1Test_webgl4()
webgl1Test_webgl5()
webgl1Test_webgl6()
webgl1Test_webgl7()
webgl1Test_webgl8()
webgl1Test_webgl9()
webgl1Test_webgl10()
webgl1Test_webgl11()
webgl1Test_webgl12()
webgl1Test_webgl13()
webgl1Test_webgl14()
webgl1Test_webgl15()
}
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册