提交 2b55e6bf 编写于 作者: C chengxingzhen

XTSAPI拆分3.1release

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 e3851ff2
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
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) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./ActsKillProcessTest.test.js')
\ No newline at end of file
# Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
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) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('ProcessManageSystemAppB onCreate');
},
onDestroy() {
console.info('ProcessManageSystemAppB onDestroy');
},
onShow() {
console.info('ProcessManageSystemAppB onShow');
},
onHide() {
console.info('ProcessManageSystemAppB onHide');
}
};
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
group("ActsKillProcessWithAccountApi7") {
testonly = true
if (is_standard_system) {
deps = [
"ActsKillProcessWithAccountApi7Test:ActsKillProcessWithAccountApi7Test",
"ActsKillProcessWithAccountCloseApi7:ActsKillProcessWithAccountCloseApi7",
]
}
}
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
......@@ -17,45 +17,21 @@ group("aafwk_standard") {
testonly = true
if (is_standard_system) {
deps = [
"ActsAbilityDelegatorCaseTest:ActsAbilityDelegatorCaseTest",
"ActsAbilityLifecycleStateNewTest:ActsAbilityLifecycleStateNewTest",
"ActsDataAbilityJsTest:ActsDataAbilityJsTest",
"ActsKillProcessWithAccountApi7:ActsKillProcessWithAccountApi7",
"ActsStServiceAbilityClientCaseTest:ActsStServiceAbilityClientCaseTest",
"abilitymanager:actsabilitymanagertest",
"actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest",
"actsabilitydistributetest:ActsAbilityDistributeTest",
"actsabilitylifecyclestatenew:ActsAbilityLifecycleStateNewTest",
"actsabilitymanageretstest:ActsAbilityManagerEtsTest",
"actsdataabilityjs:ActsDataAbilityJsTest",
"actsstserviceabilityclientcase:ActsStServiceAbilityClientCaseTest",
"amsabilitymanager/amsMissionSnapshotTest:ActsAmsMissionSnapshotTest",
"amsabilitymanager/amsMissionSnapshotTestSingleton:ActsAmsMissionSnapshotTestSingleton",
"amsabilitymanager/amsMissionSnapshotTestSingletonS:ActsAmsMissionSnapshotTestSingletonS",
"amsdatauriutils:ActsAmsDataUriUtilsTest",
"amsgetabilityprocessinfo:amsgetabilityprocessinfo",
"amsmultiapp/MultiAppPage:ActsAmsMultiPageApp",
"amsmultiapp/MultiAppPageConnectService:ActsAmsMultiPageAppConnectService",
"amsmultiapp/MultiAppPageConnect_Service:ActsAmsMultiAppPageConnectService",
"amsmultiapp/MultiAppPagePermission:ActsAmsMultiPageAppPermission",
"amsmultiapp/MultiAppPagePermission_Page:ActsAmsMultiAppPagePermission",
"amsmultiapp/MultiAppPage_PSS:ActsAmsMultiPageAppS",
"amsmultiapp/MultiAppPage_Page:ActsAmsMultiAppPage",
"amsmultiapp/MultiAppPage_Service:ActsAmsMultiAppPageService",
"amsmultiapp/MultiAppSimultaneousOnline:ActsAmsMultiAppSimultaneousOnline",
"amsmultiapp/MultiAppSimultaneousOnline_test:ActsAmsMultiAppPageClone",
"amsmultiapp/MultiAppTermination:ActsAmsMultiAppTermination",
"amsmultiapp/MultiAppTermination_test:ActsAmsMultiAppPageCloneTermination",
"amsmultiapp/amsmultiapppageexecutor:ActsAmsMultiAppPageExecutor",
"amsmultiapp/amsmultiappserviceexecutor:ActsAmsMultiAppServiceExecutor",
"amsmultiapp/amsmultiappservicestarter:ActsAmsMultiAppServiceStarter",
"amsmultiapp/amsmultiapptester:ActsAmsMultiAppTester",
"amsmultiapp/amsmultidataabilityclone:ActsAmsMultiDataAbilityClone",
"amsmultiapp/amsmultidataabilityself:ActsAmsMultiDataAbilitySelf",
"amsprocessmanageapi7:amsprocessmanageapi7",
"context:context",
"featureability:featureability",
"formmanager:formmanager",
# "lanuageConfigapi7:lanuageConfigapi7",
"serviceability/sceneProject/particlestartability:ParticleStartAbility",
"serviceability/sceneProject/particletestserver:ParticleTestServer",
"serviceability/stserviceabilityserver:amsStServiceAilityServer",
"serviceability/stserviceabilityserversecond:ActsAmsStServiceAilityServerSecondTest",
"setshowonlockscreen:setshowonlockscreen",
"want:want",
]
......
......@@ -18,7 +18,7 @@ group("actsabilitymanagertest") {
if (is_standard_system) {
deps = [
"actsamscallbackfifthscene:ActsAmsCallBackFifthSceneTest",
# "actsamscallbackfirstscene:ActsAmsCallBackFirstSceneTest",
"actsamscallbackfirstscene:ActsAmsCallBackFirstSceneTest",
"actsamscallbackfourthscene:ActsAmsCallBackFourthSceneTest",
"actsamscallbacksecondscene:ActsAmsCallBackSecondSceneTest",
"actsamscallbackthirdscene:ActsAmsCallBackThirdSceneTest",
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......@@ -32,7 +32,7 @@ export default {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
id: 'extend'
})
core.addService('expect', expectExtend)
core.init()
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -26,7 +26,7 @@ var abilityNameList = [
"com.example.actsamscallbackfifthscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -42,10 +42,10 @@ var bundleNameList = [
describe('ActsAmsCallBackFifthScene', function () {
console.info('----ActsAmsCallBackFifthScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackFifthScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbackfifthscene') {
console.log("ActsAmsCallBackFifthScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -117,7 +117,7 @@ describe('ActsAmsCallBackFifthScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -140,7 +140,7 @@ describe('ActsAmsCallBackFifthScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_6600 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -165,14 +165,14 @@ describe('ActsAmsCallBackFifthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_7000', 0, async function (done) {
var maxnum = 10;
let maxnum = 10;
missionManager.getMissionInfos("", maxnum,
(error, data) => {
console.info('Acts_Ams_test_7000 getMissionInfos error.code : \
' + error.code + ',data length [' + data.length + ']');
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
console.info('Acts_Ams_test_7000 getMissionInfos data[' + i + "]: " + JSON.stringify(data[i]));
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -201,9 +201,9 @@ describe('ActsAmsCallBackFifthScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_7600', 0, async function (done) {
var maxnum = 10;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 10;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_7600 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[0].missionId,
......@@ -216,22 +216,4 @@ describe('ActsAmsCallBackFifthScene', function () {
);
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8000
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_8000', 0, async function (done) {
appManager.killProcessesByBundleName('com.ix.verify.io',
(error, info) => {
console.info('Acts_Ams_test_8000 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
}
);
setTimeout(timeout, 5000);
})
})
\ No newline at end of file
......@@ -12,16 +12,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -154,21 +154,6 @@ describe('ActsAmsCallBackFirstScene', function () {
});
})
/*
* @tc.number : Acts_Ams_test_1600
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_1600', 0, async function (done) {
appManager.killProcessesByBundleName('com.ix.simulate.feature',
(error, info) => {
console.info('Acts_Ams_test_1600 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(error.code).assertEqual(0);
done();
});
})
/*
* @tc.number : Acts_Ams_test_1200
* @tc.name : moveMissionToFront : Move Mission To Top
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -27,7 +27,7 @@ var abilityNameList = [
"com.example.actsamscallbackfourthscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -45,10 +45,10 @@ var bundleNameList = [
describe('ActsAmsCallBackFourthScene', function () {
console.info('----ActsAmsCallBackFourthScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackFourthScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbackfourthscene') {
console.log("ActsAmsCallBackFourthScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -137,7 +137,7 @@ describe('ActsAmsCallBackFourthScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -160,7 +160,7 @@ describe('ActsAmsCallBackFourthScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_5000 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -183,14 +183,14 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_5400', 0, async function (done) {
var maxnum = 100;
let maxnum = 100;
missionManager.getMissionInfos("", maxnum,
(error, data) => {
console.info('Acts_Ams_test_5400 getMissionInfos error.code : \
' + error.code + ',data length [' + data.length + ']');
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
console.info('Acts_Ams_test_5400 getMissionInfos data[' + i + "]: " + JSON.stringify(data[i]));
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -217,10 +217,10 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_5600', 0, async function (done) {
var maxnum = 30;
var result = await missionManager.getMissionInfos("", maxnum);
let maxnum = 30;
let result = await missionManager.getMissionInfos("", maxnum);
let id = 0;
for (var i = 0; i < result.length; i++) {
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_5600 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
if (result[i].want.abilityName != 'com.example.actsamscallbackfourthscene.MainAbility' &&
result[i].runningState == 0) {
......@@ -244,9 +244,9 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_6000', 0, async function (done) {
var maxnum = 30;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 30;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_6000 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[1].missionId,
......@@ -258,35 +258,20 @@ describe('ActsAmsCallBackFourthScene', function () {
});
})
/*
* @tc.number : Acts_Ams_test_6400
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_6400', 0, async function (done) {
appManager.killProcessesByBundleName('xxxxxxxxx',
(error) => {
console.info('Acts_Ams_test_6400 killProcessesByBundleName error.code ' + error.code);
expect(error.code).assertEqual(2097215);
done();
});
})
/*
* @tc.number : Acts_Ams_test_11900
* @tc.name : clearMissions : delete Missions
* @tc.desc : delete Missions(by CallBack)
*/
it('Acts_Ams_test_11900', 0, async function (done) {
var maxnum = 30;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_11900 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
let maxnum = 30;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.clearAllMissions(
(error, info) => {
console.info('Acts_Ams_test_11900 clearAllMissions error.code: \
' + error.code + ',data [' + info + ']');
console.info('clearAllMissions error.code: \ ' + error.code + ',data [' + info + ']');
expect(error.code).assertEqual(0);
done();
});
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -25,7 +25,7 @@ var abilityNameList = [
"com.example.actsamscallbacksecondscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -41,10 +41,10 @@ var bundleNameList = [
describe('ActsAmsCallBackSecondScene', function () {
console.info('----ActsAmsCallBackSecondScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackSecondScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbacksecondscene') {
console.log("ActsAmsCallBackSecondScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -99,7 +99,7 @@ describe('ActsAmsCallBackSecondScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -122,7 +122,7 @@ describe('ActsAmsCallBackSecondScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_1800 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -145,14 +145,14 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Query Running Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_2000', 0, async function (done) {
var maxnum = 20;
let maxnum = 20;
missionManager.getMissionInfos("", maxnum,
(error, info) => {
console.info('Acts_Ams_test_2000 getMissionInfos error.code : \
' + error.code + ',data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_2000 getMissionInfos data[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -179,9 +179,9 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_2400', 0, async function (done) {
var maxnum = 20;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 20;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_2400 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.clearMission(result[1].missionId,
......@@ -199,9 +199,9 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_2800', 0, async function (done) {
var maxnum = 20;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 20;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_2800 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[0].missionId,
......@@ -212,19 +212,4 @@ describe('ActsAmsCallBackSecondScene', function () {
done();
});
})
/*
* @tc.number : Acts_Ams_test_3200
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_3200', 0, async function (done) {
appManager.killProcessesByBundleName('XXXXXXXXXXXX',
(error, info) => {
console.info('Acts_Ams_test_3200 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(error.code).assertEqual(2097215);
done();
});
})
})
\ No newline at end of file
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -25,7 +25,7 @@ var abilityNameList = [
"com.example.actsamscallbackthirdscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -40,10 +40,10 @@ var bundleNameList = [
describe('ActsAmsCallBackThirdScene', function () {
console.info('----ActsAmsCallBackThirdScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsCallBackThirdScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamscallbackthirdscene') {
console.log("ActsAmsCallBackThirdScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -92,7 +92,7 @@ describe('ActsAmsCallBackThirdScene', function () {
});
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -115,7 +115,7 @@ describe('ActsAmsCallBackThirdScene', function () {
' + error.code + ', data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_3400 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -138,14 +138,14 @@ describe('ActsAmsCallBackThirdScene', function () {
* @tc.desc : Query Running Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_3600', 0, async function (done) {
var maxnum = 20;
let maxnum = 20;
missionManager.getMissionInfos("", maxnum,
(error, info) => {
console.info('Acts_Ams_test_3600 getMissionInfos error.code : \
' + error.code + ',data length [' + info.length + ']');
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_3600 getMissionInfos info[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -172,9 +172,9 @@ describe('ActsAmsCallBackThirdScene', function () {
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_4400', 0, async function (done) {
var maxnum = 20;
var result = await missionManager.getMissionInfos("", maxnum);
for (var i = 0; i < result.length; i++) {
let maxnum = 20;
let result = await missionManager.getMissionInfos("", maxnum);
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_4400 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
missionManager.moveMissionToFront(result[0].missionId,
......@@ -186,21 +186,4 @@ describe('ActsAmsCallBackThirdScene', function () {
}
);
})
/*
* @tc.number : Acts_Ams_test_4800
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_4800', 0, async function (done) {
appManager.killProcessesByBundleName('xxxxxxxxxxx',
(error, info) => {
console.info('Acts_Ams_test_4800 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(error.code).assertEqual(2097215);
done();
}
);
done();
})
})
\ No newline at end of file
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ import missionManager from '@ohos.application.missionManager'
import appManager from "@ohos.application.appManager"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
var abilityNameList = [
let abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
......@@ -26,7 +26,7 @@ var abilityNameList = [
"com.example.actsamstestfifthscene.MainAbility"
]
var bundleNameList = [
let bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
......@@ -42,10 +42,10 @@ var bundleNameList = [
describe('ActsAmsTestFifthScene', function () {
console.info('----ActsAmsTestFifthScene----');
beforeAll(async function (done) {
var maxnum = 10;
var data = await missionManager.getMissionInfos("", maxnum);
let maxnum = 10;
let data = await missionManager.getMissionInfos("", maxnum);
console.log('ActsAmsTestFifthScene beforeAll getMissionInfos data: ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
if (data[i].want.bundleName != 'com.example.actsamstestfifthscene') {
console.log("ActsAmsTestFifthScene, missionId: " + data[i].missionId)
missionManager.clearMission(data[i].missionId,
......@@ -132,7 +132,7 @@ describe('ActsAmsTestFifthScene', function () {
}
function sleep(delay) {
var start = new Date().getTime();
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
......@@ -149,10 +149,10 @@ describe('ActsAmsTestFifthScene', function () {
console.info("sleep begin");
sleep(5000);
console.info("sleep end");
var info = await appManager.getProcessRunningInfos();
let info = await appManager.getProcessRunningInfos();
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertLarger(0);
for (var i = 0; i < info.length; i++) {
for (let i = 0; i < info.length; i++) {
console.info('Acts_Ams_test_0100 getProcessRunningInfo[' + i + "]: " + JSON.stringify(info[i]));
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -175,14 +175,14 @@ describe('ActsAmsTestFifthScene', function () {
*/
it('Acts_Ams_test_1100', 0, async function (done) {
console.log('Acts_Ams_test_1100 begin');
var maxnum = 10;
var result = await missionManager.getMissionInfos("", maxnum).catch(err => {
let maxnum = 10;
let result = await missionManager.getMissionInfos("", maxnum).catch(err => {
console.log('Acts_Ams_test_1100 getMissionInfos failed: ' + err);
});
for (var i = 0; i < result.length; i++) {
for (let i = 0; i < result.length; i++) {
console.info('Acts_Ams_test_1100 getMissionInfos result[' + i + "]: " + JSON.stringify(result[i]));
}
var info = await missionManager.moveMissionToFront(result[0].missionId).catch(err => {
let info = await missionManager.moveMissionToFront(result[0].missionId).catch(err => {
console.log('Acts_Ams_test_1100 moveMissionToFront failed: ' + err);
expect(err).assertEqual(0);
});
......@@ -196,12 +196,12 @@ describe('ActsAmsTestFifthScene', function () {
* @tc.desc : Query Running Ability Mission Infos(by Promise)
*/
it('Acts_Ams_test_0300', 0, async function (done) {
var maxnum = 10;
let maxnum = 10;
await missionManager.getMissionInfos("", maxnum).then(data => {
console.info('Acts_Ams_test_0300 getMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
console.info('Acts_Ams_test_0300 getMissionInfos data[' + i + "]: " + JSON.stringify(data[i]));
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -224,21 +224,4 @@ describe('ActsAmsTestFifthScene', function () {
console.log('Acts_Ams_test_0300 getMissionInfos failed: ' + err);
});
})
/*
* @tc.number : Acts_Ams_test_1500
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_1500', 0, async function (done) {
console.info('Acts_test_1500 killProcessesByBundleName data');
appManager.killProcessesByBundleName('com.ix.simulate.feature').then(data => {
console.log('Acts_test_1500 success: ' + data);
done();
}).catch(err => {
console.log('Acts_test_1500 failed: ' + err.code);
expect(err.code).assertEqual(2097182);
done();
});
})
})
\ No newline at end of file
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -169,16 +169,4 @@ describe('ActsAmsTestFirstScene', function () {
}
done();
})
/*
* @tc.number : Acts_Ams_test_1500
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_1500', 0, async function (done) {
var info = await appManager.killProcessesByBundleName('com.ix.simulate.feature');
console.info('Acts_Ams_test_1500 killProcessesByBundleName data [' + info + ']');
expect(info).assertEqual(0);
done();
})
})
\ No newline at end of file
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -193,20 +193,4 @@ describe('ActsAmsTestSecondScene', function () {
}
done();
})
/*
* @tc.number : Acts_Ams_test_3100
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_3100', 0, async function (done) {
console.info('Acts_test_3100 killProcessesByBundleName data');
appManager.killProcessesByBundleName('XXXXXXXXXXXX').then(data => {
console.log('Acts_test_3100 success: ' + data);
}).catch(err => {
console.log('Acts_test_3100 failed: ' + err.code);
expect(err.code).assertEqual(2097215);
done();
});
})
})
\ No newline at end of file
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -195,20 +195,4 @@ describe('ActsAmsTestThirdScene', function () {
console.info('Acts_Ams_test_4300 moveMissionToFront data [' + info + ']');
done();
})
/*
* @tc.number : Acts_Ams_test_4700
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_4700', 0, async function (done) {
console.info('Acts_test_4700 killProcessesByBundleName data');
appManager.killProcessesByBundleName('XXXXXXXX').then(data => {
console.log('Acts_test_4700 success: ' + data);
}).catch(err => {
console.log('Acts_test_4700 failed: ' + err.code);
expect(err.code).assertEqual(2097215);
done();
});
})
})
\ No newline at end of file
......@@ -17,10 +17,10 @@ import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,10 +17,10 @@ import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
var once = true
let once = true
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -18,7 +18,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -17,7 +17,7 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
......
......@@ -268,7 +268,7 @@ describe('ActsStServiceAbilityTest', function () {
done();
}
var context = featureAbility.getContext()
var result = context.getDisplayOrientation().then((data) => {
var result = await context.getDisplayOrientation().then((data) => {
clearTimeout(currentAlertTimeout);
console.debug("ACTS_AGetDisplayOrientation_0200====DisplayOrientation>"
+ JSON.stringify(DisplayOrientation) + " , err= " + err);
......
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
......@@ -10,25 +10,22 @@
# 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("ParticleTestServer") {
ohos_js_hap_suite("ActsAbilityDistributeTest") {
hap_profile = "./src/main/config.json"
hap_name = "ParticleTestServer"
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",
":hjs_demo_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAbilityDistributeTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/js/resources" ]
ohos_resources("hjs_demo_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"app": {
"bundleName": "com.example.particlestartability",
"bundleName": "com.example.actsabilitydistributetest",
"vendor": "example",
"version": {
"code": 1,
......@@ -8,13 +8,12 @@
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "com.example.particlestartability",
"package": "com.example.actsabilitydistributetest",
"name": ".MyApplication",
"deviceType": [
"phone"
......@@ -26,6 +25,7 @@
},
"abilities": [
{
"visible": true,
"skills": [
{
"entities": [
......@@ -36,8 +36,7 @@
]
}
],
"name": "com.example.particlestartability.MainAbility",
"visible": true,
"name": "com.example.actsabilitydistributetest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
......@@ -80,4 +79,4 @@
}
]
}
}
\ No newline at end of file
}
......@@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
......
{
"strings": {
"hello": "Hello",
"world": "OpenHarmony"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "鸿蒙OS"
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
......@@ -20,17 +20,16 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
title: ''
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
id: 'extend'
})
core.addService('expect', expectExtend)
core.init()
......@@ -38,11 +37,10 @@ export default {
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
require('../../test/List.test')
core.execute()
},
onReady() {
console.info('onReady');
},
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// @ts-nocheck
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import abilityFeatureAbility from '@ohos.ability.featureAbility'
var timeSleep = 3000;
describe('DistributedTest', function(){
function sleep(time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
/**
* @tc.number SUB_AA_OpenHarmony_ContinueAbility_0300
* @tc.name testContinueAbility0300
* @tc.desc T
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it('testContinueAbility0300', 0, async function (done) {
console.log('testContinueAbility0300 run start');
abilityFeatureAbility.continueAbility(undefined, (err, data) => {
console.log('testContinueAbility0300 err is :' + JSON.stringify(err) + ', value is :'
+ JSON.stringify(data));
})
await sleep(timeSleep);
console.log('testContinueAbility0300 run end');
done();
})
/**
* @tc.number SUB_AA_OpenHarmony_ContinueAbility_0400
* @tc.name testContinueAbility0200
* @tc.desc T
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it('testContinueAbility0400', 0, async function (done) {
console.log('testContinueAbility0400 run start');
abilityFeatureAbility.continueAbility("", (err, data) => {
console.log('testContinueAbility0400 err is :' + JSON.stringify(err) + ', value is :'
+ JSON.stringify(data));
})
await sleep(timeSleep);
console.log('testContinueAbility0400 run end');
done();
})
/**
* @tc.number SUB_AA_OpenHarmony_ContinueAbility_0500
* @tc.name testContinueAbility0500
* @tc.desc T
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it('testContinueAbility0500', 0, async function (done) {
let options = {
deviceId : undefined,
reversible : false,
}
console.log('testContinueAbility0500 run start');
abilityFeatureAbility.continueAbility(options, (err, data) => {
console.log('testContinueAbility0500 err is :' + JSON.stringify(err) + ', value is :'
+ JSON.stringify(data));
})
await sleep(timeSleep);
console.log('testContinueAbility0500 run end');
done();
})
/**
* @tc.number SUB_AA_OpenHarmony_ContinueAbility_0600
* @tc.name testContinueAbility0600
* @tc.desc T
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it('testContinueAbility0600', 0, async function (done) {
let options = {
deviceId : "",
reversible : false,
}
console.log('testContinueAbility0600 run start');
abilityFeatureAbility.continueAbility(options, (err, data) => {
console.log('testContinueAbility0600 err is :' + JSON.stringify(err) + ', value is :'
+ JSON.stringify(data));
})
await sleep(timeSleep);
console.log('testContinueAbility0600 run end');
done();
})
/**
* @tc.number SUB_AA_OpenHarmony_ContinueAbility_0700
* @tc.name testContinueAbility0700
* @tc.desc T
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it('testContinueAbility0700', 0, async function (done) {
let options = {
reversible : false,
}
console.log('testContinueAbility0700 run start');
abilityFeatureAbility.continueAbility(options, (err, data) => {
console.log('testContinueAbility0700 err is :' + JSON.stringify(err) + ', value is :'
+ JSON.stringify(data));
})
await sleep(timeSleep);
console.log('testContinueAbility0700 run end');
done();
})
/**
* @tc.number SUB_AA_OpenHarmony_ContinueAbility_0900
* @tc.name testContinueAbility0900
* @tc.desc T
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it('testContinueAbility0900', 0, async function (done) {
let options = {
deviceId : "2BB6F91131F74C1174904195FE72B6068F8F82280F6CE93BDFE0EFF9B37F9DD26",
reversible : false,
}
console.log('testContinueAbility0900 run start');
abilityFeatureAbility.continueAbility(options, (err, data) => {
console.log('testContinueAbility0900 err is :' + JSON.stringify(err) + ', value is :'
+ JSON.stringify(data));
})
await sleep(timeSleep);
console.log('testContinueAbility0900 run end');
done();
})
/**
* @tc.number SUB_AA_OpenHarmony_ContinueAbility_1000
* @tc.name testContinueAbility0900
* @tc.desc T
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it('testContinueAbility1000', 0, async function (done) {
let options = {
deviceId : "2BB6F91131F74C1174904195FE72B6068F8F82280F6CE93BDFE0EFF9B37F9DD26",
reversible : false,
}
for(var i = 0; i < 10; i++) {
abilityFeatureAbility.continueAbility(options, (err, data) => {
console.log('testContinueAbility1000 err is :' + JSON.stringify(err) + ', value is :'
+ JSON.stringify(data));
})
}
await sleep(timeSleep);
console.log('testContinueAbility1000 run end');
done();
})
})
\ No newline at end of file
......@@ -12,4 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./MultiDataAbilityJsSt.test.js')
\ No newline at end of file
require('./FeatureAbilityDistribute.test.js')
......@@ -2,7 +2,7 @@
"string": [
{
"name": "app_name",
"value": "STDataAbility"
"value": "StartupJSApiTest"
},
{
"name": "mainability_description",
......
......@@ -12,161 +12,47 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import testsuite2 from "../test/List.test.ets";
import file from '@system.file';
import {Core, ExpectExtend, ReportExtend} from "deccjsunit/index.ets";
import testsuite from "../test/List.test.ets";
import featureAbility from "@ohos.ability.featureAbility";
async function startService2() {
var str = {
"want": {
"bundleName": "com.ohos.acecollaboration",
"abilityName": "com.ohos.acecollaboration.ServiceAbility2",
},
};
var data = featureAbility.startAbility(str);
console.info('particleAbility_connectAbility_test_0100 startAbility succeeded: ' + JSON.stringify(data));
}
async function startService3() {
var str = {
"want": {
"bundleName": "com.ohos.acecollaboration",
"abilityName": "com.ohos.acecollaboration.ServiceAbility3",
},
};
var data = featureAbility.startAbility(str);
console.info('particleAbility_connectAbility_test_0200 startAbility succeeded: ' + JSON.stringify(data));
}
async function startService4() {
var str = {
"want": {
"bundleName": "com.ohos.acecollaboration",
"abilityName": "com.ohos.acecollaboration.ServiceAbility4",
},
};
var data = featureAbility.startAbility(str);
console.info('particleAbility_connectAbility_test_0300 startAbility succeeded: ' + JSON.stringify(data));
}
async function startService5() {
var str = {
"want": {
"bundleName": "com.ohos.acecollaboration",
"abilityName": "com.ohos.acecollaboration.ServiceAbility5",
},
};
var data = featureAbility.startAbility(str);
console.info('particleAbility_connectAbility_test_0400 startAbility succeeded: ' + JSON.stringify(data));
}
async function startService6(){
var str = {
"want": {
"bundleName": "com.ohos.acecollaboration",
"abilityName": "com.ohos.acecollaboration.ServiceAbility6",
},
};
var data = featureAbility.startAbility(str);
console.info('particleAbility_connectAbility_test_0500 startAbility succeeded: ' + JSON.stringify(data));
}
async function startService7(){
var str = {
"want": {
"bundleName": "com.ohos.acecollaboration",
"abilityName": "com.ohos.acecollaboration.ServiceAbility7",
},
};
var data = featureAbility.startAbility(str);
console.info('particleAbility_connectAbility_test_0600 startAbility succeeded: ' + JSON.stringify(data));
}
@Entry
@Component
struct MyComponent {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
console.info("start run testcase2!!!!")
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
configService.setConfig(this)
testsuite2();
core.execute();
}
build() {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Text('ACE ETS TEST 组件协同')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button('disconnectAbility_promise')
.fontSize(40)
.height(40)
.margin({ top: 20 })
.fontWeight(FontWeight.Bold)
.onClick(() => {
startService2();
});
Button('disconnectAbility_callback')
.fontSize(40)
.height(40)
.margin({ top: 20 })
.fontWeight(FontWeight.Bold)
.onClick(() => {
startService3();
});
Button('connectotherAbility')
.fontSize(40)
.height(40)
.margin({ top: 20 })
.fontWeight(FontWeight.Bold)
.onClick(() => {
startService4();
});
Button('connectnull')
.fontSize(40)
.height(40)
.margin({ top: 20 })
.fontWeight(FontWeight.Bold)
.onClick(() => {
startService5();
});
Button('connecterror')
.fontSize(40)
.height(40)
.margin({top:20})
.fontWeight(FontWeight.Bold)
.onClick(() => {
startService6();
});
Button('connectAPI8')
.fontSize(40)
.height(40)
.margin({top:20})
.fontWeight(FontWeight.Bold)
.onClick(() => {
startService7();
});
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
}
.width('100%')
.height('100%')
}
}
}
\ No newline at end of file
......@@ -15,6 +15,7 @@
import {describe, it, expect} from "deccjsunit/index.ets";
import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility';
import ability_particleAbility from '@ohos.ability.particleAbility';
import abilityManager from "@ohos.app.abilitymanager"
const TAG_TEST_0100 = ' context_isUpdatingConfigurations_test_0100 ';
......
......@@ -22,27 +22,19 @@ import {Core, ExpectExtend, ReportExtend} from "deccjsunit/index.ets";
struct MyComponent {
aboutToAppear() {
console.info("start run testcase2!!!!")
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters2---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite2();
core.execute();
console.info('Operation successful2. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed2. Cause: ' + JSON.stringify(error));
})
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
configService.setConfig(this)
testsuite2();
core.execute();
}
build() {
......
......@@ -23,27 +23,19 @@ import featureAbility from "@ohos.ability.featureAbility";
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!")
featureAbility.getWant()
.then((Want) => {
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
console.info('parameters---->' + JSON.stringify(Want.parameters));
configService.setConfig(Want.parameters);
testsuite_app1();
core.execute();
console.info('Operation successful. Data: ' + JSON.stringify(Want));
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
configService.setConfig(this)
testsuite_app1();
core.execute();
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册