提交 8547b26f 编写于 作者: Z zhaoyuan17

Update xts test code

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 7032902b
......@@ -21,6 +21,7 @@ group("aafwk_standard") {
"context:context",
"featureability:featureability",
"formmanager:formmanager",
"setshowonlockscreen:setshowonlockscreen",
"want:want",
#"verifypermission:verifypermission"
......
......@@ -159,7 +159,7 @@ describe('ActsAmsCallBackFifthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -130,7 +130,7 @@ describe('ActsAmsCallBackFirstScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -175,7 +175,7 @@ describe('ActsAmsCallBackFourthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -145,7 +145,7 @@ describe('ActsAmsCallBackSecondScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -156,7 +156,7 @@ describe('ActsAmsCallBackThirdScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -10,6 +10,7 @@
{
"test-file-name": [
"ActsAmsTestFifthSceneTest.hap",
"simulateFAbilityFir.hap",
"simulateFAbilitySed.hap",
"verifyIAbility.hap"
],
......
......@@ -177,7 +177,7 @@ describe('ActsAmsTestFifthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -137,7 +137,7 @@ describe('ActsAmsTestFirstScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -197,7 +197,7 @@ describe('ActsAmsTestFourthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -157,7 +157,7 @@ describe('ActsAmsTestSecondScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
......@@ -175,7 +175,7 @@ describe('ActsAmsTestThirdScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
expect(info[i].lastMemoryLevel).assertEqual(-1);
expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
......
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
group("setshowonlockscreen") {
testonly = true
if (is_standard_system) {
deps = [
"setshowonlock:setshowonlock",
"showsethown:showsethown",
]
}
}
# 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("setshowonlock") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "setshowonlock"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
}
{
"app": {
"bundleName": "com.example.setshowonlock",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.setshowonlock",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.setshowonlock.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard",
"visible": true
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"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('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</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 featureAbility from '@ohos.ability.featureAbility'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
featureAbility.setShowOnLockScreen(false,(error, data) => {
console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
});
console.log('ZLM-----onClick1 end');
},
onStart(want){
this.title = this.$t('strings.world');
featureAbility.setShowOnLockScreen(false,(error, data) => {
console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
});
console.log('ZLM-----onClick1 end');
},
onShow(){
this.title = this.$t('strings.world');
featureAbility.setShowOnLockScreen(false,(error, data) => {
console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
});
console.log('ZLM-----onClick1 end');
}
}
{
"string": [
{
"name": "app_name",
"value": "setShowOnLock"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("showsethown") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "showsethown"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
}
{
"app": {
"bundleName": "com.example.showsethown",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.showsethown",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.showsethown.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard",
"visible":true
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"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('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</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 featureAbility from '@ohos.ability.featureAbility'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
featureAbility.setShowOnLockScreen(true,(error, data) => {
console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
});
console.log('ZLM-----onClick1 end');
},
onStart(want){
this.title = this.$t('strings.world');
featureAbility.setShowOnLockScreen(true,(error, data) => {
console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
});
console.log('ZLM-----onClick1 end');
},
onShow(){
this.title = this.$t('strings.world');
featureAbility.setShowOnLockScreen(true,(error, data) => {
console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
});
console.log('ZLM-----onClick1 end');
}
}
{
"string": [
{
"name": "app_name",
"value": "ShowSetHOWN"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
......@@ -9,32 +9,11 @@
"kits": [
{
"test-file-name": [
"FWKDataAccessor.hap"
"FWKDataAccessor.hap",
"amsStDataAbility.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"remount",
"mkdir /data/test"
]
},
{
"type": "PushKit",
"push": [
"./resource/appexecfwk/amsStDataAbility.hap->/data/test/amsStDataAbility.hap"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 644 /data/test/*.hap",
"bm install -p /data/test/amsStDataAbility.hap"
]
}
}
]
}
......@@ -31,7 +31,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0100', 0, async function (done) {
console.info('=====================bms_checkPermission_0100==================');
var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_ONE)
expect(data).assertEqual(0);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
......@@ -44,7 +44,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0200==================');
await bundle.checkPermission(BUNDLE_NAME, PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(0);
expect(data).assertEqual(0);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
})
......@@ -58,7 +58,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0300', 0, async function (done) {
console.info('=====================bms_checkPermission_0300==================');
var data = await bundle.checkPermission('', PERMISSION_ONE)
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
......@@ -72,7 +72,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0400==================');
await bundle.checkPermission('', PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(-1);
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
......@@ -86,7 +86,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0500', 0, async function (done) {
console.info('=====================bms_checkPermission_0500==================');
var data = await bundle.checkPermission(BUNDLE_NAME, '')
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
......@@ -100,7 +100,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0600==================');
await bundle.checkPermission(BUNDLE_NAME, '', (err, data) => {
expect(err.code).assertEqual(-1);
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
......@@ -114,7 +114,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0700', 0, async function (done) {
console.info('=====================bms_checkPermission_0700==================');
var data = await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345')
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
......@@ -128,7 +128,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0800==================');
await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345', (err, data) => {
expect(err.code).assertEqual(-1);
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
......@@ -142,7 +142,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0900', 0, async function (done) {
console.info('=====================bms_checkPermission_0900==================');
var data = await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE)
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
......@@ -156,7 +156,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_1000==================');
await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(-1);
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
......@@ -174,7 +174,7 @@ describe('ActsBmsCheckPermissionTest', function () {
permissionName += 'test';
}
var data = await bundle.checkPermission(BUNDLE_NAME, permissionName)
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
......@@ -192,7 +192,7 @@ describe('ActsBmsCheckPermissionTest', function () {
}
await bundle.checkPermission(BUNDLE_NAME, permissionName, (err, data) => {
expect(err.code).assertEqual(-1);
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
......@@ -210,7 +210,7 @@ describe('ActsBmsCheckPermissionTest', function () {
bundleName += 'test';
}
var data = await bundle.checkPermission(bundleName, PERMISSION_ONE)
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
......@@ -228,7 +228,7 @@ describe('ActsBmsCheckPermissionTest', function () {
}
await bundle.checkPermission(bundleName, PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(-1);
expect(data).assertEqual(-1);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
......@@ -242,7 +242,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_1500', 0, async function (done) {
console.info('=====================bms_checkPermission_1500==================');
var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO)
expect(data).assertEqual(0);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
......@@ -256,7 +256,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_1600==================');
await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO, (err, data) => {
expect(err.code).assertEqual(0);
expect(data).assertEqual(0);
expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
})
......
......@@ -183,7 +183,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it('bms_getModuleUsageRecordTest_0300', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0300==================');
bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO, (err, data) => {
bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN, (err, data) => {
expect(err.code).assertEqual(0);
checkModuleUsageRecord(data);
var result = checkIsExist(data, BUNDLE_NAME);
......@@ -208,7 +208,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it('bms_getModuleUsageRecordTest_0400', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0400==================');
var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO);
var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN);
checkModuleUsageRecord(records);
var result = checkIsExist(records, BUNDLE_NAME);
expect(result).assertTrue();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册