提交 8ce392f1 编写于 作者: K kirl.liu

Add FA mode

Signed-off-by: Nkirl.liu <kirl.liu@huawei.com>
上级 81979d52
# 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('ActsAbilityTest', function () {
beforeEach(async (done) => {
console.log('======>beforeEach killProcessWithAccountTest<=======');
await featureAbility.startAbility({
want:
{
bundleName: BUNDLE_NAME,
abilityName: START_ABILITY_NAME
}
}).then(async() => {
console.log("====>end ACTS_KillProcessWithAccount startability ====>success!")
done();
})
})
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
}
}
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_KillProcessWithAccount_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_KillProcessWithAccount_0100', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccount_0100 start startAbility====>");
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0100 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0100====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
console.log('ACTS_KillProcessWithAccount_0100 killProcess ======> start');
})
setTimeout(async() => {
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0100 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0100====>outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
}, 3000 )
})
/**
* @tc.number: ACTS_KillProcessWithAccount_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_KillProcessWithAccount_0300', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccount_0300 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0300 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0300====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(NULL_BUNDLE_NAME, ACCOUNT_ID).then(() => {
console.log('ACTS_KillProcessWithAccount_0300 ======> ');
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0300 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0300====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
console.log('ACTS_KillProcessWithAccount_0300 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0300 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0300====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
},1500)
})
/**
* @tc.number: ACTS_KillProcessWithAccount_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_KillProcessWithAccount_0400', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccount_0400 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0400 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0400====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, NULL_ACCOUNT_ID).then(() => {
console.log('ACTS_KillProcessWithAccount_0400 killProcess ======> start');
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0400 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0400====>infores = " + infores)
expect(infores).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
console.log('ACTS_KillProcessWithAccount_0400 killProcess2 ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0400 ==2== getProcessRunningInfos ======>'
+ JSON.stringify(copyprocrssinfo));
var out = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0400====>infores = " + out)
expect(out).assertEqual(false);
done();
})
},1500)
})
/**
* @tc.number: ACTS_KillProcessWithAccount_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_KillProcessWithAccount_0500', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccount_0500 start startAbility====>");
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0500 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0500====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID,(async() => {
console.log('ACTS_KillProcessWithAccount_0500 killProcess ======> start');
}))
setTimeout(async() => {
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0500 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0500====>outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
}, 3000 )
})
/**
* @tc.number: ACTS_KillProcessWithAccount_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_KillProcessWithAccount_0700', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccount_0700 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0700 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0700====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(NULL_BUNDLE_NAME,ACCOUNT_ID,(() => {
console.log('ACTS_KillProcessWithAccount_0700 killProcess ======> start');
}))
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0700 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0700====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
console.log('ACTS_KillProcessWithAccount_0700 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0700 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0700====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
},1500)
})
/**
* @tc.number: ACTS_KillProcessWithAccount_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_KillProcessWithAccount_0800', 0, async function (done) {
console.debug("====>ACTS_KillProcessWithAccount_0800 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0800 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0800====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, NULL_ACCOUNT_ID,(() => {
console.log('ACTS_KillProcessWithAccount_0800 killProcess ======> start');
}))
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0800 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0800====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
console.log('ACTS_KillProcessWithAccount_0800 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0800 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_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('./ActsProcessManageJsTest.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",
]
}
}
......@@ -17,6 +17,7 @@ group("aafwk_standard") {
testonly = true
if (is_standard_system) {
deps = [
"ActsKillProcessWithAccountApi7:ActsKillProcessWithAccountApi7",
"abilitymanager:actsabilitymanagertest",
"actsabilitydistributetest:ActsAbilityDistributeTest",
"actsabilitydistributetest:ActsAbilityDistributeTest",
......@@ -24,6 +25,7 @@ group("aafwk_standard") {
"amsabilitymanager/amsMissionSnapshotTestSingleton:ActsAmsMissionSnapshotTestSingleton",
"amsabilitymanager/amsMissionSnapshotTestSingletonS:ActsAmsMissionSnapshotTestSingletonS",
"amsdatauriutils:ActsAmsDataUriUtilsTest",
"amsgetabilityprocessinfo:amsgetabilityprocessinfo",
"amsmultiapp/MultiAppPage:ActsAmsMultiPageApp",
"amsmultiapp/MultiAppPageConnectService:ActsAmsMultiPageAppConnectService",
"amsmultiapp/MultiAppPageConnect_Service:ActsAmsMultiAppPageConnectService",
......@@ -42,10 +44,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",
......
# 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("amsgetabilityprocessinfo") {
testonly = true
if (is_standard_system) {
deps = [ "actsprocessmanagejstest:ActsAbilityRunningInfosTest" ]
}
}
# 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("ActsAbilityRunningInfosTest") {
hap_name = "ActsAbilityRunningInfosTest"
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 hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"package": "com.example.abilityrunninginfostest",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsAbilityRunningInfosTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.abilityrunninginfostest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.abilityrunninginfostest",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.abilityrunninginfostest.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.INTERACT_ACROSS_LOCAL_ACCOUNTS"
}
],
"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('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 commonEvent from '@ohos.commonevent'
import bundle from '@ohos.bundle'
import missionManager from '@ohos.application.missionManager'
import abilityManager from '@ohos.application.AbilityManager'
import featureAbility from '@ohos.ability.featureAbility'
import appManager from '@ohos.application.AppManager'
describe('ActsAbilityRunningInfosTest', function () {
function checkRunningAbility(name, dataInfo) {
for (let i = 0, len = dataInfo.length; i < len; i++) {
if (dataInfo[i].ability.abilityName == name) {
expect(dataInfo[i].uid).assertLarger(10000);
expect(dataInfo[i].pid).assertLarger(500);
expect(dataInfo[i].startTime).assertLarger(3000);
expect(dataInfo[i].abilityState).assertLarger(0);
return true;
}
}
return false;
}
function checkRunningProcess(name, dataInfo) {
for (let i = 0, len = dataInfo.length; i < len; i++) {
if (dataInfo[i].processName == name) {
expect(dataInfo[i].uid).assertLarger(2000);
expect(dataInfo[i].pid).assertLarger(500);
return true;
}
}
return false;
}
/*
* @tc.number: ACTS_getAbilityRunningInfos_0100
* @tc.name: Application running ability information query
* @tc.desc: Verify applications are started to query getAbilityRunningInfos ability information
* (by promise)
*/
it('ACTS_getAbilityRunningInfos_0100', 0, async function (done) {
console.log('ACTS_getAbilityRunningInfos_0100====<begin');
var data = await abilityManager.getAbilityRunningInfos()
console.info('====> ACTS_getAbilityRunningInfos_0100 ====>' + JSON.stringify(data))
expect(checkRunningAbility('com.ohos.launcher.MainAbility', data)).assertTrue();
done();
})
/*
* @tc.number: ACTS_getAbilityRunningInfos_0200
* @tc.name: Application running ability information query
* @tc.desc: Verify applications are started to query getAbilityRunningInfos ability information
* (by callback)
*/
it('ACTS_getAbilityRunningInfos_0200', 0, async function (done) {
console.log('ACTS_getAbilityRunningInfos_0200====<begin');
abilityManager.getAbilityRunningInfos((err,data)=>{
console.info('====> ACTS_getAbilityRunningInfos_0200 ====>' + JSON.stringify(data))
expect(checkRunningAbility('com.ohos.launcher.MainAbility', data)).assertTrue();
done();
})
})
/*
* @tc.number: ACTS_getAbilityRunningInfos_0100
* @tc.name: Application running ability information query
* @tc.desc: Verify applications are started to query getProcessRunningInfos ability information
* (by promise)
*/
it('ACTS_getProcessRunningInfos_0100', 0, async function (done) {
console.log('ACTS_getProcessRunningInfos_0100====<begin');
var data = await appManager.getProcessRunningInfos()
console.info('====> ACTS_getProcessRunningInfos_0100 ====>' + JSON.stringify(data))
expect(checkRunningProcess('com.ohos.launcher', data)).assertTrue();
done();
})
/*
* @tc.number: ACTS_getProcessRunningInfos_0200
* @tc.name: Application running ability information query
* @tc.desc: Verify applications are started to query getProcessRunningInfos ability information
* (by callback)
*/
it('ACTS_getProcessRunningInfos_0200', 0, async function (done) {
console.log('ACTS_getProcessRunningInfos_0200====<begin');
appManager.getProcessRunningInfos((err, data) => {
console.info('====> ACTS_getProcessRunningInfos_0200 ====>' + JSON.stringify(data))
expect(checkRunningProcess('com.ohos.launcher', data)).assertTrue();
done();
})
})
})
/*
* 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('./ActsProcessManageJsTest.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")
group("amsprocessmanageapi7") {
testonly = true
if (is_standard_system) {
deps = [
"actsprocessmanagejstest:ActsAmsProcessManageJsTestApi7",
"pmsystemappa:ActsAmsProcessManageSystemAppAApi7",
"pmsystemappamulti:ActsAmsProcessManageSystemAppAMultiApi7",
"pmsystemappb:ActsAmsProcessManageSystemAppBApi7",
"pmvendorappa:ActsAmsProcessManageVendorAppAApi7",
]
}
}
# 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("ActsAmsProcessManageJsTestApi7") {
hap_name = "ActsAmsProcessManageJsTestApi7"
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": "300000",
"package": "com.acts.actsprocessmanagejstestapi7",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsAmsProcessManageJsTestApi7.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"remount"
]
},
{
"type": "PushKit",
"push": [
"ActsAmsProcessManageSystemAppAApi7.hap->/data/ActsAmsProcessManageSystemAppAApi7.hap",
"ActsAmsProcessManageSystemAppAMultiApi7.hap->/data/ActsAmsProcessManageSystemAppAMultiApi7.hap",
"ActsAmsProcessManageSystemAppBApi7.hap->/data/ActsAmsProcessManageSystemAppBApi7.hap",
"ActsAmsProcessManageVendorAppAApi7.hap->/data/ActsAmsProcessManageVendorAppAApi7.hap"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 644 /data/*.hap"
]
}
]
}
{
"app": {
"bundleName": "com.acts.actsprocessmanagejstestapi7",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.acts.actsprocessmanagejstestapi7",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.acts.actsprocessmanagejstestapi7.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"
}
],
"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('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.
*/
require('./ActsProcessManageJsTest.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("ActsAmsProcessManageSystemAppAApi7") {
hap_name = "ActsAmsProcessManageSystemAppAApi7"
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.acts.pmsystemappaapi7",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {
"default": {
"process": "com.acts.pmsystemappaapi7"
}
},
"module": {
"package": "com.acts.pmsystemappaapi7",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.acts.pmsystemappaapi7.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.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"
}
],
"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('ProcessManageSystemAppA onCreate');
},
onDestroy() {
console.info('ProcessManageSystemAppA onDestroy');
},
onShow() {
console.info('ProcessManageSystemAppA onShow');
},
onHide() {
console.info('ProcessManageSystemAppA 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;
}
<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'
import abilityManager from '@ohos.application.appManager'
import featureAbility from '@ohos.ability.featureability'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var subscribeInfo = {
events: ["event_from_ProcessManage_SystemTest",
"event_SystemAppBToSystemAppA",
"event_VendorAppAToSystemAppA",
"event_SystemAppAMultiToSystemAppA",
"event_VendorAppServiceToSystemAppA"
],
};
var publishEventName = "event_from_ProcessManage_SystemAppA";
var eventFromSystemAMulti = "event_SystemAppAMultiToSystemAppA";
var testAction;
var testTarget;
var subscriber;
var systemABundleName = "com.acts.pmsystemappaapi7";
var systemBBundleName = "com.acts.pmsystemappbapi7";
var vendorABundleName = "com.acts.pmvendorappaapi7";
var systemBAbilityName = "com.acts.pmsystemappbapi7.MainAbility";
var vendorAAbilityName = "com.acts.pmvendorappaapi7.MainAbility";
var multiAAbilityName = "com.acts.pmsystemappamultiapi7.MainAbility";
function onReceivedPublishCallBack() {
console.log("ACTS_ProcessManage SystemAppA onReceivedPublishCallBack");
}
function publishResultEvent(testResult) {
console.log("ACTS_ProcessManage SystemAppA publishResultEvent testAction:" + testAction);
console.log("ACTS_ProcessManage SystemAppA publishResultEvent testTarget:" + testTarget);
console.log("ACTS_ProcessManage SystemAppA publishResultEvent testResult:" + testResult);
let publishData = { data: testResult.toString() };
console.log("ACTS_ProcessManage SystemAppA publishResultEvent publishData:"
+ JSON.stringify(publishData));
commonEvent.publish(publishEventName, publishData, onReceivedPublishCallBack);
}
function onReceivedHandleCallback(err, data) {
publishResultEvent(data);
console.log("ACTS_ProcessManage SystemAppA onReceivedHandleCallback data:"
+ JSON.stringify(data));
}
async function onShowProcess() {
var abilityWant = await featureAbility.getWant();
console.log("ACTS_ProcessManage SystemAppA onShowProcess abilityWant:"
+ JSON.stringify(abilityWant));
testAction = abilityWant.action;
console.log("ACTS_ProcessManage SystemAppA onShowProcess testAction:" + testAction);
testTarget = abilityWant.parameters.testTarget;
console.log("ACTS_ProcessManage SystemAppA onShowProcess testTarget:" + testTarget);
if (testTarget == systemABundleName) {
if (testAction == "promiseKill") {
console.log("ACTS_ProcessManage SystemAppA onShowProcess testAction:" + testAction);
var result = await abilityManager.killProcessesByBundleName(testTarget);
console.log("ACTS_ProcessManage SystemAppA onShowProcess result:" + result);
publishResultEvent(result);
} else if (testAction == "asyncKill") {
console.log("ACTS_ProcessManage SystemAppA onShowProcess testAction:" + testAction);
abilityManager.killProcessesByBundleName(testTarget, onReceivedHandleCallback);
} else if (testAction == "promiseCleanup") {
console.log("ACTS_ProcessManage SystemAppA onShowProcess testAction:" + testAction);
var result = await abilityManager.clearUpApplicationData(testTarget);
console.log("ACTS_ProcessManage SystemAppA onShowProcess result:" + result);
publishResultEvent(result);
} else if (testAction == "asyncCleanup") {
console.log("ACTS_ProcessManage SystemAppA onShowProcess testAction:" + testAction);
abilityManager.clearUpApplicationData(testTarget, onReceivedHandleCallback);
}
}
else {
try {
subscriber = await commonEvent.createSubscriber(subscribeInfo)
console.debug("ACTS_ProcessManage SystemAppA onShowProcess subscriber:"
+ JSON.stringify(subscriber));
commonEvent.subscribe(subscriber, subscribeCallBack);
} catch (err) {
console.debug("ACTS_ProcessManage SystemAppA onShowProcess err:" + err);
}
if (testTarget == systemBBundleName) {
await featureAbility.startAbility(
{
want:
{
bundleName: systemBBundleName,
abilityName: systemBAbilityName,
},
}
);
}
else if (testTarget == vendorABundleName) {
await featureAbility.startAbility(
{
want:
{
bundleName: vendorABundleName,
abilityName: vendorAAbilityName,
},
}
);
}
else if (testTarget == multiAAbilityName) {
await featureAbility.startAbility(
{
want:
{
bundleName: systemABundleName,
abilityName: multiAAbilityName,
},
}
);
}
}
async function subscribeCallBack(err, data) {
console.debug("ACTS_ProcessManage SystemAppA subscribeCallBack SubscribeCallBack data:====>"
+ JSON.stringify(data));
console.debug("ACTS_ProcessManage SystemAppA subscribeCallBack SubscribeCallBack data.event:====>"
+ JSON.stringify(data.event));
if (data.event == eventFromSystemAMulti) {
testTarget = systemABundleName;
}
if (testAction == "promiseKill") {
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack testAction:" + testAction);
var result = await abilityManager.killProcessesByBundleName(testTarget);
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack result:" + result);
publishResultEvent(result);
} else if (testAction == "asyncKill") {
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack testAction:" + testAction);
await abilityManager.killProcessesByBundleName(testTarget, onReceivedHandleCallback);
} else if (testAction == "promiseCleanup") {
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack testAction:" + testAction);
var result = await abilityManager.clearUpApplicationData(testTarget);
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack result:" + result);
publishResultEvent(result);
} else if (testAction == "asyncCleanup") {
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack testAction:" + testAction);
await abilityManager.clearUpApplicationData(testTarget, onReceivedHandleCallback);
} else if (testAction == "promiseCleanupTentimes") {
for (var i = 0; i < 10; i++) {
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack testAction:" + testAction);
var result = await abilityManager.clearUpApplicationData(testTarget);
console.log("ACTS_ProcessManage SystemAppA subscribeCallBack result:" + result);
}
publishResultEvent(result);
}
}
}
export default {
data: {
title: ""
},
onInit() {
console.info('ACTS_ProcessManage SystemAppA onInit');
this.title = "ProcessManageSystemAppA";
},
onReady() {
console.info('ACTS_ProcessManage SystemAppA onReady');
onShowProcess();
},
onActive() {
console.info('ACTS_ProcessManage SystemAppA onActive');
},
onShow() {
console.info('ACTS_ProcessManage SystemAppA onShow');
},
onInactive() {
console.info('ACTS_ProcessManage SystemAppA onInactive');
},
onHide() {
console.info('ACTS_ProcessManage SystemAppA onHide');
},
onDestroy() {
console.info('ACTS_ProcessManage SystemAppA onDestroy');
},
onBackPress() {
console.info('ACTS_ProcessManage SystemAppA onBackPress');
},
onNewRequest() {
console.info('ACTS_ProcessManage SystemAppA onNewRequest');
},
onStartContinuation() {
console.info('ACTS_ProcessManage SystemAppA onStartContinuation');
},
onSaveData(value) {
console.info('ACTS_ProcessManage SystemAppA onSaveData:' + JSON.stringify(value));
},
onRestoreData(value) {
console.info('ACTS_ProcessManage SystemAppA onRestoreData:' + JSON.stringify(value));
},
onCompleteContinuation(code) {
console.info('ACTS_ProcessManage SystemAppA onCompleteContinuation:' + JSON.stringify(code));
},
onConfigurationUpdated(configuration) {
console.info('ACTS_ProcessManage SystemAppA 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")
ohos_hap("ActsAmsProcessManageSystemAppAMultiApi7") {
hap_name = "ActsAmsProcessManageSystemAppAMultiApi7"
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.acts.pmsystemappaapi7",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {
"default": {
"process": "com.acts.pmsystemappamultiapi7"
}
},
"module": {
"package": "com.acts.pmsystemappamultiapi7",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "secondEntry",
"moduleType": "feature"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.acts.pmsystemappamultiapi7.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.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"
}
],
"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');
}
};
{
"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 commonEvent from '@ohos.commonevent'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var publishEventName = "event_SystemAppAMultiToSystemAppA";
function onReceivedPublishCallBack() {
console.log("ACTS_ProcessManage SystemAppAMulti onReceivedPublishCallBack");
}
export default {
data: {
title: ""
},
onInit() {
console.info('ACTS_ProcessManage SystemAppAMulti onInit');
this.title = "ACTS_ProcessManage SystemAppAMulti";
},
onReady() {
console.info('ACTS_ProcessManage SystemAppAMulti onReady');
commonEvent.publish(publishEventName,onReceivedPublishCallBack);
},
onActive() {
console.info('ACTS_ProcessManage SystemAppAMulti onActive');
},
onShow() {
console.info('ACTS_ProcessManage SystemAppAMulti onShow');
},
onInactive() {
console.info('ACTS_ProcessManage SystemAppAMulti onInactive');
},
onHide() {
console.info('ACTS_ProcessManage SystemAppAMulti onHide');
},
onDestroy() {
console.info('ACTS_ProcessManage SystemAppAMulti onDestroy');
},
onBackPress() {
console.info('ACTS_ProcessManage SystemAppAMulti onBackPress');
},
onNewRequest() {
console.info('ACTS_ProcessManage SystemAppAMulti onNewRequest');
},
onStartContinuation() {
console.info('ACTS_ProcessManage SystemAppAMulti onStartContinuation');
},
onSaveData(value) {
console.info('ACTS_ProcessManage SystemAppAMulti onSaveData:' + JSON.stringify(value));
},
onRestoreData(value) {
console.info('ACTS_ProcessManage SystemAppAMulti onRestoreData:' + JSON.stringify(value));
},
onCompleteContinuation(code) {
console.info('ACTS_ProcessManage SystemAppAMulti onCompleteContinuation:' + JSON.stringify(code));
},
onConfigurationUpdated(configuration) {
console.info('ACTS_ProcessManage SystemAppAMulti 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")
ohos_hap("ActsAmsProcessManageSystemAppBApi7") {
hap_name = "ActsAmsProcessManageSystemAppBApi7"
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.acts.pmsystemappbapi7",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.acts.pmsystemappbapi7",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.acts.pmsystemappbapi7.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.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
}
],
"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');
}
};
{
"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 commonEvent from '@ohos.commonevent'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var publishEventName = "event_SystemAppBToSystemAppA";
function onReceivedPublishCallBack() {
console.log("ACTS_ProcessManage SystemAppB onReceivedPublishCallBack");
}
export default {
data: {
title: ""
},
onInit() {
console.info('ACTS_ProcessManage SystemAppB onInit');
this.title = "ACTS_ProcessManage SystemAppB";
},
onReady() {
console.info('ACTS_ProcessManage SystemAppB onReady');
commonEvent.publish(publishEventName,onReceivedPublishCallBack);
},
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")
ohos_hap("ActsAmsProcessManageVendorAppAApi7") {
hap_name = "ActsAmsProcessManageVendorAppAApi7"
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.acts.pmvendorappaapi7",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.acts.pmvendorappaapi7",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.acts.pmvendorappaapi7.MainAbility",
"visible": true,
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
}
],
"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('ProcessManageVendorAppA onCreate');
},
onDestroy() {
console.info('ProcessManageVendorAppA onDestroy');
},
onShow() {
console.info('ProcessManageVendorAppA onShow');
},
onHide() {
console.info('ProcessManageVendorAppA 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;
}
<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'
// import abilityManager from '@ohos.app.abilityManager'
import abilityManager from '@ohos.application.appManager'
import featureAbility from '@ohos.ability.featureability'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var publishEventName = "event_VendorAppAToSystemAppA";
var publishEventNameVendor = "event_from_ProcessManage_VendorAppA";
var testAction;
var testTarget;
function onReceivedPublishCallBack() {
console.log("ACTS_ProcessManage VendorAppA onReceivedPublishCallBack");
}
function onReceivedHandleCallback(err, data) {
console.log("ACTS_ProcessManage VendorAppA onReceivedHandleCallback JSON.stringify data:"
+ JSON.stringify(data));
console.log("ACTS_ProcessManage VendorAppA onReceivedHandleCallback data:"
+ data);
console.log("ACTS_ProcessManage VendorAppA onReceivedHandleCallback err:"
+ err);
commonEvent.publish(publishEventNameVendor,onReceivedPublishCallBack);
}
export default {
data: {
title: ""
},
onInit() {
console.info('ACTS_ProcessManage VendorAppA onInit');
this.title = "ACTS_ProcessManage VendorAppA";
},
async onReady() {
console.info('ACTS_ProcessManage VendorAppA onReady');
var abilityWant = await featureAbility.getWant();
console.log("ACTS_ProcessManage VendorAppA onShow abilityWant:"
+ JSON.stringify(abilityWant));
testAction = abilityWant.action;
console.log("ACTS_ProcessManage VendorAppA onShow testAction:" + testAction);
testTarget = abilityWant.parameters.testTarget;
console.log("ACTS_ProcessManage VendorAppA onShow testTarget:" + testTarget);
if (testAction == 'thirdpartykill') {
console.log("ACTS_ProcessManage VendorAppA onForeground testAction:" + testAction);
appManager.killProcessesByBundleName(testTarget, onReceivedHandleCallback);
}
if (testAction == 'thirdpartyclear') {
console.log("ACTS_ProcessManage VendorAppA onForeground testAction:" + testAction);
appManager.clearUpApplicationData(testTarget, onReceivedHandleCallback);
}
else{
commonEvent.publish(publishEventName, onReceivedPublishCallBack);
}
},
onActive() {
console.info('ACTS_ProcessManage VendorAppA onActive');
},
onShow() {
console.info('ACTS_ProcessManage VendorAppA onShow');
},
onInactive() {
console.info('ACTS_ProcessManage VendorAppA onInactive');
},
onHide() {
console.info('ACTS_ProcessManage VendorAppA onHide');
},
onDestroy() {
console.info('ACTS_ProcessManage VendorAppA onDestroy');
},
onBackPress() {
console.info('ACTS_ProcessManage VendorAppA onBackPress');
},
onNewRequest() {
console.info('ACTS_ProcessManage VendorAppA onNewRequest');
},
onStartContinuation() {
console.info('ACTS_ProcessManage VendorAppA onStartContinuation');
},
onSaveData(value) {
console.info('ACTS_ProcessManage VendorAppA onSaveData:' + JSON.stringify(value));
},
onRestoreData(value) {
console.info('ACTS_ProcessManage VendorAppA onRestoreData:' + JSON.stringify(value));
},
onCompleteContinuation(code) {
console.info('ACTS_ProcessManage VendorAppA onCompleteContinuation:' + JSON.stringify(code));
},
onConfigurationUpdated(configuration) {
console.info('ACTS_ProcessManage VendorAppA onConfigurationUpdated:' + JSON.stringify(configuration));
}
}
{
"string": [
{
"name": "app_name",
"value": "particlestartability"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册