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

!3490 XTS问题用例整改

Merge pull request !3490 from chengxingzhen/OpenHarmony-3.1-Release
......@@ -25,6 +25,7 @@ group("aafwk_standard") {
"amsdatauriutils:ActsAmsDataUriUtilsTest",
"amsgetabilityprocessinfo:amsgetabilityprocessinfo",
"context:context",
"fa:fa",
"featureability:featureability",
"formmanager:formmanager",
"want:want",
......
......@@ -24,7 +24,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0100', 0, function (done) {
console.log('dataUriUtils getIdSync start1');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/1221");
var result = dataUriUtils.getId("com.ix.dataUriUtils/1221");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -40,7 +40,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0200', 0, function (done) {
console.log('dataUriUtils getIdSync start2 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils1221");
var result = dataUriUtils.getId("com.ix.dataUriUtils1221");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -57,7 +57,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0300', 0, function (done) {
console.log('dataUriUtils getIdSync start3 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/11234567890");
var result = dataUriUtils.getId("com.ix.dataUriUtils/11234567890");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -74,7 +74,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0400', 0, function (done) {
console.log('dataUriUtils getIdSync start4 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils");
var result = dataUriUtils.getId("com.ix.dataUriUtils");
console.log('dataUriUtils getIdSync URI : ' + result);
expect(typeof(result)).assertEqual("number");
......@@ -91,7 +91,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_GetIdSync_0500', 0, function (done) {
console.log('dataUriUtils getIdSync start5 ');
var result = dataUriUtils.getIdSync("com.ix.dataUriUtils/-777");
var result = dataUriUtils.getId("com.ix.dataUriUtils/-777");
console.log('dataUriUtils getIdSync URI : ' + result);//-777
expect(typeof(result)).assertEqual("number");
......@@ -109,7 +109,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0100',0, function (done) {
console.log('dataUriUtils attachIdSync start1 ');
var idint = 1122;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -127,7 +127,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0200',0, function (done) {
console.log('dataUriUtils attachIdSync start2 ');
var idint = 0;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils/777",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils/777",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -145,7 +145,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0300',0, function (done) {
console.log('dataUriUtils attachIdSync start3 ');
var idint = 456789;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils/123",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils/123",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -163,7 +163,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0400',0, function (done) {
console.log('dataUriUtils attachIdSync start4 ');
var idint = 123456789011;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -181,7 +181,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_AttachIdSync_0500',0, function (done) {
console.log('dataUriUtils attachIdSync start5 ');
var idint = -1;
var result = dataUriUtils.attachIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.attachId("com.ix.dataUriUtils",idint);
console.log('dataUriUtils attachIdSync URI :' + result)
expect(typeof(result)).assertEqual("string");
......@@ -198,7 +198,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0100',0, function (done) {
console.log('dataUriUtils deleteIdSync start1 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -215,7 +215,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0200',0, function (done) {
console.log('dataUriUtils deleteIdSync start2 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/1122");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils/1122");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -232,7 +232,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0300',0, function (done) {
console.log('dataUriUtils deleteIdSync start3 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils1122");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils1122");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -249,7 +249,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0400',0, function (done) {
console.log('dataUriUtils deleteIdSync start4 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/-1");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils/-1");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -266,7 +266,7 @@ describe('ActsDataUriUtilsTest', function () {
*/
it('ACTS_DeleteIdSync_0500',0, function (done) {
console.log('dataUriUtils deleteIdSync start5 ');
var result = dataUriUtils.deleteIdSync("com.ix.dataUriUtils/1122/2211");
var result = dataUriUtils.deleteId("com.ix.dataUriUtils/1122/2211");
console.log('dataUriUtils deleteIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -284,7 +284,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0100',0, function (done) {
console.log('dataUriUtils updateIdSync start1 ');
var idint = 1122;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils",idint);
var result = dataUriUtils.updateId("com.ix.dataUriUtils",idint);
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -302,7 +302,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0200',0, function (done) {
console.log('dataUriUtils updateIdSync start2 ');
var idint = 1122;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -320,7 +320,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0300',0, function (done) {
console.log('dataUriUtils updateIdSync start3 ');
var idint = 3344;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/-1",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/-1",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -338,7 +338,7 @@ describe('ActsDataUriUtilsTest', function () {
it('ACTS_UpdateIdSync_0400',0, function (done) {
console.log('dataUriUtils updateIdSync start4 ');
var idint = 5566;
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/123456789011",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/123456789011",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
......@@ -360,7 +360,7 @@ describe('ActsDataUriUtilsTest', function () {
expect(typeof(idint)).assertEqual("number");
console.log('dataUriUtils updateIdSync start666 ');
var result = dataUriUtils.updateIdSync("com.ix.dataUriUtils/1122",idint)
var result = dataUriUtils.updateId("com.ix.dataUriUtils/1122",idint)
console.log('updateIdSync updateIdSync URI : ' + result);
expect(typeof(result)).assertEqual("string");
expect(result).assertEqual("com.ix.dataUriUtils/0");
......
......@@ -17,20 +17,8 @@ group("fa") {
testonly = true
if (is_standard_system) {
deps = [
"fa_applicationinfo_test:FaApplicationinfoTest",
"fa_auxstate_test:FaAuxstateTest",
"fa_auxsumstate_test:FaAuxsumstateTest",
"fa_clear_test:FaClearTest",
"fa_configurationconstant_test:FaConfigurationconstantTest",
"fa_coverapi_test:FaCoverapiTest",
"fa_equeryabilitybywant_test:FaEqueryabilitybywantTest",
"fa_lock_test:FaLockTest",
"fa_missionmanager_test:FaMissionmanagerTest",
"fa_movemissiontofront_test:FaMissionmanagerTest",
"fa_state_test:FaStateTest",
"fa_sumstate_test:FaSumstateTest",
"fa_taskmanager_test:FaTaskmanagerTest",
"fa_taskswiting_test:FaTaskswitingTest",
"faconfigurationconstant:ActsConfigurationconstantTest",
"facoverapi:ActsCoverapiTest",
]
}
}
# 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("FaApplicationinfoTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":fa_applicationinfo_test_assets",
":fa_applicationinfo_test_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FaApplicationinfoTest"
}
ohos_js_assets("fa_applicationinfo_test_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("fa_applicationinfo_test_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
/*
* 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 router from '@system.router'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
}
}
/*
* 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('./ApplicationInfoJsunit.test.js')
\ No newline at end of file
{
"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"
}
]
}
\ 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.
*/
import featureAbility from '@ohos.ability.featureAbility';
export default {
onCreate() {
console.info("Application onCreate");
setTimeout(() => {
featureAbility.terminateSelf().then(() => {
console.log('--start-- : ')
}).catch(() => {
console.log('---end-- : ')
})
}, 3000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container" 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'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
}
}
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</div>
{
"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("FaAuxsumstateTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":fa_auxsumstate_test_assets",
":fa_auxsumstate_test_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FaAuxsumstateTest"
}
ohos_js_assets("fa_auxsumstate_test_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("fa_auxsumstate_test_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"app": {
"bundleName": "com.example.fzstatelistener",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.fzstatelistener",
"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.
*/
import featureAbility from '@ohos.ability.featureAbility';
export default {
onCreate() {
console.info("Application onCreate");
setTimeout(() => {
featureAbility.terminateSelf().then(() => {
console.log('--start-- : ')
}).catch(() => {
console.log('---end-- : ')
})
}, 5000)
},
onDestroy() {
console.info("Application onDestroy");
}
};
{
"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("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"
}
<!--
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.
-->
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</div>
{
"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.
*/
.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.
*/
import router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
{
"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.
*/
.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.
*/
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.
*/
// @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
{
"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("FaConfigurationconstantTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":fa_configurationconstant_test_assets",
":fa_configurationconstant_test_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "FaConfigurationconstantTest"
}
ohos_js_assets("fa_configurationconstant_test_assets") {
source_dir = "./entry/src/main/js/MainAbility"
}
ohos_resources("fa_configurationconstant_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
apply plugin: 'com.huawei.ohos.hap'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
compileSdkVersion 8
defaultConfig {
compatibleSdkVersion 7
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
testImplementation 'junit:junit:4.13.1'
}
# config module specific ProGuard rules here.
\ 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.
*/
export default {
onCreate() {
console.info("Application onCreate 1");
},
onDestroy() {
console.info("Application onDestroy 1");
}
};
{
"strings": {
"hello": "Hello",
"world": "World",
"page": "Second Page",
"next": "Next Page",
"back": "Back"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好 1 js",
"world": "世界 1 js",
"page": "第二页 1",
"next": "下一页 1",
"back": "返回 1"
},
"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>
// @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 router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow(){
const core = Core.getInstance()
core.init();
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test');
core.execute();
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
}
}
/*
* 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>
// @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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
// @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.
*/
require('./JSMyapplicationJsunit.test.js');
{
"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
{
"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"
})
}
}
{
"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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册