提交 6aec3310 编写于 作者: O openharmony_ci 提交者: Gitee

!1394 Update bms xts code

Merge pull request !1394 from blackleon/update_master_1218
......@@ -39,6 +39,9 @@ group("bundlemanager") {
"sceneProject/bmsgetinfoshapc:bmsThirdBundleC",
"sceneProject/bmsgetinfosjsscene:bmsThirdBundleJs",
"sceneProject/bmsgetinfosscenesystem:bmsSystemBundleTest1",
"sceneProject/bmsgetinfosscenesystemfeature:bmsSystemBundleTest2Feature",
"sceneProject/bmsgetinfosscenesystemtwo:bmsSystemBundleTest2",
"sceneProject/bmsgetinfosscenesystemupdate:bmsSystemBundleTest2Update",
"sceneProject/bmsgetinfosscenevendor:bmsVendorBundleTest1",
"sceneProject/bmsgetinfossecondscene:bmsThirdBundleTest2",
"sceneProject/bmsgetinfossixthscene:bmsThirdBundleTest6",
......
......@@ -32,7 +32,10 @@
"bmsThirdBundleTest4.hap->/data/test/bmsThirdBundleTest4.hap",
"bmsThirdBundleTest5.hap->/data/test/bmsThirdBundleTest5.hap",
"bmsThirdBundleTest6.hap->/data/test/bmsThirdBundleTest6.hap",
"bmsThirdBundleTestA1.hap->/data/test/bmsThirdBundleTestA1.hap"
"bmsThirdBundleTestA1.hap->/data/test/bmsThirdBundleTestA1.hap",
"bmsSystemBundleTest2.hap->/data/test/bmsSystemBundleTest2.hap",
"bmsSystemBundleTest2Feature.hap->/data/test/bmsSystemBundleTest2Feature.hap",
"bmsSystemBundleTest2Update.hap->/data/test/bmsSystemBundleTest2Update.hap"
]
},
{
......@@ -42,4 +45,4 @@
]
}
]
}
}
\ No newline at end of file
......@@ -23,12 +23,18 @@ const BUNDLE_PATH4 = '/data/test/bmsThirdBundleTest4.hap';
const BUNDLE_PATH5 = '/data/test/bmsThirdBundleTest5.hap';
const BUNDLE_PATH6 = '/data/test/bmsThirdBundleTest6.hap';
const BUNDLE_PATHUPDATE = '/data/test/bmsThirdBundleTestA1.hap';
const SYSTEM_PATH = '/data/test/bmsSystemBundleTest2.hap';
const SYSTEM_FEATURE_PATH = '/data/test/bmsSystemBundleTest2Feature.hap';
const SYSTEM_UPDATE_PATH = '/data/test/bmsSystemBundleTest2Update.hap';
const BUNDLE_NAME1 = 'com.example.third1';
const BUNDLE_NAME2 = 'com.example.third2';
const BUNDLE_NAME4 = 'com.example.third4';
const BUNDLE_NAME5 = 'com.example.third5';
const BUNDLE_NAME6 = 'com.example.third6';
const SYSTEM_NAME = 'com.example.system2';
const NUM_TWO = 2;
const NUM_THREE = 3;
const NUM_FOUR = 4;
const NUM_NINE = 9;
let dataTransfer = 1;
let audioPlayback = 2;
......@@ -68,17 +74,17 @@ describe('ActsBmsGetBackGroundModes', function () {
elementName: {
deviceId: '0',
bundleName: BUNDLE_NAME5,
abilityName: 'com.example.third5.AMainAbility',
abilityName: 'com.example.third5.MainAbilityA',
},
}
}, 0, 0)
expect(dataInfos.length).assertEqual(NUM_TWO);
if (dataInfos.length == NUM_TWO) {
expect(dataInfos[0].name).assertEqual("com.example.third5.AMainAbility");
expect(dataInfos[0].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
expect(dataInfos.length).assertEqual(NUM_FOUR);
if (dataInfos.length == NUM_FOUR) {
expect(dataInfos[NUM_TWO].name).assertEqual("com.example.third5.MainAbilityA");
expect(dataInfos[NUM_TWO].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
location + bluetoothInteraction + multiDeviceConnection + wifiInteraction + voip + taskKeeping);
expect(dataInfos[1].name).assertEqual("com.example.third5.BMainAbility");
expect(dataInfos[1].backgroundModes).assertEqual(dataTransfer + voip);
expect(dataInfos[NUM_THREE].name).assertEqual("com.example.third5.MainAbilityB");
expect(dataInfos[NUM_THREE].backgroundModes).assertEqual(dataTransfer + voip);
}
installer.uninstall(BUNDLE_NAME5, {
param: {
......@@ -97,7 +103,7 @@ describe('ActsBmsGetBackGroundModes', function () {
/*
* @tc.number: bms_backGroundModes_0200
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get all background modes information, and each ability of the application
* contains one of the background mode
*/
......@@ -149,8 +155,8 @@ describe('ActsBmsGetBackGroundModes', function () {
/*
* @tc.number: bms_backGroundModes_0300
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Read the backgroundModes information of the app's ability and replace invalid attributes
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Read the backgroundModes information of the app's ability and replace invalid attributes
*/
it('bms_backGroundModes_0300', 0, async function (done) {
console.info('=====================bms_backGroundModes_0300==================');
......@@ -173,14 +179,14 @@ describe('ActsBmsGetBackGroundModes', function () {
elementName: {
deviceId: '0',
bundleName: BUNDLE_NAME2,
abilityName: 'com.example.third2.MainAbility',
abilityName: 'com.example.third2.MainAbilityA',
},
}
}, 0, 0)
expect(dataInfos.length).assertEqual(1);
if (dataInfos.length == 1) {
expect(dataInfos[0].name).assertEqual("com.example.third2.MainAbility")
expect(dataInfos[0].backgroundModes).assertEqual(audioPlayback + audioRecording + location
expect(dataInfos.length).assertEqual(NUM_TWO);
if (dataInfos.length == NUM_TWO) {
expect(dataInfos[1].name).assertEqual("com.example.third2.MainAbilityA")
expect(dataInfos[1].backgroundModes).assertEqual(audioPlayback + audioRecording + location
+ bluetoothInteraction + multiDeviceConnection + wifiInteraction + voip + taskKeeping)
}
installer.uninstall(BUNDLE_NAME2, {
......@@ -200,8 +206,8 @@ describe('ActsBmsGetBackGroundModes', function () {
/*
* @tc.number: bms_backGroundModes_0400
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Read the backgroundModes information of the app's ability and replace invalid attributes
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Read the backgroundModes information of the app's ability and replace invalid attributes
*/
it('bms_backGroundModes_0400', 0, async function (done) {
console.info('=====================bms_backGroundModes_0400==================');
......@@ -250,8 +256,8 @@ describe('ActsBmsGetBackGroundModes', function () {
/*
* @tc.number: bms_backGroundModes_0500
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get the backgroundModes information of the multi-hap package of the application
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get the backgroundModes information of the multi-hap package of the application
*/
it('bms_backGroundModes_0500', 0, async function (done) {
console.info('=====================bms_backGroundModes_0500==================');
......@@ -274,14 +280,14 @@ describe('ActsBmsGetBackGroundModes', function () {
elementName: {
deviceId: '0',
bundleName: BUNDLE_NAME1,
abilityName: 'com.example.third1.MainAbility',
abilityName: 'com.example.third1.MainAbilityA',
},
}
}, 0, 0)
expect(dataInfos.length).assertEqual(NUM_TWO);
if (dataInfos.length == NUM_TWO) {
expect(dataInfos[0].name).assertEqual("com.example.third1.MainAbility")
expect(dataInfos[0].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
expect(dataInfos.length).assertEqual(NUM_FOUR);
if (dataInfos.length == NUM_FOUR) {
expect(dataInfos[1].name).assertEqual("com.example.third1.MainAbilityA")
expect(dataInfos[1].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
location + bluetoothInteraction + multiDeviceConnection + wifiInteraction + voip + taskKeeping)
}
console.info("========dataInfos[0].backgroundModes=======>" + dataInfos[0].backgroundModes)
......@@ -303,7 +309,7 @@ describe('ActsBmsGetBackGroundModes', function () {
/*
* @tc.number: bms_backGroundModes_0600
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get the backgroundModes information of the upgraded application's ability
* @tc.desc: Get the backgroundModes information of the upgraded application's ability
*/
it('bms_backGroundModes_0600', 0, async function (done) {
console.info('=====================bms_backGroundModes_0600==================');
......@@ -327,14 +333,14 @@ describe('ActsBmsGetBackGroundModes', function () {
elementName: {
deviceId: '0',
bundleName: BUNDLE_NAME1,
abilityName: 'com.example.third1.MainAbility',
abilityName: 'com.example.third1.MainAbilityA',
},
}
}, 0, 0)
expect(dataInfos.length).assertEqual(1);
if (dataInfos.length == 1) {
expect(dataInfos[0].name).assertEqual("com.example.third1.MainAbility")
expect(dataInfos[0].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
expect(dataInfos.length).assertEqual(NUM_TWO);
if (dataInfos.length == NUM_TWO) {
expect(dataInfos[1].name).assertEqual("com.example.third1.MainAbilityA")
expect(dataInfos[1].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
location + bluetoothInteraction + multiDeviceConnection + wifiInteraction + voip + taskKeeping)
}
installer.install(bundlePath2, {
......@@ -358,10 +364,10 @@ describe('ActsBmsGetBackGroundModes', function () {
},
}
}, 0, 0)
expect(dataInfos.length).assertEqual(1);
if (dataInfos.length == 1) {
expect(dataInfos[0].name).assertEqual("com.example.third1.AMainAbility");
expect(dataInfos[0].backgroundModes).assertEqual(audioRecording + location + bluetoothInteraction +
expect(dataInfos.length).assertEqual(NUM_TWO);
if (dataInfos.length == NUM_TWO) {
expect(dataInfos[1].name).assertEqual("com.example.third1.AMainAbilityA");
expect(dataInfos[1].backgroundModes).assertEqual(audioRecording + location + bluetoothInteraction +
multiDeviceConnection + wifiInteraction + voip + taskKeeping);
}
installer.uninstall(BUNDLE_NAME1, {
......@@ -383,7 +389,7 @@ describe('ActsBmsGetBackGroundModes', function () {
/*
* @tc.number: bms_backGroundModes_0700
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Uninstall the application, get the backgroundModes information of the upgraded application's ability
* @tc.desc: Uninstall the application, get the backgroundModes information of the upgraded application's ability
*/
it('bms_backGroundModes_0700', 0, async function (done) {
console.info('=====================bms_backGroundModes_0700==================');
......@@ -410,10 +416,10 @@ describe('ActsBmsGetBackGroundModes', function () {
}
}
}, 0, 0)
expect(dataInfos.length).assertEqual(1);
if (dataInfos.length == 1) {
expect(dataInfos[0].name).assertEqual("com.example.third1.MainAbility")
expect(dataInfos[0].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
expect(dataInfos.length).assertEqual(NUM_TWO);
if (dataInfos.length == NUM_TWO) {
expect(dataInfos[1].name).assertEqual("com.example.third1.MainAbilityA")
expect(dataInfos[1].backgroundModes).assertEqual(dataTransfer + audioPlayback + audioRecording +
location + bluetoothInteraction + multiDeviceConnection + wifiInteraction + voip + taskKeeping)
}
installer.uninstall(BUNDLE_NAME1, {
......@@ -442,4 +448,145 @@ describe('ActsBmsGetBackGroundModes', function () {
});
})
})
/*
* @tc.number: bms_getIsKeepAliveAndSingleUser_0100
* @tc.name: Get the isKeepAlive and singleUser information of the third-party application
* @tc.desc: Get the isKeepAlive and singleUser information of the third-party application by getBundleInfo
*/
it('bms_getIsKeepAliveAndSingleUser_0100', 0, async function (done) {
console.info('===========begin bms_getIsKeepAliveAndSingleUser_0100===========');
var installer = await bundle.getBundleInstaller();
installer.install([BUNDLE_PATH1], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getBundleInfo(BUNDLE_NAME1, 1, (err, bundleInfo) => {
expect(err.code).assertEqual(0);
expect(bundleInfo.isKeepAlive).assertFalse();
expect(bundleInfo.singleUser).assertFalse();
installer.uninstall(BUNDLE_NAME1, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
})
})
/*
* @tc.number: bms_getIsKeepAliveAndSingleUser_0200
* @tc.name: Get the isKeepAlive and singleUser information of the application which doesn't config those fields
* @tc.desc: Get the isKeepAlive and singleUser information of the application which doesn't config those fields
* by getBundleInfo(application is system)
*/
it('bms_getIsKeepAliveAndSingleUser_0200', 0, async function (done) {
console.info('=====================bms_getIsKeepAliveAndSingleUser_0200==================');
var bundleInfo = await bundle.getBundleInfo('com.example.system1', 1);
console.info('========bundleInfo is=====' + JSON.stringify(bundleInfo));
expect(bundleInfo.isKeepAlive).assertFalse();
expect(bundleInfo.singleUser).assertFalse();
done();
})
/*
* @tc.number: bms_getIsKeepAliveAndSingleUser_0300
* @tc.name: Get the isKeepAlive and singleUser information of the application includes two haps
* @tc.desc: Get the isKeepAlive and singleUser information of the application includes two haps, the attribute value
* will remain the same as the attribute value of the first installed hap(application is system)
*/
it('bms_getIsKeepAliveAndSingleUser_0300', 0, async function (done) {
console.info('===========begin bms_getIsKeepAliveAndSingleUser_0300===========');
let installer = await bundle.getBundleInstaller()
installer.install([SYSTEM_PATH, SYSTEM_FEATURE_PATH], {
param: {
userId: 0,
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var bundleInfo = await bundle.getBundleInfo(SYSTEM_NAME, 1);
expect(bundleInfo.singleUser).assertTrue();
expect(bundleInfo.isKeepAlive).assertFalse();
installer.uninstall(SYSTEM_NAME, {
param: {
userId: 0,
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
})
/*
* @tc.number: bms_getIsKeepAliveAndSingleUser_0400
* @tc.name: Update application, get the isKeepAlive and singleUser information of the application
* @tc.desc: Update application, get the isKeepAlive and singleUser information of the application whether update
* (application is system)
*/
it('bms_getIsKeepAliveAndSingleUser_0400', 0, async function (done) {
console.info('=====================bms_getIsKeepAliveAndSingleUser_0400==================');
var installer = await bundle.getBundleInstaller();
installer.install([SYSTEM_PATH], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var bundleInfo = await bundle.getBundleInfo(SYSTEM_NAME, 1);
expect(bundleInfo.singleUser).assertTrue();
expect(bundleInfo.isKeepAlive).assertFalse();
installer.install([SYSTEM_UPDATE_PATH], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var bundleInfo = await bundle.getBundleInfo(SYSTEM_NAME, 1);
console.info('========bundleInfo is=====' + JSON.stringify(bundleInfo));
expect(bundleInfo.name).assertEqual(SYSTEM_NAME);
expect(bundleInfo.isKeepAlive).assertTrue();
expect(bundleInfo.singleUser).assertTrue();
installer.uninstall(SYSTEM_NAME, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
})
})
})
})
\ No newline at end of file
......@@ -14,6 +14,8 @@
*/
import bundle from '@ohos.bundle'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
const NUM_TWO = 2;
const NUM_FOUR = 4;
describe('ActsBmsJsTest', function () {
/*
* @tc.number: bms_getJsAbility_0100
......@@ -42,8 +44,8 @@ describe('ActsBmsJsTest', function () {
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
let result = await bundle.getBundleInfo(bundleName, 1);
expect(result.abilityInfo.length).assertEqual(1);
if (result.abilityInfo.length == 1) {
expect(result.abilityInfo.length).assertEqual(NUM_TWO);
if (result.abilityInfo.length == NUM_TWO) {
console.debug('========check abilityName ========' + JSON.stringify(result.abilityInfo));
expect(result.abilityInfo[0].name).assertEqual(abilityName);
expect(result.abilityInfo[0].srcLanguage).assertEqual('js');
......@@ -94,8 +96,8 @@ describe('ActsBmsJsTest', function () {
expect(data.statusMessage).assertEqual('SUCCESS');
let result = await bundle.getBundleInfo(bundleName, 1)
console.debug('==========bundleInfo==========' + JSON.stringify(result))
expect(result.abilityInfo.length).assertEqual(2);
if (result.abilityInfo.length == 2) {
expect(result.abilityInfo.length).assertEqual(NUM_FOUR);
if (result.abilityInfo.length == NUM_FOUR) {
console.debug('========check abilityName ========' + JSON.stringify(result.abilityInfo));
expect(result.abilityInfo[0].name).assertEqual(abilityName1);
expect(result.abilityInfo[0].srcLanguage).assertEqual('js');
......
......@@ -37,17 +37,6 @@
]
}
],
"backgroundModes": [
"dataTransfer",
"audioPlayback",
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third5.AMainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
......@@ -129,10 +118,6 @@
]
}
],
"backgroundModes": [
"dataTransfer",
"voip"
],
"name": ".BMainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
......@@ -191,6 +176,61 @@
}
]
}
},
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"backgroundModes": [
"dataTransfer",
"audioPlayback",
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third5.MainAbilityA",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "service",
"visible": true,
"launchType": "standard"
},
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"backgroundModes": [
"dataTransfer",
"voip"
],
"name": "com.example.third5.MainAbilityB",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "service",
"visible": true,
"launchType": "standard"
}
],
"js": [
......
......@@ -41,17 +41,6 @@
]
}
],
"backgroundModes": [
"dataTransfer",
"audioPlayback",
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third1.MainAbility",
"icon": "$media:icon",
"form": {
......@@ -120,6 +109,46 @@
}
]
}
},
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"backgroundModes": [
"dataTransfer",
"audioPlayback",
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third1.MainAbilityA",
"icon": "$media:icon",
"form": {
"formEntity": [
"homeScreen",
"searchbox"
],
"defaultHeight": 100,
"defaultWidth": 200,
"minHeight": 50,
"minWidth": 100
},
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "service",
"launchType": "standard",
"visible": true
}
],
"shortcuts": [
......
......@@ -42,15 +42,6 @@
]
}
],
"backgroundModes": [
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third1.AMainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
......@@ -118,6 +109,34 @@
}
]
}
},
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"backgroundModes": [
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third1.AMainAbilityA",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "service",
"launchType": "standard",
"visible": true
}
],
"shortcuts": [
......
......@@ -2,7 +2,6 @@
"app": {
"bundleName": "com.example.system1",
"vendor": "example",
"singleUser":true,
"version": {
"code": 1,
"name": "1.0"
......@@ -14,9 +13,7 @@
}
},
"deviceConfig": {
"default":{
"keepAlive":true
}
"default":{}
},
"module": {
"package": "com.example.system1",
......
# 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("bmsSystemBundleTest2Feature") {
hap_profile = "./src/main/config.json"
hap_name = "bmsSystemBundleTest2Feature"
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.system2",
"vendor": "example",
"singleUser":true,
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {
"default":{
"keepAlive":true
}
},
"module": {
"package": "com.example.system.feature",
"name": ".system2feature",
"mainAbility": "com.example.system2.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "systemFeature",
"moduleType": "feature"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.system2.MainAbilityB",
"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('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"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.
*/
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
{
"string": [
{
"name": "app_name",
"value": "system2"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "shortcut",
"value": "JS_Phone_Empty Shortcut"
}
]
}
\ 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("bmsSystemBundleTest2") {
hap_profile = "./src/main/config.json"
hap_name = "bmsSystemBundleTest2"
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.system2",
"vendor": "example",
"singleUser":true,
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {
"default":{
"keepAlive":false
}
},
"module": {
"package": "com.example.system2",
"name": ".BmsSystemBundle1",
"mainAbility": "com.example.system2.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.system2.MainAbility",
"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('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
{
"string": [
{
"name": "app_name",
"value": "system2"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "shortcut",
"value": "JS_Phone_Empty Shortcut"
}
]
}
\ 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("bmsSystemBundleTest2Update") {
hap_profile = "./src/main/config.json"
hap_name = "bmsSystemBundleTest2Update"
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.system2",
"vendor": "example",
"singleUser":true,
"version": {
"code": 5,
"name": "5.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {
"default":{
"keepAlive":true
}
},
"module": {
"package": "com.example.system2",
"name": ".BmsSystemBundle1",
"mainAbility": "com.example.system2.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.system2.MainAbility",
"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('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"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.
*/
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
{
"string": [
{
"name": "app_name",
"value": "upsystem"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "shortcut",
"value": "JS_Phone_Empty Shortcut"
}
]
}
\ No newline at end of file
......@@ -25,6 +25,26 @@
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.third2.MainAbility",
"srcLanguage": "js",
"visible": true,
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
},
{
"skills": [
{
......@@ -47,13 +67,13 @@
"voip",
"taskKeeping"
],
"name": "com.example.third2.MainAbility",
"name": "com.example.third2.MainAbilityA",
"srcLanguage": "js",
"visible": true,
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
}
],
......
......@@ -44,7 +44,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -66,7 +66,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -88,7 +88,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -110,7 +110,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -132,7 +132,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -154,7 +154,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -176,7 +176,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -198,7 +198,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
},
{
......@@ -220,7 +220,7 @@
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"type": "service",
"launchType": "standard"
}
],
......
......@@ -41,17 +41,6 @@
]
}
],
"backgroundModes": [
"dataTransfer",
"audioPlayback",
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third3.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
......@@ -120,6 +109,46 @@
}
]
}
},
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"backgroundModes": [
"dataTransfer",
"audioPlayback",
"audioRecording",
"location",
"bluetoothInteraction",
"multiDeviceConnection",
"wifiInteraction",
"voip",
"taskKeeping"
],
"name": "com.example.third1.MainAbilityA",
"icon": "$media:icon",
"form": {
"formEntity": [
"homeScreen",
"searchbox"
],
"defaultHeight": 100,
"defaultWidth": 200,
"minHeight": 50,
"minWidth": 100
},
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "service",
"launchType": "standard",
"visible": true
}
],
"shortcuts": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册