Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6d8ea702
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看板
未验证
提交
6d8ea702
编写于
3月 22, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 22, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7975 【包管理子系统】【master】新增overlay用例
Merge pull request !7975 from ry/master
上级
91b098d7
2bcaf745
变更
48
隐藏空白更改
内联
并排
Showing
48 changed file
with
1917 addition
and
0 deletion
+1917
-0
bundlemanager/bundle_standard/bundlemanager/BUILD.gn
bundlemanager/bundle_standard/bundlemanager/BUILD.gn
+2
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/app.json
...dlemanager/actsbundlemanageroverlaytest/AppScope/app.json
+21
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/resources/base/element/string.json
...eroverlaytest/AppScope/resources/base/element/string.json
+8
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/BUILD.gn
...ndard/bundlemanager/actsbundlemanageroverlaytest/BUILD.gn
+42
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/Test.json
...dard/bundlemanager/actsbundlemanageroverlaytest/Test.json
+42
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/Application/AbilityStage.ts
...verlaytest/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/FormAbility/FormAbility.ts
...overlaytest/entry/src/main/ets/FormAbility/FormAbility.ts
+37
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/MainAbility.ts
...overlaytest/entry/src/main/ets/MainAbility/MainAbility.ts
+36
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+57
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/second/second.ets
...st/entry/src/main/ets/MainAbility/pages/second/second.ets
+43
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/ServiceAbility/FormAbility.ts
...rlaytest/entry/src/main/ets/ServiceAbility/FormAbility.ts
+37
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/TestAbility.ts
...overlaytest/entry/src/main/ets/TestAbility/TestAbility.ts
+30
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/pages/index.ets
...verlaytest/entry/src/main/ets/TestAbility/pages/index.ets
+48
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+58
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetOverlayModuleInfo.test.ets
...est/entry/src/main/ets/test/GetOverlayModuleInfo.test.ets
+140
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetTargetOverlayModuleInfos.test.ets
...ry/src/main/ets/test/GetTargetOverlayModuleInfos.test.ets
+106
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/List.test.ets
...emanageroverlaytest/entry/src/main/ets/test/List.test.ets
+24
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/SetOverlayEnabled.test.ets
...aytest/entry/src/main/ets/test/SetOverlayEnabled.test.ets
+106
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/Utils.ets
...undlemanageroverlaytest/entry/src/main/ets/test/Utils.ets
+37
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/module.json
...r/actsbundlemanageroverlaytest/entry/src/main/module.json
+379
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/element/string.json
...laytest/entry/src/main/resources/base/element/string.json
+44
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/media/icon.png
...roverlaytest/entry/src/main/resources/base/media/icon.png
+0
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config.json
...st/entry/src/main/resources/base/profile/form_config.json
+6
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config1.txt
...st/entry/src/main/resources/base/profile/form_config1.txt
+1
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/invalid.txt
...laytest/entry/src/main/resources/base/profile/invalid.txt
+5
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+6
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/shortcuts_config.json
...try/src/main/resources/base/profile/shortcuts_config.json
+6
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/signature/openharmony_sx.p7b
...actsbundlemanageroverlaytest/signature/openharmony_sx.p7b
+0
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
...est/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
+1
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets
...dlemanagerstagetest/entry/src/main/ets/test/List.test.ets
+2
-0
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiNineTest.test.ets
...getest/entry/src/main/ets/test/PublicApiNineTest.test.ets
+113
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/app.json
...ndlemanager/sceneProject/bmsoverlaydemo/AppScope/app.json
+21
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/resources/base/element/string.json
...msoverlaydemo/AppScope/resources/base/element/string.json
+8
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/BUILD.gn
...andard/bundlemanager/sceneProject/bmsoverlaydemo/BUILD.gn
+42
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/Test.json
...ndard/bundlemanager/sceneProject/bmsoverlaydemo/Test.json
+4
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/Application/AbilityStage.ts
...verlaydemo/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/FormAbility/FormAbility.ts
...overlaydemo/entry/src/main/ets/FormAbility/FormAbility.ts
+37
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/MainAbility/MainAbility.ts
...overlaydemo/entry/src/main/ets/MainAbility/MainAbility.ts
+36
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/ServiceAbility/FormAbility.ts
...rlaydemo/entry/src/main/ets/ServiceAbility/FormAbility.ts
+37
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/index/index.ets
...t/bmsoverlaydemo/entry/src/main/ets/pages/index/index.ets
+66
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/second/second.ets
...bmsoverlaydemo/entry/src/main/ets/pages/second/second.ets
+43
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/test/List.test.ets
...ject/bmsoverlaydemo/entry/src/main/ets/test/List.test.ets
+20
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/module.json
...er/sceneProject/bmsoverlaydemo/entry/src/main/module.json
+25
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/element/string.json
...laydemo/entry/src/main/resources/base/element/string.json
+40
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/media/icon.png
...soverlaydemo/entry/src/main/resources/base/media/icon.png
+0
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/form_config.json
...mo/entry/src/main/resources/base/profile/form_config.json
+77
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/main_pages.json
...emo/entry/src/main/resources/base/profile/main_pages.json
+6
-0
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/signature/openharmony_sx.p7b
.../sceneProject/bmsoverlaydemo/signature/openharmony_sx.p7b
+0
-0
未找到文件。
bundlemanager/bundle_standard/bundlemanager/BUILD.gn
浏览文件 @
6d8ea702
...
...
@@ -26,6 +26,7 @@ group("bundlemanager") {
"actsbmsjsunpermissiontest:ActsBmsJsUnPermissionTest",
"actsbmsmetadatatest:ActsBmsMetaDataTest",
"actsbundlemanageretstest:ActsBundleManagerEtsTest",
"actsbundlemanageroverlaytest:ActsBundleMgrOverlayEtsTest",
"actsbundlemanagerstagetest:ActsBundleMgrStageEtsTest",
"actsbundlemanagertest:ActsBundleManagerTest",
"actsbundlenativetest:ActsBundleNativeTest",
...
...
@@ -52,6 +53,7 @@ group("bundlemanager") {
"sceneProject/bmsmainabilitysecondscene:bmsMainAbilitySecondScene",
"sceneProject/bmsmodulenameone:bmsModuleNameTest1",
"sceneProject/bmsmodulenametwo:bmsModuleNameTest2",
"sceneProject/bmsoverlaydemo:bmsOverlayDemo",
"sceneProject/bmsscenefive:bmsJstest5",
"sceneProject/bmsscenefour:bmsJstest4",
"sceneProject/bmssceneone:bmsJstest1",
...
...
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/app.json
0 → 100644
浏览文件 @
6d8ea702
{
"app"
:{
"bundleName"
:
"ohos.acts.bundle.overlay.test"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
6d8ea702
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/BUILD.gn
0 → 100644
浏览文件 @
6d8ea702
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsBundleMgrOverlayEtsTest") {
hap_profile = "entry/src/main/module.json"
deps = [
":actbmsoverlayetstest_js_assets",
":actbmsoverlayetstest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsBundleMgrOverlayEtsTest"
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
}
ohos_app_scope("actbmsoverlayetstest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("actbmsoverlayetstest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("actbmsoverlayetstest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":actbmsoverlayetstest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/Test.json
0 → 100644
浏览文件 @
6d8ea702
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"ohos.acts.bundle.overlay.test"
,
"module-name"
:
"testModule"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsBundleMgrOverlayEtsTest.hap"
,
"bmsOverlayDemo.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:[
"remount"
,
"mkdir /data/test/"
]
},
{
"type"
:
"PushKit"
,
"push"
:
[
"bmsOverlayDemo.hap -> /data/test/bmsOverlayDemo.hap"
]
},
{
"type"
:
"ShellKit"
,
"teardown-command"
:[
"bm uninstall -n ohos.acts.bundle.overlay.test"
,
"rm -rf /data/test/"
]
}
]
}
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
6d8ea702
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/FormAbility/FormAbility.ts
0 → 100644
浏览文件 @
6d8ea702
import
FormExtension
from
'
@ohos.app.form.FormExtensionAbility
'
;
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
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
6d8ea702
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/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
"
)
}
};
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/index/index.ets
0 → 100644
浏览文件 @
6d8ea702
/*
* 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 {
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() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/MainAbility/pages/second/second.ets
0 → 100644
浏览文件 @
6d8ea702
/*
* 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 '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/ServiceAbility/FormAbility.ts
0 → 100644
浏览文件 @
6d8ea702
import
FormExtension
from
'
@ohos.app.form.FormExtensionAbility
'
;
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
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/TestAbility.ts
0 → 100644
浏览文件 @
6d8ea702
import
Ability
from
'
@ohos.app.ability.UIAbility
'
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
.
setUIContent
(
this
.
context
,
'
TestAbility/pages/index
'
,
null
)
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
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
6d8ea702
/*
* 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
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
6d8ea702
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
'
])
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 ohos.acts.bundle.overlay.test.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
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
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetOverlayModuleInfo.test.ets
0 → 100644
浏览文件 @
6d8ea702
/**
* 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 impligetProfileByAbilityEmptyAbilityCalled.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import overlay from '@ohos.bundle.overlay';
import Utils from "./Utils";
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
const MODULE_NAME = "testModule";
const MODULE_NAME1 = "test1";
const MODULE_NAME2 = "stage1";
const ERROR_INCOMING_MODULE_NAME_NOT_INSTALL = 17700002;
const ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY = 17700033;
const ERROR_CODE = 401;
export default function getOverlayModuleInfo() {
describe('getOverlayModuleInfo', function () {
/*
* @tc.number: SUB_BMS_APPINFO_OVERLAY_0001
* @tc.name: GetOverlayModuleInfoModuleNameIsNull
* @tc.desc: The query fails when the incoming moduleName is empty
*/
it('GetOverlayModuleInfoModuleNameIsNull', 0, async function (done) {
try {
await overlay.getOverlayModuleInfo("").then(data => {
Utils.info("GetOverlayModuleInfoModuleNameIsNull result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("GetOverlayModuleInfoModuleNameIsNull fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_CODE);
});
} catch (e) {
Utils.info("GetOverlayModuleInfoModuleNameIsNull catch" + JSON.stringify(e));
expect(e.code).assertEqual(ERROR_CODE);
}
try {
overlay.getOverlayModuleInfo("", (err,data) => {
Utils.info("GetOverlayModuleInfoModuleNameIsNull result" + JSON.stringify(data));
Utils.info("GetOverlayModuleInfoModuleNameIsNull fail" + JSON.stringify(err));
expect().assertFail();
done();
});
} catch (e) {
Utils.info("GetOverlayModuleInfoModuleNameIsNull callback catch" + JSON.stringify(e));
expect(e.code).assertEqual(ERROR_CODE);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_OVERLAY_0003
* @tc.name: GetOverlayModuleInfoModuleNameNotInstall
* @tc.desc: The query fails when the incoming moduleName is not installed
*/
it('GetOverlayModuleInfoModuleNameNotInstall', 0, async function (done) {
await overlay.getOverlayModuleInfo(MODULE_NAME1).then(data => {
Utils.info("GetOverlayModuleInfoModuleNameNotInstall result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("GetOverlayModuleInfoModuleNameNotInstall fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL);
});
overlay.getOverlayModuleInfo(MODULE_NAME1, (err,data) => {
Utils.info("GetOverlayModuleInfoModuleNameNotInstall result" + JSON.stringify(data));
Utils.info("GetOverlayModuleInfoModuleNameNotInstall fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL);
done();
});
})
/*
* @tc.number: SUB_BMS_APPINFO_OVERLAY_0004
* @tc.name: GetOverlayModuleInfoModuleNameNotOverlay
* @tc.desc: Failed to set when the incoming moduleName is not overlay
*/
it('GetOverlayModuleInfoModuleNameNotOverlay', 0, async function (done) {
await overlay.getOverlayModuleInfo(MODULE_NAME).then(data => {
Utils.info("GetOverlayModuleInfoModuleNameNotOverlay result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("GetOverlayModuleInfoModuleNameNotOverlay fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY);
});
overlay.getOverlayModuleInfo(MODULE_NAME, (err,data) => {
Utils.info("GetOverlayModuleInfoModuleNameNotOverlay result" + JSON.stringify(data));
Utils.info("GetOverlayModuleInfoModuleNameNotOverlay fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY);
done();
});
})
/*
* @tc.number: SUB_BMS_APPINFO_OVERLAY_000X
* @tc.name: GetOverlayModuleInfoModuleNameIsOverlay
* @tc.desc: Query succeeded when the moduleName passed in is overlay
*/
it('GetOverlayModuleInfoModuleNameIsOverlay', 0, async function (done) {
await overlay.getOverlayModuleInfo(MODULE_NAME2).then(data => {
Utils.info("GetOverlayModuleInfoModuleNameIsOverlay result" + JSON.stringify(data));
let overlayModuleInfoTest: overlay.OverlayModuleInfo = data;
expect(typeof (overlayModuleInfoTest.bundleName)).assertEqual('string');
expect(data.bundleName).assertEqual("ohos.acts.bundle.overlay.test");
expect(data.moduleName).assertEqual("stage1");
expect(data.targetModuleName).assertEqual("entry1");
expect(data.priority).assertEqual(1);
expect(data.state).assertEqual(2);
}).catch(err => {
Utils.info("GetOverlayModuleInfoModuleNameIsOverlay fail" + JSON.stringify(err));
expect().assertFail()
});
overlay.getOverlayModuleInfo(MODULE_NAME2, (err,data) => {
// "bundleName":"ohos.acts.bundle.overlay.test","moduleName":"stage1","targetModuleName":"entry1","priority":1,"state":2
Utils.info("GetOverlayModuleInfoModuleNameIsOverlay result" + JSON.stringify(data));
Utils.info("GetOverlayModuleInfoModuleNameIsOverlay fail" + JSON.stringify(err));
expect(data.bundleName).assertEqual("ohos.acts.bundle.overlay.test");
expect(data.moduleName).assertEqual("stage1");
expect(data.targetModuleName).assertEqual("entry1");
expect(data.priority).assertEqual(1);
expect(data.state).assertEqual(2);
expect(err).assertNull();
done();
});
})
})
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/GetTargetOverlayModuleInfos.test.ets
0 → 100644
浏览文件 @
6d8ea702
/**
* 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 impligetProfileByAbilityEmptyAbilityCalled.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import overlay from '@ohos.bundle.overlay';
import Utils from "./Utils";
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
const MODULE_NAME = "testModule";
const MODULE_NAME1 = "test1";
const MODULE_NAME2 = "stage1";
const ERROR_INCOMING_MODULE_NAME_NOT_INSTALL = 17700002;
const ERROR_INCOMING_MODULE_NAME_IS_OVERLAY = 17700034;
const ERROR_CODE = 401;
export default function getTargetOverlayModuleInfos() {
describe('getTargetOverlayModuleInfos', function () {
/*
* @tc.number: SUB_BMS_APPINFO_OVERLAY_0006
* @tc.name: GetTargetOverlayModuleInfosModuleNameIsNull
* @tc.desc: The query fails when the incoming moduleName is empty
*/
it('GetTargetOverlayModuleInfosModuleNameIsNull', 0, async function (done) {
try {
await overlay.getTargetOverlayModuleInfos("").then(data => {
Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull fail" + JSON.stringify(err));
expect().assertFail();
});
} catch (e) {
Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull catch" + JSON.stringify(e));
expect(e.code).assertEqual(ERROR_CODE);
}
try {
overlay.getTargetOverlayModuleInfos("", (err,data) => {
Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull result" + JSON.stringify(data));
Utils.info("GetTargetOverlayModuleInfosModuleNameIsNull fail" + JSON.stringify(err));
expect().assertFail();
done();
});
} catch (e) {
Utils.info("SetOverlayEnabledModuleNameIsNull callback catch" + JSON.stringify(e));
expect(e.code).assertEqual(ERROR_CODE);
done();
}
})
/*
* @tc.number: SUB_BMS_APPINFO_OVERLAY_0008
* @tc.name: GetTargetOverlayModuleInfosModuleNameNotInstall
* @tc.desc: The query fails when the incoming moduleName is not installed
*/
it('GetTargetOverlayModuleInfosModuleNameNotInstall', 0, async function (done) {
await overlay.getTargetOverlayModuleInfos(MODULE_NAME1).then(data => {
Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL);
});
overlay.getTargetOverlayModuleInfos(MODULE_NAME1, (err,data) => {
Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall result" + JSON.stringify(data));
Utils.info("GetTargetOverlayModuleInfosModuleNameNotInstall fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL);
done();
});
})
/*
* @tc.number: SUB_BMS_APPINFO_OVERLAY_0009
* @tc.name: GetTargetOverlayModuleInfosModuleNameIsOverlay
* @tc.desc: Failed to set when the incoming moduleName is overlay
*/
it('GetTargetOverlayModuleInfosModuleNameIsOverlay', 0, async function (done) {
await overlay.getTargetOverlayModuleInfos(MODULE_NAME2).then(data => {
Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_IS_OVERLAY);
});
overlay.getTargetOverlayModuleInfos(MODULE_NAME2, (err,data) => {
Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay result" + JSON.stringify(data));
Utils.info("GetTargetOverlayModuleInfosModuleNameIsOverlay fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_IS_OVERLAY);
done();
});
})
})
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
6d8ea702
/*
* 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 SetOverlayEnabled from './SetOverlayEnabled.test.ets';
import GetOverlayModuleInfo from './GetOverlayModuleInfo.test.ets';
import GetTargetOverlayModuleInfos from './GetTargetOverlayModuleInfos.test.ets';
export default function testsuite() {
SetOverlayEnabled();
GetOverlayModuleInfo();
GetTargetOverlayModuleInfos();
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/SetOverlayEnabled.test.ets
0 → 100644
浏览文件 @
6d8ea702
/**
* 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 impligetProfileByAbilityEmptyAbilityCalled.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import overlay from '@ohos.bundle.overlay';
import Utils from "./Utils";
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
const MODULE_NAME = "testModule";
const MODULE_NAME1 = "test1";
const ERROR_INCOMING_MODULE_NAME_NOT_INSTALL = 17700002;
const ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY = 17700033;
const ERROR_CODE = 401;
export default function setOverlayEnabled() {
describe('setOverlayEnabled', function () {
/*
* @tc.number: SUB_BMS_OVERLAY_ENABLED_0001
* @tc.name: SetOverlayEnabledModuleNameIsNull
* @tc.desc: Failed to set when the incoming moduleName is empty
*/
it('SetOverlayEnabledModuleNameIsNull', 0, async function (done) {
try {
await overlay.setOverlayEnabled("", true).then(data => {
console.info("SetOverlayEnabledModuleNameIsNull result1111" + JSON.stringify(data))
Utils.info("SetOverlayEnabledModuleNameIsNull result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("SetOverlayEnabledModuleNameIsNull fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_CODE);
});
} catch (e) {
Utils.info("SetOverlayEnabledModuleNameIsNull catch" + JSON.stringify(e));
expect(e.code).assertEqual(ERROR_CODE);
}
try {
overlay.setOverlayEnabled("", true, (err,data) => {
Utils.info("SetOverlayEnabledModuleNameIsNull result" + JSON.stringify(data));
Utils.info("SetOverlayEnabledModuleNameIsNull fail" + JSON.stringify(err));
expect().assertFail();
done();
});
} catch (e) {
Utils.info("SetOverlayEnabledModuleNameIsNull callback catch" + JSON.stringify(e));
expect(e.code).assertEqual(ERROR_CODE);
done();
}
})
/*
* @tc.number: SUB_BMS_OVERLAY_ENABLED_0005
* @tc.name: SetOverlayEnabledModuleNameNotInstall
* @tc.desc: Failed to set when the incoming moduleName is not installed
*/
it('SetOverlayEnabledModuleNameNotInstall', 0, async function (done) {
await overlay.setOverlayEnabled(MODULE_NAME1, true).then(data => {
Utils.info("SetOverlayEnabledModuleNameNotInstall result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("SetOverlayEnabledModuleNameNotInstall fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL);
});
overlay.setOverlayEnabled(MODULE_NAME1, true, (err,data) => {
Utils.info("SetOverlayEnabledModuleNameNotInstall result" + JSON.stringify(data));
Utils.info("SetOverlayEnabledModuleNameNotInstall fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_INSTALL);
done();
});
})
/*
* @tc.number: SUB_BMS_OVERLAY_ENABLED_0006
* @tc.name: SetOverlayEnabledModuleNameIsNotOverlay
* @tc.desc: Failed to set when the incoming moduleName is not overlay
*/
it('SetOverlayEnabledModuleNameIsNotOverlay', 0, async function (done) {
await overlay.setOverlayEnabled(MODULE_NAME, true).then(data => {
Utils.info("SetOverlayEnabledModuleNameIsNotOverlay result" + JSON.stringify(data));
expect().assertFail();
}).catch(err => {
Utils.info("SetOverlayEnabledModuleNameIsNotOverlay fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY);
});
overlay.setOverlayEnabled(MODULE_NAME, true, (err,data) => {
Utils.info("SetOverlayEnabledModuleNameIsNotOverlay result" + JSON.stringify(data));
Utils.info("SetOverlayEnabledModuleNameIsNotOverlay fail" + JSON.stringify(err));
expect(err.code).assertEqual(ERROR_INCOMING_MODULE_NAME_NOT_OVERLAY);
done();
});
})
})
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/ets/test/Utils.ets
0 → 100644
浏览文件 @
6d8ea702
/**
* 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 hiLog from '@ohos.hilog';
export default class Utils {
static info(str) {
hiLog.info(0 , "BMSTEST" , str);
}
static sleep(time) {
return new Promise((resolve, reject) => {
setTimeout((data) => {
resolve(data)
}, time)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/module.json
0 → 100644
浏览文件 @
6d8ea702
{
"module"
:
{
"name"
:
"testModule"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:testModule_entry_dsc"
,
"mainElement"
:
"ohos.acts.bundle.overlay.test.MainAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"metadata"
:
[
{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"false"
}
],
"abilities"
:
[
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"singleton"
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
],
"metadata"
:
[
{
"name"
:
"ohos.ability.form"
,
"value"
:
""
,
"resource"
:
"$profile:shortcuts_config"
},
{
"name"
:
"ohos.ability.form1"
,
"value"
:
""
,
"resource"
:
"$profile:form_config"
},
{
"name"
:
"ohos.ability.form2"
,
"value"
:
""
,
"resource"
:
"@profile:form_config"
},
{
"name"
:
"ohos.ability.form3"
,
"value"
:
""
,
"resource"
:
"$profile:form_config1"
},
{
"name"
:
"ohos.ability.form4"
,
"value"
:
""
,
"resource"
:
"$profile:invalid"
}
]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility1"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"standard"
,
"orientation"
:
"landscape"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility2"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"landscape_inverted"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility3"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"portrait_inverted"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility4"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"auto_rotation"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility5"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"auto_rotation_landscape"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility6"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"auto_rotation_portrait"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility7"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"auto_rotation_restricted"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility8"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"auto_rotation_landscape_restricted"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility9"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"auto_rotation_portrait_restricted"
,
"skills"
:
[]
},
{
"name"
:
"ohos.acts.bundle.overlay.test.MainAbility10"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:testModule_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"launchType"
:
"specified"
,
"orientation"
:
"locked"
,
"skills"
:
[]
}
],
"extensionAbilities"
:
[
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"metadata"
:
[
{
"name"
:
"ohos.extension.form"
,
"value"
:
""
,
"resource"
:
"$profile:shortcuts_config"
},
{
"name"
:
"ohos.extension.form1"
,
"value"
:
""
,
"resource"
:
"$profile:form_config"
},
{
"name"
:
"ohos.extension.form2"
,
"value"
:
""
,
"resource"
:
"@profile:form_config"
},
{
"name"
:
"ohos.extension.form3"
,
"value"
:
""
,
"resource"
:
"$profile:form_config1"
},
{
"name"
:
"ohos.extension.form4"
,
"value"
:
""
,
"resource"
:
"$profile:invalid"
}
],
"name"
:
"Form"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"form"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"Form1"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"form"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"workScheduler"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"workScheduler"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"inputMethod"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"inputMethod"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"accessibility"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"accessibility"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"fileShare"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"fileShare"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"staticSubscriber"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"staticSubscriber"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"wallpaper"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"wallpaper"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"backup"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"backup"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"window"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"window"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"enterpriseAdmin"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"enterpriseAdmin"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"thumbnail"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"thumbnail"
,
"visible"
:
true
},
{
"description"
:
"$string:form_description"
,
"descriptionId"
:
16777219
,
"icon"
:
"$media:icon"
,
"iconId"
:
16777225
,
"label"
:
"$string:entry_label"
,
"name"
:
"preview"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"type"
:
"preview"
,
"visible"
:
true
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO"
,
"reason"
:
"$string:permission_reason"
,
"usedScene"
:
{
"abilities"
:
[
"MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.READ_CALENDAR"
,
"reason"
:
"$string:permission_reason"
,
"usedScene"
:
{
"abilities"
:
[
"MainAbility"
],
"when"
:
"inuse"
}
}
],
"metadata"
:
[
{
"name"
:
"MetaData1"
,
"value"
:
"MetaDataValue"
,
"resource"
:
"$profile:shortcuts_config"
}
]
}
}
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
6d8ea702
{
"string"
:
[
{
"name"
:
"testModule_entry_dsc"
,
"value"
:
"i am an entry for testModule"
},
{
"name"
:
"testModule_entry_main"
,
"value"
:
"the testModule entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
},
{
"name"
:
"form_FormAbility_desc"
,
"value"
:
"form_description"
},
{
"name"
:
"form_FormAbility_label"
,
"value"
:
"form_label"
},
{
"name"
:
"permission_reason"
,
"value"
:
"Need permission"
}
]
}
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
6d8ea702
15.1 KB
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config.json
0 → 100644
浏览文件 @
6d8ea702
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/form_config1.txt
0 → 100644
浏览文件 @
6d8ea702
{"src": ["MainAbility/pages/index/index","MainAbility/pages/second/second"]}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/invalid.txt
0 → 100644
浏览文件 @
6d8ea702
{
"src": [
"MainAbility/pages/index/index",
"MainAbility/pages/second/second"
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
6d8ea702
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/entry/src/main/resources/base/profile/shortcuts_config.json
0 → 100644
浏览文件 @
6d8ea702
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanageroverlaytest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
6d8ea702
文件已添加
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/GetBundleInfoForSelf.test.ets
浏览文件 @
6d8ea702
...
...
@@ -94,6 +94,7 @@ export default function getBundleInfoForSelf() {
await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then(data => {
console.info("getBundleInfoForSelfApplicationPro" + JSON.stringify(data.appInfo));
checkCommonBundleInfo(data);
expect(bundle.ExtensionAbilityType.PRINT).assertEqual(15);
expect(data.appInfo.bundleType).assertEqual(bundle.BundleType.APP);
expect(data.appInfo.name).assertEqual(BUNDLE_NAME);
expect(data.appInfo.description).assertEqual("$string:description_application");
...
...
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/List.test.ets
浏览文件 @
6d8ea702
...
...
@@ -19,6 +19,7 @@ import getBundleInfoForSelf from './GetBundleInfoForSelf.test.ets';
import getSecondModuleTest from './GetSecondModule.test.ets';
import isDefaultApplicationTest from './IsDefaultApplication.test.ets';
import PublicApiEightTest from './PublicApiEightTest.test.ets';
import PublicApiNineTest from './PublicApiNineTest.test.ets';
export default function testsuite() {
getProfileByAbility();
...
...
@@ -27,4 +28,5 @@ export default function testsuite() {
getSecondModuleTest();
isDefaultApplicationTest();
PublicApiEightTest();
PublicApiNineTest();
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/actsbundlemanagerstagetest/entry/src/main/ets/test/PublicApiNineTest.test.ets
0 → 100644
浏览文件 @
6d8ea702
/**
* 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 impligetProfileByAbilityEmptyAbilityCalled.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import bundle from '@ohos.bundle.bundleManager';
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import util from "./Utils";
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
const BUNDLE_NAME = "ohos.acts.bundle.stage.test";
const MODULE_NAME = "testModule";
const METADATA_NAME = "ohos.ability.form";
const METADATA_NAME1 = "ohos.extension.form1";
const ABILITY_NAME = "ohos.acts.bundle.stage.test.MainAbility";
const ABILITY_NAME1 = "Form";
const PROFILE_JSON_STRING = "{\"src\":[\"MainAbility/pages/index/index\",\"MainAbility/pages/second/second\"]}";
export default function PublicApiNineTest() {
describe('PublicApiNineTest', function () {
/*
* @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0069
* @tc.name: getBundleInfoForSelfProTest
* @tc.desc: Test getBundleInfoForSelf of API9 in version9 normal project
*/
it('getBundleInfoForSelfProTest', 0, async function (done) {
await bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT).then(data => {
util.info("getBundleInfoForSelfPro" + JSON.stringify(data));
expect(data.name).assertEqual(BUNDLE_NAME);
}).catch(err => {
util.info("getBundleInfoForSelf fail" + JSON.stringify(err));
expect(err).assertFail();
})
bundle.getBundleInfoForSelf(bundle.BundleFlag.GET_BUNDLE_INFO_DEFAULT, (err, data) => {
expect(data.name).assertEqual(BUNDLE_NAME);
expect(err).assertEqual(null);
done();
})
});
/*
* @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0070
* @tc.name: getProfileByAbilityTest
* @tc.desc: Test getProfileByAbility of API9 in version9 normal project
*/
it('getProfileByAbilityTest', 0, async function (done) {
await bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME).then(data => {
util.info('getProfileByAbility promise data is: ' + JSON.stringify(data));
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
}).catch(err => {
util.info('getProfileByAbility failed. Cause: ' + JSON.stringify(err));
expect().assertFail();
})
bundle.getProfileByAbility(MODULE_NAME, ABILITY_NAME, METADATA_NAME, (err, data) => {
util.info('getProfileByAbility failed. Cause: ' + JSON.stringify(err));
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
done();
})
});
/*
* @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0071
* @tc.name: getProfileByExtensionAbilityTest
* @tc.desc: Test getProfileByExtensionAbility of API9 in version9 normal project
*/
it('getProfileByExtensionAbilityPromise', 0, async function (done) {
await bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME1, METADATA_NAME1).then(data => {
util.info('getProfileByExtensionAbility promise data is: ' + JSON.stringify(data));
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
}).catch(err => {
util.info('getProfileByExtensionAbility failed. Cause: ' + JSON.stringify(err));
expect().assertFail();
})
bundle.getProfileByExtensionAbility(MODULE_NAME, ABILITY_NAME1, METADATA_NAME1, (err, data) => {
util.info('getProfileByExtensionAbility failed. Cause: ' + JSON.stringify(err));
expect(data[0]).assertEqual(PROFILE_JSON_STRING);
done();
})
});
/**
* @tc.number: SUB_BMS_SYSTEMAPI_RUNNIING_0072
* @tc.name: isDefaultApplicationTest
* @tc.desc: Test isDefaultApplication of API9 in version9 normal project
*/
it('isDefaultApplication_0100', 0, async function (done) {
await defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.IMAGE).then(data => {
expect(data).assertFalse()
}).catch(err => {
expect().assertFail();
})
defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.IMAGE, (err, data) => {
util.info("isDefaultApplication_0100 data--- " + data)
util.info("isDefaultApplication_0100 err--- " + err)
expect(data).assertFalse()
expect(err).assertEqual(null)
done()
})
});
})
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/app.json
0 → 100644
浏览文件 @
6d8ea702
{
"app"
:{
"bundleName"
:
"ohos.acts.bundle.overlay.test"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
6d8ea702
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/BUILD.gn
0 → 100644
浏览文件 @
6d8ea702
# 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("bmsOverlayDemo") {
hap_profile = "entry/src/main/module.json"
hap_name = "bmsOverlayDemo"
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "signature/openharmony_sx.p7b"
}
ohos_app_scope("bmsoverlaydemo_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("hjs_demo_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":bmsoverlaydemo_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/Test.json
0 → 100644
浏览文件 @
6d8ea702
{
"description"
:
"Configuration for hjunit demo Tests"
,
}
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
6d8ea702
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/FormAbility/FormAbility.ts
0 → 100644
浏览文件 @
6d8ea702
import
FormExtension
from
'
@ohos.app.form.FormExtensionAbility
'
;
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
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
6d8ea702
import
Ability
from
'
@ohos.app.ability.UIAbility
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/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
"
)
}
};
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/ServiceAbility/FormAbility.ts
0 → 100644
浏览文件 @
6d8ea702
import
FormExtension
from
'
@ohos.app.form.FormExtensionAbility
'
;
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
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/index/index.ets
0 → 100644
浏览文件 @
6d8ea702
/*
* 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 file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"
import testsuite from "../../test/List.test.ets"
@Entry
@Component
struct Index {
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()
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters)
testsuite(globalThis.abilityContext)
core.execute()
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/pages/second/second.ets
0 → 100644
浏览文件 @
6d8ea702
/*
* 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 router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
6d8ea702
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default function testsuite(context) {
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/module.json
0 → 100644
浏览文件 @
6d8ea702
{
"module"
:
{
"name"
:
"stage1"
,
"type"
:
"feature"
,
"targetModuleName"
:
"entry1"
,
"targetPriority"
:
1
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"metadata"
:
[
{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"false"
}
]
}
}
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
6d8ea702
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
},
{
"name"
:
"form_FormAbility_desc"
,
"value"
:
"form_description"
},
{
"name"
:
"form_FormAbility_label"
,
"value"
:
"form_label"
}
]
}
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
6d8ea702
15.1 KB
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/form_config.json
0 → 100644
浏览文件 @
6d8ea702
{
"forms"
:
[
{
"isDefault"
:
true
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
},
{
"isDefault"
:
true
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget1"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"1*2"
,
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
},
{
"isDefault"
:
true
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget2"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
},
{
"isDefault"
:
true
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget3"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
}
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
6d8ea702
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
bundlemanager/bundle_standard/bundlemanager/sceneProject/bmsoverlaydemo/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
6d8ea702
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录