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

!2632 add 3.1 release

Merge pull request !2632 from jiyong/OpenHarmony-3.1-Release
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
...@@ -18,6 +18,7 @@ import {describe, expect, it} from 'deccjsunit/index' ...@@ -18,6 +18,7 @@ import {describe, expect, it} from 'deccjsunit/index'
import commonEvent from '@ohos.commonevent' import commonEvent from '@ohos.commonevent'
import featureAbility from '@ohos.ability.featureability' import featureAbility from '@ohos.ability.featureability'
import formBindingData from '@ohos.application.formBindingData' import formBindingData from '@ohos.application.formBindingData'
import bundle from '@ohos.bundle';
var getCallingBundleUri = { var getCallingBundleUri = {
events: ["uri"] events: ["uri"]
...@@ -133,4 +134,65 @@ describe("ApplicationInfoTest", function () { ...@@ -133,4 +134,65 @@ describe("ApplicationInfoTest", function () {
console.log("------------end SUB_AA_OpenHarmony_Want_0300-------------"); console.log("------------end SUB_AA_OpenHarmony_Want_0300-------------");
}) })
/*
* @tc.number SUB_AA_OpenHarmony_ApplicationInfo_0100
* @tc.name Verify the CodePath of applicationinfo
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ApplicationInfo_0100', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ApplicationInfo_0100-------------");
TAG = "SUB_AA_OpenHarmony_ApplicationInfo_0100";
bundle.getApplicationInfo("com.example.applicationinfo", 1, (error, data)=> {
console.log(TAG + "getApplicationInfo success, error: "
+ JSON.stringify(error) + ", data: " + JSON.stringify(data))
console.log(TAG + "data.condePath: " + JSON.stringify(data.codePath))
expect(JSON.stringify(data.codePath)).
assertEqual(JSON.stringify("/data/app/el1/bundle/public/com.example.applicationinfo"))
done()
})
console.log("------------end SUB_AA_OpenHarmony_ApplicationInfo_0100-------------");
})
/*
* @tc.number SUB_AA_OpenHarmony_ApplicationInfo_0200
* @tc.name Verify the removable of applicationinfo
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ApplicationInfo_0200', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ApplicationInfo_0200-------------");
TAG = "SUB_AA_OpenHarmony_ApplicationInfo_0200";
bundle.getApplicationInfo("com.example.applicationinfo", 1, (error, data)=> {
console.log(TAG + "getApplicationInfo success, error: "
+ JSON.stringify(error) + ", data: " + JSON.stringify(data))
console.log(TAG + "data.removable: " + JSON.stringify(data.removable))
expect(JSON.stringify(data.removable)).assertEqual("true")
done()
})
console.log("------------end SUB_AA_OpenHarmony_ApplicationInfo_0200-------------");
})
/*
* @tc.number SUB_AA_OpenHarmony_ApplicationInfo_0300
* @tc.name Verify the accesstokenid of applicationinfo
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ApplicationInfo_0300', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ApplicationInfo_0300-------------");
TAG = "SUB_AA_OpenHarmony_ApplicationInfo_0300";
bundle.getApplicationInfo("com.example.applicationinfo", 1, (error, data)=> {
console.log(TAG + "getApplicationInfo success, error: "
+ JSON.stringify(error) + ", data: " + JSON.stringify(data))
console.log(TAG + "data.accessTokenId: " + JSON.stringify(data.accessTokenId))
expect(data.accessTokenId == 537317578).assertTrue();
done()
})
console.log("------------end SUB_AA_OpenHarmony_ApplicationInfo_0300-------------");
})
}) })
\ No newline at end of file
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
{ {
"app": { "app": {
"bundleName": "com.example.abilitydisable", "bundleName": "com.example.jsmyapplication",
"vendor": "example", "vendor": "example",
"version": { "version": {
"code": 1000000, "code": 1000000,
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
}, },
"deviceConfig": {}, "deviceConfig": {},
"module": { "module": {
"package": "com.example.abilitydisable", "package": "com.example.jsmyapplication",
"name": ".MyApplication", "name": ".MyApplication",
"mainAbility": ".MainAbility", "mainAbility": ".MainAbility",
"srcPath": "", "srcPath": "",
...@@ -45,42 +45,6 @@ ...@@ -45,42 +45,6 @@
"label": "$string:entry_MainAbility", "label": "$string:entry_MainAbility",
"type": "page", "type": "page",
"launchType": "standard" "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"
} }
], ],
"js": [ "js": [
...@@ -94,56 +58,15 @@ ...@@ -94,56 +58,15 @@
"designWidth": 720, "designWidth": 720,
"autoDesignWidth": false "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
}
} }
], ],
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" "name": "ohos.permission.GET_BUNDLE_INFO",
}, "reason": "need use ohos.permission.INSTALL_BUNDLE"
{
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name": "ohos.permission.MANAGE_MISSIONS"
}, },
{ {
"name": "ohos.permission.GET_BUNDLE_INFO", "name": "ohos.permission.UPDATE_CONFIGURATION",
"reason": "need use ohos.permission.INSTALL_BUNDLE" "reason": "need use ohos.permission.INSTALL_BUNDLE"
} }
] ]
......
// @ts-nocheck
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -12,27 +13,12 @@ ...@@ -12,27 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import commonEvent from '@ohos.commonEvent';
import abilityFeatureAbility from '@ohos.ability.featureAbility';
export default { export default {
onCreate() { onCreate() {
commonEvent.publish("ApplicationMainAbility1_onCreate",()=>{ console.info("Application onCreate 1");
console.log("ApplicationMainAbility1_onCreate publish callBack ApplicationMainAbility1_onCreate");
});
setTimeout(()=>{
abilityFeatureAbility.terminateSelf().then((data)=>{
console.log("ApplicationMainAbility2 terminateSelf data:" + JSON.stringify(data) )
}).catch((error)=>{
console.log("ApplicationMainAbility2 terminateSelf error:" + JSON.stringify(error) )
})
},3000)
console.info("Application onCreate");
}, },
onDestroy() { onDestroy() {
console.info("Application onDestroy"); console.info("Application onDestroy 1");
},
onForgeGround(){
console.info("Application onForgeGround");
} }
}; };
{ {
"strings": { "strings": {
"hello": "您好", "hello": "您好 1 js",
"world": "世界", "world": "世界 1 js",
"page": "第二页", "page": "第二页 1",
"next": "下一页", "next": "下一页 1",
"back": "返回" "back": "返回 1"
}, },
"Files": { "Files": {
} }
......
<!-- <!--
Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
You may obtain a copy of the License at * You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
*
Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
limitations under the License. * limitations under the License.
--> -->
<div class="container" onswipe="touchMove"> <div class="container" onswipe="touchMove">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ title }} {{ $t('strings.hello') }} {{ title }}
......
// @ts-nocheck
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -12,54 +13,27 @@ ...@@ -12,54 +13,27 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import commonEvent from '@ohos.commonEvent';
import router from '@system.router' import router from '@system.router'
import {Core} from 'deccjsunit/index' import {Core} from 'deccjsunit/index'
export default { export default {
data: { data: {
title: "" title: ""
}, },
onInit() { onInit() {
this.title = 'yingyong1'; this.title = this.$t('strings.world');
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
}, },
onShow() { onShow(){
console.log("singletonEntryAbulity1_onShow")
commonEvent.publish("singletonEntryAbulity1_onShow",()=>{
console.log("singletonEntryAbulity1_onHide publish callBack singletonEntryAbulity1_onHide");
});
const core = Core.getInstance() const core = Core.getInstance()
core.init() core.init();
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
console.info('onShow ') require('../../../test/List.test');
require('../../../test/List.test') core.execute();
console.info('onShow start5')
core.execute()
}, },
onHide(){ onclick: function () {
console.log("singletonEntryAbulity_onHide") router.replace({
commonEvent.publish("singletonEntryAbulity1_onHide",()=>{ uri: "pages/second/second"
console.log("singletonEntryAbulity1_onHide publish callBack singletonEntryAbulity1_onHide"); })
});
},
onActive(){
console.log("singletonEntryAbulity_onActive")
commonEvent.publish("singletonEntryAbulity1_onActive",()=>{
console.log("singletonEntryAbulity1_onActive publish callBack singletonEntryAbulity1_onActive");
});
},
onInactive(){
console.log("singletonEntryAbulity_onInactive")
commonEvent.publish("singletonEntryAbulity1_onInactive",()=>{
console.log("singletonEntryAbulity1_onInactive publish callBack singletonEntryAbulity1_onInactive");
});
} }
} }
......
<!-- <!--
Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
You may obtain a copy of the License at * You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
*
Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
limitations under the License. * limitations under the License.
--> -->
<div class="container"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.page') }} {{ $t('strings.page') }}
......
// @ts-nocheck
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
......
/*
* 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';
export default {
onCreate() {
commonEvent.publish("ApplicationMainAbility2_onCreate",()=>{
console.log("ApplicationMainAbility2_onCreate publish callBack ApplicationMainAbility2_onCreate");
});
console.info("ApplicationMainAbility2 onCreate");
},
onDestroy() {
console.log("singletonEntryAbulity_onDestroy222");
commonEvent.publish("ApplicationMainAbility2_onDestroy",()=>{
console.log("singletonEntryAbulity2_onDestroy publish callBack singletonEntryAbulity2onDestroy");
});
},
};
{
"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'
import commonEvent from '@ohos.commonEvent';
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong2';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.log("singletonEntryAbulity_onShow")
commonEvent.publish("singletonEntryAbulity2_onShow",()=>{
console.log("singletonEntryAbulity2_onShow publish callBack singletonEntryAbulity2_onShow");
});
},
onHide(){
console.log("singletonEntryAbulity_onHide")
commonEvent.publish("singletonEntryAbulity2_onHide",()=>{
console.log("singletonEntryAbulity2_onHide publish callBack singletonEntryAbulity2onHide");
});
},
onActive(){
console.log("singletonEntryAbulity_onActive")
commonEvent.publish("singletonEntryAbulity2_onActive",()=>{
console.log("singletonEntryAbulity2_onActive publish callBack singletonEntryAbulity2_onActive");
});
},
onInactive(){
console.log("singletonEntryAbulity_onInactive");
commonEvent.publish("singletonEntryAbulity2_onInactive",()=>{
console.log("singletonEntryAbulity2_onInactive publish callBack singletonEntryAbulity2_onInactive");
});
}
}
/*
* 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>
{
"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'
import commonEvent from '@ohos.commonEvent';
export default {
data: {
title: ""
},
onInit() {
this.title = 'yingyong3';
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
},
onHide(){
console.log("singletonEntryAbulity_onHide")
commonEvent.publish("singletonEntryAbulity3_onHide",()=>{
console.log("singletonEntryAbulity3_onHide publish callBack singletonEntryAbulity3_onHide");
});
},
onActive(){
console.log("singletonEntryAbulity_onActive")
commonEvent.publish("singletonEntryAbulity3_onActive",()=>{
console.log("singletonEntryAbulity3_onActive publish callBack singletonEntryAbulity3_onActive");
});
},
onInactive(){
console.log("singletonEntryAbulity_onInactive")
commonEvent.publish("singletonEntryAbulity3_onHide",()=>{
console.log("singletonEntryAbulity3_onInactive publish callBack singletonEntryAbulity3_onInactive");
});
}
}
/*
* 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>
{
"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.
*/
.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.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"
import missionManager from '@ohos.application.missionManager';
import featureAbility from '@ohos.ability.featureAbility';
import bundleManager from '@ohos.bundle';
import appManager from "@ohos.application.appManager"
import commonEvent from '@ohos.commonEvent';
import {onDestroys} from "../MainAbility2/app.js"
import abilityManager from '@ohos.application.abilityManager'
import ConfigurationConstant from "@ohos.application.ConfigurationConstant";
function startAility(){
setTimeout(()=>{
featureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility2"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility2: '
+ JSON.stringify(error) + ", " + JSON.stringify(data))
});
},100)
setTimeout(()=>{
featureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility3"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility3: '
+ JSON.stringify(error) + ", " + JSON.stringify(data));
});
},400)
}
function lockMissions(titles,missionId,times){
setTimeout(()=>{
for(var i=0;i<missionId.length;i++){
missionManager.lockMission(parseInt(missionId[i]),(err,data)=>{
console.log(titles+'lockMission1 errCode:' + JSON.stringify(err) + " data: " + JSON.stringify(data));
});
};
},times);
}
function clearAllMissions(){
missionManager.clearAllMissions((err,data)=>{
console.log('clearAllMissions errCode: ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
}
function fns(){
setTimeout(()=>{
featureAbility.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();
});
},100)
setTimeout(()=>{
featureAbility.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();
});
},300)
setTimeout(()=>{
featureAbility.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();
});
},500)
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));
},800)
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));
})
},1200)
setTimeout(()=>{
missionManager.lockMission(parseInt(missionIds[2]),(err,data)=>{
console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission2 errCode : ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
},1500)
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));
},3500)
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" + JSON.stringify(missionIds));
},4000)
setTimeout(()=>{
missionManager.moveMissionToFront(parseInt(missionIds[2]),(err,data)=>{
console.log('SUB_AA_OpenHarmony_Clear_0100 moveMissionToFront errCode : ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
},4500)
setTimeout(()=>{
missionManager.clearAllMissions((err,data)=>{
console.log('SUB_AA_OpenHarmony_Clear_0100 clearAllMissions errCode: ' +
JSON.stringify(err) + " data: " + JSON.stringify(data));
})
},5000)
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" +
JSON.stringify(missionIds));
},8000)
expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue();
}
describe('AbilityDisableTests', function () {
let mainAbility1ListS = new Array()
let lists = new Array()
function subscriberCallBackMainAbility2Destory(err,data){
console.log("Subscribe2 CallBack data:" + JSON.stringify(data));
lists.push(data["event"]);
console.log("subscriberCallBackMainAbility2Destory lists:"+lists);
};
function subscriberCallBackMainAbility1Destory(err,data){
console.log("Subscribe3 CallBack data:" + JSON.stringify(data));
mainAbility1ListS.push(data["event"])
console.log("subscriberCallBack_mainAbility3_Destory mainAbility1ListS:"+mainAbility1ListS);
}
console.log("AbilityDisableTests --- start");
var ability2LifeEvents = {
events:["ApplicationMainAbility2_onDestroy",
"singletonEntryAbulity2_onHide",
"singletonEntryAbulity2_onActive",
"singletonEntryAbulity2_onInactive",
"singletonEntryAbility2_onDestroy",
"singletonEntryAbulity2_onShow",
"ApplicationMainAbility2_onCreate",]
};
var ability1LifeEvents = {
events:["singletonEntryAbulity3_onHide",
"singletonEntryAbulity3_onActive",
"singletonEntryAbulity3_onInactive",
"singletonEntryAbility3_onDestroy",
"singletonEntryAbulity3_onShow",
"ApplicationMainAbility3_onCreate",
"ApplicationMainAbility3_onDestroy",
]
};
/*
* @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2900
* @tc.name Verify the full-screen switching application
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_MoveMissionToFront_2900', 0, async function (done) {
var Subscriber2 = [];
var Subscriber1 = [];
var mainAbility1missinds = []
console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2900 --- start")
commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{
console.log("Create Subscriber2=======>:"+JSON.stringify(data));
Subscriber2 = data;
console.log("data2 is:" + JSON.stringify(Subscriber2));
await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory)
});
commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{
console.log("Create Subscriber1=======>:"+JSON.stringify(data));
Subscriber1 = data;
console.log("data2 is:" + JSON.stringify(Subscriber1));
await commonEvent.subscribe(Subscriber1,subscriberCallBackMainAbility1Destory)
});
setTimeout(()=>{
featureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility2"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility2: '
+ JSON.stringify(error) + ", " + JSON.stringify(data));
});
},500)
setTimeout(()=>{
featureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility3"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility3: '
+ JSON.stringify(error) + ", " + JSON.stringify(data));
});
},1000);
setTimeout(()=>{
console.log("1111subscriberCallBackMainAbility2Destory lists:"+lists);
expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue();
expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue();
},2500)
setTimeout(()=>{
missionManager.getMissionInfos("", 100, (err, data) => {
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 getMissionInfos errCode: '+
JSON.stringify(err) + " data: " + JSON.stringify(data));
for (var i = 0;i < data.length; i++) {
if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){
mainAbility1missinds.push(data[i]["missionId"])
}
}
console.log("mainAbility1missinds:"+mainAbility1missinds);
});
},3000)
setTimeout(()=>{
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:++++++');
missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{
parameters:{ "windowMode":1 }}).then((data)=>{
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:'+ " data:"
+ JSON.stringify(data));
expect().assertFail();
}).catch((err)=>{
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront errCode:'+ " err:"
+ JSON.stringify(err));
});
},3888);
setTimeout(()=>{
console.log("1111subscriberCallBackMainAbility1Destory lists:"+ mainAbility1ListS);
expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntrymainAb" +
"ility1ListSAbulity1_onInactive"))!=-1).assertTrue();
expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryA" +
"bulity1_onHide"))!=-1).assertTrue();
},3999);
done()
});
/*
* @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_3000
* @tc.name Verify the left split screen switching application
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_MoveMissionToFront_3000', 0, async function (done) {
var Subscriber2 = "";
var Subscriber1 = "";
var mainAbility1missinds = []
console.log("SUB_AA_OpenHarmony_MoveMissionToFront_3000 --- start")
commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{
console.log("Create Subscriber2=======>:"+JSON.stringify(data));
Subscriber2 = data;
console.log("data2 is:" + JSON.stringify(Subscriber2));
await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory)
});
commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{
console.log("Create Subscriber1=======>:"+JSON.stringify(data));
Subscriber1 = data;
console.log("data2 is:" + JSON.stringify(Subscriber1));
await commonEvent.subscribe(Subscriber1,subscriberCallBackMainAbility1Destory)
});
setTimeout(()=>{
featureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility2"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility2: '
+ JSON.stringify(error) + ", " + JSON.stringify(data));
});
},500);
setTimeout(()=>{
featureAbility.startAbility({ want: {
bundleName: "com.example.abilitydisable",
abilityName: "com.example.abilitydisable.MainAbility3"
} }, (error, data) => {
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility3: '
+ JSON.stringify(error) + ", " + JSON.stringify(data));
});
},1000);
setTimeout(()=>{
console.log("1111subscriberCallBack_mainAbility2_lists:
singletonEntryAbulity2_onShow:"+lists);
console.log("+++++++++++++++++"+lists.indexOf("singletonEntryAbulity2_onShow")+"+++++++"+lists.indexOf("ApplicationMainAbility2_onCreate")+lists)
expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue();
expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue();
},2500);
setTimeout(()=>{
missionManager.getMissionInfos("", 100, (err, data) => {
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 getMissionInfos errCode: '+ JSON.stringify(err) + " data: " + JSON.stringify(data));
for (var i = 0;i < data.length; i++) {
console.log("bundleName222222:"+data[i].want["abilityName"]+"data[i]['lockedState']::::"+data[i]['lockedState']);
if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3"){
console.log('data[i]["missionId"]'+data[i]["missionId"] + "::::"+data[i].want["abilityName"]);
mainAbility1missinds.push(data[i]["missionId"])
}
}
console.log("mainAbility1missinds:"+mainAbility1missinds);
});
},3000);
setTimeout(()=>{
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 moveMissionToFront dataCode:++++++');
missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{
parameters:{ "windowMode":100 }}).then((data)=>{
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000
moveMissionToFront dataCode:'+ " data:" + JSON.stringify(data));
}).catch((err)=>{
console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000
moveMissionToFront errCode:'+ " err:" + JSON.stringify(err));
});
},3888);
setTimeout(()=>{
expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onInactive"))==-1).assertTrue();
expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onHide"))==-1).assertTrue();
},3999);
done();
});
})
// @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 {describe, expect, it} from 'deccjsunit/index'
import ConfigurationConstant from '@ohos.application.ConfigurationConstant'
describe("ConfigurationTest", function () {
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100
* @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------");
expect(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT).assertEqual(1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200
* @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_DARK"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------");
expect(ConfigurationConstant.ColorMode.COLOR_MODE_DARK).assertEqual(0);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300
* @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------");
expect(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET).assertEqual(-1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100
* @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_VERTICAL"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------");
expect(ConfigurationConstant.Direction.DIRECTION_VERTICAL).assertEqual(0);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200
* @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_HORIZONTAL"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------");
expect(ConfigurationConstant.Direction.DIRECTION_HORIZONTAL).assertEqual(1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300
* @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_NOT_SET"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------");
expect(ConfigurationConstant.Direction.DIRECTION_NOT_SET).assertEqual(-1);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI).assertEqual(120);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI).assertEqual(160);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI).assertEqual(240);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI).assertEqual(320);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI).assertEqual(480);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI).assertEqual(640);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------");
});
/*
* @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700
* @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET"
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------");
expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET).assertEqual(0);
done();
console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------");
});
})
\ No newline at end of file
// @ts-nocheck
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -12,7 +13,4 @@ ...@@ -12,7 +13,4 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require('./ClearTest.js'); require('./JSMyapplicationJsunit.test.js');
require('./AbilityDisableTest.js');
...@@ -15,26 +15,6 @@ ...@@ -15,26 +15,6 @@
{ {
"name": "entry_MainAbility2", "name": "entry_MainAbility2",
"value": "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
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
...@@ -16,6 +16,9 @@ import("//test/xts/tools/build/suite.gni") ...@@ -16,6 +16,9 @@ import("//test/xts/tools/build/suite.gni")
group("stage") { group("stage") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ "actsamscontexttest:ActsAmsContextTest" ] deps = [
"actsamscontexttest:ActsAmsContextTest",
"stageenvchangetest:StageEnvchangeTest",
]
} }
} }
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("StageEnvchangeTest") {
hap_profile = "entry/src/main/config.json"
deps = [
":stageenvchangetest_js_assets",
":stageenvchangetest_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "StageEnvchangeTest"
}
ohos_js_assets("stageenvchangetest_js_assets") {
source_dir = "entry/src/main/ets/MainAbility"
}
ohos_resources("stageenvchangetest_resources") {
sources = [ "entry/src/main/resources" ]
hap_profile = "entry/src/main/config.json"
}
{
"description": "Configuration for Ability Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "600000",
"package": "com.example.etsmyapplication",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"StageAbilityTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.missionmanager",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.missionmanager",
"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": "ets",
"icon": "$media:icon",
"description": "$string:description_mainability",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index",
"pages/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name": "ohos.permission.MANAGE_MISSIONS"
},
{
"name": "ohos.permission.INSTALL_BUNDLE",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name": "ohos.permission.REMOVE_CACHE_FILES",
"reason": "need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name": "ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
]
}
}
\ No newline at end of file
...@@ -12,15 +12,12 @@ ...@@ -12,15 +12,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import router from '@system.router' import AbilityStage from "@ohos.application.AbilityStage"
export default { export default class MyAbilityStage extends AbilityStage {
data: { onCreate() {
title: 'World' console.log("MyAbilityStage onCreate")
}, globalThis.stageOnCreateRun = 1;
onclick: function () { globalThis.stageContext = this.context;
router.replace({
uri: "pages/index/index"
})
} }
} }
\ No newline at end of file
...@@ -12,29 +12,38 @@ ...@@ -12,29 +12,38 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import abilityFeatureAbility from '@ohos.ability.featureAbility'; import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent';
export default { export default class MainAbility extends Ability {
onCreate() {
console.info("Application onCreate MainAbility3"); onCreate(want, launchParam) {
setTimeout(()=>{ // Ability is creating, initialize resources for this ability
abilityFeatureAbility.terminateSelf().then((data)=>{ console.log("MainAbility onCreate")
console.log("Application terminateSelf data:" + JSON.stringify(data) ) globalThis.abilityWant = want;
}).catch((error)=>{ globalThis.abilityContext = this.context
console.log("Application terminateSelf data:" + JSON.stringify(error) ) }
})
},2500)
},
onDestroy() { onDestroy() {
console.log("singletonEntryAbulity_onDestroy222"); // Ability is destroying, release resources for this ability
commonEvent.publish("ApplicationMainAbility3_onDestroy",()=>{ console.log("MainAbility onDestroy")
console.log("ApplicationMainAbility3_onDestroy publish callBack ApplicationMainAbility2_onDestroy"); }
}); onWindowStageCreate(windowStage) {
}, // Main window is created, set main page for this ability
onForgeGround(){ console.log("MainAbility onWindowStageCreate")
console.log("singletonEntryAbulity_onForgeGround"); windowStage.setUIContent(this.context, "pages/index", null)
commonEvent.publish("ApplicationMainAbility3_onForgeGround",()=>{ }
console.log("ApplicationMainAbility3_onHide publish callBack ApplicationMainAbility2_onForgeGround");
}); onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
console.log("MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("MainAbility onBackground")
} }
}; };
...@@ -12,15 +12,11 @@ ...@@ -12,15 +12,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import router from '@system.router'
export default { export default {
data: { onCreate() {
title: 'World' console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
}, },
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
} }
\ No newline at end of file
...@@ -12,45 +12,52 @@ ...@@ -12,45 +12,52 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import router from '@system.router' import file from '@system.file';
import {Core} from 'deccjsunit/index' import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"
import commonEvent from '@ohos.commonEvent'; import testsuite from "../../test/List.test.ets"
export default { @Entry
data: { @Component
title: "" struct Index {
}, aboutToAppear() {
onInit() { console.log("start run testcase!!!!1");
this.title = 'yingyong4'; const core = Core.getInstance();
},
onclick: function () {
router.replace({
uri: "pages/second/second"
})
},
onShow() {
console.info('onShow start')
}, const expectExtend = new ExpectExtend({
onHide(){ 'id': 'extend'
console.log("singletonEntryAbulity_onHide")
commonEvent.publish("singletonEntryAbulity1_onHide",()=>{
console.log("singletonEntryAbulity1_onHide publish callBack singletonEntryAbulity1_onHide");
});
},
onActive(){
console.log("singletonEntryAbulity_onActive")
commonEvent.publish("singletonEntryAbulity1_onActive",()=>{
console.log("singletonEntryAbulity1_onActive publish callBack singletonEntryAbulity1_onActive");
});
},
onInactive(){
console.log("singletonEntryAbulity_onInactive")
commonEvent.publish("singletonEntryAbulity1_onHide",()=>{
console.log("singletonEntryAbulity1_onInactive publish callBack singletonEntryAbulity1_onInactive");
}); });
} core.addService('expect', expectExtend);
} const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
// console.log('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters));
// configService.setConfig(globalThis.abilityWant.parameters);
testsuite(globalThis.abilityContext);
core.execute();
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World 111')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
...@@ -12,18 +12,32 @@ ...@@ -12,18 +12,32 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
export default { import router from '@system.router';
onCreate() {
console.info("Application onCreate"); @Entry
// setTimeout(()=>{ @Component
// this.content.terminateSelf().then((data)=>{ struct Second {
// console.log("Application terminateSelf data:" + JSON.stringify(data) ) private content: string = "Second Page"
// }).catch((error)=>{
// console.log("Application terminateSelf data:" + JSON.stringify(error) ) build() {
// }) Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
// },8000) Text(`${this.content}`)
}, .fontSize(50)
onDestroy() { .fontWeight(FontWeight.Bold)
console.info("Application onDestroy"); Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
} }
}; .width('100%')
.height('100%')
}
}
\ No newline at end of file
...@@ -9,18 +9,14 @@ ...@@ -9,18 +9,14 @@
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permisrsions and
* limitations under the License. * limitations under the License.
*/ */
import router from '@system.router' import missionManagerTest from './MissionManager_test.ets'
export default function testsuite(context) {
missionManagerTest(context)
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
} }
\ No newline at end of file
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -13,19 +12,61 @@ ...@@ -13,19 +12,61 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"
import missionManager from '@ohos.application.missionManager'; import missionManager from "@ohos.application.missionManager"
import abilityFeatureAbility from '@ohos.ability.featureAbility';
import bundleManager from '@ohos.bundle';
import appManager from "@ohos.application.appManager"
import commonEvent from '@ohos.commonEvent';
import {onDestroys} from "../MainAbility2/app.js"
import abilityManager from '@ohos.application.abilityManager'
import ConfigurationConstant from "@ohos.application.ConfigurationConstant";
import AbilityConstant from '@ohos.application.AbilityConstant' import AbilityConstant from '@ohos.application.AbilityConstant'
describe('AbilityDisableTests', function () {
export default function missionManagerTest(abilityContext) {
describe('missionManagerTest', function () {
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Verify the enumeration values abilityContext.config.language
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0100", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0100-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0100 abilityContext.config.language:" + abilityContext.config.language);
expect(abilityContext.config.language=="zh-Hans").assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Call direction to get the direction
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0200", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0200-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0200 abilityContext.config.direction:" + abilityContext.config.direction);
expect(abilityContext.config.direction==0).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Call direction to get the screenDensity
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0300", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0300-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0300 abilityContext.config.screenDensity:" + abilityContext.config.screenDensity);
expect(abilityContext.config.screenDensity==160).assertTrue();
done();
});
/*
* @tc.number SUB_AA_OpenHarmony_EnvChange_0400
* @tc.name Call direction to get the displayId
* @tc.desc Function test
* @tc.level 0
*/
it("SUB_AA_OpenHarmony_EnvChange_0400", 0, async function (done) {
console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0400-------------------");
console.info("SUB_AA_OpenHarmony_EnvChange_0400 abilityContext.config.displayId:" + abilityContext.config.displayId);
expect(abilityContext.config.displayId==0).assertTrue();
done();
});
/* /*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6200 * @tc.number SUB_AA_OpenHarmony_AbilityStart_6200
* @tc.name Verify the enumeration values LaunchReason. CONTINUATION * @tc.name Verify the enumeration values LaunchReason. CONTINUATION
...@@ -33,13 +74,11 @@ describe('AbilityDisableTests', function () { ...@@ -33,13 +74,11 @@ describe('AbilityDisableTests', function () {
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_AA_OpenHarmony_AbilityStart_6200", 0, async function (done) { it("SUB_AA_OpenHarmony_AbilityStart_6200", 0, async function (done) {
console.info("--------logMessage SUB_AA_OpenHarmony_AbilityStart_6300----"); console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6300-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6200 LaunchReason.CONTINUATION: " console.info("SUB_AA_OpenHarmony_AbilityStart_6200 LaunchReason.CONTINUATION: " + AbilityConstant.LaunchReason.CONTINUATION);
+ AbilityConstant.LaunchReason.CONTINUATION);
expect(AbilityConstant.LaunchReason.CONTINUATION==3).assertTrue(); expect(AbilityConstant.LaunchReason.CONTINUATION==3).assertTrue();
done(); done();
}); });
/* /*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6300 * @tc.number SUB_AA_OpenHarmony_AbilityStart_6300
* @tc.name Verify the enumeration value launchreason.start UNKNOWN * @tc.name Verify the enumeration value launchreason.start UNKNOWN
...@@ -47,13 +86,11 @@ describe('AbilityDisableTests', function () { ...@@ -47,13 +86,11 @@ describe('AbilityDisableTests', function () {
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_AA_OpenHarmony_AbilityStart_6300", 0, async function (done) { it("SUB_AA_OpenHarmony_AbilityStart_6300", 0, async function (done) {
console.info("--------logMessage SUB_AA_OpenHarmony_AbilityStart_6300----"); console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6300-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6300 LaunchReason.UNKNOWN: " + console.info("SUB_AA_OpenHarmony_AbilityStart_6300 LaunchReason.UNKNOWN: " + AbilityConstant.LaunchReason.UNKNOWN);
AbilityConstant.LaunchReason.UNKNOWN);
expect(AbilityConstant.LaunchReason.UNKNOWN==0).assertTrue(); expect(AbilityConstant.LaunchReason.UNKNOWN==0).assertTrue();
done(); done();
}); });
/* /*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6400 * @tc.number SUB_AA_OpenHarmony_AbilityStart_6400
* @tc.name Verify the enumeration value launchreason.START_ABILITY * @tc.name Verify the enumeration value launchreason.START_ABILITY
...@@ -61,13 +98,11 @@ AbilityConstant.LaunchReason.UNKNOWN); ...@@ -61,13 +98,11 @@ AbilityConstant.LaunchReason.UNKNOWN);
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_AA_OpenHarmony_AbilityStart_6400", 0, async function (done) { it("SUB_AA_OpenHarmony_AbilityStart_6400", 0, async function (done) {
console.info("------logMessage SUB_AA_OpenHarmony_AbilityStart_6400-----"); console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6400-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6400 LaunchReason.START_ABILITY: " + console.info("SUB_AA_OpenHarmony_AbilityStart_6400 LaunchReason.START_ABILITY: " + AbilityConstant.LaunchReason.START_ABILITY);
AbilityConstant.LaunchReason.START_ABILITY);
expect(AbilityConstant.LaunchReason.START_ABILITY==1).assertTrue(); expect(AbilityConstant.LaunchReason.START_ABILITY==1).assertTrue();
done(); done();
}); });
/* /*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6500 * @tc.number SUB_AA_OpenHarmony_AbilityStart_6500
* @tc.name Verify the enumeration values LaunchReason. CALL * @tc.name Verify the enumeration values LaunchReason. CALL
...@@ -75,13 +110,11 @@ AbilityConstant.LaunchReason.UNKNOWN); ...@@ -75,13 +110,11 @@ AbilityConstant.LaunchReason.UNKNOWN);
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_AA_OpenHarmony_AbilityStart_6500", 0, async function (done) { it("SUB_AA_OpenHarmony_AbilityStart_6500", 0, async function (done) {
console.info("-------logMessage SUB_AA_OpenHarmony_AbilityStart_6500-----"); console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6500-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6500 LaunchReason.CALL: " + console.info("SUB_AA_OpenHarmony_AbilityStart_6500 LaunchReason.CALL: " + AbilityConstant.LaunchReason.CALL);
AbilityConstant.LaunchReason.CALL);
expect(AbilityConstant.LaunchReason.CALL==2).assertTrue(); expect(AbilityConstant.LaunchReason.CALL==2).assertTrue();
done(); done();
}); });
/* /*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6600 * @tc.number SUB_AA_OpenHarmony_AbilityStart_6600
* @tc.name Verify the enumeration values LastExitReason.UNKNOWN * @tc.name Verify the enumeration values LastExitReason.UNKNOWN
...@@ -89,13 +122,11 @@ AbilityConstant.LaunchReason.CALL); ...@@ -89,13 +122,11 @@ AbilityConstant.LaunchReason.CALL);
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_AA_OpenHarmony_AbilityStart_6600", 0, async function (done) { it("SUB_AA_OpenHarmony_AbilityStart_6600", 0, async function (done) {
console.info("---------logMessage SUB_AA_OpenHarmony_AbilityStart_6600---------"); console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6600-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6600 LastExitReason.UNKNOWN: " + console.info("SUB_AA_OpenHarmony_AbilityStart_6600 LastExitReason.UNKNOWN: " + AbilityConstant.LastExitReason.UNKNOWN);
AbilityConstant.LastExitReason.UNKNOWN);
expect(AbilityConstant.LastExitReason.UNKNOWN==0).assertTrue(); expect(AbilityConstant.LastExitReason.UNKNOWN==0).assertTrue();
done(); done();
}); });
/* /*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6700 * @tc.number SUB_AA_OpenHarmony_AbilityStart_6700
* @tc.name Verify the enumeration values LastExitReason.ABILITY_NOT_RESPONDING * @tc.name Verify the enumeration values LastExitReason.ABILITY_NOT_RESPONDING
...@@ -103,13 +134,11 @@ AbilityConstant.LaunchReason.CALL); ...@@ -103,13 +134,11 @@ AbilityConstant.LaunchReason.CALL);
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_AA_OpenHarmony_AbilityStart_6700", 0, async function (done) { it("SUB_AA_OpenHarmony_AbilityStart_6700", 0, async function (done) {
console.info("--------logMessage SUB_AA_OpenHarmony_AbilityStart_6700---------"); console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6700-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6700 LastExitReason.ABILITY_NOT_RESPONDING: " + console.info("SUB_AA_OpenHarmony_AbilityStart_6700 LastExitReason.ABILITY_NOT_RESPONDING: " + AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING);
AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING);
expect(AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING==1).assertTrue(); expect(AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING==1).assertTrue();
done(); done();
}); });
/* /*
* @tc.number SUB_AA_OpenHarmony_AbilityStart_6700 * @tc.number SUB_AA_OpenHarmony_AbilityStart_6700
* @tc.name Verify the enumeration values LastExitReason.NORMAL * @tc.name Verify the enumeration values LastExitReason.NORMAL
...@@ -117,10 +146,10 @@ AbilityConstant.LaunchReason.CALL); ...@@ -117,10 +146,10 @@ AbilityConstant.LaunchReason.CALL);
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_AA_OpenHarmony_AbilityStart_6800", 0, async function (done) { it("SUB_AA_OpenHarmony_AbilityStart_6800", 0, async function (done) {
console.info("-----logMessage SUB_AA_OpenHarmony_AbilityStart_6800-----------"); console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6800-------------------");
console.info("SUB_AA_OpenHarmony_AbilityStart_6800 LastExitReason.NORMAL: " + console.info("SUB_AA_OpenHarmony_AbilityStart_6800 LastExitReason.NORMAL: " + AbilityConstant.LastExitReason.NORMAL);
AbilityConstant.LastExitReason.NORMAL);
expect(AbilityConstant.LastExitReason.NORMAL==2).assertTrue(); expect(AbilityConstant.LastExitReason.NORMAL==2).assertTrue();
done(); done();
}); });
}) })
}
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "description_mainability",
"value": "eTS_Empty Ability"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册