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

!2220 Submit eight FA projects

Merge pull request !2220 from jiyong/master
# 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")
group("fa") {
testonly = true
if (is_standard_system) {
deps = [
"fa_clear_test:FaClearTest",
"fa_coverapi_test:FaCoverapiTest",
"fa_equeryabilitybywant_test:FaEqueryabilitybywantTest",
"fa_lock_test:FaLockTest",
"fa_missionmanager_test:FaMissionmanagerTest",
"fa_statelistener_test:FaStatelistenerTest",
"fa_taskmanager_test:FaTaskmanagerTest",
"fa_taskswiting_test:FaTaskswitingTest",
]
}
}
# Copyright (c) 2020-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("FaClearTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":fa_clear_test_assets",
":fa_clear_test_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FaClearTest"
}
ohos_js_assets("fa_clear_test_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("fa_clear_test_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description" : "Configuration for hjunit demo Test",
"driver": {
"type" : "JSUnitTest",
"test-timeout": "180000",
"package": "com.example.actsabilitydistributetest",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsAbilityDistributeTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitydisable",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.abilitydisable",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility2",
"name": ".MainAbility2",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability2",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility3",
"name": ".MainAbility3",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability3",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility4",
"name": ".MainAbility4",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability4",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"srcPath": "ServiceAbility",
"name": ".ServiceAbility",
"icon": "$media:icon",
"srcLanguage": "js",
"description": "$string:description_serviceability",
"type": "service"
}
],
"js": [
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility2",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility3",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility4",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ 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("Application onCreate");
},
onDestroy() {
console.info("Application onDestroy");
},
onForgeGround(){
console.info("Application onForgeGround");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong1';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
console.info('onShow start1')
core.init()
console.info('onShow start2')
const configService = core.getDefaultService('config')
console.info('onShow start3')
configService.setConfig(this)
console.info('onShow start4')
require('../../../test/List.test')
console.info('onShow start5')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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("Application onCreate");
setTimeout(()=>{
this.content.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong2';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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 abilityFeatureAbility from '@ohos.ability.featureAbility';
export default {
onCreate() {
console.info("Application onCreate MainAbility3");
setTimeout(()=>{
abilityFeatureAbility.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong3';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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("Application onCreate");
setTimeout(()=>{
this.content.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong4';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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 {
onStart(want) {
console.info('ServiceAbility onStart');
},
onStop() {
console.info('ServiceAbility onStop');
},
onConnect(want) {
console.info('ServiceAbility onConnect');
return {};
},
onReconnect(want) {
console.info('ServiceAbility onReconnect');
},
onDisconnect() {
console.info('ServiceAbility onDisconnect');
},
onCommand(want, restart, startId) {
console.info('ServiceAbility onCommand');
},
onForeground(){
console.info('ServiceAbility onForeground');
},
};
\ 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.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"
import missionManager from '@ohos.application.missionManager';
import abilityFeatureAbility from '@ohos.ability.featureAbility';
import bundleManager from '@ohos.bundle';
describe('AbilityDisableTests', function () {
console.log("AbilityDisableTests --- start");
function fns(){
setTimeout(()=>{
abilityFeatureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility2"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility2: '
+ JSON.stringify(error) + ", " + JSON.stringify(data))
expect(err.code == 0).assertTrue();
});
},500)
setTimeout(()=>{
abilityFeatureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility4"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility4: '
+ JSON.stringify(error) + ", " + JSON.stringify(data))
expect(err.code == 0).assertTrue();
});
},1000)
setTimeout(()=>{
abilityFeatureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility3"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility3: '
+ JSON.stringify(error) + ", " + JSON.stringify(data))
expect(err.code == 0).assertTrue();
});
},1500)
setTimeout(()=>{
missionManager.getMissionInfos("", 20, (err, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
for (var i = 0;i < data.length; i++) {
console.log("bundleName:"+data[i].want["abilityName"])
if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3"
|| data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4"
||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"
||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){
console.log("data[i]['lockedState']::::"+data[i]['lockedState']);
console.log("data[i].missionId" + data[i].missionId);
console.log("SUB_AA_OpenHarmony_Clear_0100, missionId:" + data[i].missionId);
missionIds.push(data[i].missionId);
}
}
console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds +
typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]);
})
console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds));
},2000)
setTimeout(()=>{
missionManager.lockMission(parseInt(missionIds[1]),(err,data)=>{
console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 missionIds[1] : ' +
JSON.stringify(missionIds[1]), + parseInt(missionIds[1]));
console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 errCode : ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
},2500)
setTimeout(()=>{
missionManager.lockMission(parseInt(missionIds[2]),(err,data)=>{
console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission2 errCode : ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
},2500)
setTimeout(()=>{
missionManager.getMissionInfos("", 20, (err, data) => {
console.log("SUB_AA_OpenHarmony_Clear_0100, twosgetMissionInfos:" +
JSON.stringify(data));
for (var i = 0;i < data.length; i++) {
console.log("data[i].missionId:missionIds[2] news missionIds[1]" +
data[i].missionId + missionIds[2] + missionIds[1])
if(data[i].missionId == missionIds[1] || data[i].missionId == missionIds[2]){
console.log("data[i]['lockedState']222:::::::"+data[i]['lockedState']);
expect(data[i]['lockedState'] == true).assertTrue();
}
}
})
console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds));
},3100)
setTimeout(()=>{
missionManager.getMissionInfos("", 20, (err, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
for (var i = 0;i < data.length; i++) {
console.log("bundleName:"+data[i].want["abilityName"])
if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3"
|| data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4"
||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"
||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){
console.log("data[i]['lockedState']::::"+data[i]['lockedState']);
expect(data[i].lockedState == false).assertTrue();
}
}
console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds +
typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]);
})
console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds));
},5000)
setTimeout(()=>{
missionManager.moveMissionToFront(parseInt(missionIds[2]),(err,data)=>{
console.log('SUB_AA_OpenHarmony_Clear_0100 moveMissionToFront errCode : ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
},6000)
setTimeout(()=>{
missionManager.clearAllMissions((err,data)=>{
console.log('SUB_AA_OpenHarmony_Clear_0100 clearAllMissions errCode: ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
},7000)
setTimeout(()=>{
missionManager.getMissionInfos("", 20, (err, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
for (var i = 0;i < data.length; i++) {
console.log("bundleName:"+data[i].want["abilityName"])
if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" ||
data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" ||
data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"||
data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){
console.log("data[i]['lockedState']end::::"+data[i]['lockedState']);
expect(data[i]['lockedState'] == true).assertTrue();
}
}
console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+
missionIds + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]);
})
console.log("SUB_AA_OpenHarmony_Clear_0100" +
JSON.stringify(missionIds));
},8000)
}
/*
* @tc.number SUB_AA_OpenHarmony_Clear_1200
* @tc.name missionId for undefined
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_Clear_1200", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1200-------------------");
missionManager.clearMission(undefined, (data, err) => {
console.log('SUB_AA_OpenHarmony_Clear_1200 asyncCallback errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
expect(data["code"]==-1).assertTrue();
})
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_Clear_1300
* @tc.name MissionId: does not exist
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_Clear_1300", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1300-------------------");
missionManager.clearMission("xxxx", (data, err) => {
console.log('SUB_AA_OpenHarmony_Clear_1300 asyncCallback errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
expect(data["code"]==-1).assertTrue();
})
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_Clear_1400
* @tc.name MissionId is a string number
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_Clear_1400", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1400-------------------");
missionManager.clearMission("123456", (data, err) => {
console.log('SUB_AA_OpenHarmony_Clear_1400 asyncCallback errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
expect(data["code"]==-1).assertTrue();
})
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_Clear_1500
* @tc.name The missionId is a non-number string
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_Clear_1500", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1500-------------------");
missionManager.clearMission("abc@@#$", (data, err) => {
console.log('SUB_AA_OpenHarmony_Clear_1500 asyncCallback errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
expect(data["code"]==-1).assertTrue();
})
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_Clear_1600
* @tc.name MissionId is an existing floating point type
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_Clear_1600", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1600-------------------");
missionManager.clearMission(1.1234, (data, err) => {
console.log('SUB_AA_OpenHarmony_Clear_1600 asyncCallback errCode : '
+ JSON.stringify(err) + " data: " + JSON.stringify(data));
expect(data["code"]==-1).assertTrue();
})
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_Clear_0100
* @tc.name Locking is terminated after mission, switching to the front desk for cleanup
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_Clear_0100', 0, async function (done) {
var missionIds = [];
console.log("SUB_AA_OpenHarmony_Clear_0100 --- start")
fns()
done()
});
})
\ 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.
*/
require('./AbilityDisableTest.js');
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "description_mainability",
"value": "JS_Empty Ability"
},
{
"name": "description_mainability2",
"value": "JS_Empty Ability"
},
{
"name": "entry_MainAbility2",
"value": "entry_MainAbility2"
},
{
"name": "description_mainability3",
"value": "JS_Empty Ability"
},
{
"name": "entry_MainAbility3",
"value": "entry_MainAbility3"
},
{
"name": "description_mainability4",
"value": "JS_Empty Ability"
},
{
"name": "entry_MainAbility4",
"value": "entry_MainAbility4"
},
{
"name": "description_serviceability",
"value": "hap sample empty service"
}
]
}
\ No newline at end of file
# Copyright (c) 2020-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("FaCoverapiTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":fa_coverapi_test_assets",
":fa_coverapi_test_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FaCoverapiTest"
}
ohos_js_assets("fa_coverapi_test_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("fa_coverapi_test_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description" : "Configuration for hjunit demo Test",
"driver": {
"type" : "JSUnitTest",
"test-timeout": "180000",
"package": "com.example.actsabilitydistributetest",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsAbilityDistributeTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app":{
"bundleName":"com.example.coverapi",
"vendor":"example",
"version":{
"code":1000000,
"name":"1.0.0"
}
},
"deviceConfig":{},
"module":{
"package":"com.example.coverapi",
"name":".MyApplication",
"mainAbility":".MainAbility",
"srcPath":"",
"deviceType":[
"phone"
],
"distro":{
"deliveryWithInstall":true,
"moduleName":"entry",
"moduleType":"entry",
"installationFree":false
},
"abilities":[
{
"skills":[
{
"entities":[
"entity.system.home"
],
"actions":[
"action.system.home"
]
}
],
"orientation":"unspecified",
"visible":true,
"srcPath":"MainAbility",
"name":".MainAbility",
"srcLanguage":"js",
"icon":"$media:icon",
"description":"$string:description_mainability",
"formsEnabled":false,
"label":"$string:entry_MainAbility",
"type":"page",
"launchType":"standard"
}
],
"js":[
{
"pages":[
"pages/index/index",
"pages/second/second"
],
"name":".MainAbility",
"window":{
"designWidth":720,
"autoDesignWidth":false
}
}
]
}
}
\ 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("Application onCreate");
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}} {{"sunliyan"}}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router';
import commonEvent from '@ohos.commonEvent';
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
console.info('onShow start1')
core.init()
console.info('onShow start2')
const configService = core.getDefaultService('config')
console.info('onShow start3')
configService.setConfig(this)
console.info('onShow start4')
require('../../../test/List.test')
console.info('onShow start5')
core.execute()
},
onConfigurationUpdated(){
console.info("mainAbility onConfigurationUpdated");
commonEvent.publish("mainAbility_onConfigurationUpdated", () => {
console.log("MainAbility Publish CallBack mainAbility_onConfigurationUpdated")
});
}
}
/*
* 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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('./coverApiTest.js');
\ No newline at end of file
// @ts-nocheck
/*
* 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 commonEvent from '@ohos.commonevent'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index";
import appManager from '@ohos.application.appManager';
import abilityManager from '@ohos.application.abilityManager';
const START_ABILITY_TIMEOUT = 5000;
describe('CoverApiTest', function () {
console.log("CoverApiTest --- start");
var subscriberInfoMainAbility = {
events: ["mainAbilityOnConfigurationUpdated"]
}
/*
* @tc.number SUB_AA_OpenHarmony_CoverApi_0500
* @tc.name whether the system is under stability test
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_CoverApi_0500', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------");
appManager.isRunningInStabilityTest()
.then((data) => {
console.info('SUB_AA_OpenHarmony_CoverApi_0500 successful. data: ' + JSON.stringify(data));
expect(data == false).assertTrue();
done();
}).catch((error) => {
console.error('SUB_AA_OpenHarmony_CoverApi_0500 failed. error: ' + JSON.stringify(error));
expect().assertFalse();
done();
})
});
/*
* @tc.number SUB_AA_OpenHarmony_CoverApi_0700
* @tc.name Verify that the data of nonexistent apps is cleared
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_CoverApi_0700', 0, async function (done) {
console.log("SUB_AA_OpenHarmony_CoverApi_0700 --- start");
appManager.clearUpApplicationData('com.example.coverapi')
.then((data) => {
console.info('SUB_AA_OpenHarmony_CoverApi_0700 successful. data: ' + JSON.stringify(data));
expect(data == 0).assertTrue();
done();
}).catch((error) => {
console.error('SUB_AA_OpenHarmony_CoverApi_0700 failed. error: ' + JSON.stringify(error));
expect().assertFalse();
done();
})
})
/**
* @tc.number: SUB_AA_OpenHarmony_CoverApi_0500
* @tc.name: wantConstant : Check specific enum
* @tc.desc: Check the return type of the interface (by Promise)
*/
it('SUB_AA_OpenHarmony_CoverApi_0800', 0, async function (done) {
console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- start");
var Subscriber;
let id;
function SubscribeCallBack(err, data) {
console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>Subscribe CallBack data:====>" + JSON.stringify(data));
expect(data.event == 'mainAbilityOnConfigurationUpdated').assertTrue();
if (data.event == 'mainAbility_onConfigurationUpdated') {
clearTimeout(id);
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
done();
}
}
commonEvent.createSubscriber(subscriberInfoMainAbility).then(async (data) => {
console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>Create Subscriber====>");
Subscriber = data;
await commonEvent.subscribe(Subscriber, SubscribeCallBack);
})
function UnSubscribeCallback() {
console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>UnSubscribe CallBack====>");
done();
}
function timeout() {
expect().assertFail();
console.debug('SUB_AA_OpenHarmony_CoverApi_0800 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
var Configuration = { language: "en" };
abilityManager.updateConfiguration(Configuration)
.then((data) => {
console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- updateConfiguration " + JSON.stringify(data));
done();
}).catch((error) => {
console.error('SUB_AA_OpenHarmony_CoverApi_0800 failed. error: ' + JSON.stringify(error));
done();
})
console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- end");
})
})
{
"string":[
{
"name":"entry_MainAbility",
"value":"entry_MainAbility"
},
{
"name":"description_mainability",
"value":"JS_Empty Ability"
}
]
}
\ No newline at end of file
# Copyright (c) 2020-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("FaEqueryabilitybywantTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":fa_equeryabilitybywant_test_assets",
":fa_equeryabilitybywant_test_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FaEqueryabilitybywantTest"
}
ohos_js_assets("fa_equeryabilitybywant_test_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("fa_equeryabilitybywant_test_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description" : "Configuration for hjunit demo Test",
"driver": {
"type" : "JSUnitTest",
"test-timeout": "180000",
"package": "com.example.actsabilitydistributetest",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsAbilityDistributeTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitydisable",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.abilitydisable",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility2",
"name": ".MainAbility2",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability2",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility3",
"name": ".MainAbility3",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability3",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"srcPath": "MainAbility4",
"name": ".MainAbility4",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:description_mainability4",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"srcPath": "ServiceAbility",
"name": ".ServiceAbility",
"icon": "$media:icon",
"srcLanguage": "js",
"description": "$string:description_serviceability",
"type": "service"
}
],
"js": [
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility2",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility3",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility4",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ 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("Application onCreate");
},
onDestroy() {
console.info("Application onDestroy");
},
onForgeGround(){
console.info("Application onForgeGround");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong1';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
console.info('onShow start1')
core.init()
console.info('onShow start2')
const configService = core.getDefaultService('config')
console.info('onShow start3')
configService.setConfig(this)
console.info('onShow start4')
require('../../../test/List.test')
console.info('onShow start5')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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("Application onCreate");
setTimeout(()=>{
this.content.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong2';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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 abilityFeatureAbility from '@ohos.ability.featureAbility';
export default {
onCreate() {
console.info("Application onCreate MainAbility3");
setTimeout(()=>{
abilityFeatureAbility.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong3';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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("Application onCreate");
setTimeout(()=>{
this.content.terminateSelf().then((data)=>{
console.log("Application terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("Application terminateSelf data:" + JSON.stringify(error) )
})
},4000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界",
"page": "第二页",
"next": "下一页",
"back": "返回"
},
"Files": {
}
}
\ 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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
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.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong4';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
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.
*/
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册