Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
10213a13
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
10213a13
编写于
8月 02, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XTS用例上库
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
35373c9f
变更
47
隐藏空白更改
内联
并排
Showing
47 changed file
with
1414 addition
and
1 deletion
+1414
-1
ability/ability_runtime/formmanager/BUILD.gn
ability/ability_runtime/formmanager/BUILD.gn
+4
-1
ability/ability_runtime/formmanager/stage/BUILD.gn
ability/ability_runtime/formmanager/stage/BUILD.gn
+23
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/AppScope/app.json
...ager/stage/actsformprovidergetformsinfo/AppScope/app.json
+20
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/AppScope/resources/base/element/string.json
...rgetformsinfo/AppScope/resources/base/element/string.json
+8
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/AppScope/resources/base/media/app_icon.png
...ergetformsinfo/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/BUILD.gn
...e/formmanager/stage/actsformprovidergetformsinfo/BUILD.gn
+25
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/BUILD.gn
...manager/stage/actsformprovidergetformsinfo/entry/BUILD.gn
+40
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/Test.json
...anager/stage/actsformprovidergetformsinfo/entry/Test.json
+20
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/Application/AbilityStage.ts
...tformsinfo/entry/src/main/ets/Application/AbilityStage.ts
+21
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/MainAbility/MainAbility.ts
...etformsinfo/entry/src/main/ets/MainAbility/MainAbility.ts
+48
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/pages/index.ets
...rmprovidergetformsinfo/entry/src/main/ets/pages/index.ets
+53
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/test/GetFormsInfoTest.test.ets
...rmsinfo/entry/src/main/ets/test/GetFormsInfoTest.test.ets
+404
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/test/List.test.ets
...rovidergetformsinfo/entry/src/main/ets/test/List.test.ets
+19
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/module.json
...e/actsformprovidergetformsinfo/entry/src/main/module.json
+38
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/element/color.json
...ormsinfo/entry/src/main/resources/base/element/color.json
+8
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/element/string.json
...rmsinfo/entry/src/main/resources/base/element/string.json
+16
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/media/icon.png
...getformsinfo/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/profile/main_pages.json
...nfo/entry/src/main/resources/base/profile/main_pages.json
+5
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/BUILD.gn
...nager/stage/actsformprovidergetformsinfo/module1/BUILD.gn
+44
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/Application/AbilityStage.ts
...ormsinfo/module1/src/main/ets/Application/AbilityStage.ts
+21
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/FormAbility/FormAbility.ts
...formsinfo/module1/src/main/ets/FormAbility/FormAbility.ts
+51
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/MainAbility/MainAbility.ts
...formsinfo/module1/src/main/ets/MainAbility/MainAbility.ts
+48
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/pages/index.ets
...providergetformsinfo/module1/src/main/ets/pages/index.ets
+31
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/js/module1_widget/pages/index/index.css
.../module1/src/main/js/module1_widget/pages/index/index.css
+19
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/js/module1_widget/pages/index/index.hml
.../module1/src/main/js/module1_widget/pages/index/index.hml
+7
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/js/module1_widget/pages/index/index.json
...module1/src/main/js/module1_widget/pages/index/index.json
+6
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/module.json
...actsformprovidergetformsinfo/module1/src/main/module.json
+43
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/element/color.json
...msinfo/module1/src/main/resources/base/element/color.json
+8
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/element/string.json
...sinfo/module1/src/main/resources/base/element/string.json
+24
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/media/icon.png
...tformsinfo/module1/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/profile/form_config.json
.../module1/src/main/resources/base/profile/form_config.json
+24
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/profile/main_pages.json
...o/module1/src/main/resources/base/profile/main_pages.json
+5
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/BUILD.gn
...nager/stage/actsformprovidergetformsinfo/module2/BUILD.gn
+44
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/Application/AbilityStage.ts
...ormsinfo/module2/src/main/ets/Application/AbilityStage.ts
+21
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/FormAbility/FormAbility.ts
...formsinfo/module2/src/main/ets/FormAbility/FormAbility.ts
+51
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/MainAbility/MainAbility.ts
...formsinfo/module2/src/main/ets/MainAbility/MainAbility.ts
+48
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/pages/index.ets
...providergetformsinfo/module2/src/main/ets/pages/index.ets
+31
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/js/module2widget/pages/index/index.css
...o/module2/src/main/js/module2widget/pages/index/index.css
+19
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/js/module2widget/pages/index/index.hml
...o/module2/src/main/js/module2widget/pages/index/index.hml
+7
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/js/module2widget/pages/index/index.json
.../module2/src/main/js/module2widget/pages/index/index.json
+6
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/module.json
...actsformprovidergetformsinfo/module2/src/main/module.json
+43
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/element/color.json
...msinfo/module2/src/main/resources/base/element/color.json
+8
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/element/string.json
...sinfo/module2/src/main/resources/base/element/string.json
+24
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/media/icon.png
...tformsinfo/module2/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/profile/form_config.json
.../module2/src/main/resources/base/profile/form_config.json
+24
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/profile/main_pages.json
...o/module2/src/main/resources/base/profile/main_pages.json
+5
-0
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/signature/openharmony_sx.p7b
...actsformprovidergetformsinfo/signature/openharmony_sx.p7b
+0
-0
未找到文件。
ability/ability_runtime/formmanager/BUILD.gn
浏览文件 @
10213a13
...
...
@@ -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"
]
}
}
ability/ability_runtime/formmanager/stage/BUILD.gn
0 → 100644
浏览文件 @
10213a13
# 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",
]
}
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/AppScope/app.json
0 → 100644
浏览文件 @
10213a13
{
"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
}
}
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
10213a13
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"GetFormsInfoTest"
}
]
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
10213a13
6.6 KB
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/BUILD.gn
0 → 100644
浏览文件 @
10213a13
# 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"
]
}
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/BUILD.gn
0 → 100644
浏览文件 @
10213a13
# 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",
]
certificate_profile = "../signature/openharmony_sx.p7b"
hap_name = "ActsFormProviderGetFormsInfoTest"
}
ohos_app_scope("actsformprovidergetformsinfotest_app_profile") {
app_profile = "../AppScope/app.json"
sources = [ "../AppScope/resources" ]
}
ohos_js_assets("actsformprovidergetformsinfotest_js_assets") {
ets2abc = true
source_dir = "src/main/ets"
}
ohos_resources("actsformprovidergetformsinfotest_resources") {
sources = [ "src/main/resources" ]
deps = [ ":actsformprovidergetformsinfotest_app_profile" ]
hap_profile = "src/main/module.json"
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/Test.json
0 → 100644
浏览文件 @
10213a13
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.getformsinfotest"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsFormProviderGetFormsInfoTest.hap"
,
"ActsFormProviderGetFormsInfoModule1.hap"
,
"ActsFormProviderGetFormsInfoModule2.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
"
)
}
};
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/pages/index.ets
0 → 100644
浏览文件 @
10213a13
/*
* 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 file from '@system.file';
import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index"
import List from '../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
aboutToAppear() {
console.info("start run testcase!!!!")
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()
globalThis.abilityWant.parameters.timeout = 10000;
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
configService.setConfig(globalThis.abilityWant.parameters);
List()
core.execute()
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/test/GetFormsInfoTest.test.ets
0 → 100644
浏览文件 @
10213a13
/*
* 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 'hypium/index'
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(formError.FormError.ERR_ADD_INVALID_PARAM);
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().assertFail();
}).catch((err) => {
console.info('formProvider::GetFormsInfoTest failed' + JSON.stringify(err));
expect(err.code).assertEqual(formError.FormError.ERR_ADD_INVALID_PARAM);
})
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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
10213a13
/*
* 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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/module.json
0 → 100644
浏览文件 @
10213a13
{
"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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
10213a13
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
10213a13
{
"string"
:
[
{
"name"
:
"entry_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
10213a13
6.6 KB
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
10213a13
{
"src"
:
[
"pages/index"
]
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/BUILD.gn
0 → 100644
浏览文件 @
10213a13
# 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("ActsFormProviderGetFormsInfoModule1") {
hap_name = "ActsFormProviderGetFormsInfoModule1"
hap_profile = "src/main/module.json"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":actsformprovidergetformsinfomodule1_js_assets",
":actsformprovidergetformsinfomodule1_resources",
]
ets2abc = true
certificate_profile = "../signature/openharmony_sx.p7b"
}
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"
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/FormAbility/FormAbility.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
"
)
}
};
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/ets/pages/index.ets
0 → 100644
浏览文件 @
10213a13
/*
* 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'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/js/module1_widget/pages/index/index.css
0 → 100644
浏览文件 @
10213a13
#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
;
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/js/module1_widget/pages/index/index.hml
0 → 100644
浏览文件 @
10213a13
<div>
<div id="wrapper">
<div id="div1">
<text id="text1">{{title}}</text>
</div>
</div>
</div>
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/js/module1_widget/pages/index/index.json
0 → 100644
浏览文件 @
10213a13
{
"actions"
:
{},
"data"
:
{
"title"
:
"Hello World"
}
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/module.json
0 → 100644
浏览文件 @
10213a13
{
"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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
10213a13
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
10213a13
{
"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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
10213a13
6.6 KB
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/profile/form_config.json
0 → 100644
浏览文件 @
10213a13
{
"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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
10213a13
{
"src"
:
[
"pages/index"
]
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/BUILD.gn
0 → 100644
浏览文件 @
10213a13
# 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("ActsFormProviderGetFormsInfoModule2") {
hap_name = "ActsFormProviderGetFormsInfoModule2"
hap_profile = "src/main/module.json"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":actsformprovidergetformsinfomodule2_js_assets",
":actsformprovidergetformsinfomodule2_resources",
]
ets2abc = true
certificate_profile = "../signature/openharmony_sx.p7b"
}
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"
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/FormAbility/FormAbility.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
10213a13
/*
* 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
"
)
}
};
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/ets/pages/index.ets
0 → 100644
浏览文件 @
10213a13
/*
* 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'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/js/module2widget/pages/index/index.css
0 → 100644
浏览文件 @
10213a13
#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
;
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/js/module2widget/pages/index/index.hml
0 → 100644
浏览文件 @
10213a13
<div>
<div id="wrapper">
<div id="div1">
<text id="text1">{{title}}</text>
</div>
</div>
</div>
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/js/module2widget/pages/index/index.json
0 → 100644
浏览文件 @
10213a13
{
"actions"
:
{},
"data"
:
{
"title"
:
"Hello World"
}
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/module.json
0 → 100644
浏览文件 @
10213a13
{
"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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
10213a13
{
"color"
:
[
{
"name"
:
"white"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
10213a13
{
"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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
10213a13
6.6 KB
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/profile/form_config.json
0 → 100644
浏览文件 @
10213a13
{
"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
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
10213a13
{
"src"
:
[
"pages/index"
]
}
ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
10213a13
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录