You need to sign in or sign up before continuing.
未验证 提交 8d95ccad 编写于 作者: O openharmony_ci 提交者: Gitee

!4805 【XTS】【元能力】测试套上库(提供方查询静态卡片)

Merge pull request !4805 from chengxingzhen/master
......@@ -16,6 +16,9 @@ import("//test/xts/tools/build/suite.gni")
group("formmanager") {
testonly = true
if (is_standard_system) {
deps = [ "fa:formmanager" ]
deps = [
"fa:formmanager",
#"stage:stage",
]
}
}
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
group("stage") {
testonly = true
if (is_standard_system) {
deps = [ "actsformprovidergetformsinfo:actsformprovidergetformsinfo" ]
}
}
{
"app": {
"bundleName": "com.example.getformsinfotest",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"debug": false,
"icon": "$media:app_icon",
"label": "$string:app_name",
"distributedNotificationEnabled": true,
"keepAlive": true,
"singleUser": true,
"minAPIVersion": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
group("actsformprovidergetformsinfo") {
testonly = true
if (is_standard_system) {
deps = [
"entry:ActsFormProviderGetFormsInfoTest",
"module1:ActsFormProviderGetFormsInfoModule1",
"module2:ActsFormProviderGetFormsInfoModule2",
]
}
}
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsFormProviderGetFormsInfoTest") {
hap_profile = "src/main/module.json"
deps = [
":actsformprovidergetformsinfotest_js_assets",
":actsformprovidergetformsinfotest_resources",
]
ets2abc = true
certificate_profile = "../signature/openharmony_sx.p7b"
hap_name = "ActsFormProviderGetFormsInfoTest"
js_build_mode = "debug"
subsystem_name = "ability"
part_name = "form_fwk"
}
ohos_app_scope("actsformprovidergetformsinfotest_app_profile") {
app_profile = "../AppScope/app.json"
sources = [ "../AppScope/resources" ]
}
ohos_js_assets("actsformprovidergetformsinfotest_js_assets") {
source_dir = "src/main/ets"
}
ohos_resources("actsformprovidergetformsinfotest_resources") {
sources = [ "src/main/resources" ]
deps = [ ":actsformprovidergetformsinfotest_app_profile" ]
hap_profile = "src/main/module.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"bundle-name": "com.example.getformsinfotest",
"module-name": "entry",
"shell-timeout": "600000",
"testcase-timeout": 20000
},
"kits": [
{
"test-file-name": [
"ActsFormProviderGetFormsInfoTest.hap",
"ActsFormProviderGetFormsInfoModule1.hap",
"ActsFormProviderGetFormsInfoModule2.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
/*
* 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 AbilityStage from "@ohos.application.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[Demo] MyAbilityStage onCreate")
}
}
\ 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 Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
}
onDestroy() {
console.log("[Demo] MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[Demo] MainAbility onWindowStageCreate")
windowStage.setUIContent(this.context, "MainAbility/pages/index", null)
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("[Demo] MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
};
/*
* 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 router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'Hello World entry'
aboutToAppear() {
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ 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 Ability from '@ohos.application.Ability'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
console.log('TestAbility onCreate')
}
onDestroy() {
console.log('TestAbility onDestroy')
}
onWindowStageCreate(windowStage) {
console.log('TestAbility onWindowStageCreate')
windowStage.loadContent("TestAbility/pages/index", (err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data))
});
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.log('TestAbility onWindowStageDestroy')
}
onForeground() {
console.log('TestAbility onForeground')
}
onBackground() {
console.log('TestAbility onBackground')
}
};
\ 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 router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ 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 TestRunner from '@ohos.application.testRunner'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
var abilityDelegator = undefined
var abilityDelegatorArguments = undefined
function translateParamsToString(parameters) {
const keySet = new Set([
'-s class', '-s notClass', '-s suite', '-s it',
'-s level', '-s testType', '-s size', '-s timeout',
'-s dryRun'
])
let targetParams = '';
for (const key in parameters) {
if (keySet.has(key)) {
targetParams = `${targetParams} ${key} ${parameters[key]}`
}
}
return targetParams.trim()
}
async function onAbilityCreateCallback() {
console.log("onAbilityCreateCallback");
}
async function addAbilityMonitorCallback(err: any) {
console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
}
export default class OpenHarmonyTestRunner implements TestRunner {
constructor() {
}
onPrepare() {
console.info("OpenHarmonyTestRunner OnPrepare ")
}
async onRun() {
console.log('OpenHarmonyTestRunner onRun run')
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
var cmd = 'aa start -d 0 -a com.example.getformsinfotest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
console.info('cmd : '+cmd)
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + d.stdResult);
console.info('executeShellCommand : data : ' + d.exitCode);
})
console.info('OpenHarmonyTestRunner onRun end')
}
};
\ 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 '@ohos/hypium'
import formProvider from '@ohos.application.formProvider';
import formInfo from '@ohos.application.formInfo';
import formError from '@ohos.application.formError';
let module1FormInfo: formInfo.FormInfo = {
bundleName: "com.example.getformsinfotest",
moduleName: "module1",
abilityName: "FormAbility",
name: "module1_widget",
description: "This is a service widget.",
type:1,
jsComponentName: "",
colorMode: -1,
isDefault: true,
updateEnabled: true,
formVisibleNotify: true,
relatedBundleName : "com.example.getformsinfotest",
scheduledUpdateTime: "10:30",
formConfigAbility: "ability://xxxxx",
updateDuration: 1,
defaultDimension:2,
supportDimensions:[2],
customizeData: {}
}
let module2FormInfo: formInfo.FormInfo = {
bundleName: "com.example.getformsinfotest",
moduleName: "module2",
abilityName: "FormAbility",
name: "module2_widget",
description: "This is a service widget.",
type:1,
jsComponentName: "",
colorMode: -1,
isDefault: true,
updateEnabled: true,
formVisibleNotify: true,
relatedBundleName : "com.example.getformsinfotest",
scheduledUpdateTime: "10:30",
formConfigAbility: "ability://xxxxx",
updateDuration: 1,
defaultDimension:2,
supportDimensions:[2],
customizeData: {}
}
var expectResult = Array();
expectResult.push(module1FormInfo);
expectResult.push(module2FormInfo);
export default function abilityTest() {
describe('ProviderGetFormsInfoTest', function () {
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0100
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0100
* @tc.desc: #1: getFormsInfo(callback)
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0100', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0100");
formProvider.getFormsInfo((err, value) => {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value)
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0200
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0200
* @tc.desc: #2 getFormsInfo(filter, undefined) # Have no idea how to test it.
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0200', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0200");
const filter : formInfo.FormInfoFilter = {
moduleName : "module1"
};
try {
formProvider.getFormsInfo(filter, undefined);
} catch(err) {
expect().assertFail();
}
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0300
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0300
* @tc.desc: #3 getFormsInfo()
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0300', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0300");
formProvider.getFormsInfo().then((value) => {
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect().assertFail();
})
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0400
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0400
* @tc.desc: #4 getFormsInfo(undefined, callback)
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0400', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0400");
formProvider.getFormsInfo(undefined, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(formError.FormError.ERR_ADD_INVALID_PARAM);
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0500
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0500
* @tc.desc: #5 getFormsInfo(filter, callback) where filter = {}
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0500', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_getFormsInfo_0105");
const filter : formInfo.FormInfoFilter = {};
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0600
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0600
* @tc.desc: #6 getFormsInfo(filter, callback) where moduleName = ""
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0600', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0600");
const filter : formInfo.FormInfoFilter = {
moduleName: ""
};
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0700
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0700
* @tc.desc: #7 getFormsInfo(filter, callback) where moduleName = undefined
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0700', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0700");
const filter : formInfo.FormInfoFilter = {
moduleName: undefined
};
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0800
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0800
* @tc.desc: #8 getFormsInfo(filter, callback) where moduleName = "HelloWorld" which doesn't exist
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0800', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0800");
const filter : formInfo.FormInfoFilter = {
moduleName: "HelloWorld"
};
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(value.length).assertEqual(0);
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_0900
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_0900
* @tc.desc: #9 getFormsInfo(filter, callback) where moduleName = "module1" which does exist
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0900', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0900");
const filter : formInfo.FormInfoFilter = {
moduleName: "module1"
};
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(value.length).assertEqual(1);
checkResult(module1FormInfo, value[0]);
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_1000
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_1000
* @tc.desc: #10 getFormsInfo(filter, callback) where moduleName = "entry" exists but has no forms.
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_1000', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_1000");
const filter : formInfo.FormInfoFilter = {
moduleName: "entry"
};
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(value.length).assertEqual(0);
done();
});
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_1200
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_1200
* @tc.desc: #12 getFormsInfo(filter) where filter = {}
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_1200', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_1200");
const filter : formInfo.FormInfoFilter = {};
await formProvider.getFormsInfo(filter).then((value) => {
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect().assertFail();
})
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_1300
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_1300
* @tc.desc: #13 getFormsInfo(filter) where moduleName = ""
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_1300', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_1300");
const filter : formInfo.FormInfoFilter = {
moduleName: ""
};
await formProvider.getFormsInfo(filter).then((value) => {
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect().assertFail();
})
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_1400
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_1400
* @tc.desc: #14 getFormsInfo(filter) where moduleName = undefined
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_1400', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_1400");
const filter : formInfo.FormInfoFilter = {
moduleName: undefined
};
formProvider.getFormsInfo(filter).then((value) => {
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect().assertFail();
})
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_1500
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_1500
* @tc.desc: #15 getFormsInfo(filter) where moduleName = "HelloWorld" which doesn't exist
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_1500', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_1500");
const filter : formInfo.FormInfoFilter = {
moduleName: "HelloWorld"
};
await formProvider.getFormsInfo(filter).then((value) => {
expect(value.length).assertEqual(0);
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect().assertFail();
})
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_1600
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_1600
* @tc.desc: #16 getFormsInfo(filter) where moduleName = "module1" which does exist
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_1600', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_1600");
const filter : formInfo.FormInfoFilter = {
moduleName: "module1"
};
await formProvider.getFormsInfo(filter).then((value) => {
expect(value.length).assertEqual(1);
checkResult(module1FormInfo, value[0])
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect().assertFail();
})
done();
});
/**
* @tc.number: SUB_AA_OpenHarmony_ProviderGetForsInfo_1700
* @tc.name: SUB_AA_OpenHarmony_ProviderGetForsInfo_1700
* @tc.desc: #17 getFormsInfo(filter) where moduleName = "entry" which exists but has no forms
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_1700', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_1700");
const filter : formInfo.FormInfoFilter = {
moduleName: "entry"
};
formProvider.getFormsInfo(filter).then((value) => {
expect(value.length).assertEqual(0);
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect().assertFail();
})
done();
});
})
function checkResultArray(expectInfos: Array<formInfo.FormInfo>, result:Array<formInfo.FormInfo>) {
console.info("formProvider::GetForsInfoTest checkResultArray");
for (var index = 0; index < expectInfos.length; index++) {
console.info("formProvider::GetForsInfoTest checkResul index is " + index);
checkResult(expectInfos[index], result[index])
}
}
function checkResult(expectInfo: formInfo.FormInfo, result: formInfo.FormInfo) {
console.info("formProvider::GetFormsInfoTest: bundleName expect " + expectInfo.bundleName);
expect(expectInfo.bundleName).assertEqual(result.bundleName);
console.info("formProvider::GetFormsInfoTest: abilityName expect " + expectInfo.abilityName);
expect(expectInfo.abilityName).assertEqual(result.abilityName);
console.info("formProvider::GetFormsInfoTest: name expect " + expectInfo.name);
expect(expectInfo.name).assertEqual(result.name);
console.info("formProvider::GetFormsInfoTest: description expect " + expectInfo.description);
expect(expectInfo.description).assertEqual(result.description);
console.info("formProvider::GetFormsInfoTest: type expect " + expectInfo.type);
expect(expectInfo.type).assertEqual(result.type);
console.info("formProvider::GetFormsInfoTest: jsComponentName expect " + expectInfo.jsComponentName);
expect(expectInfo.jsComponentName).assertEqual(result.jsComponentName);
console.info("formProvider::GetFormsInfoTest: colorMode expect " + expectInfo.colorMode);
expect(expectInfo.colorMode).assertEqual(result.colorMode);
console.info("formProvider::GetFormsInfoTest: isDefault expect " + expectInfo.isDefault);
expect(expectInfo.isDefault).assertEqual(result.isDefault);
console.info("formProvider::GetFormsInfoTest: formVisibleNotify expect " + expectInfo.formVisibleNotify);
expect(expectInfo.formVisibleNotify).assertEqual(result.formVisibleNotify);
console.info("formProvider::GetFormsInfoTest: relatedBundleName expect " + expectInfo.relatedBundleName);
expect(expectInfo.relatedBundleName).assertEqual(result.relatedBundleName);
console.info("formProvider::GetFormsInfoTest: scheduledUpdateTime expect " + expectInfo.scheduledUpdateTime);
expect(expectInfo.scheduledUpdateTime).assertEqual(result.scheduledUpdateTime);
console.info("formProvider::GetFormsInfoTest: formConfigAbility expect " + expectInfo.formConfigAbility);
expect(expectInfo.formConfigAbility).assertEqual(result.formConfigAbility);
console.info("formProvider::GetFormsInfoTest: updateDuration expect " + expectInfo.updateDuration);
expect(expectInfo.updateDuration).assertEqual(result.updateDuration);
console.info("formProvider::GetFormsInfoTest: defaultDimension expect " + expectInfo.defaultDimension);
expect(expectInfo.defaultDimension).assertEqual(result.defaultDimension);
console.info("formProvider::GetFormsInfoTest: supportDimensions expect " + JSON.stringify(expectInfo.supportDimensions));
expect(JSON.stringify(expectInfo.supportDimensions)).assertEqual(JSON.stringify(result.supportDimensions));
console.info("formProvider::GetFormsInfoTest: customizeData expect " + JSON.stringify(expectInfo.customizeData));
expect(JSON.stringify(expectInfo.customizeData)).assertEqual(JSON.stringify(result.customizeData));
}
}
\ 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 getFormsInfoTest from './GetFormsInfoTest.test'
export default function testsuite() {
getFormsInfoTest()
}
\ No newline at end of file
{
"module": {
"name": "entry",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "com.example.getformsinfotest.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"color": [
{
"name": "white",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "entry_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
}
]
}
\ 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_assist_suite("ActsFormProviderGetFormsInfoModule1") {
hap_name = "ActsFormProviderGetFormsInfoModule1"
hap_profile = "src/main/module.json"
testonly = true
deps = [
":actsformprovidergetformsinfomodule1_js_assets",
":actsformprovidergetformsinfomodule1_resources",
]
ets2abc = true
certificate_profile = "../signature/openharmony_sx.p7b"
js_build_mode = "debug"
subsystem_name = "ability"
part_name = "form_fwk"
}
ohos_app_scope("actsformprovidergetformsinfomodule1_app_profile") {
app_profile = "../AppScope/app.json"
sources = [ "../AppScope/resources" ]
}
ohos_js_assets("actsformprovidergetformsinfomodule1_js_assets") {
source_dir = "src/main/ets"
}
ohos_resources("actsformprovidergetformsinfomodule1_resources") {
sources = [ "src/main/resources" ]
deps = [ ":actsformprovidergetformsinfomodule1_app_profile" ]
hap_profile = "src/main/module.json"
}
/*
* 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 AbilityStage from "@ohos.application.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[Demo] MyAbilityStage onCreate")
}
}
\ 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 FormExtension from '@ohos.application.FormExtension';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
export default class FormAbility extends FormExtension {
onCreate(want) {
// Called to return a FormBindingData object.
let formData = {};
return formBindingData.createFormBindingData(formData);
}
onCastToNormal(formId) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}
onUpdate(formId) {
// Called to notify the form provider to update a specified form.
}
onVisibilityChange(newStatus) {
// Called when the form provider receives form events from the system.
}
onEvent(formId, message) {
// Called when a specified message event defined by the form provider is triggered.
}
onDestroy(formId) {
// Called to notify the form provider that a specified form has been destroyed.
}
onAcquireFormState(want) {
// Called to return a {@link FormState} object.
return formInfo.FormState.READY;
}
};
\ 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 Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
}
onDestroy() {
console.log("[Demo] MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[Demo] MainAbility onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null)
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("[Demo] MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
};
/*
* 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.
*/
@Entry
@Component
struct Index {
@State message: string = 'Hello World module1'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
#wrapper {
flex-direction: column;
}
#div1 {
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
background-color: white;
}
#text1 {
height: 45px;
width: 150px;
font-size: 16px;
text-align: center;
}
<div>
<div id="wrapper">
<div id="div1">
<text id="text1">{{title}}</text>
</div>
</div>
</div>
\ No newline at end of file
{
"module": {
"name": "module1",
"type": "feature",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:module1_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white"
}
],
"extensionAbilities": [
{
"name": "FormAbility",
"srcEntrance": "./ets/FormAbility/FormAbility.ts",
"label": "$string:form_FormAbility_label",
"description": "$string:form_FormAbility_desc",
"type": "form",
"metadata": [
{
"name": "ohos.extension.form",
"resource": "$profile:form_config"
}
]
}
]
}
}
\ No newline at end of file
{
"color": [
{
"name": "white",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "module1_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "form_FormAbility_desc",
"value": "form_description"
},
{
"name": "form_FormAbility_label",
"value": "form_label"
}
]
}
\ No newline at end of file
{
"forms": [
{
"name": "module1_widget",
"description": "This is a service widget.",
"src": "./js/module1_widget/pages/index/index",
"window": {
"designWidth": 720,
"autoDesignWidth": true
},
"colorMode": "auto",
"isDefault": true,
"updateEnabled": true,
"scheduledUpdateTime": "10:30",
"updateDuration": 1,
"defaultDimension": "2*2",
"supportDimensions": [
"2*2"
],
"formConfigAbility": "ability://xxxxx",
"formVisibleNotify":true
}
]
}
\ 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_assist_suite("ActsFormProviderGetFormsInfoModule2") {
hap_name = "ActsFormProviderGetFormsInfoModule2"
hap_profile = "src/main/module.json"
testonly = true
deps = [
":actsformprovidergetformsinfomodule2_js_assets",
":actsformprovidergetformsinfomodule2_resources",
]
ets2abc = true
certificate_profile = "../signature/openharmony_sx.p7b"
js_build_mode = "debug"
subsystem_name = "ability"
part_name = "form_fwk"
}
ohos_app_scope("actsformprovidergetformsinfomodule2_app_profile") {
app_profile = "../AppScope/app.json"
sources = [ "../AppScope/resources" ]
}
ohos_js_assets("actsformprovidergetformsinfomodule2_js_assets") {
source_dir = "src/main/ets"
}
ohos_resources("actsformprovidergetformsinfomodule2_resources") {
sources = [ "src/main/resources" ]
deps = [ ":actsformprovidergetformsinfomodule2_app_profile" ]
hap_profile = "src/main/module.json"
}
/*
* 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 AbilityStage from "@ohos.application.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("[Demo] MyAbilityStage onCreate")
}
}
\ 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 FormExtension from '@ohos.application.FormExtension';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
export default class FormAbility extends FormExtension {
onCreate(want) {
// Called to return a FormBindingData object.
let formData = {};
return formBindingData.createFormBindingData(formData);
}
onCastToNormal(formId) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}
onUpdate(formId) {
// Called to notify the form provider to update a specified form.
}
onVisibilityChange(newStatus) {
// Called when the form provider receives form events from the system.
}
onEvent(formId, message) {
// Called when a specified message event defined by the form provider is triggered.
}
onDestroy(formId) {
// Called to notify the form provider that a specified form has been destroyed.
}
onAcquireFormState(want) {
// Called to return a {@link FormState} object.
return formInfo.FormState.READY;
}
};
\ 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 Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
}
onDestroy() {
console.log("[Demo] MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("[Demo] MainAbility onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null)
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
console.log("[Demo] MainAbility onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.log("[Demo] MainAbility onForeground")
}
onBackground() {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
};
/*
* 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.
*/
@Entry
@Component
struct Index {
@State message: string = 'Hello World module2'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
#wrapper {
flex-direction: column;
}
#div1 {
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
background-color: white;
}
#text1 {
height: 45px;
width: 150px;
font-size: 16px;
text-align: center;
}
<div>
<div id="wrapper">
<div id="div1">
<text id="text1">{{title}}</text>
</div>
</div>
</div>
\ No newline at end of file
{
"module": {
"name": "module2",
"type": "feature",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:module2_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white"
}
],
"extensionAbilities": [
{
"name": "FormAbility",
"srcEntrance": "./ets/FormAbility/FormAbility.ts",
"label": "$string:form_FormAbility_label",
"description": "$string:form_FormAbility_desc",
"type": "form",
"metadata": [
{
"name": "ohos.extension.form",
"resource": "$profile:form_config"
}
]
}
]
}
}
\ No newline at end of file
{
"color": [
{
"name": "white",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
{
"string": [
{
"name": "module2_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "form_FormAbility_desc",
"value": "form_description"
},
{
"name": "form_FormAbility_label",
"value": "form_label"
}
]
}
\ No newline at end of file
{
"forms": [
{
"name": "module2_widget",
"description": "This is a service widget.",
"src": "./js/module2widget/pages/index/index",
"window": {
"designWidth": 720,
"autoDesignWidth": true
},
"colorMode": "auto",
"isDefault": true,
"updateEnabled": true,
"scheduledUpdateTime": "10:30",
"updateDuration": 1,
"defaultDimension": "2*2",
"supportDimensions": [
"2*2"
],
"formConfigAbility": "ability://xxxxx",
"formVisibleNotify":true
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册