提交 9e1645f5 编写于 作者: K kirl75 提交者: Gitee

Merge branch 'master' of gitee.com:openharmony/xts_acts into master_xts_0308_2

# 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("ActsDataAbilityJsTest") {
hap_name = "ActsDataAbilityJsTest"
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
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 hjsunit Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "100000",
"package": "com.example.actsdataabilityjstest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsDataAbilityJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsdataabilityjstest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsdataabilityjstest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsdataabilityjstest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "singleton",
"visible": true
}
],
"reqPermissions": [
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO",
"reason":"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"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"
},
{
"name":"ohos.permission.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.MANAGE_MISSIONS",
"reason":"need use ohos.permission.MANAGE_MISSIONS"
},
{
"name":"ohos.permission.GET_RUNNING_INFO",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
},
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
},
{
"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
}
],
"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('ActsProcessManageJsTest onCreate');
},
onDestroy() {
console.info('ActsProcessManageJsTest onDestroy');
},
onShow() {
console.info('ActsProcessManageJsTest onShow');
},
onHide() {
console.info('ActsProcessManageJsTest onHide');
}
};
{
"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;
}
.btn {
width: 200px;
height: 80px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<button class="btn" type="capsule" value="start" onclick="start"></button>
</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 { Core, ExpectExtend } from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "",
testTime: 0
},
onInit() {
console.info('Acts_DataAbilityJSTest onInit');
this.title = this.$t('strings.world');
},
onShow() {
console.info('Acts_DataAbilityJSTest onShow');
console.info('Acts_DataAbilityJSTest testTime' + this.testTime);
if (this.testTime == 0) {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 30000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
this.testTime++;
},
onReady() {
console.info('Acts_DataAbilityJSTest onReady');
},
onActive() {
console.info('Acts_DataAbilityJSTest onActive');
},
onInactive() {
console.info('Acts_DataAbilityJSTest onInactive');
},
onHide() {
console.info('Acts_DataAbilityJSTest onHide');
},
onDestroy() {
console.info('Acts_DataAbilityJSTest onDestroy');
},
onBackPress() {
console.info('Acts_DataAbilityJSTest onBackPress');
},
onNewRequest() {
console.info('Acts_DataAbilityJSTest onNewRequest');
},
onStartContinuation() {
console.info('Acts_DataAbilityJSTest onStartContinuation');
},
onSaveData(value) {
console.info('Acts_DataAbilityJSTest onSaveData:' + JSON.stringify(value));
},
onRestoreData(value) {
console.info('Acts_DataAbilityJSTest onRestoreData:' + JSON.stringify(value));
},
onCompleteContinuation(code) {
console.info('Acts_DataAbilityJSTest onCompleteContinuation:' + JSON.stringify(code));
},
onConfigurationUpdated(configuration) {
console.info('Acts_DataAbilityJSTest onConfigurationUpdated:' + JSON.stringify(configuration));
}
}
{
"string": [
{
"name": "app_name",
"value": "actsparticleabilitytest"
},
{
"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.
*/
require('./ActsDataAbilityJsTest.test.js')
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsKillProcessWithAccountApi7Test") {
hap_name = "ActsKillProcessWithAccountApi7Test"
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
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 hjsunit Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "60000",
"package": "com.example.myapplication.actsapi7killtest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsKillProcessWithAccountApi7Test.hap",
"ActsKillProcessWithAccountCloseApi7.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"remount"
]
},
{
"type": "PushKit",
"push": [
"ActsKillProcessWithAccountCloseApi7.hap->/data/ActsKillProcessWithAccountCloseApi7.hap"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 644 /data/*.hap"
]
}
]
}
{
"app": {
"bundleName": "com.example.myapplication.actsapi7killtest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.myapplication.actsapi7killtest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.myapplication.actsapi7killtest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "singleton",
"visible": true
}
],
"reqPermissions": [
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO",
"reason":"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"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"
},
{
"name":"ohos.permission.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.MANAGE_MISSIONS",
"reason":"need use ohos.permission.MANAGE_MISSIONS"
},
{
"name":"ohos.permission.GET_RUNNING_INFO",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
},
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
},
{
"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
}
],
"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('ActsProcessManageJsTest onCreate');
},
onDestroy() {
console.info('ActsProcessManageJsTest onDestroy');
},
onShow() {
console.info('ActsProcessManageJsTest onShow');
},
onHide() {
console.info('ActsProcessManageJsTest onHide');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
.btn {
width: 200px;
height: 80px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<button class="btn" type="capsule" value="start" onclick="start"></button>
</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 { Core, ExpectExtend } from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "",
testTime: 0
},
onInit() {
console.info('ActsProcessManageJsTest onInit');
this.title = this.$t('strings.world');
},
onShow() {
console.info('ActsProcessManageJsTest onShow');
console.info('ActsProcessManageJsTest testTime' + this.testTime);
if (this.testTime == 0) {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 30000;
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
}
this.testTime++;
},
onReady() {
console.info('ActsProcessManageJsTest onReady');
},
onActive() {
console.info('ActsProcessManageJsTest onActive');
},
onInactive() {
console.info('ActsProcessManageJsTest onInactive');
},
onHide() {
console.info('ActsProcessManageJsTest onHide');
},
onDestroy() {
console.info('ActsProcessManageJsTest onDestroy');
},
onBackPress() {
console.info('ActsProcessManageJsTest onBackPress');
},
onNewRequest() {
console.info('ActsProcessManageJsTest onNewRequest');
},
onStartContinuation() {
console.info('ActsProcessManageJsTest onStartContinuation');
},
onSaveData(value) {
console.info('ActsProcessManageJsTest onSaveData:' + JSON.stringify(value));
},
onRestoreData(value) {
console.info('ActsProcessManageJsTest onRestoreData:' + JSON.stringify(value));
},
onCompleteContinuation(code) {
console.info('ActsProcessManageJsTest onCompleteContinuation:' + JSON.stringify(code));
},
onConfigurationUpdated(configuration) {
console.info('ActsProcessManageJsTest onConfigurationUpdated:' + JSON.stringify(configuration));
}
}
{
"string": [
{
"name": "app_name",
"value": "actsparticleabilitytest"
},
{
"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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"
import appManager from '@ohos.application.AppManager';
import featureAbility from '@ohos.ability.featureAbility'
const ACCOUNT_ID = 100;
const NULL_ACCOUNT_ID = 102;
const BUNDLE_NAME = 'com.example.actskillprocesswithaccountcloseapi7';
const NULL_BUNDLE_NAME = 'com.aaa.bbb';
const START_ABILITY_NAME = 'com.example.actskillprocesswithaccountcloseapi7.MainAbility';
describe('ActskillProcessWithaccountTest', function () {
beforeEach(async (done) => {
console.log('======>beforeEach killProcessWithAccountFATest<=======');
await featureAbility.startAbility({
want:
{
bundleName: BUNDLE_NAME,
abilityName: START_ABILITY_NAME
}
}).then(async () => {
console.log("====>end ACTS_KillProcessWithAccountFA startability ====>success!")
done();
})
})
function sleep(time) {
let delta;
if (typeof time != 'number' || time <= 0) {
delta = 100;
} else {
delta = Math.round(time);
}
for (let start = Date.now(); Date.now() - start <= delta;);
}
function checkRunningProcess(name, dataInfo) {
for (let i = 0, len = dataInfo.length; i < len; i++) {
if (dataInfo[i].processName == name) {
return true;
}
}
return false;
}
/**
* @tc.number: ACTS_KillProcessWithAccountFA_0100
* @tc.name: Provide the system interface of the specified user management application.
* @tc.desc: Validates the ability to stop the specified process for the specified user.
*/
it('ACTS_KillProcessWithAccountFA_0100', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccountFA_0100 start startAbility====>");
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0100 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0100====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccountFA_0100 killProcess ======> start');
})
setTimeout(async () => {
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0100 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0100====>outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
}, 3000)
})
/**
* @tc.number: ACTS_KillProcessWithAccountFA_0300
* @tc.name: Provide the system interface of the specified user management application.
* @tc.desc: Authentication cannot stop the specified process for the specified user.
*/
it('ACTS_KillProcessWithAccountFA_0300', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccountFA_0300 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0300 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0300====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(NULL_BUNDLE_NAME, ACCOUNT_ID).then(() => {
console.log('ACTS_KillProcessWithAccountFA_0300 ======> ');
})
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0300 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0300====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccountFA_0300 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0300 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0300====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
}, 1500)
})
/**
* @tc.number: ACTS_KillProcessWithAccountFA_0400
* @tc.name: Provide the system interface of the specified user management application.
* @tc.desc: Authentication cannot stop the specified process for the specified user.
*/
it('ACTS_KillProcessWithAccountFA_0400', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccountFA_0400 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0400 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0400====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, NULL_ACCOUNT_ID).then(() => {
console.log('ACTS_KillProcessWithAccountFA_0400 killProcess ======> start');
})
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0400 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0400====>infores = " + infores)
expect(infores).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccountFA_0400 killProcess2 ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0400 ==2== getProcessRunningInfos ======>'
+ JSON.stringify(copyprocrssinfo));
var out = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0400====>infores = " + out)
expect(out).assertEqual(false);
done();
})
}, 1500)
})
/**
* @tc.number: ACTS_KillProcessWithAccountFA_0500
* @tc.name: Provide the system interface of the specified user management application.
* @tc.desc: Validates the ability to stop the specified process for the specified user.
*/
it('ACTS_KillProcessWithAccountFA_0500', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccountFA_0500 start startAbility====>");
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0500 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0500====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID, (async () => {
console.log('ACTS_KillProcessWithAccountFA_0500 killProcess ======> start');
}))
setTimeout(async () => {
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0500 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0500====>outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
}, 3000)
})
/**
* @tc.number: ACTS_KillProcessWithAccountFA_0700
* @tc.name: Provide the system interface of the specified user management application.
* @tc.desc: Authentication cannot stop the specified process for the specified user.
*/
it('ACTS_KillProcessWithAccountFA_0700', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccountFA_0700 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0700 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0700====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(NULL_BUNDLE_NAME, ACCOUNT_ID, (() => {
console.log('ACTS_KillProcessWithAccountFA_0700 killProcess ======> start');
}))
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0700 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0700====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccountFA_0700 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0700 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0700====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
}, 1500)
})
/**
* @tc.number: ACTS_KillProcessWithAccountFA_0800
* @tc.name: Provide the system interface of the specified user management application.
* @tc.desc: Authentication cannot stop the specified process for the specified user.
*/
it('ACTS_KillProcessWithAccountFA_0800', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccountFA_0800 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0800 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0800====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, NULL_ACCOUNT_ID, (() => {
console.log('ACTS_KillProcessWithAccountFA_0800 killProcess ======> start');
}))
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0800 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0800====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccountFA_0800 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccountFA_0800 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccountFA_0800====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
}, 1500)
})
})
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./ActsKillProcessTest.test.js')
\ No newline at end of file
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsKillProcessWithAccountCloseApi7") {
hap_name = "ActsKillProcessWithAccountCloseApi7"
hap_profile = "./src/main/config.json"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/js/resources" ]
hap_profile = "./src/main/config.json"
}
{
"app": {
"bundleName": "com.example.actskillprocesswithaccountcloseapi7",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actskillprocesswithaccountcloseapi7",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actskillprocesswithaccountcloseapi7.MainAbility",
"visible": true,
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
}
],
"reqPermissions": [
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO",
"reason":"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"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"
},
{
"name":"ohos.permission.MANAGE_MISSIONS",
"reason":"need use ohos.permission.MANAGE_MISSIONS"
},
{
"name":"ohos.permission.GET_RUNNING_INFO",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
},
{
"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS",
"reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS"
},
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
}
],
"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('ProcessManageSystemAppB onCreate');
},
onDestroy() {
console.info('ProcessManageSystemAppB onDestroy');
},
onShow() {
console.info('ProcessManageSystemAppB onShow');
},
onHide() {
console.info('ProcessManageSystemAppB onHide');
}
};
.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 commonEvent from '@ohos.commonevent'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
console.info('ACTS_ProcessManage SystemAppB onInit');
this.title = "ACTS_ProcessManage SystemAppB";
},
onReady() {
console.info('ACTS_ProcessManage SystemAppB onReady');
},
onActive() {
console.info('ACTS_ProcessManage SystemAppB onActive');
},
onShow() {
console.info('ACTS_ProcessManage SystemAppB onShow');
},
onInactive() {
console.info('ACTS_ProcessManage SystemAppB onInactive');
},
onHide() {
console.info('ACTS_ProcessManage SystemAppB onHide');
},
onDestroy() {
console.info('ACTS_ProcessManage SystemAppB onDestroy');
},
onBackPress() {
console.info('ACTS_ProcessManage SystemAppB onBackPress');
},
onNewRequest() {
console.info('ACTS_ProcessManage SystemAppB onNewRequest');
},
onStartContinuation() {
console.info('ACTS_ProcessManage SystemAppB onStartContinuation');
},
onSaveData(value) {
console.info('ACTS_ProcessManage SystemAppB onSaveData:' + JSON.stringify(value));
},
onRestoreData(value) {
console.info('ACTS_ProcessManage SystemAppB onRestoreData:' + JSON.stringify(value));
},
onCompleteContinuation(code) {
console.info('ACTS_ProcessManage SystemAppB onCompleteContinuation:' + JSON.stringify(code));
},
onConfigurationUpdated(configuration) {
console.info('ACTS_ProcessManage SystemAppB onConfigurationUpdated:' + JSON.stringify(configuration));
}
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "particlestartability"
},
{
"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")
group("ActsKillProcessWithAccountApi7") {
testonly = true
if (is_standard_system) {
deps = [
"ActsKillProcessWithAccountApi7Test:ActsKillProcessWithAccountApi7Test",
"ActsKillProcessWithAccountCloseApi7:ActsKillProcessWithAccountCloseApi7",
]
}
}
......@@ -18,13 +18,17 @@ group("aafwk_standard") {
if (is_standard_system) {
deps = [
"ActsStServiceAbilityClientCaseTest:ActsStServiceAbilityClientCaseTest",
"ActsDataAbilityJsTest:ActsDataAbilityJsTest",
"ActsKillProcessWithAccountApi7:ActsKillProcessWithAccountApi7",
"abilitymanager:actsabilitymanagertest",
"actsabilitydistributetest:ActsAbilityDistributeTest",
"actsabilitydistributetest:ActsAbilityDistributeTest",
"actsabilitymanageretstest:ActsAbilityManagerEtsTest",
"amsabilitymanager/amsMissionSnapshotTest:ActsAmsMissionSnapshotTest",
"amsabilitymanager/amsMissionSnapshotTestSingleton:ActsAmsMissionSnapshotTestSingleton",
"amsabilitymanager/amsMissionSnapshotTestSingletonS:ActsAmsMissionSnapshotTestSingletonS",
"amsdatauriutils:ActsAmsDataUriUtilsTest",
"amsgetabilityprocessinfo:amsgetabilityprocessinfo",
"amsmultiapp/MultiAppPage:ActsAmsMultiPageApp",
"amsmultiapp/MultiAppPageConnectService:ActsAmsMultiPageAppConnectService",
"amsmultiapp/MultiAppPageConnect_Service:ActsAmsMultiAppPageConnectService",
......@@ -43,10 +47,12 @@ group("aafwk_standard") {
"amsmultiapp/amsmultiapptester:ActsAmsMultiAppTester",
"amsmultiapp/amsmultidataabilityclone:ActsAmsMultiDataAbilityClone",
"amsmultiapp/amsmultidataabilityself:ActsAmsMultiDataAbilitySelf",
"amsprocessmanageapi7:amsprocessmanageapi7",
"amszipfileunzipfilest:ActsAmsZipfileUnzipfileSTest",
"context:context",
"featureability:featureability",
"formmanager:formmanager",
"lanuageConfigapi7:lanuageConfigapi7",
"serviceability/sceneProject/particlestartability:ParticleStartAbility",
"serviceability/sceneProject/particletestserver:ParticleTestServer",
"serviceability/stserviceabilityserver:amsStServiceAilityServer",
......
......@@ -39,6 +39,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -40,6 +40,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -39,6 +39,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -39,6 +39,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -39,6 +39,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"test-timeout": "300000",
"package": "com.example.actsamstestfifthscene",
"shell-timeout": "600000"
},
......
......@@ -39,6 +39,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"test-timeout": "300000",
"package": "com.example.actsamstestfirstscene",
"shell-timeout": "600000"
},
......
......@@ -39,6 +39,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"test-timeout": "300000",
"package": "com.example.actsamstestfourthscene",
"shell-timeout": "60000"
},
......
......@@ -39,6 +39,7 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
this.timeout = 10000
require('../../../test/List.test')
core.execute()
......
......@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"test-timeout": "300000",
"package": "com.example.actsamstestsecondscene",
"shell-timeout": "600000"
},
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册