= 0).assertTrue()
- done()
- })
-
/**
* @tc.number: ACTS_AACommand_finishTest_0300
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
@@ -551,43 +374,6 @@ export default function abilityTest() {
done()
})
- /**
- * @tc.number: ACTS_AACommand_finishTest_0800
- * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
- * AsyncCallback
- * mode. The msg parameter is invalid(including Chinese and special characters) and the
- * code parameter is valid (“ABCD”)
- * @tc.desc: Verify that the process of the test framework is not stopped by calling this interface.
- */
- it('ACTS_AACommand_finishTest_0800', 0, async function (done) {
- console.log("ACTS_AACommand_finishTest_0800 --- start")
- expect(globalThis.stdResult31.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
- done()
- })
-
- /**
- * @tc.number: ACTS_AACommand_finishTest_1000
- * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
- * mode. The msg parameter is invalid(null) and the code parameter is valid (1)
- * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
- */
- it('ACTS_AACommand_finishTest_1000', 0, async function (done) {
- console.log("ACTS_AACommand_finishTest_1000 --- start")
- expect(globalThis.stdResult32.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
- done()
- })
-
- /**
- * @tc.number: ACTS_AACommand_finishTest_1100
- * @tc.name: The parameters of the test command are valid, and the finishTest interface is called in Promise
- * mode. The msg parameter is invalid(undefined) and the code parameter is valid (1)
- * @tc.desc: Verify that the process of the test framework can be stopped by calling this interface.
- */
- it('ACTS_AACommand_finishTest_1100', 0, async function (done) {
- console.log("ACTS_AACommand_finishTest_1100 --- start")
- expect(globalThis.stdResult33.indexOf("com.example.aacommandrelyhap") >= 0).assertTrue()
- done()
- })
/**
* @tc.number: ACTS_AACommand_finishTest_1600
* @tc.name: The parameters of the test command are valid, and the finishTest interface is called in
diff --git a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json
index 96db0c371f6341dbf2ed7025e2dcedd77b341fac..19cd72eca96fa364da0aae5c8892e0e7eb0848d0 100644
--- a/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json
+++ b/ability/ability_runtime/aacommand/AACommandtest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_test_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -21,6 +22,7 @@
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
+ "launchType": "singleton",
"skills": [
{
"entities": [
diff --git a/ability/ability_runtime/aacommand/BUILD.gn b/ability/ability_runtime/aacommand/BUILD.gn
index 644135d438f8c8576e8d3f2fb9fd9a3256bb1283..64fec3878c9d1d9ce98532fb68b91dffbb1cfcc1 100644
--- a/ability/ability_runtime/aacommand/BUILD.gn
+++ b/ability/ability_runtime/aacommand/BUILD.gn
@@ -19,6 +19,7 @@ group("aacommand") {
deps = [
"AACommand07:AACommand07",
"AACommand08:AACommand08",
+ "AACommandPrintOneTest:ActsAACommandPrintOneTest",
"AACommandPrintSync:AACommandPrintSync",
"AACommandPrintSyncTest:ActsAACommandPrintSyncTest",
"AACommandRelyHap:AACommandRelyHap",
diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/src/main/config.json
index 92e6a35a32b5b6d328ef13185401ab8e305defcc..e68dd4067e1d3d1a2d249e7ff4e48e716027a94e 100644
--- a/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamscallbackfifthscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/src/main/config.json
index 08626438965d52dad65503a4dad984dc99774724..98b5a3ac6a31d61a11bc69961f4a3eab3c7816e8 100644
--- a/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamscallbackfirstscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/src/main/config.json
index 4d0fbdc896090ed05980b57b4463d9c989a8dbe8..c13a28be2b4c8702f3ec2ae3eeb4115104c6dd67 100644
--- a/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamscallbackfourthscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/src/main/config.json
index 42a625c57bf984e35fdee29967f8cc87d362fb25..e6b6b649761ccdb21a70964c73dd6856530bccfd 100644
--- a/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamscallbacksecondscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/src/main/config.json
index 98f7d882be177dd78143aa3c4f7575f5c458b4a5..75d5900a2019ef12df78165d534d13842c7e6650 100644
--- a/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamscallbackthirdscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/src/main/config.json
index 84a1ef48066bb38570eb16606ff13a12e44c5063..c2b7d9418c177863be212483c4283cdcf0eb8e00 100644
--- a/ability/ability_runtime/abilitymanager/actsamstestfifthscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamstestfifthscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/src/main/config.json
index 89355be858387a8e59792bf9fbf9e0be39814cdd..0ee07351d8c166702544d07a6a2d00ecda507ab5 100644
--- a/ability/ability_runtime/abilitymanager/actsamstestfirstscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamstestfirstscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/src/main/config.json
index 76e63afa3d5607148d98d956f8ebf4466bc5d539..78cb23d926127618280a31b2dd9f24643cae7881 100644
--- a/ability/ability_runtime/abilitymanager/actsamstestfourthscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamstestfourthscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/src/main/config.json
index c28a0df5fa67a140fd34de540d64271526a055a7..56d9adbc0f51e479d148a1856212c0dc66a7a8b3 100644
--- a/ability/ability_runtime/abilitymanager/actsamstestsecondscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamstestsecondscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/src/main/config.json b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/src/main/config.json
index 4885d8a231c4551314be3bc456edd44afd201bfc..89e35043d00c179ac285b3eb92a8441e6aeaa9e3 100644
--- a/ability/ability_runtime/abilitymanager/actsamstestthirdscene/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/actsamstestthirdscene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json
index de20a4362f25370f1e4cfccc2e5469d102ede3d5..c78ab63a3c993aaef684b3b8cf9f89e36c2300b6 100644
--- a/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateEAbility/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.simulateeability",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json
index b5b8e428c62b3cdbc61c2d65cdbfe3ac45c516a3..e7ad9a86fb7ab3b398fb26195de20b50e290043d 100644
--- a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilityFir/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.simulatefabilityfir",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json
index 52cca5948ec80701f2972868ea59f9c17ea02b9a..c2f3e47b6d636d1d9a06a2de0a2a8789deb79de9 100644
--- a/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/sceneProject/simulateFAbilitySed/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.simulatefabilitysed",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json
index 367fbe56ff60319a84ec93f1b4685f959931ed23..8c82d1fcef030581bba3da2cd1b7e36fe053f9dd 100644
--- a/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyAAbility/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.verifyaability",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json
index 82b3340659f1fa47a1ed9e3651f0760f261a3219..42fc6c622a090f0ae9773463008570cd03a76446 100644
--- a/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json
+++ b/ability/ability_runtime/abilitymanager/sceneProject/verifyIAbility/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.verifyiability",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets
index 37cbf1f99eb45f18ed24e7e79b360cbb2872bbdd..9b3273043183ca68cf2b29f66291b87c1aaa532e 100644
--- a/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/abilitymontior/entry/src/main/ets/test/Ability.test.ets
@@ -109,7 +109,10 @@ export default function abilityTest() {
data.addAbilityMonitor(
{
abilityName: 'MainAbility2',
- onAbilityForeground: onAbilityForeground
+ onAbilityForeground: onAbilityForeground,
+ onWindowStageRestore:(Ability)=>{
+ console.info("===>onWindowStageRestore");
+ }
}, (async (err) => {
console.debug("====>ACTS_AddAbilityMonitor_0200 success====>" + err.code);
await globalThis.abilitydelegator.startAbility(
diff --git a/ability/ability_runtime/abilitymontior/entry/src/main/module.json b/ability/ability_runtime/abilitymontior/entry/src/main/module.json
index f5cda5bfa8510fc7353208936a4191a2bb79f29e..3d6e72c4cb3194bbd8746295d68afddd6e3bb1ea 100644
--- a/ability/ability_runtime/abilitymontior/entry/src/main/module.json
+++ b/ability/ability_runtime/abilitymontior/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -58,6 +59,12 @@
"visible": true,
"launchType": "singleton"
}
+ ],
+ "reqPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json
index 2eb330f80879cf5576e42523fd33c776b7c5cb98..f23724b5b11b5d4ee49c433a7a835f2818ec1ce3 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappa/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -74,6 +75,10 @@
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json
index 59947d2cd26bc6812931955346af8c9d7171f76f..eb64059ad8bb44d87ef639af6a917e76f0ada5c0 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappb/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -74,6 +75,10 @@
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json
index cc9c505c9ec155b96ff3cb20f89d2b8baffeffec..1ac01030cac5fa90199bd4dff131195655ac2b25 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappc/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -74,6 +75,10 @@
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json
index 14d28d9b42e2ec310f2a1f3382183bc6b4183cd2..980d4d28b712f00348fb7ffa27f4e7a41c36f4dd 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -114,6 +115,10 @@
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json
index 7aefa80545212cec61c3b43e96ccae313ecaab5b..9c0f79b26fe4512bea5abb961089d563a9a7f75a 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/config.json
@@ -21,6 +21,7 @@
"package": "com.example.amsabilitymultiinstanceappe",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -77,6 +78,10 @@
{
"name": "ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
index 6d4dc7c06648df436d0c1b7fd7683f5e66b6f030..a7588ad77f5f08bc17b9b26c76461798cca2d735 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -13,12 +13,23 @@
* limitations under the License.
*/
import Ability from '@ohos.application.Ability'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
onCreate(want,launchParam){
// Ability is creating, initialize resources for this ability
console.log("AbilityMultiInstanceTest onCreate")
globalThis.abilityWant = want;
+
+ globalThis.abilityContext = this.context
+ let abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ let abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
@@ -29,7 +40,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("AbilityMultiInstanceTest onWindowStageCreate")
- globalThis.abilityContext = this.context
+
windowStage.setUIContent(this.context, "pages/index/index", null)
console.log("AbilityMultiInstanceTest onWindowStageCreate finish")
}
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets
index 8104a9e406943f5c5320809295495863e5ec128e..88f0dd53fa9780e4262830d1922a633c8fc1fd88 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/pages/index/index.ets
@@ -13,20 +13,11 @@
* limitations under the License.
*/
-import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
-import { Hypium } from '@ohos/hypium'
-import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
aboutToAppear(){
- let abilityDelegator: any
- abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
- let abilityDelegatorArguments: any
- abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
- console.info('start run testcase!!!')
- Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets
index 8b530adededf7147f149694a410055b5b55f0cac..c13edd358fd36710b9247a9c50a67ce8afd77d9c 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets
@@ -91,6 +91,25 @@ async function startAbilityProcess(abilityContext, parameters) {
export default function abilityTest(abilityContext) {
describe('ActsAbilityTest', function () {
+ let TAG1 = "ACTS_AbilityMultiInstance_Single == ";
+ afterEach(async (done) => {
+ console.log(TAG1 + "afterEach called");
+ let wantInfo = {
+ bundleName: "com.example.abilitymultiinstance",
+ abilityName: "com.example.abilitymultiinstance.MainAbility"
+ }
+ await abilityContext.startAbility(wantInfo).then((data) => {
+ console.log(TAG1 + "startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log(TAG1 + "startAbility err : " + JSON.stringify(err));
+ })
+
+ setTimeout(function () {
+ console.log(TAG1 + "afterEach end");
+ done();
+ }, 500);
+ })
+
/*
* @tc.number: ACTS_AbilityMultiInstance_Multi_0100
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json
index 8938ebbbcead80c8831f3ebcbf00154338442246..0156baf35e7675c7c13e4ee3370c373bf7ee4453 100644
--- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json
+++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -74,6 +75,10 @@
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
diff --git a/ability/ability_runtime/abilitystagemonitor/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..c62db0ce5753f5e760fa45d10cc27b1351abdda5
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/BUILD.gn
@@ -0,0 +1,30 @@
+# 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("abilitystagemonitor") {
+ testonly = true
+ if (is_standard_system) {
+ deps = [
+ "abilitystagemonitorassista:AbilityStageMonitorAssistA",
+ "abilitystagemonitorassistc:AbilityStageMonitorAssistC",
+ "abilitystagemonitorassistd:AbilityStageMonitorAssistD",
+ "abilitystagemonitorassiste:AbilityStageMonitorAssistE",
+ "abilitystagemonitorassistf:AbilityStageMonitorAssistF",
+ "abilitystagemonitorassistg:AbilityStageMonitorAssistG",
+ "abilitystagemonitorassisth:AbilityStageMonitorAssistH",
+ "abilitystagemonitortest:ActsAbilityStageMonitorTest",
+ ]
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/multimedia/camera/cameraDepthOffield/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from multimedia/camera/cameraDepthOffield/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..b9cede19023aa0737cac207eb3b630ea1d14f12a
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("AbilityStageMonitorAssistA") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitorassista_js_assets",
+ ":abilitystagemonitorassista_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "AbilityStageMonitorAssistA"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitorassista_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitorassista_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitorassista_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitorassista_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1c0b9c74e71d497764f791d25187cd511ca8d64a
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,45 @@
+/*
+* 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.info('MainAbilityMonitor onCreate')
+ }
+
+ onDestroy() {
+ console.info('MainAbilityMonitor onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.info('MainAbilityMonitor onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.info('MainAbilityMonitor onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.info('MainAbilityMonitor onForeground')
+ }
+
+ onBackground() {
+ console.info('MainAbilityMonitor onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2061615571be9e4e28c4f2c1ea5b231b4a063681
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+* 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 {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ console.info('start run testcase!!!')
+ }
+
+ @State message: string = 'MainAbility Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..e9c2e405452a71c68db0b60e163585b366891e0c
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature_assista",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..127ea0d94555366c6888ac530babae4bf4cc1299
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "assista"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/multimedia/camera/cameraExceedWideAngle/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from multimedia/camera/cameraExceedWideAngle/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..951f0a2b8d54f94311cb88cbedae68c9d56fcb49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/request/RequestTest_ets/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/signature/openharmony_sx.p7b
old mode 100755
new mode 100644
similarity index 100%
rename from request/RequestTest_ets/signature/openharmony_sx.p7b
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassista/signature/openharmony_sx.p7b
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/multimedia/camera/cameraLongFocus/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from multimedia/camera/cameraLongFocus/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..8b29ea6397bcb51b7a82007bfbca358be1979b0e
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("AbilityStageMonitorAssistC") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitorassistc_js_assets",
+ ":abilitystagemonitorassistc_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "AbilityStageMonitorAssistC"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitorassistc_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitorassistc_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitorassistc_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitorassistc_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54fb016cfb5876920e658414ee16d35ba6869df9
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,46 @@
+/*
+* 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.info('MainAbilityMonitor onCreate')
+ }
+
+
+ onDestroy() {
+ console.info('MainAbilityMonitor onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.info('MainAbilityMonitor onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.info('MainAbilityMonitor onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.info('MainAbilityMonitor onForeground')
+ }
+
+ onBackground() {
+ console.info('MainAbilityMonitor onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..9e23418836be1e36fc7823c36138cc343029122f
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+* 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 {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ console.info('start run testcase!!!')
+ }
+
+ @State message: string = 'MainAbility2 Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..2dc69255f983edb8593e020b6fcc73a225d1d31f
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature_assistc",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility2",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility2",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:MainAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..164db31071950c97cb9a00f325391560598c9d08
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "assistc"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/multimedia/camera/cameraUnspc/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from multimedia/camera/cameraUnspc/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..951f0a2b8d54f94311cb88cbedae68c9d56fcb49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/time/TimeTest_js/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/signature/openharmony_sx.p7b
similarity index 100%
rename from time/TimeTest_js/signature/openharmony_sx.p7b
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistc/signature/openharmony_sx.p7b
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/multimedia/camera/cameraWideAngle/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from multimedia/camera/cameraWideAngle/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..baeca91f57855eec19490cdfb4b74f927adbd3ae
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("AbilityStageMonitorAssistD") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitorassistd_js_assets",
+ ":abilitystagemonitorassistd_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "AbilityStageMonitorAssistD"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitorassistd_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitorassistd_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitorassistd_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitorassistd_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54fb016cfb5876920e658414ee16d35ba6869df9
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,46 @@
+/*
+* 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.info('MainAbilityMonitor onCreate')
+ }
+
+
+ onDestroy() {
+ console.info('MainAbilityMonitor onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.info('MainAbilityMonitor onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.info('MainAbilityMonitor onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.info('MainAbilityMonitor onForeground')
+ }
+
+ onBackground() {
+ console.info('MainAbilityMonitor onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..46cbf8478ea057c90ac54be87cc5db177cbe3277
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+* 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 {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ console.info('start run testcase!!!')
+ }
+
+ @State message: string = 'MainAbility3 Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..1ab7e76239d8938364fcbe5f83157302d3e00425
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature_assistd",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility3",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility3",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:MainAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..d43bdd43148a9f58f156952ae728af724fc08507
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "assistd"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/multimedia/camera/cameraWideAngleRK/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from multimedia/camera/cameraWideAngleRK/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..951f0a2b8d54f94311cb88cbedae68c9d56fcb49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/time/TimerTest_js/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/signature/openharmony_sx.p7b
similarity index 100%
rename from time/TimerTest_js/signature/openharmony_sx.p7b
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistd/signature/openharmony_sx.p7b
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/multimedia/media/media_js_standard/recorderProfile/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from multimedia/media/media_js_standard/recorderProfile/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..cfe38a642640a6d7ee45e5d454d335b4b5f66d5e
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("AbilityStageMonitorAssistE") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitorassiste_js_assets",
+ ":abilitystagemonitorassiste_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "AbilityStageMonitorAssistE"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitorassiste_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitorassiste_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitorassiste_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitorassiste_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54fb016cfb5876920e658414ee16d35ba6869df9
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,46 @@
+/*
+* 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.info('MainAbilityMonitor onCreate')
+ }
+
+
+ onDestroy() {
+ console.info('MainAbilityMonitor onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.info('MainAbilityMonitor onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.info('MainAbilityMonitor onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.info('MainAbilityMonitor onForeground')
+ }
+
+ onBackground() {
+ console.info('MainAbilityMonitor onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c1c0f2c9122aa6dcf2ae920ad25df61d783654ea
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+* 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 {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ console.info('start run testcase!!!')
+ }
+
+ @State message: string = 'MainAbility4 Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..ba8c50bb286d033861ce929d3ff32047aca40522
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature_assiste",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility4",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility4",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:MainAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..4590c7b559ea45c68c440646e0057ea2785737e9
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "assiste"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/media/icon.png
old mode 100755
new mode 100644
similarity index 100%
rename from multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..951f0a2b8d54f94311cb88cbedae68c9d56fcb49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassiste/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/actsansnotificationcancel/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..43c41360dbf985790a8398db2a3c7724ccdbb4ba
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("AbilityStageMonitorAssistF") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitorassistf_js_assets",
+ ":abilitystagemonitorassistf_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "AbilityStageMonitorAssistF"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitorassistf_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitorassistf_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitorassistf_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitorassistf_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54fb016cfb5876920e658414ee16d35ba6869df9
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,46 @@
+/*
+* 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.info('MainAbilityMonitor onCreate')
+ }
+
+
+ onDestroy() {
+ console.info('MainAbilityMonitor onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.info('MainAbilityMonitor onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.info('MainAbilityMonitor onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.info('MainAbilityMonitor onForeground')
+ }
+
+ onBackground() {
+ console.info('MainAbilityMonitor onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..cfe56a48a83be655cb302d0fdc1abb6c2d28587b
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+* 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 {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ console.info('start run testcase!!!')
+ }
+
+ @State message: string = 'MainAbilityf5 Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..14299d215f1fb8c4f9cf87a00c4915cfa2ecdb8e
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature_assistf",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbilityf5",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbilityf5",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:MainAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..917bbd6315734ee7f1795e4dcb90b91a2a92a4a3
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "assistf"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/actsansnotificationremove/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/actsansnotificationremove/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..951f0a2b8d54f94311cb88cbedae68c9d56fcb49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistf/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..e2c7c7007078605e459a4dea05160507135c5980
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("AbilityStageMonitorAssistG") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitorassistg_js_assets",
+ ":abilitystagemonitorassistg_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "AbilityStageMonitorAssistG"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitorassistg_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitorassistg_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitorassistg_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitorassistg_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54fb016cfb5876920e658414ee16d35ba6869df9
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,46 @@
+/*
+* 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.info('MainAbilityMonitor onCreate')
+ }
+
+
+ onDestroy() {
+ console.info('MainAbilityMonitor onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.info('MainAbilityMonitor onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.info('MainAbilityMonitor onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.info('MainAbilityMonitor onForeground')
+ }
+
+ onBackground() {
+ console.info('MainAbilityMonitor onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0aeb88ca7ed660425c541ce8b0ede058251520c6
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+* 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 {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ console.info('start run testcase!!!')
+ }
+
+ @State message: string = 'MainAbility6 Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..d17f8659db601fc0d0ede59773a66a56cd4dc1cf
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature_assistg",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility6",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility6",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:MainAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..d256cdf5bc0751684f2a4f8ef597249ed07d3327
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "assistg"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..951f0a2b8d54f94311cb88cbedae68c9d56fcb49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassistg/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..86b710629d25f9fae7c89d39f317c2bdf84b10cf
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("AbilityStageMonitorAssistH") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitorassisth_js_assets",
+ ":abilitystagemonitorassisth_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "AbilityStageMonitorAssistH"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitorassisth_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitorassisth_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitorassisth_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitorassisth_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54fb016cfb5876920e658414ee16d35ba6869df9
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,46 @@
+/*
+* 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.info('MainAbilityMonitor onCreate')
+ }
+
+
+ onDestroy() {
+ console.info('MainAbilityMonitor onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.info('MainAbilityMonitor onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.info('MainAbilityMonitor onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.info('MainAbilityMonitor onForeground')
+ }
+
+ onBackground() {
+ console.info('MainAbilityMonitor onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f156d9ceff6824421a7bd4ce79522ac64b61f1c0
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+* 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 {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ console.info('start run testcase!!!')
+ }
+
+ @State message: string = 'MainAbility7 Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..af9885f310f2f6c6f2c08fee63c4f9c40aed967c
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature_assistg",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility7",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility7",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:MainAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..b5cafcc1c21c8e487c4b840c9506186455d87ed1
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "assisth"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..951f0a2b8d54f94311cb88cbedae68c9d56fcb49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitorassisth/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/app.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a921834bca84e37cf76efb5d0a4921c279cafa63
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.abilitystagemonitortest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ec48a8748ea2b8c0babde132baba30c5503a0918
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AbilityStageMonitor"
+ }
+ ]
+}
diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/BUILD.gn b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..90f1d5de6f3f4f36024e8b05f4e48aa18036b4ee
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/BUILD.gn
@@ -0,0 +1,43 @@
+# 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("ActsAbilityStageMonitorTest") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":abilitystagemonitor_js_assets",
+ ":abilitystagemonitor_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsAbilityStageMonitorTest"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("abilitystagemonitor_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("abilitystagemonitor_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("abilitystagemonitor_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":abilitystagemonitor_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/Test.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..9812e158e9648a33f32e8a27baefae42c62dd510
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/Test.json
@@ -0,0 +1,28 @@
+{
+ "description": "Configuration for aceceshi Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.example.abilitystagemonitortest",
+ "module-name": "entry_test",
+ "shell-timeout": "600000",
+ "testcase-timeout": "15000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsAbilityStageMonitorTest.hap",
+ "AbilityStageMonitorAssistA.hap",
+ "AbilityStageMonitorAssistC.hap",
+ "AbilityStageMonitorAssistD.hap",
+ "AbilityStageMonitorAssistE.hap",
+ "AbilityStageMonitorAssistF.hap",
+ "AbilityStageMonitorAssistG.hap",
+ "AbilityStageMonitorAssistH.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
+
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/Application/TestAbilityStage.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/Application/TestAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e51ff9632d6371ef35f5b56c7af455e3b8687949
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/Application/TestAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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.info("MyAbilityStageMonitor onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/TestAbility.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/TestAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d1317f99b914d3bc27274c9ade6bc4a8b62a47fd
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/TestAbility.ts
@@ -0,0 +1,51 @@
+/*
+ * 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'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
+
+export default class TestAbility extends Ability {
+ onCreate(want, launchParam) {
+ globalThis.abilityContext = this.context;
+ console.info('TestAbility onCreate')
+ let abilityDelegatorArguments: any
+ let abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ }
+
+ onDestroy() {
+ console.log('TestAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('TestAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'TestAbility/pages/index', null)
+ }
+
+ onWindowStageDestroy() {
+ console.log('TestAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('TestAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('TestAbility onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c6e79e8ce9ce787c085cf32507c73a4d2a63a42c
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestAbility/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 {
+ aboutToAppear() {
+ console.info('TestAbility index aboutToAppear')
+ }
+ @State message: string = 'TestAbility Hello'
+ 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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e9555725ac68e84cbe76bdac9294719a0ecfc3f4
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2022 Huawei Device Co., Ltd.
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import TestRunner from '@ohos.application.testRunner'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+let abilityDelegator = undefined
+let abilityDelegatorArguments = undefined
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s it',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s dryRun'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ targetParams = `${targetParams} ${key} ${parameters[key]}`
+ }
+ }
+ return targetParams.trim()
+}
+
+async function onAbilityCreateCallback() {
+ console.log("onAbilityCreateCallback");
+}
+
+async function addAbilityMonitorCallback(err: any) {
+ console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
+}
+
+export default class OpenHarmonyTestRunner implements TestRunner {
+ constructor() {
+ }
+
+ onPrepare() {
+ console.info("OpenHarmonyTestRunner OnPrepare ")
+ }
+
+ async onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ globalThis.abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'
+ let lMonitor = {
+ abilityName: testAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ let cmd = 'aa start -d 0 -a TestAbility' + ' -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
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/AbilityStageMonitor.test.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/AbilityStageMonitor.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8bdca59c2a7c62bfe7a7fcb79402f79f27328341
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/AbilityStageMonitor.test.ets
@@ -0,0 +1,546 @@
+/*
+ * 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, it, expect, afterEach } from '@ohos/hypium'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+let moduleName1: any
+let monitor: any
+let want: any
+let timeout = 3000;
+let addMonitor = false;
+let removeMonitor = false;
+
+function sleep(delay) {
+ let start = (new Date()).getTime();
+ while ((new Date()).getTime() - start < delay) {
+ continue;
+ }
+}
+function test(time) {
+ sleep(time);
+}
+
+export default function abilityStageMonitorTest() {
+ describe('ActsAbilityTest', function () {
+
+ afterEach(async (done) => {
+ console.log("SUB_AA_AbilityStageMonitor afterEach called");
+ let wantInfo = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "TestAbility"
+ }
+ await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
+ console.log("SUB_AA_AbilityStageMonitor startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("SUB_AA_AbilityStageMonitor startAbility err : " + JSON.stringify(err));
+ })
+
+ setTimeout(function () {
+ console.log("SUB_AA_AbilityStageMonitor afterEach called");
+ done();
+ }, 1000);
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0100
+ * @tc.name: Call waitAbilityStageMonitor in the form of callback, and enter the monitor
+ * @tc.desc: Verify that the callback form of waitAbilityStageMonitor can get the abilityStage instance
+ * @tc.level: 1
+ */
+ it('SUB_AA_AbilityStageMonitor_0100', 0, async function (done) {
+ console.info("SUB_AA_AbilityStage_0100 begin")
+
+ monitor = {
+ moduleName: "feature_assista",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ try {
+ console.info("SUB_AA_AbilityStage_0100 wait abilityStage");
+ abilityDelegator.waitAbilityStageMonitor(monitor, (err, data) => {
+ console.log("SUB_AA_AbilityStage_0100 waitAbilityStageMonitor callback " +
+ "err = " + err + ", data = " + JSON.stringify(data));
+ moduleName1 = data.context.currentHapModuleInfo.name;
+ expect(moduleName1).assertEqual(monitor.moduleName)
+ done();
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStage_0100 waitAbilityStageMonitor callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+
+ console.info("SUB_AA_AbilityStage_0100 start ability");
+
+ want = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "MainAbility"
+ };
+
+ try {
+ abilityDelegator.startAbility(want, (err, data) => {
+ console.info("SUB_AA_AbilityStage_0100 startAbility callback err: " + JSON.stringify(err) + "data: " + JSON.stringify(data));
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStage_0100 startAbility callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0200
+ * @tc.name: Call waitAbilityStageMonitor in the form of a promise, and enter the monitor
+ * @tc.desc: Verify that the promise form of waitAbilityStageMonitor can get the abilityStage instance
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0200', 0, async function (done) {
+ console.log("SUB_AA_AbilityStage_0100 begin")
+
+ monitor = {
+ moduleName: "feature_assistd",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ console.log("SUB_AA_AbilityStageMonitor_0200 wait abilityStage");
+
+ abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
+ console.log("SUB_AA_AbilityStageMonitor_0200 waitAbilityStageMonitor promise " +
+ "abilityStage: " + JSON.stringify(abilityStage));
+ moduleName1 = abilityStage.context.currentHapModuleInfo.name;
+ expect(moduleName1).assertEqual(monitor.moduleName)
+ done();
+ }).catch((err) => {
+ console.log("SUB_AA_AbilityStageMonitor_0200 waitAbilityStageMonitor err: " + JSON.stringify(err));
+ expect().assertFail()
+ done()
+ })
+
+ console.log("SUB_AA_AbilityStageMonitor_0200 start ability");
+
+ want = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "MainAbility3"
+ };
+
+ try {
+ abilityDelegator.startAbility(want, (err, data) => {
+ console.log("SUB_AA_AbilityStageMonitor_0200 startAbility callback err: " +
+ JSON.stringify(err) + "data: " + JSON.stringify(data));
+ });
+ } catch (error) {
+ console.log("SUB_AA_AbilityStageMonitor_0200 startAbility callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0300
+ * @tc.name: Call waitAbilityStageMonitor in the form of callBack, enter the monitor, timeout
+ * @tc.desc: Verify that the callback form of waitAbilityStageMonitor can get the abilityStage instance
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0300', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_0300 begin")
+
+ monitor = {
+ moduleName: "feature_assistf",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ try {
+ console.info("SUB_AA_AbilityStageMonitor_0300 wait abilityStage");
+ abilityDelegator.waitAbilityStageMonitor(monitor, timeout, (err, data) => {
+ moduleName1 = data.context.currentHapModuleInfo.name;
+ console.info("SUB_AA_AbilityStageMonitor_0300 waitAbilityStageMonitor callback, err: " +
+ err + ", data =" + JSON.stringify(data));
+ expect(moduleName1).assertEqual(monitor.moduleName)
+ done();
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStageMonitor_0300 waitAbilityStageMonitor callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_0300 start ability");
+
+ want = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "MainAbilityf5"
+ };
+
+ try {
+ abilityDelegator.startAbility(want, (err, data) => {
+ console.info("SUB_AA_AbilityStageMonitor_0300 startAbility callback err: " +
+ JSON.stringify(err) + "data: " + JSON.stringify(data));
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStageMonitor_0300 startAbility callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0400
+ * @tc.name: Call waitAbilityStageMonitor in the form of promise, input monitor, timeout
+ * @tc.desc: Verify that the promise form of waitAbilityStageMonitor can get the abilityStage instance
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0400', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_0400 begin")
+
+ monitor = {
+ moduleName: "feature_assistc",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_0400 wait abilityStage");
+
+ abilityDelegator.waitAbilityStageMonitor(monitor, timeout).then((abilityStage) => {
+ moduleName1 = abilityStage.context.currentHapModuleInfo.name;
+ console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " +
+ JSON.stringify(abilityStage));
+ expect(moduleName1).assertEqual(monitor.moduleName)
+ done();
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_0400 waitAbilityStageMonitor err: " + JSON.stringify(err));
+ expect().assertFail()
+ done()
+ })
+
+ console.info("SUB_AA_AbilityStageMonitor_0400 start ability");
+
+ test(1000)
+
+ want = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "MainAbility2"
+ };
+
+ try {
+ abilityDelegator.startAbility(want, (err, data) => {
+ console.info("SUB_AA_AbilityStageMonitor_0400 startAbility callback err: " +
+ JSON.stringify(err) + "data: " + JSON.stringify(data));
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStageMonitor_0400 startAbility callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0500
+ * @tc.name: Call waitAbilityStageMonitor, the moduleName in the parameter monitor does not exist
+ * @tc.desc: Verify that the moduleName passed in by waitAbilityStageMonitor
+ * does not exist and throw an exception
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0500', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_0500 begin")
+
+ monitor = {
+ moduleName: "feature_as1",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_0500 wait abilityStage");
+
+ await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
+ console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage = " + JSON.stringify(abilityStage));
+ expect().assertFail()
+ done()
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_0500 waitAbilityStageMonitor err: " + JSON.stringify(err));
+ expect(err.code).assertEqual(-1)
+ done()
+ })
+
+ console.info("SUB_AA_AbilityStageMonitor_0500 start ability");
+
+ want = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "MainAbility4"
+ };
+
+ try {
+ abilityDelegator.startAbility(want, (err, data) => {
+ console.info("SUB_AA_AbilityStageMonitor_0500 startAbility callback err: " +
+ JSON.stringify(err) + "data: " + JSON.stringify(data));
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStageMonitor_0500 startAbility callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0600
+ * @tc.name: Call waitAbilityStageMonitor, the srcEntrance in the parameter monitor does not exist
+ * @tc.desc: Verify that the srcEntrance passed in by waitAbilityStageMonitor
+ * does not exist and throw an exception
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0600', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_0600 begin")
+
+ monitor = {
+ moduleName: "feature_assistg",
+ srcEntrance: "./ets/Application/AbilityStageA.ts",
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_0600 wait abilityStage");
+
+ await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
+ console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " + JSON.stringify(abilityStage));
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
+ expect(err.code).assertEqual(-1)
+ done()
+ })
+
+ console.info("SUB_AA_AbilityStageMonitor_0600 start ability");
+
+ want = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "MainAbility6"
+ };
+
+ try {
+ abilityDelegator.startAbility(want, (err, data) => {
+ console.info("SUB_AA_AbilityStageMonitor_0600 startAbility callback err: " +
+ JSON.stringify(err) + "data: " + JSON.stringify(data));
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStageMonitor_0600 startAbility callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0700
+ * @tc.name: Call the promise form of addAbilityStageMonitor to add monitoring,
+ * and call the promise form of removeAbilityStageMonitor to cancel monitoring
+ * @tc.desc: Verify that addAbilityStageMonitor can add monitoring,
+ * verify that removeAbilityStageMonitor can cancel monitoring
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0700', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_0700 begin")
+
+ addMonitor = false;
+ removeMonitor = false;
+ monitor = {
+ moduleName: "feature_assisth",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_0700 wait abilityStage");
+
+ await abilityDelegator.addAbilityStageMonitor(monitor).then((data) => {
+ console.info("stageMonitor addAbilityStageMonitor promise, data = " + data);
+ addMonitor = true;
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_0700 addAbilityStageMonitor err: " + JSON.stringify(err));
+ expect().assertFail()
+ done()
+ });
+
+ await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
+ console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " + JSON.stringify(abilityStage));
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
+ expect(err.code).assertEqual(-1)
+ })
+
+ console.info("SUB_AA_AbilityStageMonitor_0700 removeAbilityStageMonitor");
+
+ await abilityDelegator.removeAbilityStageMonitor(monitor).then((data) => {
+ console.info("stageMonitor addAbilityStageMonitor promise, data = " + data);
+ removeMonitor = true;
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_0700 removeAbilityStageMonitor err: " + JSON.stringify(err));
+ expect().assertFail()
+ done()
+ });
+ expect(addMonitor).assertTrue();
+ expect(removeMonitor).assertTrue();
+ done()
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0800
+ * @tc.name: Call the callback form of addAbilityStageMonitor to add monitoring,
+ * and call the callback form of removeAbilityStageMonitor to cancel monitoring
+ * @tc.desc: Verify that addAbilityStageMonitor can add monitoring,
+ * verify that removeAbilityStageMonitor can cancel monitoring
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0800', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_0800 begin")
+
+ addMonitor = false;
+ removeMonitor = false;
+ monitor = {
+ moduleName: "feature_assisti",
+ srcEntrance: "./ets/Application/AbilityStage.ts",
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_0800 wait abilityStage");
+
+ try {
+ abilityDelegator.addAbilityStageMonitor(monitor, (err, data) => {
+ console.info("SUB_AA_AbilityStageMonitor_0800 addAbilityStageMonitor callback, data = " + data +
+ "err: " + err);
+ addMonitor = true;
+ })
+ } catch (error) {
+ console.log("SUB_AA_AbilityStageMonitor_0800 addAbilityStageMonitor callback err: " + error);
+ expect().assertFail()
+ done()
+ }
+
+ await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
+ console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " + JSON.stringify(abilityStage));
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
+ expect(err.code).assertEqual(-1)
+ })
+
+ try {
+ console.info("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor");
+ abilityDelegator.removeAbilityStageMonitor(monitor, (err, data) => {
+ console.info("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor callback, data = " +
+ data + "err: " + err);
+ removeMonitor = true;
+ })
+ } catch (error) {
+ console.log("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor callback err: " + error);
+ expect().assertFail()
+ done()
+ }
+
+ setTimeout(() => {
+ expect(addMonitor).assertTrue()
+ expect(removeMonitor).assertTrue()
+ done()
+ }, 3000);
+
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_0900
+ * @tc.name: Call waitAbilityStageMonitor, input monitor, timeout is 3 seconds
+ * @tc.desc: Verify that waitAbilityStageMonitor is
+ * created after listening for less than 3 seconds
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_0900', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_0900 begin")
+
+ monitor = {
+ moduleName: "feature_assisth",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_0900 wait abilityStage");
+
+ await abilityDelegator.waitAbilityStageMonitor(monitor, timeout).then((abilityStage) => {
+ console.info("SUB_AA_AbilityStageMonitor_0900 waitAbilityStageMonitor promise, abilityStage: " +
+ JSON.stringify(abilityStage));
+ expect().assertFail()
+ done();
+ }).catch((err) => {
+ console.info("stageMonitor waitAbilityStageMonitor err = " + JSON.stringify(err));
+ expect(err.code).assertEqual(-1)
+ done();
+ })
+
+ test(3000)
+
+ console.info("SUB_AA_AbilityStageMonitor_0900 start ability");
+
+ want = {
+ bundleName: "com.example.abilitystagemonitortest",
+ abilityName: "MainAbility7"
+ };
+
+ try {
+ abilityDelegator.startAbility(want, (err, data) => {
+ console.info("SUB_AA_AbilityStageMonitor_0900 startAbility callback err: " +
+ JSON.stringify(err) + "data: " + JSON.stringify(data));
+ });
+ } catch (error) {
+ console.info("SUB_AA_AbilityStageMonitor_0900 startAbility callback err: " + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+ })
+
+ /**
+ * @tc.number: SUB_AA_AbilityStageMonitor_1000
+ * @tc.name: Call the promise form of addAbilityStageMonitor to add monitoring,
+ * call the promise form of removeAbilityStageMonitor to cancel monitoring,
+ * and the moduleName in the parameter monitor does not exist
+ * @tc.desc: Verify that addAbilityStageMonitor can add monitoring,
+ * verify that removeAbilityStageMonitor can cancel monitoring
+ * @tc.level: 3
+ */
+ it('SUB_AA_AbilityStageMonitor_1000', 0, async function (done) {
+ console.info("SUB_AA_AbilityStageMonitor_1000 begin")
+
+ addMonitor = false;
+ removeMonitor = false;
+ monitor = {
+ moduleName: "feature_assa",
+ srcEntrance: "./ets/Application/MyAbilityStage.ts",
+ }
+
+ console.info("SUB_AA_AbilityStageMonitor_1000 wait abilityStage");
+
+ await abilityDelegator.addAbilityStageMonitor(monitor).then((data) => {
+ console.info("SUB_AA_AbilityStageMonitor_1000 addAbilityStageMonitor promise, data = " + data);
+ addMonitor = true;
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_1000 removeAbilityStageMonitor err: " + JSON.stringify(err));
+ expect().assertFail()
+ done()
+ });
+
+ console.info("stageMonitor removeAbilityStageMonitor");
+
+ await abilityDelegator.removeAbilityStageMonitor(monitor).then((data) => {
+ console.info("SUB_AA_AbilityStageMonitor_1000 addAbilityStageMonitor promise, data = " + data);
+ removeMonitor = true;
+ }).catch((err) => {
+ console.info("SUB_AA_AbilityStageMonitor_1000 removeAbilityStageMonitor err: " + JSON.stringify(err));
+ expect().assertFail()
+ done()
+ });
+ expect(addMonitor).assertTrue();
+ expect(removeMonitor).assertTrue();
+ done()
+ })
+ })
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3943e83bbd25fed4bfb15abdf49c48404d1e0c50
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,20 @@
+/*
+* 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 abilityStageMonitorTest from './AbilityStageMonitor.test'
+
+export default function testsuite() {
+ abilityStageMonitorTest()
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/module.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..1868c97065974161717a459761cb8a21bdb77f8a
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "entry_test",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/TestAbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "TestAbility",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "TestAbility",
+ "srcEntrance": "./ets/TestAbility/TestAbility.ts",
+ "description": "$string:TestAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:TestAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..994bf08e00f269257844e6b9ecb091ea785de23c
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandtest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ },
+ {
+ "name": "TestAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "TestAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/media/icon.png b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..f1395d5d9958beba9c08629a18e47e4d10de9f49
--- /dev/null
+++ b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "TestAbility/pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/signature/openharmony_sx.p7b b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/config.json b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/config.json
index c88e2c7465606e5a41db76d90738f2ed40fc4627..cce709b00ba46b3b1948e9d8968061b5f334c10f 100644
--- a/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/config.json
+++ b/ability/ability_runtime/actsabilitydelegatorcase/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.amsst.actsabilitydelegatorcasetest",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json
index c41d04caf7d0887c48afbdddd94df9cbd315b655..c2fa25973e1c4a0759314d89c05ddab989fd2033 100644
--- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json
+++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/config.json
@@ -19,7 +19,8 @@
"srcPath": "",
"mainAbility": "com.ohos.acecollaboration.MainAbility",
"deviceType": [
- "phone"
+ "default",
+ "default"
],
"reqPermissions": [
{
diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets
index 59b0a7ff11990489f9611c0c8c4f3673a0444536..e74925b2006b532dfa226ffdcaa4d410856ccdca 100644
--- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets
+++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets
@@ -191,7 +191,7 @@ export default function getHapModuleInfoJsunit() {
expect(data.type).assertEqual(1);
expect(data.orientation).assertEqual(0);
expect(data.launchMode).assertEqual(1);
- expect(data.deviceTypes[0]).assertEqual("phone");
+ expect(data.deviceTypes[0]).assertEqual("default");
expect(data.readPermission).assertEqual("");
expect(data.writePermission).assertEqual("");
checkApplicationInfo(msg, data.applicationInfo);
diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets
index 2f3c5606755e9f430a9cf8816966d6684035a0d8..3703d15b1f64c00c3bb288b5eb853d9d207aaf43 100644
--- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets
+++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets
@@ -125,7 +125,7 @@ export default function getHapModuleInfoJsunit() {
expect(data.iconId).assertEqual(16777229);
expect(data.backgroundImg).assertEqual("");
expect(data.supportedModes).assertEqual(0);
- expect(data.deviceTypes[0]).assertEqual("phone");
+ expect(data.deviceTypes[0]).assertEqual("default");
console.info(msg + ' data.abilityInfo.length ' + data.abilityInfo.length)
checkAbilityInfo(msg, data.abilityInfo[0]);
expect(data.moduleName).assertEqual("entry")
@@ -219,7 +219,7 @@ export default function getHapModuleInfoJsunit() {
expect(data.type).assertEqual(1);
expect(data.orientation).assertEqual(0);
expect(data.launchMode).assertEqual(1);
- expect(data.deviceTypes[0]).assertEqual("phone");
+ expect(data.deviceTypes[0]).assertEqual("default");
expect(data.readPermission).assertEqual("");
expect(data.writePermission).assertEqual("");
expect(data.formEntity).assertEqual(0);
diff --git a/ability/ability_runtime/actsabilityusertest/entry/src/main/module.json b/ability/ability_runtime/actsabilityusertest/entry/src/main/module.json
index 4085e71d212cab75c38a50307aad7f60cc424e45..ddc5a77fe4142cce29b00266ab032da4aa910cba 100644
--- a/ability/ability_runtime/actsabilityusertest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsabilityusertest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -46,6 +47,16 @@
"icon": "$media:icon",
"label": "$string:MainAbility3_label"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/BUILD.gn b/ability/ability_runtime/actsappselector/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..94cec912f856013afd4333a39e63ecf1891d6cd1
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/BUILD.gn
@@ -0,0 +1,52 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+group("actsappselector") {
+ testonly = true
+ if (is_standard_system) {
+ deps = [
+ "actsappselectorpctest:ActsAppSelectorPCTest",
+ "actsappselectorrelyhap:ActsAppSelectorRelyHap",
+ "actsappselectortest:ActsAppSelectorTest",
+ "actsimageaentryrelyhap:ActsImageAEntryRelyHap",
+ "actsimageafeaturerelyhap:ActsImageAFeatureRelyHap",
+ "actsimagebentryrelyhap:ActsImageBEntryRelyHap",
+ "actsimagebfeaturerelyhap:ActsImageBFeatureRelyHap",
+ "actsimagecentryrelyhap:ActsImageCEntryRelyHap",
+ "actsimagecfeaturerelyhap:ActsImageCFeatureRelyHap",
+ "actsimagedrelyhap:ActsImageDRelyHap",
+ "actsimageerelyhap:ActsImageERelyHap",
+ "actsimagefrelyhap:ActsImageFRelyHap",
+ "actsimagegrelyhap:ActsImageGRelyHap",
+ "actsimagehrelyhap:ActsImageHRelyHap",
+ "actsimageirelyhap:ActsImageIRelyHap",
+ "actsimagejrelyhap:ActsImageJRelyHap",
+ "actsimagekrelyhap:ActsImageKRelyHap",
+ "actsserviceabilityarelyhap:ActsServiceAbilityARelyHap",
+ "actsserviceabilitybrelyhap:ActsServiceAbilityBRelyHap",
+ "actstextarelyhap:ActstextARelyHap",
+ "actstextbrelyhap:ActstextBRelyHap",
+ "actstextcrelyhap:ActstextCRelyHap",
+ "actstextdrelyhap:ActstextDRelyHap",
+ "actstexterelyhap:ActstextERelyHap",
+ "actstextfrelyhap:ActstextFRelyHap",
+ "actstextgrelyhap:ActstextGRelyHap",
+ "actstexthrelyhap:ActstextHRelyHap",
+ "actstextirelyhap:ActstextIRelyHap",
+ "actstextjrelyhap:ActstextJRelyHap",
+ "actstextkrelyhap:ActstextKRelyHap",
+ ]
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/app.json b/ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..a393ee0a845dfaf49ef5623216dc0eff22aab6ac
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "com.example.appselectorpctest",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..983cb0514901934e3003f407acba6c78fa97b868
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AppSelectorTest"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsappselectorpctest/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/BUILD.gn b/ability/ability_runtime/actsappselector/actsappselectorpctest/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..050f6a8c2fee394a874d5ef305b5b539d1cd98ec
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/BUILD.gn
@@ -0,0 +1,43 @@
+# 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("ActsAppSelectorPCTest") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":actsappselectorpctest_js_assets",
+ ":actsappselectorpctest_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsAppSelectorPCTest"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsappselectorpctest_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsappselectorpctest_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsappselectorpctest_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsappselectorpctest_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/Test.json b/ability/ability_runtime/actsappselector/actsappselectorpctest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..2545f010722811a683933cd24bdc0d25db9a55c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/Test.json
@@ -0,0 +1,65 @@
+{
+ "description": "Configuration for aceceshi Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.example.appselectorpctest",
+ "module-name": "entry",
+ "shell-timeout": "600000",
+ "testcase-timeout":"100000"
+ },
+ "kits": [
+ {
+ "type": "ShellKit",
+ "run-command": [
+ "setenforce 0",
+ "power-shell setmode 602",
+ "param set persist.ace.testmode.enabled 1",
+ "hilog -Q pidoff",
+ "hilog -Q domainoff",
+ "hilog -b D"
+ ]
+ },
+ {
+ "test-file-name": [
+ "ActsAppSelectorPCTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ },
+ {
+ "type": "PushKit",
+ "push": [
+ "ActsAppSelectorRelyHap.hap->/data/ActsAppSelectorRelyHap.hap",
+ "ActsServiceAbilityARelyHap.hap->/data/ActsServiceAbilityARelyHap.hap",
+ "ActsServiceAbilityBRelyHap.hap->/data/ActsServiceAbilityBRelyHap.hap",
+ "ActsImageAEntryRelyHap.hap->/data/ActsImageAEntryRelyHap.hap",
+ "ActsImageAFeatureRelyHap.hap->/data/ActsImageAFeatureRelyHap.hap",
+ "ActsImageBEntryRelyHap.hap->/data/ActsImageBEntryRelyHap.hap",
+ "ActsImageBFeatureRelyHap.hap->/data/ActsImageBFeatureRelyHap.hap",
+ "ActsImageCEntryRelyHap.hap->/data/ActsImageCEntryRelyHap.hap",
+ "ActsImageCFeatureRelyHap.hap->/data/ActsImageCFeatureRelyHap.hap",
+ "ActsImageDRelyHap.hap->/data/ActsImageDRelyHap.hap",
+ "ActsImageERelyHap.hap->/data/ActsImageERelyHap.hap",
+ "ActsImageFRelyHap.hap->/data/ActsImageFRelyHap.hap",
+ "ActsImageGRelyHap.hap->/data/ActsImageGRelyHap.hap",
+ "ActsImageHRelyHap.hap->/data/ActsImageHRelyHap.hap",
+ "ActsImageIRelyHap.hap->/data/ActsImageIRelyHap.hap",
+ "ActsImageJRelyHap.hap->/data/ActsImageJRelyHap.hap",
+ "ActsImageKRelyHap.hap->/data/ActsImageKRelyHap.hap",
+ "ActstextARelyHap.hap->/data/ActstextARelyHap.hap",
+ "ActstextBRelyHap.hap->/data/ActstextBRelyHap.hap",
+ "ActstextCRelyHap.hap->/data/ActstextCRelyHap.hap",
+ "ActstextDRelyHap.hap->/data/ActstextDRelyHap.hap",
+ "ActstextERelyHap.hap->/data/ActstextERelyHap.hap",
+ "ActstextFRelyHap.hap->/data/ActstextFRelyHap.hap",
+ "ActstextGRelyHap.hap->/data/ActstextGRelyHap.hap",
+ "ActstextHRelyHap.hap->/data/ActstextHRelyHap.hap",
+ "ActstextIRelyHap.hap->/data/ActstextIRelyHap.hap",
+ "ActstextJRelyHap.hap->/data/ActstextJRelyHap.hap",
+ "ActstextKRelyHap.hap->/data/ActstextKRelyHap.hap"
+ ]
+ }
+ ]
+}
+
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..41c2c986f8d126bc9fa12b16119184a13fca63d9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,54 @@
+/*
+ * 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'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
+
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log('MainAbility onCreate')
+ globalThis.abilityWant = want;
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ }
+
+ onDestroy() {
+ console.log('MainAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('MainAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.log('MainAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('MainAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('MainAbility onBackground')
+ }
+
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1b4c5782a516e02419cea30fcbeb81283cb3f2cd
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import TestRunner from '@ohos.application.testRunner'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+var abilityDelegator = undefined
+var abilityDelegatorArguments = undefined
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s it',
+ '-s level', '-s testType', '-s size', '-s timeout'
+ ])
+ 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 MainAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
+ let lMonitor = {
+ abilityName: MainAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a 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
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1b6cdc6216cb015082cf70111d41384b3be07f0e
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,31 @@
+/*
+ * 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 = 'AppSelectorPC'
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/test/Ability.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1ccd6043655e8f16aa8a0bcc7de5c98b7b849562
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/test/Ability.test.ets
@@ -0,0 +1,444 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
+import commonEvent from '@ohos.commonEvent'
+import { BY, UiDriver, UiComponent, MatchPattern } from '@ohos.uitest'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+var abilityDelegator = undefined;
+var driver;
+var cmdInstall
+var cmdUninstall;
+var subscriberInfo = {
+ events: ['AppSelector']
+};
+
+function sleep(time) {
+ return new Promise < void> ((resolve, reject) => {
+ setTimeout(() => {
+ resolve();
+ }, time)
+ })
+}
+
+export default function abilityTest() {
+ describe('ActsAppSelectorPCTest', function () {
+ beforeAll(async (done) => {
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+ driver = await UiDriver.create()
+ await sleep(2000);
+ done();
+ })
+
+ afterEach(async (done) => {
+ abilityDelegator.executeShellCommand(cmdUninstall,
+ async (err: any, d: any) => {
+ console.log('ACTS_AppSelectorTest cmdUninstall executeShellCommand : err : ' + JSON.stringify(err));
+ console.log('ACTS_AppSelectorTest cmdUninstall executeShellCommand : stdResult : ' + d.stdResult);
+ console.log('ACTS_AppSelectorTest cmdUninstall executeShellCommand : exitCode : ' + d.exitCode);
+ await sleep(4000);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1100
+ * @tc.name: Install one image type matching app
+ * @tc.desc: Install one image type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_1100', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1100 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActstextARelyHap.hap';
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n textarelyhap.com.example";
+
+ console.log('ACTS_AppSelectorTest_1100 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1100 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1100 startAbility end");
+ })
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_1100 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_1100 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_1100 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_1100 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_1100 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_1100 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1200
+ * @tc.name: Install one image type matching app
+ * @tc.desc: Install one image type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_1200', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1200 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActstextARelyHap.hap';
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;" +
+ "bm uninstall -n textarelyhap.com.example";
+
+ console.log('ACTS_AppSelectorTest_1200 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+
+ console.debug("ACTS_AppSelectorTest_1200 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1200 startAbility end");
+
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_1200 findComponent");
+ let button = await driver.findComponent(BY.text('imagearelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_1200 button " + JSON.stringify(button));
+ await button.click();
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_1200 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_1200 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_1200 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_1200 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_1200 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_1200 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1300
+ * @tc.name: Install one image type matching app
+ * @tc.desc: Install one image type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_1300', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1300 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActsImageCEntryRelyHap.hap;bm install -p /data/ActsImageDRelyHap.hap;' +
+ 'bm install -p /data/ActstextARelyHap.hap';
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;" +
+ "bm uninstall -n imagecrelyhap;bm uninstall -n imagedrelyhap;" +
+ "bm uninstall -n textarelyhap.com.example"
+
+ console.log('ACTS_AppSelectorTest_1300 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1300 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1300 startAbility end");
+
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_1300 findComponent");
+ let button = await driver.findComponent(BY.text('imagearelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_1300 button " + JSON.stringify(button));
+ await button.click();
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_1300 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_1300 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_1300 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_1300 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_1300 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_1300 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1400
+ * @tc.name: Install one image type matching app
+ * @tc.desc: Install one image type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_1400', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1400 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActsImageCEntryRelyHap.hap;bm install -p /data/ActsImageDRelyHap.hap;' +
+ 'bm install -p /data/ActsImageERelyHap.hap;bm install -p /data/ActsImageGRelyHap.hap;' +
+ 'bm install -p /data/ActsImageHRelyHap.hap;bm install -p /data/ActsImageIRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;bm uninstall -n imagecrelyhap;" +
+ "bm uninstall -n imagedrelyhap;bm uninstall -n imageerelyhap;bm uninstall -n imagegrelyhap;" +
+ "bm uninstall -n imagehrelyhap;bm uninstall -n imageirelyhap;"
+
+ console.log('ACTS_AppSelectorTest_1400 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1400 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1400 startAbility end");
+
+ await sleep(2000);
+ let component = await driver.findComponent(BY.text("imagedrelyhap"))
+ let rectSerial = await component.getBounds()
+ component = await driver.findComponent(BY.text("imagearelyhap"))
+ let rectAlias = await component.getBounds()
+ console.log("ACTS_AppSelectorTest_1400 rectSerial " + JSON.stringify(rectSerial));
+ console.log("ACTS_AppSelectorTest_1400 rectAlias " + JSON.stringify(rectAlias));
+
+ await driver.swipe(rectSerial.leftX, rectSerial.topY, rectAlias.leftX, rectAlias.topY)
+ await sleep(3000);
+ console.log("ACTS_AppSelectorTest_1400 findComponent");
+ let button = await driver.findComponent(BY.text('imagegrelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_1400 button " + JSON.stringify(button));
+ await button.click();
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ })
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_1400 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_1400 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_1400 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_1400 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_1400 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagegrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_1400 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1500
+ * @tc.name: Install one image type matching app
+ * @tc.desc: Install one image type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_1500', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1500 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;"
+
+ console.log('ACTS_AppSelectorTest_1500 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1500 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1500 startAbility end");
+ await sleep(2000);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ let component1 = await driver.findComponent(BY.text("使用以下方式打开"))
+ let text = await component1.getBounds()
+ console.log("ACTS_AppSelectorTest_1500 rectSerial " + JSON.stringify(text));
+
+
+ let component2 = await driver.findComponent(BY.text("imagebrelyhap"))
+ let button = await component2.getBounds()
+ console.log("ACTS_AppSelectorTest_1500 rectSerial " + JSON.stringify(button));
+
+ await sleep(2000);
+ await driver.click(text.leftX, text.topY);
+ await sleep(2000);
+ await driver.click(button.leftX, button.topY);
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_1500 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_1500 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_1500 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_1500 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_1500 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility1");
+ expect(data.parameters.bundleName).assertEqual("imagebrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_1500 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1600
+ * @tc.name: Install one image type matching app
+ * @tc.desc: Install one image type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_1600', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1600 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;"
+
+ console.log('ACTS_AppSelectorTest_1600 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1600 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1600 startAbility end");
+
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_1600 findComponent");
+ let button = await driver.findComponent(BY.text('取消').enabled(true))
+ console.log("ACTS_AppSelectorTest_1600 button " + JSON.stringify(button));
+ await button.click();
+
+ try {
+ await sleep(2000);
+ let close = await driver.findComponent(BY.text('取消').enabled(true))
+ console.log("ACTS_AppSelectorTest_1600 close " + JSON.stringify(close));
+ expect(close == null).assertTrue();
+ done();
+ } catch (err) {
+ console.debug("ACTS_AppSelectorTest_1600 catch err: " + JSON.stringify(err));
+ console.debug("ACTS_AppSelectorTest_1600 catch err: " + err);
+ expect(err.code).assertEqual("INTERNAL_ERROR");
+ done();
+ }
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1700
+ * @tc.name: Do not install matching apps
+ * @tc.desc: Do not install matching apps,"can't open this file" popup
+ */
+ it('ACTS_AppSelectorTest_1700', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1700 --- start")
+ await sleep(2000);
+ cmdInstall = 'bm install -p /data/ActsImageJRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagejrelyhap";
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1700 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1700 startAbility end");
+
+ try {
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_1700 findComponent");
+ let cantOpen1 = await driver.findComponent(BY.text('无法打开此文件').enabled(true))
+ console.log("ACTS_AppSelectorTest_1700 cantOpen1 " + JSON.stringify(cantOpen1));
+ expect(cantOpen1 != null).assertTrue();
+ let button = await driver.findComponent(BY.text('知道了').enabled(true))
+ console.debug("ACTS_AppSelectorTest_1700 button: " + JSON.stringify(button))
+ await button.click();
+
+ await sleep(1000);
+ console.debug("ACTS_AppSelectorTest_1700 findComponent");
+ let cantOpen2 = await driver.findComponent(BY.text('无法打开此文件').enabled(true))
+ console.log("ACTS_AppSelectorTest_1700 cantOpen2 " + JSON.stringify(cantOpen2));
+ expect(cantOpen2 == null).assertTrue();
+ done();
+ } catch (err) {
+ console.debug("ACTS_AppSelectorTest_1700 catch err: " + JSON.stringify(err));
+ console.debug("ACTS_AppSelectorTest_1700 catch err: " + err);
+ expect(err.code).assertEqual("INTERNAL_ERROR");
+ done();
+ }
+ })
+ })
+ })
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8828f3c461f6224c1f8532e6e299c7b1facc2824
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,19 @@
+/*
+ * 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 abilityTest from './Ability.test'
+
+export default function testsuite() {
+ abilityTest()
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..d4759b77fa44488ac09e4ce59469ef7f0367c8f9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/module.json
@@ -0,0 +1,37 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..2b8c72be1fb5a552cd53c1fbc08aec477819ea5a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,40 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "MainAbility2_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility2_label",
+ "value": "label"
+ },
+ {
+ "name": "MainAbility3_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility3_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorpctest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsappselectorpctest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsappselectorpctest/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..8043b5a0cc673dddfa054f7bae0c8e555fc543ef
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "com.example.appselectorrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..62800de69e1b240ca8f3a77234cbb12682a38ad2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ }
+ ]
+}
diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsappselectorrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..11839cba8c55a2f7ca8ea7a7df40860c5f37aa28
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/BUILD.gn
@@ -0,0 +1,45 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsAppSelectorRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsAppSelectorRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsappselectorrelyhap_js_assets",
+ ":actsappselectorrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsappselectorrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsappselectorrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsappselectorrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsappselectorrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..633ebb3f2e880b9c86212fd2c378d5e7a14feadc
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,62 @@
+/*
+ * 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")
+ globalThis.abilityContext = this.context;
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.log("ACTS_AppSelectorTest_3700 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f65697aec97cd488048ce4ecc3917b541631c0eb
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,31 @@
+/*
+ * 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 World1'
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..d4759b77fa44488ac09e4ce59469ef7f0367c8f9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/module.json
@@ -0,0 +1,37 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..2b8c72be1fb5a552cd53c1fbc08aec477819ea5a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,40 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "MainAbility2_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility2_label",
+ "value": "label"
+ },
+ {
+ "name": "MainAbility3_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility3_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectorrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsappselectorrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/AppScope/app.json b/ability/ability_runtime/actsappselector/actsappselectortest/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..6ebe8e35024953ae383bdef858249de07e5dce44
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "com.example.appselectortest",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsappselectortest/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..983cb0514901934e3003f407acba6c78fa97b868
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AppSelectorTest"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsappselectortest/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsappselectortest/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/BUILD.gn b/ability/ability_runtime/actsappselector/actsappselectortest/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..08278d994257a88b101bdf868ad26507726bc5fa
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/BUILD.gn
@@ -0,0 +1,43 @@
+# 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("ActsAppSelectorTest") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":actsappselectortest_js_assets",
+ ":actsappselectortest_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsAppSelectorTest"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsappselectortest_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsappselectortest_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsappselectortest_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsappselectortest_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/Test.json b/ability/ability_runtime/actsappselector/actsappselectortest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..dcac3574879dbac24ab26e74088dd2305ebfc6b3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/Test.json
@@ -0,0 +1,65 @@
+{
+ "description": "Configuration for aceceshi Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.example.appselectortest",
+ "module-name": "entry",
+ "shell-timeout": "600000",
+ "testcase-timeout":"300000"
+ },
+ "kits": [
+ {
+ "type": "ShellKit",
+ "run-command": [
+ "setenforce 0",
+ "power-shell setmode 602",
+ "param set persist.ace.testmode.enabled 1",
+ "hilog -Q pidoff",
+ "hilog -Q domainoff",
+ "hilog -b D"
+ ]
+ },
+ {
+ "test-file-name": [
+ "ActsAppSelectorTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ },
+ {
+ "type": "PushKit",
+ "push": [
+ "ActsAppSelectorRelyHap.hap->/data/ActsAppSelectorRelyHap.hap",
+ "ActsServiceAbilityARelyHap.hap->/data/ActsServiceAbilityARelyHap.hap",
+ "ActsServiceAbilityBRelyHap.hap->/data/ActsServiceAbilityBRelyHap.hap",
+ "ActsImageAEntryRelyHap.hap->/data/ActsImageAEntryRelyHap.hap",
+ "ActsImageAFeatureRelyHap.hap->/data/ActsImageAFeatureRelyHap.hap",
+ "ActsImageBEntryRelyHap.hap->/data/ActsImageBEntryRelyHap.hap",
+ "ActsImageBFeatureRelyHap.hap->/data/ActsImageBFeatureRelyHap.hap",
+ "ActsImageCEntryRelyHap.hap->/data/ActsImageCEntryRelyHap.hap",
+ "ActsImageCFeatureRelyHap.hap->/data/ActsImageCFeatureRelyHap.hap",
+ "ActsImageDRelyHap.hap->/data/ActsImageDRelyHap.hap",
+ "ActsImageERelyHap.hap->/data/ActsImageERelyHap.hap",
+ "ActsImageFRelyHap.hap->/data/ActsImageFRelyHap.hap",
+ "ActsImageGRelyHap.hap->/data/ActsImageGRelyHap.hap",
+ "ActsImageHRelyHap.hap->/data/ActsImageHRelyHap.hap",
+ "ActsImageIRelyHap.hap->/data/ActsImageIRelyHap.hap",
+ "ActsImageJRelyHap.hap->/data/ActsImageJRelyHap.hap",
+ "ActsImageKRelyHap.hap->/data/ActsImageKRelyHap.hap",
+ "ActstextARelyHap.hap->/data/ActstextARelyHap.hap",
+ "ActstextBRelyHap.hap->/data/ActstextBRelyHap.hap",
+ "ActstextCRelyHap.hap->/data/ActstextCRelyHap.hap",
+ "ActstextDRelyHap.hap->/data/ActstextDRelyHap.hap",
+ "ActstextERelyHap.hap->/data/ActstextERelyHap.hap",
+ "ActstextFRelyHap.hap->/data/ActstextFRelyHap.hap",
+ "ActstextGRelyHap.hap->/data/ActstextGRelyHap.hap",
+ "ActstextHRelyHap.hap->/data/ActstextHRelyHap.hap",
+ "ActstextIRelyHap.hap->/data/ActstextIRelyHap.hap",
+ "ActstextJRelyHap.hap->/data/ActstextJRelyHap.hap",
+ "ActstextKRelyHap.hap->/data/ActstextKRelyHap.hap"
+ ]
+ }
+ ]
+}
+
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c546e58c88a3a4ba91d9388cce5752a38cc4069b
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,54 @@
+/*
+ * 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'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
+
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log('MainAbility onCreate')
+ globalThis.abilityWant = want;
+ globalThis.abilityContext = this.context;
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ }
+
+ onDestroy() {
+ console.log('MainAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('MainAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+ }
+
+ onWindowStageDestroy() {
+ console.log('MainAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('MainAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('MainAbility onBackground')
+ }
+
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1b4c5782a516e02419cea30fcbeb81283cb3f2cd
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import TestRunner from '@ohos.application.testRunner'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+var abilityDelegator = undefined
+var abilityDelegatorArguments = undefined
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s it',
+ '-s level', '-s testType', '-s size', '-s timeout'
+ ])
+ 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 MainAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
+ let lMonitor = {
+ abilityName: MainAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a 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
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b136fb5291be2733cdd073b53d6deecb33545f7c
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,31 @@
+/*
+ * 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 = 'AppSelector'
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/test/Ability.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fa2c8ed3ad3af124347705258e21d3ec403ba7d6
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/test/Ability.test.ets
@@ -0,0 +1,1494 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
+import commonEvent from '@ohos.commonEvent'
+import { BY, UiDriver, UiComponent, MatchPattern } from '@ohos.uitest'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+var abilityDelegator = undefined;
+var driver;
+var cmdInstall
+var cmdUninstall;
+var subscriberInfo = {
+ events: ['AppSelector']
+};
+
+let paConnect = {
+ onConnect: function (elementName, proxy) {
+ console.info("AppSelector Service onConnect called.");
+ },
+ onDisconnect: function (elementName) {
+ console.info("AppSelector Service onDisconnect");
+ },
+ onFailed: function (code) {
+ console.info("AppSelector Service onFailed");
+ }
+};
+
+function sleep(time) {
+ return new Promise < void> ((resolve, reject) => {
+ setTimeout(() => {
+ resolve();
+ }, time)
+ })
+}
+
+
+export default function abilityTest() {
+ describe('ActsAppSelectorTest', function () {
+ beforeAll(async (done) => {
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+ driver = await UiDriver.create()
+ await sleep(1000);
+ done();
+ })
+
+ afterEach(async (done) => {
+ abilityDelegator.executeShellCommand(cmdUninstall,
+ async (err: any, d: any) => {
+ console.info('ACTS_AppSelectorTest cmdUninstall executeShellCommand : err : ' + JSON.stringify(err));
+ console.info('ACTS_AppSelectorTest cmdUninstall executeShellCommand : data : ' + d.stdResult);
+ console.info('ACTS_AppSelectorTest cmdUninstall executeShellCommand : data : ' + d.exitCode);
+ await sleep(6000);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3200
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_3200', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3200 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActsImageJRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;bm uninstall -n imagejrelyhap"
+
+ console.log('ACTS_AppSelectorTest_3200 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_3200 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_3200 startAbility end");
+
+ let component = await driver.findComponent(BY.text('imagearelyhap'))
+ let button = await component.getBounds()
+ console.log("ACTS_AppSelectorTest_3200 button " + JSON.stringify(button));
+
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ bundleName: "imagejrelyhap",
+ abilityName: "MainAbility",
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_3200 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_3200 startAbility end");
+
+ await sleep(5000);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ await driver.click(button.leftX, button.topY);
+ })
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_3200 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_3200 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_3200 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_3200 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_3200 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_3200 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0100
+ * @tc.name: Install one image type matching app
+ * @tc.desc: Install one image type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0100', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0100 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageJRelyHap.hap;' +
+ 'bm install -p /data/ActstextARelyHap.hap';
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagejrelyhap;" +
+ "bm uninstall -n textarelyhap.com.example";
+
+ console.log('ACTS_AppSelectorTest_0100 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.log("ACTS_AppSelectorTest_0100 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.log("ACTS_AppSelectorTest_0100 startAbility end");
+ })
+
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0100 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0100 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0100 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0100 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0100 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0100 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0200
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0200', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0200 --- start")
+ cmdInstall = 'bm install -p /data/ActstextARelyHap.hap;bm install -p /data/ActstextJRelyHap.hap;' +
+ 'bm install -p /data/ActsImageAEntryRelyHap.hap ';
+ cmdUninstall = "bm uninstall -n textarelyhap.com.example;bm uninstall -n textjrelyhap.com.example;" +
+ "bm uninstall -n imagearelyhap";
+
+ console.log('ACTS_AppSelectorTest_0200 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "text/txt",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.debug("ACTS_AppSelectorTest_0200 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_0200 startAbility end");
+ })
+
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0200 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0200 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0200 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0200 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0200 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("com.example.entry.MainAbility");
+ expect(data.parameters.bundleName).assertEqual("textarelyhap.com.example");
+ expect(data.parameters.type).assertEqual("text/txt");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0200 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0300
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0300', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0300 --- start")
+ let subscriber;
+ cmdInstall = 'bm install -p /data/ActstextARelyHap.hap;bm install -p /data/ActstextBRelyHap.hap;' +
+ 'bm install -p /data/ActstextJRelyHap.hap;bm install -p /data/ActsImageAEntryRelyHap.hap ';
+ cmdUninstall = "bm uninstall -n textarelyhap.com.example;bm uninstall -n textbrelyhap.com.example;" +
+ "bm uninstall -n textjrelyhap.com.example;bm uninstall -n imagearelyhap";
+
+ console.log('ACTS_AppSelectorTest_0300 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "text/txt",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_0300 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_0300 startAbility end");
+ })
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_0300 findComponent");
+ let button = await driver.findComponent(BY.text('textbrelyhap.com.example').enabled(true))
+ console.log("ACTS_AppSelectorTest_0300 button " + JSON.stringify(button));
+ subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ await button.click();
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0300 SubscribeCallBack');
+ console.log('ACTS_AppSelectorTest_0300 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0300 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0300 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0300 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0300 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("com.example.entry.MainAbility");
+ expect(data.parameters.bundleName).assertEqual("textbrelyhap.com.example");
+ expect(data.parameters.type).assertEqual("text/txt");
+ expect(data.parameters.uri).assertEqual("filePath");
+
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0300 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0400
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0400', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0400 --- start")
+ let subscriber;
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActsImageCEntryRelyHap.hap;bm install -p /data/ActsImageDRelyHap.hap;' +
+ 'bm install -p /data/ActsImageJRelyHap.hap;bm install -p /data/ActstextARelyHap.hap';
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;" +
+ "bm uninstall -n imagecrelyhap;bm uninstall -n imagedrelyhap;" +
+ "bm uninstall -n imagejrelyhap;bm uninstall -n textarelyhap.com.example"
+
+ console.log('ACTS_AppSelectorTest_0400 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_0400 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_0400 startAbility end");
+
+ subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ await sleep(1000);
+ console.log("ACTS_AppSelectorTest_0400 findComponent");
+ let button = await driver.findComponent(BY.text('imagebrelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_0400 button " + JSON.stringify(button));
+ await button.click();
+ })
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0400 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0400 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0400 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0400 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0400 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility1");
+ expect(data.parameters.bundleName).assertEqual("imagebrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0400 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0500
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0500', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0500 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActsImageCEntryRelyHap.hap;bm install -p /data/ActsImageDRelyHap.hap;' +
+ 'bm install -p /data/ActsImageERelyHap.hap;bm install -p /data/ActsImageGRelyHap.hap;' +
+ 'bm install -p /data/ActsImageHRelyHap.hap;bm install -p /data/ActsImageIRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;bm uninstall -n imagecrelyhap;" +
+ "bm uninstall -n imagedrelyhap;bm uninstall -n imageerelyhap;bm uninstall -n imagegrelyhap;" +
+ "bm uninstall -n imagehrelyhap;bm uninstall -n imageirelyhap;"
+
+ console.log('ACTS_AppSelectorTest_0500 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_0500 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_0500 startAbility end");
+
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ await sleep(1000);
+ console.log("ACTS_AppSelectorTest_0500 findComponent");
+ let button = await driver.findComponent(BY.text('imagegrelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_0500 button " + JSON.stringify(button));
+ await button.click();
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0500 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0500 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0500 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0500 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0500 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagegrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0500 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0600
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0600', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0600 --- start")
+ cmdInstall = 'bm install -p /data/ActstextARelyHap.hap;bm install -p /data/ActstextBRelyHap.hap;' +
+ 'bm install -p /data/ActstextCRelyHap.hap;bm install -p /data/ActstextDRelyHap.hap;' +
+ 'bm install -p /data/ActstextERelyHap.hap;bm install -p /data/ActstextFRelyHap.hap;' +
+ 'bm install -p /data/ActstextGRelyHap.hap;bm install -p /data/ActstextHRelyHap.hap;' +
+ 'bm install -p /data/ActstextIRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n textarelyhap.com.example;bm uninstall -n textbrelyhap.com.example;" +
+ "bm uninstall -n textcrelyhap.com.example;bm uninstall -n textdrelyhap.com.example;" +
+ "bm uninstall -n texterelyhap.com.example;bm uninstall -n textfrelyhap.com.example;" +
+ "bm uninstall -n textgrelyhap.com.example;bm uninstall -n texthrelyhap.com.example;" +
+ "bm uninstall -n textirelyhap.com.example;"
+
+ console.log('ACTS_AppSelectorTest_0600 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "text/txt",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_0600 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_0600 startAbility end");
+
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ await sleep(2000);
+ let component = await driver.findComponent(BY.text("texthrelyhap.com.example"))
+ let rectSerial = await component.getBounds()
+ component = await driver.findComponent(BY.text("texterelyhap.com.example"))
+ let rectAlias = await component.getBounds()
+ console.log("ACTS_AppSelectorTest_0600 rectSerial " + JSON.stringify(rectSerial));
+ console.log("ACTS_AppSelectorTest_0600 rectAlias " + JSON.stringify(rectAlias));
+
+ await driver.swipe(rectSerial.leftX, rectSerial.topY, rectAlias.leftX, rectAlias.topY)
+ console.log("ACTS_AppSelectorTest_0600 findComponent");
+ let button = await driver.findComponent(BY.text('textirelyhap.com.example').enabled(true))
+ console.log("ACTS_AppSelectorTest_0600 button " + JSON.stringify(button));
+ await button.click();
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0600 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0600 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0600 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0600 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0600 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("com.example.entry.MainAbility");
+ expect(data.parameters.bundleName).assertEqual("textirelyhap.com.example");
+ expect(data.parameters.type).assertEqual("text/txt");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0600 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0700
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0700', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0700 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;"
+
+ console.log('ACTS_AppSelectorTest_0700 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_0700 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_0700 startAbility end");
+ await sleep(2000);
+ let button = await driver.findComponent(BY.text('imagebrelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_0700 button " + JSON.stringify(button));
+ let component = await driver.findComponent(BY.text("使用以下方式打开"))
+ let rectSerial = await component.getBounds()
+ console.log("ACTS_AppSelectorTest_0700 rectSerial " + JSON.stringify(rectSerial));
+ await driver.click(rectSerial.leftX, rectSerial.topY);
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_0700 findComponent");
+
+ await button.click();
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0700 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0700 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0700 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0700 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0700 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility1");
+ expect(data.parameters.bundleName).assertEqual("imagebrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0700 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0800
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0800', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0800 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;"
+
+ console.log('ACTS_AppSelectorTest_0800 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_0800 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_0800 startAbility end");
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_0800 findComponent");
+ let button = await driver.findComponent(BY.text('取消').enabled(true))
+ console.log("ACTS_AppSelectorTest_0800 button " + JSON.stringify(button));
+ await button.click();
+ done();
+
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_0900
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_0900', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_0900 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActstextARelyHap.hap;bm install -p /data/ActstextBRelyHap.hap;' +
+ 'bm install -p /data/ActsServiceAbilityARelyHap.hap;'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;" +
+ "bm uninstall -n textarelyhap.com.example;bm uninstall -n textbrelyhap.com.example;" +
+ "bm uninstall -n aserviceabilityrelyhap;"
+
+ console.log('ACTS_AppSelectorTest_0900 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+
+ console.info("ACTS_AppSelectorTest_0900 Service servStart");
+ let connectionId;
+ let want = {
+ "bundleName": "aserviceabilityrelyhap",
+ "abilityName": "ServiceAbility"
+ };
+
+ connectionId = globalThis.abilityContext.connectAbility(want, paConnect)
+ console.info('ACTS_AppSelectorTest_0900 Service connectionId ' + connectionId);
+
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_0900 findComponent");
+ let button = await driver.findComponent(BY.text('textbrelyhap.com.example').enabled(true))
+ console.log("ACTS_AppSelectorTest_0900 button " + JSON.stringify(button));
+ await button.click();
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_0900 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_0900 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_0900 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_0900 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_0900 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("com.example.entry.MainAbility");
+ expect(data.parameters.bundleName).assertEqual("textbrelyhap.com.example");
+ expect(data.parameters.type).assertEqual("text/txt");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_0900 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1000
+ * @tc.name: Install one text type matching app
+ * @tc.desc: Install one text type matching app,no application selection box pops up, the app is pulled up
+ */
+ it('ACTS_AppSelectorTest_1000', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1000 --- start")
+ cmdInstall = 'bm install -p /data/ActstextARelyHap.hap;bm install -p /data/ActstextBRelyHap.hap;'
+ cmdUninstall = "bm uninstall -n textarelyhap.com.example;bm uninstall -n textbrelyhap.com.example;"
+
+ console.log('ACTS_AppSelectorTest_1000 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbilityForResult(
+ {
+ action: "ohos.want.action.viewData",
+ type: "text/txt",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.log("ACTS_AppSelectorTest_1000 startAbilityForResult " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ })
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_1000 findComponent");
+ let button = await driver.findComponent(BY.text('textbrelyhap.com.example').enabled(true))
+ console.log("ACTS_AppSelectorTest_1000 button " + JSON.stringify(button));
+ await button.click();
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_1000 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_1000 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_1000 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_1000 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_1000 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("com.example.entry.MainAbility");
+ expect(data.parameters.bundleName).assertEqual("textbrelyhap.com.example");
+ expect(data.parameters.type).assertEqual("text/txt");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+ async function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_1000 UnSubscribeCallBack");
+ try {
+ let close = await driver.findComponent(BY.text('取消').enabled(true))
+ console.log("ACTS_AppSelectorTest_1000 cantOpen2 " + JSON.stringify(close));
+ expect(close == null).assertTrue();
+ done();
+ } catch (err) {
+ console.debug("ACTS_AppSelectorTest_1000 catch err: " + JSON.stringify(err));
+ console.debug("ACTS_AppSelectorTest_1000 catch err: " + err);
+ expect("").assertFail();
+ done();
+ }
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1800
+ * @tc.name: Install action matches but type does not match app
+ * @tc.desc: Install action matches but type does not match app,"can't open this file" popup
+ */
+ it('ACTS_AppSelectorTest_1800', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1800 --- start")
+ cmdInstall = 'bm install -p /data/ActstextARelyHap.hap'
+ cmdUninstall = "bm uninstall -n textarelyhap.com.example"
+
+ console.log('ACTS_AppSelectorTest_1800 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1800 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1800 startAbility end");
+
+
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_1800 findComponent");
+ let cantOpen1 = await driver.findComponent(BY.text('无法打开此文件').enabled(true))
+ console.log("ACTS_AppSelectorTest_1800 cantOpen1 " + JSON.stringify(cantOpen1));
+ expect(cantOpen1 != null).assertTrue();
+ let button = await driver.findComponent(BY.text('知道了').enabled(true))
+ console.debug("ACTS_ANROptimization_1800 button: " + JSON.stringify(button))
+ await button.click();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_1900
+ * @tc.name: Install action does not match but type matches app
+ * @tc.desc: Install action does not match but type matches app,"can't open this file" popup
+ */
+ it('ACTS_AppSelectorTest_1900', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_1900 --- start")
+ cmdInstall = 'bm install -p /data/ActstextKRelyHap.hap'
+ cmdUninstall = "bm uninstall -n textkrelyhap.com.example"
+
+ console.log('ACTS_AppSelectorTest_1900 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "text/txt",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_1900 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_1900 startAbility end");
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_1900 findComponent");
+ let cantOpen1 = await driver.findComponent(BY.text('无法打开此文件').enabled(true))
+ console.log("ACTS_AppSelectorTest_1900 cantOpen1 " + JSON.stringify(cantOpen1));
+ expect(cantOpen1 != null).assertTrue();
+ let button = await driver.findComponent(BY.text('知道了').enabled(true))
+ console.debug("ACTS_AppSelectorTest_1900 button: " + JSON.stringify(button))
+ await button.click();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2000
+ * @tc.name: Implicitly start the interface action and pass in an empty string
+ * @tc.desc: Implicitly start the interface action and pass in an empty string,return success
+ */
+ it('ACTS_AppSelectorTest_2000', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2000 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap"
+
+ console.log('ACTS_AppSelectorTest_2000 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.log("ACTS_AppSelectorTest_2000 startAbility " + JSON.stringify(error));
+ expect(error.code).assertEqual(0);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2100
+ * @tc.name: Implicitly start the interface action and pass in null
+ * @tc.desc: Implicitly start the interface action and pass in null,return failure
+ */
+ it('ACTS_AppSelectorTest_2100', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2100 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap"
+
+ console.log('ACTS_AppSelectorTest_2100 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: null,
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.log("ACTS_AppSelectorTest_2100 startAbility " + JSON.stringify(error));
+ expect(error.code).assertEqual(0);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelector_2200
+ * @tc.name: Implicitly start the interface action and pass in undefined
+ * @tc.desc: Implicitly start the interface action and pass in undefined,return success
+ */
+ it('ACTS_AppSelectorTest_2200', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2200 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap"
+
+ console.log('ACTS_AppSelectorTest_2200 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: undefined,
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.log("ACTS_AppSelectorTest_2200 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ expect(error.code).assertEqual(0);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2300
+ * @tc.name: Implicitly start the interface type and pass in an empty string
+ * @tc.desc: Implicitly start the interface type and pass in an empty string,return failure
+ */
+ it('ACTS_AppSelectorTest_2300', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2300 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap"
+
+ console.log('ACTS_AppSelectorTest_2300 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.log("ACTS_AppSelectorTest_2300 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ expect(error.code).assertEqual(1);
+ await sleep(2000);
+ let button = await driver.findComponent(BY.text('知道了').enabled(true))
+ console.debug("ACTS_AppSelectorTest_2300 button: " + JSON.stringify(button))
+ console.debug("ACTS_AppSelectorTest_2300 click");
+ await button.click();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2400
+ * @tc.name: Implicitly start the interface type and pass in null
+ * @tc.desc: Implicitly start the interface type and pass in null,return failure
+ */
+ it('ACTS_AppSelectorTest_2400', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2400 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap"
+
+ console.log('ACTS_AppSelectorTest_2400 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: null,
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.log("ACTS_AppSelectorTest_2400 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ expect(error.code).assertEqual(1);
+ await sleep(2000);
+ let button = await driver.findComponent(BY.text('知道了').enabled(true))
+ console.debug("ACTS_AppSelectorTest_2400 button: " + JSON.stringify(button))
+ console.debug("ACTS_AppSelectorTest_2400 click");
+ await button.click();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2500
+ * @tc.name: Implicitly start the interface type and pass in undefined
+ * @tc.desc: Implicitly start the interface type and pass in undefined,return failure
+ */
+ it('ACTS_AppSelectorTest_2500', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2500 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap"
+
+ console.log('ACTS_AppSelectorTest_2500 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: undefined,
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.log("ACTS_AppSelectorTest_2500 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ expect(error.code).assertEqual(1);
+ await sleep(2000);
+ let button = await driver.findComponent(BY.text('知道了').enabled(true))
+ console.debug("ACTS_AppSelectorTest_2500 button: " + JSON.stringify(button))
+ console.debug("ACTS_AppSelectorTest_2500 click");
+ await button.click();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2600
+ * @tc.name: Multi-hap application with action and type configured in entry
+ * @tc.desc: Multi-hap application with action and type configured in entry,MainAbility is pulled up in entry
+ */
+ it('ACTS_AppSelectorTest_2600', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2600 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageAFeatureRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap"
+
+ console.log('ACTS_AppSelectorTest_2600 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.debug("ACTS_AppSelectorTest_2600 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_2600 startAbility end");
+ })
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_2600 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_2600 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_2600 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_2600 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_2600 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_2600 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2700
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_2700', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2700 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageBFeatureRelyHap.hap;bm install -p /data/ActsImageBEntryRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagebrelyhap"
+
+ console.log('ACTS_AppSelectorTest_2700 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.debug("ACTS_AppSelectorTest_2700 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_2700 startAbility end");
+ })
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_2700 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_2700 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_2700 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_2700 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_2700 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility1");
+ expect(data.parameters.bundleName).assertEqual("imagebrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_2700 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2800
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_2800', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2800 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageCEntryRelyHap.hap;bm install -p /data/ActsImageCFeatureRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagecrelyhap"
+
+ console.log('ACTS_AppSelectorTest_2800 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_2800 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_2800 startAbility end");
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_2800 findComponent");
+ let button = await driver.findComponent(BY.text('imagecrelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_2800 button " + JSON.stringify(button));
+ await button.click();
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_2800 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_2800 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_2800 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_2800 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_2800 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagecrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_2800 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_2900
+ * @tc.name: MainAbility configures multi-ability applications of actions and types
+ * @tc.desc: MainAbility configures multi-ability applications of actions and types,mainAbility is pulled up
+ */
+ it('ACTS_AppSelectorTest_2900', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_2900 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageDRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagedrelyhap"
+
+ console.log('ACTS_AppSelectorTest_2900 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.debug("ACTS_AppSelectorTest_2900 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_2900 startAbility end");
+ })
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_2900 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_2900 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_2900 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_2900 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_2900 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagedrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_2900 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3000
+ * @tc.name: SecondAbility configures multi-ability applications of actions and types
+ * @tc.desc: SecondAbility configures multi-ability applications of actions and types,secondAbility is pulled up
+ */
+ it('ACTS_AppSelectorTest_3000', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3000 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageERelyHap.hap'
+ cmdUninstall = "bm uninstall -n imageerelyhap"
+
+ console.log('ACTS_AppSelectorTest_3000 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.debug("ACTS_AppSelectorTest_3000 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_3000 startAbility end");
+ })
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_3000 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_3000 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_3000 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_3000 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_3000 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("SecondAbility");
+ expect(data.parameters.bundleName).assertEqual("imageerelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_3000 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3100
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_3100', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3100 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageFRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagefrelyhap"
+
+ console.log('ACTS_AppSelectorTest_3100 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.debug("ACTS_AppSelectorTest_3100 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.debug("ACTS_AppSelectorTest_3100 startAbility end");
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_3100 findComponent");
+ let button = await driver.findComponent(BY.text('imagefrelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_3100 button " + JSON.stringify(button));
+ await button.click();
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ })
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_3100 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_3100 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_3100 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_3100 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_3100 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagefrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_3100 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3400
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_3400', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3400 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap"
+
+ console.log('ACTS_AppSelectorTest_3400 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ globalThis.abilityContext.startAbilityWithAccount(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, 100, (error, data) => {
+ console.log("ACTS_AppSelectorManual startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ })
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_3400 findComponent");
+ let button = await driver.findComponent(BY.text('imagearelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_3400 button " + JSON.stringify(button));
+ await button.click();
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_3400 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_3400 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_3400 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_3400 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_3400 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_3400 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3500
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_3500', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3500 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap"
+
+ console.log('ACTS_AppSelectorTest_3500 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ globalThis.abilityContext.startAbilityForResultWithAccount(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, 100, (error, data) => {
+ console.log("ACTS_AppSelectorManual startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ })
+ await sleep(2000);
+ console.log("ACTS_AppSelectorTest_3500 findComponent");
+ let button = await driver.findComponent(BY.text('imagebrelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_3500 button " + JSON.stringify(button));
+ await button.click();
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_3500 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_3500 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_3500 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_3500 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_3500 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility1");
+ expect(data.parameters.bundleName).assertEqual("imagebrelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_3500 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3600
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_3600', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3600 --- start")
+ cmdInstall = 'bm install -p /data/ActsServiceAbilityBRelyHap.hap;bm install -p /data/ActsImageKRelyHap.hap'
+ cmdUninstall = "bm uninstall -n bserviceabilityrelyhap;bm uninstall -n imagekrelyhap"
+
+ console.log('ACTS_AppSelectorTest_3600 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+ let subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ commonEvent.subscribe(subscriber, SubscribeCallBack)
+ console.log("ACTS_AppSelectorTest_3600 connectservice")
+
+ let connectionId;
+ let want = {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ },
+ };
+
+ connectionId = globalThis.abilityContext.connectAbility(want, paConnect)
+ console.info('ACTS_AppSelectorTest_3600 Service connectionId ' + connectionId);
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_3600 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_3600 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_3600 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_3600 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_3600 event = ' + data.event);
+ console.log('ACTS_AppSelectorTest_3600 startByService = ' + data.parameters.startByService);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.startByService).assertEqual(true);
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+ }
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_3600 UnSubscribeCallBack");
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3700
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_3700', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3700 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap;' +
+ 'bm install -p /data/ActsAppSelectorRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap;" +
+ "bm uninstall -n com.example.appselectorrelyhap"
+
+ console.log('ACTS_AppSelectorTest_3700 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(1000);
+ globalThis.abilityContext.startAbility(
+ {
+ bundleName: "com.example.appselectorrelyhap",
+ abilityName: "MainAbility",
+ }, (error, data) => {
+ console.log("ACTS_AppSelectorTest_3700 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ })
+ await sleep(2000);
+ let component = await driver.findComponent(BY.text('imagearelyhap'))
+ let button = await component.getBounds()
+ console.log("ACTS_AppSelectorTest_3700 button " + JSON.stringify(button));
+
+ var cmd = 'bm uninstall -n com.example.appselectorrelyhap ';
+ console.log('ACTS_AppSelectorTest_3700 cmd = ' + cmd);
+ abilityDelegator.executeShellCommand(cmd,
+ async (err: any, d: any) => {
+ console.info('ACTS_AppSelectorTest_3700 executeShellCommand : err : ' + JSON.stringify(err));
+ console.info('ACTS_AppSelectorTest_3700 executeShellCommand : stdResult : ' + d.stdResult);
+ console.info('ACTS_AppSelectorTest_3700 executeShellCommand : exitCode : ' + d.exitCode);
+ await sleep(2000);
+ await driver.click(button.leftX, button.topY);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number: ACTS_AppSelectorTest_3300
+ * @tc.name: Multi-hap application with action and type configured in feature
+ * @tc.desc: Multi-hap application with action and type configured in feature,mainAbility is pulled up in feature
+ */
+ it('ACTS_AppSelectorTest_3300', 0, async function (done) {
+ console.log("ACTS_AppSelectorTest_3300 --- start")
+ cmdInstall = 'bm install -p /data/ActsImageAEntryRelyHap.hap;bm install -p /data/ActsImageBFeatureRelyHap.hap'
+ cmdUninstall = "bm uninstall -n imagearelyhap;bm uninstall -n imagebrelyhap"
+ let subscriber;
+ console.log('ACTS_AppSelectorTest_3300 cmd = ' + cmdInstall);
+ await abilityDelegator.executeShellCommand(cmdInstall);
+ await sleep(2000);
+
+ for (var i = 0; i < 10; i++) {
+ await sleep(2000);
+ subscriber = await commonEvent.createSubscriber(subscriberInfo);
+ globalThis.abilityContext.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "image/png",
+ parameters: {
+ uri: "filePath"
+ }
+ }, async (error, data) => {
+ console.log("ACTS_AppSelectorTest_3300 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ })
+
+ commonEvent.subscribe(subscriber, SubscribeCallBack);
+ await sleep(3000);
+ console.log("ACTS_AppSelectorTest_3300 findComponent");
+ let button = await driver.findComponent(BY.text('imagearelyhap').enabled(true))
+ console.log("ACTS_AppSelectorTest_3300 button " + JSON.stringify(button));
+ await button.click();
+
+ async function SubscribeCallBack(err, data) {
+ console.log('ACTS_AppSelectorTest_3300 bundleName = ' + data.parameters.bundleName);
+ console.log('ACTS_AppSelectorTest_3300 abilityName = ' + data.parameters.abilityName);
+ console.log('ACTS_AppSelectorTest_3300 type = ' + data.parameters.type);
+ console.log('ACTS_AppSelectorTest_3300 uri = ' + data.parameters.uri);
+ console.log('ACTS_AppSelectorTest_3300 event = ' + data.event);
+ expect(data.event).assertEqual("AppSelector");
+ expect(data.parameters.abilityName).assertEqual("MainAbility");
+ expect(data.parameters.bundleName).assertEqual("imagearelyhap");
+ expect(data.parameters.type).assertEqual("image/png");
+ expect(data.parameters.uri).assertEqual("filePath");
+ }
+ }
+ await sleep(2000);
+ commonEvent.unsubscribe(subscriber, UnSubscribeCallBack)
+
+ function UnSubscribeCallBack() {
+ console.log("ACTS_AppSelectorTest_3300 UnSubscribeCallBack");
+ done();
+ }
+ })
+ })
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8828f3c461f6224c1f8532e6e299c7b1facc2824
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,19 @@
+/*
+ * 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 abilityTest from './Ability.test'
+
+export default function testsuite() {
+ abilityTest()
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..63433eb8d6b9487794cb12a568e2b0f733abdad3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/module.json
@@ -0,0 +1,36 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone"
+ ],
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..a042229a98e83f0fecd6510b9240aa0e6b18e3d6
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "AppSelectorTest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsappselectortest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsappselectortest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsappselectortest/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..acb9d83ec9c7c15b36d1656d0f67135832ee207d
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagearelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..f5a41012f62766f497f607db33d0a34c69f32dd3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageARelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageaentryrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..d82bab124d4f2306b6fa81810fdf3b75924453bd
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageAEntryRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageAEntryRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimageaentryrelyhap_js_assets",
+ ":actsimageaentryrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimageaentryrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimageaentryrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimageaentryrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimageaentryrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..76c42708a682982115e9e63459c1e5157eaefe59
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,67 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b821e0762b0ce1f49b14c6af2d2ef24927e5ec39
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageAEntryRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..9f0588e2b01de5e7be32dfad152eee0c3097c594
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimageaentryrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..acb9d83ec9c7c15b36d1656d0f67135832ee207d
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagearelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..f5a41012f62766f497f607db33d0a34c69f32dd3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageARelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..f7f1783bffade24d6d73f90b6000de457e6bcf1b
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageAFeatureRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageAFeatureRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimageafeaturerelyhap_js_assets",
+ ":actsimageafeaturerelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimageafeaturerelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimageafeaturerelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimageafeaturerelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimageafeaturerelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts
new file mode 100644
index 0000000000000000000000000000000000000000..76c42708a682982115e9e63459c1e5157eaefe59
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts
@@ -0,0 +1,67 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..5156aee2af84b888660cd3cc28d333098c0ded6e
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageAFeatureRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..cdf0c7dd43e3f837aa98eef7aaca99a153efe00f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/module.json
@@ -0,0 +1,37 @@
+{
+ "module": {
+ "name": "feature",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:feature_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility1",
+ "srcEntrance": "./ets/MainAbility1/MainAbility1.ts",
+ "description": "$string:MainAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..4d1ba2b5ec9e5f5215bbb05f4b2eda6660424843
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "feature_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimageafeaturerelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..3756872988b7a78687c16d798c72fb8048659288
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagebrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..2a5a20b619bd79751438a2ca9f2ab3e9392745b9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageBRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagebentryrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..2944cbcf208f0496714a2f69a5c2f906d3fcecf4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageBEntryRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageBEntryRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagebentryrelyhap_js_assets",
+ ":actsimagebentryrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagebentryrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagebentryrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagebentryrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagebentryrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c96f3dd3cedffdd357d535fb84eb81e5cf7a4341
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagebrelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>ACTS_AppSelectorTest imagebrelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..9b0661e21deae5ad7dd4088becd0c8259a2747ce
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageBEntryRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..d4759b77fa44488ac09e4ce59469ef7f0367c8f9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/module.json
@@ -0,0 +1,37 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagebentryrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..3756872988b7a78687c16d798c72fb8048659288
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagebrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..2a5a20b619bd79751438a2ca9f2ab3e9392745b9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageBRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..6708e0097b9e78a250def0dc9c5f674b506ce953
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageBFeatureRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageBFeatureRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagebfeaturerelyhap_js_assets",
+ ":actsimagebfeaturerelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagebfeaturerelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagebfeaturerelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagebfeaturerelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagebfeaturerelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c96f3dd3cedffdd357d535fb84eb81e5cf7a4341
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagebrelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>ACTS_AppSelectorTest imagebrelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a674f001c62661447573261aa7bd2c9841b2f675
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageBFeatureRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..9c5991c31d2ebedc37f3df222ee647e4e17ce60f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "feature",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:feature_desc",
+ "mainElement": "MainAbility1",
+ "deviceTypes": [
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility1",
+ "srcEntrance": "./ets/MainAbility1/MainAbility1.ts",
+ "description": "$string:MainAbility1_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility1_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..f9bf22447345a31bb6c59261fb1e4408ee9ed80f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "feature_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility1_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility1_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagebfeaturerelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..03c6abdacceab3ebe42a6b273981630443234a12
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagecrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..c9a066960309d4f715524a76b860f773d69204d5
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageCRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagecentryrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..6223a6db9574fb6559dff36ce8c41f62fd1f4e27
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageCEntryRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageCEntryRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagecentryrelyhap_js_assets",
+ ":actsimagecentryrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagecentryrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagecentryrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagecentryrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagecentryrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7290324cec34b10c9c16b1627996902c767b61a3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageCEntryRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..9f0588e2b01de5e7be32dfad152eee0c3097c594
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagecentryrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..03c6abdacceab3ebe42a6b273981630443234a12
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagecrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..c9a066960309d4f715524a76b860f773d69204d5
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageCRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..439aed5911aca9909a6db1f2dc8fd3393df2d15d
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageCFeatureRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageCFeatureRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagecfeaturerelyhap_js_assets",
+ ":actsimagecfeaturerelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagecfeaturerelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagecfeaturerelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagecfeaturerelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagecfeaturerelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/MainAbility1/MainAbility1.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b23af53b55141998878348ccef5af0069dea1651
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageCFeatureRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..9c5991c31d2ebedc37f3df222ee647e4e17ce60f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "feature",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:feature_desc",
+ "mainElement": "MainAbility1",
+ "deviceTypes": [
+ "phone",
+ "tablet"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "pages": "$profile:main_pages",
+ "uiSyntax": "ets",
+ "abilities": [
+ {
+ "name": "MainAbility1",
+ "srcEntrance": "./ets/MainAbility1/MainAbility1.ts",
+ "description": "$string:MainAbility1_desc",
+ "icon": "$media:icon",
+ "label": "$string:MainAbility1_label",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..f9bf22447345a31bb6c59261fb1e4408ee9ed80f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "feature_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility1_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility1_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagecfeaturerelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..da43eefaab4029493a13cac52cf45bb6ec81a03f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagedrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..31f2f8582d9dc30cae94c460cddeb40c4b6f48e3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageDRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagedrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagedrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..8dcad72e371dbc361565edc3e0a787e84bc7ec6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageDRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageDRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagedrelyhap_js_assets",
+ ":actsimagedrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagedrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagedrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagedrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagedrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8b0e4d5690e998c9672c7ff9cab09a0dadfe596a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class SecondAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..13ab1f39b0dd02c4b7c0cbc1faed42c67b9df424
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageDRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..813610967ecfbd698d1bbf0bc8b4d29c18904262
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/module.json
@@ -0,0 +1,57 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "SecondAbility",
+ "srcEntrance": "./ets/SecondAbility/SecondAbility.ts",
+ "description": "$string:SecondAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:SecondAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..61009f0568889992994409f98d5fe3964976a381
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "SecondAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "SecondAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagedrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagedrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagedrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagedrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..4489cddd78fca4c8d9fffc8be1222295a239c01e
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imageerelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..0878ae980505e0a7d84fe04f75e4321b45cc47aa
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageERelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageerelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimageerelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..d15a05756ae5a2c90cff97bcdc11aabc0fa39330
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageERelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageERelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimageerelyhap_js_assets",
+ ":actsimageerelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimageerelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimageerelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimageerelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimageerelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..650c7d6d0ac41b1f69e0973cfe540e36cb723481
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
@@ -0,0 +1,67 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class SecondAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] SecondAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ onDestroy() {
+ console.log("[Demo] SecondAbility onDestroy")
+ }
+
+ onWindowStageCreate(windowStage) {
+ // Main window is created, set main page for this ability
+ console.log("[Demo] SecondAbility onWindowStageCreate")
+
+ windowStage.setUIContent(this.context, "pages/index", null)
+ }
+
+ onWindowStageDestroy() {
+ // Main window is destroyed, release UI related resources
+ console.log("[Demo] SecondAbility onWindowStageDestroy")
+
+ }
+
+ onForeground() {
+ // Ability has brought to foreground
+ console.log("[Demo] SecondAbility onForeground")
+ console.log("[Demo] SecondAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imageerelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imageerelyhap SecondAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] SecondAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2bf5dfc120e669e90836f59e59f15aec8c7e2492
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageERelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..08f74bf6254b16c01eeee6416d6958022d828e1c
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/module.json
@@ -0,0 +1,57 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "SecondAbility",
+ "srcEntrance": "./ets/SecondAbility/SecondAbility.ts",
+ "description": "$string:SecondAbility_desc",
+ "icon": "$media:icon",
+ "visible": true,
+ "label": "$string:SecondAbility_label",
+ "skills": [
+ {
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..61009f0568889992994409f98d5fe3964976a381
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "SecondAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "SecondAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageerelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageerelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimageerelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimageerelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..daf090d19e0073910c3fb9a90d11e21bddddaa69
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagefrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..bf92305ade6d8307163cdcfc15ce4145a8a14281
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageFRelyHap"
+ }
+ ]
+}
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagefrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagefrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..9eb9d019f758a95f451e526418c67d3a9a098970
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageFRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageFRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagefrelyhap_js_assets",
+ ":actsimagefrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagefrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagefrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagefrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagefrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b92beea4500936fc2b1121af5b5677c0b705b002
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class SecondAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1f19a1da4cd8fe10ba7ce872f6138fc5bcf520ee
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageFRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..8c94ac7bfb74af1d6c878b86df1bd7be99b49992
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/module.json
@@ -0,0 +1,62 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "SecondAbility",
+ "srcEntrance": "./ets/SecondAbility/SecondAbility.ts",
+ "description": "$string:SecondAbility_desc",
+ "icon": "$media:icon",
+ "label": "$string:SecondAbility_label",
+ "visible": true,
+ "skills": [
+ {
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..61009f0568889992994409f98d5fe3964976a381
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "SecondAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "SecondAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publish/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/publish/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagefrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagefrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagefrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagefrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..8cd8e57fb555c6c35432eff0367f3e04355ad412
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagegrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e32c2ed17093310924304748a2eba36391f4c83
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageGRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagegrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagegrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..6743221be79cbb9563c3e82c74b1152f74dcb59c
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageGRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageGRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagegrelyhap_js_assets",
+ ":actsimagegrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagegrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagegrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagegrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagegrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..184d752c47544da3d049cfc5811251a5ec0a2350
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,51 @@
+/*
+ * 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';
+import file from '@system.file';
+@Entry
+@Component
+struct Index {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ }
+
+ @State message: string = 'MainAbility'
+
+ 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
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3ef538001795a4630d04727ca36007f19b1ffdcb
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageGRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..9f0588e2b01de5e7be32dfad152eee0c3097c594
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagegrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagegrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagegrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagegrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..e16e3c3d3b8fab173c092ba7aa82a3fea108ee5b
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagehrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..f2c355baaa7bd6052f161bd6d2dccfe258e740ac
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageHRelyHap"
+ }
+ ]
+}
diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagehrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagehrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..134c1c11e33cdbe7fe7695dc3b126e147047a215
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageHRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageHRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagehrelyhap_js_assets",
+ ":actsimagehrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagehrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagehrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagehrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagehrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..184d752c47544da3d049cfc5811251a5ec0a2350
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,51 @@
+/*
+ * 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';
+import file from '@system.file';
+@Entry
+@Component
+struct Index {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ }
+
+ @State message: string = 'MainAbility'
+
+ 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
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..cf55418401cd0d4397d281037b90a7758321b005
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageHRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..9f0588e2b01de5e7be32dfad152eee0c3097c594
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishsound/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/publishsound/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagehrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagehrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagehrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagehrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..2d2d77b8d712dd2a7d0729dfb26384de19912da1
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imageirelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..90d258ec6679699ca1dd21aca46459848b95a15f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageIRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/publishvibra/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageirelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimageirelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..413afe705c35a288c4d4ba94ec6475f1bda9744f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageIRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageIRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimageirelyhap_js_assets",
+ ":actsimageirelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimageirelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimageirelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimageirelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimageirelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c082a6aec43c79c11fc4377e3c9c8cb5b92c7186
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagearelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagearelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..184d752c47544da3d049cfc5811251a5ec0a2350
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,51 @@
+/*
+ * 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';
+import file from '@system.file';
+@Entry
+@Component
+struct Index {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ }
+
+ @State message: string = 'MainAbility'
+
+ 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
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e904e3bb73f7f95a6dc0dccada2c614908c616be
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageIRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..9f0588e2b01de5e7be32dfad152eee0c3097c594
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/sub/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/sub/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimageirelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimageirelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimageirelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimageirelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..4b6ade9e393a72acfd04c1ba8283bfa666da7a8a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagejrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..d9bd9cdbd32547c15bb8b57444b4cf8be0e54927
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageJRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagejrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagejrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..2a8343798d525211b72dc8f74cab7a1acabc6e5d
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageJRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageJRelyHap"
+
+ deps = [
+ ":actsimagejrelyhap_js_assets",
+ ":actsimagejrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagejrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagejrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagejrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagejrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5eccf4c7828dd8d34e6a327910ee1358a56c5833
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,47 @@
+/*
+ * 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")
+ }
+
+ 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")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..184d752c47544da3d049cfc5811251a5ec0a2350
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,51 @@
+/*
+ * 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';
+import file from '@system.file';
+@Entry
+@Component
+struct Index {
+ aboutToAppear() {
+ console.info('MainAbility index aboutToAppear')
+ }
+
+ @State message: string = 'MainAbility'
+
+ 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
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..30c9b862cdb3b656d310d90614387b6f5928bef5
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageJRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..d6d2ca5d59ade7344363c49384aeda2e12280916
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/module.json
@@ -0,0 +1,42 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/jpeg"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagejrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagejrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagejrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagejrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..70d6774d44f0b1d3e13dc9a07d181ce50c44d419
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "imagekrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..71e244d1382c49873d6d6b031bd47ce57abc1d75
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "imageKRelyHap"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagekrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsimagekrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..78c47bd116ccd106e4953f9646c05d09f42561b1
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsImageKRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsImageKRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsimagekrelyhap_js_assets",
+ ":actsimagekrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsimagekrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsimagekrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsimagekrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsimagekrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..48603c3f1882e3fee65d6e0967ec1aac963ff8ef
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,67 @@
+/*
+ * 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'
+import commonEvent from '@ohos.commonEvent'
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log("[Demo] MainAbility onCreate")
+ globalThis.abilityWant = want;
+ if (want.parameters.startByService) {
+ AppStorage.SetOrCreate('startByService', want.parameters.startByService);
+ }
+
+ }
+
+ 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")
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
+ let commonEventData = {
+ code: 0,
+ data: 'imagekrelyhap',
+ parameters: {
+ abilityName: globalThis.abilityWant.abilityName,
+ bundleName: globalThis.abilityWant.bundleName,
+ type: globalThis.abilityWant.type,
+ uri: globalThis.abilityWant.parameters.uri,
+ startByService:globalThis.abilityWant.parameters.startByService
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>imagekrelyhap MainAbility published<======')
+ })
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] MainAbility onBackground")
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f1865cb187f944195a866cd23584a5b165a54bf3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,36 @@
+/*
+ * 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 = 'imageKRelyHap'
+ @StorageLink('startByService') startByService: boolean = false;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+
+ Text("startByService: " + this.startByService)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..647f63e74c2c3445054c8860ac412a796f89ae0e
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,36 @@
+/*
+ * 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 = 'imageKRelyHap'
+ @StorageLink('startByService') startByService: boolean = false;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+
+ Text("startByService: " + this.startByService)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..d4759b77fa44488ac09e4ce59469ef7f0367c8f9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/module.json
@@ -0,0 +1,37 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..dddf9123aec0b6c9500eeacf289ac1bc58ff7a6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsimagekrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsimagekrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsimagekrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsimagekrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..c3256a90083abadcdf7244149dc5c7898d255130
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "aserviceabilityrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..6683e32c2794d4749b23c82d7fe673f83c1066d1
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "actsserviceabilityarelyhap"
+ }
+ ]
+}
diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..c55e4970cdb7822329aca1a97c7e6b5fe7eaeba3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsServiceAbilityARelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsServiceAbilityARelyHap"
+
+ testonly = true
+ deps = [
+ ":actsserviceabilityarelyhap_js_assets",
+ ":actsserviceabilityarelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsserviceabilityarelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsserviceabilityarelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsserviceabilityarelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsserviceabilityarelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..260e7891fe9921853f1d5fdf6640818e4f636d41
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,43 @@
+/*
+ * 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('MainAbility onCreate')
+ globalThis.abilityWant = want;
+ }
+
+ onDestroy() {
+ console.log('MainAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('MainAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+ }
+
+ onWindowStageDestroy() {
+ console.log('MainAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('MainAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('MainAbility onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c40096dc19e6372101d540684b500456f5f739c3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageAEntryRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..210dc7900f7a34e309d9e6eac96191206e624fdf
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
@@ -0,0 +1,49 @@
+/*
+ * 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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
+import rpc from "@ohos.rpc";
+import Want from '@ohos.application.Want';
+
+export default class ServiceAbility extends ServiceExtensionAbility {
+ onCreate(want) {
+ console.log('AppSelector ServiceAbility onCreate, want: ' + want.abilityName);
+ }
+
+ onConnect(want: Want) {
+ console.log('AppSelector ServiceAbility onConnect, want:' + want.abilityName);
+ this.context.startAbility(
+ {
+ action: "ohos.want.action.viewData",
+ type: "text/txt",
+ parameters: {
+ uri: "filePath"
+ }
+ }, (error, data) => {
+ console.info("ACTS_AppSelector_0900 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.info("ACTS_AppSelector_0900 startAbility end");
+ })
+ return new rpc.RemoteObject('connect');
+ }
+
+ onDisconnect(want) {
+ console.log('AppSelector ServiceAbility onDisconnect, want:' + want.abilityName);
+ }
+
+ onDestroy() {
+ console.log('ServiceAbility onDestroy');
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/ServiceAbility/service.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8f18a61d57fe4cc71cd70bae4d9378d284df0e2c
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/ServiceAbility/service.ts
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default {
+ onStart() {
+ console.info('ServiceAbility onStart');
+ },
+ onStop() {
+ console.info('ServiceAbility onStop');
+ },
+ onCommand(want, startId) {
+ console.info('ServiceAbility onCommand');
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b821e0762b0ce1f49b14c6af2d2ef24927e5ec39
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageAEntryRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..d5ff071453789a78c54e1b90a1d323294996502b
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/module.json
@@ -0,0 +1,46 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone"
+ ],
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ],
+ "extensionAbilities": [
+ {
+ "name": "ServiceAbility",
+ "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts",
+ "label": "$string:service_ServiceAbility_desc",
+ "description": "$string:service_ServiceAbility_desc",
+ "type": "service|dataShare",
+ "visible": true
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..24e76e8b8cf82af6c7c52c48bbf354c2c5b35173
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,32 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsserviceabilityarelyhap"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ },
+ {
+ "name": "service_ServiceAbility_desc",
+ "value": "service_description"
+ },
+ {
+ "name": "service_ServiceAbility_label",
+ "value": "service_label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsserviceabilityarelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/app.json b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..38b25d33adb4e6c768412172077803e704df9c52
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/app.json
@@ -0,0 +1,19 @@
+{
+ "app": {
+ "bundleName": "bserviceabilityrelyhap",
+ "vendor": "example",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..6792c02963a3e29c0f34e365874200241b0f72c7
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "actsserviceabilitybrelyhap"
+ }
+ ]
+}
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/resources/base/media/app_icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/AppScope/resources/base/media/app_icon.png
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..ddbe2a0f7c6010a71d9a68301c258ca04c7aebd4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/BUILD.gn
@@ -0,0 +1,44 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsServiceAbilityBRelyHap") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ hap_name = "ActsServiceAbilityBRelyHap"
+
+ testonly = true
+ deps = [
+ ":actsserviceabilitybrelyhap_js_assets",
+ ":actsserviceabilitybrelyhap_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsserviceabilitybrelyhap_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsserviceabilitybrelyhap_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsserviceabilitybrelyhap_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsserviceabilitybrelyhap_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0190fb0606f5b60fafe51d094ef1b3c8d69d1da4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,21 @@
+/*
+ * 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
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d22a1bf6db6d710e0e88072be63c9b519414d31f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,45 @@
+/*
+ * 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('MainAbility onCreate')
+ globalThis.abilityWant = want;
+ globalThis.abilityContext = this.context;
+ }
+
+ onDestroy() {
+ console.log('MainAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('MainAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
+
+ }
+
+ onWindowStageDestroy() {
+ console.log('MainAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('MainAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('MainAbility onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ffa2c85dbe70cacfc662ba9cc0c346e7f6034707
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
@@ -0,0 +1,66 @@
+/*
+ * 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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
+import rpc from "@ohos.rpc";
+import Want from '@ohos.application.Want';
+// import commonEvent from '@ohos.commonEvent'
+
+export default class ServiceAbility extends ServiceExtensionAbility {
+ onCreate(want) {
+ console.log('AppSelector ServiceAbility onCreate, want: ' + want.abilityName);
+ }
+
+ onConnect(want: Want) {
+ console.log('AppSelector ServiceAbility onConnect, want:' + want.abilityName);
+ this.context.startAbility(
+ {
+ "bundleName": "imagekrelyhap",
+ "abilityName": "MainAbility",
+ parameters: {
+ startByService: true
+ }
+ }, (error, data) => {
+ console.info("ACTS_AppSelector_3600 startAbility " +
+ JSON.stringify(error) + "," + JSON.stringify(data));
+ console.info("ACTS_AppSelector_3600 startAbility end");
+ })
+ // console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ // let commonEventData = {
+ // code: 0,
+ // data: 'imagekrelyhap',
+ // parameters: {
+ // abilityName: want.abilityName,
+ // bundleName: want.bundleName,
+ // type: want.type,
+ // uri: want.parameters.uri,
+ // startByService:want.parameters.startByService
+ // }
+ // }
+ // commonEvent.publish('AppSelector', commonEventData, (err) => {
+ // console.log('======>imagekrelyhap MainAbility published<======')
+ // })
+
+ return new rpc.RemoteObject('connect');
+ }
+
+ onDisconnect(want) {
+ console.log('AppSelector ServiceAbility onDisconnect, want:' + want.abilityName);
+ }
+
+ onDestroy() {
+ console.log('ServiceAbility onDestroy');
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/ServiceAbility/service.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8f18a61d57fe4cc71cd70bae4d9378d284df0e2c
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/ServiceAbility/service.ts
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default {
+ onStart() {
+ console.info('ServiceAbility onStart');
+ },
+ onStop() {
+ console.info('ServiceAbility onStop');
+ },
+ onCommand(want, startId) {
+ console.info('ServiceAbility onCommand');
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b821e0762b0ce1f49b14c6af2d2ef24927e5ec39
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,47 @@
+/*
+ * 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 = 'imageAEntryRelyHap'
+ @StorageLink('bundleName') bundleName: string = null;
+ @StorageLink('abilityName') abilityName: string = null;
+ @StorageLink('type') type: string = null;
+ @StorageLink('uri') uri: string = null;
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/module.json b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..96165322cba1e22a7cff03ceee3c96d83099f0c4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/module.json
@@ -0,0 +1,58 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "phone"
+ ],
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ],
+ "extensionAbilities": [
+ {
+ "name": "ServiceAbility",
+ "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts",
+ "label": "$string:service_ServiceAbility_label",
+ "description": "$string:service_ServiceAbility_desc",
+ "type": "service|dataShare",
+ "visible": true,
+ "skills": [
+ {
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "image/png"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..8c7ec91f5a16fe583414ee4fea0c5e1e2316bc5e
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,32 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsserviceabilitybrelyhap"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ },
+ {
+ "name": "service_ServiceAbility_desc",
+ "value": "service_description"
+ },
+ {
+ "name": "service_ServiceAbility_label",
+ "value": "service_label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actsserviceabilitybrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextarelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextarelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..2f129f022f222699c3560180c4e9155683691d11
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextarelyhap/BUILD.gn
@@ -0,0 +1,36 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextARelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextARelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..66926bfc494ab0189e6b0454ff3cd8ef72c4ae5b
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textarelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..451daa2fe41cc40b0bf6a9be4ef9f168956b3504
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,60 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ var want;
+ console.info('Application onCreate')
+
+ try{
+ featureAbility.getWant((err, data) => {
+ want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textarelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textarelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b9b91905974490cf08585eef34ac6a0675f2085a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textARelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..655a94a9ab09856c1bc6c1849cd0666967a32f2d
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actstextarelyhap"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextarelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextarelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextarelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextarelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextbrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextbrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..e6f561f8416e77edc4bcc45a1da5a5b610e2d7cc
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextbrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextBRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextBRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..3ebcb6f57be19a4c62316c673c38d5dea29854e8
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textbrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2e13f77c871ddc8b35be79f4eb78def7c05d2cea
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textbrelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textbrelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..76560040dc7d3887599a9d96b06988dbbe6c3608
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textBRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextbrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextbrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextbrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextbrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextcrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextcrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..cbe03c77df9ef29efea652d39fd7a33f59f22e01
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextcrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextCRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextCRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..36ef410d47779a929811b346e1577e79ca9bf391
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textcrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..83427442c5d81beec585d422c5aa320922fd4296
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textcrelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textcrelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c012201e82452697bd99e0f55fcf92f879c11a34
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textCRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextcrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextcrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextcrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextcrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextdrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextdrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..7e5520c648653b836c1459bf38c83eaf1e902472
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextdrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextDRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextDRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..a498525b79d1143cae6ff154b57786b740851f3a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textdrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..64bfc183bf50af03cd43910909a9a563416f88f2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textdrelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textdrelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8bc776ed3ebb8f39735a21ebb42a7deb5b063392
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textDRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextdrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextdrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextdrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextdrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstexterelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstexterelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..83376d2cd74b881abd4fd171ad2d14fc21978550
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexterelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextERelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextERelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..0972283a3ac4c14935f38555fd8c0790f42d20c6
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "texterelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..95daf966045a694f936a1de7cd5874c1606f2d85
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'texterelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>texterelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8cebb723863a85d1abe2f4eb618dfa0979271817
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textERelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstexterelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstexterelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstexterelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstexterelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextfrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextfrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..08ba99bb2f589969b0eb3c1001ff788acc1f124b
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextfrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextFRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextFRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..189a522070726cce363635438b6d7bbd05613b5a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textfrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1a21fb5443dc7f3fb21819568aa988da80308cae
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textfrelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textfrelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..76d6ac147b0f2509b1685ddaa3db90ff3b03da17
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textFRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextfrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextfrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextfrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextfrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextgrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextgrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..1fba8dbe9aa828e46bda739a0b0ed77f21226724
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextgrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextGRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextGRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..d0dafedf8ddd0cd680f92767f23668249b0dc3f3
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textgrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..92fed374e5d5a2c5cfb64662fd3f85f9aea56ab8
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textgrelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textgrelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3e385b74990affd8e27f6067a7d7d6e828464c6f
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textGRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextgrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextgrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextgrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextgrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstexthrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstexthrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..fdc6f6595207c7d5289059c40053f5df2c31a5d1
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexthrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextHRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextHRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..aa060703b712204544fbc467b9c83e6226a2a961
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "texthrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..723dfab3fce9064772189d623fe10fc01e7d1711
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'texthrelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>texthrelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0d2c9e3502b1938592fe171de0e589db191cab6a
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textHRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstexthrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstexthrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstexthrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstexthrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextirelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextirelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..40414a02c2a00198e20b8944d7722bcaef3ae6b8
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextirelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextIRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextIRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..7dfa59339f0cb0128e1bae3b688a537058a568a6
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textirelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..697c9217409692a5c4e108a830cce9bbd7219ce2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textirelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textirelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..03705059201f9ae73b90dfbb6632100be8d829b4
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textIRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextirelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextirelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextirelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextirelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextjrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextjrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..d940b30119fd72a14b5c10e67bb288ef5a013965
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextjrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextJRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextJRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..b68cd0930f90833c134f1247167afa69f3d0eca1
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textjrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.viewData"
+ ],
+ "uris": [
+ {
+ "type": "text/md"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..487fafac7cc9fa524b919b440eb1244df9a6732d
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// @ts-nocheck
+import featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textarelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textarelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..bcfc2c61bc6969a4d19365aa7f21643697dd0067
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textJRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..863d57a2f5c6975f36734e5e2331bbed32ff09b2
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "actsstartrunnertest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/startup/startup_standard/systemparamter/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from startup/startup_standard/systemparamter/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextjrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextjrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextjrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextjrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsappselector/actstextkrelyhap/BUILD.gn b/ability/ability_runtime/actsappselector/actstextkrelyhap/BUILD.gn
new file mode 100755
index 0000000000000000000000000000000000000000..f34f30ad8eb2548e02d5f23439cc3c272b3f2674
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextkrelyhap/BUILD.gn
@@ -0,0 +1,35 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActstextKRelyHap") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActstextKRelyHap"
+ js_build_mode = "debug"
+ testonly = true
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..57885f72d00f6cd1f32f49f8b694cd21a80bd10e
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/config.json
@@ -0,0 +1,78 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "textkrelyhap.com.example",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "phone",
+ "tablet"
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "ohos.want.action.getData"
+ ],
+ "uris": [
+ {
+ "type": "text/txt"
+ }
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "com.example.entry",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a877ff7a9af570e2e6dec2ea7377f0a036c0bd74
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,58 @@
+/**
+ * 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 featureAbility from "@ohos.ability.featureAbility"
+import commonEvent from '@ohos.commonEvent'
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ try{
+ featureAbility.getWant((err, data) => {
+ var want = data;
+ try{
+ console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(want))
+ let commonEventData = {
+ code: 0,
+ data: 'textkrelyhap',
+ parameters: {
+ abilityName: want.abilityName,
+ bundleName: want.bundleName,
+ type: want.type,
+ uri:want.parameters.uri
+ }
+ }
+ commonEvent.publish('AppSelector', commonEventData, (err) => {
+ console.log('======>textkrelyhap MainAbility published<======')
+ })
+
+ AppStorage.SetOrCreate('bundleName', want.bundleName);
+ AppStorage.SetOrCreate('abilityName', want.abilityName);
+ AppStorage.SetOrCreate('type', want.type);
+ AppStorage.SetOrCreate('uri', want.parameters.uri);
+ }catch(error)
+ {
+ console.info('Application onCreate error ='+ error);
+ AppStorage.SetOrCreate('err1', error.message);
+ }
+ });
+ }catch(err)
+ {
+ console.info('Application onCreate err ='+ err);
+ AppStorage.SetOrCreate('err2', err.message);
+ }
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..06647c0ca6bbd594796c1a89ec68f00a7b3507e9
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'textKRelyHap'
+ @StorageLink('bundleName') bundleName: string = "";
+ @StorageLink('abilityName') abilityName: string = "";
+ @StorageLink('type') type: string = "";
+ @StorageLink('uri') uri: string = "";
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text("bundleName: " + this.bundleName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("abilityName: " + this.abilityName)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("type: " + this.type)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ Text("uri: " + this.uri)
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..df18caae3bd9df85b56116a0e5e39c02dc9ef250
--- /dev/null
+++ b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "entry_MainAbility"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "TestAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "TestAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/time/TimeTest_js/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from time/TimeTest_js/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actsappselector/actstextkrelyhap/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actsappselector/actstextkrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsappselector/actstextkrelyhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actsappselector/actstextkrelyhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actscalldataabilitytest/BUILD.gn b/ability/ability_runtime/actscalldataabilitytest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..da3fc144cdd030cc89abdaf8cdc8582bef81a0b9
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/BUILD.gn
@@ -0,0 +1,34 @@
+# 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("ActsCallDataAbilityTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":actscalldataabilitytest_ets_assets",
+ ":actscalldataabilitytest_ets_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsCallDataAbilityTest"
+}
+ohos_js_assets("actscalldataabilitytest_ets_assets") {
+ source_dir = "./entry/src/main/ets"
+ hap_profile = "entry/src/main/config.json"
+ ets2abc = true
+}
+ohos_resources("actscalldataabilitytest_ets_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/ability/ability_runtime/actscalldataabilitytest/Test.json b/ability/ability_runtime/actscalldataabilitytest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..3b870295fefc32b94e8a96c0cfd16b52af303a5a
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/Test.json
@@ -0,0 +1,20 @@
+{
+ "description": "Configuration for ActsCallDataAbilityTest Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "300000",
+ "bundle-name": "ohos.acts.aafwk.test.fasupplement",
+ "package-name": "ohos.acts.aafwk.test.fasupplement",
+ "shell-timeout": "600000",
+ "testcase-timeout": "10000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsCallDataAbilityTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/config.json b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..51cbf607724d208bec808bc3ac0a7bfae59efcc6
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/config.json
@@ -0,0 +1,114 @@
+{
+ "app": {
+ "vendor": "example",
+ "bundleName": "ohos.acts.aafwk.test.fasupplement",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 8,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "mainAbility": ".MainAbility",
+ "deviceType": [
+ "default"
+ ],
+ "reqPermissions": [
+ {
+ "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
+ },
+ {
+ "name": "ohos.permission.GET_BUNDLE_INFO"
+ },
+ {
+ "name": "ohos.permission.READ_CONTACTS"
+ },
+ {
+ "name": "ohos.permission.WRITE_CONTACTS"
+ }
+ ],
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "launchType": "singleton"
+ },
+ {
+ "name": ".DataAbility",
+ "srcLanguage": "ets",
+ "srcPath": "DataAbility",
+ "icon": "$media:icon",
+ "description": "$string:DataAbility_desc",
+ "type": "data",
+ "uri": "dataability://ohos.acts.aafwk.test.fasupplement.DataAbility"
+ }
+ ],
+ "distro": {
+ "moduleType": "entry",
+ "installationFree": false,
+ "deliveryWithInstall": true,
+ "moduleName": "entry"
+ },
+ "package": "ohos.acts.aafwk.test.fasupplement",
+ "srcPath": "",
+ "name": ".entry",
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ },
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility2",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ],
+ "defPermissions": [
+ {
+ "name": "ohos.acts.aafwk.test.fasupplement.DataAbilityShellProvider.PROVIDER"
+ }
+ ]
+ }
+}
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/DataAbility/data.ts b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/DataAbility/data.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4e3f90dbb321b579784ae66dcda33198dbc7ec80
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/DataAbility/data.ts
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import commonEvent from '@ohos.commonEvent';
+var publishOptions = {
+ parameters: {
+ "assertData": "{\"group_name\":{\"data\":\"test1\",\"type\":10},"
+ +"\"ringtone_modify_time\":{\"data\":\"28wTypeToString\",\"type\":9}}"
+ }
+};
+
+function PublishCallBack(err) {
+ if (err.code) {
+ console.error("callTest publish failed " + JSON.stringify(err));
+ } else {
+ console.info("callTest publish success!!!");
+ }
+}
+
+export default {
+ onInitialized(abilityInfo) {
+ console.info('DataAbility onInitialized');
+ },
+ call(method, arg, extras) {
+ console.info('DataAbility call test000');
+ console.info('call succeeded data111 ' + JSON.stringify(extras));
+ var temp = JSON.stringify(extras);
+ if(temp == "\"{\\\"group_name\\\":{\\\"data\\\":\\\"test1\\\",\\\"type\\\":10}," +
+ "\\\"ringtone_modify_time\\\":{\\\"data\\\":\\\"28wTypeToString\\\",\\\"type\\\":9}}\"")
+ {
+ console.info('call commonEvent.publish start!!!!');
+ commonEvent.publish("call_event", publishOptions, PublishCallBack);
+ }else {
+ console.info('call not commonEvent.publish!!!');
+ }
+ return extras;
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c9b470c5e030646dc074678531eec7ca122a98cc
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default {
+ onCreate() {
+ console.info('onCreate');
+ },
+ onDestroy() {
+ console.info('onDestroy');
+ },
+ onActive() {
+ console.info('onActive');
+ },
+ onInactive() {
+ console.info('onInactive');
+ },
+ onShow() {
+ console.info('onShow');
+ },
+ onHide() {
+ console.info('onHide');
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..22bb82767483c2cad8397d386cd47c9eeedb3a8c
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,46 @@
+// @ts-nocheck
+/**
+ * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from "../test/List.test";
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'Hello World'
+
+ aboutToAppear() {
+ console.info("aboutToAppear start!!!!")
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ }
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..24619881faa373aa2cdb6c3716e3a8020209b53e
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/List.test.ets
@@ -0,0 +1,20 @@
+/**
+ * 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 callTest from "./callTest.test";
+
+export default function testsuite() {
+ callTest();
+
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/Utils.ets b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/Utils.ets
new file mode 100644
index 0000000000000000000000000000000000000000..78a775bc36e3828f6bb4292a2effa58fd940d9f1
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/Utils.ets
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default class Utils {
+ static sleep(time) {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ resolve(reject)
+ }, time)
+ }).then(() => {
+ console.info(`sleep ${time} over...`)
+ })
+ }
+
+ static getNowTime() {
+ return new Date().getTime();
+ }
+
+ /**
+ * 接口调用时间
+ * @param startTime 接口调用开始时间
+ * @param endTime 接口调用结束时间
+ */
+ static getDurationTime(msg, startTime, endTime) {
+ console.info(msg + 'Get Interface startTime: ' + startTime);
+ console.info(msg + 'Get Interface endTime: ' + endTime);
+ var duration = (endTime - startTime)
+ console.info(msg + 'Get Interface Duration: ' + duration);
+ return duration;
+ }
+}
+
+
+
+
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/callTest.test.ets b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/callTest.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ea9106e1ff5e6cf13469231b001d94ee221910ed
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/MainAbility/test/callTest.test.ets
@@ -0,0 +1,91 @@
+// @ts-nocheck
+
+
+/**
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
+import featureAbility from "@ohos.ability.featureAbility";
+import commonEvent from '@ohos.commonEvent';
+import Utils from './Utils';
+
+export default function callTest() {
+ let TAG = "";
+ const URI_TEST = 'dataability:///ohos.acts.aafwk.test.fasupplement.DataAbility';
+ let dataAbilityHelper = featureAbility.acquireDataAbilityHelper(URI_TEST);
+ let pacMap = {
+ 'group_name': 'test1',
+ 'ringtone_modify_time': 28
+ };
+ var dataAssert = "";
+ var subscriber;
+ var subscribeInfo = {
+ events: ["call_event"]
+ };
+
+ function SubscribeCallBack(err, data) {
+ if (err.code) {
+ console.error("commonEvent subscribe failed " + JSON.stringify(err));
+ } else {
+ console.info("commonEvent subscribe service " + JSON.stringify(data));
+ for (var key in data.parameters) {
+ if (data.parameters[key]) {
+ dataAssert = data.parameters[key]
+ console.info("callTest dataAssert is : " + dataAssert);
+ }
+ }
+ }
+ }
+
+ function CreateSubscriberCallBack(err, commonEventSubscriber) {
+ if (err.code) {
+ console.error("commonEvent createSubscriber failed " + JSON.stringify(err));
+ } else {
+ console.info("----commonEvent createSubscriber------");
+ subscriber = commonEventSubscriber;
+ commonEvent.subscribe(subscriber, SubscribeCallBack);
+ }
+ }
+
+ describe('callTest', function () {
+ /*
+ * @tc.number CallTest_0100
+ * @tc.name The deviceid passed in is null, so the installation free process is implemented
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("CallTest_0100", 0, async function (done) {
+ console.info("------------start CallTest_0100-------------");
+ console.info("CallTest_0100 commonEvent.createSubscriber start!!!");
+ commonEvent.createSubscriber(subscribeInfo, CreateSubscriberCallBack);
+ await Utils.sleep(2000);
+ TAG = "CallTest_0100";
+ let details;
+ dataAbilityHelper.call(URI_TEST, 'insert', '', pacMap).then((data) => {
+ console.info(TAG + ' call succeeded, data: ' + JSON.stringify(data));
+ details = data;
+ }).catch((error) => {
+ console.error(TAG + ' call failed, error: ' + JSON.stringify(error));
+ });
+ await Utils.sleep(2000);
+ expect(details.result).assertEqual("{\"group_name\":{\"data\":\"test1\",\"type\":10}," +
+ "\"ringtone_modify_time\":{\"data\":\"28wTypeToString\",\"type\":9}}");
+ expect(dataAssert).assertEqual("{\"group_name\":{\"data\":\"test1\",\"type\":10}" +
+ ",\"ringtone_modify_time\":{\"data\":\"28wTypeToString\",\"type\":9}}");
+ console.info("------------end CallTest_0100-------------");
+ done();
+ });
+ })
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1a4f0a7ebdd1edda79fae1ca7c5eb84881d08fc3
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,69 @@
+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 itName',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s package','-s dryRun'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ targetParams += ' ' + key + ' ' + parameters[key]
+ }
+ }
+ return targetParams.trim()
+}
+
+async function onAbilityCreateCallback() {
+ console.info('onAbilityCreateCallback');
+}
+
+async function addAbilityMonitorCallback(err: any) {
+ console.info('addAbilityMonitorCallback : ' + JSON.stringify(err))
+}
+
+export default class OpenHarmonyTestRunner implements TestRunner {
+ constructor() {
+ }
+
+ onPrepare() {
+ console.info('OpenHarmonyTestRunner OnPrepare')
+ }
+
+ onRun() {
+ console.info('OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+
+ let lMonitor = {
+ abilityName: testAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
+ cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
+ console.info('cmd : '+cmd)
+ var debug = abilityDelegatorArguments.parameters["-D"]
+ if (debug == 'true')
+ {
+ cmd += ' -D'
+ }
+ console.info('cmd : '+cmd)
+ abilityDelegator.executeShellCommand(cmd,
+ (err: any, d: any) => {
+ console.info('executeShellCommand : err : ' + JSON.stringify(err));
+ console.info('executeShellCommand : data : ' + d.stdResult);
+ console.info('executeShellCommand : data : ' + d.exitCode);
+ })
+ console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext')
+ var context = abilityDelegator.getAppContext()
+ console.info('getAppContext : ' + JSON.stringify(context))
+ console.info('OpenHarmonyTestRunner onRun end')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalldataabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..b404f7231b36547b1d28897502630b90c19772fd
--- /dev/null
+++ b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,44 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "FaSupplement"
+ },
+ {
+ "name": "MainAbility2_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility2_label",
+ "value": "label"
+ },
+ {
+ "name": "MainAbility3_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility3_label",
+ "value": "label"
+ },
+ {
+ "name": "PageAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "PageAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "DataAbility_desc",
+ "value": "hap sample empty provider"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/time/TimerTest_js/src/main/resources/base/media/icon.png b/ability/ability_runtime/actscalldataabilitytest/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from time/TimerTest_js/src/main/resources/base/media/icon.png
rename to ability/ability_runtime/actscalldataabilitytest/entry/src/main/resources/base/media/icon.png
diff --git a/ability/ability_runtime/actscalldataabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actscalldataabilitytest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actscalldataabilitytest/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/module.json
index 9ed9f1a6e2d1563f3673e75e5b4b0d4c5435b44b..08d39cbe20e884c67e8ce274a2c5cf78d115c8bd 100644
--- a/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/systemappcalleea/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/module.json
index 144073f33a52bb84f5223ecbaab5a0f38912ef68..7c2ee6b7d60e5e3fb3866148b32b423afca79702 100644
--- a/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/systemappcallera/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/module.json
index 9e2cdcdde294ecd7c9b4614e2db14ac003e5033f..fcdb1221b07ed6e22ff8c52c3220b63805b4f190 100644
--- a/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/module.json
index 85761ba82b64477adeb23f18ac44b9cf05c5b601..b27d0f0d803b0e5f89a5aeb3509aefbd19d0c8f7 100644
--- a/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/systemappcallerc/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
index 1f0330a2bf120509340ddda2c47770a1f6337c40..e96e52c308d0978bb956e8c78d6b0c1daf1f1e39 100644
--- a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
@@ -170,80 +170,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_0100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0100 begin');
-
- function unSubscribeCallBack() {
- console.log('ACTS_CommonComponent_Call_0100 unSubscribeCallBack')
- subscriber = null;
- done();
- }
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_0100 releaseCallBack' + data);
- commonEvent.unsubscribe(subscriber, unSubscribeCallBack);
- }
-
- function subscribeCallBack(err, data) {
- console.log('ACTS_CommonComponent_Call_0100 subscribeCallBack data:' + JSON.stringify(data))
- expect(data.data).assertEqual('calleeCheckCallParam');
- expect(data.parameters.num).assertEqual(100);
- expect(data.parameters.str).assertEqual('ACTS_CommonComponent_Call_0100');
- expect(data.parameters.result).assertEqual('ACTS_CommonComponent_Call_0100processed');
- console.log('AMS_CallTest_0100 do release');
- caller.release();
- }
-
- subscriber = await commonEvent.createSubscriber(subscriberInfo);
- commonEvent.subscribe(subscriber, subscribeCallBack);
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
+ let want = {
bundleName: sysABundleName,
abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(100, "ACTS_CommonComponent_Call_0100", 'default');
- caller.call('testCall', param).then(() => {
- console.log('ACTS_CommonComponent_Call_0100 call success');
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_0100 call exception' + err);
- expect().assertFail();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_0200
- * @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
- */
- it('ACTS_CommonComponent_Call_0200', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_0200 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_0200 releaseCallBack' + data);
- done();
}
-
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(200, "ACTS_CommonComponent_Call_0200", 'default');
- caller.callWithResult('testCallWithResult', param).then((data) => {
- console.log('ACTS_CommonComponent_Call_0200 call success');
- var result = new MySequenceable(0, '', '');
- data.readSequenceable(result);
- expect(result.num).assertEqual(200);
- expect(result.str).assertEqual('ACTS_CommonComponent_Call_0200');
- expect(result.result).assertEqual('ACTS_CommonComponent_Call_0200processed');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_0200 call exception' + err);
- expect().assertFail();
- caller.release();
- })
+ globalThis.abilityContext.startAbilityByCall(want)
+ .then(data => {
+ console.info(`ACTS_CommonComponent_Call_0100 startAbilityByCall SUCCESS`);
+ expect().assertFail();
+ done();
+ })
+ .catch(error => {
+ console.info(`ACTS_CommonComponent_Call_0100 startAbilityByCall Catch`);
+ done();
+ });
})
/**
@@ -665,89 +605,6 @@ export default function abilityTest() {
done();
})
- /**
- * @tc.number: ACTS_CommonComponent_Call_1900
- * @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
- */
- it('ACTS_CommonComponent_Call_1900', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_1900 begin');
- var callBackCnt = 0;
-
- function checkFinish() {
- if (callBackCnt >= 3) {
- console.log('ACTS_CommonComponent_Call_1900 finish release')
- caller.release();
- }
- }
-
- function unSubscribeCallBack() {
- console.log('ACTS_CommonComponent_Call_1900 unSubscribeCallBack')
- subscriber = null;
- done();
- }
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_1900 releaseCallBack' + data);
- commonEvent.unsubscribe(subscriber, unSubscribeCallBack);
- }
-
- function subscribeCallBack(err, data) {
- console.log('ACTS_CommonComponent_Call_1900 subscribeCallBack data:' + JSON.stringify(data))
- if (data.data == 'calleeCheckCallParam') {
- expect(data.parameters.num).assertEqual(1900);
- expect(data.parameters.str).assertEqual('ACTS_CommonComponent_Call_1900');
- expect(data.parameters.result).assertEqual('ACTS_CommonComponent_Call_1900processed');
- callBackCnt++;
- checkFinish();
- } else if (data.data == 'calleeCheckCall2Param') {
- expect(data.parameters.num).assertEqual(1900);
- expect(data.parameters.str).assertEqual('ACTS_CommonComponent_Call_1900');
- expect(data.parameters.result).assertEqual('ACTS_CommonComponent_Call_1900processed2');
- callBackCnt++;
- checkFinish();
- }
- }
-
- subscriber = await commonEvent.createSubscriber(subscriberInfo);
- commonEvent.subscribe(subscriber, subscribeCallBack);
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(1900, "ACTS_CommonComponent_Call_1900", 'default');
- caller.call('testCall', param).then(() => {
- console.log('ACTS_CommonComponent_Call_1900 call success');
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_1900 call exception' + err);
- expect().assertFail();
- })
- caller.call('testCall2', param).then(() => {
- console.log('ACTS_CommonComponent_Call_1900 call2 success');
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_1900 call2 exception' + err);
- expect().assertFail();
- })
-
- caller.callWithResult('testCallWithResult', param).then((data) => {
- console.log('ACTS_CommonComponent_Call_1900 call success');
- var result = new MySequenceable(0, '', '');
- data.readSequenceable(result);
- expect(result.num).assertEqual(1900);
- expect(result.str).assertEqual('ACTS_CommonComponent_Call_1900');
- expect(result.result).assertEqual('ACTS_CommonComponent_Call_1900processed');
- callBackCnt++;
- checkFinish();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_1900 call exception' + err);
- expect().assertFail();
- caller.release();
- })
- })
-
/**
* @tc.number: ACTS_CommonComponent_Call_2000
* @tc.name: The callee exits abnormally after the caller requests the call to be called successfully.
@@ -783,404 +640,121 @@ export default function abilityTest() {
})
/**
- * @tc.number: ACTS_CommonComponent_Call_2300
- * @tc.name: Callee is in standalone process AbilityStage of the same app.
- * @tc.desc: Verify Callee is in standalone process AbilityStage of the same app.
+ * @tc.number: ACTS_CommonComponent_Call_3100
+ * @tc.name: The parameter method of the Callee.on function is an empty string.
+ * @tc.desc: Verify that the parameter method of the Callee.on function is an empty string.
*/
- it('ACTS_CommonComponent_Call_2300', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_2300 begin');
-
- let bundleNameCallee = "com.example.systemcalltest";
- let abilityNameCallee = "com.example.second.MainAbility";
-
- function releaseCallback(data) {
- console.log('ACTS_CommonComponent_Call_2300 releaseCallBack:' + data);
- expect(data).assertEqual("release");
- done();
- }
+ it('ACTS_CommonComponent_Call_3100', 0, async function (done) {
+ console.log('ACTS_CommonComponent_Call_3100 begin');
- let want = {
- bundleName: bundleNameCallee,
- abilityName: abilityNameCallee,
- }
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
- if (typeof caller !== "object" || caller == null) {
- console.log('ACTS_CommonComponent_Call_2300 startAbilityByCall fail');
- expect().assertFail();
- done();
+ function onTest(data) {
+ console.log('ACTS_CommonComponent_Call_3100 onTest');
}
+ let finishFlag = 0;
try {
- caller.onRelease(releaseCallback);
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_2300 Caller onRelease fail ' + e);
- expect().assertFail();
- done();
+ globalThis.callee.on('', onTest);
+ } catch (err) {
+ console.log('ACTS_CommonComponent_Call_3100 callee.on err' + err);
+ expect(err.message).assertEqual("function input parameter error");
+ finishFlag = 1;
}
- let param = new MySequenceable(2300, "case2300", 'default');
- caller.callWithResult('test2300', param).then((data) => {
- console.log('ACTS_CommonComponent_Call_2300 callWithResult ' + JSON.stringify(data));
- let result = new MySequenceable(0, '', '');
- data.readSequenceable(result);
- expect(result.str).assertEqual("onCreateonBackground");
- expect(result.num).assertEqual(0);
- });
- try {
- caller.release();
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_2300 Caller Release fail:' + e);
- expect().assertFail();
- done();
- }
+ expect(finishFlag).assertEqual(1);
+ done();
})
/**
- * @tc.number: ACTS_CommonComponent_Call_2400
- * @tc.name: The service party cannot provide the corresponding service after calling Callee.off.
- * @tc.desc: The verification service party cannot provide the corresponding service after calling Callee.off.
+ * @tc.number: ACTS_CommonComponent_Call_3200
+ * @tc.name: The parameter method of the Callee.on function is null.
+ * @tc.desc: Verify that the parameter method of the Callee.on function is null.
*/
- it('ACTS_CommonComponent_Call_2400', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_2400 begin');
+ it('ACTS_CommonComponent_Call_3200', 0, async function (done) {
+ console.log('ACTS_CommonComponent_Call_3200 begin');
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_2400 releaseCallBack ' + data);
- done();
+ function onTest(data) {
+ console.log('ACTS_CommonComponent_Call_3200 onTest');
}
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(2400, "case2400", 'default');
- let beforeOff = 0;
- let afterOff = 0;
- await caller.call('testOff', param).then(() => {
- console.log('ACTS_CommonComponent_Call_2400 call success');
- beforeOff = 1;
- }).catch(err => {
- beforeOff = 2;
- })
-
- globalThis.secondCallee.off('testOff');
-
- await caller.call('testOff', param).then(() => {
- console.log('ACTS_CommonComponent_Call_2400 call success');
- afterOff = 1;
- }).catch(err => {
- afterOff = 2;
- })
+ let finishFlag = 0;
+ try {
+ globalThis.callee.on(null, onTest);
+ } catch (err) {
+ console.log('ACTS_CommonComponent_Call_3200 callee.on err' + err);
+ expect(err.message).assertEqual("function input parameter error");
+ finishFlag = 1;
+ }
- expect(beforeOff).assertEqual(1);
- expect(afterOff).assertEqual(2);
- caller.release();
+ expect(finishFlag).assertEqual(1);
+ done();
})
/**
- * @tc.number: ACTS_CommonComponent_Call_2500
- * @tc.name: The parameter "method" of the Caller.call function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.call function is an empty string.
+ * @tc.number: ACTS_CommonComponent_Call_3300
+ * @tc.name: The parameter method of the Caller.callWithResult function is undefined.
+ * @tc.desc: Verify that the parameter method of the Caller.callWithResult function is undefined.
*/
- it('ACTS_CommonComponent_Call_2500', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_2500 begin');
+ it('ACTS_CommonComponent_Call_3300', 0, async function (done) {
+ console.log('ACTS_CommonComponent_Call_3300 begin');
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_2500 releaseCallBack' + data);
- done();
+ function onTest(data) {
+ console.log('ACTS_CommonComponent_Call_3300 onTest');
}
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(2500, "case2500", 'default');
- caller.call('', param).then(() => {
- console.log('ACTS_CommonComponent_Call_2500 call success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_2500 call exception' + err);
+ let finishFlag = 0;
+ try {
+ globalThis.callee.on(undefined, onTest);
+ } catch (err) {
+ console.log('ACTS_CommonComponent_Call_3300 callee.on err' + err);
expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
+ finishFlag = 1;
+ }
+
+ expect(finishFlag).assertEqual(1);
+ done();
})
/**
- * @tc.number: ACTS_CommonComponent_Call_2600
- * @tc.name: The parameter "method" of the Caller.call function is null.
- * @tc.desc: Verify that the parameter "method" of the Caller.call function is null.
+ * @tc.number: ACTS_CommonComponent_Call_3400
+ * @tc.name: The parameter "method" of the Callee.off function is an empty string.
+ * @tc.desc: Verify that the parameter "method" of the Callee.off function is an empty string.
*/
- it('ACTS_CommonComponent_Call_2600', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_2600 begin');
+ it('ACTS_CommonComponent_Call_3400', 0, async function (done) {
+ console.log('ACTS_CommonComponent_Call_3400 begin');
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_2600 releaseCallBack' + data);
- done();
+ let finishFlag = 0;
+ try {
+ globalThis.callee.off('');
+ } catch (err) {
+ console.log('ACTS_CommonComponent_Call_3400 callee.off err' + err);
+ expect(err.message).assertEqual("function input parameter error");
+ finishFlag = 1;
}
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(2600, "case2600", 'default');
- caller.call(null, param).then(() => {
- console.log('ACTS_CommonComponent_Call_2600 call success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_2600 call exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
+ expect(finishFlag).assertEqual(1);
+ done();
})
/**
- * @tc.number: ACTS_CommonComponent_Call_2700
- * @tc.name: The parameter "method" of the Caller.call function is undefined.
- * @tc.desc: Verify that the parameter "method" of the Caller.call function is undefined.
+ * @tc.number: ACTS_CommonComponent_Call_3500
+ * @tc.name: The parameter "method" of the Callee.off function is null.
+ * @tc.desc: Verify that the parameter "method" of the Callee.off function is null.
*/
- it('ACTS_CommonComponent_Call_2700', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_2700 begin');
+ it('ACTS_CommonComponent_Call_3500', 0, async function (done) {
+ console.log('ACTS_CommonComponent_Call_3500 begin');
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_2700 releaseCallBack' + data);
- done();
+ let finishFlag = 0;
+ try {
+ globalThis.callee.off(null);
+ } catch (err) {
+ console.log('ACTS_CommonComponent_Call_3500 callee.off err' + err);
+ expect(err.message).assertEqual("function input parameter error");
+ finishFlag = 1;
}
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(2700, "case2700", 'default');
- caller.call(undefined, param).then(() => {
- console.log('ACTS_CommonComponent_Call_2700 call success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_2700 call exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_2800
- * @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
- */
- it('ACTS_CommonComponent_Call_2800', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_2800 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_2800 releaseCallBack' + data);
- done();
- }
-
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(2800, "case2800", 'default');
- caller.callWithResult('', param).then((data) => {
- console.log('ACTS_CommonComponent_Call_2800 callWithResult success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_2800 callWithResult exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_2900
- * @tc.name: The parameter "method" of the Caller.callWithResult function is null.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is null.
- */
- it('ACTS_CommonComponent_Call_2900', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_2900 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_2900 releaseCallBack' + data);
- done();
- }
-
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(2900, "case2900", 'default');
- caller.callWithResult(null, param).then((data) => {
- console.log('ACTS_CommonComponent_Call_2900 callWithResult success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_2900 callWithResult exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_3000
- * @tc.name: The parameter "method" of the Caller.callWithResult function is undefined.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is undefined.
- */
- it('ACTS_CommonComponent_Call_3000', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3000 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_3000 releaseCallBack' + data);
- done();
- }
-
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(3000, "case3000", 'default');
- caller.callWithResult(undefined, param).then((data) => {
- console.log('ACTS_CommonComponent_Call_3000 call success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_3000 catch exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_3100
- * @tc.name: The parameter method of the Callee.on function is an empty string.
- * @tc.desc: Verify that the parameter method of the Callee.on function is an empty string.
- */
- it('ACTS_CommonComponent_Call_3100', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3100 begin');
-
- function onTest(data) {
- console.log('ACTS_CommonComponent_Call_3100 onTest');
- }
-
- let finishFlag = 0;
- try {
- globalThis.callee.on('', onTest);
- } catch (err) {
- console.log('ACTS_CommonComponent_Call_3100 callee.on err' + err);
- expect(err.message).assertEqual("function input parameter error");
- finishFlag = 1;
- }
-
- expect(finishFlag).assertEqual(1);
- done();
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_3200
- * @tc.name: The parameter method of the Callee.on function is null.
- * @tc.desc: Verify that the parameter method of the Callee.on function is null.
- */
- it('ACTS_CommonComponent_Call_3200', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3200 begin');
-
- function onTest(data) {
- console.log('ACTS_CommonComponent_Call_3200 onTest');
- }
-
- let finishFlag = 0;
- try {
- globalThis.callee.on(null, onTest);
- } catch (err) {
- console.log('ACTS_CommonComponent_Call_3200 callee.on err' + err);
- expect(err.message).assertEqual("function input parameter error");
- finishFlag = 1;
- }
-
- expect(finishFlag).assertEqual(1);
- done();
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_3300
- * @tc.name: The parameter method of the Caller.callWithResult function is undefined.
- * @tc.desc: Verify that the parameter method of the Caller.callWithResult function is undefined.
- */
- it('ACTS_CommonComponent_Call_3300', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3300 begin');
-
- function onTest(data) {
- console.log('ACTS_CommonComponent_Call_3300 onTest');
- }
-
- let finishFlag = 0;
- try {
- globalThis.callee.on(undefined, onTest);
- } catch (err) {
- console.log('ACTS_CommonComponent_Call_3300 callee.on err' + err);
- expect(err.message).assertEqual("function input parameter error");
- finishFlag = 1;
- }
-
- expect(finishFlag).assertEqual(1);
- done();
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_3400
- * @tc.name: The parameter "method" of the Callee.off function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Callee.off function is an empty string.
- */
- it('ACTS_CommonComponent_Call_3400', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3400 begin');
-
- let finishFlag = 0;
- try {
- globalThis.callee.off('');
- } catch (err) {
- console.log('ACTS_CommonComponent_Call_3400 callee.off err' + err);
- expect(err.message).assertEqual("function input parameter error");
- finishFlag = 1;
- }
-
- expect(finishFlag).assertEqual(1);
- done();
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_3500
- * @tc.name: The parameter "method" of the Callee.off function is null.
- * @tc.desc: Verify that the parameter "method" of the Callee.off function is null.
- */
- it('ACTS_CommonComponent_Call_3500', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3500 begin');
-
- let finishFlag = 0;
- try {
- globalThis.callee.off(null);
- } catch (err) {
- console.log('ACTS_CommonComponent_Call_3500 callee.off err' + err);
- expect(err.message).assertEqual("function input parameter error");
- finishFlag = 1;
- }
-
- expect(finishFlag).assertEqual(1);
- done();
- })
+ expect(finishFlag).assertEqual(1);
+ done();
+ })
/**
* @tc.number: ACTS_CommonComponent_Call_3600
@@ -1203,201 +777,6 @@ export default function abilityTest() {
done();
})
- /*
- * @tc.number: ACTS_CommonComponent_Call_3700
- * @tc.name: Connects a service ability, which is used to start a cloned page ability.
- * @tc.desc: Check the event data of executor page ability publishes
- */
- it('ACTS_CommonComponent_Call_3700', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3700 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_3700 releaseCallBack' + data);
- done();
- }
-
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- console.log('ACTS_CommonComponent_Call_3700 before onRelease')
- caller.onRelease(releaseCallback);
- console.log('ACTS_CommonComponent_Call_3700 before call')
- caller.call('testCall', "").then(() => {
- console.log('ACTS_CommonComponent_Call_3700 call success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_3700 catch exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
- })
-
- /*
- * @tc.number: ACTS_CommonComponent_Call_3800
- * @tc.name: Connects a service ability, which is used to start a cloned page ability.
- * @tc.desc: Check the event data of executor page ability publishes
- */
- it('ACTS_CommonComponent_Call_3800', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3800 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_3800 releaseCallBack' + data);
- done();
- }
-
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- console.log('ACTS_CommonComponent_Call_3800 before onRelease')
- caller.onRelease(releaseCallback);
- console.log('ACTS_CommonComponent_Call_3800 before call')
- caller.call('testCall', null).then(() => {
- console.log('ACTS_CommonComponent_Call_3800 call success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_3800 catch exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
- })
-
- /*
- * @tc.number: ACTS_CommonComponent_Call_3900
- * @tc.name: Connects a service ability, which is used to start a cloned page ability.
- * @tc.desc: Check the event data of executor page ability publishes
- */
- it('ACTS_CommonComponent_Call_3900', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_3900 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_3900 releaseCallBack' + data);
- done();
- }
-
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- });
-
- console.log('ACTS_CommonComponent_Call_3900 before onRelease')
- caller.onRelease(releaseCallback);
- console.log('ACTS_CommonComponent_Call_3900 before call')
- caller.call('testCall', undefined).then(() => {
- console.log('ACTS_CommonComponent_Call_3900 call success');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_3900 catch exception' + err);
- expect(err.message).assertEqual("function input parameter error");
- caller.release();
- })
- })
-
- /*
- * @tc.number: ACTS_CommonComponent_Call_4000
- * @tc.name: Connects a service ability, which is used to start a cloned page ability.
- * @tc.desc: Check the event data of executor page ability publishes
- */
- it('ACTS_CommonComponent_Call_4000', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_4000 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_4000 release CallBack' + data);
- done();
- }
-
- globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- }).then((data) => {
- let caller = data;
- console.log('ACTS_CommonComponent_Call_4000 before onRelease')
- caller.onRelease(releaseCallback);
- console.log('ACTS_CommonComponent_Call_4000 before call')
- caller.callWithResult('testCallWithResult', "").then((data) => {
- console.log('ACTS_CommonComponent_Call_4000 call success');
- expect(data).assertEqual(undefined);
- caller.release();
- }).catch((e) => {
- console.log('ACTS_CommonComponent_Call_4000 call err' + e);
- caller.release();
- });
- })
- })
-
- /*
- * @tc.number: ACTS_CommonComponent_Call_4100
- * @tc.name: Connects a service ability, which is used to start a cloned page ability.
- * @tc.desc: Check the event data of executor page ability publishes
- */
- it('ACTS_CommonComponent_Call_4100', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_4100 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_4100 release CallBack' + data);
- done();
- }
-
- globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- }).then((data) => {
- let caller = data;
- console.log('ACTS_CommonComponent_Call_4100 before onRelease')
- caller.onRelease(releaseCallback);
- console.log('ACTS_CommonComponent_Call_4100 before call')
- caller.callWithResult('testCallWithResult', null).then((data) => {
- console.log('ACTS_CommonComponent_Call_4100 call success');
- expect(data).assertEqual(undefined);
- caller.release();
- }).catch((e) => {
- console.log('ACTS_CommonComponent_Call_4100 call err' + e);
- caller.release();
- });
- })
- })
-
- /*
- * @tc.number: ACTS_CommonComponent_Call_4200
- * @tc.name: Connects a service ability, which is used to start a cloned page ability.
- * @tc.desc: Check the event data of executor page ability publishes
- */
- it('ACTS_CommonComponent_Call_4200', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_4200 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_4200 release CallBack' + data);
- done();
- }
-
- globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- }).then((data) => {
- let caller = data;
- console.log('ACTS_CommonComponent_Call_4200 before onRelease')
- caller.onRelease(releaseCallback);
- console.log('ACTS_CommonComponent_Call_4200 before call')
- caller.callWithResult('testCallWithResult', undefined).then((data) => {
- console.log('ACTS_CommonComponent_Call_4200 call success');
- expect(data).assertEqual(undefined);
- caller.release();
- }).catch((e) => {
- console.log('ACTS_CommonComponent_Call_4200 call err' + e);
- caller.release();
- });
- })
- })
-
/*
* @tc.number: ACTS_CommonComponent_Call_4300
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
@@ -1458,102 +837,6 @@ export default function abilityTest() {
done();
})
- /**
- * @tc.number: ACTS_CommonComponent_Call_4800
- * @tc.name: Callee is in standalone process AbilityStage of the same app.
- * @tc.desc: Verify Callee is in standalone process AbilityStage of the same app.
- */
- it('ACTS_CommonComponent_Call_4800', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_4800 begin');
-
- let bundleNameCallee = "com.example.systemcalltest";
- let abilityNameCallee = "com.example.second.MainAbility";
-
- function releaseCallback(data) {
- console.log('ACTS_CommonComponent_Call_4800 releaseCallBack:' + data);
- expect(data).assertEqual("release");
- done();
- }
-
- let want = {
- bundleName: bundleNameCallee,
- abilityName: abilityNameCallee,
- }
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
- if (typeof caller !== "object" || caller == null) {
- console.log('ACTS_CommonComponent_Call_4800 startAbilityByCall fail');
- expect().assertFail();
- done();
- }
-
- try {
- caller.onRelease(releaseCallback);
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_4800 Caller onRelease fail ' + e);
- expect().assertFail();
- done();
- }
- let param = new MySequenceable(4600, "case4600", 'default');
- caller.callWithResult('test4600', param).then((data) => {
- let result = new MySequenceable(0, '', '');
- data.readSequenceable(result);
- expect(result.str).assertEqual("onCreateonBackground");
- expect(result.num).assertEqual(0);
- });
-
- try {
- caller.release();
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_4800 Caller Release fail:' + e);
- expect().assertFail();
- done();
- }
- })
-
- /*
- * @tc.number: ACTS_CommonComponent_Call_4900
- * @tc.name: Connects a service ability, which is used to start a cloned page ability.
- * @tc.desc: Check the event data of executor page ability publishes
- */
- it('ACTS_CommonComponent_Call_4900', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_4900 begin');
- let caller;
- let sequenceable = new MySequenceable(1, 'ACTS_CommonComponent_Call_4900', 'default');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_4900 releaseCallBack ' + data);
- caller.call('testCall', sequenceable).then(() => {
- console.log('ACTS_CommonComponent_Call_4900 call2 success');
- expect().assertFail();
- done();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_4900 call2 err ' + err);
- expect(err.message).assertEqual("function inner object error");
- done();
- })
- }
-
- globalThis.globalThis.abilityContext.startAbilityByCall({
- bundleName: sysABundleName,
- abilityName: sysASecondAbilityName,
- }).then((data) => {
- caller = data;
- console.log('ACTS_CommonComponent_Call_4900 before onRelease')
- caller.onRelease(releaseCallback);
- console.log('ACTS_CommonComponent_Call_4900 before call')
- delay(100);
- caller.call('testCall', sequenceable).then(() => {
- console.log('ACTS_CommonComponent_Call_4900 call1 success');
- caller.release();
- }).catch((e) => {
- console.log('ACTS_CommonComponent_Call_4900 call err' + e);
- expect().assertFail();
- done();
- });
- })
- })
-
/*
* @tc.number: ACTS_CommonComponent_Call_5000
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
@@ -1695,109 +978,5 @@ export default function abilityTest() {
expect(exceptionFlag).assertEqual(true);
done();
})
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_5700
- * @tc.name: The mission of callee is not in recent list when startAbilityByCall only.
- * @tc.desc: Verify the mission of callee is not in recent list when startAbilityByCall only.
- */
- it('ACTS_CommonComponent_Call_5700', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_5700 begin');
-
- let bundleNameCallee = "com.example.systemcalltest";
- let abilityNameCallee = "com.example.systemcalltest.SecondAbility";
- let want = {
- bundleName: bundleNameCallee,
- abilityName: abilityNameCallee,
- }
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
- if (typeof caller !== "object" || caller == null) {
- console.log('ACTS_CommonComponent_Call_5700 startAbilityByCall fail');
- expect().assertFail();
- done();
- }
-
- async function releaseCallback(data) {
- console.log('ACTS_CommonComponent_Call_5700 releaseCallBack:' + data);
- expect(data).assertEqual("release");
-
- let missionId = await getMissionId(abilityNameCallee, 0);
- expect(missionId == -1).assertTrue();
- done();
- }
-
- try {
- caller.onRelease(releaseCallback);
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_5700 Caller onRelease fail ' + e);
- expect().assertFail();
- done();
- }
-
- try {
- caller.release();
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_5700 Caller Release fail:' + e);
- expect().assertFail();
- done();
- }
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_5800
- * @tc.name: The mission of callee is in recent list when startAbilityByCall then startAbility.
- * @tc.desc: Verify the mission of callee is in recent list when startAbilityByCall then startAbility.
- */
- it('ACTS_CommonComponent_Call_5800', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_5800 begin');
-
- let bundleNameCallee = "com.example.systemcalltest";
- let abilityNameCallee = "com.example.systemcalltest.SecondAbility";
- let want = {
- bundleName: bundleNameCallee,
- abilityName: abilityNameCallee,
- }
- let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
- if (typeof caller !== "object" || caller == null) {
- console.log('ACTS_CommonComponent_Call_5800 startAbilityByCall fail');
- expect().assertFail();
- done();
- }
-
- function startAbilityCallback(err) {
- console.log('ACTS_CommonComponent_Call_5800 startAbilityCallback');
- if (err.code != 0) {
- expect().assertFail();
- done();
- }
- }
- await sleep(1000);
-
- await globalThis.globalThis.abilityContext.startAbility(want, startAbilityCallback);
-
- async function releaseCallback(data) {
- console.log('ACTS_CommonComponent_Call_5800 releaseCallBack:' + data);
- expect(data).assertEqual("release");
-
- let missionId = await getMissionId(abilityNameCallee, 0);
- expect(missionId != -1).assertTrue();
- done();
- }
- try {
- caller.onRelease(releaseCallback);
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_5800 Caller onRelease fail ' + e);
- expect().assertFail();
- done();
- }
-
- try {
- caller.release();
- } catch (e) {
- console.log('ACTS_CommonComponent_Call_5800 Caller Release fail:' + e);
- expect().assertFail();
- done();
- }
- })
})
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json
index c351dcc66e2d84cad05ac16d426b11cda07e4b22..5bb1810f319a58f65b650a2236fac45b5cf25d25 100644
--- a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -80,6 +81,18 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ },
+ {
+ "name":"ohos.permission.ABILITY_BACKGROUND_COMMUNICATION",
+ "reason":"need use ohos.permission.ABILITY_BACKGROUND_COMMUNICATION"
}
]
}
diff --git a/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/module.json b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/module.json
index 857565bb1d04e52b26be210b38136e0644f08eaf..c93183b1bbb8a523964513703307259da2aaf564 100644
--- a/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/systemcallfeature/entry/src/main/module.json
@@ -7,6 +7,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/module.json b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/module.json
index c8fd2c246308f250ceb430c070fcf32eae40b475..afbf5b68756a617f65fdf70fc750f1add2fcd3a7 100644
--- a/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/thirdappa/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
index b9dd1a51347385aaa08e83cf15e8b5d0d7402731..528878d0d7055a1d00e4b52a2fdd0b61816cf7c6 100644
--- a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
@@ -93,201 +93,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_1100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1100 begin');
- var subscriber;
-
- function unSubscribeCallBack() {
- console.log('ACTS_CommonComponent_Call_1100 unSubscribeCallBack')
- setTimeout(()=>{done();}, 100)
- }
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_1100 releaseCallBack' + data);
- commonEvent.unsubscribe(subscriber, unSubscribeCallBack);
- }
-
- function subscribeCallBack(err, data) {
- console.log('ACTS_CommonComponent_Call_1100 subscribeCallBack data:' + JSON.stringify(data))
- expect(data.data).assertEqual('calleeCheckCallParam');
- expect(data.parameters.num).assertEqual(1100);
- expect(data.parameters.str).assertEqual('ACTS_CommonComponent_Call_1100');
- expect(data.parameters.result).assertEqual('ACTS_CommonComponent_Call_1100processed');
- console.log('AMS_CallTest_0100 do release');
- caller.release();
- }
-
- subscriber = await commonEvent.createSubscriber(subscriberInfo);
- commonEvent.subscribe(subscriber, subscribeCallBack);
- let caller = await globalThis.abilityContext.startAbilityByCall({
+ let want = {
bundleName: thirdCallTestBundleName,
abilityName: thirdCallTestForthAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(1100, "ACTS_CommonComponent_Call_1100", 'default');
- caller.call('testCall', param).then(() => {
- console.log('ACTS_CommonComponent_Call_1100 call success');
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_1100 call exception' + err);
- expect().assertFail();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_1200
- * @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
- */
- it('ACTS_CommonComponent_Call_1200', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_1200 begin');
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_1200 releaseCallBack' + data);
- setTimeout(()=>{done();}, 100)
}
-
- let caller = await globalThis.abilityContext.startAbilityByCall({
- bundleName: thirdCallTestBundleName,
- abilityName: thirdCallTestFifthAbilityName,
- });
-
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(1200, "ACTS_CommonComponent_Call_1200", 'default');
- caller.callWithResult('testCallWithResult', param).then((data) => {
- console.log('ACTS_CommonComponent_Call_1200 call success');
- var result = new MySequenceable(0, '', '');
- data.readSequenceable(result);
- expect(result.num).assertEqual(1200);
- expect(result.str).assertEqual('ACTS_CommonComponent_Call_1200');
- expect(result.result).assertEqual('ACTS_CommonComponent_Call_1200processed');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_1200 call exception' + err);
- expect().assertFail();
- caller.release();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_1300
- * @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
- */
- it('ACTS_CommonComponent_Call_1300', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_1300 begin');
- var subscriber;
- var caller
-
- function unSubscribeCallBack() {
- console.log('ACTS_CommonComponent_Call_1300 unSubscribeCallBack')
- setTimeout(()=>{done();}, 100)
- }
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_1300 releaseCallBack' + data);
- commonEvent.unsubscribe(subscriber, unSubscribeCallBack);
- }
-
- function releaseCallback1(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_1300 releaseCallBack1' + data);
- setTimeout(() => {
- globalThis.abilityContext.startAbilityByCall({
- bundleName: thirdCallTestBundleName,
- abilityName: thirdCallTestSecondAbilityName,
- }).then(data => {
- caller = data;
- console.log('ACTS_CommonComponent_Call_1300 caller get')
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(1300, "ACTS_CommonComponent_Call_1300", 'default');
- caller.call('testCall', param).then(() => {
- console.log('ACTS_CommonComponent_Call_1300 call success');
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_1300 call exception' + err);
- expect().assertFail();
- })
- })
- },100);
- }
-
- function subscribeCallBack(err, data) {
- console.log('ACTS_CommonComponent_Call_1300 subscribeCallBack data:' + JSON.stringify(data))
- expect(data.data).assertEqual('calleeCheckCallParam');
- expect(data.parameters.num).assertEqual(1300);
- expect(data.parameters.str).assertEqual('ACTS_CommonComponent_Call_1300');
- expect(data.parameters.result).assertEqual('ACTS_CommonComponent_Call_1300processed');
- console.log('ACTS_CommonComponent_Call_1300 do release');
- caller.release();
- }
-
- subscriber = await commonEvent.createSubscriber(subscriberInfo);
- commonEvent.subscribe(subscriber, subscribeCallBack);
-
- globalThis.abilityContext.startAbilityByCall({
- bundleName: thirdCallTestBundleName,
- abilityName: thirdCallTestSecondAbilityName,
- }).then(data => {
- caller = data;
- console.log('ACTS_CommonComponent_Call_1300 caller get')
- caller.onRelease(releaseCallback1);
- caller.release();
- })
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_1400
- * @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
- */
- it('ACTS_CommonComponent_Call_1400', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_1400 begin');
- var caller
-
- function releaseCallback(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_1400 releaseCallBack' + data);
- setTimeout(()=>{done();}, 100)
- }
-
- function releaseCallback1(data) {
- expect(data).assertEqual('release');
- console.log('ACTS_CommonComponent_Call_1400 releaseCallBack' + data);
- setTimeout(() => {
- globalThis.abilityContext.startAbilityByCall({
- bundleName: thirdCallTestBundleName,
- abilityName: thirdCallTestSecondAbilityName,
- }).then(data => {
- caller = data;
- caller.onRelease(releaseCallback);
- let param = new MySequenceable(1400, "ACTS_CommonComponent_Call_1400", 'default');
- caller.callWithResult('testCallWithResult', param).then((data) => {
- console.log('ACTS_CommonComponent_Call_1400 call success');
- var result = new MySequenceable(0, '', '');
- data.readSequenceable(result);
- expect(result.num).assertEqual(1400);
- expect(result.str).assertEqual('ACTS_CommonComponent_Call_1400');
- expect(result.result).assertEqual('ACTS_CommonComponent_Call_1400processed');
- caller.release();
- }).catch(err => {
- console.log('ACTS_CommonComponent_Call_1400 call exception' + err);
- expect().assertFail();
- caller.release();
- })
- });
- },100);
- }
-
- globalThis.abilityContext.startAbilityByCall({
- bundleName: thirdCallTestBundleName,
- abilityName: thirdCallTestSecondAbilityName,
- }).then(data => {
- caller = data;
- console.log('ACTS_CommonComponent_Call_1400 caller get')
- caller.onRelease(releaseCallback1);
- caller.release();
- })
+ globalThis.abilityContext.startAbilityByCall(want)
+ .then(data => {
+ console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall SUCCESS`);
+ expect().assertFail();
+ done();
+ })
+ .catch(error => {
+ console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall Catch`);
+ done();
+ });
})
/**
@@ -297,17 +116,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_1500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1500 begin');
- var caller;
- try{
- caller = await globalThis.abilityContext.startAbilityByCall({
- bundleName: systemAppCalleeABundleName,
- abilityName: systemAppCalleeAMainAbilityName,
- });
- }catch(error){
- console.log('ACTS_CommonComponent_Call_1500 start err'+error);
- expect(error=="Error: function request remote error").assertTrue();
- done();
+ let want = {
+ bundleName: systemAppCalleeABundleName,
+ abilityName: systemAppCalleeAMainAbilityName,
}
+ globalThis.abilityContext.startAbilityByCall(want)
+ .then(data => {
+ console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall SUCCESS`);
+ expect().assertFail();
+ done();
+ })
+ .catch(error => {
+ console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall Catch`);
+ done();
+ });
})
/**
@@ -317,49 +139,20 @@ export default function abilityTest() {
*/
it('ACTS_CommonComponent_Call_1600', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1600 begin');
- let caller;
- let exceptionFlag = false;
-
- try {
- caller = await globalThis.abilityContext.startAbilityByCall({
- bundleName: thirdAppABundleName,
- abilityName: thirdAppAMainAbilityName,
- });
- console.log('ACTS_CommonComponent_Call_1600 startAbilityByCall' + JSON.stringify(caller))
- } catch(err) {
- console.log('ACTS_CommonComponent_Call_1600 exception' + err);
- exceptionFlag = true;
- expect(err.message).assertEqual("function request remote error");
+ let want = {
+ bundleName: thirdAppABundleName,
+ abilityName: thirdAppAMainAbilityName,
}
-
- expect(exceptionFlag).assertEqual(true);
- done();
- })
-
- /**
- * @tc.number: ACTS_CommonComponent_Call_1800
- * @tc.name: The parameter "method" of the Caller.callWithResult function is an empty string.
- * @tc.desc: Verify that the parameter "method" of the Caller.callWithResult function is an empty string.
- */
- it('ACTS_CommonComponent_Call_1800', 0, async function (done) {
- console.log('ACTS_CommonComponent_Call_1800 begin');
- let caller;
- let exceptionFlag = false;
-
- try {
- caller = await globalThis.abilityContext.startAbilityByCall({
- bundleName: thirdCallTestBundleName,
- abilityName: thirdCallTestThirdAbilityName,
+ globalThis.abilityContext.startAbilityByCall(want)
+ .then(data => {
+ console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall SUCCESS`);
+ expect().assertFail();
+ done();
+ })
+ .catch(error => {
+ console.info(`ACTS_CommonComponent_Call_1100 startAbilityByCall Catch`);
+ done();
});
- console.log('ACTS_CommonComponent_Call_1800 startAbilityByCall' + JSON.stringify(caller))
- } catch(err) {
- console.log('ACTS_CommonComponent_Call_1800 exception' + err);
- exceptionFlag = true;
- expect(err.message).assertEqual("function request remote error");
- }
-
- expect(exceptionFlag).assertEqual(true);
- done();
})
})
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/module.json b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/module.json
index d6fcdb48b904426b645cc82adacdb54668e8bc89..9d72e996bfc19073ff977c0c333f3a238995136c 100644
--- a/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/module.json
+++ b/ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/BUILD.gn b/ability/ability_runtime/actsdataabilityaccessdatasharetest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..36dbc7c62c12d71672c4047a09b4a4fe7fa4db55
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/BUILD.gn
@@ -0,0 +1,24 @@
+# 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("dataabilityaccessdatashare") {
+ testonly = true
+ if (is_standard_system) {
+ deps = [
+ "actsdataabilityaccessdatasharetest:ActsDataAbilityAccessDataShareTest",
+ "datashareserverhap:DataShareServerHap",
+ ]
+ }
+}
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/BUILD.gn b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..d522afc61be34630a4cf9435dbe5e6336f656a3d
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/BUILD.gn
@@ -0,0 +1,36 @@
+# 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("ActsDataAbilityAccessDataShareTest") {
+ hap_profile = "./src/main/config.json"
+ hap_name = "ActsDataAbilityAccessDataShareTest"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+ohos_js_assets("hjs_demo_js_assets") {
+ js2abc = true
+ hap_profile = "./src/main/config.json"
+ source_dir = "./src/main/js"
+}
+ohos_resources("hjs_demo_resources") {
+ sources = [ "./src/main/resources" ]
+ hap_profile = "./src/main/config.json"
+}
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/Test.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb2d778715571b36ef6cb7b319a414fb5e61648e
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/Test.json
@@ -0,0 +1,20 @@
+{
+ "description": "Configuration for hjunit demo Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "180000",
+ "shell-timeout": "180000",
+ "bundle-name": "com.amsst.dataabilityaccessdatashare",
+ "package-name": "com.amsst.dataabilityaccessdatashare"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsDataAbilityAccessDataShareTest.hap",
+ "DataShareServerHap.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
\ No newline at end of file
diff --git a/distributedschedule/dmsfwk/continuationmanagertest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/signature/openharmony_sx.p7b
similarity index 100%
rename from distributedschedule/dmsfwk/continuationmanagertest/signature/openharmony_sx.p7b
rename to ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/signature/openharmony_sx.p7b
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/config.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..1a8073b9a927759a51af1784dfa5e6f5238eec30
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/config.json
@@ -0,0 +1,95 @@
+{
+ "app": {
+ "bundleName": "com.amsst.dataabilityaccessdatashare",
+ "vendor": "amsst",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 9,
+ "target": 5,
+ "releaseType": "Beta1"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.amsst.dataabilityaccessdatashare",
+ "name": ".entry",
+ "deviceType": [
+ "default",
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "formsEnabled": false,
+ "name": ".MainAbility",
+ "srcLanguage": "js",
+ "srcPath": "MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:MainAbility_desc",
+ "label": "$string:MainAbility_label",
+ "type": "page",
+ "visible": true,
+ "launchType": "standard"
+ },
+ {
+ "orientation": "unspecified",
+ "formsEnabled": false,
+ "name": ".TestAbility",
+ "srcLanguage": "js",
+ "srcPath": "TestAbility",
+ "icon": "$media:icon",
+ "description": "$string:TestAbility_desc",
+ "label": "$string:TestAbility_label",
+ "type": "page",
+ "visible": true,
+ "launchType": "standard"
+ }
+ ],
+ "js": [
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": "default",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ },
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": ".TestAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ],
+ "testRunner": {
+ "name": "OpenHarmonyTestRunner",
+ "srcPath": "TestRunner"
+ },
+ "mainAbility": ".MainAbility",
+ "srcPath": ""
+ }
+}
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/app.js b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..5ab30d89d09c11d290f2c64a14b4b27afa5c8a36
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/app.js
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export default {
+ onCreate() {
+ console.info('AceApplication onCreate');
+ },
+ onDestroy() {
+ console.info('AceApplication onDestroy');
+ }
+};
diff --git a/multimodalinput/input_js_standard/src/main/js/default/i18n/en-US.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/i18n/en-US.json
similarity index 100%
rename from multimodalinput/input_js_standard/src/main/js/default/i18n/en-US.json
rename to ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/i18n/en-US.json
diff --git a/multimodalinput/input_js_standard/src/main/js/default/i18n/zh-CN.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/i18n/zh-CN.json
similarity index 100%
rename from multimodalinput/input_js_standard/src/main/js/default/i18n/zh-CN.json
rename to ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/i18n/zh-CN.json
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.css b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6724ec055a554cf3f9c7be83780c30df2274875b
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.css
@@ -0,0 +1,12 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
+.titleST {
+ font-size: 32px;
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.hml b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..4f779dcdff4fa69413976fe7032ca3656758793a
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.hml
@@ -0,0 +1,8 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
+ STDataAbility
+
+
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.js b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..dd962694ee71f8605150daad4626edbb069b3a05
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/MainAbility/pages/index/index.js
@@ -0,0 +1,30 @@
+/*
+ * 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 app from '@system.app'
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ },
+ onShow() {
+ console.info('====onShow finish====<')
+ },
+ onReady() {
+ },
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/app.js b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..d5ee271df29e516d1c8929054283e5f2bf5c981c
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/app.js
@@ -0,0 +1,31 @@
+/*
+ * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
+
+export default {
+ onCreate() {
+ console.info('TestApplication onCreate')
+ var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ },
+ onDestroy() {
+ console.info("TestApplication onDestroy");
+ }
+};
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/i18n/en-US.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/i18n/en-US.json
@@ -0,0 +1,8 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ },
+ "Files": {
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/i18n/zh-CN.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/i18n/zh-CN.json
@@ -0,0 +1,8 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ },
+ "Files": {
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.css b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..b21c92c6290ea747bd891e2ab673721afc5521ed
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.css
@@ -0,0 +1,30 @@
+.container {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ left: 0px;
+ top: 0px;
+ width: 100%;
+ height: 100%;
+}
+
+.title {
+ font-size: 60px;
+ text-align: center;
+ width: 100%;
+ height: 40%;
+ margin: 10px;
+}
+
+@media screen and (device-type: phone) and (orientation: landscape) {
+ .title {
+ font-size: 60px;
+ }
+}
+
+@media screen and (device-type: tablet) and (orientation: landscape) {
+ .title {
+ font-size: 100px;
+ }
+}
\ No newline at end of file
diff --git a/startup/startup_standard/systemparamter/src/main/js/MainAbility/pages/index/index.hml b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.hml
similarity index 100%
rename from startup/startup_standard/systemparamter/src/main/js/MainAbility/pages/index/index.hml
rename to ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.hml
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.js b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..d94b75c085fa1c16a0b2721609b18c57a7295476
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestAbility/pages/index/index.js
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ }
+}
+
+
+
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestRunner/OpenHarmonyTestRunner.js
new file mode 100644
index 0000000000000000000000000000000000000000..b9e78ce7cf73f1ade6ba52a408a44e33f5430f0d
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/TestRunner/OpenHarmonyTestRunner.js
@@ -0,0 +1,59 @@
+/*
+ * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s itName',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s package', '-s dryRun'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ targetParams += ' ' + key + ' ' + parameters[key]
+ }
+ }
+ return targetParams.trim()
+}
+
+ export default {
+ onPrepare() {
+ console.info('OpenHarmonyTestRunner OnPrepare')
+ },
+ onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+
+ var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
+
+ var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
+ cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
+ var debug = abilityDelegatorArguments.parameters["-D"]
+ console.info('debug value : '+debug)
+ if (debug == 'true')
+ {
+ cmd += ' -D'
+ }
+ console.info('cmd : '+cmd)
+ abilityDelegator.executeShellCommand(cmd, (err, data) => {
+ console.info('executeShellCommand : err : ' + JSON.stringify(err));
+ console.info('executeShellCommand : data : ' + data.stdResult);
+ console.info('executeShellCommand : data : ' + data.exitCode);
+ })
+ }
+};
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/test/DataAbilityHelperJsSt.test.js b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/test/DataAbilityHelperJsSt.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..bbff5f02637b972a113d2c51c230619144b0de13
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/actsdataabilityaccessdatasharetest/src/main/js/test/DataAbilityHelperJsSt.test.js
@@ -0,0 +1,764 @@
+/*
+ * 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 featureAbility from '@ohos.ability.featureAbility'
+import ohosDataAbility from '@ohos.data.dataAbility'
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
+
+export default function ActsDataAbilityHelperTest() {
+describe('ActsDataAbilityHelperTest', function () {
+ let dataAbilityUri = ("dataability:///com.example.dataabilityserver_fa.DataAbility");
+ let dataShareUri = ("datashare:///com.example.dataabilityserver_fa.DataAbility");
+ let columns = ['id', 'name', 'introduction']
+ let DAHelper;
+ let gSetTimeout = 500;
+ let TAG = ''
+
+ function sleep(delay) {
+ let start = new Date().getTime();
+ while (true) {
+ if (new Date().getTime() - start > delay) {
+ break;
+ }
+ }
+ }
+
+ beforeAll(async (done) => {
+ console.debug('= ACTS_beforeAll ==== ' + DAHelper + " ,JSON. " + JSON.stringify(DAHelper));
+ if(DAHelper == null){
+ console.debug('ACTS_beforeAll DAHelper ====> DAHelper == null');
+ return;
+ }
+ } catch (err) {
+ console.error('=ACTS_beforeAll acquireDataAbilityHelper catch(err)====>' + err);
+ }
+ sleep(500);
+ console.debug('= ACTS_beforeAll ==== {
+ console.debug('= ACTS_afterAll ==== {
+ console.log(TAG + ' insert err, data====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(1);
+ console.log(TAG + '====' + err);
+ expect(false).assertTrue();
+ }
+ console.log(TAG + '===='
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(2);
+ console.log(TAG + '===='
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ expect(false).assertTrue();
+ console.log(TAG + '====' + err);
+ expect(false).assertTrue();
+ console.log(TAG + '==== {
+ console.log(TAG + ' query err, data====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(typeof (data)).assertEqual("object");
+ console.log(TAG + '====' + err);
+ console.log(TAG + '===='
+ + 'json queryPromise [ ' + JSON.stringify(queryPromise) + ' ]');
+ expect(typeof (queryPromise)).assertEqual("object");
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' update err, data====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(1);
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' then data====>'
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(1);
+ console.log(TAG + '==== {
+ console.log(TAG + ' catch err ====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' delete err, data====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(1);
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' then data====>'
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(1);
+ console.log(TAG + '==== {
+ console.log(TAG + ' catch err ====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG +' batchInsert err, data====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(3);
+ console.log(TAG +'====' + err);
+ console.log(TAG +'==== {
+ console.log(TAG + ' then data====>'
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(3);
+ console.log(TAG + '==== {
+ console.log(TAG + ' catch err ====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' err=======>'
+ + 'err [ ' + JSON.stringify(err) + ' ]');
+ expect(err.code).assertEqual(0);
+ }
+ );
+ }
+ } catch (err) {
+ console.error(TAG + ' catch(err)====>' + err);
+ expect(false).assertTrue();
+ console.log(TAG + '====');
+ expect(false).assertTrue();
+ clearTimeout(currentAlertTimeout);
+ console.log(TAG + '==== {
+ if (err.code != 0) {
+ console.log(TAG + ' err=======>'
+ + 'err [ ' + JSON.stringify(err) + ' ]');
+ expect(false).assertTrue();
+ console.log(TAG + '==== {
+ expect(err.code).assertEqual(0);
+ console.log(TAG + '====' + err);
+ expect(false).assertTrue();
+ console.log(TAG + '==== {
+ console.debug(TAG + ' getType err,data=======>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(mimeType);
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' then data====>'
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(mimeType);
+ console.log(TAG + '==== {
+ console.log(TAG + ' catch err ====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ console.log(TAG + '====' + promise)
+ } catch (err) {
+ console.error(TAG + ' getType AsyncCallback catch(err)====>' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' getFileTypes err,data=======>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ console.log(TAG + ' data.length ====>' + data.length);
+ expect(data.length).assertEqual(3);
+ for (let i = 0; i < data.length; i++) {
+ expect(typeof (data[i])).assertEqual("string");
+ console.log(TAG + ' for data ====>' + err.code +
+ ' data[' + i + ']: ' + data[i]);
+ if (i == 0) {
+ expect(data[i]).assertEqual("type01");
+ } else if (i == 1) {
+ expect(data[i]).assertEqual("type00");
+ } else if (i == 2) {
+ expect(data[i]).assertEqual("type03");
+ }
+ }
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' then data====>'
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ console.log(TAG + ' getFileTypes data.length ====>' + data.length);
+ expect(data.length).assertEqual(3);
+ for (var i = 0; i < data.length; i++) {
+ expect(typeof (data[i])).assertEqual("string");
+ console.log(TAG + ' for data[' + i + '] ====>' + data[i])
+ if (i == 0) {
+ expect(data[i]).assertEqual("type01");
+ } else if (i == 1) {
+ expect(data[i]).assertEqual("type00");
+ } else if (i == 2) {
+ expect(data[i]).assertEqual("type03");
+ }
+ }
+ console.log(TAG + '==== {
+ console.log(TAG + ' getFileTypes catch err ====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ console.log(TAG + '====: ' + promise)
+ } catch (err) {
+ console.error(TAG + ' getFileTypes AsyncCallback catch(err)====>' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' err,data=======>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(typeof (data)).assertEqual("string");
+ expect(data).assertEqual(dataShareUri);
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' then data====>'
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(dataShareUri);
+ console.log(TAG + '==== {
+ console.log(TAG + ' catch err ====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG + ' err,data=======>'
+ + 'json err [ ' + JSON.stringify(err) + ' ], json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(dataShareUri);
+ console.log(TAG + '====' + err);
+ console.log(TAG + '==== {
+ console.log(TAG +' then data====>'
+ + 'json data [ ' + JSON.stringify(data) + ' ]');
+ expect(data).assertEqual(dataShareUri);
+ console.log(TAG +'==== {
+ console.log(TAG +' catch err ====>'
+ + 'json err [ ' + JSON.stringify(err) + ' ]');
+ console.log(TAG +'====' + err);
+ console.log(TAG +'====
+ setTimeout(resolve,time)
+ ) } async function output() {
+ let out = await sleep(1000);
+ console.log('1');
+ return out;
+}
+
+export default class DataShareExtAbility extends Extension {
+ async onCreate(want, callback) {
+ console.log('[DataShareServer]: DataShareExtAbility onCreate, want:' + want.abilityName);
+ console.log('[DataShareServer]: DataShareExtAbility onCreate this.context.databaseDir:' + this.context.databaseDir);
+ // @ts-ignore
+ rdbStore = await rdb.getRdbStore(this.context, { name: DB_NAME }, 1);
+ console.log('[DataShareServer]: DataShareExtAbility getRdbStore done');
+ await rdbStore.executeSql(DDL_TBL_CREATE, []);
+ console.log('[DataShareServer]: DataShareExtAbility executeSql done');
+ let err = {"code":0};
+ callback(err);
+ console.log('[DataShareServer]: DataShareExtAbility onCreate end');
+ }
+
+ async getFileTypes(uri: string, mimeTypeFilter: string, callback) {
+ console.log('[DataShareServer]: [getFileTypes] enter');
+ let ret = new Array("type01", "type00", "type03");
+ console.log('[DataShareServer]: [getFileTypes] leave, ret:' + ret);
+ let err = {"code":0};
+ await callback(err,ret);
+ return ret;
+ }
+
+ async openFile(uri: string, mode: string, callback) {
+ console.log('[DataShareServer]: [openFile] enter');
+ let ret = 1;
+ let err = {"code":0};
+ await callback(err,ret);
+ console.log('[DataShareServer]: [openFile] leave, ret:' + ret);
+ }
+
+ async insert(uri, value, callback) {
+ console.log('[DataShareServer]: [insert] enter');
+ if (value == null) {
+ console.error('[DataShareServer]: [insert] invalid valueBuckets');
+ return;
+ }
+ console.log('[DataShareServer]: [insert] value = ' + value);
+ console.log('[DataShareServer]: [insert] value = ' + JSON.stringify(value));
+ await rdbStore.insert(TBL_NAME, value, function (err, ret) {
+ console.log('[DataShareServer]: <> [insert] callback ret:' + ret);
+ if (callback != undefined) {
+ callback(err, ret);
+ }
+ });
+ console.log('[DataShareServer]: [insert] leave');
+ }
+
+ async update(uri, predicates, value, callback) {
+ console.log('[DataShareServer]: [update] enter');
+ if (predicates == null || predicates == undefined) {
+ console.error('[DataShareServer]: <> [update] invalid predicates');
+ return;
+ }
+ console.log('[DataShareServer]: [update] values = ' + value);
+ console.log('[DataShareServer]: [update] values = ' + JSON.stringify(value));
+ console.log('[DataShareServer]: [update] predicates = ' + predicates);
+ console.log('[DataShareServer]: [update] predicates = ' + JSON.stringify(predicates));
+ try {
+ await rdbStore.update(TBL_NAME, value, predicates, function (err, ret) {
+ console.log('[DataShareServer]: [update] callback ret:' + ret);
+ console.log('[DataShareServer]: [update] callback err:' + err);
+ if (callback != undefined) {
+ callback(err, ret);
+ }
+ });
+ } catch (err) {
+ console.error('[DataShareServer]: [update] error' + err);
+ }
+ sleep(1);
+ console.log('[DataShareServer]: [update] leave');
+ }
+
+ async delete(uri, predicates, callback) {
+ console.log('[DataShareServer]: [delete] enter');
+ if (predicates == null || predicates == undefined) {
+ console.error('[DataShareServer]: [delete] invalid predicates');
+ return;
+ }
+ console.log('[DataShareServer]: [delete] predicates = ' + predicates);
+ console.log('[DataShareServer]: [delete] predicates = ' + JSON.stringify(predicates));
+ try {
+ await rdbStore.delete(TBL_NAME, predicates, function (err, ret) {
+ console.log('[DataShareServer]: [delete] ret:' + ret);
+ if (callback != undefined) {
+ callback(err, ret);
+ }
+ });
+ } catch (err) {
+ console.error('[DataShareServer]: [delete] error' + err);
+ }
+ console.log('[DataShareServer]: [delete] leave');
+ }
+
+ async query(uri, predicates, columns, callback) {
+ console.log('[DataShareServer]: [query] enter');
+ if (predicates == null || predicates == undefined) {
+ console.error('[DataShareServer]: [query] invalid predicates');
+ }
+ console.log('[DataShareServer]: [query] values = ' + columns);
+ console.log('[DataShareServer]: [query] values = ' + JSON.stringify(columns));
+ console.log('[DataShareServer]: [query] predicates = ' + predicates);
+ console.log('[DataShareServer]: [query] predicates = ' + JSON.stringify(predicates));
+ try {
+ await rdbStore.query(TBL_NAME, predicates, columns, function (err, resultSet) {
+ console.log('[DataShareServer]: [query] ret: ' + resultSet);
+ if (resultSet != undefined) {
+ console.log('[DataShareServer]: [query] resultSet.rowCount: ' + resultSet.rowCount);
+ }
+ if (callback != undefined) {
+ callback(err, resultSet);
+ }
+ });
+ } catch (err) {
+ console.error('[DataShareServer]: [query] error' + err);
+ }
+
+ console.log('[DataShareServer]: [query] leave');
+ }
+
+ async getType(uri: string, callback) {
+ console.log('[DataShareServer]: [getType] enter');
+ let ret = "image";
+ console.log('[DataShareServer]: [getType] leave, ret:' + ret);
+ let err = {"code":0};
+ await callback(err,ret);
+ return ret;
+ }
+
+ async batchInsert(uri: string, valueBuckets, callback) {
+ console.log('[DataShareServer]: [batchInsert] enter');
+ if (valueBuckets == null || valueBuckets.length == undefined) {
+ console.error('[DataShareServer]: <> [batchInsert] invalid valueBuckets');
+ return;
+ }
+ console.log('[DataShareServer]: [batchInsert] valueBuckets.length:' + valueBuckets.length);
+ let resultNum = valueBuckets.length
+ await valueBuckets.forEach(vb => {
+ console.log('[DataShareServer]: [batchInsert] vb:' + JSON.stringify(vb));
+ rdbStore.insert(TBL_NAME, vb, function (err, ret) {
+ console.log('[DataShareServer]: [batchInsert] callback ret:' + ret);
+ if (callback != undefined) {
+ callback(err, resultNum);
+ }
+ });
+ });
+ console.log('[DataShareServer]: [batchInsert] leave');
+ }
+
+ async normalizeUri(uri: string, callback) {
+ console.log('[DataShareServer]: [normalizeUri] enter');
+ let ret = uri;
+ let err = {"code":0};
+ await callback(err, ret);
+ console.log('[DataShareServer]: [normalizeUri] leave, ret:' + ret);
+ }
+
+ async denormalizeUri(uri: string, callback) {
+ console.log('[DataShareServer]: [denormalizeUri] enter');
+ let ret = uri;
+ let err = {"code":0};
+ await callback(err, ret);
+ console.log('[DataShareServer]: [denormalizeUri] leave, ret:' + ret);
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..618bcd06d8ce579fd5cc66bbf8303dcc6a404e49
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,55 @@
+/*
+ * 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("[DataShareServer]: MainAbility onCreate")
+ globalThis.abilityWant = want;
+ }
+
+ onDestroy() {
+ console.log("[DataShareServer]: MainAbility onDestroy")
+ }
+
+ onWindowStageCreate(windowStage) {
+ // Main window is created, set main page for this ability
+ console.log("[DataShareServer]: MainAbility onWindowStageCreate")
+
+ windowStage.loadContent("pages/index", (err, data) => {
+ if (err.code) {
+ console.error("[DataShareServer]: Failed to load the content. Cause: " + JSON.stringify(err));
+ return;
+ }
+ console.log("[DataShareServer]: Succeeded in loading the content. Data: " + JSON.stringify(data))
+ });
+ }
+
+ onWindowStageDestroy() {
+ // Main window is destroyed, release UI related resources
+ console.log("[DataShareServer]: MainAbility onWindowStageDestroy")
+ }
+
+ onForeground() {
+ // Ability has brought to foreground
+ console.log("[DataShareServer]: MainAbility onForeground")
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[DataShareServer]: MainAbility onBackground")
+ }
+};
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fb89f1e578a2315b78248ba65edf9f921773d319
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,32 @@
+/*
+ * 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 = 'stagemode: datashare server'
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/module.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..465ba09da3eccecf8fa98f74631226acc7aa8a43
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/module.json
@@ -0,0 +1,50 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "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",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:white",
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ],
+ "extensionAbilities": [
+ {
+ "srcEntrance": "./ets/DataShareExtAbility/DataShareExtAbility.ts",
+ "name": "DataShareExtAbility",
+ "icon": "$media:icon",
+ "description": "$string:DataShareExtAbility_desc",
+ "type": "dataShare",
+ "uri": "datashare://com.example.dataabilityserver_fa.DataAbility",
+ "visible": true
+ }
+ ]
+ }
+}
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..1bbc9aa9617e97c45440e1d3d66afc1154837012
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/element/color.json
@@ -0,0 +1,8 @@
+{
+ "color": [
+ {
+ "name": "white",
+ "value": "#FFFFFF"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..8c7cb2aa4611048f2274a70ae34c675ab8522d87
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "DataShareExtAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "DataShareExtAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/media/icon.png differ
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/profile/form_config.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/profile/form_config.json
new file mode 100644
index 0000000000000000000000000000000000000000..b672a6f28aa83a8f8044e696c3c3eee89f9cd258
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/profile/form_config.json
@@ -0,0 +1,40 @@
+{
+ "forms": [
+ {
+ "name": "widget",
+ "description": "This is a service widget.",
+ "src": "./js/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"
+ ]
+ },
+ {
+ "name": "widget",
+ "description": "This is a service widget.",
+ "src": "./js/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"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..feec276e105eeb8d621c20aaf838f318b0a94150
--- /dev/null
+++ b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
diff --git a/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/signature/openharmony_sx.p7b b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..1bc7370912ff0914f3ccbcf639788d441f8d2dcc
Binary files /dev/null and b/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn
index 1c6bcd4b946192377fa618ac7672cdeae9f887ed..8a0cb63e2257253be6570f26257eea4c35eb5db0 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn
+++ b/ability/ability_runtime/actsfwkdataaccessortest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn
index 9652cd443e559021d1edb39bddcfea3b29025f77..45c4a6a0dbbf2b2c4e4d5eb5cf36f224ea4edbfe 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json
index 32e59a4bf17b9e3633802259f02a69431bae741c..51f1b4e73aa66b3efe133332d0e00db4aca68aa3 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/config.json
@@ -18,6 +18,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -69,6 +70,18 @@
"type": "data",
"visible": true,
"uri": "dataability://com.example.myapplication.DataAbility2"
+ },
+ {
+ "srcPath": "TestDataAbility3",
+ "name": ".TestDataAbility3",
+ "icon": "$media:icon",
+ "srcLanguage": "ets",
+ "description": "$string:description_testdataability",
+ "type": "data",
+ "visible": true,
+ "uri": "dataability://com.example.myapplication.DataAbility3",
+ "readPermission": "ohos.permission.READ_CONTACTS",
+ "writePermission": "ohos.permission.WRITE_CONTACTS"
}
],
"js": [
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts
index 1a20eee46467aae73e076eb589ac0d4f36a1e61f..622c50ba44e2bf3fee88052461df2f40cb618619 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts
@@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import dataAbility from '@ohos.data.dataAbility'
import featureAbility from '@ohos.ability.featureAbility'
+import dataAbility from '@ohos.data.dataAbility'
import fileio from '@ohos.fileio'
import dataRdb from '@ohos.data.rdb'
@@ -251,4 +251,4 @@ export default {
}
callback("success", uri);
}
-};
\ No newline at end of file
+};
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts
index f84642cbb8dcc82295cb720eaf2affb061edee4a..4906d9e3927e85556786e154b69b3d6a46148db0 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts
@@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import dataAbility from '@ohos.data.dataAbility'
import featureAbility from '@ohos.ability.featureAbility'
+import dataAbility from '@ohos.data.dataAbility'
import fileio from '@ohos.fileio'
import dataRdb from '@ohos.data.rdb'
@@ -251,4 +251,4 @@ export default {
}
callback("success", uri);
}
-};
\ No newline at end of file
+};
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility3/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility3/data.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e6a8ac729d8c71ef8e16472a363c767472ffd27d
--- /dev/null
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility3/data.ts
@@ -0,0 +1,216 @@
+/*
+ * 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 featureAbility from '@ohos.ability.featureAbility'
+import dataAbility from '@ohos.data.dataAbility'
+import fileio from '@ohos.fileio'
+import dataRdb from '@ohos.data.rdb'
+
+const TABLE_NAME = 'book'
+const STORE_CONFIG = {name: 'book.db'}
+const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book' +
+ '(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)'
+let rdbStore: any = undefined
+const TAG = 'ACTS_ DataAbility.data'
+const context = featureAbility.getContext()
+
+let defaultReturn = 1;
+let returnError = 0;
+let returnError1 = -1;
+let returnError2 = -2;
+let returnError3 = -3;
+let dataAbilityUri = ("dataability:///com.example.myapplication.DataAbility3");
+
+export default {
+
+ onInitialized(abilityInfo) {
+ console.debug('ACTS_ DataAbility onInitialized,abilityInfo=' + abilityInfo.bundleName)
+ dataRdb.getRdbStore(context, STORE_CONFIG, 1, (err, store) => {
+ console.debug('ACTS_ [data]getRdbStoreThen')
+ store.executeSql(SQL_CREATE_TABLE, [])
+ rdbStore = store
+ });
+ },
+
+ insert(uri, valueBucket, callback) {
+ console.debug(TAG + ' insert start 1121')
+ console.debug(TAG + ' valueBucket json=>' + JSON.stringify(valueBucket))
+
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, returnError1);
+ }
+
+ console.debug(TAG + ' valueBucket.age =>' + valueBucket.age)
+ console.debug(TAG + ' valueBucket.name =>' + valueBucket.name)
+ console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary)
+ if (valueBucket.age != 24) {
+ err = "Error age"
+ callback(err, returnError2);
+ }
+ if (valueBucket.name != "ActsDataAbilityHelperPermissionTest") {
+ err = "Error name"
+ callback(err, returnError2);
+ }
+ if (valueBucket.salary != 2024.20) {
+ err = "Error salary"
+ callback(err, returnError2);
+ }
+
+ err = "Error insert"
+ console.debug(TAG + ' rdbStore.insert ')
+ rdbStore.insert(TABLE_NAME, valueBucket, function (err, resultSet) {
+ console.log(TAG + "insert callback resultSet:" + resultSet
+ + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err)
+ callback(err, defaultReturn);
+ })
+ },
+
+ query(uri, columns, predicates, callback) {
+ console.debug(TAG + ' query start')
+
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, returnError1);
+ }
+
+ let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
+ rdbStore.query(rdbPredicates, columns, callback)
+ },
+
+ update(uri, valueBucket, predicates, callback) {
+ console.debug(TAG + 'update start')
+
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, returnError1);
+ }
+
+ console.debug(TAG + ' valueBucket.age =>' + valueBucket.age)
+ console.debug(TAG + ' valueBucket.name =>' + valueBucket.name)
+ console.debug(TAG + ' valueBucket.salary =>' + valueBucket.salary)
+ if (valueBucket.age != 24) {
+ err = "Error age"
+ callback(err, returnError2);
+ }
+ if (valueBucket.name != "ActsDataAbilityHelperPermissionTest") {
+ err = "Error name"
+ callback(err, returnError2);
+ }
+ if (valueBucket.salary != 2024.20) {
+ err = "Error salary"
+ callback(err, returnError2);
+ }
+
+ err = "Error update"
+ let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
+ rdbStore.update(valueBucket, rdbPredicates, function (err, resultSet) {
+ console.log(TAG + "insert callback resultSet:" + resultSet
+ + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err)
+ callback(err, defaultReturn);
+ })
+ },
+
+ delete(uri, predicates, callback) {
+ console.debug(TAG + 'delete start')
+
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, returnError1);
+ }
+
+ let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
+ rdbStore.delete(rdbPredicates, function (err, resultSet) {
+ console.log(TAG + "insert callback resultSet:" + resultSet
+ + " ,json=" + JSON.stringify(resultSet) + ' ,err' + err)
+ callback(err, defaultReturn);
+ })
+ },
+ call(uri, method, arg, extras, callback) {
+ console.debug(TAG + 'call start')
+ console.debug(TAG + 'uri---->' + uri)
+ console.debug(TAG + 'method---->' + uri)
+ },
+
+ batchInsert(uri, values, callback) {
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, returnError1);
+ }
+
+ for (var j = 0; j < values.length; j++) {
+ rdbStore.insert("EMPLOYEE", values[j], function (err, ret) {
+ console.log(TAG + "batchInsert callback ret:" + JSON.stringify(ret))
+ })
+ }
+ console.log(TAG + "batchInsert values.length:" + values.length + ' ,json=' + JSON.stringify(values.length))
+ callback(err, values.length);
+ },
+
+ openFile(uri, mode, callback) {
+ console.info(TAG + '==================== DataAbility test interface by openFile ================');
+ let defaultReturn = 1;
+ let returnError1 = -1;
+
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, returnError1);
+ }
+ if (!(mode == ("r") || mode == ("w") || mode == ("wt") || mode == ("wa") ||
+ mode == ("rw") || mode == ("rwt"))) {
+ if (mode == ("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7")) {
+ defaultReturn = returnError2;
+ } else
+ defaultReturn = returnError3;
+ }
+ console.info(TAG + " path = /data/test ");
+ let path = "/data/test"
+ fileio.stat(path).then(function (stat) {
+ console.info(TAG + "openFile getFileInfo successfully callback ret:" + JSON.stringify(stat));
+ }).catch(function (err) {
+ console.info(TAG + "openFile getFileInfo failed with error callback ret:" + err);
+ defaultReturn = returnError1;
+ });
+ console.info(TAG + " path ==>" + path);
+ callback("success", defaultReturn);
+ },
+
+ normalizeUri(uri, callback) {
+ console.info(TAG + '==================== DataAbility test interface by normalizeUri ================');
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, "");
+ }
+ callback("success", uri);
+ },
+
+ denormalizeUri(uri, callback) {
+ console.info(TAG + '==================== DataAbility test interface by denormalizeUri ================');
+ console.info(TAG + "denormalizeUri uri:" + JSON.stringify(uri));
+
+ let err = "Error Uri"
+ if (uri != dataAbilityUri) {
+ console.debug(TAG + ' uri != dataAbilityUri')
+ callback(err, "");
+ }
+ callback("success", uri);
+ }
+};
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn
index 35a7ed52eadd1032107918470073a5a50f6b000c..1361cce02480f34a0374c8efd964dbf83d96c204 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/config.json b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/config.json
index ce2f9da5d496fd6773569b37047c519e6cc0920b..2021dc4739be0667797d6fa59b0c89ac16363bc9 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/config.json
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.amsst.fwkdataaccessor",
"name": ".entry",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -91,4 +92,4 @@
"mainAbility": ".MainAbility",
"srcPath": ""
}
-}
\ No newline at end of file
+}
diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js
index a5da7a0645c2bcedee40b768e38ee9dd08e4ce10..62743701b9df32cd87d8ce237b9a394dbf807578 100644
--- a/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js
+++ b/ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js
@@ -41,6 +41,7 @@ describe('ActsDataAbilityHelperTest', function () {
} catch (err) {
console.error('=ACTS_beforeAll acquireDataAbilityHelper catch(err)====>:' + err);
}
+ sleep(300);
console.debug('= ACTS_beforeAll ==== delay) {
+ break;
+ }
+ }
+ }
+
/*
* @tc.number: ACTS_AcquireDataAbilityHelper_0100
* @tc.name: GetDataAbilityHelper : Connects an ability to a Service ability
@@ -59,13 +69,13 @@ describe('ActsDataAbilityHelperTest', function () {
console.log('ACTS_AcquireDataAbilityHelper_0100====" + dataAbilityUri)
try {
- var abilityHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri)
- console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: '
- + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper))
if(DAHelper == null){
+ var abilityHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri)
+ console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: '
+ + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper))
DAHelper = abilityHelper;
}
- expect(typeof (abilityHelper)).assertEqual("object");
+ expect(typeof (DAHelper)).assertEqual("object");
} catch (err) {
console.error('=ACTS_GetDataAbilityHelper_0100 acquireDataAbilityHelper catch(err)====>:' + err);
expect(false).assertTrue();
@@ -8317,146 +8327,4 @@ describe('ActsDataAbilityHelperTest', function () {
done();
}
})
-
- /*
- * @tc.number: ACTS_Release_0100
- * @tc.name: Releases the client resource of the Data ability.
- * @tc.desc: Check the return value of the interface (by promise)
- */
- it('ACTS_Release_0100', 0, async function (done) {
- console.log('ACTS_Release_0100====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper));
- expect(typeof (rDAHelper)).assertEqual("object");
- rDAHelper.release().then((data) => {
- console.debug("=ACTS_Release_0100 then data====>"
- + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data);
- expect(data).assertEqual(true);
- console.log('ACTS_Release_0100==== {
- console.debug("=ACTS_Release_0100 catch err ====>"
- + ("json err 【") + JSON.stringify(err) + (" 】 "));
- expect(false).assertTrue();
- console.log('ACTS_Release_0100====:' + err);
- expect(false).assertTrue();
- console.log('ACTS_Release_0100====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper));
- expect(typeof (rDAHelper)).assertEqual("object");
- rDAHelper.release((err, data) => {
- console.debug("=ACTS_Release_0200 err,data=======>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;"));
- console.log('featureAbility getDataAbilityHelper ACTS_Release_0200 data: ' + data)
- expect(data).assertEqual(true);
- console.log('ACTS_Release_0200====:' + err);
- expect(false).assertTrue();
- console.log('ACTS_Release_0200====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper));
- expect(typeof (rDAHelper)).assertEqual("object");
- rDAHelper.release().then((data) => {
- console.debug("=ACTS_Release_0300 then data====>"
- + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data);
- expect(data).assertEqual(true);
- rDAHelper.release().then((data) => {
- console.debug("=ACTS_Release_0300 then data====>"
- + ("json data 【") + JSON.stringify(data) + (" 】") + " , " + data);
- expect(data).assertEqual(false);
- console.log('ACTS_Release_0300==== {
- console.debug("=ACTS_Release_0300 catch err ====>"
- + ("json err 【") + JSON.stringify(err) + (" 】 "));
- expect(false).assertTrue();
- console.log('ACTS_Release_0300==== {
- console.debug("=ACTS_Release_0300 catch err ====>"
- + ("json err 【") + JSON.stringify(err) + (" 】 "));
- expect(false).assertTrue();
- console.log('ACTS_Release_0300====:' + err);
- expect(false).assertTrue();
- console.log('ACTS_Release_0300====: ' + rDAHelper + " ,JSON. " + JSON.stringify(rDAHelper));
- expect(typeof (rDAHelper)).assertEqual("object");
- rDAHelper.release((err, data) => {
- console.debug("=ACTS_Release_0400 err,data=======>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;"));
- console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data)
- expect(data).assertEqual(true);
- rDAHelper.release((err, data) => {
- console.debug("=ACTS_Release_0400 err,data=======>"
- + ("json err【") + JSON.stringify(err) + (" ,") + JSON.stringify(data) + (" 】;"));
- console.log('featureAbility getDataAbilityHelper ACTS_Release_0400 data: ' + data)
- expect(data).assertEqual(false);
- console.log('ACTS_Release_0400====:' + err);
- expect(false).assertTrue();
- console.log('ACTS_Release_0400==== {
+ console.debug('= ACTS_beforeAll ====: ' + DAHelper + " ,JSON. " + JSON.stringify(DAHelper));
+ if(DAHelper == null){
+ console.debug('ACTS_beforeAll DAHelper ====>: DAHelper == null');
+ }
+ } catch (err) {
+ console.error('=ACTS_beforeAll acquireDataAbilityHelper catch(err)====>:' + err);
+ }
+ console.debug('= ACTS_beforeAll ==== {
+ console.debug('= ACTS_afterAll ====" + dataAbilityUri)
+ try {
+ if(DAHelper == null){
+ var abilityHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri)
+ console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: '
+ + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper))
+ DAHelper = abilityHelper;
+ }
+ expect(typeof (DAHelper)).assertEqual("object");
+ } catch (err) {
+ console.error('=ACTS_GetDataAbilityHelper_0100 acquireDataAbilityHelper catch(err)====>:' + err);
+ expect(false).assertTrue();
+ }
+ expect(true).assertTrue();
+ console.log('ACTS_AcquireDataAbilityHelper_0100====: ' + DAHelper)
+ let valueBucketM;
+ try {
+ DAHelper.insert(dataAbilityUri, valueBucketM)
+ .then(function (data) {
+ console.debug("=ACTS_Insert_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】"));
+ expect(JSON.stringify(data)).assertEqual("-1")
+ console.log('ACTS_Insert_0100===="
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ expect(false).assertTrue();
+ console.log('ACTS_Insert_0100====:' + err);
+ expect(false).assertTrue();
+ console.log('ACTS_Insert_0100====: ' + DAHelper)
+ var valueBucketM;
+ try {
+ DAHelper.batchInsert(
+ dataAbilityUri,
+ valueBucketM
+ ).then((data) => {
+ console.debug("=ACTS_BatchInsert_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】; ====>"));
+ expect(JSON.stringify(data)).assertEqual("-1")
+ console.log('ACTS_BatchInsert_0100==== {
+ console.debug("=ACTS_BatchInsert_0100 catch err ====>"
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ console.log('ACTS_BatchInsert_0100====:' + err);
+ console.log('ACTS_BatchInsert_0100==== {
+ console.debug("=ACTS_Query_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】"));
+ expect(data).assertEqual(null);
+ console.log('ACTS_Query_0100==== {
+ console.debug("=ACTS_Query_0100 catch err ====>"
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ console.log('ACTS_Query_0100====:' + err);
+ console.log('ACTS_Query_0100====: ' + DAHelper)
+ try {
+ let valueBucketNull = {};
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
+ console.debug("=ACTS_Update_0100 predicates====>"
+ + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates);
+ DAHelper.update(
+ dataAbilityUri,
+ valueBucketNull,
+ predicates
+ ).then((data) => {
+ console.debug("=ACTS_Update_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】"));
+ expect(JSON.stringify(data)).assertEqual("-1")
+ console.log('ACTS_Update_0100==== {
+ console.debug("=ACTS_Update_0100 catch err ====>"
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ expect(false).assertTrue();
+ console.log('ACTS_Update_0100====:' + err);
+ expect(false).assertTrue();
+ console.log('ACTS_Update_0100====: ' + DAHelper);
+ try {
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
+ console.debug("=ACTS_Delete_0100 predicates====>"
+ + ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates);
+ DAHelper.delete(
+ dataAbilityUri,
+ predicates
+ ).then((data) => {
+ console.debug("=ACTS_Delete_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】"));
+ expect(JSON.stringify(data)).assertEqual("-1")
+ console.log('ACTS_Delete_0100==== {
+ console.debug("=ACTS_Delete_0100 catch err ====>"
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ expect(false).assertTrue();
+ console.log('ACTS_Delete_0100====:' + err);
+ expect(false).assertTrue();
+ console.log('ACTS_Delete_0100==== {
+ console.debug("=ACTS_OpenFile_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】"));
+ expect(JSON.stringify(data)).assertEqual("-1")
+ done();
+ }).catch(err => {
+ console.debug("=ACTS_OpenFile_0100 catch err ====>"
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ expect(false).assertTrue();
+ done();
+ });
+ } catch (err) {
+ console.error('=ACTS_OpenFile_0100 getType catch(err)====>:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ })
+
+ /*
+ * @tc.number: ACTS_NormalizeUri_0100
+ * @tc.name: Converts the given uri that refer to the Data ability into a normalized URI.
+ * @tc.desc: Check the return value of the interface (by promise)
+ */
+ it('ACTS_NormalizeUri_0100', 0, async function (done) {
+ console.log('ACTS_NormalizeUri_0100====: ' + DAHelper);
+ try {
+ DAHelper.normalizeUri(
+ dataAbilityUri,
+ ).then((data) => {
+ console.debug("=ACTS_NormalizeUri_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】"));
+ expect(data.length).assertEqual(0);
+ console.log('ACTS_NormalizeUri_0100==== {
+ console.debug("=ACTS_NormalizeUri_0100 catch err ====>"
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ console.log('ACTS_NormalizeUri_0100====:' + err);
+ console.log('ACTS_NormalizeUri_0100====: ' + DAHelper);
+ try {
+ DAHelper.denormalizeUri(
+ dataAbilityUri,
+ ).then((data) => {
+ console.debug("=ACTS_DenormalizeUri_0100 then data====>"
+ + ("json data 【") + JSON.stringify(data) + (" 】"));
+ expect(data.length).assertEqual(0);
+ console.log('ACTS_DenormalizeUri_0100==== {
+ console.debug("=ACTS_DenormalizeUri_0100 catch err ====>"
+ + ("json err 【") + JSON.stringify(err) + (" 】 "));
+ console.log('ACTS_DenormalizeUri_0100====:' + err);
+ console.log('ACTS_DenormalizeUri_0100====ACTS_GetAbilityState_0300 state:" + state);
expect(state).assertEqual(AbilityDelegatorRegistry.AbilityLifecycleState.FOREGROUND);
+ expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.CREATE).assertTrue()
+ expect(state != AbilityDelegatorRegistry.AbilityLifecycleState.DESTROY).assertTrue()
abilityDelegator.doAbilityBackground(ability, (err, isBackground)=>{
console.debug("====>doAbilityBackground_0300 data:" + JSON.stringify(isBackground));
expect(isBackground).assertTrue();
diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/module.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/module.json
index a8779c99a35f86d0fe682bebc3f05922edee2ce3..ef30793d100bdfe17f02713a68a762aa0ff15bab 100644
--- a/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -53,6 +54,16 @@
"icon": "$media:icon",
"label": "$string:MainAbility4_label"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/module.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/module.json
index 4130395f9b9fb4787e299ae0ee0e3d9bc58c41fd..0dbcd3cba07228d4a8b161c954c9f0ed6974ac46 100644
--- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstageatest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -41,6 +42,16 @@
"visible": true,
"launchType": "singleton"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/module.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/module.json
index 4130395f9b9fb4787e299ae0ee0e3d9bc58c41fd..0dbcd3cba07228d4a8b161c954c9f0ed6974ac46 100644
--- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontextstagebtest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -41,6 +42,16 @@
"visible": true,
"launchType": "singleton"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/module.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/module.json
index 4130395f9b9fb4787e299ae0ee0e3d9bc58c41fd..0dbcd3cba07228d4a8b161c954c9f0ed6974ac46 100644
--- a/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetappcontexttest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -41,6 +42,16 @@
"visible": true,
"launchType": "singleton"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/module.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/module.json
index fe9e3ab7c2cf97d85eab89937b7663c227d3eb34..1a6fa9151a78d2690410cbb3c15ddb9caddd1917 100644
--- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -46,6 +47,16 @@
"icon": "$media:icon",
"label": "$string:Ability2_label"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/module.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/module.json
index fe9e3ab7c2cf97d85eab89937b7663c227d3eb34..1a6fa9151a78d2690410cbb3c15ddb9caddd1917 100644
--- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystagebtest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -46,6 +47,16 @@
"icon": "$media:icon",
"label": "$string:Ability2_label"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn b/ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn
index f1fdbde7189be1310a8a681410275073a6ea864e..00cc7dcb1444be838e228dc7f851dc56076cbf32 100644
--- a/ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn
+++ b/ability/ability_runtime/actsserviceabilityclienttest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn
index adb077d8ae9ba2966202ca4b2e1f1472d5a769a2..6fd401246613abe853f6c9a79e7fd6397a939a47 100644
--- a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn
+++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/config.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/config.json
index c8779ae95cecb444f31bb20fa6d8f8c2a2e6fdc1..15d5a27d063781a24281822e9a2bcdca1ba2da1a 100644
--- a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/config.json
+++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/test/StServiceAbilityClient.test.js b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/test/StServiceAbilityClient.test.js
index 51c02cccfac200139fc1681267318dbad61b4bc6..245ff215008a8839d17196af02aca0a58f6e08d5 100644
--- a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/test/StServiceAbilityClient.test.js
+++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityclienttest/src/main/js/test/StServiceAbilityClient.test.js
@@ -15,842 +15,813 @@
import featureAbility from '@ohos.ability.featureAbility'
import commonEvent from '@ohos.commonEvent'
-import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
+import { describe, afterEach, it, expect } from '@ohos/hypium'
export default function ActsStServiceAbilityTest() {
-describe('ActsStServiceAbilityTest', function () {
- let bundleName = "com.amsst.stserviceabilityserver";
- let abilityName = "com.amsst.stserviceabilityserver.ServiceAbility";
+ describe('ActsStServiceAbilityTest', function () {
+ let bundleName = "com.amsst.stserviceabilityserver";
+ let abilityName = "com.amsst.stserviceabilityserver.ServiceAbility";
- var subscriber0100;
- var CommonEventSubscribeInfo0100 = {
- events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0100",
- ],
- };
- var subscriber0200;
- var CommonEventSubscribeInfo0200 = {
- events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0200",
- ],
- };
- var subscriber0300;
- var CommonEventSubscribeInfo0300 = {
- events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0300",
+ let subscriber0100;
+ let CommonEventSubscribeInfo0100 = {
+ events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0100",
+ ],
+ };
+ let subscriber0200;
+ let CommonEventSubscribeInfo0200 = {
+ events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0200",
+ ],
+ };
+ let subscriber0300;
+ let CommonEventSubscribeInfo0300 = {
+ events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0300",
"ACTS_SerivceAbilityServer_onCommand_PageStartService_0301",
- ],
- };
- var subscriber0400;
- var CommonEventSubscribeInfo0400 = {
- events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0400",
+ ],
+ };
+ let subscriber0400;
+ let CommonEventSubscribeInfo0400 = {
+ events: ["ACTS_SerivceAbilityServer_onCommand_PageStartService_0400",
"ACTS_SerivceAbilityServer_onCommand_PageStartService_0401",
- ],
- };
- var subscriber0500;
- var CommonEventSubscribeInfo0500 = {
- events: ["ACTS_SerivceAbilityServer_onConnect_PageConnectService_0500",
- "ACTS_SerivceAbilityServer_onDisConnect",
- ],
- };
- var subscriber0600;
- var CommonEventSubscribeInfo0600 = {
- events: ["ACTS_SerivceAbilityServer_onConnect_PageConnectService_0600",
- "ACTS_SerivceAbilityServer_onDisConnect",
- ],
- };
- var subscriber0900;
- var CommonEventSubscribeInfo0900 = {
- events: ["ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_0900",
- ],
- };
- var subscriber1000;
- var CommonEventSubscribeInfo1000 = {
- events: ["ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_1000",
- ],
- };
- var subscriber1300;
- var CommonEventSubscribeInfo1300 = {
- events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1300",
- "ACTS_SerivceAbilityServerSecond_onDisConnect",
- ],
- };
- var subscriber1400;
- var CommonEventSubscribeInfo1400 = {
- events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1400",
- "ACTS_SerivceAbilityServerSecond_onDisConnect",
- ],
- };
- var subscriber1500;
- var CommonEventSubscribeInfo1500 = {
- events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1500",
- "ACTS_SerivceAbilityServer_onDisConnect",
- ],
- };
+ ],
+ };
+ let subscriber0500;
+ let CommonEventSubscribeInfo0500 = {
+ events: ["ACTS_SerivceAbilityServer_onConnect_PageConnectService_0500",
+ "ACTS_SerivceAbilityServer_onDisConnect_PageConnectService_0500",
+ ],
+ };
+ let subscriber0600;
+ let CommonEventSubscribeInfo0600 = {
+ events: ["ACTS_SerivceAbilityServer_onConnect_PageConnectService_0600",
+ "ACTS_SerivceAbilityServer_onDisConnect_PageConnectService_0600",
+ ],
+ };
+ let subscriber0900;
+ let CommonEventSubscribeInfo0900 = {
+ events: ["ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_0900",
+ ],
+ };
+ let subscriber1000;
+ let CommonEventSubscribeInfo1000 = {
+ events: ["ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_1000",
+ ],
+ };
+ let subscriber1300;
+ let CommonEventSubscribeInfo1300 = {
+ events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1300",
+ "ACTS_SerivceAbilityServerSecond_onDisConnect_ServiceConnectService_1300",
+ ],
+ };
+ let subscriber1400;
+ let CommonEventSubscribeInfo1400 = {
+ events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1400",
+ "ACTS_SerivceAbilityServerSecond_onDisConnect_ServiceConnectService_1400",
+ ],
+ };
+ let subscriber1500;
+ let CommonEventSubscribeInfo1500 = {
+ events: ["ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1500",
+ "ACTS_SerivceAbilityServer_onDisConnect_ServiceConnectService_1500",
+ ],
+ };
- function unsubscribe(caller, subscriber) {
- commonEvent.unsubscribe(subscriber, (err, data) => {
- console.debug("=ACTS_unsubscribe (err,data)=======>"
+ function unsubscribe(caller, subscriber) {
+ commonEvent.unsubscribe(subscriber, (err, data) => {
+ console.debug("=ACTS_unsubscribe (err,data)=======>"
+ (caller)
+ (" , json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- });
- }
- let gSetTimeout = 1000
- beforeAll(async (done) => {
- console.debug('= ACTS_beforeAll ==== {
- setTimeout(function () {
- done();
- }, gSetTimeout);
- })
- afterEach(async (done) => {
- setTimeout(function () {
- done();
- }, gSetTimeout);
- })
- afterAll((done) => {
- console.debug('= ACTS_afterAll ==== setTimeout(resolve, ms));
+ }
+ let gSetTimeout = 2000
+ afterEach(async (done) => {
+ setTimeout(function () {
+ done();
+ }, gSetTimeout);
+ })
- /*
- * @tc.number: ACTS_JsServiceAbility_0100
- * @tc.name: featureAbility.startAbility : Use page to test startAbiltiy service.
- * @tc.desc: Check the return value of the interface (by Promise)
- */
- it('ACTS_JsServiceAbility_0100', 0, async function (done) {
- console.debug('ACTS_JsServiceAbility_0100==== {
- console.debug("=ACTS_JsServiceAbility_0100 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_0100
+ * @tc.name: featureAbility.startAbility : Use page to test startAbiltiy service.
+ * @tc.desc: Check the return value of the interface (by Promise)
+ */
+ it('ACTS_JsServiceAbility_0100', 0, async function (done) {
+ console.debug('ACTS_JsServiceAbility_0100==== {
+ console.debug("=ACTS_JsServiceAbility_0100 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber0100 = data;
- await commonEvent.subscribe(subscriber0100, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_0100 subscribe (err,data)=======>"
+ subscriber0100 = data;
+ commonEvent.subscribe(subscriber0100, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_0100 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0100").assertEqual(
- data.event);
- unsubscribe("ACTS_JsServiceAbility_0100_unsubscribe", subscriber0100);
- console.debug('ACTS_JsServiceAbility_0100==== {
- console.debug("=ACTS_JsServiceAbility_0100 .then(data)=======>"
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "PageStartService_0100",
+ },
+ }
+ ).then(data => {
+ console.debug("=ACTS_JsServiceAbility_0100 .then(data)=======>"
+ ("abilityStartSetting json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- }).catch(err => {
- expect(".catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_0100==== {
+ expect(".catch").assertEqual(err);
+ console.debug('ACTS_JsServiceAbility_0100==== {
- console.debug("=ACTS_JsServiceAbility_0200 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_0200
+ * @tc.name: featureAbility.startAbility : Use page to test startAbiltiy service.
+ * @tc.desc: Check the return value of the interface (by AsyncCallback)
+ */
+ it('ACTS_JsServiceAbility_0200', 0, async function (done) {
+ console.debug('ACTS_JsServiceAbility_0200==== {
+ console.debug("=ACTS_JsServiceAbility_0200 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber0200 = data;
- await commonEvent.subscribe(subscriber0200, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_0200 subscribe (err,data)=======>"
+ subscriber0200 = data;
+ commonEvent.subscribe(subscriber0200, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_0200 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0200").assertEqual(
- data.event);
- unsubscribe("ACTS_JsServiceAbility_0200_unsubscribe", subscriber0200);
- console.debug('ACTS_JsServiceAbility_0200==== {
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "PageStartService_0200",
+ },
+ }, (err, data) => {
console.debug("=ACTS_JsServiceAbility_0200 startAbility (err,data)=======>"
- + ("abilityStartSetting json err【") + JSON.stringify(err) + (" 】")
- + ("json data【") + JSON.stringify(data) + (" 】")
- + " ,err=" + err + " ,data=" + data);
+ + ("abilityStartSetting json err【") + JSON.stringify(err) + (" 】")
+ + ("json data【") + JSON.stringify(data) + (" 】")
+ + " ,err=" + err + " ,data=" + data);
}
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_0200==== {
- console.debug("=ACTS_JsServiceAbility_0300 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_0300
+ * @tc.name: featureAbility.startAbility : Use page to test startAbiltiy service.
+ * @tc.desc: Check the return value of the interface (by Promise)
+ */
+ it('ACTS_JsServiceAbility_0300', 0, async function (done) {
+ console.debug('ACTS_JsServiceAbility_0300==== {
+ console.debug("=ACTS_JsServiceAbility_0300 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber0300 = data;
- await commonEvent.subscribe(subscriber0300, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_0300 subscribe (err,data)=======>"
+ subscriber0300 = data;
+ commonEvent.subscribe(subscriber0300, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_0300 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- if (data.event == "ACTS_SerivceAbilityServer_onCommand_PageStartService_0300") {
- expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0300").assertEqual(
- data.event);
- featureAbility.startAbility(
- {
- want:
+ if (data.event == "ACTS_SerivceAbilityServer_onCommand_PageStartService_0300") {
+ expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0300").assertEqual(
+ data.event);
+ featureAbility.startAbility(
{
- bundleName: bundleName,
- abilityName: abilityName,
- action: "PageStartService_0301",
- },
- }
- ).then(data => {
- console.debug("=ACTS_JsServiceAbility_0300 .then(data) 2=======>"
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "PageStartService_0301",
+ },
+ }
+ ).then(data => {
+ console.debug("=ACTS_JsServiceAbility_0300 .then(data) 2=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- }).catch(err => {
- expect(".catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_0300==== {
+ expect().assertFail()
+ console.debug('ACTS_JsServiceAbility_0300==== err: ' + JSON.stringify(err));
+ done();
+ })
+ } else {
+ expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0301").assertEqual(
+ data.event);
+ unsubscribe("ACTS_JsServiceAbility_0300_unsubscribe", subscriber0300);
+ console.debug('ACTS_JsServiceAbility_0300==== {
- console.debug("=ACTS_JsServiceAbility_0300 .then(data) 1=======>"
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "PageStartService_0300",
+ },
+ }
+ ).then(data => {
+ console.debug("=ACTS_JsServiceAbility_0300 .then(data) 1=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- }).catch(err => {
- expect(".catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_0300==== {
+ expect(".catch").assertEqual(err);
+ console.debug('ACTS_JsServiceAbility_0300==== {
- console.debug("=ACTS_JsServiceAbility_0400 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_0400
+ * @tc.name: featureAbility.startAbility : Use page to test startAbiltiy service.
+ * @tc.desc: Check the return value of the interface (by AsyncCallback)
+ */
+ it('ACTS_JsServiceAbility_0400', 0, async function (done) {
+ console.debug('ACTS_JsServiceAbility_0400==== {
+ console.debug("=ACTS_JsServiceAbility_0400 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber0400 = data;
- await commonEvent.subscribe(subscriber0400, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_0400 subscribe (err,data)=======>"
+ subscriber0400 = data;
+ commonEvent.subscribe(subscriber0400, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_0400 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- if (data.event == "ACTS_SerivceAbilityServer_onCommand_PageStartService_0400") {
- expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0400").assertEqual(
- data.event);
- featureAbility.startAbility(
- {
- want:
+ if (data.event == "ACTS_SerivceAbilityServer_onCommand_PageStartService_0400") {
+ expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0400").assertEqual(
+ data.event);
+ featureAbility.startAbility(
{
- bundleName: bundleName,
- abilityName: abilityName,
- action: "PageStartService_0401",
- },
- }, (err, data) => {
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "PageStartService_0401",
+ },
+ }, (err, data) => {
console.debug("=ACTS_JsServiceAbility_0400 startAbility (err,data) 2=======>"
- + ("json err【") + JSON.stringify(err) + (" 】")
- + ("json data【") + JSON.stringify(data) + (" 】")
- + " ,err=" + err + " ,data=" + data);
+ + ("json err【") + JSON.stringify(err) + (" 】")
+ + ("json data【") + JSON.stringify(data) + (" 】")
+ + " ,err=" + err + " ,data=" + data);
}
- )
- } else {
- expect("ACTS_SerivceAbilityServer_onCommand_PageStartService_0401").assertEqual(
- data.event);
- unsubscribe("ACTS_JsServiceAbility_0400_unsubscribe", subscriber0400);
- console.debug('ACTS_JsServiceAbility_0400==== {
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "PageStartService_0400",
+ },
+ }, (err, data) => {
console.debug("=ACTS_JsServiceAbility_0400 startAbility (err,data) 1=======>"
- + ("json err【") + JSON.stringify(err) + (" 】")
- + ("json data【") + JSON.stringify(data) + (" 】")
- + " ,err=" + err + " ,data=" + data);
+ + ("json err【") + JSON.stringify(err) + (" 】")
+ + ("json data【") + JSON.stringify(data) + (" 】")
+ + " ,err=" + err + " ,data=" + data);
}
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_0400==== {
- console.debug("=ACTS_JsServiceAbility_0500 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_0500
+ * @tc.name: featureAbility.ConnectAbility : Connects an ability to a Service ability.
+ * @tc.desc: Check the return value of the interface (by Promise)
+ */
+ it('ACTS_JsServiceAbility_0500', 0, async function (done) {
+ console.log('ACTS_JsServiceAbility_0500==== {
+ console.debug("=ACTS_JsServiceAbility_0500 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber0500 = data;
- await commonEvent.subscribe(subscriber0500, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_0500 subscribe (err,data)=======>"
+ subscriber0500 = data;
+ commonEvent.subscribe(subscriber0500, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_0500 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- if (data.event != "ACTS_SerivceAbilityServer_onDisConnect") {
- expect("ACTS_SerivceAbilityServer_onConnect_PageConnectService_0500").assertEqual(
- data.event);
- featureAbility.disconnectAbility(mConnIdJsPromise).then(() => {
- }).catch(err => {
- expect(".catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_0500==== {
+ console.debug("=ACTS_JsServiceAbility_0500 disconnectAbility err====>"
+ + ("json err=") + JSON.stringify(err));
+ }).catch(err => {
+ expect().assertFail()
+ console.debug('ACTS_JsServiceAbility_0500==== err: ' + JSON.stringify(err));
+ done()
+ })
+ } else {
+ expect("ACTS_SerivceAbilityServer_onDisConnect_PageConnectService_0500")
+ .assertEqual(data.event);
+ unsubscribe("ACTS_JsServiceAbility_0500_unsubscribe", subscriber0500);
+ console.debug('ACTS_JsServiceAbility_0500==== mConnIdJsPromise='
+ }
+ });
+ })
+ function onConnectCallback(element, remote) {
+ console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> mConnIdJsPromise='
+ JSON.stringify(mConnIdJsPromise) + " , " + mConnIdJsPromise);
- console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> element='
+ console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> remote='
+ console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> remote='
+ JSON.stringify(remote) + " , " + remote);
- console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> remote is proxy:'
+ console.debug('ACTS_JsServiceAbility_0500_onConnectCallback ====> remote is proxy:'
+ (remote instanceof rpc.RemoteProxy));
- }
+ }
- function onDisconnectCallback(element) {
- console.debug('ACTS_JsServiceAbility_0500_onDisconnectCallback ====> element='
+ function onDisconnectCallback(element) {
+ console.debug('ACTS_JsServiceAbility_0500_onDisconnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- }
+ }
- function onFailedCallback(code) {
- console.debug('ACTS_JsServiceAbility_0500_onFailedCallback ====> code='
+ function onFailedCallback(code) {
+ console.debug('ACTS_JsServiceAbility_0500_onFailedCallback ====> code='
+ JSON.stringify(code) + " , " + code)
- }
+ }
- mConnIdJsPromise = featureAbility.connectAbility(
- {
- bundleName: bundleName,
- abilityName: abilityName,
- action: "PageConnectService_0500",
- },
- {
- onConnect: onConnectCallback,
- onDisconnect: onDisconnectCallback,
- onFailed: onFailedCallback,
- },
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.log('ACTS_JsServiceAbility_0500==== {
- console.debug("=ACTS_JsServiceAbility_0600 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_0600
+ * @tc.name: featureAbility.ConnectAbility : Connects an ability to a Service ability.
+ * @tc.desc: Check the return value of the interface (by AsyncCallback)
+ */
+ it('ACTS_JsServiceAbility_0600', 0, async function (done) {
+ console.log('ACTS_JsServiceAbility_0600==== {
+ console.debug("=ACTS_JsServiceAbility_0600 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber0600 = data;
- await commonEvent.subscribe(subscriber0600, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_0600 subscribe (err,data)=======>"
+ subscriber0600 = data;
+ commonEvent.subscribe(subscriber0600, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_0600 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- if (data.event != "ACTS_SerivceAbilityServer_onDisConnect") {
- expect("ACTS_SerivceAbilityServer_onConnect_PageConnectService_0600").assertEqual(
- data.event);
- featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => {
- console.debug("=ACTS_JsServiceAbility_0600 disconnectAbility err====>"
+ if (data.event == "ACTS_SerivceAbilityServer_onConnect_PageConnectService_0600") {
+ featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => {
+ console.debug("=ACTS_JsServiceAbility_0600 disconnectAbility err====>"
+ ("json err=") + JSON.stringify(err));
- })
- currentAlertTimeout = setTimeout(() => {
- console.log('ACTS_JsServiceAbility_0600==== mConnIdJsAsyncCallback='
+ }
+ });
+ })
+ function onConnectCallback(element, remote) {
+ console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> mConnIdJsAsyncCallback='
+ JSON.stringify(mConnIdJsAsyncCallback) + " , " + mConnIdJsAsyncCallback);
- console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> element='
+ console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote='
+ console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote='
+ JSON.stringify(remote) + " , " + remote);
- console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote is proxy:'
+ console.debug('ACTS_JsServiceAbility_0600_onConnectCallback ====> remote is proxy:'
+ (remote instanceof rpc.RemoteProxy));
- }
+ }
- function onDisconnectCallback(element) {
- console.debug('ACTS_JsServiceAbility_0600_onDisconnectCallback ====> element='
+ function onDisconnectCallback(element) {
+ console.debug('ACTS_JsServiceAbility_0600_onDisconnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- }
+ }
- function onFailedCallback(code) {
- console.debug('ACTS_JsServiceAbility_0600_onFailedCallback ====> code='
+ function onFailedCallback(code) {
+ console.debug('ACTS_JsServiceAbility_0600_onFailedCallback ====> code='
+ JSON.stringify(code) + " , " + code)
- expect(code==featureAbility.ErrorCode.ABILITY_NOT_FOUND
- || (code!=featureAbility.ErrorCode.NO_ERROR
- || code!=featureAbility.ErrorCode.INVALID_PARAMETER
- || code!=featureAbility.ErrorCode.PERMISSION_DENY
+ expect(code == featureAbility.ErrorCode.ABILITY_NOT_FOUND
+ || (code != featureAbility.ErrorCode.NO_ERROR
+ || code != featureAbility.ErrorCode.INVALID_PARAMETER
+ || code != featureAbility.ErrorCode.PERMISSION_DENY
)).assertTrue();
- }
+ }
- mConnIdJsAsyncCallback = featureAbility.connectAbility(
- {
- bundleName: bundleName,
- abilityName: abilityName,
- action: "PageConnectService_0600",
- },
- {
- onConnect: onConnectCallback,
- onDisconnect: onDisconnectCallback,
- onFailed: onFailedCallback,
- },
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.log('ACTS_JsServiceAbility_0600==== {
- console.debug("=ACTS_JsServiceAbility_0900 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_0900
+ * @tc.name: particleability.startAbility : Use page to test startAbiltiy service.
+ * @tc.desc: Check the return value of the interface (by Promise)
+ */
+ it('ACTS_JsServiceAbility_0900', 0, async function (done) {
+ console.debug('ACTS_JsServiceAbility_0900==== {
+ console.debug("=ACTS_JsServiceAbility_0900 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber0900 = data;
- await commonEvent.subscribe(subscriber0900, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_0900 subscribe (err,data)=======>"
+ subscriber0900 = data;
+ commonEvent.subscribe(subscriber0900, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_0900 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- expect("ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_0900").assertEqual(
- data.event);
- unsubscribe("ACTS_JsServiceAbility_0900_unsubscribe", subscriber0900);
- console.debug('ACTS_JsServiceAbility_0900==== {
- console.debug("=ACTS_JsServiceAbility_0900 .then(data)=======>"
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "ServiceStartService_0900",
+ },
+ }
+ ).then(data => {
+ console.debug("=ACTS_JsServiceAbility_0900 .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- }).catch(err => {
- expect(".catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_0900==== {
+ expect(".catch").assertEqual(err);
+ console.debug('ACTS_JsServiceAbility_0900==== {
- console.debug("=ACTS_JsServiceAbility_1000 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_1000
+ * @tc.name: particleability.startAbility : Use page to test startAbiltiy service.
+ * @tc.desc: Check the return value of the interface (by AsyncCallback)
+ */
+ it('ACTS_JsServiceAbility_1000', 0, async function (done) {
+ console.debug('ACTS_JsServiceAbility_1000==== {
+ console.debug("=ACTS_JsServiceAbility_1000 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber1000 = data;
- await commonEvent.subscribe(subscriber1000, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_1000 subscribe (err,data)=======>"
+ subscriber1000 = data;
+ commonEvent.subscribe(subscriber1000, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_1000 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- expect("ACTS_SerivceAbilityServerSecond_onCommand_ServiceStartService_1000").assertEqual(
- data.event);
- unsubscribe("ACTS_JsServiceAbility_1000_unsubscribe", subscriber1000);
- console.debug('ACTS_JsServiceAbility_1000==== {
+ want:
+ {
+ bundleName: bundleName,
+ abilityName: abilityName,
+ action: "ServiceStartService_1000",
+ },
+ }, (err, data) => {
console.debug("=ACTS_JsServiceAbility_1000 startAbility (err,data)=======>"
- + ("json err【") + JSON.stringify(err) + (" 】")
- + ("json data【") + JSON.stringify(data) + (" 】")
- + " ,err=" + err + " ,data=" + data);
+ + ("json err【") + JSON.stringify(err) + (" 】")
+ + ("json data【") + JSON.stringify(data) + (" 】")
+ + " ,err=" + err + " ,data=" + data);
}
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_1000==== {
- console.debug("=ACTS_JsServiceAbility_1300 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_1300
+ * @tc.name: particleability.ConnectAbility : Connects an ability to a Service ability.
+ * @tc.desc: Check the return value of the interface (by Promise)
+ */
+ it('ACTS_JsServiceAbility_1300', 0, async function (done) {
+ console.log('ACTS_JsServiceAbility_1300==== {
+ console.debug("=ACTS_JsServiceAbility_1300 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber1300 = data;
- await commonEvent.subscribe(subscriber1300, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_1300 subscribe (err,data)=======>"
+ subscriber1300 = data;
+ commonEvent.subscribe(subscriber1300, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_1300 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- if (data.event != "ACTS_SerivceAbilityServerSecond_onDisConnect") {
- expect("ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1300"
- ).assertEqual(data.event);
- featureAbility.disconnectAbility(mConnIdJsPromise).then((err) => {
- console.debug("=ACTS_JsServiceAbility_1300 disconnectAbility err====>"
+ if (data.event == "ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1300") {
+ featureAbility.disconnectAbility(mConnIdJsPromise).then((err) => {
+ console.debug("=ACTS_JsServiceAbility_1300 disconnectAbility err====>"
+ ("json err=") + JSON.stringify(err));
- })
- } else {
- expect("ACTS_SerivceAbilityServerSecond_onDisConnect").assertEqual(
- data.event);
- unsubscribe("ACTS_JsServiceAbility_1300_unsubscribe", subscriber1300);
- console.log('ACTS_JsServiceAbility_1300==== mConnIdJsPromise='
+ })
+ }
+ else {
+ expect("ACTS_SerivceAbilityServerSecond_onDisConnect_ServiceConnectService_1300")
+ .assertEqual(data.event);
+ unsubscribe("ACTS_JsServiceAbility_1300_unsubscribe", subscriber1300);
+ console.log('ACTS_JsServiceAbility_1300==== mConnIdJsPromise='
+ JSON.stringify(mConnIdJsPromise) + " , " + mConnIdJsPromise);
- console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> element='
+ console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> remote='
+ console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> remote='
+ JSON.stringify(remote) + " , " + remote);
- console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> remote is proxy:'
+ console.debug('ACTS_JsServiceAbility_1300_onConnectCallback ====> remote is proxy:'
+ (remote instanceof rpc.RemoteProxy));
- }
+ }
- function onDisconnectCallback(element) {
- console.debug('ACTS_JsServiceAbility_1300_onDisconnectCallback ====> element='
+ function onDisconnectCallback(element) {
+ console.debug('ACTS_JsServiceAbility_1300_onDisconnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- unsubscribe("ACTS_JsServiceAbility_1300_unsubscribe", subscriber1300);
- console.log('ACTS_JsServiceAbility_1300==== code='
+ function onFailedCallback(code) {
+ console.debug('ACTS_JsServiceAbility_1300_onFailedCallback ====> code='
+ JSON.stringify(code) + " , " + code)
- }
+ }
- mConnIdJsPromise = featureAbility.connectAbility(
- {
- bundleName: bundleName,
- abilityName: abilityName,
- action: "ServiceConnectService_1300",
- },
- {
- onConnect: onConnectCallback,
- onDisconnect: onDisconnectCallback,
- onFailed: onFailedCallback,
- },
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.log('ACTS_JsServiceAbility_1300==== {
- console.debug("=ACTS_JsServiceAbility_1400 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_1400
+ * @tc.name: particleability.ConnectAbility : Connects an ability to a Service ability.
+ * @tc.desc: Check the return value of the interface (by AsyncCallback)
+ */
+ it('ACTS_JsServiceAbility_1400', 0, async function (done) {
+ console.log('ACTS_JsServiceAbility_1400==== {
+ console.debug("=ACTS_JsServiceAbility_1400 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber1400 = data;
- await commonEvent.subscribe(subscriber1400, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_1400 subscribe (err,data)=======>"
+ subscriber1400 = data;
+ commonEvent.subscribe(subscriber1400, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_1400 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- if (data.event != "ACTS_SerivceAbilityServerSecond_onDisConnect") {
- expect("ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1400"
- ).assertEqual(data.event);
- featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => {
- console.debug("=ACTS_JsServiceAbility_1400 disconnectAbility err====>"
+ if (data.event == "ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1400") {
+ featureAbility.disconnectAbility(mConnIdJsAsyncCallback, (err) => {
+ console.debug("=ACTS_JsServiceAbility_1400 disconnectAbility err====>"
+ ("json err=") + JSON.stringify(err));
- })
- currentAlertTimeout = setTimeout(() => {
- console.log('ACTS_JsServiceAbility_1400==== mConnIdJsAsyncCallback='
+ }
+ });
+ })
+ function onConnectCallback(element, remote) {
+ console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> mConnIdJsAsyncCallback='
+ JSON.stringify(mConnIdJsAsyncCallback) + " , " + mConnIdJsAsyncCallback);
- console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> element='
+ console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote='
+ console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote='
+ JSON.stringify(remote) + " , " + remote);
- console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote is proxy:'
+ console.debug('ACTS_JsServiceAbility_1400_onConnectCallback ====> remote is proxy:'
+ (remote instanceof rpc.RemoteProxy));
- }
+ }
- function onDisconnectCallback(element) {
- console.debug('ACTS_JsServiceAbility_1400_onDisconnectCallback ====> element='
+ function onDisconnectCallback(element) {
+ console.debug('ACTS_JsServiceAbility_1400_onDisconnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- }
+ }
- function onFailedCallback(code) {
- console.debug('ACTS_JsServiceAbility_1400_onFailedCallback ====> code='
+ function onFailedCallback(code) {
+ console.debug('ACTS_JsServiceAbility_1400_onFailedCallback ====> code='
+ JSON.stringify(code) + " , " + code)
- }
+ }
- mConnIdJsAsyncCallback = featureAbility.connectAbility(
- {
- bundleName: bundleName,
- abilityName: abilityName,
- action: "ServiceConnectService_1400",
- },
- {
- onConnect: onConnectCallback,
- onDisconnect: onDisconnectCallback,
- onFailed: onFailedCallback,
- },
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.log('ACTS_JsServiceAbility_1400==== {
- console.debug("=ACTS_JsServiceAbility_1500 createSubscriber .then(data)=======>"
+ /*
+ * @tc.number: ACTS_JsServiceAbility_1500
+ * @tc.name: particleability.ConnectAbility : Connects an ability to a Service ability.
+ * @tc.desc: Check the return value of the interface (by Promise)
+ */
+ it('ACTS_JsServiceAbility_1500', 0, async function (done) {
+ console.log('ACTS_JsServiceAbility_1500==== {
+ console.debug("=ACTS_JsServiceAbility_1500 createSubscriber .then(data)=======>"
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,data=" + data);
- subscriber1500 = data;
- await commonEvent.subscribe(subscriber1500, async (err, data) => {
- console.debug("=ACTS_JsServiceAbility_1500 subscribe (err,data)=======>"
+ subscriber1500 = data;
+ commonEvent.subscribe(subscriber1500, (err, data) => {
+ console.debug("=ACTS_JsServiceAbility_1500 subscribe (err,data)=======>"
+ ("json err【") + JSON.stringify(err) + (" 】")
+ ("json data【") + JSON.stringify(data) + (" 】")
+ " ,err=" + err + " ,data=" + data);
- if (data.event != "ACTS_SerivceAbilityServer_onDisConnect") {
- expect("ACTS_SerivceAbilityServerSecond_onConnect_ServiceConnectService_1500").assertEqual(
- data.event);
- featureAbility.disconnectAbility(mConnIdJsPromise).then(() => {
- }).catch(err => {
- expect(".catch").assertEqual(err);
- console.debug('ACTS_JsServiceAbility_1500==== {
+ console.debug('ACTS_JsServiceAbility_1500===disconnectAbility data:' +
+ JSON.stringify(err));
+ }).catch(err => {
+ expect().assertFail()
+ console.debug('ACTS_JsServiceAbility_1500==== err: ' + JSON.stringify(err));
+ done();
+ })
+ } else {
+ expect("ACTS_SerivceAbilityServer_onDisConnect_ServiceConnectService_1500")
+ .assertEqual(data.event);
+ unsubscribe("ACTS_JsServiceAbility_1500_unsubscribe", subscriber1500);
+ console.log('ACTS_JsServiceAbility_1500==== mConnIdJsPromise='
+ }
+ });
+ })
+ function onConnectCallback(element, remote) {
+ console.debug('ACTS_JsServiceAbility_1500_onConnectCallback ====> mConnIdJsPromise='
+ JSON.stringify(mConnIdJsPromise) + " , " + mConnIdJsPromise);
- console.debug('ACTS_JsServiceAbility_1500_onConnectCallback ====> element='
+ console.debug('ACTS_JsServiceAbility_1500_onConnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- console.debug('ACTS_JsServiceAbility_1500_onConnectCallback ====> remote='
+ console.debug('ACTS_JsServiceAbility_1500_onConnectCallback ====> remote='
+ JSON.stringify(remote) + " , " + remote);
- }
+ }
- function onDisconnectCallback(element) {
- console.debug('ACTS_JsServiceAbility_1500_onDisconnectCallback ====> element='
+ function onDisconnectCallback(element) {
+ console.debug('ACTS_JsServiceAbility_1500_onDisconnectCallback ====> element='
+ JSON.stringify(element) + " , " + element);
- unsubscribe("ACTS_JsServiceAbility_1500_unsubscribe", subscriber1500);
- console.log('ACTS_JsServiceAbility_1500==== code='
+ function onFailedCallback(code) {
+ console.debug('ACTS_JsServiceAbility_1500_onFailedCallback ====> code='
+ JSON.stringify(code) + " , " + code)
- }
+ }
- mConnIdJsPromise = featureAbility.connectAbility(
- {
- bundleName: bundleName,
- abilityName: abilityName,
- action: "ServiceConnectService_1500",
- },
- {
- onConnect: onConnectCallback,
- onDisconnect: onDisconnectCallback,
- onFailed: onFailedCallback,
- },
- )
- } catch (err) {
- expect("catch").assertEqual(err);
- console.log('ACTS_JsServiceAbility_1500==== delay) {
+ break;
+ }
+ }
+}
+
export default {
onStart(want) {
console.debug('ACTS_SerivceAbilityServer 0425 ====>onStart .ts 0851 ='
- + want + " , JSON." + JSON.stringify(want));
+ + want + " , JSON." + JSON.stringify(want));
commonEvent.publish("ACTS_SerivceAbilityServer_onStart", (err) => { });
},
onStop() {
console.debug('ACTS_SerivceAbilityServer ==== { });
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
},
onCommand(want, restart, startId) {
console.debug('ACTS_SerivceAbilityServer ====>onCommand='
- + "JSON(want)=" + JSON.stringify(want)
- + " ,restart=" + restart + " ,startId=" + startId);
+ + "JSON(want)=" + JSON.stringify(want)
+ + " ,restart=" + restart + " ,startId=" + startId);
if (want.action == 'ServiceStartService_0900') {
particleAbility.startAbility(
{
@@ -79,11 +83,7 @@ export default {
},
}
);
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
+ sleep(600)
} else if (want.action == 'ServiceStartService_1000') {
particleAbility.startAbility(
{
@@ -94,27 +94,17 @@ export default {
action: "ServiceStartService_1000",
},
}, (err, data) => {
- console.debug('ACTS_SerivceAbilityServer start Ability 1000 callback====='
- + err + ', data= ' + data + " , JSON." + JSON.stringify(data));
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
- }
+ console.debug('ACTS_SerivceAbilityServer start Ability 1000 callback====='
+ + err + ', data= ' + data + " , JSON." + JSON.stringify(data));
+ }
);
} else {
commonEvent.publish("ACTS_SerivceAbilityServer_onCommand" + "_" + want.action, (err) => {
if (!err.code) {
if (want.action == 'PageStartService_0100' || want.action == 'PageStartService_0200'
- || want.action == 'PageStartService_0301' || want.action == 'PageStartService_0401') {
- console.debug('ACTS_SerivceAbilityServer_onCommand 100 200 301 401.terminateSelf()=====>'
- + want.action);
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
+ || want.action == 'PageStartService_0301' || want.action == 'PageStartService_0401') {
+ console.debug('ACTS_SerivceAbilityServer_onCommand 100 200 301 401.=====>'
+ + want.action);
}
} else {
console.debug('ACTS_SerivceAbilityServer_onCommand publish err=====>' + err);
@@ -126,25 +116,26 @@ export default {
console.info('ACTS_SerivceAbilityServer ====< onConnect');
try {
console.debug('ACTS_SerivceAbilityServer ====>onConnect='
- + want + " , JSON." + JSON.stringify(want));
+ + want + " , JSON." + JSON.stringify(want));
+ commonEvent.publish("ACTS_SerivceAbilityServer_onConnect" + "_" + want.action, (err) => { });
function onConnectCallback(element, remote) {
console.debug('ACTS_SerivceAbilityServer_onConnectCallback ====> mConnIdJs='
- + JSON.stringify(mConnIdJs) + " , " + mConnIdJs);
+ + JSON.stringify(mConnIdJs) + " , " + mConnIdJs);
console.debug('ACTS_SerivceAbilityServer_onConnectCallback ====> element='
- + JSON.stringify(element) + " , " + element);
+ + JSON.stringify(element) + " , " + element);
console.debug('ACTS_SerivceAbilityServer_onConnectCallback ====> remote='
- + JSON.stringify(remote) + " , " + remote);
+ + JSON.stringify(remote) + " , " + remote);
}
function onDisconnectCallback(element) {
console.debug('ACTS_SerivceAbilityServer_onDisconnectCallback ====> element='
- + JSON.stringify(element) + " , " + element);
+ + JSON.stringify(element) + " , " + element);
}
function onFailedCallback(code) {
console.debug('ACTS_SerivceAbilityServer_onFailedCallback ====> code='
- + JSON.stringify(code) + " , " + code)
+ + JSON.stringify(code) + " , " + code)
}
if (want.action == 'ServiceConnectService_1300' || want.action == 'ServiceConnectService_1400'
- || want.action == 'ServiceConnectService_1500' || want.action == 'ServiceConnectService_1600') {
+ || want.action == 'ServiceConnectService_1500' || want.action == 'ServiceConnectService_1600') {
mConnIdJs = particleAbility.connectAbility(
{
bundleName: serversecond_bundleName,
@@ -157,8 +148,6 @@ export default {
onFailed: onFailedCallback,
},
)
- } else {
- commonEvent.publish("ACTS_SerivceAbilityServer_onConnect" + "_" + want.action, (err) => { });
}
} catch (err) {
console.log("ACTS_SerivceAbilityServer ====< error:" + err)
@@ -168,44 +157,34 @@ export default {
},
onDisconnect(want) {
console.debug('ACTS_SerivceAbilityServer ====>onDisConnect='
- + want + " , JSON." + JSON.stringify(want));
- commonEvent.publish("ACTS_SerivceAbilityServer_onDisConnect", (err) => {
- if (err.code) {
- console.debug('ACTS_SerivceAbilityServer_onDisConnect publish err=====>' + err);
- } else {
- console.debug('ACTS_SerivceAbilityServer_onDisConnect featureAbility.terminateSelf()=====<'
- + want.action);
- if (want.action == 'ServiceConnectService_1300' || want.action == 'ServiceConnectService_1400'
- || want.action == 'ServiceConnectService_1500' || want.action == 'ServiceConnectService_1501'
- || want.action == 'ServiceConnectService_1600' || want.action == 'ServiceConnectService_1601'
- ) {
- particleAbility.disconnectAbility(mConnIdJs, (err) => {
- console.debug("=ACTS_SerivceAbilityServer_onDisConnect 13 14 15 16 err====>"
- + ("json err=") + JSON.stringify(err) + " , " + want.action);
- })
- }
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
- }
+ + want + " , JSON." + JSON.stringify(want));
+ commonEvent.publish("ACTS_SerivceAbilityServer_onDisConnect_" + want.action, (err) => {
+ console.debug('ACTS_SerivceAbilityServer_onDisConnect ===' + want.action);
});
+ if (want.action == 'ServiceConnectService_1300' || want.action == 'ServiceConnectService_1400'
+ || want.action == 'ServiceConnectService_1500' || want.action == 'ServiceConnectService_1501'
+ || want.action == 'ServiceConnectService_1600' || want.action == 'ServiceConnectService_1601'
+ ) {
+ particleAbility.disconnectAbility(mConnIdJs, (err) => {
+ console.debug("=ACTS_SerivceAbilityServer_onDisConnect 13 14 15 16 err====>"
+ + ("json err=") + JSON.stringify(err) + " , " + want.action);
+ })
+ }
},
onReady() {
console.debug('ACTS_SerivceAbilityServer ====onReconnect='
- + want + " , JSON." + JSON.stringify(want));
+ + want + " , JSON." + JSON.stringify(want));
commonEvent.publish("ACTS_SerivceAbilityServer_onReconnect" + "_" + want.action, (err) => { });
},
OnAbilityConnectDone(element, remoteObject, resultCode) {
console.debug('ACTS_SerivceAbilityServer ====>OnAbilityConnectDone='
- + element + " , JSON." + JSON.stringify(element)
- + remoteObject + " , JSON." + JSON.stringify(remoteObject)
- + resultCode + " , JSON." + JSON.stringify(resultCode)
+ + element + " , JSON." + JSON.stringify(element)
+ + remoteObject + " , JSON." + JSON.stringify(remoteObject)
+ + resultCode + " , JSON." + JSON.stringify(resultCode)
);
commonEvent.publish("ACTS_SerivceAbilityServer_OnAbilityConnectDone", (err) => { });
},
-};
\ No newline at end of file
+};
diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn
index 7621ad6341985b6681f5d2aeee1328b5a8bea2b4..dbe9959e2c05a20f3edfec6288204ccdce2f32ea 100644
--- a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn
+++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json
index 7f51b6e226c3e39f401d6970cf0f9bdd59f1188b..103ef286afb1ac1b5d44fed56dc7ac3ca2eb7948 100644
--- a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json
+++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/config.json
@@ -18,6 +18,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts
index 80a93e559c71aed05ec6bcd2e94152428f02022a..519bd96b39d3f2747cd4b917801bd4f36cd0dc7d 100644
--- a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts
+++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserversecondrelyhap/entry/src/main/ets/ServiceAbility/service.ts
@@ -49,44 +49,41 @@ class StubTest extends rpc.RemoteObject {
}
}
+function sleep(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+}
export default {
onStart(want) {
console.debug('ACTS_SerivceAbilityServerSecond ====>onStart='
- + want + " , JSON." + JSON.stringify(want));
+ + want + " , JSON." + JSON.stringify(want));
commonEvent.publish("ACTS_SerivceAbilityServerSecond_onStart", (err) => { });
},
onStop() {
console.debug('ACTS_SerivceAbilityServerSecond ==== { });
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
},
onCommand(want, restart, startId) {
console.debug('ACTS_SerivceAbilityServerSecond ====>onCommand='
- + "JSON(want)=" + JSON.stringify(want)
- + " ,restart=" + restart + " ,startId=" + startId);
- commonEvent.publish("ACTS_SerivceAbilityServerSecond_onCommand" + "_" + want.action, (err) => { });
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
+ + "JSON(want)=" + JSON.stringify(want)
+ + " ,restart=" + restart + " ,startId=" + startId);
+ commonEvent.publish("ACTS_SerivceAbilityServerSecond_onCommand" + "_" + want.action, (err) => {
+ console.debug("ACTS_SerivceAbilityServerSecond_onCommand" + "_" + want.action +
+ "err: " + JSON.stringify(err))
+ });
+ sleep(500)
},
onConnect(want) {
console.info('ACTS_SerivceAbilityServerSecond ====< onConnect');
try {
console.debug('ACTS_SerivceAbilityServerSecond ====>onConnect='
- + want + " , JSON." + JSON.stringify(want));
+ + want + " , JSON." + JSON.stringify(want));
function onConnectCallback(element, remote) {
console.debug('ACTS_SerivceAbilityServerSecond_onConnectCallback ====> want.action='
- + JSON.stringify(want.action) + " , " + want.action);
+ + JSON.stringify(want.action) + " , " + want.action);
console.debug('ACTS_SerivceAbilityServerSecond_onConnectCallback ====> element='
- + JSON.stringify(element) + " , " + element);
+ + JSON.stringify(element) + " , " + element);
console.debug('ACTS_SerivceAbilityServerSecond_onConnectCallback ====> remote='
- + JSON.stringify(remote) + " , " + remote);
+ + JSON.stringify(remote) + " , " + remote);
if (want.action == 'ServiceConnectService_1500' || want.action == 'ServiceConnectService_1600') {
commonEvent.publish("ACTS_SerivceAbilityServerSecond_onConnect" + "_" + want.action, (err) => {
console.debug("publish = ACTS_SerivceAbilityServerSecond_onConnect" + "_" + want.action);
@@ -96,12 +93,12 @@ export default {
function onDisconnectCallback(element) {
console.debug('ACTS_SerivceAbilityServerSecond_onDisconnectCallback ====> element='
- + JSON.stringify(element) + " , " + element);
+ + JSON.stringify(element) + " , " + element);
}
function onFailedCallback(code) {
console.debug('ACTS_SerivceAbilityServerSecond_onFailedCallback ====> code='
- + JSON.stringify(code) + " , " + code)
+ + JSON.stringify(code) + " , " + code)
}
if (want.action == 'ServiceConnectService_1500') {
mConnIdJs = particleAbility.connectAbility(
@@ -153,26 +150,21 @@ export default {
},
onDisconnect(want) {
console.debug('ACTS_SerivceAbilityServerSecond ====>onDisConnect='
- + want + " , JSON." + JSON.stringify(want));
- commonEvent.publish("ACTS_SerivceAbilityServerSecond_onDisConnect", (err) => {
+ + want + " , JSON." + JSON.stringify(want));
+ commonEvent.publish("ACTS_SerivceAbilityServerSecond_onDisConnect_" + want.action, (err) => {
if (err.code) {
console.debug('ACTS_SerivceAbilityServerSecond_onDisConnect publish err=====>' + err);
} else {
- console.debug('ACTS_SerivceAbilityServerSecond_onDisConnect featureAbility.terminateSelf()=====<'
- + want.action);
+ console.debug('ACTS_SerivceAbilityServerSecond_onDisConnect =====<'
+ + want.action);
if (want.action == 'ServiceConnectService_1500' || want.action == 'ServiceConnectService_1501'
- || want.action == 'ServiceConnectService_1600' || want.action == 'ServiceConnectService_1601'
- || want.action == 'ServiceConnectService_1590') {
+ || want.action == 'ServiceConnectService_1600' || want.action == 'ServiceConnectService_1601'
+ || want.action == 'ServiceConnectService_1590') {
particleAbility.disconnectAbility(mConnIdJs, (err) => {
console.debug("=ACTS_SerivceAbilityServerSecond_onDisConnect err====>"
- + ("json err=") + JSON.stringify(err) + " , " + want.action);
+ + ("json err=") + JSON.stringify(err) + " , " + want.action);
})
}
- particleAbility.terminateSelf().then((data) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data));
- }).catch((error) => {
- console.log('ACTS_SerivceAbilityServer terminateSelf error:' + JSON.stringify(error));
- });
}
});
},
@@ -181,13 +173,13 @@ export default {
},
onReconnect(want) {
console.debug('ACTS_SerivceAbilityServerSecond ====>onReconnect='
- + want + " , JSON." + JSON.stringify(want));
+ + want + " , JSON." + JSON.stringify(want));
},
OnAbilityConnectDone(element, remoteObject, resultCode) {
console.debug('ACTS_SerivceAbilityServerSecond ====>OnAbilityConnectDone='
- + element + " , JSON." + JSON.stringify(element)
- + remoteObject + " , JSON." + JSON.stringify(remoteObject)
- + resultCode + " , JSON." + JSON.stringify(resultCode)
+ + element + " , JSON." + JSON.stringify(element)
+ + remoteObject + " , JSON." + JSON.stringify(remoteObject)
+ + resultCode + " , JSON." + JSON.stringify(resultCode)
);
commonEvent.publish("ACTS_SerivceAbilityServerSecond_OnAbilityConnectDone", (err) => { });
},
diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/module.json b/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/module.json
index 63433eb8d6b9487794cb12a568e2b0f733abdad3..62daa989b086556ef166f17c87ebb9d02b57088d 100644
--- a/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/ActskillProcessWithAccountCloseTest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/module.json b/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/module.json
index 63433eb8d6b9487794cb12a568e2b0f733abdad3..62daa989b086556ef166f17c87ebb9d02b57088d 100644
--- a/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/module.json
+++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/ExecuteShellCommand/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actsstartrunnertest/entry/src/main/module.json b/ability/ability_runtime/actsstartrunnertest/entry/src/main/module.json
index cb34980fee3963211cde784db3c8f95bd49a82ee..628fdcbca8d16feaf0c4f7390573077da0a4c36c 100644
--- a/ability/ability_runtime/actsstartrunnertest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsstartrunnertest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json
index da803ed692c2f99e99039294f6204ab21eea2b70..7839de72adab3d3bdd961cefebd008b67790e59c 100644
--- a/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json
+++ b/ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".entry",
"mainAbility": "com.amsst.actsstserviceabilityclientcasetest.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actssupportfunction/BUILD.gn b/ability/ability_runtime/actssupportfunction/BUILD.gn
index 8d8ea0da68d3387ab50dc01a321dd8ecd4f0d5f0..b79c4e83021b10af79dc6b3bc102c2d51674e996 100644
--- a/ability/ability_runtime/actssupportfunction/BUILD.gn
+++ b/ability/ability_runtime/actssupportfunction/BUILD.gn
@@ -17,6 +17,7 @@ group("actssupportfunction") {
testonly = true
if (is_standard_system) {
deps = [
+ "actsonandoffscreentest:ActsOnAndOffScreenTest",
"actssupportfunctiontest:ActsSupportFunctionTest",
"faonandoffscreen:FaOnAndOffScreen",
"fasupportfunction:fasupportfunction",
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/app.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..0e1b95a94f8f01c5febab78595e5295d1f3be0b7
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.actsonandoffscreentest",
+ "vendor": "huawei",
+ "versionCode": 1000000,
+ "versionName": "1.0.0",
+ "debug": false,
+ "icon": "$media:app_icon",
+ "label": "$string:app_name",
+ "description" : "$string:app_name",
+ "distributedNotificationEnabled": true,
+ "keepAlive" : true,
+ "singleUser": true,
+ "minAPIVersion": 9,
+ "targetAPIVersion": 9,
+ "car": {
+ "apiCompatibleVersion": 9,
+ "singleUser": false
+ }
+ }
+}
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..d0dc3a93dbce6bd228a2968ecd9885fc364e9dcf
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "ActsOnAndOffScreenTest"
+ }
+ ]
+}
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/AppScope/resources/base/media/app_icon.png differ
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/BUILD.gn b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..3fe950e9b1ebd17bd036c168914acb514a33e23e
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/BUILD.gn
@@ -0,0 +1,42 @@
+# 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("ActsOnAndOffScreenTest") {
+ hap_profile = "entry/src/main/module.json"
+ deps = [
+ ":actsonandoffscreentest_js_assets",
+ ":actsonandoffscreentest_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsOnAndOffScreenTest"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("actsonandoffscreentest_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("actsonandoffscreentest_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("actsonandoffscreentest_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":actsonandoffscreentest_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..4553d0904aa1784824061c0793aa049d7cbc5aa2
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json
@@ -0,0 +1,23 @@
+{
+ "description": "Configuration for aceceshi Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.example.actsonandoffscreentest",
+ "module-name": "entry",
+ "shell-timeout": "600000",
+ "testcase-timeout":"30000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsOnAndOffScreenTest.hap",
+ "FaOnAndOffScreen.hap",
+ "StageOnAndOffScreen.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
+
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/Application/MyAbilityStage.ts b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/Application/MyAbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8d3ffd1340628c7919ecdc7cb5dd81d37c483445
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/Application/MyAbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+ * 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";
+
+var TAG0 = 'ActsOnAndOffScreenTest:MyAbilityStage:';
+export default class MyAbilityStage extends AbilityStage {
+ onCreate() {
+ console.log(TAG0 + "onCreate")
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8e765bf1f7f376c6871a5a1a4b0d35164d256de8
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,63 @@
+/*
+ * 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';
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
+import { Hypium } from '@ohos/hypium';
+import testsuite from '../test/List.test';
+
+var TAG1 = 'ActsOnAndOffScreenTest:MainAbility:';
+export default class MainAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log(TAG1 + 'onCreate');
+
+ globalThis.abilityTestContext = this.context;
+ globalThis.abilityWant = want;
+ globalThis.abilityWant.parameters.timeout = 15000;
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.log('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ }
+
+ onDestroy() {
+ console.log(TAG1 + 'onDestroy');
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log(TAG1 + 'onWindowStageCreate');
+
+ windowStage.loadContent("pages/index", (err, data) => {
+ if (err.code) {
+ console.log(TAG1 + 'Failed to load the content. Cause:' + JSON.stringify(err));
+ return;
+ }
+ console.log(TAG1 + 'Succeeded in loading the content. Data: ' + JSON.stringify(data));
+ });
+ }
+
+ onWindowStageDestroy() {
+ console.log(TAG1 + 'onWindowStageDestroy');
+ }
+
+ onForeground() {
+ console.log(TAG1 + 'onForeground');
+ }
+
+ onBackground() {
+ console.log(TAG1 + 'onBackground');
+ }
+};
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7977b1e28cfa0007b46f0df33b5290187ab81553
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import TestRunner from '@ohos.application.testRunner';
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
+
+var abilityDelegator = undefined
+var abilityDelegatorArguments = undefined
+var TAG = "ActsOnAndOffScreenTest == "
+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(TAG + "onAbilityCreateCallback");
+}
+
+async function addAbilityMonitorCallback(err: any) {
+ console.log(TAG + "addAbilityMonitorCallback : " + JSON.stringify(err))
+}
+
+export default class OpenHarmonyTestRunner implements TestRunner {
+ constructor() {
+ }
+
+ onPrepare() {
+ console.log(TAG + "OpenHarmonyTestRunner OnPrepare ")
+ }
+
+ async onRun() {
+ console.log(TAG + 'OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ globalThis.abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var MainAbilityName = 'MainAbility'
+ let lMonitor = {
+ abilityName: MainAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
+ cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
+ console.log(TAG + 'cmd : '+cmd)
+ abilityDelegator.executeShellCommand(cmd,
+ (err: any, d: any) => {
+ console.log(TAG + 'executeShellCommand : err : ' + JSON.stringify(err));
+ console.log(TAG + 'executeShellCommand : data : ' + d.stdResult);
+ console.log(TAG + 'executeShellCommand : data : ' + d.exitCode);
+ })
+ console.log(TAG + 'OpenHarmonyTestRunner onRun end')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..05c74b67a7f5d3318febb5f2c1cc22506bdf5679
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,35 @@
+/*
+ * 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 {
+ aboutToAppear() {
+ console.log('ActsOnAndOffScreenTest MainAbility index aboutToAppear')
+ }
+
+ @State message: string = 'Hello World ActsOnAndOffScreenTest 1'
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2d711f4be534262ffd210c8a392852a2297f5f27
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,19 @@
+/*
+ * 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 onAndOffScreenTest from './OnAndOffScreenTest.test';
+
+export default function testsuite() {
+ onAndOffScreenTest();
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f83fcea06c81abbf49173ba5bcdd3d0a5345aada
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
@@ -0,0 +1,637 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
+import { BY,UiDriver,UiComponent } from '@ohos.uitest';
+import commonEvent from '@ohos.commonEvent';
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
+import power from '@ohos.power';
+import backgroundTaskManager from '@ohos.backgroundTaskManager';
+
+export default function OnAndOffScreenTest() {
+
+ describe('OnAndOffScreenTest', function () {
+
+ let TAG = "";
+ let TAG1 = "SUB_AA_OpenHarmony == OnAndOffScreenTest : ";
+ let sleepTimeOne = 1000;
+ let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+ let id = undefined;
+ beforeAll(async (done) => {
+ console.log(TAG1 + "beforeAll called");
+ let myReason = 'test FaShowOnLockTest';
+ let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
+ console.log(TAG1 + "Request suspension delay will time out.");
+ })
+ id = delayInfo.requestId;
+ console.log(TAG1 + "requestId is : " + id);
+ setTimeout(function () {
+ console.log(TAG1 + "beforeAll end");
+ done();
+ }, sleepTimeOne);
+ })
+
+ afterAll(async (done) => {
+ console.log(TAG1 + "afterAll called");
+ backgroundTaskManager.cancelSuspendDelay(id);
+ setTimeout(function () {
+ console.log(TAG1 + "afterAll end");
+ done();
+ }, sleepTimeOne);
+ })
+
+ async function slideScreen(TAG) {
+ console.log(TAG + "slideScreen start");
+ var driver = UiDriver.create();
+ await driver.swipe(1000, 3000, 1000, 500, 1200).then((data) => {
+ console.log(TAG + "swipe : " + JSON.stringify(data));
+ }).catch((error) => {
+ console.log(TAG + "swipe error = " + JSON.stringify(error));
+ })
+ console.log(TAG + "slideScreen end");
+ }
+
+ async function executeShellCommand(cmd, TAG) {
+ console.log(TAG + "executeShellCommand start : " + JSON.stringify(cmd));
+ await abilityDelegator.executeShellCommand(cmd).then((data) => {
+ console.log(TAG + "executeShellCommand : data : " + data.stdResult);
+ console.log(TAG + "executeShellCommand : data : " + data.exitCode);
+ }).catch((error) => {
+ console.log(TAG + "executeShellCommand error : " + JSON.stringify(error));
+ })
+ }
+
+ beforeEach(async (done) => {
+ console.log(TAG1 + "beforeEach called");
+ let status = undefined;
+ await power.isScreenOn().then((data) => {
+ console.log(TAG1 + "isScreenOn data = " + JSON.stringify(data));
+ status = data;
+ }).catch((error) => {
+ console.log(TAG1 + "isScreenOn error = " + JSON.stringify(error));
+ })
+
+ if (!status) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG1);
+ await slideScreen(TAG1);
+ }
+
+ setTimeout(() => {
+ console.log(TAG1 + "beforeEach end");
+ done();
+ }, sleepTimeOne);
+ })
+
+ afterEach(async (done) => {
+ console.log(TAG1 + "afterEach called");
+ let cmd1 = "aa force-stop ohos.acts.aafwk.test.faonandoffscreen";
+ await executeShellCommand(cmd1, TAG1);
+ let cmd2 = "aa force-stop ohos.acts.aafwk.test.stageonandoffscreen";
+ await executeShellCommand(cmd2, TAG1);
+
+ setTimeout(() => {
+ console.log(TAG1 + "afterEach end");
+ done();
+ }, sleepTimeOne);
+ })
+
+ /*
+ * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0100
+ * @tc.name : Verify the life cycle of on / off screen ability
+ * @tc.desc : FA model is applied in the foreground, and the device is locked.
+ */
+ it('SUB_AA_OpenHarmony_OnAndOffScreen_0100', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0100 == ';
+ console.log(TAG + "begin");
+
+ let status1 = undefined;
+ let lifeList = [];
+ let listCheck = ["onCreate", "onActive", "onInactive", "onHide"];
+ let onActive = "FaOnAndOffScreen_MainAbility_onActive";
+ let onHide = "FaOnAndOffScreen_MainAbility_onHide";
+
+ var subscriber;
+ var subscribeInfo = {
+ events: [onActive, onHide]
+ }
+ await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
+ subscriber = data;
+
+ commonEvent.subscribe(subscriber, async (err, data) => {
+ console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
+
+ if (data.event == onActive) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ }
+
+ if (data.event == onHide) {
+ lifeList = data.parameters.lifeList;
+ setTimeout(async () => {
+ commonEvent.unsubscribe(subscriber, async (err, data) => {
+ console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
+ expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
+ expect(status1).assertTrue();
+ done();
+ });
+ }, sleepTimeOne);
+ }
+ });
+ }).catch((error) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ await power.isScreenOn().then((data) => {
+ console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
+ status1 = data;
+ }).catch((error) => {
+ console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ let wantNum = {
+ bundleName: "ohos.acts.aafwk.test.faonandoffscreen",
+ abilityName: "ohos.acts.aafwk.test.faonandoffscreen.MainAbility"
+ }
+ await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
+ console.log(TAG + "startAbility data = " + JSON.stringify(data));
+ }).catch((error) => {
+ console.log(TAG + "startAbility error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0200
+ * @tc.name : Verify the life cycle of on / off screen ability
+ * @tc.desc : FA model is applied in the foreground, the device locks the screen, and then unlocks.
+ */
+ it('SUB_AA_OpenHarmony_OnAndOffScreen_0200', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0200 == ';
+ console.log(TAG + "begin");
+
+ let status1 = undefined;
+ let lifeList = [];
+ let listCheck = ["onCreate", "onActive", "onInactive", "onHide", "onShow"];
+ let onActive = "FaOnAndOffScreen_MainAbility_onActive";
+ let onHide = "FaOnAndOffScreen_MainAbility_onHide";
+ let onShow = "FaOnAndOffScreen_MainAbility_onShow";
+
+ var subscriber;
+ var subscribeInfo = {
+ events: [onActive, onHide, onShow]
+ }
+ await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
+ subscriber = data;
+
+ commonEvent.subscribe(subscriber, async (err, data) => {
+ console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
+
+ if (data.event == onActive) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ }
+
+ if (data.event == onHide) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ await slideScreen(TAG);
+ }
+
+ if (data.event == onShow) {
+ lifeList = data.parameters.lifeList;
+ setTimeout(async () => {
+ commonEvent.unsubscribe(subscriber, async (err, data) => {
+ console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
+ expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
+ expect(status1).assertTrue();
+ done();
+ });
+ }, sleepTimeOne);
+ }
+ });
+ }).catch((error) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ await power.isScreenOn().then((data) => {
+ console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
+ status1 = data;
+ }).catch((error) => {
+ console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ let wantNum = {
+ bundleName: "ohos.acts.aafwk.test.faonandoffscreen",
+ abilityName: "ohos.acts.aafwk.test.faonandoffscreen.MainAbility"
+ }
+ await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
+ console.log(TAG + "startAbility data = " + JSON.stringify(data));
+ }).catch((error) => {
+ console.log(TAG + "startAbility error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0300
+ * @tc.name : Verify the life cycle of on / off screen ability
+ * @tc.desc : Stage model is applied in the foreground, and the device locks the screen.
+ */
+ it('SUB_AA_OpenHarmony_OnAndOffScreen_0300', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0300 == ';
+ console.log(TAG + "begin");
+
+ let status1 = undefined;
+ let lifeList = [];
+ let listCheck = ["onCreate", "onForeground", "onBackground"];
+ let onForeground = "StageOnAndOffScreen_MainAbility_onForeground";
+ let onBackground = "StageOnAndOffScreen_MainAbility_onBackground";
+
+ var subscriber;
+ var subscribeInfo = {
+ events: [onForeground, onBackground]
+ }
+ await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
+ subscriber = data;
+
+ commonEvent.subscribe(subscriber, async (err, data) => {
+ console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
+
+ if (data.event == onForeground) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ }
+
+ if (data.event == onBackground) {
+ lifeList = data.parameters.lifeList;
+ setTimeout(async () => {
+ commonEvent.unsubscribe(subscriber, async (err, data) => {
+ console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
+ expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
+ expect(status1).assertTrue();
+ done();
+ });
+ }, sleepTimeOne);
+ }
+ });
+ }).catch((error) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ await power.isScreenOn().then((data) => {
+ console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
+ status1 = data;
+ }).catch((error) => {
+ console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ let wantNum = {
+ bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
+ abilityName: "MainAbility"
+ }
+ await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
+ console.log(TAG + "startAbility data = " + JSON.stringify(data));
+ }).catch((error) => {
+ console.log(TAG + "startAbility error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0400
+ * @tc.name : Verify the life cycle of on / off screen ability
+ * @tc.desc : The stage model is applied in the foreground, the device locks the screen, and then unlocks.
+ */
+ it('SUB_AA_OpenHarmony_OnAndOffScreen_0400', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0400 == ';
+ console.log(TAG + "begin");
+
+ let flag = false;
+ let status1 = undefined;
+ let lifeList = [];
+ let listCheck = ["onCreate", "onForeground", "onBackground", "onForeground"];
+ let onForeground = "StageOnAndOffScreen_MainAbility_onForeground";
+ let onBackground = "StageOnAndOffScreen_MainAbility_onBackground";
+
+ var subscriber;
+ var subscribeInfo = {
+ events: [onForeground, onBackground]
+ }
+ await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
+ subscriber = data;
+
+ commonEvent.subscribe(subscriber, async (err, data) => {
+ console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
+
+ if (data.event == onForeground && !flag) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ flag = true;
+ } else if (data.event == onForeground && flag) {
+ lifeList = data.parameters.lifeList;
+ setTimeout(async () => {
+ commonEvent.unsubscribe(subscriber, async (err, data) => {
+ console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
+ expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
+ expect(status1).assertTrue();
+ done();
+ });
+ }, sleepTimeOne);
+ }
+
+ if (data.event == onBackground) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ await slideScreen(TAG);
+ }
+ });
+ }).catch((error) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ await power.isScreenOn().then((data) => {
+ console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
+ status1 = data;
+ }).catch((error) => {
+ console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ let wantNum = {
+ bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
+ abilityName: "MainAbility"
+ }
+ await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
+ console.log(TAG + "startAbility data = " + JSON.stringify(data));
+ }).catch((error) => {
+ console.log(TAG + "startAbility error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0500
+ * @tc.name : Verify the life cycle of on / off screen ability
+ * @tc.desc : Application in the background, device lock screen.
+ */
+ it('SUB_AA_OpenHarmony_OnAndOffScreen_0500', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0500 == ';
+ console.log(TAG + "begin");
+
+ let status1 = undefined;
+ let lifeList = [];
+ let listCheck = ["onCreate", "onWindowStageCreate", "onForeground", "onBackground"];
+ let onCreate = "StageOnAndOffScreen_MainAbility2_onCreate";
+ let onWindowStageCreate = "StageOnAndOffScreen_MainAbility2_onWindowStageCreate";
+ let onForeground = "StageOnAndOffScreen_MainAbility2_onForeground";
+ let onBackground = "StageOnAndOffScreen_MainAbility2_onBackground";
+ let onWindowStageDestroy = "StageOnAndOffScreen_MainAbility2_onWindowStageDestroy";
+ let onDestroy = "StageOnAndOffScreen_MainAbility2_onDestroy";
+ let onForeground2 = "StageOnAndOffScreen_MainAbility3_onForeground";
+ let onBackground2 = "StageOnAndOffScreen_MainAbility3_onBackground";
+
+ var subscriber;
+ var subscribeInfo = {
+ events: [onCreate, onWindowStageCreate, onForeground, onBackground, onWindowStageDestroy, onDestroy,
+ onForeground2, onBackground2]
+ }
+ await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
+ subscriber = data;
+
+ commonEvent.subscribe(subscriber, async (err, data) => {
+ console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
+
+ if (data.event == onCreate) {
+ lifeList.push("onCreate");
+ }
+
+ if (data.event == onWindowStageCreate) {
+ lifeList.push("onWindowStageCreate");
+ }
+
+ if (data.event == onForeground) {
+ lifeList.push("onForeground");
+ }
+
+ if (data.event == onBackground) {
+ lifeList.push("onBackground");
+ }
+
+ if (data.event == onWindowStageDestroy) {
+ lifeList.push("onWindowStageDestroy");
+ }
+
+ if (data.event == onDestroy) {
+ lifeList.push("onDestroy");
+ }
+
+ if (data.event == onForeground2) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ }
+
+ if (data.event == onBackground2) {
+ setTimeout(async () => {
+ commonEvent.unsubscribe(subscriber, async (err, data) => {
+ console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
+ expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
+ expect(status1).assertTrue();
+ done();
+ });
+ }, sleepTimeOne);
+ }
+ });
+ }).catch((error) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ await power.isScreenOn().then((data) => {
+ console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
+ status1 = data;
+ }).catch((error) => {
+ console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ let wantNum = {
+ bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
+ abilityName: "MainAbility2"
+ }
+ await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
+ console.log(TAG + "startAbility data = " + JSON.stringify(data));
+ }).catch((error) => {
+ console.log(TAG + "startAbility error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0600
+ * @tc.name : Verify the life cycle of on / off screen ability
+ * @tc.desc : Application in the background, device lock screen.
+ */
+ it('SUB_AA_OpenHarmony_OnAndOffScreen_0600', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0600 == ';
+ console.log(TAG + "begin");
+
+ let flag = false;
+ let status1 = undefined;
+ let lifeList = [];
+ let listCheck = ["onCreate", "onWindowStageCreate", "onForeground", "onBackground"];
+ let onCreate = "StageOnAndOffScreen_MainAbility2_onCreate";
+ let onWindowStageCreate = "StageOnAndOffScreen_MainAbility2_onWindowStageCreate";
+ let onForeground = "StageOnAndOffScreen_MainAbility2_onForeground";
+ let onBackground = "StageOnAndOffScreen_MainAbility2_onBackground";
+ let onWindowStageDestroy = "StageOnAndOffScreen_MainAbility2_onWindowStageDestroy";
+ let onDestroy = "StageOnAndOffScreen_MainAbility2_onDestroy";
+ let onForeground2 = "StageOnAndOffScreen_MainAbility3_onForeground";
+ let onBackground2 = "StageOnAndOffScreen_MainAbility3_onBackground";
+
+ var subscriber;
+ var subscribeInfo = {
+ events: [onCreate, onWindowStageCreate, onForeground, onBackground, onWindowStageDestroy, onDestroy,
+ onForeground2, onBackground2]
+ }
+ await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
+ subscriber = data;
+
+ commonEvent.subscribe(subscriber, async (err, data) => {
+ console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
+
+ if (data.event == onCreate) {
+ lifeList.push("onCreate");
+ }
+
+ if (data.event == onWindowStageCreate) {
+ lifeList.push("onWindowStageCreate");
+ }
+
+ if (data.event == onForeground) {
+ lifeList.push("onForeground");
+ }
+
+ if (data.event == onBackground) {
+ lifeList.push("onBackground");
+ }
+
+ if (data.event == onWindowStageDestroy) {
+ lifeList.push("onWindowStageDestroy");
+ }
+
+ if (data.event == onDestroy) {
+ lifeList.push("onDestroy");
+ }
+
+ if (data.event == onForeground2 && !flag) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ flag = true;
+ } else if (data.event == onForeground2 && flag) {
+ setTimeout(async () => {
+ commonEvent.unsubscribe(subscriber, async (err, data) => {
+ console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
+ expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
+ expect(status1).assertTrue();
+ done();
+ });
+ }, sleepTimeOne);
+ }
+
+ if (data.event == onBackground2) {
+ let cmd = "uinput -K -d 18 -u 18";
+ await executeShellCommand(cmd, TAG);
+ await slideScreen(TAG);
+ }
+ });
+ }).catch((error) => {
+ console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ await power.isScreenOn().then((data) => {
+ console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
+ status1 = data;
+ }).catch((error) => {
+ console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+
+ let wantNum = {
+ bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
+ abilityName: "MainAbility2"
+ }
+ await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
+ console.log(TAG + "startAbility data = " + JSON.stringify(data));
+ }).catch((error) => {
+ console.log(TAG + "startAbility error = " + JSON.stringify(error));
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : SUB_AA_OpenHarmony_Share_1000
+ * @tc.name : Verify the ability implicit start
+ * @tc.desc : Verify that the capability is started implicitly, and the input parameter is a nonexistent action.
+ */
+ it('SUB_AA_OpenHarmony_Share_1000', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_Share_1000 == ';
+ console.log(TAG + "begin");
+
+ let wantNum = {
+ action: "ohos.acts.aafwk.aafwk.aafwk",
+ }
+ await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
+ console.log(TAG + "startAbility data = " + JSON.stringify(data));
+ expect().assertFail();
+ done();
+ }).catch((error) => {
+ console.log(TAG + "startAbility error = " + JSON.stringify(error));
+ done();
+ })
+ })
+ })
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..0199106a56cb36899900f7a88bec678653b7565d
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json
@@ -0,0 +1,50 @@
+{
+ "module": {
+ "name": "entry",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/MyAbilityStage.ts",
+ "description": "$string:entry_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "phone"
+ ],
+ "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",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:white",
+ "visible": true,
+ "launchType": "singleton",
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..1bbc9aa9617e97c45440e1d3d66afc1154837012
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/color.json
@@ -0,0 +1,8 @@
+{
+ "color": [
+ {
+ "name": "white",
+ "value": "#FFFFFF"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..917ecd4da54d99cac4cea51deef18431f433d742
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,16 @@
+{
+ "string": [
+ {
+ "name": "entry_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "ActsOnAndOffScreenTest"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/media/icon.png differ
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..feec276e105eeb8d621c20aaf838f318b0a94150
--- /dev/null
+++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json
index 64f2b975d4e00e7b66493bb0990c565dc3b0200c..43943c705dbd0648f1ae9d0a88188ac6fd8125d5 100644
--- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json
+++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json
@@ -15,9 +15,7 @@
"FaSupportFunction.hap",
"FaSupportFunctionTwo.hap",
"FaSupportFunctionThree.hap",
- "StageSupportFunction.hap",
- "FaOnAndOffScreen.hap",
- "StageOnAndOffScreen.hap"
+ "StageSupportFunction.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
index ee6a8cd3aca8a465ebc319f06b847a29232ec060..c4ca0cb700844fa2cbcb8f9cb3ccf5e8f82f722e 100644
--- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
+++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaSetDisplayOrientation.test.ets
@@ -22,13 +22,23 @@ export default function FaSetDisplayOrientationTest() {
describe('FaSetDisplayOrientationTest', function () {
let TAG = "";
- let TAG1 = "SUB_AA_OpenHarmony == ";
+ let TAG1 = "SUB_AA_OpenHarmony == FaSetDisplayOrientationTest : ";
let sleepTimeOne = 1000;
let sleepTimeTwo = 2000;
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
afterEach(async (done) => {
console.log(TAG1 + "afterEach called");
+ let wantInfo = {
+ bundleName: "com.example.supportfunctionhaptest",
+ abilityName: "MainAbility"
+ }
+ await globalThis.abilityTestContext.startAbility(wantInfo).then((data) => {
+ console.log(TAG1 + "startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log(TAG1 + "startAbility err : " + JSON.stringify(err));
+ })
+
let cmd1 = "aa force-stop ohos.acts.aafwk.test.fasupportfunction";
let cmd2 = "aa force-stop ohos.acts.aafwk.test.fasupportfunctionthree";
@@ -67,12 +77,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0200
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0500
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Set the horizontal and vertical screen status of ability to UNSPECIFIED.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0200', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0200 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_0500', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0500 == ';
console.log(TAG + "begin");
let displayOrientationBefore = undefined;
@@ -131,12 +141,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0300
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0600
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Set the horizontal and vertical screen status of ability to LANDSCAPE.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0300', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0300 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_0600', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0600 == ';
console.log(TAG + "begin");
let displayOrientationBefore = undefined;
@@ -198,12 +208,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0400
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0700
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Set the horizontal and vertical screen status of ability to PORTRAIT.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0400', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0400 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_0700', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0700 == ';
console.log(TAG + "begin");
let displayOrientationBefore = undefined;
@@ -265,13 +275,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0500
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0800
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : The same applies to setting ability1 to LANDSCAPE, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0500', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0500 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_0800', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0800 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
@@ -349,13 +359,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0600
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0900
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : The same applies to setting ability1 to PORTRAIT, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0600', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0600 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_0900', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0900 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
@@ -433,13 +443,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0700
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1000
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different haps set ability1 to LANDSCAPE, and ability1 starts ability2 and sets the status of
ability2 to FOLLOW_RECENT.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0700', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0700 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1000', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1000 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
@@ -517,13 +527,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0800
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1100
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different haps set ability1 to PORTRAIT, and ability1 starts ability2 and sets the status of
ability2 to FOLLOW_RECENT.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0800', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0800 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1100', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1100 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
@@ -601,13 +611,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_0900
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1200
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different applications set ability1 to LANDSCAPE, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_0900', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_0900 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1200', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1200 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
@@ -685,13 +695,13 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1000
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1300
* @tc.name : Verify getDisplayOrientation and setDisplayOrientation interfaces
* @tc.desc : Different applications set ability1 to PORTRAIT, and ability1 starts ability2 and sets the status
of ability2 to FOLLOW_RECENT.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_1000', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1000 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1300', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1300 == ';
console.log(TAG + "begin");
let displayOrientationBefore1 = undefined;
@@ -773,12 +783,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1100
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1400
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is undefined.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_1100', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1100 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1400', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1400 == ';
console.log(TAG + "begin");
let status1 = undefined;
@@ -837,12 +847,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1200
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1500
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is -1.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_1200', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1200 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1500', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1500 == ';
console.log(TAG + "begin");
let status1 = undefined;
@@ -901,12 +911,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1300
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1600
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is a nonexistent enumeration value.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_1300', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1300 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1600', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1600 == ';
console.log(TAG + "begin");
let status1 = undefined;
@@ -965,12 +975,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1400
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1700
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is a value of string type.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_1400', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1400 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1700', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1700 == ';
console.log(TAG + "begin");
let status1 = undefined;
@@ -1029,12 +1039,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1500
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1800
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is of type array.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_1500', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1500 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1800', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1800 == ';
console.log(TAG + "begin");
let status1 = undefined;
@@ -1093,12 +1103,12 @@ export default function FaSetDisplayOrientationTest() {
})
/*
- * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1600
+ * @tc.number : SUB_AA_OpenHarmony_DisplayOrientation_1900
* @tc.name : Verify setDisplayOrientation interfaces
* @tc.desc : SetDisplayOrientation input parameter is of type json.
*/
- it('SUB_AA_OpenHarmony_DisplayOrientation_1600', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1600 == ';
+ it('SUB_AA_OpenHarmony_DisplayOrientation_1900', 0, async function (done) {
+ TAG = 'SUB_AA_OpenHarmony_DisplayOrientation_1900 == ';
console.log(TAG + "begin");
let status1 = undefined;
diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
index ddc89ff2a4d415771544ae7e5a8a4f44b293a0d5..ca61879ab195fc366be1bb330c6d17c6c19d9daf 100644
--- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
+++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
@@ -16,16 +16,41 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import commonEvent from '@ohos.commonEvent';
import power from '@ohos.power';
+import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function FaShowOnLockTest() {
describe('FaShowOnLockTest', function () {
let TAG = "";
- let TAG1 = "SUB_AA_OpenHarmony == ";
+ let TAG1 = "SUB_AA_OpenHarmony == FaShowOnLockTest : ";
let sleepTimeOne = 1000;
let sleepTimeTwo = 2000;
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
+ let id = undefined;
+ beforeAll(async (done) => {
+ console.log(TAG1 + "beforeAll called");
+ let myReason = 'test FaShowOnLockTest';
+ let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
+ console.log(TAG1 + "Request suspension delay will time out.");
+ })
+ id = delayInfo.requestId;
+ console.log(TAG1 + "requestId is : " + id);
+ setTimeout(function () {
+ console.log(TAG1 + "beforeAll end");
+ done();
+ }, sleepTimeOne);
+ })
+
+ afterAll(async (done) => {
+ console.log(TAG1 + "afterAll called");
+ backgroundTaskManager.cancelSuspendDelay(id);
+ setTimeout(function () {
+ console.log(TAG1 + "afterAll end");
+ done();
+ }, sleepTimeOne);
+ })
+
beforeEach(async (done) => {
console.log(TAG1 + "beforeEach called");
let status = undefined;
diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/List.test.ets
index 9408471b7130dd978a58be567d5ec53b4f2d5ba5..151b8b2773a7b7093d1663ebc3a2bbaea1309575 100644
--- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/List.test.ets
+++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/List.test.ets
@@ -15,11 +15,9 @@
import abilityIsTerminatingTest from './AbilityIsTerminating.test';
import faSetDisplayOrientation from './FaSetDisplayOrientation.test';
import faShowOnLock from './FaShowOnLock.test';
-import onAndOffScreenTest from './OnAndOffScreenTest.test';
export default function testsuite() {
abilityIsTerminatingTest();
faSetDisplayOrientation();
faShowOnLock();
- onAndOffScreenTest();
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
deleted file mode 100644
index a47a5d44d81e63ebc5c8bbda82f53bd74588d069..0000000000000000000000000000000000000000
--- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/OnAndOffScreenTest.test.ets
+++ /dev/null
@@ -1,610 +0,0 @@
-/*
- * Copyright (c) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
-import { BY,UiDriver,UiComponent } from '@ohos.uitest';
-import commonEvent from '@ohos.commonEvent';
-import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
-import power from '@ohos.power';
-
-export default function OnAndOffScreenTest() {
-
- describe('OnAndOffScreenTest', function () {
-
- let TAG = "";
- let TAG1 = "SUB_AA_OpenHarmony == ";
- let sleepTimeOne = 1000;
- let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
-
- async function slideScreen(TAG) {
- console.log(TAG + "slideScreen start");
- var driver = UiDriver.create();
- await driver.swipe(100, 100, 500, 500);
- driver.delayMs(500);
- console.log(TAG + "slideScreen end");
- }
-
- async function executeShellCommand(cmd, TAG) {
- console.log(TAG + "executeShellCommand start : " + JSON.stringify(cmd));
- await abilityDelegator.executeShellCommand(cmd).then((data) => {
- console.log(TAG + "executeShellCommand : data : " + data.stdResult);
- console.log(TAG + "executeShellCommand : data : " + data.exitCode);
- }).catch((error) => {
- console.log(TAG + "executeShellCommand error : " + JSON.stringify(error));
- })
- }
-
- beforeEach(async (done) => {
- console.log(TAG1 + "beforeEach called");
- let status = undefined;
- await power.isScreenOn().then((data) => {
- console.log(TAG1 + "isScreenOn data = " + JSON.stringify(data));
- status = data;
- }).catch((error) => {
- console.log(TAG1 + "isScreenOn error = " + JSON.stringify(error));
- })
-
- if (!status) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG1);
- await slideScreen(TAG1);
- }
-
- setTimeout(() => {
- console.log(TAG1 + "beforeEach end");
- done();
- }, sleepTimeOne);
- })
-
- afterEach(async (done) => {
- console.log(TAG1 + "afterEach called");
- let cmd1 = "aa force-stop ohos.acts.aafwk.test.faonandoffscreen";
- await executeShellCommand(cmd1, TAG);
- let cmd2 = "aa force-stop ohos.acts.aafwk.test.stageonandoffscreen";
- await executeShellCommand(cmd2, TAG);
-
- setTimeout(() => {
- console.log(TAG1 + "afterEach end");
- done();
- }, sleepTimeOne);
- })
-
- /*
- * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0100
- * @tc.name : Verify the life cycle of on / off screen ability
- * @tc.desc : FA model is applied in the foreground, and the device is locked.
- */
- it('SUB_AA_OpenHarmony_OnAndOffScreen_0100', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0100 == ';
- console.log(TAG + "begin");
-
- let status1 = undefined;
- let lifeList = [];
- let listCheck = ["onCreate", "onActive", "onInactive", "onHide"];
- let onActive = "FaOnAndOffScreen_MainAbility_onActive";
- let onHide = "FaOnAndOffScreen_MainAbility_onHide";
-
- var subscriber;
- var subscribeInfo = {
- events: [onActive, onHide]
- }
- await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
- subscriber = data;
-
- commonEvent.subscribe(subscriber, async (err, data) => {
- console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
-
- if (data.event == onActive) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- }
-
- if (data.event == onHide) {
- lifeList = data.parameters.lifeList;
- setTimeout(async () => {
- commonEvent.unsubscribe(subscriber, async (err, data) => {
- console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
- expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
- expect(status1).assertTrue();
- done();
- });
- }, sleepTimeOne);
- }
- });
- }).catch((error) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- await power.isScreenOn().then((data) => {
- console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
- status1 = data;
- }).catch((error) => {
- console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- let wantNum = {
- bundleName: "ohos.acts.aafwk.test.faonandoffscreen",
- abilityName: "ohos.acts.aafwk.test.faonandoffscreen.MainAbility"
- }
- await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
- console.log(TAG + "startAbility data = " + JSON.stringify(data));
- }).catch((error) => {
- console.log(TAG + "startAbility error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0200
- * @tc.name : Verify the life cycle of on / off screen ability
- * @tc.desc : FA model is applied in the foreground, the device locks the screen, and then unlocks.
- */
- it('SUB_AA_OpenHarmony_OnAndOffScreen_0200', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0200 == ';
- console.log(TAG + "begin");
-
- let status1 = undefined;
- let lifeList = [];
- let listCheck = ["onCreate", "onActive", "onInactive", "onHide", "onShow"];
- let onActive = "FaOnAndOffScreen_MainAbility_onActive";
- let onHide = "FaOnAndOffScreen_MainAbility_onHide";
- let onShow = "FaOnAndOffScreen_MainAbility_onShow";
-
- var subscriber;
- var subscribeInfo = {
- events: [onActive, onHide, onShow]
- }
- await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
- subscriber = data;
-
- commonEvent.subscribe(subscriber, async (err, data) => {
- console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
-
- if (data.event == onActive) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- }
-
- if (data.event == onHide) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- await slideScreen(TAG);
- }
-
- if (data.event == onShow) {
- lifeList = data.parameters.lifeList;
- setTimeout(async () => {
- commonEvent.unsubscribe(subscriber, async (err, data) => {
- console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
- expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
- expect(status1).assertTrue();
- done();
- });
- }, sleepTimeOne);
- }
- });
- }).catch((error) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- await power.isScreenOn().then((data) => {
- console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
- status1 = data;
- }).catch((error) => {
- console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- let wantNum = {
- bundleName: "ohos.acts.aafwk.test.faonandoffscreen",
- abilityName: "ohos.acts.aafwk.test.faonandoffscreen.MainAbility"
- }
- await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
- console.log(TAG + "startAbility data = " + JSON.stringify(data));
- }).catch((error) => {
- console.log(TAG + "startAbility error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0300
- * @tc.name : Verify the life cycle of on / off screen ability
- * @tc.desc : Stage model is applied in the foreground, and the device locks the screen.
- */
- it('SUB_AA_OpenHarmony_OnAndOffScreen_0300', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0300 == ';
- console.log(TAG + "begin");
-
- let status1 = undefined;
- let lifeList = [];
- let listCheck = ["onCreate", "onForeground", "onBackground"];
- let onForeground = "StageOnAndOffScreen_MainAbility_onForeground";
- let onBackground = "StageOnAndOffScreen_MainAbility_onBackground";
-
- var subscriber;
- var subscribeInfo = {
- events: [onForeground, onBackground]
- }
- await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
- subscriber = data;
-
- commonEvent.subscribe(subscriber, async (err, data) => {
- console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
-
- if (data.event == onForeground) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- }
-
- if (data.event == onBackground) {
- lifeList = data.parameters.lifeList;
- setTimeout(async () => {
- commonEvent.unsubscribe(subscriber, async (err, data) => {
- console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
- expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
- expect(status1).assertTrue();
- done();
- });
- }, sleepTimeOne);
- }
- });
- }).catch((error) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- await power.isScreenOn().then((data) => {
- console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
- status1 = data;
- }).catch((error) => {
- console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- let wantNum = {
- bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
- abilityName: "MainAbility"
- }
- await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
- console.log(TAG + "startAbility data = " + JSON.stringify(data));
- }).catch((error) => {
- console.log(TAG + "startAbility error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0400
- * @tc.name : Verify the life cycle of on / off screen ability
- * @tc.desc : The stage model is applied in the foreground, the device locks the screen, and then unlocks.
- */
- it('SUB_AA_OpenHarmony_OnAndOffScreen_0400', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0400 == ';
- console.log(TAG + "begin");
-
- let flag = false;
- let status1 = undefined;
- let lifeList = [];
- let listCheck = ["onCreate", "onForeground", "onBackground", "onForeground"];
- let onForeground = "StageOnAndOffScreen_MainAbility_onForeground";
- let onBackground = "StageOnAndOffScreen_MainAbility_onBackground";
-
- var subscriber;
- var subscribeInfo = {
- events: [onForeground, onBackground]
- }
- await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
- subscriber = data;
-
- commonEvent.subscribe(subscriber, async (err, data) => {
- console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
-
- if (data.event == onForeground && !flag) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- flag = true;
- } else if (data.event == onForeground && flag) {
- lifeList = data.parameters.lifeList;
- setTimeout(async () => {
- commonEvent.unsubscribe(subscriber, async (err, data) => {
- console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
- expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
- expect(status1).assertTrue();
- done();
- });
- }, sleepTimeOne);
- }
-
- if (data.event == onBackground) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- await slideScreen(TAG);
- }
- });
- }).catch((error) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- await power.isScreenOn().then((data) => {
- console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
- status1 = data;
- }).catch((error) => {
- console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- let wantNum = {
- bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
- abilityName: "MainAbility"
- }
- await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
- console.log(TAG + "startAbility data = " + JSON.stringify(data));
- }).catch((error) => {
- console.log(TAG + "startAbility error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0500
- * @tc.name : Verify the life cycle of on / off screen ability
- * @tc.desc : Application in the background, device lock screen.
- */
- it('SUB_AA_OpenHarmony_OnAndOffScreen_0500', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0500 == ';
- console.log(TAG + "begin");
-
- let status1 = undefined;
- let lifeList = [];
- let listCheck = ["onCreate", "onWindowStageCreate", "onForeground", "onBackground"];
- let onCreate = "StageOnAndOffScreen_MainAbility2_onCreate";
- let onWindowStageCreate = "StageOnAndOffScreen_MainAbility2_onWindowStageCreate";
- let onForeground = "StageOnAndOffScreen_MainAbility2_onForeground";
- let onBackground = "StageOnAndOffScreen_MainAbility2_onBackground";
- let onWindowStageDestroy = "StageOnAndOffScreen_MainAbility2_onWindowStageDestroy";
- let onDestroy = "StageOnAndOffScreen_MainAbility2_onDestroy";
- let onForeground2 = "StageOnAndOffScreen_MainAbility3_onForeground";
- let onBackground2 = "StageOnAndOffScreen_MainAbility3_onBackground";
-
- var subscriber;
- var subscribeInfo = {
- events: [onCreate, onWindowStageCreate, onForeground, onBackground, onWindowStageDestroy, onDestroy,
- onForeground2, onBackground2]
- }
- await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
- subscriber = data;
-
- commonEvent.subscribe(subscriber, async (err, data) => {
- console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
-
- if (data.event == onCreate) {
- lifeList.push("onCreate");
- }
-
- if (data.event == onWindowStageCreate) {
- lifeList.push("onWindowStageCreate");
- }
-
- if (data.event == onForeground) {
- lifeList.push("onForeground");
- }
-
- if (data.event == onBackground) {
- lifeList.push("onBackground");
- }
-
- if (data.event == onWindowStageDestroy) {
- lifeList.push("onWindowStageDestroy");
- }
-
- if (data.event == onDestroy) {
- lifeList.push("onDestroy");
- }
-
- if (data.event == onForeground2) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- }
-
- if (data.event == onBackground2) {
- setTimeout(async () => {
- commonEvent.unsubscribe(subscriber, async (err, data) => {
- console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
- expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
- expect(status1).assertTrue();
- done();
- });
- }, sleepTimeOne);
- }
- });
- }).catch((error) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- await power.isScreenOn().then((data) => {
- console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
- status1 = data;
- }).catch((error) => {
- console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- let wantNum = {
- bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
- abilityName: "MainAbility2"
- }
- await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
- console.log(TAG + "startAbility data = " + JSON.stringify(data));
- }).catch((error) => {
- console.log(TAG + "startAbility error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0600
- * @tc.name : Verify the life cycle of on / off screen ability
- * @tc.desc : Application in the background, device lock screen.
- */
- it('SUB_AA_OpenHarmony_OnAndOffScreen_0600', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_OnAndOffScreen_0600 == ';
- console.log(TAG + "begin");
-
- let flag = false;
- let status1 = undefined;
- let lifeList = [];
- let listCheck = ["onCreate", "onWindowStageCreate", "onForeground", "onBackground"];
- let onCreate = "StageOnAndOffScreen_MainAbility2_onCreate";
- let onWindowStageCreate = "StageOnAndOffScreen_MainAbility2_onWindowStageCreate";
- let onForeground = "StageOnAndOffScreen_MainAbility2_onForeground";
- let onBackground = "StageOnAndOffScreen_MainAbility2_onBackground";
- let onWindowStageDestroy = "StageOnAndOffScreen_MainAbility2_onWindowStageDestroy";
- let onDestroy = "StageOnAndOffScreen_MainAbility2_onDestroy";
- let onForeground2 = "StageOnAndOffScreen_MainAbility3_onForeground";
- let onBackground2 = "StageOnAndOffScreen_MainAbility3_onBackground";
-
- var subscriber;
- var subscribeInfo = {
- events: [onCreate, onWindowStageCreate, onForeground, onBackground, onWindowStageDestroy, onDestroy,
- onForeground2, onBackground2]
- }
- await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
- subscriber = data;
-
- commonEvent.subscribe(subscriber, async (err, data) => {
- console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
-
- if (data.event == onCreate) {
- lifeList.push("onCreate");
- }
-
- if (data.event == onWindowStageCreate) {
- lifeList.push("onWindowStageCreate");
- }
-
- if (data.event == onForeground) {
- lifeList.push("onForeground");
- }
-
- if (data.event == onBackground) {
- lifeList.push("onBackground");
- }
-
- if (data.event == onWindowStageDestroy) {
- lifeList.push("onWindowStageDestroy");
- }
-
- if (data.event == onDestroy) {
- lifeList.push("onDestroy");
- }
-
- if (data.event == onForeground2 && !flag) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- flag = true;
- } else if (data.event == onForeground2 && flag) {
- setTimeout(async () => {
- commonEvent.unsubscribe(subscriber, async (err, data) => {
- console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
- expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck));
- expect(status1).assertTrue();
- done();
- });
- }, sleepTimeOne);
- }
-
- if (data.event == onBackground2) {
- let cmd = "uinput -K -d 18 -u 18";
- await executeShellCommand(cmd, TAG);
- await slideScreen(TAG);
- }
- });
- }).catch((error) => {
- console.log(TAG + "createSubscriber data : " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- await power.isScreenOn().then((data) => {
- console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data));
- status1 = data;
- }).catch((error) => {
- console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
-
- let wantNum = {
- bundleName: "ohos.acts.aafwk.test.stageonandoffscreen",
- abilityName: "MainAbility2"
- }
- await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
- console.log(TAG + "startAbility data = " + JSON.stringify(data));
- }).catch((error) => {
- console.log(TAG + "startAbility error = " + JSON.stringify(error));
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number : SUB_AA_OpenHarmony_Share_1000
- * @tc.name : Verify the ability implicit start
- * @tc.desc : Verify that the capability is started implicitly, and the input parameter is a nonexistent action.
- */
- it('SUB_AA_OpenHarmony_Share_1000', 0, async function (done) {
- TAG = 'SUB_AA_OpenHarmony_Share_1000 == ';
- console.log(TAG + "begin");
-
- let wantNum = {
- action: "ohos.acts.aafwk.aafwk.aafwk",
- }
- await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
- console.log(TAG + "startAbility data = " + JSON.stringify(data));
- expect().assertFail();
- done();
- }).catch((error) => {
- console.log(TAG + "startAbility error = " + JSON.stringify(error));
- done();
- })
- })
- })
-}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json
index f81b1543a04f1b750c63ed035fc6e161102f855b..0199106a56cb36899900f7a88bec678653b7565d 100644
--- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json
+++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -22,6 +23,7 @@
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white",
"visible": true,
+ "launchType": "singleton",
"skills": [
{
"entities": [
@@ -33,6 +35,16 @@
}
]
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/config.json b/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/config.json
index c12007742965d221626122995ecb284c6dc2b0f2..f4ceb1a2582fdb5403bb91be4eb8a52e933df412 100644
--- a/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/config.json
+++ b/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/config.json
@@ -17,6 +17,7 @@
"name": ".entry",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/config.json b/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/config.json
index a4daf622f8157c47202b0aea34e46ecb214d2150..5fc9c11391f98c496c86e71cf6a09dc49c31942f 100644
--- a/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/config.json
+++ b/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/config.json
@@ -17,6 +17,7 @@
"name": ".entry",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actssupportfunction/fasupportfunction/fasupportfunctiontwo/src/main/config.json b/ability/ability_runtime/actssupportfunction/fasupportfunction/fasupportfunctiontwo/src/main/config.json
index c719b946dd9df4e8ff12c3ca12fee2fc273d6329..c7a107d402dbcd334f8b833de6b1f4eeb553e96b 100644
--- a/ability/ability_runtime/actssupportfunction/fasupportfunction/fasupportfunctiontwo/src/main/config.json
+++ b/ability/ability_runtime/actssupportfunction/fasupportfunction/fasupportfunctiontwo/src/main/config.json
@@ -17,6 +17,7 @@
"name": ".fasupportfunctiontwo",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actssupportfunction/fasupportfunctionthree/entry/src/main/config.json b/ability/ability_runtime/actssupportfunction/fasupportfunctionthree/entry/src/main/config.json
index 111d354fc3af39d023ada8235ff0b9b650c892c4..9b7734d2ec2ee177de90b8e2d1c51c88a35f562d 100644
--- a/ability/ability_runtime/actssupportfunction/fasupportfunctionthree/entry/src/main/config.json
+++ b/ability/ability_runtime/actssupportfunction/fasupportfunctionthree/entry/src/main/config.json
@@ -17,6 +17,7 @@
"name": ".entry",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actssupportfunction/stageonandoffscreen/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/stageonandoffscreen/entry/src/main/module.json
index 21fad3b21d24ad38b0d5b80defdb8b450361ba7a..f99e1263411f8b35fd0c56dad06f5c7a151937d4 100644
--- a/ability/ability_runtime/actssupportfunction/stageonandoffscreen/entry/src/main/module.json
+++ b/ability/ability_runtime/actssupportfunction/stageonandoffscreen/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json
index 193fbe2729a6be135477bc3e72d8c0956373d952..be8af7585da85bc779d10f3fe26c56a37236a9a4 100644
--- a/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json
+++ b/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json
index b6296a1c98d879e07803c83b459e7d105fca42e1..e428f5e935d5085c5ad9149a157ad737504601e7 100644
--- a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json
+++ b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json
@@ -18,6 +18,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts
index 1f59e0610a8e2d81c31b546dedcd9824ae876628..2dacb6574be66d2f68efc846b3037f365a781aca 100644
--- a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts
+++ b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/ets/ServiceAbility/service.ts
@@ -13,13 +13,13 @@
* limitations under the License.
*/
import commonEvent from "@ohos.commonEvent"
-import featureAbility from '@ohos.ability.featureAbility'
+import particleAbility from '@ohos.ability.particleAbility'
export default {
onStart() {
console.info('ServiceAbility onStart');
commonEvent.publish("ACTS_InterfaceMultiUsers_0100_Start_CommonEvent", () => {
console.log(" Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback")
- featureAbility.terminateSelf().then(() => {
+ particleAbility.terminateSelf().then(() => {
console.log('terminateSelf promise');
commonEvent.publish("ACTS_TerminateSelf_CommonEvent", () => {
console.log(" Publish ACTS_TerminateSelf_CommonEvent callback")
diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json
index 7c50780a282fac6917578612e8e8870070b881a8..0708ef68311b7a5cd563f9fcd008298b8aff8962 100644
--- a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json
+++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json
index 99b6752f5e1704f1a5d4da4837ddbf71452b2376..57dd4170d26022f09453024b8562412d4b9093ba 100644
--- a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json
+++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json
index 933db7e827ece3a4db232a4e3620b2df9e6acb15..67a16160585a8717a86fefb797ef8a32e0fd6b12 100644
--- a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json
+++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
index 2f92b8b0047c723e9a21906ebff8cb523c1be9e6..c532c04c7d9322a2dd1f04af9eabc89285e0571b 100644
--- a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/test/Ability.test.ets
@@ -16,6 +16,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
import commonEvent from '@ohos.commonEvent'
import appManager from '@ohos.application.appManager'
import osaccount from '@ohos.account.osAccount'
+import backgroundTaskManager from '@ohos.backgroundTaskManager';
var subscriberInfo_MainAbility = {
events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent","ACTS_TerminateSelf_CommonEvent"]
@@ -39,6 +40,38 @@ export default function abilityTest() {
// })
// })
// })
+
+ let id = undefined;
+ beforeAll(async (done) => {
+ console.log("ACTS_InterfaceMultiUsers beforeAll called");
+ let myReason = 'test FaShowOnLockTest';
+ let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
+ console.log("ACTS_InterfaceMultiUsers Request suspension delay will time out.");
+ })
+ id = delayInfo.requestId;
+ console.log("ACTS_InterfaceMultiUsers requestId is : " + id);
+ setTimeout(function () {
+ console.log("ACTS_InterfaceMultiUsers beforeAll end");
+ done();
+ }, 1000);
+ })
+
+ afterAll(async (done) => {
+ console.log("ACTS_InterfaceMultiUsers afterAll called");
+ backgroundTaskManager.cancelSuspendDelay(id);
+ setTimeout(function () {
+ console.log("ACTS_InterfaceMultiUsers afterAll end");
+ done();
+ }, 1000);
+ })
+
+ afterEach(async (done) => {
+ console.error("ACTS_InterfaceMultiUsers afterEach called");
+ setTimeout(function() {
+ done();
+ }, 500);
+ })
+
console.debug("====>in ACTS_InterfaceMultiUsers====>");
/*
* @tc.number : ACTS_startAbility_0100
@@ -46,24 +79,25 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options succeeded.(promise)
*/
it('ACTS_StartAbility_0100', 0, async function (done) {
+ let TAG = 'ACTS_StartAbility_0100'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
@@ -71,14 +105,14 @@ export default function abilityTest() {
}, {
windowMode:0
}).then((data)=>{
- console.debug("====>startAbility end====>");
- console.debug("====>data is====>" + JSON.stringify(data));
+ console.debug(TAG + "====>startAbility end====>");
+ console.debug(TAG + "====>data is====>" + JSON.stringify(data));
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
expect(startresult).assertEqual(true);
done();
@@ -87,7 +121,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbility_0100 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_0100 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -101,20 +135,21 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options failed.(promise)
*/
it('ACTS_StartAbility_0200', 0, async function (done) {
+ let TAG = 'ACTS_StartAbility_0200'
let Subscriber
function SubscribeCallBack (err, data) {
expect().assertFail();
- console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0200 Subscribe CallBack data:====>" + JSON.stringify(data));
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then((data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.error',
@@ -122,18 +157,18 @@ export default function abilityTest() {
}, {
windowMode:0
}).then(()=>{
- console.debug("====>startAbility end====>");
+ console.debug(TAG + "====>startAbility end====>");
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
done();
}
function timeout() {
- console.debug('ACTS_startAbility_0200 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_0200 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
@@ -146,12 +181,13 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options succeeded.(callback)
*/
it('ACTS_StartAbility_0300', 0, async function (done) {
+ let TAG = 'ACTS_StartAbility_0300'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0300 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
@@ -159,12 +195,12 @@ export default function abilityTest() {
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
@@ -172,14 +208,14 @@ export default function abilityTest() {
}, {
windowMode:0
},() => {
- console.debug("====>startAbility end====>" );
+ console.debug(TAG + "====>startAbility end====>" );
})
})
})
function UnSubscribeCallback() {
flag = false
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
expect(startresult).assertEqual(true);
done();
}
@@ -187,7 +223,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbility_0300 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_0300 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -202,21 +238,22 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options failed.(callback)
*/
it('ACTS_StartAbility_0400', 0, async function (done) {
+ let TAG = 'ACTS_StartAbility_0400'
let Subscriber
function SubscribeCallBack (err, data) {
expect().assertFail();
- console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0200 Subscribe CallBack data:====>" + JSON.stringify(data));
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
})
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.error',
@@ -224,17 +261,17 @@ export default function abilityTest() {
}, {
windowMode:0
},() => {
- console.debug("====>startAbility end====>" );
+ console.debug(TAG + "====>startAbility end====>" );
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
done();
}
function timeout() {
- console.debug('ACTS_startAbility_0400 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_0400 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
@@ -248,37 +285,38 @@ export default function abilityTest() {
* @tc.desc : Starting mainability2 with startability succeeded.(promise)
*/
it('ACTS_StartAbility_0500', 0, async function (done) {
+ let TAG = 'ACTS_StartAbility_0500'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility2'
}).then((data)=>{
- console.debug("====>startAbility end====>");
- console.debug("====>data is====>" + JSON.stringify(data));
+ console.debug(TAG + "====>startAbility end====>");
+ console.debug(TAG + "====>data is====>" + JSON.stringify(data));
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
expect(startresult).assertEqual(true);
done();
@@ -287,7 +325,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbility_0100 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_0100 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -301,12 +339,13 @@ export default function abilityTest() {
* @tc.desc : Starting mainability2 with startability succeeded.(callback)
*/
it('ACTS_StartAbility_0700', 0, async function (done) {
+ let TAG = 'ACTS_StartAbility_0700'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0300 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
@@ -314,25 +353,25 @@ export default function abilityTest() {
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility2'
},() => {
- console.debug("====>startAbility end====>" );
+ console.debug(TAG + "====>startAbility end====>" );
})
})
})
function UnSubscribeCallback() {
flag = false
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
expect(startresult).assertEqual(true);
done();
}
@@ -340,7 +379,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbility_0300 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_0300 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -355,36 +394,37 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options succeeded.(promise)
*/
it('ACTS_StartAbility_0900', 0, async function (done) {
+ let TAG = 'ACTS_StartAbility_0900'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.example.userservicesystemapi7',
abilityName: 'com.example.userservicesystemapi7.ServiceAbility'
}).then(()=>{
- console.debug("====>startAbility end====>");
+ console.debug(TAG + "====>startAbility end====>");
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
expect(startresult).assertEqual(true);
done();
@@ -393,7 +433,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbility_0900 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_0900 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -406,36 +446,37 @@ export default function abilityTest() {
* @tc.desc : Start an ability with the parameter startability with options succeeded.(promise)
*/
it('ACTS_startAbility_1000', 0, async function (done) {
+ let TAG = 'ACTS_startAbility_1000'
let Subscriber
var flag = true
var startresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"){
startresult = true
}
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.example.userservicesystemapi7',
abilityName: 'com.example.userservicesystemapi7.ServiceAbility'
},()=>{
- console.debug("====>startAbility end====>");
+ console.debug(TAG + "====>startAbility end====>");
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
expect(startresult).assertEqual(true);
done();
@@ -444,7 +485,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbility_1000 - timeout');
+ console.debug(TAG + 'ACTS_startAbility_1000 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -458,16 +499,17 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult succeeded.(promise)
*/
it('ACTS_StartAbilityForResult_0100', 0, async function (done) {
+ let TAG = 'ACTS_StartAbilityForResult_0100'
var flag = true
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('AMS_startAbilityForResult_0100 - timeout');
+ console.debug(TAG + 'AMS_startAbilityForResult_0100 - timeout');
done();
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
@@ -475,9 +517,9 @@ export default function abilityTest() {
}, {
windowMode:0
}).then((data)=>{
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
flag = false
- console.debug("====>data.resultCode is====>"+JSON);
+ console.debug(TAG + "====>data.resultCode is====>"+JSON);
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
done();
@@ -490,12 +532,13 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult failed.(promise)
*/
it('ACTS_StartAbilityForResult_0200', 0, async function (done) {
+ let TAG = 'ACTS_StartAbilityForResult_0200'
function timeout() {
- console.debug('ACTS_startAbilityForResult_0200 - timeout');
+ console.debug(TAG + 'ACTS_startAbilityForResult_0200 - timeout');
done();
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.error',
@@ -503,7 +546,7 @@ export default function abilityTest() {
}, {
windowMode:0
}).then((data)=>{
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
expect().assertFail();
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
@@ -517,16 +560,17 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult succeeded.(callback)
*/
it('ACTS_StartAbilityForResult_0300', 0, async function (done) {
+ let TAG = 'ACTS_StartAbilityForResult_0300'
var flag = true
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbilityForResult_0300 - timeout');
+ console.debug(TAG + 'ACTS_startAbilityForResult_0300 - timeout');
done();
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
@@ -534,7 +578,7 @@ export default function abilityTest() {
},{
windowMode : 0
},(err,data)=>{
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
flag = false
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
@@ -548,12 +592,13 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult failed.(callback)
*/
it('ACTS_StartAbilityForResult_0400', 0, async function (done) {
+ let TAG = 'ACTS_StartAbilityForResult_0400'
function timeout() {
- console.debug('ACTS_startAbilityForResult_0400 - timeout');
+ console.debug(TAG + 'ACTS_startAbilityForResult_0400 - timeout');
done();
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.error',
@@ -562,7 +607,7 @@ export default function abilityTest() {
windowMode:0
},(err,data)=>{
expect().assertFail();
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
done();
@@ -575,24 +620,25 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult succeeded.(promise)
*/
it('ACTS_StartAbilityForResult_0500', 0, async function (done) {
+ let TAG = 'ACTS_StartAbilityForResult_0500'
var flag = true
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('AMS_startAbilityForResult_0500 - timeout');
+ console.debug(TAG + 'AMS_startAbilityForResult_0500 - timeout');
done();
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility3',
}).then((data)=>{
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
flag = false
- console.debug("====>data.resultCode is====>"+JSON);
+ console.debug(TAG + "====>data.resultCode is====>"+JSON);
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
done();
@@ -605,22 +651,23 @@ export default function abilityTest() {
* @tc.desc : Starting mainability3 with startAbilityForResult succeeded.(callback)
*/
it('ACTS_StartAbilityForResult_0700', 0, async function (done) {
+ let TAG = 'ACTS_StartAbilityForResult_0700'
var flag = true
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_startAbilityForResult_0700 - timeout');
+ console.debug(TAG + 'ACTS_startAbilityForResult_0700 - timeout');
done();
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility3',
},(err,data)=>{
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
flag = false
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
@@ -634,38 +681,39 @@ export default function abilityTest() {
* @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(promise)
*/
it('ACTS_TerminateSelf_0100', 0, async function (done) {
+ let TAG = 'ACTS_TerminateSelf_0100'
let Subscriber
var flag = true
var terminateresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0100 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_TerminateSelf_CommonEvent"){
terminateresult = true
- console.debug("====>terminateresult is:====>" + JSON.stringify(terminateresult));
+ console.debug(TAG + "====>terminateresult is:====>" + JSON.stringify(terminateresult));
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
}
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility2'
}).then(()=>{
- console.debug("====>startAbility end====>");
+ console.debug(TAG + "====>startAbility end====>");
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
expect(terminateresult).assertEqual(true);
done();
@@ -674,7 +722,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_TerminateSelf_0100 - timeout');
+ console.debug(TAG + 'ACTS_TerminateSelf_0100 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -689,12 +737,13 @@ export default function abilityTest() {
* @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(callback)
*/
it('ACTS_TerminateSelf_0300', 0, async function (done) {
+ let TAG = 'ACTS_TerminateSelf_0300'
let Subscriber
var flag = true
var terminateresult = false
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent" || data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue();
- console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>0300 Subscribe CallBack data:====>" + JSON.stringify(data));
if(data.event == "ACTS_TerminateSelf_CommonEvent"){
terminateresult = true
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback);
@@ -703,25 +752,25 @@ export default function abilityTest() {
}
commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async(SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility2'
},() => {
- console.debug("====>startAbility end====>" );
+ console.debug(TAG + "====>startAbility end====>" );
})
})
})
function UnSubscribeCallback() {
flag = false
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
expect(terminateresult).assertEqual(true);
done();
}
@@ -729,7 +778,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_TerminateSelf_0300 - timeout');
+ console.debug(TAG + 'ACTS_TerminateSelf_0300 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -745,24 +794,25 @@ export default function abilityTest() {
* then terminateself ability and return result succeeded.(promise)
*/
it('ACTS_TerminateSelfWithResult_0100', 0, async function (done) {
+ let TAG = 'ACTS_TerminateSelfWithResult_0100'
var flag = true
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_TerminateSelfWithResult_0100 - timeout');
+ console.debug(TAG + 'ACTS_TerminateSelfWithResult_0100 - timeout');
done();
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility3',
}).then((data)=>{
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
flag = false
- console.debug("====>data.resultCode is====>"+JSON);
+ console.debug(TAG + "====>data.resultCode is====>"+JSON);
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
done();
@@ -776,23 +826,24 @@ export default function abilityTest() {
* then terminateself ability and return result succeeded.(callback)
*/
it('ACTS_TerminateSelfWithResult_0300', 0, async function (done) {
+ let TAG = 'ACTS_TerminateSelfWithResult_0300'
var flag = true
function timeout() {
if (flag == true) {
expect().assertFail();
- console.debug('ACTS_TerminateSelfWithResult_0300 - timeout');
+ console.debug(TAG + 'ACTS_TerminateSelfWithResult_0300 - timeout');
done();
}
}
setTimeout(timeout, START_ABILITY_TIMEOUT);
- console.debug("====>start startAbilityForResult====>");
+ console.debug(TAG + "====>start startAbilityForResult====>");
await globalThis.abilityContext.startAbilityForResult(
{
bundleName: 'com.acts.actsinterfacemultiuserstest',
abilityName: 'com.acts.actsinterfacemultiuserstest.MainAbility3',
},(err,data)=>{
flag = false
- console.debug("====>startAbilityForResult end====>");
+ console.debug(TAG + "====>startAbilityForResult end====>");
expect(data.resultCode).assertEqual(1)
expect(data.want.action).assertEqual('ACTION')
done();
@@ -806,28 +857,29 @@ export default function abilityTest() {
* then terminateself ability and return result failed.(promise)
*/
it('ACTS_KillProcess_0100', 0, async function (done) {
+ let TAG = 'ACTS_KillProcess_0100'
var Subscriber
var flag = true
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_KillProcess").assertTrue();
- console.debug("====>ACTS_KillProcess_0100 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>ACTS_KillProcess_0100 Subscribe CallBack data:====>" + JSON.stringify(data));
appManager.getProcessRunningInfos().then((data)=> {
- console.info('====>ACTS_KillProcess_0100 getProcessRunningInfos=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos=====>' + JSON.stringify(data))
for(var i = 0; ihas com.acts.killprocesshap=====>')
+ console.info(TAG + '====>has com.acts.killprocesshap=====>')
break
}
}
- console.log('====>i is:====>' + JSON.stringify(i))
+ console.log(TAG + '====>i is:====>' + JSON.stringify(i))
if(i==data.length && data[i].processName!='com.acts.killprocesshap'){
expect().assertFail()
}
appManager.killProcessesByBundleName('com.acts.killprocesshap').then((data)=>{
- console.info('====>ACTS_KillProcess_0100 killProcessesByBundleName=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0100 killProcessesByBundleName=====>' + JSON.stringify(data))
setTimeout(()=>{
appManager.getProcessRunningInfos().then((data)=> {
- console.info('====>ACTS_KillProcess_0100 getProcessRunningInfos2=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos2=====>' + JSON.stringify(data))
for(var i = 0; i {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.killprocesshap',
abilityName: 'com.acts.killprocesshap.MainAbility'
}).then((data)=>{
- console.debug("====>startAbility end====>");
- console.debug("====>data is====>" + JSON.stringify(data));
+ console.debug(TAG + "====>startAbility end====>");
+ console.debug(TAG + "====>data is====>" + JSON.stringify(data));
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
done();
}
@@ -866,7 +918,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_KillProcess_0100 - timeout');
+ console.debug(TAG + 'ACTS_KillProcess_0100 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -881,28 +933,29 @@ export default function abilityTest() {
* then terminateself ability and return result failed.(callback)
*/
it('ACTS_KillProcess_0200', 0, async function (done) {
+ let TAG = 'ACTS_KillProcess_0200'
var Subscriber
var flag = true
function SubscribeCallBack (err, data) {
expect(data.event == "ACTS_KillProcess").assertTrue();
- console.debug("====>ACTS_KillProcess_0200 Subscribe CallBack data:====>" + JSON.stringify(data));
+ console.debug(TAG + "====>ACTS_KillProcess_0200 Subscribe CallBack data:====>" + JSON.stringify(data));
appManager.getProcessRunningInfos().then((data)=> {
- console.info('====>ACTS_KillProcess_0200 getProcessRunningInfos=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0200 getProcessRunningInfos=====>' + JSON.stringify(data))
for(var i = 0; ihas com.acts.killprocesshap=====>')
+ console.info(TAG + '====>has com.acts.killprocesshap=====>')
break
}
}
- console.log('====>i is:====>' + JSON.stringify(i))
+ console.log(TAG + '====>i is:====>' + JSON.stringify(i))
if(i==data.length && data[i].processName!='com.acts.killprocesshap'){
expect().assertFail()
}
appManager.killProcessesByBundleName('com.acts.killprocesshap',(data)=>{
- console.info('====>ACTS_KillProcess_0200 killProcessesByBundleName=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0200 killProcessesByBundleName=====>' + JSON.stringify(data))
setTimeout(()=> {
appManager.getProcessRunningInfos().then((data) => {
- console.info('====>ACTS_KillProcess_0200 getProcessRunningInfos2=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0200 getProcessRunningInfos2=====>' + JSON.stringify(data))
for (var i = 0; i < data.length; i++) {
if (data[i].processName == 'com.acts.killprocesshap') {
expect().assertFail()
@@ -916,24 +969,24 @@ export default function abilityTest() {
})
}
commonEvent.createSubscriber(subscriberInfo_killprocess).then(async (data) => {
- console.debug("====>Create Subscriber====>");
+ console.debug(TAG + "====>Create Subscriber====>");
data.getSubscribeInfo().then(async (SubscribeInfo)=>{
- console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
+ console.debug(TAG + "====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo));
Subscriber = data;
commonEvent.subscribe(Subscriber, SubscribeCallBack);
- console.debug("====>start startAbility====>");
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.killprocesshap',
abilityName: 'com.acts.killprocesshap.MainAbility'
}).then((data)=>{
- console.debug("====>startAbility end====>");
- console.debug("====>data is====>" + JSON.stringify(data));
+ console.debug(TAG + "====>startAbility end====>");
+ console.debug(TAG + "====>data is====>" + JSON.stringify(data));
})
})
})
function UnSubscribeCallback() {
- console.debug("====>UnSubscribeCallback====>");
+ console.debug(TAG + "====>UnSubscribeCallback====>");
flag = false
done();
}
@@ -941,7 +994,7 @@ export default function abilityTest() {
function timeout() {
if(flag == true) {
expect().assertFail();
- console.debug('ACTS_KillProcess_0200 - timeout');
+ console.debug(TAG + 'ACTS_KillProcess_0200 - timeout');
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
}
}
@@ -956,24 +1009,25 @@ export default function abilityTest() {
* then terminateself ability and return result failed.(promise)
*/
it('ACTS_ThirdPartyKillProcess_0100', 0, async function (done) {
- console.debug("====>start startAbility====>");
+ let TAG = 'ACTS_ThirdPartyKillProcess_0100'
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.killprocessthirdhap',
abilityName: 'com.acts.killprocessthirdhap.MainAbility'
}).then(()=>{
- console.debug("====>startAbility end====>");
+ console.debug(TAG + "====>startAbility end====>");
})
setTimeout(()=>{
appManager.getProcessRunningInfos().then((data)=> {
- console.info('====>ACTS_KillProcess_0100 getProcessRunningInfos=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos=====>' + JSON.stringify(data))
for(var i = 0; ihas com.acts.killprocessthirdhap=====>')
+ console.info(TAG + '====>has com.acts.killprocessthirdhap=====>')
break
}
}
- console.log('====>i is:====>' + JSON.stringify(i))
+ console.log(TAG + '====>i is:====>' + JSON.stringify(i))
if(i==data.length && data[i].processName!='com.acts.killprocessthirdhap'){
expect().assertFail()
}
@@ -981,13 +1035,13 @@ export default function abilityTest() {
},1000)
setTimeout(()=> {
appManager.getProcessRunningInfos().then((data) => {
- console.info('====>ACTS_KillProcess_0100 getProcessRunningInfos2=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos2=====>' + JSON.stringify(data))
for (var i = 0; i < data.length; i++) {
if (data[i].processName == 'com.acts.killprocessthirdhap') {
break
}
}
- console.log('====>i2 is:====>' + JSON.stringify(i))
+ console.log(TAG + '====>i2 is:====>' + JSON.stringify(i))
if(i==data.length && data[i].processName!='com.acts.killprocessthirdhap'){
expect().assertFail()
}
@@ -1003,24 +1057,25 @@ export default function abilityTest() {
* then terminateself ability and return result failed.(callback)
*/
it('ACTS_ThirdPartyKillProcess_0200', 0, async function (done) {
- console.debug("====>start startAbility====>");
+ let TAG = 'ACTS_ThirdPartyKillProcess_0200'
+ console.debug(TAG + "====>start startAbility====>");
await globalThis.abilityContext.startAbility(
{
bundleName: 'com.acts.killprocessthirdhap2',
abilityName: 'com.acts.killprocessthirdhap2.MainAbility'
}).then(() => {
- console.debug("====>startAbility end====>");
+ console.debug(TAG + "====>startAbility end====>");
})
setTimeout(() => {
appManager.getProcessRunningInfos().then((data) => {
- console.info('====>ACTS_KillProcess_0100 getProcessRunningInfos=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos=====>' + JSON.stringify(data))
for (var i = 0; i < data.length; i++) {
if (data[i].processName == 'com.acts.killprocessthirdhap2') {
console.info('====>has com.acts.killprocessthirdhap2=====>')
break
}
}
- console.log('====>i is:====>' + JSON.stringify(i))
+ console.log(TAG + '====>i is:====>' + JSON.stringify(i))
if (i == data.length && data[i].processName != 'com.acts.killprocessthirdhap2') {
expect().assertFail()
}
@@ -1028,13 +1083,13 @@ export default function abilityTest() {
},1000)
setTimeout(() => {
appManager.getProcessRunningInfos().then((data) => {
- console.info('====>ACTS_KillProcess_0100 getProcessRunningInfos2=====>' + JSON.stringify(data))
+ console.info(TAG + '====>ACTS_KillProcess_0100 getProcessRunningInfos2=====>' + JSON.stringify(data))
for (var i = 0; i < data.length; i++) {
if (data[i].processName == 'com.acts.killprocessthirdhap2') {
break
}
}
- console.log('====>i2 is:====>' + JSON.stringify(i))
+ console.log(TAG + '====>i2 is:====>' + JSON.stringify(i))
if(i==data.length && data[i].processName!='com.acts.killprocessthirdhap'){
expect().assertFail()
}
diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json
index 9cae7b176dd182c1624e18a2f26b48dda690717f..91307c774d4ef37fb65e8664e8cb7abcd919b3d8 100644
--- a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json
+++ b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -114,6 +115,14 @@
{
"name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION",
"reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json
index 5688c398db78ea3bb5d87d96a86246331f88710d..c0ea26177cbd32c7bb33eacda520677fdc1ceb98 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json
index f9b841630cfded042ceeff3689be922bcc26e06b..4a7e8aec7292460fb269b36d0cc607c2e540b391 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "com.example.staticabilitystagecontext.MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json
index d9a51d0c364eb8e882e2fdcd58d464992fc42a8e..ba61d981c74230179f42dddf1f052249ad33d4cb 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "com.example.staticextensioninfotest.MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets
index d777a901cf67d23211504698eea008ed5c737c42..fddd62c18ce956f23b5ab449aa22d2136f8d2d3f 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets
@@ -376,7 +376,7 @@ export default function abilityTest() {
expect(data.labelId.length).assertLarger(0);
expect(data.icon).assertEqual("$media:icon");
expect(data.iconId.length).assertLarger(0);
- expect(data.process).assertEqual("com.example.staticextensioninfo");
+ expect(data.process).assertEqual("com.example.staticextensioninfotest");
expect(data.supportedModes).assertEqual(0);
expect(data.moduleSourceDirs.length).assertEqual(1);
expect(data.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" +
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json
index 93021963968c39cb1354f3d4514fc88c556a59a3..36fa006e12125f5f90e48d1314409b48a8a64bc6 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "com.example.staticextensioninfo.MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json
index 29f9d54c2740fd91397020f76ef336885cfdffac..dc941e9c361802fdce346514c6cc3348d090b1fc 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json
index ad3c7f20097ee1d14dffcb6bd1d5077753757723..f149ec893a65903b70233b26ad323b82f8ea721f 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json
index ac0e4ad2be8ba1dee339b5c10b40c7625b45d382..b9efba8332df03de1983000d0aa7ab6e703e00b3 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "com.example.staticinfomationquery.MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json
index e43f7f15e3df7c678a1a48f6cba6aba7c2cf89ef..3049f74f498315ed78c6d19346adf77be1edcf92 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json
index becb94d1a5146a0fe2fef38f27542b2955e9cf09..879ce108400f6dd391bda1fceebba31a45b965ea 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json
index b5a08e893aaa08480222c9cbd7c9d7e0580da5ae..e2379153ad01d1b90f7ed3ff46d1300e7477de86 100644
--- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json
+++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amsdatauriutils/BUILD.gn b/ability/ability_runtime/amsdatauriutils/BUILD.gn
index e5e4332eded15b417998331d23e94db49d666125..2b34603978fabd888994753b3029f44857d18340 100644
--- a/ability/ability_runtime/amsdatauriutils/BUILD.gn
+++ b/ability/ability_runtime/amsdatauriutils/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/amsdatauriutils/src/main/config.json b/ability/ability_runtime/amsdatauriutils/src/main/config.json
index e84e34c950cbadbe8a675d95ac57c84a48ae2402..04102ca091d759d76738a4e5fbddc13a57702f9c 100644
--- a/ability/ability_runtime/amsdatauriutils/src/main/config.json
+++ b/ability/ability_runtime/amsdatauriutils/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.amsst.amsdatauriutils",
"name": ".entry",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -113,4 +114,4 @@
"mainAbility": ".MainAbility",
"srcPath": ""
}
-}
\ No newline at end of file
+}
diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json
index 7fc559d0628b0b6a53f6b450e3d917db28e803c7..bbc0605a6981989ccc9d0adbe999b17843503b63 100644
--- a/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json
+++ b/ability/ability_runtime/amsdisplayIdtest/actsamsspecifytesthap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts
index c47793cc75426eb2dd74eeb659dd757468ac50ab..e67d5ef1ae1362462abe3dbf080e06930cb6a064 100644
--- a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts
+++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/MainAbility2/MainAbility2.ts
@@ -16,12 +16,12 @@ import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
async function onShowProcess() {
- var abilityWant = globalThis.abilityWant;
+ var abilityWant = globalThis.abilityWant2;
var commonEventPublishData = {
parameters: {
- displayId: globalThis.abilityWant.parameters['ohos.aafwk.param.displayId'],
- windowMode: globalThis.abilityWant.parameters['ohos.aafwk.param.windowMode'],
+ displayId: abilityWant.parameters['ohos.aafwk.param.displayId'],
+ windowMode: abilityWant.parameters['ohos.aafwk.param.windowMode'],
}
};
@@ -29,7 +29,7 @@ async function onShowProcess() {
commonEvent.publish("ACTS_TerminateSelf_CommonEvent", commonEventPublishData, () => {
console.log('============>querytestsecond success==========>>')
- globalThis.abilityContext.terminateSelf();
+ globalThis.abilityContext2.terminateSelf();
});
}
@@ -38,8 +38,8 @@ export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
console.log("MainAbility2 onCreate")
- globalThis.abilityWant = want;
- console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify( globalThis.abilityWant));
+ globalThis.abilityWant2 = want;
+ console.log("AbilityMultiInstanceAppA abilityWant = " + JSON.stringify( globalThis.abilityWant2));
}
onDestroy() {
@@ -50,7 +50,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("MainAbility2 onWindowStageCreate")
- globalThis.abilityContext = this.context
+ globalThis.abilityContext2 = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/second/second", null)
}
diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
index 025b140b8c7979a68f2cedceec293ce6683fe0f2..8b29a6c2db891cca32cee4c3d736d081586950af 100644
--- a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
@@ -38,7 +38,7 @@ export default class ServiceAbility extends ServiceExtension {
abilityName: 'com.example.startabilityforresult.MainAbility2'
},
{
- windowMode: 2,
+ windowMode: 0,
displayId: 10,
}).then(() => {
console.log("====>end startAbility====>success!")
diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets
index 6b0bb23c9d513aff487f19f028cfea3681f47cc8..dcdfe4b665ce0596f6c487d33828c64d1640029a 100644
--- a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/ets/test/Ability.test.ets
@@ -225,7 +225,7 @@ export default function abilityTest() {
if (data.event == "ACTS_TerminateSelf_CommonEvent") {
clearTimeout(id);
expect(data.parameters['displayId']).assertEqual(10);
- expect(data.parameters['windowMode']).assertEqual(2);
+ expect(data.parameters['windowMode']).assertEqual(0);
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
expect(data.event).assertEqual("ACTS_TerminateSelf_CommonEvent");
diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json
index e03188518a858b3cda3905fd65cc2bc754384a4f..3d001509c85b17818a56915a49c688690ee4c31d 100644
--- a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json
+++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilityforresulttest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -92,6 +93,14 @@
{
"name": "ohos.permission.GET_RUNNING_INFO",
"reason": "need use ohos.permission.GET_RUNNING_INFO"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json
index ccdf974f472223c915e5236d94b4ddffa488bb04..74bec329ee1b7e0fe6d3462197056b2cbc60ffe0 100644
--- a/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json
+++ b/ability/ability_runtime/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -73,6 +74,14 @@
{
"name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason": "need use ohos.permission.GET_RUNNING_INFO"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/amsgetabilityprocessinfo/BUILD.gn b/ability/ability_runtime/amsgetabilityprocessinfo/BUILD.gn
index 3a95dd1cfc419dd28663f3f32599617cc7eff46e..109ef2f9055e8e5830664e199167496293581f49 100644
--- a/ability/ability_runtime/amsgetabilityprocessinfo/BUILD.gn
+++ b/ability/ability_runtime/amsgetabilityprocessinfo/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn
index ed78cabf6ea490b5dd198aeece0623e03a947cc0..d814b04db06b6affae125963c16a2796a98e152e 100644
--- a/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn
+++ b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/src/main/config.json b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/src/main/config.json
index ead649de33874627ae88674db6eb0f6f5eef11bf..3c1ef301afbc0ab5b790a861d83edf8801ebdee4 100644
--- a/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/src/main/config.json
+++ b/ability/ability_runtime/amsgetabilityprocessinfo/actsgetabilityprocessinfotest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.abilityrunninginfostest",
"name": ".entry",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -137,4 +138,4 @@
"mainAbility": ".MainAbility",
"srcPath": ""
}
-}
\ No newline at end of file
+}
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/CreateFormAbility/CreateFormAbility.ts b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/CreateFormAbility/CreateFormAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..481070a0daa9da861c7451a088c1e43afe74414a
--- /dev/null
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/CreateFormAbility/CreateFormAbility.ts
@@ -0,0 +1,50 @@
+/*
+ * 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 Ability from '@ohos.application.Ability'
+export default class CreateFormAbility extends Ability {
+
+ onCreate(want, launchParam) {
+ console.log("[Demo] CreateFormAbility onCreate")
+ globalThis.abilityWant = want;
+ globalThis.applicationContext = this.context.getApplicationContext();
+ globalThis.isCreateForm = want.parameters["createForm"];
+ }
+
+ onDestroy() {
+ console.log("[Demo] CreateFormAbility onDestroy")
+ }
+
+ onWindowStageCreate(windowStage) {
+ // Main window is created, set main page for this ability
+ console.log("[Demo] CreateFormAbility onWindowStageCreate")
+ globalThis.abilityContext = this.context;
+ windowStage.setUIContent(this.context, "CreateFormAbility/pages/MainAbility_pages", null)
+ }
+
+ onWindowStageDestroy() {
+ // Main window is destroyed, release UI related resources
+ console.log("[Demo] CreateFormAbility onWindowStageDestroy")
+ }
+
+ onForeground() {
+ // Ability has brought to foreground
+ console.log("[Demo] CreateFormAbility onForeground")
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] SecondAbility onBackground")
+ }
+};
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/CreateFormAbility/pages/MainAbility_pages.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/CreateFormAbility/pages/MainAbility_pages.ets
new file mode 100644
index 0000000000000000000000000000000000000000..56d5f67e613ad670d5eaf335e5304b0bdbed6f35
--- /dev/null
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/CreateFormAbility/pages/MainAbility_pages.ets
@@ -0,0 +1,66 @@
+// @ts-nocheck
+/*
+ * 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 '@ohos.router';
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../../test/List.test'
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'CreateFormAbility'
+ @State isShowing: boolean = true;
+
+ @State formId: number = 0;
+ @State bundle: string = "com.example.apicoverhaptest";
+ @State ability: string = "FormAbility";
+ @State moduleName: string = "phone";
+ @State name: string = "form1";
+ private dimension: FormDimension = FormDimension.Dimension_2_2;
+ private temporary = false;
+
+ aboutToAppear() {
+ this.isShowing = globalThis.isCreateForm
+ }
+
+ build() {
+ Row() {
+ Column() {
+ if (this.isShowing) {
+ FormComponent({
+ id: this.formId,
+ name: this.name,
+ bundle: this.bundle,
+ ability: this.ability,
+ module: this.moduleName,
+ dimension: this.dimension,
+ temporary: this.temporary,
+ })
+ .allowUpdate(this.allowUpate)
+ .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden)
+ .onAcquired((form) => {
+ console.log("[FormComponent.host] get form, form id:" + form.id);
+ })
+ }
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormAbility/FormAbility.ts b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormAbility/FormAbility.ts
index 7c6ef8300e32e9aa59af887de858e1882850ed0b..e07c8d2677a609954848949db2d116b99e7ffbe9 100644
--- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormAbility/FormAbility.ts
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormAbility/FormAbility.ts
@@ -16,13 +16,27 @@
import FormExtension from '@ohos.application.FormExtension';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
+import commonEvent from '@ohos.commonEvent';
-var extensionInfo_config_direction
export default class FormAbility extends FormExtension {
onCreate(want) {
// Called to return a FormBindingData object.
- let formData = {};
console.info("FormAbility onCreate")
+ let formData = {
+ temperature: "11°",
+ time: "11:00",
+ area: "Shenyang"
+ };
+ console.info("FormAbility onCreate===StarAbility=== ")
+ this.context.startAbility({
+ bundleName:"com.example.apicoverhaptest",
+ abilityName:"SecondAbility"
+ }).then((data)=>{
+ console.info("FormAbility startAbility success")
+ }).catch((err)=>{
+ console.info("FormAbility startAbility failed " + err.code)
+ })
+ console.info("FormAbility onCreate===end=== ")
return formBindingData.createFormBindingData(formData);
}
@@ -49,6 +63,7 @@ export default class FormAbility extends FormExtension {
onAcquireFormState(want) {
// Called to return a {@link FormState} object.
+ console.info("FormAbility want success" + JSON.stringify(want.parameters))
return formInfo.FormState.READY;
}
};
\ No newline at end of file
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormHostAbility/FormHostAbility.ts b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormHostAbility/FormHostAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b87146f0022cc25140be23f512b2d30bd407cb49
--- /dev/null
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormHostAbility/FormHostAbility.ts
@@ -0,0 +1,50 @@
+/*
+ * 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 Ability from '@ohos.application.Ability'
+
+export default class MainAbility extends Ability {
+
+ onCreate(want, launchParam) {
+ console.log("[Demo] FormHostAbility onCreate")
+ globalThis.abilityWant = want;
+ globalThis.applicationContext = this.context.getApplicationContext();
+ }
+
+ onDestroy() {
+ console.log("[Demo] FormHostAbility onDestroy")
+ }
+
+ onWindowStageCreate(windowStage) {
+ // Main window is created, set main page for this ability
+ console.log("[Demo] FormHostAbility onWindowStageCreate")
+ globalThis.abilityContext = this.context;
+ windowStage.setUIContent(this.context, "FormHostAbility/pages/MainAbility_pages", null)
+ }
+
+ onWindowStageDestroy() {
+ // Main window is destroyed, release UI related resources
+ console.log("[Demo] FormHostAbility onWindowStageDestroy")
+ }
+
+ onForeground() {
+ // Ability has brought to foreground
+ console.log("[Demo] FormHostAbility onForeground")
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] FormHostAbility onBackground")
+ }
+};
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormHostAbility/pages/MainAbility_pages.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormHostAbility/pages/MainAbility_pages.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6d8586760af62b7b8de76f1d383acb97d319ae42
--- /dev/null
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormHostAbility/pages/MainAbility_pages.ets
@@ -0,0 +1,62 @@
+// @ts-nocheck
+/*
+ * 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 '@ohos.router';
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'FormHostAbility'
+ @State isShowing: boolean = true;
+
+ @State formId: number = 0;
+ @State bundle: string = "com.example.apicoverhaptest";
+ @State ability: string = "FormAbility";
+ @State moduleName: string = "phone";
+ @State name: string = "widget";
+ private dimension: FormDimension = FormDimension.Dimension_2_1;
+ private temporary = false;
+
+ build() {
+ Row() {
+ Column() {
+ FormComponent({
+ id: this.formId,
+ name: this.name,
+ bundle: this.bundle,
+ ability: this.ability,
+ module: this.moduleName,
+ dimension: this.dimension,
+ temporary: this.temporary,
+ })
+ .allowUpdate(this.allowUpate)
+ .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden)
+ .onAcquired((form) => {
+ console.log("[FormComponent.FormHostAbility] get form, form id:" + form.id);
+ globalThis.formId21 = form.id
+ })
+ .onError((error) => {
+ console.log("[FormComponent.FormHostAbility] error code:" + error.errcode);
+ console.log("[FormComponent.FormHostAbility] error msg:" + error.msg);
+ })
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/SecondAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5a2b21198a7510b760d93a98d453e998258aa43c
--- /dev/null
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/SecondAbility.ts
@@ -0,0 +1,58 @@
+/*
+ * 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 Ability from '@ohos.application.Ability'
+import commonEvent from '@ohos.commonEvent';
+export default class SecondAbility extends Ability {
+
+ onCreate(want, launchParam) {
+ console.log("[Demo] SecondAbility onCreate")
+ globalThis.abilityWant = want;
+ globalThis.applicationContext = this.context.getApplicationContext();
+ }
+
+ onDestroy() {
+ console.log("[Demo] SecondAbility onDestroy")
+ }
+
+ onWindowStageCreate(windowStage) {
+ // Main window is created, set main page for this ability
+ console.log("[Demo] SecondAbility onWindowStageCreate")
+ globalThis.abilityContext = this.context;
+ windowStage.setUIContent(this.context, "SecondAbility/pages/MainAbility_pages", null)
+ }
+
+ onWindowStageDestroy() {
+ // Main window is destroyed, release UI related resources
+ console.log("[Demo] SecondAbility onWindowStageDestroy")
+ }
+
+ onForeground() {
+ // Ability has brought to foreground
+ console.log("[Demo] SecondAbility onForeground")
+ var CommonEventPublishData = {
+ parameters: {
+ "Life": "onForeground"
+ }
+ }
+ commonEvent.publish("Form_StartAbility", CommonEventPublishData, (err) => {
+ console.info("Form_StartAbility onCreate");
+ });
+ }
+
+ onBackground() {
+ // Ability has back to background
+ console.log("[Demo] SecondAbility onBackground")
+ }
+};
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/pages/MainAbility_pages.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/pages/MainAbility_pages.ets
new file mode 100644
index 0000000000000000000000000000000000000000..351e255f16e266ff4d6e6252b1541f1f06aaaf52
--- /dev/null
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/pages/MainAbility_pages.ets
@@ -0,0 +1,37 @@
+// @ts-nocheck
+/*
+ * 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 '@ohos.router';
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../../test/List.test'
+
+@Entry
+@Component
+struct Index {
+ @State message: string = 'MainAbility'
+ @State create: string = 'MainAbility'
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..21e5a3e438d15227342a49dcb2778470a2f518ee
--- /dev/null
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
@@ -0,0 +1,64 @@
+/*
+ * 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 ServiceExtension from '@ohos.application.ServiceExtensionAbility'
+import commonEvent from "@ohos.commonEvent";
+import Want from '@ohos.application.Want';
+import rpc from '@ohos.rpc';
+export default class ServiceAbility extends ServiceExtension {
+ onCreate(want:Want) {
+ globalThis.abilityWant = want;
+ globalThis.serviceContext = this.context
+ let direction = this.context.config.direction
+ let pointerDervice = this.context.config.hasPointerDevice
+ let AbilityInfo = this.context.extensionAbilityInfo.bundleName
+ console.log('ServiceAbility onCreate, want: ' + want.abilityName);
+ var CommonEventPublishData = {
+ parameters: {
+ "config": direction,
+ "poniterDevices": pointerDervice,
+ "AbilityInfo":AbilityInfo
+ }
+ }
+ commonEvent.publish("ExtensionConext_StartAbility", CommonEventPublishData, (err) => {
+ console.info("ExtensionConext_StartAbility onCreate");
+ });
+ }
+
+ onRequest(want, startId) {
+ console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId);
+ console.log('ServiceAbility registerApplicationStateObserver begin');
+ setTimeout(()=>{
+ this.context.terminateSelf().then((data) => {
+ console.info("terminateSelf data = " + JSON.stringify(data));
+ }).catch((err) => {
+ console.info("terminateSelf err = " + JSON.stringify(err));
+ });
+ }, 3000)
+ }
+
+ onConnect(want) {
+ console.log('ServiceAbility onConnect, want:' + want.abilityName);
+ return null;
+ }
+
+ onDisconnect(want) {
+ console.log('ServiceAbility onDisconnect, want:' + want.abilityName);
+ }
+
+ onDestroy() {
+ console.log('ServiceAbility onDestroy');
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
index 7d18d34f735b4bf48847b4f75a7b563366aea7e9..df792a6398148298604cefced127f968584418a7 100644
--- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
@@ -17,6 +17,14 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import formProvider from '@ohos.application.formProvider';
import FormInfo from '@ohos.application.formInfo';
import formError from '@ohos.application.formError';
+import formHost from '@ohos.application.formHost';
+import errorManager from '@ohos.application.errorManager';
+import abilityConstant from '@ohos.application.AbilityConstant'
+import appManager from '@ohos.application.appManager'
+import applicationContext from '@ohos.application.context'
+import commonEvent from '@ohos.commonEvent';
+import ability from '@ohos.ability.ability'
+FormDimension
var EXTENSION_INFO_ERR = 2097152
var USERID_ERR = 2097177
var trueInfo;
@@ -24,8 +32,14 @@ var array = new Array();
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
+
export default function ApiCoverTest() {
describe('ApiCoverTestTest', function () {
+ afterEach(async (done) => {
+ setTimeout(function () {
+ done();
+ }, 2500);
+ })
/*
* @tc.number SUB_AA_ABILITY_Extension_API_001
@@ -227,19 +241,21 @@ export default function ApiCoverTest() {
expect("/data/storage/el1/bundle").assertEqual(globalThis.abilityContext.bundleCodeDir)
expect("/data/storage/el2/distributedfiles").assertEqual(globalThis.abilityContext.distributedFilesDir)
expect(1).assertEqual(globalThis.abilityContext.area)
- let moduleContext = globalThis.abilityContext.createModuleContext("module1")
+ let moduleContext = globalThis.abilityContext.createModuleContext("module1")
expect("/data/storage/el2/base/cache").assertEqual(moduleContext.cacheDir)
- globalThis.abilityContext.resourceManager.getConfiguration((err, data) => {
- if(err == undefined){
+ globalThis.abilityContext.area = 0
+ expect(0).assertEqual(globalThis.abilityContext.area)
+ globalThis.abilityContext.resourceManager.getConfiguration((err, data) => {
+ if(err == undefined){
console.log(`Ability: getConfiguration success: ${JSON.stringify(data)}`);
- console.log(`Ability: getConfiguration success: JSON.stringify(data.direction)`);
+ console.log(`Ability: getConfiguration success: JSON.stringify(data.direction)`);
expect(0).assertEqual(data.direction)
done()
- }else{
- expect().assertFail()
+ }else{
+ expect().assertFail()
done()
- }
- })
+ }
+ })
})
/*
@@ -312,15 +328,335 @@ export default function ApiCoverTest() {
expect("ohos.extra.param.key.form_dimension").assertEqual(FormInfo.FormParam.DIMENSION_KEY)
expect("ohos.extra.param.key.form_height").assertEqual(FormInfo.FormParam.HEIGHT_KEY)
expect("ohos.extra.param.key.module_name").assertEqual(FormInfo.FormParam.MODULE_NAME_KEY)
+ expect("ohos.extra.param.key.form_width").assertEqual(FormInfo.FormParam.WIDTH_KEY)
expect("ohos.extra.param.key.form_name").assertEqual(FormInfo.FormParam.NAME_KEY)
expect("ohos.extra.param.key.form_temporary").assertEqual(FormInfo.FormParam.TEMPORARY_KEY)
- expect("ohos.extra.param.key.form_width").assertEqual(FormInfo.FormParam.WIDTH_KEY)
+ expect("ohos.extra.param.key.form_identity").assertEqual(FormInfo.FormParam.IDENTITY_KEY)
+ expect("ohos.extra.param.key.bundle_name").assertEqual(FormInfo.FormParam.BUNDLE_NAME_KEY)
+ expect("ohos.extra.param.key.ability_name").assertEqual(FormInfo.FormParam.ABILITY_NAME_KEY)
expect(0).assertEqual(FormInfo.FormState.DEFAULT)
expect(1).assertEqual(FormInfo.FormState.READY)
expect(-1).assertEqual(FormInfo.FormState.UNKNOWN)
expect(0).assertEqual(FormInfo.ColorMode.MODE_DARK)
expect(1).assertEqual(FormInfo.ColorMode.MODE_LIGHT)
+ console.info("SUB_AA_Form_provider_TestFormInfo_0100:" + FormInfo.FormDimension.Dimension_2_1);
+ expect(1).assertEqual(FormInfo.FormDimension.Dimension_1_2)
+ expect(2).assertEqual(FormInfo.FormDimension.Dimension_2_2)
+ expect(3).assertEqual(FormInfo.FormDimension.Dimension_2_4)
+ expect(4).assertEqual(FormInfo.FormDimension.Dimension_4_4)
+ expect(5).assertEqual(FormInfo.FormDimension.Dimension_2_1)
done();
});
+
+ /*
+ * @tc.number SUB_AA_ReisterErrorObserver_0100
+ * @tc.name Test ReisterErrorObserver.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_ReisterErrorObserver_0100', 0, async function (done) {
+ let errorObserver:errorManager.ErrorObserver;
+ errorObserver = {
+ onUnhandledException:(errMessage) => {
+ console.info("SUB_AA_ReisterErrorObserver_0100" + JSON.stringify(errMessage));
+ }
+ }
+ let errCodeId = errorManager.registerErrorObserver(errorObserver)
+ expect(errCodeId).assertEqual(0)
+ errorManager.unregisterErrorObserver(errCodeId).then((data)=>{
+ expect(data).assertEqual(undefined)
+ done();
+ }).catch((err)=>{
+ expect().assertFail()
+ done();
+ })
+ });
+
+ /*
+ * @tc.number SUB_AA_ReisterErrorObserver_0200
+ * @tc.name Test unregisterErrorObserver with error number.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_ReisterErrorObserver_0200', 0, async function (done) {
+ errorManager.unregisterErrorObserver(-1, (err, data)=>{
+ console.info("SUB_AA_ReisterErrorObserver_0200:" + JSON.stringify(err) + " " + JSON.stringify(data));
+ console.info("SUB_AA_ReisterErrorObserver_0200:" + typeof(err.code));
+ if(err.code != 0){
+ expect(err.code).assertEqual(-2)
+ done()
+ }else{
+ expect().assertFail()
+ done();
+ }
+ })
+ });
+
+ /*
+ * @tc.number SUB_AA_Test_AbilityConstant_0100
+ * @tc.name Test abilityConstant.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_Test_AbilityConstant_0100', 0, async function (done) {
+ expect(1).assertEqual(abilityConstant.LaunchReason.START_ABILITY)
+ expect(1).assertEqual(abilityConstant.LastExitReason.ABILITY_NOT_RESPONDING)
+ expect(2).assertEqual(abilityConstant.LastExitReason.NORMAL)
+ expect(0).assertEqual(abilityConstant.MemoryLevel.MEMORY_LEVEL_MODERATE)
+ expect(1).assertEqual(abilityConstant.MemoryLevel.MEMORY_LEVEL_LOW)
+ expect(2).assertEqual(abilityConstant.MemoryLevel.MEMORY_LEVEL_CRITICAL)
+ done()
+ });
+
+ /*
+ * @tc.number SUB_AA_Test_ProcessRunningInformation_0100
+ * @tc.name Test getProcessRunningInformation in appManager.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_Test_ProcessRunningInformation_0100', 0, async function (done) {
+ let processRunningInformation:appManager.ProcessRunningInformation;
+ let process;
+ appManager.getProcessRunningInformation().then((processRunningInformations)=>{
+ console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations));
+ for(let i = 0; i < processRunningInformations.length; i++){
+ console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations[i]));
+ expect(processRunningInformations[i].pid).assertLarger(0)
+ expect(processRunningInformations[i].uid).assertLarger(0)
+ if(processRunningInformations[i].processName == "com.example.apicoverhaptest"){
+ process = processRunningInformations[i]
+ }
+ }
+ expect(process.bundleNames[0]).assertEqual("com.example.apicoverhaptest")
+ done()
+ }).catch((error)=>{
+ console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ })
+ });
+
+ /*
+ * @tc.number SUB_AA_Test_ProcessRunningInformation_0200
+ * @tc.name Test getProcessRunningInformation by callback in appManager.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_Test_ProcessRunningInformation_0200', 0, async function (done) {
+ let process;
+ appManager.getProcessRunningInformation((error, processRunningInformations)=>{
+ if(error.code == 0){
+ console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations));
+ for(let i = 0; i < processRunningInformations.length; i++){
+ console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations[i]));
+ expect(processRunningInformations[i].pid).assertLarger(0)
+ expect(processRunningInformations[i].uid).assertLarger(0)
+ if(processRunningInformations[i].processName == "com.example.apicoverhaptest"){
+ process = processRunningInformations[i]
+ }
+ }
+ expect(process.bundleNames[0]).assertEqual("com.example.apicoverhaptest")
+ done()
+ }else{
+ console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(error));
+ expect().assertFail()
+ done()
+ }
+ })
+ });
+
+ /*
+ * @tc.number SUB_AA_FMS_AbilityStage_0100
+ * @tc.name Start AbilityStage and get config.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_FMS_AbilityStage_0100', 0, async function (done) {
+ console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext))
+ console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext.config))
+ let directions = globalThis.stageContext.config.direction
+ let subscriber = null
+ let subscribeInfo = {
+ events: ["AbilityStage_StartAbility"]
+ }
+ function UnSubscribeInfoCallback(err, data) {
+ console.info("SUB_AA_FMS_AbilityStage_0100===UnSubscribeInfoCallback===")
+ done()
+ }
+ async function SubscribeInfoCallback(err, data) {
+ console.info("SUB_AA_FMS_AbilityStage_0100===SubscribeInfoCallback===" + JSON.stringify(data))
+ expect(data.parameters["config"]).assertEqual(-1)
+ expect(data.parameters["config"]).assertEqual(directions)
+ commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
+ await sleep(4000)
+ done()
+ }
+ commonEvent.createSubscriber(subscribeInfo, (err, data) => {
+ console.info("SUB_AA_FMS_AbilityStage_0100===CreateSubscriberCallback===")
+ subscriber = data
+ commonEvent.subscribe(subscriber, SubscribeInfoCallback)
+ })
+ let formWant ={
+ deviceId:"",
+ bundleName:"ohos.acts.aafwk.test.stagesupplement",
+ abilityName:"MainAbility3",
+ }
+ globalThis.abilityContext.startAbility(formWant, (err, data)=>{
+ if(err.code == 0){
+ console.info("SUB_AA_FMS_AbilityStage_0100===CreateSubscriberCallback===")
+ }else{
+ console.info("SUB_AA_FMS_AbilityStage_0100===failed===")
+ expect().assertFail()
+ done()
+ }
+ })
+ })
+
+ /*
+ * @tc.number SUB_AA_FMS_AbilityStage_0200
+ * @tc.name Start Service and get config.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_FMS_AbilityStage_0200', 0, async function (done) {
+ let subscriber = null
+ let subscribeInfo = {
+ events: ["ExtensionConext_StartAbility"]
+ }
+ function UnSubscribeInfoCallback(err, data) {
+ console.info("SUB_AA_FMS_AbilityStage_0200===UnSubscribeInfoCallback===")
+ }
+ async function SubscribeInfoCallback(err, data) {
+ console.info("SUB_AA_FMS_AbilityStage_0200===SubscribeInfoCallback===" + JSON.stringify(data))
+ console.info("SUB_AA_FMS_AbilityStage_0200===serviceContext===" + JSON.stringify(globalThis.serviceContext))
+ console.info("SUB_AA_FMS_AbilityStage_0200===config===" + JSON.stringify(globalThis.serviceContext.config))
+ expect(data.parameters["config"]).assertLess(2)
+ expect(data.parameters["poniterDevices"]).assertFalse()
+ expect(data.parameters["AbilityInfo"]).assertEqual("com.example.apicoverhaptest")
+ let direction = globalThis.serviceContext.config.direction
+ let pointerDervice = globalThis.serviceContext.config.hasPointerDevice
+ let AbilityInfo = globalThis.serviceContext.extensionAbilityInfo.bundleName
+ expect(direction).assertLess(2)
+ expect(pointerDervice).assertFalse()
+ expect(AbilityInfo).assertEqual("com.example.apicoverhaptest")
+ commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
+ await sleep(4000)
+ done()
+ }
+ commonEvent.createSubscriber(subscribeInfo, (err, data) => {
+ console.info("SUB_AA_FMS_AbilityStage_0200===CreateSubscriberCallback===")
+ subscriber = data
+ commonEvent.subscribe(subscriber, SubscribeInfoCallback)
+ })
+ let formWant ={
+ deviceId:"",
+ bundleName:"com.example.apicoverhaptest",
+ abilityName:"ServiceAbility",
+ }
+ globalThis.abilityContext.startAbility(formWant, (err, data)=>{
+ if(err.code == 0){
+ console.info("SUB_AA_FMS_AbilityStage_0200===abilityContext startAbility success===")
+ }else{
+ expect().assertFail()
+ done()
+ }
+ })
+ })
+
+ /*
+ * @tc.number SUB_AA_FMS_AcquireForm_0100
+ * @tc.name Test startAbility in FormExtensionContext.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_FMS_AcquireForm_0100', 0, async function (done) {
+ let subscriber = null
+ let formExtensionContext:applicationContext.FormExtensionContext
+ let pacMap:ability.PacMap
+ let subscribeInfo = {
+ events: ["Form_StartAbility"]
+ }
+ function UnSubscribeInfoCallback(err, data) {
+ console.info("SUB_AA_FMS_AcquireForm_0100 ===UnSubscribeInfoCallback===")
+ }
+ function SubscribeInfoCallback(err, data) {
+ console.info("SUB_AA_FMS_AcquireForm_0100 ===SubscribeInfoCallback===" + JSON.stringify(data))
+ expect(data.parameters["Life"]).assertEqual("onForeground")
+ commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
+ done()
+ }
+ commonEvent.createSubscriber(subscribeInfo, (err, data) => {
+ console.info("SUB_AA_FMS_AcquireForm_0100 ===CreateSubscriberCallback===")
+ subscriber = data
+ commonEvent.subscribe(subscriber, SubscribeInfoCallback)
+ })
+ let formWant ={
+ deviceId:"",
+ bundleName:"com.example.apicoverhaptest",
+ abilityName:"CreateFormAbility",
+ parameters:{
+ "createForm": true
+ }
+ }
+ globalThis.abilityContext.startAbility(formWant, (err, data)=>{
+ if(err.code == 0){
+ console.info("SUB_AA_FMS_AcquireForm_0100 ===acquireFormState=== " + JSON.stringify(data))
+ }else{
+ expect().assertFail()
+ done()
+ }
+ })
+ })
+
+ /*
+ * @tc.number SUB_AA_FormDisplaySpecifications_0100
+ * @tc.name Create a form and delete.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_FormDisplaySpecifications_0100', 0, async function (done) {
+ let formWant ={
+ deviceId:"",
+ bundleName:"com.example.apicoverhaptest",
+ abilityName:"FormHostAbility",
+ }
+ globalThis.abilityContext.startAbility(formWant, (err, data)=>{
+ if(err.code == 0){
+ console.info("SUB_AA_FormDisplaySpecifications_0100===abilityContext startAbility success===")
+ }else{
+ expect().assertFail()
+ done()
+ }
+ })
+ await sleep(2000)
+ console.info("SUB_AA_FormDisplaySpecifications_0100===globalThis.formId21 success===" + globalThis.formId21)
+ expect(globalThis.formId21 != undefined).assertTrue()
+ formHost.deleteForm(globalThis.formId21).then((data)=>{
+ console.info("SUB_AA_FormDisplaySpecifications_0100===deleteForm success===")
+ done()
+ }).catch((err)=>{
+ console.info("SUB_AA_FormDisplaySpecifications_0100===deleteForm failed===")
+ expect().assertFail()
+ done()
+ })
+ })
+
+ /*
+ * @tc.number SUB_AA_FormDisplaySpecifications_0200
+ * @tc.name get the form info.
+ * @tc.desc Function test
+ * @tc.level 3
+ */
+ it('SUB_AA_FormDisplaySpecifications_0200', 0, async function (done) {
+ await formHost.getFormsInfo("com.example.apicoverhaptest", "phone").then((data)=>{
+ console.info("SUB_AA_FormDisplaySpecifications_0200===deleteForm success===" + JSON.stringify(data))
+ expect(5).assertEqual(data[0].defaultDimension)
+ done()
+ }).catch((err)=>{
+ console.info("SUB_AA_FormDisplaySpecifications_0200===deleteForm failed===" + JSON.stringify(err))
+ expect().assertFail()
+ done()
+ })
+ })
})
-}
\ No newline at end of file
+}
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ContextEnvironmentTest.test.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ContextEnvironmentTest.test.ets
index 66112e138880c05906d4733024887320ade74377..fb64c64e7e3b53e93cf76ee93c39e49563f8e85c 100644
--- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ContextEnvironmentTest.test.ets
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ContextEnvironmentTest.test.ets
@@ -67,7 +67,7 @@ export default function ContextEnvironmentTest(applicationContext) {
var code = undefined
console.info(TAG + "callbackId = " + callbackId + " callNum = " + callNum)
- await sleep(1000)
+ await sleep(700)
// unregisterEnvironmentCallback
applicationContext.unregisterEnvironmentCallback(callbackId, (error, data) => {
console.info(TAG + "unregisterEnvironmentCallback first err is : " + JSON.stringify(error) + ", data is : " + JSON.stringify(data))
@@ -75,7 +75,7 @@ export default function ContextEnvironmentTest(applicationContext) {
})
- await sleep(1000)
+ await sleep(700)
expect(callbackId).assertEqual(callNum)
expect(code).assertEqual(0)
callNum++;
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/List.test.ets
index 23781d4adba7617a15f63682a4d9bfffab4ef4a7..38a460a83beb6ff912abe6f8f49b7477fdb1f3db 100644
--- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/List.test.ets
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/List.test.ets
@@ -24,4 +24,4 @@ export default function List() {
verificationTest()
wantAgentCover()
contextEnvironmentTest(globalThis.applicationContext)
-}
\ No newline at end of file
+}
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json
index 0fa974e61afec84e6edbecafe79e606dcafff7dd..98ba6b8eb10b4ea9727b5f3c149020a5ac00c19e 100644
--- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -33,6 +34,39 @@
]
}
]
+ },
+ {
+ "name": "SecondAbility",
+ "srcEntrance": "./ets/SecondAbility/SecondAbility.ts",
+ "description": "$string:phone_entry_main",
+ "icon": "$media:icon",
+ "label": "$string:entry_label",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:white",
+ "visible": true,
+ "launchType": "singleton"
+ },
+ {
+ "name": "CreateFormAbility",
+ "srcEntrance": "./ets/CreateFormAbility/CreateFormAbility.ts",
+ "description": "$string:phone_entry_main",
+ "icon": "$media:icon",
+ "label": "$string:entry_label",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:white",
+ "visible": true,
+ "launchType": "singleton"
+ },
+ {
+ "name": "FormHostAbility",
+ "srcEntrance": "./ets/FormHostAbility/FormHostAbility.ts",
+ "description": "$string:phone_entry_main",
+ "icon": "$media:icon",
+ "label": "$string:entry_label",
+ "startWindowIcon": "$media:icon",
+ "startWindowBackground": "$color:white",
+ "visible": true,
+ "launchType": "singleton"
}
],
"extensionAbilities": [
@@ -48,7 +82,32 @@
"resource": "$profile:form_config"
}
]
+ },
+ {
+ "name": "ServiceAbility",
+ "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts",
+ "label": "$string:MainAbility_label",
+ "description": "$string:MainAbility_desc",
+ "type": "service",
+ "visible": true
+ }
+ ],
+ "requestPermissions":[
+ {
+ "name":"ohos.permission.GET_RUNNING_INFO"
+ },
+ {
+ "name":"ohos.permission.REQUIRE_FORM"
+ },
+ {
+ "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
- }
\ No newline at end of file
+ }
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/form_config.json b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/form_config.json
index 146fbe1c6da88e46886838ba746afb29e69cc190..e2b5e0aaabb7f175f1f32532dd50a31bfc9ec2a4 100644
--- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/form_config.json
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/form_config.json
@@ -4,7 +4,7 @@
"isDefault": true,
"src": "./js/widget/pages/index/index",
"scheduledUpdateTime": "10:30",
- "defaultDimension": "2*2",
+ "defaultDimension": "2*1",
"name": "widget",
"description": "This is a service widget.",
"colorMode": "auto",
@@ -13,6 +13,25 @@
"autoDesignWidth": true
},
"formConfigAbility": "ability://xxxxx",
+ "supportDimensions": [
+ "2*1"
+ ],
+ "updateEnabled": true,
+ "updateDuration": 1
+ },
+ {
+ "isDefault": false,
+ "src": "./js/widget/pages/index/index",
+ "scheduledUpdateTime": "10:30",
+ "defaultDimension": "2*2",
+ "name": "form1",
+ "description": "This is a service widget.",
+ "colorMode": "auto",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": true
+ },
+ "formConfigAbility": "ability://xxxxx",
"supportDimensions": [
"2*2"
],
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/main_pages.json
index 81691245bb98976d7d8966dd406a9abd5140ef39..c8f90d45cd159400c5f4f8088715066225b9b91f 100644
--- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/main_pages.json
+++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/main_pages.json
@@ -1,5 +1,8 @@
{
"src": [
- "MainAbility/pages/MainAbility_pages"
+ "MainAbility/pages/MainAbility_pages",
+ "SecondAbility/pages/MainAbility_pages",
+ "CreateFormAbility/pages/MainAbility_pages",
+ "FormHostAbility/pages/MainAbility_pages"
]
}
\ No newline at end of file
diff --git a/ability/ability_runtime/apicover/apicoverhaptest/signature/openharmony_sx.p7b b/ability/ability_runtime/apicover/apicoverhaptest/signature/openharmony_sx.p7b
index 66b4457a8a81fb8d3356cf46d67226c850944858..6c7c8e29e3c4a1f8d0419932ebc28f665e4ae974 100644
Binary files a/ability/ability_runtime/apicover/apicoverhaptest/signature/openharmony_sx.p7b and b/ability/ability_runtime/apicover/apicoverhaptest/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/apicover/fasupplement/entry/src/main/config.json b/ability/ability_runtime/apicover/fasupplement/entry/src/main/config.json
index f6a8619c1fb69e60eead2ac7cb113628a8a2dbb2..33a1c2ad616740876b7974505655df1f993e8106 100644
--- a/ability/ability_runtime/apicover/fasupplement/entry/src/main/config.json
+++ b/ability/ability_runtime/apicover/fasupplement/entry/src/main/config.json
@@ -15,6 +15,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"abilities": [
diff --git a/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/FormAbility/FormAbility.ts b/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/FormAbility/FormAbility.ts
index d29f2942dbf56b979a920147b58852bb7a9e58fa..22f718baed7541652ed99894fbc0e018f152be53 100644
--- a/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/FormAbility/FormAbility.ts
+++ b/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/FormAbility/FormAbility.ts
@@ -5,7 +5,9 @@ import formInfo from '@ohos.application.formInfo';
export default class FormModuleAbility extends FormExtension {
onCreate(want) {
// Called to return a FormBindingData object.
- let formData = {};
+ console.info("FormAbility onCreate")
+ let formData = {
+ };
return formBindingData.createFormBindingData(formData);
}
diff --git a/ability/ability_runtime/apicover/formmodule/entry/src/main/module.json b/ability/ability_runtime/apicover/formmodule/entry/src/main/module.json
index 0f4f9038601384276a81fcb000cf54c49d2b9394..71ed0df91b00fe3610e97bccdc50a0502eceb360 100644
--- a/ability/ability_runtime/apicover/formmodule/entry/src/main/module.json
+++ b/ability/ability_runtime/apicover/formmodule/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:module1_desc",
"mainElement": "ModuleAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -36,7 +37,7 @@
],
"extensionAbilities": [
{
- "name": "FormAbility",
+ "name": "FormAbility2",
"srcEntrance": "./ets/FormAbility/FormAbility.ts",
"label": "$string:form_FormAbility_label",
"description": "$string:form_FormAbility_desc",
diff --git a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/Application/AbilityStage.ts
index 45aaf28a4ff72e191b47bf46a421ab11a1cc4d05..d8f2468920ab67540f4c3adad5b50bb982c39bb4 100644
--- a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/Application/AbilityStage.ts
+++ b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/Application/AbilityStage.ts
@@ -1,7 +1,16 @@
import AbilityStage from "@ohos.application.AbilityStage"
-
+import commonEvent from '@ohos.commonEvent';
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("[Demo] MyAbilityStage onCreate")
+ let directions = this.context.config.direction
+ var CommonEventPublishData = {
+ parameters: {
+ "config": directions
+ }
+ }
+ commonEvent.publish("AbilityStage_StartAbility", CommonEventPublishData, (err) => {
+ console.info("AbilityStage_StartAbility onCreate");
+ });
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json
index 08e99a06afd00a0edd7174f180304a5718f7c882..a73bebfec0cc42174e20c62d1ac6609d19f3bb17 100644
--- a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json
+++ b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts
index a8a08f6192e94a154c7880cf9a00de826c52da52..f182429412cd553f67162311b079a60ff71d902c 100644
--- a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts
+++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility2/MainAbility2.ts
@@ -17,14 +17,14 @@ import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() {
console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0100_Event====>");
setTimeout(()=>{
- globalThis.abilityContext.terminateSelf();
+ globalThis.abilityContextMainAbility2.terminateSelf();
console.debug("====>MainAbility2 terminateSelf succese====>")
- },2000)
+ },5000)
}
export default class MainAbility2 extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility2 onCreate")
- globalThis.abilityContext = this.context
+ globalThis.abilityContextMainAbility2 = this.context
}
onDestroy() {
@@ -36,6 +36,13 @@ export default class MainAbility2 extends Ability {
console.log("[Demo] MainAbility2 onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null)
+ windowStage.on('windowStageEvent', (data)=>{
+ if(data == 2){
+ setTimeout(()=>{
+ commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
+ }, 2000)
+ }
+ })
}
onWindowStageDestroy() {
@@ -46,7 +53,6 @@ export default class MainAbility2 extends Ability {
onForeground() {
// Ability has brought to foreground
console.log("[Demo] MainAbility2 onForeground")
- commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
}
onBackground() {
diff --git a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts
index 5860a5aa56a834c2869091efe1b12d085c09bea8..077b6fa9ef84bc8c243e47d99f2fde6eccc2657b 100644
--- a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts
+++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility3/MainAbility3.ts
@@ -16,14 +16,14 @@ import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() {
console.debug("====>Publish CallBack ACTS_DoAbilityForeground_0300_Event====>");
- globalThis.abilityContext.terminateSelf().then(()=>{
+ globalThis.abilityContextMainAbility3.terminateSelf().then(()=>{
console.debug("====>MainAbility3 terminateSelf====>");
});
}
export default class MainAbility3 extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility3 onCreate")
- globalThis.abilityContext = this.context
+ globalThis.abilityContextMainAbility3 = this.context
}
onDestroy() {
diff --git a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility5/MainAbility5.ts b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility5/MainAbility5.ts
index d95cbac070cd2a39eae21723f745664627a6b8b9..e199b01c89d907714dad64910e9876b058266679 100644
--- a/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility5/MainAbility5.ts
+++ b/ability/ability_runtime/apitest/entry/src/main/ets/MainAbility5/MainAbility5.ts
@@ -20,7 +20,7 @@ function PublishCallBackOne() {
export default class MainAbility5 extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility5 onCreate")
- globalThis.abilityContext = this.context
+ globalThis.abilityContextMainAility5 = this.context
setTimeout(()=> {
commonEvent.publish("ACTS_DoAbility_Event", PublishCallBackOne);
}, 500)
diff --git a/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets
index 56cbdcd7e7ba8142de8d5b1accd1fc4b8d6658b2..90f359d406d5d30ef813b41526a40ca407bfab01 100644
--- a/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/apitest/entry/src/main/ets/test/Ability.test.ets
@@ -19,7 +19,7 @@ var subscriberInfo_MainAbility = {
events: ["ACTS_DoAbility_Event"]
};
var mainability
-const START_ABILITY_TIMEOUT = 4000;
+const START_ABILITY_TIMEOUT = 10000;
const START_ABILITY_TIMEOUT_TWO_THOUSAND = 2000;
const START_ABILITY_TIMEOUT_THOUSAND = 1000;
export default function abilityTest() {
diff --git a/ability/ability_runtime/apitest/entry/src/main/module.json b/ability/ability_runtime/apitest/entry/src/main/module.json
index 6bae42d73033f74fe59824f0bdec3bd6e92d8486..60910719a2b1c50de5de954bbd271351aa480476 100644
--- a/ability/ability_runtime/apitest/entry/src/main/module.json
+++ b/ability/ability_runtime/apitest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -61,6 +62,12 @@
"icon": "$media:icon",
"label": "$string:MainAbility5_label"
}
+ ],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ }
]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/BUILD.gn b/ability/ability_runtime/context/BUILD.gn
index 5c1dee281f9c533274abe3c18d6baaa2b4789119..6c4935d9fc2bfcbbd1def7eefce08624a0fa63d9 100644
--- a/ability/ability_runtime/context/BUILD.gn
+++ b/ability/ability_runtime/context/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
@@ -18,6 +18,9 @@ group("context") {
if (is_standard_system) {
deps = [
"actscontexttest:ActsContextTest",
+ "actscreatemodulecontextassist:ActsCreateModuleContextAssist",
+ "actscreatemodulecontextassistone:ActsCreateModuleContextAssistOne",
+ "actscreatemodulecontexttest:ActsCreateModuleContextTest",
"scene/defpermission:DefPermission",
]
}
diff --git a/ability/ability_runtime/context/actscontexttest/BUILD.gn b/ability/ability_runtime/context/actscontexttest/BUILD.gn
index bc20877b258d188317605657eb2bcaf015fdb560..030c902a77fc35a9f985fe362722dbe840e9d751 100644
--- a/ability/ability_runtime/context/actscontexttest/BUILD.gn
+++ b/ability/ability_runtime/context/actscontexttest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/context/actscontexttest/src/main/config.json b/ability/ability_runtime/context/actscontexttest/src/main/config.json
index 217133b3dc795dfc44a6e0647d56a4c6ee09ccb4..8fbe3749cea0210d4a57f947762c85e178b9d5af 100644
--- a/ability/ability_runtime/context/actscontexttest/src/main/config.json
+++ b/ability/ability_runtime/context/actscontexttest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actscontext",
"name": ".entry",
"deviceType": [
+ "default",
"phone"
],
"reqPermissions": [
diff --git a/ability/ability_runtime/context/actscontexttest/src/main/js/test/ContextJsunit.test.js b/ability/ability_runtime/context/actscontexttest/src/main/js/test/ContextJsunit.test.js
index 91dc94f500d64acb7b2456558741a9147572120a..9bf9d107f548de3b5ca2e2e1a931808c3287ee8e 100644
--- a/ability/ability_runtime/context/actscontexttest/src/main/js/test/ContextJsunit.test.js
+++ b/ability/ability_runtime/context/actscontexttest/src/main/js/test/ContextJsunit.test.js
@@ -57,7 +57,6 @@ describe('ActsContextTest', function () {
var context = featureAbility.getContext();
var info = context.getBundleName(
(err, data) => {
- expect(err.code).assertEqual(0);
expect(data).assertEqual('com.example.actscontext');
ret = true
done();
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/app.json b/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..fdb2973d57fa29e7ac012eaf58685358bddb02fa
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.createmodulecontexttest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/resources/base/element/string.json b/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..7a1e60df49d818c68d318759bfab1d84ea794c50
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AACommandPrintSyncTest"
+ }
+ ]
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontextassist/AppScope/resources/base/media/app_icon.png differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/BUILD.gn b/ability/ability_runtime/context/actscreatemodulecontextassist/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..f03025b0897b89a17fb64ef7f5570d821e0b4849
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsCreateModuleContextAssist") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":createmodulecontext_js_assets",
+ ":createmodulecontext_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsCreateModuleContextAssist"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("createmodulecontext_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("createmodulecontext_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("createmodulecontext_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":createmodulecontext_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5073f074333769e258d7b97d27aa750302f91fbe
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2f1389c76e39a641715b88eb6163d50366ceb508
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,45 @@
+/*
+* 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 {
+ async onCreate(want, launchParam) {
+ globalThis.abilityContext = this.context;
+ console.log('MainAbility onCreate')
+ }
+
+ onDestroy() {
+ console.log('MainAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('MainAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'pages/index', null)
+
+ }
+
+ onWindowStageDestroy() {
+ console.log('MainAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('MainAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('MainAbility onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..83cc6acd855717c6f038570f27469d87775999ff
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,44 @@
+/*
+* 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)
+ 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
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/module.json b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..bf04793757bacffca561c517bc3fb7cd56c8d628
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "feature",
+ "type": "feature",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..a3b7f1a4253e2cbc68577cdc1f00e891f82ac432
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandPrintSyncTest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/media/icon.png differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassist/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassist/signature/openharmony_sx.p7b b/ability/ability_runtime/context/actscreatemodulecontextassist/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontextassist/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/app.json b/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..c89708540211aeb93bdccca563d594b1123c6fe8
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.createmodulecontextassistone",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/resources/base/element/string.json b/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..7a1e60df49d818c68d318759bfab1d84ea794c50
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AACommandPrintSyncTest"
+ }
+ ]
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontextassistone/AppScope/resources/base/media/app_icon.png differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/BUILD.gn b/ability/ability_runtime/context/actscreatemodulecontextassistone/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..beeb1fadb1fda63d6106ac1f1fd54587adf0dfea
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/BUILD.gn
@@ -0,0 +1,43 @@
+# Copyright (c) 2022 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//test/xts/tools/build/suite.gni")
+
+ohos_hap_assist_suite("ActsCreateModuleContextAssistOne") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":createmodulecontext_js_assets",
+ ":createmodulecontext_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsCreateModuleContextAssistOne"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("createmodulecontext_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("createmodulecontext_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("createmodulecontext_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":createmodulecontext_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5073f074333769e258d7b97d27aa750302f91fbe
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,22 @@
+/*
+* 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
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2f1389c76e39a641715b88eb6163d50366ceb508
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,45 @@
+/*
+* 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 {
+ async onCreate(want, launchParam) {
+ globalThis.abilityContext = this.context;
+ console.log('MainAbility onCreate')
+ }
+
+ onDestroy() {
+ console.log('MainAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('MainAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'pages/index', null)
+
+ }
+
+ onWindowStageDestroy() {
+ console.log('MainAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('MainAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('MainAbility onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..83cc6acd855717c6f038570f27469d87775999ff
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,44 @@
+/*
+* 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)
+ 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
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/module.json b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..4cf1d5c2386db1b13131232f1cb58e87a83ac01f
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "entry_assist",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..a3b7f1a4253e2cbc68577cdc1f00e891f82ac432
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandPrintSyncTest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/media/icon.png differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontextassistone/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontextassistone/signature/openharmony_sx.p7b b/ability/ability_runtime/context/actscreatemodulecontextassistone/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontextassistone/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/app.json b/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..fdb2973d57fa29e7ac012eaf58685358bddb02fa
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.createmodulecontexttest",
+ "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
+ }
+ }
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/resources/base/element/string.json b/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..7a1e60df49d818c68d318759bfab1d84ea794c50
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "AACommandPrintSyncTest"
+ }
+ ]
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontexttest/AppScope/resources/base/media/app_icon.png differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/BUILD.gn b/ability/ability_runtime/context/actscreatemodulecontexttest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..e244c407cf93e4840649bdc95132601ec6a27a28
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/BUILD.gn
@@ -0,0 +1,43 @@
+# 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("ActsCreateModuleContextTest") {
+ hap_profile = "entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":createmodulecontext_js_assets",
+ ":createmodulecontext_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsCreateModuleContextTest"
+ subsystem_name = "ability"
+ part_name = "ability_runtime"
+}
+
+ohos_app_scope("createmodulecontext_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("createmodulecontext_js_assets") {
+ source_dir = "entry/src/main/ets"
+}
+
+ohos_resources("createmodulecontext_resources") {
+ sources = [ "entry/src/main/resources" ]
+ deps = [ ":createmodulecontext_app_profile" ]
+ hap_profile = "entry/src/main/module.json"
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/Test.json b/ability/ability_runtime/context/actscreatemodulecontexttest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..d6f74daa1268a2b46bdac93bdff79a7770882d94
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/Test.json
@@ -0,0 +1,21 @@
+{
+ "description": "Configuration for aceceshi Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.example.createmodulecontexttest",
+ "module-name": "entry_test",
+ "shell-timeout": "600000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsCreateModuleContextTest.hap",
+ "ActsCreateModuleContextAssist.hap",
+ "ActsCreateModuleContextAssistOne.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2b1035b73f5f61109e5ce372b42bebd105bb68d3
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,23 @@
+/*
+* 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")
+ globalThis.abilityStageContext = this.context
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..07eefcc2c8f98aa12043bb97840478e7f980b9c8
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,51 @@
+/*
+* 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'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
+
+export default class MainAbility extends Ability {
+ async onCreate(want, launchParam) {
+ globalThis.abilityContext = this.context;
+ console.log('MainAbility onCreate')
+ let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ let abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ }
+
+ onDestroy() {
+ console.log('MainAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('MainAbility onWindowStageCreate')
+ windowStage.setUIContent(this.context, 'pages/index', null)
+
+ }
+
+ onWindowStageDestroy() {
+ console.log('MainAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('MainAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('MainAbility onBackground')
+ }
+};
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1762cda6dd8f03996989e42dfeb364161e91c0b7
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2022 Huawei Device Co., Ltd.
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import TestRunner from '@ohos.application.testRunner'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+var abilityDelegator = undefined
+var abilityDelegatorArguments = undefined
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s it',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s dryRun'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ targetParams = `${targetParams} ${key} ${parameters[key]}`
+ }
+ }
+ return targetParams.trim()
+}
+
+async function onAbilityCreateCallback() {
+ console.log("onAbilityCreateCallback");
+}
+
+async function addAbilityMonitorCallback(err: any) {
+ console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
+}
+
+export default class OpenHarmonyTestRunner implements TestRunner {
+ constructor() {
+ }
+
+ onPrepare() {
+ console.info("OpenHarmonyTestRunner OnPrepare ")
+ }
+
+ async onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ globalThis.abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var MainAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
+ let lMonitor = {
+ abilityName: MainAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a 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
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..83cc6acd855717c6f038570f27469d87775999ff
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/pages/index.ets
@@ -0,0 +1,44 @@
+/*
+* 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)
+ 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
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/CreateModuleContext.test.ets b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/CreateModuleContext.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c7fdf38b3b58e230bcd111147d48b35590a6b4fa
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/CreateModuleContext.test.ets
@@ -0,0 +1,197 @@
+/*
+ * 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, it, expect } from "@ohos/hypium";
+
+let createModuleContext: any;
+let bundleName: any;
+
+export default function actsCreateModuleContextTest() {
+ describe("CreateModuleContext", function () {
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0100
+ * @tc.name: AbilityContext calls createModuleContext, passing in the moduleName of
+ * the current application hap1
+ * @tc.desc: Verify that the context of the application can be obtained
+ * @tc.level: 1
+ */
+ it("SUB_AA_CreateModuleContext_0100", 0, async function (done) {
+ console.info("SUB_AA_AbilityStage_0100 begin");
+
+ createModuleContext =
+ globalThis.abilityContext.createModuleContext("entry_test");
+
+ bundleName = createModuleContext.applicationInfo.name;
+
+ expect(bundleName).assertEqual("com.example.createmodulecontexttest");
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0200
+ * @tc.name: AbilityContext calls createModuleContext, passing in the moduleName of
+ * the current application hap2
+ * @tc.desc: Verify that the context of the application can be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0200", 0, async function (done) {
+ console.log("SUB_AA_AbilityStage_0100 begin");
+
+ createModuleContext =
+ globalThis.abilityContext.createModuleContext("feature");
+
+ bundleName = createModuleContext.applicationInfo.name;
+
+ expect(bundleName).assertEqual("com.example.createmodulecontexttest");
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0300
+ * @tc.name: AbilityContext calls createModuleContext, passing in the moduleName of
+ * the cross-application hap1
+ * @tc.desc: Verify that the context of the application can not be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0300", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_0300 begin");
+
+ createModuleContext =
+ globalThis.abilityContext.createModuleContext("entry_assist");
+
+ expect(createModuleContext).assertUndefined();
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0400
+ * @tc.name: AbilityContext calls createModuleContext, passing in a non-existing moduleName
+ * @tc.desc: Verify that the context of the application can not be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0400", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_0400 begin");
+
+ createModuleContext =
+ globalThis.abilityContext.createModuleContext("abc");
+
+ expect(createModuleContext).assertUndefined();
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0500
+ * @tc.name: AbilityContext calls createModuleContext, and the incoming moduleName is undefined
+ * @tc.desc: Verify that the context of the application can not be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0500", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_0500 begin");
+
+ createModuleContext =
+ globalThis.abilityContext.createModuleContext(undefined);
+
+ expect(createModuleContext).assertUndefined();
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0600
+ * @tc.name: AbilityStageContext calls createModuleContext, passing in the moduleName of
+ * the current application hap1
+ * @tc.desc: Verify that the context of the application can be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0600", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_0600 begin");
+
+ createModuleContext =
+ globalThis.abilityStageContext.createModuleContext("entry_test");
+
+ bundleName = createModuleContext.applicationInfo.name;
+
+ expect(bundleName).assertEqual("com.example.createmodulecontexttest");
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0700
+ * @tc.name: AbilityStageContext calls createModuleContext, passing in the moduleName of
+ * the current application hap2
+ * @tc.desc: Verify that the context of the application can be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0700", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_0700 begin");
+
+ createModuleContext =
+ globalThis.abilityStageContext.createModuleContext("feature");
+
+ bundleName = createModuleContext.applicationInfo.name;
+
+ expect(bundleName).assertEqual("com.example.createmodulecontexttest");
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0800
+ * @tc.name: AbilityStageContext calls createModuleContext, passing in the moduleName of
+ * the cross-application hap1
+ * @tc.desc: Verify that the context of the application can not be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0800", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_0800 begin");
+
+ createModuleContext =
+ globalThis.abilityContext.createModuleContext("entry_assist");
+
+ expect(createModuleContext).assertUndefined();
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_0900
+ * @tc.name: AbilityStageContext calls createModuleContext, passing in a non-existing moduleName
+ * @tc.desc: Verify that the context of the application can not be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_0900", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_0900 begin");
+
+ createModuleContext =
+ globalThis.abilityContext.createModuleContext("createmodue");
+
+ expect(createModuleContext).assertUndefined();
+ done();
+ });
+
+ /**
+ * @tc.number: SUB_AA_CreateModuleContext_1000
+ * @tc.name: AbilityStageContext calls createModuleContext, and the incoming moduleName is undefined
+ * @tc.desc: Verify that the context of the application can not be obtained
+ * @tc.level: 3
+ */
+ it("SUB_AA_CreateModuleContext_1000", 0, async function (done) {
+ console.info("SUB_AA_CreateModuleContext_1000 begin");
+
+ createModuleContext =
+ globalThis.abilityStageContext.createModuleContext(undefined);
+
+ expect(createModuleContext).assertUndefined();
+ done();
+ });
+ });
+}
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ffe188ed88a460e4448caa363b820cddaac19c60
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,20 @@
+/*
+* 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 actsCreateModuleContextTest from './CreateModuleContext.test'
+
+export default function testsuite() {
+ actsCreateModuleContextTest()
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/module.json b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..95e1457d4fe3581d6061986bb18322d9884e053d
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/module.json
@@ -0,0 +1,38 @@
+{
+ "module": {
+ "name": "entry_test",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:entry_test_desc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "phone",
+ "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,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..a3b7f1a4253e2cbc68577cdc1f00e891f82ac432
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,24 @@
+{
+ "string": [
+ {
+ "name": "entry_test_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "label"
+ },
+ {
+ "name": "app_name",
+ "value": "AACommandPrintSyncTest"
+ },
+ {
+ "name": "description_application",
+ "value": "demo for test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/media/icon.png differ
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..e291133c8b3c329611da5af30c299ec10589c7c2
--- /dev/null
+++ b/ability/ability_runtime/context/actscreatemodulecontexttest/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "pages/index"
+ ]
+}
\ No newline at end of file
diff --git a/ability/ability_runtime/context/actscreatemodulecontexttest/signature/openharmony_sx.p7b b/ability/ability_runtime/context/actscreatemodulecontexttest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..66b4457a8a81fb8d3356cf46d67226c850944858
Binary files /dev/null and b/ability/ability_runtime/context/actscreatemodulecontexttest/signature/openharmony_sx.p7b differ
diff --git a/ability/ability_runtime/context/scene/defpermission/src/main/config.json b/ability/ability_runtime/context/scene/defpermission/src/main/config.json
index ae380a7bb5683516aea308784e6e1e3e7f743bca..39b19be80835156388491ee336f13eab40facbad 100644
--- a/ability/ability_runtime/context/scene/defpermission/src/main/config.json
+++ b/ability/ability_runtime/context/scene/defpermission/src/main/config.json
@@ -29,6 +29,7 @@
}
],
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/fa/BUILD.gn b/ability/ability_runtime/fa/BUILD.gn
index b3f1f376060514f0d63acf506fc81dabb13dc444..f75ceef5a8bad76dae0eb4baf6e2884c612ae364 100644
--- a/ability/ability_runtime/fa/BUILD.gn
+++ b/ability/ability_runtime/fa/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/fa/faapplicationinfo/BUILD.gn b/ability/ability_runtime/fa/faapplicationinfo/BUILD.gn
index 739455fe5b35678a3438eb5282d56c1b44c04010..c1baca59d063f934138d39808d99cc702cae41f7 100644
--- a/ability/ability_runtime/fa/faapplicationinfo/BUILD.gn
+++ b/ability/ability_runtime/fa/faapplicationinfo/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/fa/faapplicationinfo/src/main/config.json b/ability/ability_runtime/fa/faapplicationinfo/src/main/config.json
index ca9fcbc92d5e990c2e928fa02f0903b37fd0d01a..9e2475886573b77c339f00b3f05117e5219a5142 100644
--- a/ability/ability_runtime/fa/faapplicationinfo/src/main/config.json
+++ b/ability/ability_runtime/fa/faapplicationinfo/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -112,6 +113,12 @@
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
- }
+ },
+ "reqPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ }
+ ]
}
}
\ No newline at end of file
diff --git a/ability/ability_runtime/fa/faconfigurationconstant/BUILD.gn b/ability/ability_runtime/fa/faconfigurationconstant/BUILD.gn
index bc41908a05078a7cd46c4cfd78b1cb252b1c5b99..a23eabb6f211d4ff3175b6a1d558705806dd0737 100644
--- a/ability/ability_runtime/fa/faconfigurationconstant/BUILD.gn
+++ b/ability/ability_runtime/fa/faconfigurationconstant/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/fa/faconfigurationconstant/src/main/config.json b/ability/ability_runtime/fa/faconfigurationconstant/src/main/config.json
index cdb4103c7fa80444e170cac2e9664a5867d9a829..8e835a50d0efd712d04722f5be2338991df70518 100644
--- a/ability/ability_runtime/fa/faconfigurationconstant/src/main/config.json
+++ b/ability/ability_runtime/fa/faconfigurationconstant/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/fa/facoverapi/BUILD.gn b/ability/ability_runtime/fa/facoverapi/BUILD.gn
index 14be9fb81f15f0f222ef5fe36f0de87db7901335..d7db8319fe6aed2285dd4263e51255377a2b6377 100644
--- a/ability/ability_runtime/fa/facoverapi/BUILD.gn
+++ b/ability/ability_runtime/fa/facoverapi/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/fa/facoverapi/src/main/config.json b/ability/ability_runtime/fa/facoverapi/src/main/config.json
index 75024e946ddf9c48258ff2a6a34989029d6cb36e..ec09e45c5cdccae19caaa08734958dac57cc2a75 100644
--- a/ability/ability_runtime/fa/facoverapi/src/main/config.json
+++ b/ability/ability_runtime/fa/facoverapi/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.coverapi",
"name": ".entry",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/fa/faequeryabilitybywant/BUILD.gn b/ability/ability_runtime/fa/faequeryabilitybywant/BUILD.gn
index bbbb3349132ef2f4ec96f07cab45fd5909532548..de29af9b022c59d27c51d8712122184058084902 100644
--- a/ability/ability_runtime/fa/faequeryabilitybywant/BUILD.gn
+++ b/ability/ability_runtime/fa/faequeryabilitybywant/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/fa/faequeryabilitybywant/src/main/config.json b/ability/ability_runtime/fa/faequeryabilitybywant/src/main/config.json
index 76a9cc02fc16ef84e7b4113156645d902f539d3a..86d4a969a41025e84b08be14c1cf6296af9213cf 100644
--- a/ability/ability_runtime/fa/faequeryabilitybywant/src/main/config.json
+++ b/ability/ability_runtime/fa/faequeryabilitybywant/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json b/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json
index 3f38dd44604ebb86e9efc93093b255bd9faea90f..feb6433a3bd1105801c729df316ac922466f81a3 100644
--- a/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json
+++ b/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json
@@ -5,7 +5,8 @@
"test-timeout": "600000",
"bundle-name": "com.example.faapicoverhaptest",
"package-name": "com.example.faapicoverhaptest",
- "shell-timeout": "600000"
+ "shell-timeout": "600000",
+ "testcase-timeout": 70000
},
"kits": [
{
diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json
index 378a138d5e422f7d931eac414e418db8a4aab215..46f6b42787ae26ec132afd4f3bc27cdc04805ed2 100644
--- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json
+++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/config.json
@@ -15,6 +15,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"default",
"tablet"
],
diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
index e3a6d8b9279a3da0c22072032e3d9d1536e2cedb..2c6af00e3fbbbdd16f00a1b32c38931fb76d967e 100644
--- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
+++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
@@ -16,6 +16,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
import FormInfo from '@ohos.application.formInfo';
import formError from '@ohos.application.formError';
+import featureAbility from '@ohos.ability.featureAbility'
export default function ApiCoverTest() {
describe('ApiCoverTestTest', function () {
@@ -75,5 +76,40 @@ export default function ApiCoverTest() {
expect(1).assertEqual(FormInfo.FormState.READY)
done();
});
+ /*
+ * @tc.number SUB_AA_OpenHarmony_CoverApiContext_0100
+ * @tc.name Test getExternalCacheDir by callback.
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it('SUB_AA_OpenHarmony_CoverApiContext_0100', 0, async function (done) {
+ console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------");
+ let appContext = featureAbility.getContext()
+ appContext.getExternalCacheDir((err, data) => {
+ console.info('SUB_AA_OpenHarmony_CoverApiContext_0100 successful. data: ' + JSON.stringify(data));
+ expect(true).assertTrue()
+ done()
+ })
+ })
+
+ /*
+ * @tc.number SUB_AA_OpenHarmony_CoverApiContext_0200
+ * @tc.name Test getExternalCacheDir by promise.
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it('SUB_AA_OpenHarmony_CoverApiContext_0200', 0, async function (done) {
+ console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------");
+ let appContext = featureAbility.getContext()
+ appContext.getExternalCacheDir().then((data)=>{
+ console.info('SUB_AA_OpenHarmony_CoverApiContext_0200 successful. data: ' + JSON.stringify(data));
+ expect(true).assertTrue()
+ done()
+ }).catch((err)=>{
+ expect().assertFalse();
+ done()
+ })
+ })
+
})
}
\ No newline at end of file
diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
index 3250494c2423e7bab5a5c77495019b5032f8bb71..efe1453e24f9a0843279945da528366c1e877115 100644
--- a/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
+++ b/ability/ability_runtime/faapicover/faapicoverhaptest/entry/src/main/ets/test/VerificationTest.ets
@@ -134,35 +134,26 @@ export default function verificationTest(){
try {
let list1 = []
- let list2 = ["Fa_Auxiliary_MainAbility4_onDestroy", "Fa_Auxiliary_MainAbility5_onDestroy"]
+ let list2 = ["Fa_Auxiliary_MainAbility4_onDestroy"]
let number1 = undefined
- let number2 = undefined
let number3 = undefined
let code1 = 536870912
let code2 = 2048
let subscriber = null
let subscribeInfo = {
- events: ["Fa_Auxiliary_MainAbility4_onCreate", "Fa_Auxiliary_MainAbility4_onDestroy",
- "Fa_Auxiliary_MainAbility5_onCreate", "Fa_Auxiliary_MainAbility5_onDestroy"]
+ events: ["Fa_Auxiliary_MainAbility4_onCreate", "Fa_Auxiliary_MainAbility4_onDestroy"]
}
function SubscribeInfoCallback(err, data) {
console.info(TAG + "===SubscribeInfoCallback===" + JSON.stringify(data))
if (data.event == "Fa_Auxiliary_MainAbility4_onCreate") {
number1 = data.parameters.flags
}
- if (data.event == "Fa_Auxiliary_MainAbility5_onCreate") {
- number2 = data.parameters.flags
- }
if (data.event == "Fa_Auxiliary_MainAbility4_onDestroy") {
list1[0] = "Fa_Auxiliary_MainAbility4_onDestroy"
}
- if (data.event == "Fa_Auxiliary_MainAbility5_onDestroy") {
- list1[1] = "Fa_Auxiliary_MainAbility5_onDestroy"
- }
if (JSON.stringify(list1) == JSON.stringify(list2)) {
expect(number3).assertEqual(1);
expect(number1).assertEqual(code1);
- expect(number2).assertEqual(code2);
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
}
}
@@ -204,21 +195,6 @@ export default function verificationTest(){
expect().assertFail();
done();
});
-
- let wantNum3 = {
- want: {
- bundleName: 'ohos.acts.aafwk.test.faauxiliary',
- abilityName: 'ohos.acts.aafwk.test.faauxiliary.MainAbility5',
- flags: wantConstant.Flags.FLAG_INSTALL_ON_DEMAND
- }
- }
- await ability_featureAbility.startAbility(wantNum3).then((data) => {
- console.info(TAG + "startAbility data = " + JSON.stringify(data));
- }).catch((err) => {
- console.info(TAG + "startAbility err = " + JSON.stringify(err));
- expect().assertFail();
- done();
- });
} catch (err) {
console.info(TAG + "catch err = " + JSON.stringify(err));
expect().assertFail();
diff --git a/ability/ability_runtime/faapicover/faauxiliary/entry/src/main/config.json b/ability/ability_runtime/faapicover/faauxiliary/entry/src/main/config.json
index ee0129cff641bbfdcefeb1a24b80061bfc421311..793985417879ac6042b70a25589582aea5d1701b 100644
--- a/ability/ability_runtime/faapicover/faauxiliary/entry/src/main/config.json
+++ b/ability/ability_runtime/faapicover/faauxiliary/entry/src/main/config.json
@@ -15,6 +15,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"default",
"tablet"
],
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json
index 78165bae4c2699d1e89d4e9b13517a2d1c034094..f90fa76aa4db5609959884ac1d19638e9b6d2c66 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json
@@ -22,7 +22,8 @@
"name": ".MyApplication",
"mainAbility": "com.example.actsfeatureabilitytest.MainAbility",
"deviceType": [
- "phone"
+ "default",
+ "default"
],
"distro": {
"deliveryWithInstall": true,
@@ -121,6 +122,10 @@
{
"name": "ohos.permission.ACCELEROMETER",
"reason":"need use ohos.permission.ACCELEROMETER"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
index 6563e4db5fd25b16160e17808d8ad7ff17fa48b8..67affdfdb61ce75865a235fe940a385123e8a354 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
@@ -84,7 +84,7 @@ describe('ActsFeatureAbilityTest', function () {
console.info('beforeEach called')
})
- afterEach(function() {
+ afterEach(async function(done) {
/*
* @tc.teardown: teardown invoked after each testcases
@@ -94,6 +94,22 @@ describe('ActsFeatureAbilityTest', function () {
setTimeout(() => {}, 500);
backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext());
setTimeout(() => {}, 500);
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.example.actsfeatureabilitytest",
+ abilityName: "com.example.actsfeatureabilitytest.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("ACTS_wantConstant startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("ACTS_wantConstant startAbility err : " + JSON.stringify(err));
+ })
+ setTimeout(function () {
+ console.log("ACTS_wantConstant afterEach end");
+ done();
+ }, 500);
})
/**
@@ -167,8 +183,7 @@ describe('ActsFeatureAbilityTest', function () {
it('ACTS_HasWindowFocus_0300', 0, async function (done) {
let result = featureAbility.hasWindowFocus(
(err, data) => {
- console.info("hasWindowFocus asyncCallback code: " + err.code + " data: " + data);
- expect(err.code).assertEqual(0);
+ console.info("hasWindowFocus asyncCallback code data: " + data);
expect(data).assertTrue();
done()
}
@@ -1111,7 +1126,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(data.launchMode).assertEqual(0);
expect(data.permissions[0]).assertEqual("ohos.permission.ACCELEROMETER");
- expect(data.deviceTypes[0]).assertEqual("phone");
+ expect(data.deviceTypes[0]).assertEqual("default");
expect(data.deviceCapabilities[0]).assertEqual("SystemCapability.Ability.AbilityBase");
expect(data.readPermission).assertEqual("");
@@ -1194,7 +1209,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(data.supportedModes).assertEqual(0);
expect(data.reqCapabilities[0]).assertEqual("reqCapabilitiesTest1");
expect(data.reqCapabilities[1]).assertEqual("reqCapabilitiesTest2");
- expect(data.deviceTypes[0]).assertEqual("phone");
+ expect(data.deviceTypes[0]).assertEqual("default");
expect(data.moduleName).assertEqual("entry")
expect(data.mainAbilityName).assertEqual("com.example.actsfeatureabilitytest.MainAbility");
expect(data.installationFree).assertEqual(false);
diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
index 1d63d39b02c28ab660b8d4a64c9b7fb510974f62..e420df97c8342fc2166d92cc5007f9d7e7a10f89 100644
--- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
+++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
@@ -23,6 +23,24 @@ const errCode1 = 202;
export default function startAbilityTest() {
describe('StartAbilityTest', function () {
+ afterEach(async function(done) {
+ let wantInfo = {
+ want: {
+ bundleName: "com.example.actsfeatureabilitytest",
+ abilityName: "com.example.actsfeatureabilitytest.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("SUB_AA_JsApi_StartAbility startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("SUB_AA_JsApi_StartAbility startAbility err : " + JSON.stringify(err));
+ })
+ setTimeout(function () {
+ console.log("SUB_AA_JsApi_StartAbility afterEach end");
+ done();
+ }, 500);
+ })
+
/*
* @tc.number: SUB_AA_JsApi_StartAbility_0100
* @tc.name: testAbility0100.
@@ -141,48 +159,6 @@ describe('StartAbilityTest', function () {
})
})
- /*
- * @tc.number: SUB_AA_JsApi_Ability_0700
- * @tc.name: testAblity0700.
- * @tc.desc: startAbility-want-configuration action+entities-entities is configured as a string.(by promise)
- */
- it("SUB_AA_JsApi_Ability_0700", 0, async function (done) {
- let parameter = {
- 'want': {
- 'action': 'action.ohos.acts.aafwk.jsapi.MainAbility',
- 'entities': 'abc123'
- }
- }
- await featureAbility.startAbility(parameter).then((data) => {
- console.log('testAblity0700 data: ' + JSON.stringify(data))
- expect().assertFail()
- }).catch((error) => {
- console.log('testAblity0700 error: ' + JSON.stringify(error))
- expect(errCode).assertEqual(error.code)
- })
- done()
- })
-
- /*
- * @tc.number: SUB_AA_JsApi_Ability_0800
- * @tc.name: testAblity0800.
- * @tc.desc: startAbility-want-configuration action+entities-entities is configured as a string.(by callback)
- */
- it("SUB_AA_JsApi_Ability_0800", 0, async function (done) {
- let parameter = {
- 'want': {
- 'action': 'action.ohos.acts.aafwk.jsapi.MainAbility',
- 'entities': 'abc123'
- }
- }
- featureAbility.startAbility((parameter), (error, data) => {
- console.log('testAblity0800 data: ' + JSON.stringify(data))
- console.log('testAblity0800 error: ' + JSON.stringify(error))
- expect(errCode).assertEqual(error.code)
- done()
- })
- })
-
/*
* @tc.number: SUB_AA_JsApi_Ability_0900
* @tc.name: testAblity0900.
diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/config.json
index d33f3b33537d87cd94dbbb1390f0453f59c601f9..ff10f1ef588983dafe785d47cd395353a43b0f1f 100644
--- a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/config.json
+++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.finishwithresultemptytest",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json
index d73ca01765ceeb3bc463e390c5927e89ffd84da6..fcaed56ed5ddeb1e230a9c4f952ca3590bedd406 100644
--- a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json
+++ b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.finishwithresultpromiseparameterstest",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/config.json
index 9ec733d3c2e52da6d7caff688d1e9b605d4ae53c..8ade1e80b3bcd41f34f07ed9d3ff9734f600f4b1 100644
--- a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/config.json
+++ b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.finishwithresulttest",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/config.json
index 0026c7409fda38d24d5aaf38bb231425d3a1061c..d72c688f659b47780acf9ed2e7d2da79b1f85e02 100644
--- a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/config.json
+++ b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.getcallingbundlepromisetest",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/featureability/sceneproject/startability/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/startability/src/main/config.json
index b5540465fd8d6fe532b962cb4ed6dcdabdad756c..3fd7272e146996db21b823c7af13f1a2996eaab7 100644
--- a/ability/ability_runtime/featureability/sceneproject/startability/src/main/config.json
+++ b/ability/ability_runtime/featureability/sceneproject/startability/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.startability",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/config.json
index 0002e785b61a24cb1c34f1afd17ad886538d5474..6ae9094cd4bb5e764423f8e48f61e813987cc318 100644
--- a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/config.json
+++ b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.startabilityforresult",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/config.json b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/config.json
index a0da9e7ac355982f3345754d6b75c71417ea9179..d542b37ff0826ba7fffc57666c6d14f9a6905dff 100644
--- a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/config.json
+++ b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.terminateabilitytest",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json
index c8690b4bb2ca91777e273bed44741e75fef71a74..d7622a4aba3b3784343f982a9c11367b7418fbc5 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets
index 54eeee8755a15da27ec0ddc4df67305983859383..c4f389eba0d54fbb616b45322aaf957d5fdc3cc2 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhost/entry/src/main/ets/MainAbility/pages/index.ets
@@ -46,22 +46,22 @@ struct Index {
events: ["FMS_FormDelete_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>formOnErrorEvent Publish CallBack ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>formOnAcquiredEvent Publish CallBack ====>");
}
- private publishCastCallBack() {
+ private publishCastCallBack = () => {
console.debug("====>formCastEvent Publish CallBack ====>");
}
- private publishOnUninstallCallBack() {
+ private publishOnUninstallCallBack = () => {
console.debug("====>formOnUninstallEvent Publish CallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data));
if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json
index fc12ed37e598a5d27fb345bd23869c165dbf9426..ed27d691ebff0ceee75d40ecaafc43ccc32649bf 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppB",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets
index 010c8e164b692d160c4511f2f113d55d43712b7d..767c0ff7fb9ba067241ad67673d155a99db9310b 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostb/entry/src/main/ets/MainAbility/pages/index.ets
@@ -46,17 +46,17 @@ struct Index {
};
private subscriberDle;
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>formOnErrorEvent Publish CallBack ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>formOnAcquiredEvent Publish CallBack ====>");
}
- private publishCastCallBack() {
+ private publishCastCallBack = () => {
console.debug("====>formCastEvent Publish CallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data));
if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostb") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json
index f07e7e2fa9031ba48a6fd0d4fe3d575bf8a34ae9..0c1e0afe32e77f52c8925418d9ed95ec73ed592e 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppC",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets
index 969c4c1bdade76fd48a6870ac3a622aefd99b4bf..5ba286fc463638c6143c5adb1c81b210eeb8eb63 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostc/entry/src/main/ets/MainAbility/pages/index.ets
@@ -57,26 +57,26 @@ struct Index {
events: ["FMS_TimeChange_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc formOnErrorEventCallBack ====>");
}
- private publishOnDeletedCallBack() {
+ private publishOnDeletedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnDeletedCallBack ====>");
}
- private publishOnReleasedCallBack() {
+ private publishOnReleasedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnReleasedCallBackk ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>");
}
- private publishCastCallBack() {
+ private publishCastCallBack = () => {
console.debug("====>formsystemhostc formCastEventCallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>[FormComponent] deleteCallBack start:====>" + JSON.stringify(data));
if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostc") {
return;
@@ -90,7 +90,7 @@ struct Index {
console.info("!!!====>[FormComponent] deleteCallBack end ====>");
}
- private timeChangeCallBack(err, data) {
+ private timeChangeCallBack = (err, data) => {
console.info("!!!====>[FormComponent] timeChangeCallBack start:====>" + JSON.stringify(data));
if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostc") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json
index bc91c029913894eafde7158fa1f7b5e4e49b205f..2acd7863a3011f9ba30d317eeab3003c983687da 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppD",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets
index 2668b47ef158158999edb38e16d6243cdbadd8d7..32f4a3bf7940a4ce16314165791467191ddab680 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostd/entry/src/main/ets/MainAbility/pages/index.ets
@@ -50,26 +50,26 @@ struct Index {
events: ["FMS_FormDelete_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc formOnErrorEventCallBack ====>");
}
- private publishOnDeletedCallBack() {
+ private publishOnDeletedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnDeletedCallBack ====>");
}
- private publishOnReleasedCallBack() {
+ private publishOnReleasedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnReleasedCallBackk ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>");
}
- private publishCastCallBack() {
+ private publishCastCallBack = () => {
console.debug("====>formsystemhostc formCastEventCallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data));
if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostd") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json
index 52d6a204a3d6bb1152e3e23f34ac84834db0e37e..112c1d49b2e258097f023c9fe449a2de6fe21db6 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppE",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets
index 8eaf42ac8b3e569d536a781b0e92e7b15ac346b5..6303a481a96b5e47ccf632e473290b514c8e5813 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets
@@ -55,27 +55,27 @@ struct Index {
events: ["FMS_FormDelete_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc formOnErrorEventCallBack ====>");
}
- private publishOnDeletedCallBack() {
+ private publishOnDeletedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnDeletedCallBack ====>");
}
- private formOnDynamicRefreshCallBack() {
+ private formOnDynamicRefreshCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc formOnDynamicRefreshEventk ====>");
}
- private formOnRequestCallBack() {
+ private formOnRequestCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc formOnRequestCallBack ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data));
if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json
index 9665ee652052437c69e227b5cee8984e1537e888..2ac6615f091099c073f2459045a4ceaa80f34caa 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppF",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets
index 2b576e3c1c8fd2ac95832e110cf3e7a1b70c5860..6794ecc980b1c0e82313b5fb6f1531087c6c1eda 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostf/entry/src/main/ets/MainAbility/pages/index.ets
@@ -57,26 +57,26 @@ struct Index {
events: ["FMS_FormDelete_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc formOnErrorEventCallBack ====>");
}
- private publishOnDeletedCallBack() {
+ private publishOnDeletedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnDeletedCallBack ====>");
}
- private publishOnReleasedCallBack() {
+ private publishOnReleasedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnReleasedCallBackk ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>formsystemhostc formOnAcquiredEventCallBack ====>");
}
- private publishOnUpdatedCallBack() {
+ private publishOnUpdatedCallBack = () => {
this.canCreateForm = false;
console.debug("====>formsystemhostc publishOnUpdatedCallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data));
if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostf") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json
index 1ef54c5fa2d9aa2c3b7eb7276b8e84628994fcce..075b857bc3ce01abfb203f728632dfca3b7977d9 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppG",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets
index e037471b283e4bfed89a387b6d3f24cdb9df772a..89d9c29a46595e8b58d215e0512e5f5b748d468d 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostg/entry/src/main/ets/MainAbility/pages/index.ets
@@ -49,22 +49,22 @@ struct Index {
events: ["FMS_FormDelete_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>[FormComponent.host] formOnErrorEventCallBack ====>");
}
- private publishOnDeletedCallBack() {
+ private publishOnDeletedCallBack = () => {
this.canCreateForm = false;
console.debug("====>[FormComponent.host] publishOnDeletedCallBack ====>");
}
- private publishOnStateCallBack() {
+ private publishOnStateCallBack = () => {
this.canCreateForm = false;
console.debug("====>[FormComponent.host] publishOnStateCallBack ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>[FormComponent.host] formOnAcquiredEventCallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>[FormComponent.host] deleteCallBack start:====>" + JSON.stringify(data));
if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostg") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json
index ff59a977b1677c584508c4a3b96d51512e6361b9..fb7f83992e333b62dbaa4d18e5731361f8061361 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppI",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets
index 732bbe9e396cfb0b15ace9d91a050d0bf90c2cb3..7d7588e3a1f288fa5549fc454721e95c1f1c1243 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosti/entry/src/main/ets/MainAbility/pages/index.ets
@@ -45,18 +45,18 @@ struct Index {
events: ["FMS_FormDelete_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.info("====>formOnErrorEvent Publish CallBack ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.info("====>formOnAcquiredEvent Publish CallBack ====>");
}
- private publishCastCallBack() {
+ private publishCastCallBack = () => {
console.info("====>formCastEvent Publish CallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>formsystemhost deleteCallBack start:====>" + JSON.stringify(data));
if (data.bundleName && data.bundleName != "com.ohos.st.formsystemhost") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json
index 2248ed3dcd62c3e02c74dd5e30e83a6afc9c596b..945f15352d6d7bbc935d07d3ad38cd77ea6de6cd 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets
index f86495a3e4b1953adef5d3b64c2a9dfcbc5200e3..5199fd1785a6d621e258ef0f90908ffdd1206f6a 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostj/entry/src/main/ets/MainAbility/pages/index.ets
@@ -45,18 +45,18 @@ struct Index {
events: ["FMS_FormDelete_commonEvent"],
};
- private publishOnErrorCallBack() {
+ private publishOnErrorCallBack = () => {
this.canCreateForm = false;
console.debug("====>formOnErrorEvent Publish CallBack ====>");
}
- private publishOnAcquiredCallBack() {
+ private publishOnAcquiredCallBack = () => {
console.debug("====>formOnAcquiredEvent Publish CallBack ====>");
}
- private publishCastCallBack() {
+ private publishCastCallBack = () => {
console.debug("====>formCastEvent Publish CallBack ====>");
}
- private deleteCallBack(err, data) {
+ private deleteCallBack = (err, data) => {
console.info("!!!====>formsystemhostj deleteCallBack start:====>" + JSON.stringify(data));
if(data.bundleName && data.bundleName != "com.ohos.st.formsystemhostj") {
return;
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json
index 4b25e4f0371b28e28bf2ee65f10eef061ee68adc..b8a4957ba773ee72cafcec39d7240e0583b5b0ac 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppK",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets
index c970518070b5892e9160114c7f6ea6a1cb588ea6..12d7ad236b2e6617e40c492dc340f24c8a6e27fa 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostk/entry/src/main/ets/MainAbility/pages/index.ets
@@ -67,19 +67,19 @@ struct Index {
private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent";
private formOnReleasedEvent = "FMS_FormOnReleased_commonEvent";
- private onAcquiredCallback() {
+ private onAcquiredCallback = () => {
console.info(`${this.TAG} onAcquiredCallback`);
}
- private onRequestCallback() {
+ private onRequestCallback = () => {
console.info(`====>${this.TAG} onRequestCallback====>`);
}
- private onDeletedCallback() {
+ private onDeletedCallback = () => {
console.info(`${this.TAG} onDeletedCallback`);
}
- private onReleasedCallback() {
+ private onReleasedCallback = () => {
console.info(`====>${this.TAG} onReleasedCallback====>`);
}
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json
index d184b9ec9f1f96282caf4286da00d6438216cbb0..11155c1bda766d7a5c58561ed68b6233355fbea6 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppL",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets
index c900acdf69687d0e5cbc835fc4c87757e23fbc1e..279ca31580b4e1a1b097b29a78450ae40109fb42 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostl/entry/src/main/ets/MainAbility/pages/index.ets
@@ -42,11 +42,11 @@ struct Index {
private formOnRequestEvent = `FMS_FormOnRequest_commonEvent`;
private formOnDeletedEvent = "FMS_FormOnDeleted_commonEvent";
- private onAcquiredCallback() {
+ private onAcquiredCallback = () => {
console.info(`====>${this.TAG} onAcquiredCallback====>`);
}
- private onRequestCallback() {
+ private onRequestCallback = () => {
console.info(`====>${this.TAG} onRequestCallback====>`);
}
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json
index 6dca4226ce5e71a950efe771eb11b49d887eac72..530cf66d86a52d66e5db063389f52a305c66fb39 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostn/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppN",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json
index 3e8c6d744837a0d161d8d31e1d59c37bbd2cbb07..478ab8725d557e950c94eaa66b693d81c0f52292 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppNoPerm",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets
index 891b96832546dc14795b7b3afe11d329f6c3ae7e..7727fd57e45571f58206ea9668702be5e142ac62 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostnoperm/entry/src/main/ets/MainAbility/pages/index.ets
@@ -48,7 +48,7 @@ struct Index {
private formOnRequestEvent = "FMS_FormOnRequest_commonEvent";
private formOnStateEvent = "FMS_FormOnState_commonEvent";
- private publishCallBack() {
+ private publishCallBack = () => {
console.debug("====>formOnErrorEvent Publish CallBack ====>");
}
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json
index 6e442bee365d947a8f258d108b44fa6f39ad1005..df6ad4771b801cb25c7b62b3cc1bbdda847e17c7 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhosto/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppO",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json
index 90f1833b1bc8fd3dc1fe168f92f574f968b1f524..83186cf50073fa929ab6fb40e8f361182fb6cc46 100644
--- a/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhostp/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStHostAppP",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json
index 5d19bdb474422ecbb2e85cedbf305f9b68826497..0165ca2b9f479636e522e332ce625cec9858407e 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationA/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json
index 3ee65354333d9eaad62e2a8827aafdf7e7310789..15274d76cfbdc5aab09f10f8ca8127e90648a3ec 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationB/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json
index 29fc8bf65033356a845a8b912d3145eed9cc4a85..8e0e5e408fbf46ba9b0743617129bb2693ab3b29 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationC/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json
index 514dc4b0f78107e6cc8f791ec3fa6a42b1e2410e..5900f22d84887f42c02ca46ddbb8f3561cf43589 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationD/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json
index 650456f8ef9c200ad401f881eec72d77d476c0f0..4d878c851bd25547093c49f7081517854211c434 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationE/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json
index 2e2e549336e2ec8de3461a96300a3bfb1f727e59..d4eb21880410b2473eed4fcdae139c63d830c346 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationF/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json
index 389435140fe597cbad596896cb387e94536dced8..d7b259e3caf61d774c2b531b5482be82707ac3f0 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationG/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json
index 734f57ff8a2ca909697e995d9b4b94e50351a038..62979bb7e8634e26ca13dc6b29b18b135a9d0eb8 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationH/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json
index 20d6ca20267b58c21a4fdf073cf3edd911c06aee..eb22f83f954362f3250378038a61bbe547101a1a 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsupplyapplicationNotSysApp/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json
index ad2fd2f88454ab6b77ae4bc964466dc514a470f3..e8097cca484cbea6e51c8c8ce9ca1fc33a5a9e3d 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemprovidera/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json
index 162e5064dda116f79541231c61c2d1686f51aa32..95f8b8d4b063be1ce46d2d8ad09605fcfe73622a 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderb/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json
index 9e0dc9dd6e4809b3b7e0ae2f8beafde7cc57f7d6..b8b993c94b427ff2e912d3c1ac096e7080e9175a 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderc/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json
index d4e41013420a2ab58a815f697b1a815b1e6eda46..6d42150787b0b7abece298186c66ea07b75253d4 100644
--- a/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formproviderst_ets/formsystemproviderd/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json
index c1e01e845cd806c5fb6d427c6268b5f5b8fe809d..867c551289372768f10196c8a96166552afa5531 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormAcquireSTApp",
"mainAbility": "com.ohos.st.formacquiretest.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -133,6 +134,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets
index cb718c637486144af0d2aefc788dec26c7440b57..e20ede1bbea2a817efd2e358689a13a052631948 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets
@@ -57,6 +57,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberCast, () => unsubscribeCallback("afterEach unsubscribe subscriberCast"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.ohos.st.formacquiretest",
+ abilityName: "com.ohos.st.formacquiretest.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("FMS_acquireForm startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FMS_acquireForm startAbility err : " + JSON.stringify(err));
+ })
await sleep(1000);
})
@@ -1552,7 +1564,7 @@ export default function test() {
function onCastCallBack(_, data) {
console.info("!!!====>FMS_acquireForm_2600 onCastCallBack data:====>" + JSON.stringify(data));
expect(data.event).assertEqual("FMS_FormCast_commonEvent");
- expect(data.data).assertEqual("undefined");
+ expect(data.data).assertEqual("0");
commonEvent.unsubscribe(subscriberCast, () => unsubscribeOnCastCallback("FMS_acquireForm_2600"))
formId1 = data.parameters.formId;
console.info("!!!====>FMS_acquireForm_2600 formId1 " + formId1 + " formId2 " + formId2);
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json
index f5fd8a283edf4229155e935fa38613a8cf812164..cca586d2916f698c588c8af26de4a952efe78d25 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormAcquire2STApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -132,6 +133,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets
index 0eb17e84a984fd4246ae47a760f8f45b8176c4f8..04066271e9c56a3ca09920a536ad2d8d9e5c3e4e 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets
@@ -60,6 +60,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberCast, () => unsubscribeCallback("afterEach unsubscribe subscriberCast"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.ohos.st.formacquiretest2",
+ abilityName: "com.ohos.st.formacquiretest2.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("FMS_acquireForm2 startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FMS_acquireForm2 startAbility err : " + JSON.stringify(err));
+ })
await sleep(1000);
})
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json
index 6f8538908a163152a2a766919f633bf853d20282..491be01687d3dbd71eb189b95099bc6d8d67d609 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormDeleteSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -154,6 +155,10 @@
{
"name": "ohos.permission.SET_TIME",
"reason": "need use ohos.permission.SET_TIME"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets
index 151d24e4dc983d02670595f24a2bc6128f5f9ffa..3cedbffb31f86a9cd303bb2c8686dba9acc96d36 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets
@@ -16,7 +16,8 @@
import featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent';
import systemTime from '@ohos.systemTime';
-import { beforeEach, afterEach, describe, expect, it } from '@ohos/hypium'
+import { beforeAll, afterAll, beforeEach, afterEach, describe, expect, it } from '@ohos/hypium'
+import backgroundTaskManager from '@ohos.backgroundTaskManager';
const onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"],
@@ -45,6 +46,30 @@ let subscriberSupply;
export default function test() {
describe(`FmsDeleteFormTest`, () => {
+ let id = undefined;
+ beforeAll(async (done) => {
+ console.log("FMS_deleteForm beforeAll called");
+ let myReason = 'test FaShowOnLockTest';
+ let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
+ console.log("FMS_deleteForm Request suspension delay will time out.");
+ })
+ id = delayInfo.requestId;
+ console.log("FMS_deleteForm requestId is : " + id);
+ setTimeout(function () {
+ console.log("FMS_deleteForm beforeAll end");
+ done();
+ }, 1000);
+ })
+
+ afterAll(async (done) => {
+ console.log("FMS_deleteForm afterAll called");
+ backgroundTaskManager.cancelSuspendDelay(id);
+ setTimeout(function () {
+ console.log("FMS_deleteForm afterAll end");
+ done();
+ }, 1000);
+ })
+
beforeEach(async () => {
subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event);
subscriberOnReleased = await commonEvent.createSubscriber(onReleasedFormEvent);
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json
index 32026dbd99926b0556ea4fddb503813e63270b52..7867a43beef8d98d8850ac59aedb5bf24ec6e485 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormDynamicSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -131,6 +132,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets
index 09ee65d6bbb73ad412e0a563beeb7a806e643dd7..14374575c40ba8a0e9095819a293f13e8101aa20 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets
@@ -60,6 +60,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.ohos.st.formdynamicrefreshtest",
+ abilityName: "com.ohos.st.formdynamicrefreshtest.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("FMS_timedRefresh startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FMS_timedRefresh startAbility err : " + JSON.stringify(err));
+ })
await sleep(1000);
})
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json
index 8543a6e915322cd9f88c97724000226440c2eeab..fcc584b7d290f58a4de45b58a5a5b9bb8b12f4d8 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormFuzzSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets
index 7870950c2f224e462b107a950d784b0a4ebaac6d..c8d058de57b2c1cc43d4e4078f3a1bc02885e4c9 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets
@@ -43,7 +43,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => {
formHost.getFormsInfo(bundleName, (error, data) => {
console.log(`FMS_fuzzTest_getinfobundle ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
- if (`STRING` === dataType) {
+ if (`string` === typeof bundleName) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
@@ -79,7 +79,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => {
expect().assertFail();
} catch (error) {
console.log(`FMS_fuzzTest_getinfobundle ${tcNumber} exception caught: ${JSON.stringify(error)}`);
- if (`STRING` === dataType) {
+ if (`string` === typeof bundleName) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
@@ -108,7 +108,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => {
formHost.getFormsInfo(bundleName, moduleName, (error, data) => {
console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
- if (`STRING` === dataType) {
+ if (`string` === typeof bundleName) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
@@ -146,7 +146,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => {
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
- if (`STRING` === dataType) {
+ if (`string` === typeof bundleName) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
@@ -175,7 +175,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => {
formHost.getFormsInfo(bundleName, moduleName, (error, data) => {
console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
- if (`STRING` === dataType) {
+ if (`string` === typeof moduleName) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
@@ -212,7 +212,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => {
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
- if (`STRING` === dataType) {
+ if (`string` === typeof moduleName) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets
index 0dc146dba93b773d41c0babe10c55ead09a73f4d..a5c4ddfe781c75cba27f0d19c4da6d4b19bdea47 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets
@@ -76,7 +76,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => {
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
- if (`STRING` === dataType) {
+ if (`string` === typeof formId) {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
} else {
@@ -137,7 +137,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => {
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
- if (`STRING` === dataType) {
+ if (`string` === typeof formId) {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
} else {
@@ -166,7 +166,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => {
formHost.releaseForm(formId, isReleaseCache, (error, data) => {
console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
- if (`BOOLEAN` === dataType) {
+ if (`boolean` === typeof isReleaseCache) {
expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE);
expect(error.message).assertEqual(ERR_NOT_EXIST_ID);
} else {
@@ -203,7 +203,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => {
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
- if (`BOOLEAN` === dataType) {
+ if (`boolean` === typeof isReleaseCache) {
expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE);
expect(error.message).assertEqual(ERR_NOT_EXIST_ID);
} else {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets
index 4d030380aa50610615aaf7b07dcaa68999bfaa2c..70c2eb0ca30b6295ed75c7e63a881d3cc211bf89 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets
@@ -104,7 +104,7 @@ export const setFormNextRefreshTimeFuzzTest = (describeName, filterParameter) =>
formProvider.setFormNextRefreshTime(formId, nextTime, (error, data) => {
console.log(`${callbackName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
- if (`NUMBER` === dataType) {
+ if (`number` === typeof nextTime) {
if (ERR_NOT_EXIST_ID_CODE === error.code) {
expect(error.message).assertEqual(ERR_NOT_EXIST_ID);
} else if (ERR_ADD_INVALID_PARAM_CODE === error.code) {
@@ -147,7 +147,7 @@ export const setFormNextRefreshTimeFuzzTest = (describeName, filterParameter) =>
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
- if (`NUMBER` === dataType) {
+ if (`number` === typeof nextTime) {
if (ERR_NOT_EXIST_ID_CODE === error.code) {
expect(error.message).assertEqual(ERR_NOT_EXIST_ID);
} else if (ERR_ADD_INVALID_PARAM_CODE === error.code) {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets
index 29c726720f932d52c1ccedb7d9c1bae3a394c412..f4cf0821260244921a28156973d46ff277e6541b 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets
@@ -148,7 +148,13 @@ const functionTest = function () {
const getFuzzData = (datatype: string) => {
switch (datatype) {
case 'ARRAY':
- return arrayTest();
+ let array1 = arrayTest();
+ let array2 = array1
+ if (isNaN(Number(array1.join("")))) {
+ return array2;
+ } else {
+ getFuzzData(DATA_TYPE_LIST[0]);
+ }
case 'BOOLEAN':
return booleanTest();
case 'FUNCTION':
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json
index a15daad37c5acd5a06b3f4d7be668393c3bf6c82..7e0badee1c023ed8004e11df0a1076279b1b8d45 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
index 58a8d0ae908af324d343bc47ea6dc31ab5981455..e6ec15d892e372e7e8d8c47b9f5b8be999bae2da 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
@@ -61,7 +61,6 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
tempDataB = dataB[0];
tempDataC = dataC[0];
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
});
await sleep(2000)
checkDataB(tempDataB)
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetFormsInfo.test.ets
index 8e3403f80e26e061735f4b5366602e6d90c0d4a8..302ef8ac02cea568e3ef93f868c60aa5de6df506 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetFormsInfo.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/test/GetFormsInfo.test.ets
@@ -178,7 +178,6 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
expect(dataB.length).assertEqual(1);
tempDataB = dataB[0]
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
console.log(`==========${callbackName2} ${describeName} end==========`);
});
await sleep(2000)
@@ -400,7 +399,6 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
console.log(`${callbackName6} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(JSON.stringify(data)).assertEqual(`[]`);
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
done();
console.log(`==========${callbackName6} ${describeName} end==========`);
});
@@ -456,7 +454,6 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
expect(data.length).assertEqual(1);
expect(dataC.length).assertEqual(1);
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
console.log(`==========${callbackName7} ${describeName} end==========`);
});
await sleep(2000)
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json
index 0183f81e01ab174e87ed93c2d81974532e691642..87b9f7db29c94e09c38376f63144b3cc5e519843 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
index fd1fe68cfb7fcd8e7b361d695a55d64cc5f10ac6..023ba9611c5b65f5f083a725b086233d51360632 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
@@ -62,7 +62,6 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
tempDataA2 = dataA[1]
tempDataB = dataB[0]
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
console.log(`==========${callbackName} ${describeName} end==========`);
});
await sleep(2000)
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json
index 739668a77e2b5c7081568b1a35c3ceba3c6ee7ba..5f7a98a6bdc9b0a1cf9c90ff139e442058f1d85e 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
index 169f3825aa1e4accf97b6d436a2e883c43b5b01f..e4a2abc7d81f49a19ea29e5c4443a2dabc957662 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
@@ -58,7 +58,6 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
tempDataB = dataB[0]
expect(JSON.stringify(dataD)).assertEqual(`[]`);
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
console.log(`==========${callbackName} ${describeName} end==========`);
});
await sleep(2000)
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json
index 9a7fb1603e47fd6194d237dbddaddabb390edfad..aaec29db555a13bffffa983760de7df6adec8838 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
index 5d91f12ae3a21c20f9f334d562f7c7adde4ecc20..f38f9e7cb52e3a4d3a932134072146acc6aacaea 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
@@ -37,7 +37,6 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(JSON.stringify(data)).assertEqual(`[]`);
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
done();
console.log(`==========${callbackName} ${describeName} end==========`);
});
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json
index e55f5685b64ebab1c69132342aeb368fd31e0a96..75396a3a28f777be8e26f77ed3da9de15bcf2511 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
index 78bcac9763e65b37720bd1223d6a52eca6fbcb37..4350c2f8051f51840727811f73d0ab5ec91fb168 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formszerotest/entry/src/main/ets/test/GetAllFormsInfo.test.ets
@@ -44,7 +44,6 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(dataD.length).assertEqual(0);
expect(JSON.stringify(dataD)).assertEqual(`[]`);
expect(error.code).assertEqual(ERR_OK_CODE);
- expect(error.message).assertEqual(ERR_OK);
done();
console.log(`==========${callbackName} ${describeName} end==========`);
});
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json
index f38d28074d0921c1a28be01a42432fc666ebc03f..84313c183f489a061a6021b5abdca1ca3332530f 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormHostDeathRecipientSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json
index 4125e2667315915d341ff54b6a645abcffe3d106..60458105ad97daf58c59edb64806240fc15db534 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormPerformanceSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json
index 867cbe0e16c6ad70a992d4238cd7a466ee11a704..467b44dc360e34a76b73a04b6337247177b3e4ab 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormReleaseSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -139,6 +140,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/test/FmsReleaseForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/test/FmsReleaseForm.test.ets
index bef74bca0e9e49878bf3fb8c1c0e6c4ed39b4941..98f9179159dd6764a1998a989bfba2484c12866f 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/test/FmsReleaseForm.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/test/FmsReleaseForm.test.ets
@@ -56,6 +56,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeCallback("afterEach unsubscribe subscriberOnReleased"));
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.ohos.st.formreleasetest",
+ abilityName: "com.ohos.st.formreleasetest.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("FMS_releaseForm startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FMS_releaseForm startAbility err : " + JSON.stringify(err));
+ })
await sleep(1000);
})
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json
index f12ebbf7cab84a87b66419ccc9e95bbea78adedd..8040926bfc6d554edff883a1d3d3030caecd1916 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStateSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -141,6 +142,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/test/FmsFormStateDisable.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/test/FmsFormStateDisable.test.ets
index 793cff053aacea7e6fe55865d12eafa7d918000c..33e7f385c0384bcc8444ff956ede02bfb535753e 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/test/FmsFormStateDisable.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/test/FmsFormStateDisable.test.ets
@@ -15,7 +15,8 @@
import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent';
-import { beforeAll, beforeEach, afterEach, describe, expect, it } from '@ohos/hypium'
+import { beforeAll, afterAll, beforeEach, afterEach, describe, expect, it } from '@ohos/hypium'
+import backgroundTaskManager from '@ohos.backgroundTaskManager';
var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"],
@@ -47,8 +48,28 @@ var subscriberSupply;
export default function test() {
describe(`FmsStateFormTest`, () => {
+ let id = undefined;
beforeAll(async (done) => {
- done();
+ console.log("FMS_disableFormsUpdate beforeAll called");
+ let myReason = 'test FaShowOnLockTest';
+ let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
+ console.log("FMS_disableFormsUpdate Request suspension delay will time out.");
+ })
+ id = delayInfo.requestId;
+ console.log("FMS_disableFormsUpdate requestId is : " + id);
+ setTimeout(function () {
+ console.log("FMS_disableFormsUpdate beforeAll end");
+ done();
+ }, 1000);
+ })
+
+ afterAll(async (done) => {
+ console.log("FMS_disableFormsUpdate afterAll called");
+ backgroundTaskManager.cancelSuspendDelay(id);
+ setTimeout(function () {
+ console.log("FMS_disableFormsUpdate afterAll end");
+ done();
+ }, 1000);
})
beforeEach(async () => {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json
index cbb125b936eca69883eb4292f58ad6827b4bbb2d..1ee904b08db0a4a415df445fd7f98540db0a7555 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStateSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -141,6 +142,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets
index e412b411248bd8f72052713898d8728bab9a8d4e..205120afe381f18eedac2f3cee9482e2b3c1c92f 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets
@@ -15,7 +15,8 @@
import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent';
-import { beforeAll, beforeEach, afterEach, describe, expect, it } from '@ohos/hypium'
+import { beforeAll, afterAll, beforeEach, afterEach, describe, expect, it } from '@ohos/hypium'
+import backgroundTaskManager from '@ohos.backgroundTaskManager';
var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"],
@@ -47,8 +48,28 @@ var subscriberSupply;
export default function test() {
describe(`FmsStateFormTest`, () => {
+ let id = undefined;
beforeAll(async (done) => {
- done();
+ console.log("FMS_enableFormsUpdate beforeAll called");
+ let myReason = 'test FaShowOnLockTest';
+ let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
+ console.log("FMS_enableFormsUpdate Request suspension delay will time out.");
+ })
+ id = delayInfo.requestId;
+ console.log("FMS_enableFormsUpdate requestId is : " + id);
+ setTimeout(function () {
+ console.log("FMS_enableFormsUpdate beforeAll end");
+ done();
+ }, 1000);
+ })
+
+ afterAll(async (done) => {
+ console.log("FMS_enableFormsUpdate afterAll called");
+ backgroundTaskManager.cancelSuspendDelay(id);
+ setTimeout(function () {
+ console.log("FMS_enableFormsUpdate afterAll end");
+ done();
+ }, 1000);
})
beforeEach(async () => {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json
index 8d6fef062e42d8489b70503fe37c02f8f6d89153..58d83feef3a5f366f4155a97279c706c193d2e70 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStateSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -141,6 +142,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/test/FmsFormStateNotifyInvisible.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/test/FmsFormStateNotifyInvisible.test.ets
index 3fc87b2f5f905356ba6a29ff22910c06958ee026..d1e1fdea513f42d0ee64fd001bf40d893be35e58 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/test/FmsFormStateNotifyInvisible.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/test/FmsFormStateNotifyInvisible.test.ets
@@ -60,6 +60,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberDel, () => unsubscribeCallback("afterEach unsubscribe subscriberDel"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.ohos.st.formstatenotifyinvisibletest",
+ abilityName: "com.ohos.st.formstatenotifyinvisibletest.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("FMS_notifyInvisibleForms startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FMS_notifyInvisibleForms startAbility err : " + JSON.stringify(err));
+ })
await sleep(1000);
})
/**
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json
index 9bcb03ea97ebb7f111f17dbb6de7a674ba06acad..c8e3a5b4e2a07439983ddd879b13df584ddd2c97 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStateSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -141,6 +142,14 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/test/FmsFormStateNotifyInvisible2.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/test/FmsFormStateNotifyInvisible2.test.ets
index 84d1c284602236796f1efe13be40f322e81da042..6dd14fbb13b53216e190fdf36de9a66fd5977627 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/test/FmsFormStateNotifyInvisible2.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/test/FmsFormStateNotifyInvisible2.test.ets
@@ -54,6 +54,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.ohos.st.formstatenotifyinvisibletest2",
+ abilityName: "com.ohos.st.formstatenotifyinvisibletest2.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("FMS_notifyInvisibleForms2 startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FMS_notifyInvisibleForms2 startAbility err : " + JSON.stringify(err));
+ })
await sleep(1000);
})
/**
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json
index cdf7831de6083f70651f501bd33bd104e3dbbb38..8101fc1eff78e87796c5aaf1027b8df58db52c7b 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStateSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -141,6 +142,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/test/FmsFormStateNotifyVisible.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/test/FmsFormStateNotifyVisible.test.ets
index 9458578b86097e315be87c59333d4632f88dd423..ffd33691ea972b305ee93931f7b257e1409b9fda 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/test/FmsFormStateNotifyVisible.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/test/FmsFormStateNotifyVisible.test.ets
@@ -57,6 +57,18 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
+
+ let wantInfo = {
+ want: {
+ bundleName: "com.ohos.st.formstatenotifyvisibletest",
+ abilityName: "com.ohos.st.formstatenotifyvisibletest.TestAbility"
+ }
+ }
+ await featureAbility.startAbility(wantInfo).then((data) => {
+ console.log("FMS_notifyVisibleForms startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FMS_notifyVisibleForms startAbility err : " + JSON.stringify(err));
+ })
await sleep(1000);
})
/**
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json
index 5637e0cc11ceecc54d14d329e91be306afe28ad7..4c72406e07c399c63113fb886d6ac8d03622dfa7 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormStressSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -160,6 +161,10 @@
},
{
"name": "ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets
index e23601167a51d1998aa7155c8f3962308f502e07..371a116803bf0aad3401409221e6da622d44d7d4 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets
@@ -68,7 +68,17 @@ export default function test() {
commonEvent.unsubscribe(onDeletedEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onDeletedEventSubscriber"));
commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber"));
commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber"));
- await sleep(1000);
+ await featureAbility.startAbility({
+ want: {
+ bundleName: "com.ohos.st.formstresstest",
+ abilityName: "com.ohos.st.formstresstest.MainAbility"
+ }
+ }).then((data) => {
+ console.log("FmsStressTest startAbility data: " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FmsStressTest startAbility err: " + JSON.stringify(err));
+ })
+ await sleep(2000);
})
const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => {
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json
index 72b3d879e6c3f39ef41b943f45783d1be018daec..4598051105ae30aacc3b746e148d09d6611a61cf 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".FormUpdateSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -150,6 +151,10 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets
index 270b019595b664cd8d8b7abfced7f272a757bef1..9d84b65cab527595a82b8b76cadefc9137a5b839 100644
--- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets
+++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets
@@ -65,7 +65,17 @@ export default function test() {
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRequest"));
- await sleep(1000);
+ await featureAbility.startAbility({
+ want: {
+ bundleName: "com.ohos.st.formupdaterefreshtest",
+ abilityName: "com.ohos.st.formupdaterefreshtest.MainAbility"
+ }
+ }).then((data) => {
+ console.log("FmsUpdateRefreshFormTest startAbility data: " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("FmsUpdateRefreshFormTest startAbility err: " + JSON.stringify(err));
+ })
+ await sleep(2000);
})
/**
* @tc.number: FMS_updateForm_0100
diff --git a/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/module.json b/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/module.json
index 4e4edfed85bdc47418e18ccd4d35b889376248cb..3be9582522234c01c2c91f3e439defc726360091 100644
--- a/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/module.json
+++ b/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"tablet"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/module.json b/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/module.json
index eff67c9014c6839a115b47acac8826b8c3b1a6a3..ac065dbf50e15df3f3c26f3820dd05abaab0798d 100644
--- a/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/module.json
+++ b/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module1/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:module1_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"tablet"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/module.json b/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/module.json
index 00feac3a5bc2cc319eea8cf86f4482579260e78b..5cf7620fb80dd3f6b3d0ab9abc4d9033ac07464e 100644
--- a/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/module.json
+++ b/ability/ability_runtime/formmanager/stage/actsformprovidergetformsinfo/module2/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:module2_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"tablet"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/config.json
index 02cfb86b4cd2bb7b361e1c31ad714abf28e85576..a8de7e0415412832a0f557038c0f5d73d5b5a667 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets
index 5bed498301ee1ac25541bd2748182d46a5e09bb0..3d26b03273556a59ca9c9caa3ae2a53775cd2a30 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest.ets
@@ -25,611 +25,488 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
export default function ConnectAbilityTest() {
- var TAG = "";
- var Tempassert = "";
- var abilityDelegator = undefined
+ var TAG = "";
+ var Tempassert = "";
+ var abilityDelegator = undefined
- function sleep(time) {
- return new Promise((resolve) => setTimeout(resolve, time))
+ function sleep(time) {
+ return new Promise((resolve) => setTimeout(resolve, time))
+ }
+
+ describe('FreeInstall_FA_ConnectAbility', function () {
+ beforeAll(async function (done) {
+ console.info("FreeInstall_FA_ConnectAbility before all called");
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var cmd = "bm install -p data/test/MockService.hap";
+ console.info("cmd : " + cmd)
+ console.info(TAG + " abilityDelegator : " + JSON.stringify(abilityDelegator));
+ abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => {
+ console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await sleep(500);
+ var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
+ abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => {
+ console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await sleep(500);
+ var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
+ abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => {
+ console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ done();
+ })
+ });
+
+ afterEach(async (done) => {
+ console.info("FreeInstall_FA_ConnectAbility after each called");
+ Tempassert = ""
+ if ("FreeInstall_FA_ConnectAbility_2000" === TAG) {
+ var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
+ abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => {
+ console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ }
+ done();
+ });
+
+ function tips(msg) {
+ Prompt.showToast({
+ message: msg,
+ duration: 2000,
+ bottom: '150px'
+ });
+ }
+
+ async function connectabillity(msg, request) {
+ console.info(msg + "START");
+ let options = {
+ onConnect: function (element, proxy) {
+ console.info("FreeInstall_FA_ConnectAbility onConnect success!!!")
+ console.info(msg + " onConnect success!!! ");
+ console.info(msg + " onConnect: " + JSON.stringify(element));
+ console.info(msg + " onConnect: " + JSON.stringify(proxy));
+ if (proxy == null) {
+ console.error("FreeInstall_FA_ConnectAbility proxy null");
+ return;
+ }
+ let option = new rpc.MessageOption();
+ let data = new rpc.MessageParcel();
+ let reply = new rpc.MessageParcel();
+ data.writeInterfaceToken("ohos.appexecfwk.IApplicationStateObserver");
+ proxy.sendRequest(0, data, reply, option);
+ Tempassert = "onConnect";
+ tips("连接成功");
+ },
+ onDisconnect: function (element) {
+ console.info("FreeInstall_FA_ConnectAbility onDisconnect success!!!")
+ console.info(msg + " onDisconnect success!!!");
+ console.info(msg + " onDisconnect: " + JSON.stringify(element));
+ Tempassert = "onDisconnect";
+ tips("连接断开");
+ },
+ onFailed: function (code) {
+ console.info("FreeInstall_FA_ConnectAbility onFailed!!!")
+ console.info(msg + " onFailed!!! ");
+ console.info(msg + " onFailed: " + JSON.stringify(code));
+ Tempassert = "onFailed";
+ tips("连接失败");
+ }
+ }
+ let connection = await featureAbility.connectAbility(request, options);
+ console.info(msg + "request:" + JSON.stringify(request));
+ console.info(msg + "options:" + JSON.stringify(options));
+ console.info(msg + "connection=" + JSON.stringify(connection));
+ console.info(msg + "END");
}
- describe('FreeInstall_FA_ConnectAbility', function () {
- beforeAll(async function (done) {
- console.info("FreeInstall_FA_ConnectAbility before all called");
- abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
- var cmd = "bm install -p data/test/MockService.hap";
- console.info("cmd : " + cmd)
- console.info(TAG + " abilityDelegator : " + JSON.stringify(abilityDelegator));
- abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => {
- console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
- abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => {
- console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
- abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => {
- console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- done();
- })
- });
-
- afterEach(async function (done) {
- console.info("FreeInstall_FA_ConnectAbility after each called");
- Tempassert = ""
- await sleep(1000);
- if ("FreeInstall_FA_ConnectAbility_2000" === TAG) {
- var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
- abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => {
- console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- }
- await sleep(500);
- done();
- });
-
- function tips(msg) {
- Prompt.showToast({
- message: msg,
- duration: 2000,
- bottom: '150px'
- });
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0100
+ * @tc.name Pass in the local deviceid,atomic service does not exist locally
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_ConnectAbility_0100", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0100-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0100";
+ var cmd4 = "cp data/test/ConnectFaMyApplication6.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" +
+ "/entry/files";
+ abilityDelegator.executeShellCommand(cmd4, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+
+ setTimeout(async () => {
+ var deviceid = "0";
+ await abilityManager.getTopAbility((err, data) => {
+ console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err));
+ console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId));
+ deviceid = data.deviceId;
+ })
+ var request1 = {
+ "deviceId": deviceid,
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication6.ServiceAbility",
+ "moduleName": "myapplication6",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
}
+ connectabillity(TAG, request1);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0100-------------");
+ done();
+ });
- async function connectabillity(msg, request) {
- console.info(msg + "START");
- let options = {
- onConnect: function (element, proxy) {
- console.info("FreeInstall_FA_ConnectAbility onConnect success!!!")
- console.info(msg + " onConnect success!!! ");
- console.info(msg + " onConnect: " + JSON.stringify(element));
- console.info(msg + " onConnect: " + JSON.stringify(proxy));
- if (proxy == null) {
- console.error("FreeInstall_FA_ConnectAbility proxy null");
- return;
- }
- let option = new rpc.MessageOption();
- let data = new rpc.MessageParcel();
- let reply = new rpc.MessageParcel();
- data.writeInterfaceToken("ohos.appexecfwk.IApplicationStateObserver");
- proxy.sendRequest(0, data, reply, option);
- Tempassert = "onConnect";
- tips("连接成功");
- },
- onDisconnect: function (element) {
- console.info("FreeInstall_FA_ConnectAbility onDisconnect success!!!")
- console.info(msg + " onDisconnect success!!!");
- console.info(msg + " onDisconnect: " + JSON.stringify(element));
- Tempassert = "onDisconnect";
- tips("连接断开");
- },
- onFailed: function (code) {
- console.info("FreeInstall_FA_ConnectAbility onFailed!!!")
- console.info(msg + " onFailed!!! ");
- console.info(msg + " onFailed: " + JSON.stringify(code));
- Tempassert = "onFailed";
- tips("连接失败");
- }
- }
- let connection = await featureAbility.connectAbility(request, options);
- console.info(msg + "request:" + JSON.stringify(request));
- console.info(msg + "options:" + JSON.stringify(options));
- console.info(msg + "connection=" + JSON.stringify(connection));
- console.info(msg + "END");
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0200
+ * @tc.name Pass in the local deviceid,atomic service exists locally
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_ConnectAbility_0200", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0200-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0200";
+ var cmdapp10 = "bm install -p data/test/ConnectFaMyApplication10.hap";
+ abilityDelegator.executeShellCommand(cmdapp10, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ var deviceid = "0";
+ await abilityManager.getTopAbility((err, data) => {
+ console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err));
+ console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId));
+ deviceid = data.deviceId;
+ })
+ var request2 = {
+ "deviceId": deviceid,
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication10.ServiceAbility",
+ "moduleName": "myapplication10",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
}
+ connectabillity(TAG, request2);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500)
+ }, 2500);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0200-------------");
+ done();
+ });
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0100
- * @tc.name Pass in the local deviceid,atomic service does not exist locally
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_ConnectAbility_0100", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0100-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0100";
- var cmd4 = "cp data/test/ConnectFaMyApplication6.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" +
- "/entry/files";
- abilityDelegator.executeShellCommand(cmd4, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var deviceid = "0";
- abilityManager.getTopAbility((err, data) => {
- console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err));
- console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId));
- deviceid = data.deviceId;
- })
- await sleep(500);
- var request1 = {
- "deviceId": deviceid,
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication6.ServiceAbility",
- "moduleName": "myapplication6",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request1);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_0100-------------");
- done();
- }, 3000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0200
- * @tc.name Pass in the local deviceid,atomic service exists locally
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_ConnectAbility_0200", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0200-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0200";
- var cmdapp10 = "bm install -p data/test/ConnectFaMyApplication10.hap";
- abilityDelegator.executeShellCommand(cmdapp10, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var deviceid = "0";
- abilityManager.getTopAbility((err, data) => {
- console.log(TAG + 'getTopAbility result: ' + JSON.stringify(data) + " , err: " + JSON.stringify(err));
- console.log(TAG + 'getTopAbility result deviceid:' + JSON.stringify(data.deviceId));
- deviceid = data.deviceId;
- })
- await sleep(500);
- var request2 = {
- "deviceId": deviceid,
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication10.ServiceAbility",
- "moduleName": "myapplication10",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request2);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_0200-------------");
- done();
- }, 3000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0300
- * @tc.name Deviceid is empty,atomic service does not exist locally
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_ConnectAbility_0300", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0300-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0300";
- var cmd3 = "cp data/test/ConnectFaMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
- abilityDelegator.executeShellCommand(cmd3, (err: any, d: any) => {
- console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var request3 = {
- "deviceId": "",
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication1.ServiceAbility_feature",
- "moduleName": "myapplication1",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request3);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_0300-------------");
- done();
- }, 3000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0400
- * @tc.name Deviceid is empty,atomic service exists locally
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_ConnectAbility_0400", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0400-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0400";
- var cmdapp11 = "bm install -p data/test/ConnectFaMyApplication11.hap";
- abilityDelegator.executeShellCommand(cmdapp11, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var request4 = {
- "deviceId": "",
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication11.ServiceAbility",
- "moduleName": "myapplication11",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request4);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_0400-------------");
- done();
- }, 3000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0500
- * @tc.name The bundleName passed in is different from the local
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_0500", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0500-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0500";
- var request5 = {
- "bundleName": "com.example.different.hmservice",
- "abilityName": "com.example.different.ServiceAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request5);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_0500-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0600
- * @tc.name Pass in an empty bundleName
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_0600", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0600-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0600";
- var request6 = {
- "bundleName": "",
- "abilityName": "com.example.myapplication1.ServiceAbility_feature",
- "moduleName": "myapplication1",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request6);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_0600-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0700
- * @tc.name Pass in an empty abilityName
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_0700", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0700-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0700";
- var request7 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "",
- "moduleName": "myapplication1",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request7);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_0700-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0800
- * @tc.name Incorrect deviceid passed in
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_0800", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0800-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0800";
- var request8 = {
- "deviceId": "xxxxxx",
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication2.ServiceAbility",
- "moduleName": "myapplication2",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request8);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_0800-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_0900
- * @tc.name Incorrect bundleName passed in
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_0900", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_0900-------------");
- TAG = "FreeInstall_FA_ConnectAbility_0900";
- var request9 = {
- "bundleName": "com.example.xxx.hmservice",
- "abilityName": "com.example.myapplication2.ServiceAbility",
- "moduleName": "myapplication2",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request9);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_0900-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1000
- * @tc.name Incorrect flags passed in,atomic service does not exist locally
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1000", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1000-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1000";
- var request10 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication2.ServiceAbility",
- "moduleName": "myapplication2",
- "flags": 1111111,
- }
- connectabillity(TAG, request10);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1100
- * @tc.name Incorrect flags passed in,atomic service exists locally
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_ConnectAbility_1100", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1100-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1100";
- var cmdapp2 = "bm install -p data/test/ConnectFaMyApplication2.hap";
- abilityDelegator.executeShellCommand(cmdapp2, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(1000);
- var request11 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication2.ServiceAbility",
- "moduleName": "myapplication2",
- "flags": "11",
- }
- connectabillity(TAG, request11);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------");
- done();
- }, 3000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1200
- * @tc.name No atomic service under path
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1200", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1200-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1200";
- var cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*";
- abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var request12 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication1.ServiceAbility_feature",
- "moduleName": "myapplication3",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request12);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_1200-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1300
- * @tc.name The application is not in the foreground [start MainAbility2 first, then connect]
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1300", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1300-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1300";
- var str = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.MainAbility2",
- }
- }
- console.info(TAG + " startmainability2 str: " + JSON.stringify(str));
- featureAbility.startAbility(str)
- .then((data) => {
- console.info(TAG + " startmainability2 successful. Data: " + JSON.stringify(data))
- }).catch((error) => {
- console.error(TAG + " startmainability2 failed. Cause: " + JSON.stringify(error));
- })
- await sleep(1500);
- var request13 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication1.ServiceAbility_feature",
- "moduleName": "myapplication3",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request13);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_1300-------------");
- done();
- }, 1500);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1400
- * @tc.name The application is not in the foreground [start myapp2 first, then connect]
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1400", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1400-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1400";
- var str = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication2.MainAbility",
- }
- }
- console.info(TAG + " startmyapp2 str: " + JSON.stringify(str));
- featureAbility.startAbility(str)
- .then((data) => {
- console.info(TAG + " startmyapp2 successful. Data: " + JSON.stringify(data))
- }).catch((error) => {
- console.error(TAG + " startmyapp2 failed. Cause: " + JSON.stringify(error));
- })
- await sleep(1500);
- var request14 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication1.ServiceAbility_feature",
- "moduleName": "myapplication3",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request14);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_1400-------------");
- done();
- }, 1500);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1700
- * @tc.name Do not pass flags, connect to the service of another project
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_ConnectAbility_1700", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1700-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1700";
- var cmddif = "bm install -p data/test/ConnectDifferentApplication.hap";
- abilityDelegator.executeShellCommand(cmddif, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(1000);
- var request17 = {
- "bundleName": "com.example.different.hmservice",
- "abilityName": "com.example.different.ServiceAbility",
- "moduleName": "entry",
- }
- connectabillity(TAG, request17);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_1700-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1800
- * @tc.name Incorrect moduleName passed in
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1800", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1800-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1800";
- var request18 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication1.ServiceAbility_feature",
- "moduleName": "xxxxx",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request18);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_1800-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1900
- * @tc.name The target is atomized as hapA, and hapB is placed under the path
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1900", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1900-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1900";
- var cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
- "haps/entry/files";
- abilityDelegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(1000);
- var request19 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication1.ServiceAbility_feature",
- "moduleName": "myapplication3",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request19);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_1900-------------");
- done();
- }, 2000);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_2000
- * @tc.name Pass in parameters
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_ConnectAbility_2000", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_2000-------------");
- TAG = "FreeInstall_FA_ConnectAbility_2000";
- var cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
- "haps/entry/files";
- abilityDelegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(1000);
- var request20 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication5.ServiceAbility5",
- "moduleName": "myapplication5",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- "parameters": {
- "name": 1111, "key1": "value1", "site": "nice to meet you!"
- },
- }
- connectabillity(TAG, request20);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_2000-------------");
- done();
- }, 2000);
- });
- }
- )
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0300
+ * @tc.name Deviceid is empty,atomic service does not exist locally
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_ConnectAbility_0300", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0300-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0300";
+ var cmd3 = "cp data/test/ConnectFaMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
+ abilityDelegator.executeShellCommand(cmd3, (err: any, d: any) => {
+ console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+
+ setTimeout(async () => {
+ var request3 = {
+ "deviceId": "",
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication1.ServiceAbility_feature",
+ "moduleName": "myapplication1",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request3);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0300-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0400
+ * @tc.name Deviceid is empty,atomic service exists locally
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_ConnectAbility_0400", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0400-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0400";
+ var cmdapp11 = "bm install -p data/test/ConnectFaMyApplication11.hap";
+ abilityDelegator.executeShellCommand(cmdapp11, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ var request4 = {
+ "deviceId": "",
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication11.ServiceAbility",
+ "moduleName": "myapplication11",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request4);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0400-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0500
+ * @tc.name The bundleName passed in is different from the local
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_0500", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0500-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0500";
+
+ setTimeout(async () => {
+ var request5 = {
+ "bundleName": "com.example.different.hmservice",
+ "abilityName": "com.example.different.ServiceAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request5);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0500-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0600
+ * @tc.name Pass in an empty bundleName
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_0600", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0600-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0600";
+
+ setTimeout(async () => {
+ var request6 = {
+ "bundleName": "",
+ "abilityName": "com.example.myapplication1.ServiceAbility_feature",
+ "moduleName": "myapplication1",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request6);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0600-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0700
+ * @tc.name Pass in an empty abilityName
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_0700", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0700-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0700";
+
+ setTimeout(async () => {
+ var request7 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "",
+ "moduleName": "myapplication1",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request7);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0700-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0800
+ * @tc.name Incorrect deviceid passed in
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_0800", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0800-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0800";
+
+ setTimeout(async () => {
+ var request8 = {
+ "deviceId": "xxxxxx",
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication2.ServiceAbility",
+ "moduleName": "myapplication2",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request8);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0800-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_0900
+ * @tc.name Incorrect bundleName passed in
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_0900", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_0900-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_0900";
+
+ setTimeout(async () => {
+ var request9 = {
+ "bundleName": "com.example.xxx.hmservice",
+ "abilityName": "com.example.myapplication2.ServiceAbility",
+ "moduleName": "myapplication2",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request9);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_0900-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1000
+ * @tc.name Incorrect flags passed in,atomic service does not exist locally
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1000", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1000-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1000";
+
+ setTimeout(async () => {
+ var request10 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication2.ServiceAbility",
+ "moduleName": "myapplication2",
+ "flags": 1111111,
+ }
+ connectabillity(TAG, request10);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1100
+ * @tc.name Incorrect flags passed in,atomic service exists locally
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_ConnectAbility_1100", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1100-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1100";
+ var cmdapp2 = "bm install -p data/test/ConnectFaMyApplication2.hap";
+ abilityDelegator.executeShellCommand(cmdapp2, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+
+ setTimeout(async () => {
+ var request11 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication2.ServiceAbility",
+ "moduleName": "myapplication2",
+ "flags": "11",
+ }
+ connectabillity(TAG, request11);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1000-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1200
+ * @tc.name No atomic service under path
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1200", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1200-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1200";
+ var cmdrm = "rm -r /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/*";
+ abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ var request12 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication1.ServiceAbility_feature",
+ "moduleName": "myapplication3",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request12);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1200-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1300
+ * @tc.name The application is not in the foreground [start MainAbility2 first, then connect]
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1300", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1300-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1300";
+ var str = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.MainAbility2",
+ }
+ }
+ console.info(TAG + " startmainability2 str: " + JSON.stringify(str));
+ featureAbility.startAbility(str)
+ .then((data) => {
+ console.info(TAG + " startmainability2 successful. Data: " + JSON.stringify(data))
+ }).catch((error) => {
+ console.error(TAG + " startmainability2 failed. Cause: " + JSON.stringify(error));
+ })
+
+ setTimeout(async () => {
+ var request13 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication1.ServiceAbility_feature",
+ "moduleName": "myapplication3",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request13);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1300-------------");
+ done();
+ });
+
+ })
}
\ No newline at end of file
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets
index e565491bc46ce2e45a13ebee915798feb705af83..38282979cc69d511a3088c9a27d335706456b0a2 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/ConnectAbilityTest1.ets
@@ -24,186 +24,338 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry
export default function ConnectAbilityTest1() {
- var TAG = "";
- var Tempassert = "";
- var abilityDelegator = undefined
+ var TAG = "";
+ var Tempassert = "";
+ var abilityDelegator = undefined
- function sleep(time) {
- return new Promise((resolve) => setTimeout(resolve, time))
- }
+ function sleep(time) {
+ return new Promise((resolve) => setTimeout(resolve, time))
+ }
- describe('FreeInstall_FA_ConnectAbility', function () {
- beforeAll(async function (done) {
- console.info("FreeInstall_FA_ConnectAbility before all called");
- abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
- var cmd = "bm install -p data/test/MockService.hap";
- console.info("cmd : " + cmd)
- console.info(TAG + " abilityDelegator : " + JSON.stringify(abilityDelegator));
- abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => {
- console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
- abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => {
- console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
- abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => {
- console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- done();
- })
- });
-
- afterEach(async function (done) {
- console.info("FreeInstall_FA_ConnectAbility after each called");
- Tempassert = ""
- await sleep(1000);
- if ("FreeInstall_FA_ConnectAbility_1600" === TAG) {
- var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
- abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => {
- console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- }
- await sleep(500);
+ describe('FreeInstall_FA_ConnectAbilityOne', function () {
+ beforeAll(async function (done) {
+ console.info("FreeInstall_FA_ConnectAbility before all called");
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var cmd = "bm install -p data/test/MockService.hap";
+ console.info("cmd : " + cmd)
+ console.info(TAG + " abilityDelegator : " + JSON.stringify(abilityDelegator));
+ abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => {
+ console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
+ abilityDelegator.executeShellCommand(cmd1, (err: any, d: any) => {
+ console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
+ abilityDelegator.executeShellCommand(cmd2, (err: any, d: any) => {
+ console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
done();
- });
-
- function tips(msg) {
- Prompt.showToast({
- message: msg,
- duration: 2000,
- bottom: '150px'
- });
+ })
+ });
+
+ afterEach(async function (done) {
+ console.info("FreeInstall_FA_ConnectAbility after each called");
+ Tempassert = ""
+ if ("FreeInstall_FA_ConnectAbility_1600" === TAG) {
+ var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
+ abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => {
+ console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ }
+ done();
+ });
+
+ function tips(msg) {
+ Prompt.showToast({
+ message: msg,
+ duration: 2000,
+ bottom: '150px'
+ });
+ }
+
+ async function connectabillity(msg, request) {
+ console.info(msg + "START");
+ let options = {
+ onConnect: function (element, proxy) {
+ console.info("FreeInstall_FA_ConnectAbility onConnect success!!!")
+ console.info(msg + " onConnect success!!! ");
+ console.info(msg + " onConnect: " + JSON.stringify(element));
+ console.info(msg + " onConnect: " + JSON.stringify(proxy));
+ if (proxy == null) {
+ console.error("FreeInstall_FA_ConnectAbility proxy null");
+ return;
+ }
+ let option = new rpc.MessageOption();
+ let data = new rpc.MessageParcel();
+ let reply = new rpc.MessageParcel();
+ data.writeInterfaceToken("ohos.appexecfwk.IApplicationStateObserver");
+ proxy.sendRequest(0, data, reply, option);
+ Tempassert = "onConnect";
+ tips("连接成功");
+ },
+ onDisconnect: function (element) {
+ console.info("FreeInstall_FA_ConnectAbility onDisconnect success!!!")
+ console.info(msg + " onDisconnect success!!!");
+ console.info(msg + " onDisconnect: " + JSON.stringify(element));
+ Tempassert = "onDisconnect";
+ tips("连接断开");
+ },
+ onFailed: function (code) {
+ console.info("FreeInstall_FA_ConnectAbility onFailed!!!")
+ console.info(msg + " onFailed!!! ");
+ console.info(msg + " onFailed: " + JSON.stringify(code));
+ Tempassert = "onFailed";
+ tips("连接失败");
}
+ }
+ let connection = await featureAbility.connectAbility(request, options);
+ console.info(msg + "request:" + JSON.stringify(request));
+ console.info(msg + "options:" + JSON.stringify(options));
+ console.info(msg + "connection=" + JSON.stringify(connection));
+ console.info(msg + "END");
+ }
- async function connectabillity(msg, request) {
- console.info(msg + "START");
- let options = {
- onConnect: function (element, proxy) {
- console.info("FreeInstall_FA_ConnectAbility onConnect success!!!")
- console.info(msg + " onConnect success!!! ");
- console.info(msg + " onConnect: " + JSON.stringify(element));
- console.info(msg + " onConnect: " + JSON.stringify(proxy));
- if (proxy == null) {
- console.error("FreeInstall_FA_ConnectAbility proxy null");
- return;
- }
- let option = new rpc.MessageOption();
- let data = new rpc.MessageParcel();
- let reply = new rpc.MessageParcel();
- data.writeInterfaceToken("ohos.appexecfwk.IApplicationStateObserver");
- proxy.sendRequest(0, data, reply, option);
- Tempassert = "onConnect";
- tips("连接成功");
- },
- onDisconnect: function (element) {
- console.info("FreeInstall_FA_ConnectAbility onDisconnect success!!!")
- console.info(msg + " onDisconnect success!!!");
- console.info(msg + " onDisconnect: " + JSON.stringify(element));
- Tempassert = "onDisconnect";
- tips("连接断开");
- },
- onFailed: function (code) {
- console.info("FreeInstall_FA_ConnectAbility onFailed!!!")
- console.info(msg + " onFailed!!! ");
- console.info(msg + " onFailed: " + JSON.stringify(code));
- Tempassert = "onFailed";
- tips("连接失败");
- }
- }
- let connection = await featureAbility.connectAbility(request, options);
- console.info(msg + "request:" + JSON.stringify(request));
- console.info(msg + "options:" + JSON.stringify(options));
- console.info(msg + "connection=" + JSON.stringify(connection));
- console.info(msg + "END");
+
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1500
+ * @tc.name The application is not in the foreground,
+ [start another project first, then connect,atomic service does not exist locally]
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1500", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1500-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1500";
+ var cmddif = "bm install -p data/test/ConnectDifferentApplication.hap";
+ abilityDelegator.executeShellCommand(cmddif, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var str = {
+ "want": {
+ "bundleName": "com.example.different.hmservice",
+ "abilityName": "MainAbility",
+ }
+ };
+ featureAbility.startAbility(str)
+ .then((data) => {
+ console.info(TAG + " startother successful. Data: " + JSON.stringify(data))
+ }).catch((error) => {
+ console.error(TAG + " startother failed. Cause: " + JSON.stringify(error));
+ })
+ setTimeout(async () => {
+ var request15 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication5.ServiceAbility5",
+ "moduleName": "myapplication5",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
}
+ connectabillity(TAG, request15);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1500-------------");
+ done();
+ });
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1600
+ * @tc.name The application is not in the foreground,
+ [start another project first, then connect,atomic service exists locally]
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1600", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1600-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1600";
+ var cmdmyapp4 = "bm install -p data/test/ConnectFaMyApplication4.hap";
+ abilityDelegator.executeShellCommand(cmdmyapp4, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var str = {
+ "want": {
+ "bundleName": "com.example.different.hmservice",
+ "abilityName": "MainAbility",
+ }
+ };
+ featureAbility.startAbility(str)
+ .then((data) => {
+ console.info(TAG + " startother successful. Data: " + JSON.stringify(data))
+ }).catch((error) => {
+ console.error(TAG + " startother failed. Cause: " + JSON.stringify(error));
+ })
+ setTimeout(function () {
+ var request16 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication4.ServiceAbility4",
+ "moduleName": "myapplication4",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request16);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1600-------------");
+ done();
+ });
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1500
- * @tc.name The application is not in the foreground,
- [start another project first, then connect,atomic service does not exist locally]
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1500", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1500-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1500";
- var cmddif = "bm install -p data/test/ConnectDifferentApplication.hap";
- abilityDelegator.executeShellCommand(cmddif, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(1000);
- var str = {
- "want": {
- "bundleName": "com.example.different.hmservice",
- "abilityName": "MainAbility",
- }
- };
- featureAbility.startAbility(str)
- .then((data) => {
- console.info(TAG + " startother successful. Data: " + JSON.stringify(data))
- }).catch((error) => {
- console.error(TAG + " startother failed. Cause: " + JSON.stringify(error));
- })
- await sleep(1500);
- var request15 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication5.ServiceAbility5",
- "moduleName": "myapplication5",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request15);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onFailed");
- console.log("------------end FreeInstall_FA_ConnectAbility_1500-------------");
- done();
- }, 1500);
- });
-
- /*
- * @tc.number FreeInstall_FA_ConnectAbility_1600
- * @tc.name The application is not in the foreground,
- [start another project first, then connect,atomic service exists locally]
- * @tc.desc Function test
- * @tc.level 1
- */
- it("FreeInstall_FA_ConnectAbility_1600", 0, async function (done) {
- console.log("------------start FreeInstall_FA_ConnectAbility_1600-------------");
- TAG = "FreeInstall_FA_ConnectAbility_1600";
- var cmdmyapp4 = "bm install -p data/test/ConnectFaMyApplication4.hap";
- abilityDelegator.executeShellCommand(cmdmyapp4, (err: any, d: any) => {
- console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(1000);
- var str = {
- "want": {
- "bundleName": "com.example.different.hmservice",
- "abilityName": "MainAbility",
- }
- };
- featureAbility.startAbility(str)
- .then((data) => {
- console.info(TAG + " startother successful. Data: " + JSON.stringify(data))
- }).catch((error) => {
- console.error(TAG + " startother failed. Cause: " + JSON.stringify(error));
- })
- await sleep(1500);
- var request16 = {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication4.ServiceAbility4",
- "moduleName": "myapplication4",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- connectabillity(TAG, request16);
- setTimeout(function () {
- expect(Tempassert).assertEqual("onConnect");
- console.log("------------end FreeInstall_FA_ConnectAbility_1600-------------");
- done();
- }, 1500);
- });
- }
- )
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1400
+ * @tc.name The application is not in the foreground [start myapp2 first, then connect]
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1400", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1400-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1400";
+ var str = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication2.MainAbility",
+ }
+ }
+ console.info(TAG + " startmyapp2 str: " + JSON.stringify(str));
+ featureAbility.startAbility(str)
+ .then((data) => {
+ console.info(TAG + " startmyapp2 successful. Data: " + JSON.stringify(data))
+ }).catch((error) => {
+ console.error(TAG + " startmyapp2 failed. Cause: " + JSON.stringify(error));
+ })
+ setTimeout(() => {
+ var request14 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication1.ServiceAbility_feature",
+ "moduleName": "myapplication3",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request14);
+ setTimeout(async () => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500);
+ }, 2000)
+ done();
+ console.log("------------end FreeInstall_FA_ConnectAbility_1400-------------");
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1700
+ * @tc.name Do not pass flags, connect to the service of another project
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_ConnectAbility_1700", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1700-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1700";
+ var cmddif = "bm install -p data/test/ConnectDifferentApplication.hap";
+ await abilityDelegator.executeShellCommand(cmddif, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(() => {
+ var request17 = {
+ "bundleName": "com.example.different.hmservice",
+ "abilityName": "com.example.different.ServiceAbility",
+ "moduleName": "entry",
+ }
+ connectabillity(TAG, request17);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500);
+ }, 2000)
+ console.log("------------end FreeInstall_FA_ConnectAbility_1700-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1800
+ * @tc.name Incorrect moduleName passed in
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1800", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1800-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1800";
+
+ setTimeout(async () => {
+ var request18 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication1.ServiceAbility_feature",
+ "moduleName": "xxxxx",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request18);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1800-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_1900
+ * @tc.name The target is atomized as hapA, and hapB is placed under the path
+ * @tc.desc Function test
+ * @tc.level 1
+ */
+ it("FreeInstall_FA_ConnectAbility_1900", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_1900-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_1900";
+ var cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
+ "haps/entry/files";
+ await abilityDelegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ var request19 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication1.ServiceAbility_feature",
+ "moduleName": "myapplication3",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ connectabillity(TAG, request19);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onFailed");
+ }, 500)
+ }, 2000);
+ console.log("------------end FreeInstall_FA_ConnectAbility_1900-------------");
+ done();
+ });
+
+ /*
+ * @tc.number FreeInstall_FA_ConnectAbility_2000
+ * @tc.name Pass in parameters
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_ConnectAbility_2000", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_ConnectAbility_2000-------------");
+ TAG = "FreeInstall_FA_ConnectAbility_2000";
+ var cmdmyapp5 = "cp data/test/ConnectFaMyApplication5.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
+ "haps/entry/files";
+ abilityDelegator.executeShellCommand(cmdmyapp5, (err: any, d: any) => {
+ console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ var request20 = {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication5.ServiceAbility5",
+ "moduleName": "myapplication5",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ "parameters": {
+ "name": 1111, "key1": "value1", "site": "nice to meet you!"
+ },
+ }
+ connectabillity(TAG, request20);
+ setTimeout(() => {
+ expect(Tempassert).assertEqual("onConnect");
+ }, 500)
+ }, 4000)
+ done();
+ console.log("------------end FreeInstall_FA_ConnectAbility_2000-------------");
+ });
+ }
+ )
}
\ No newline at end of file
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets
index f2b84b5796ddac70ace6d58750429150c694a266..aa2458c2368fb48ec5d92f50100d62318764c5bb 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/List.test.ets
@@ -12,13 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import ConnectAbilityTest1 from './ConnectAbilityTest1'
-import ConnectAbilityTest from './ConnectAbilityTest'
import connectAbilityTest_PA from './connectAbilityTest_PA'
+import ConnectAbilityTest from './ConnectAbilityTest'
+import ConnectAbilityTest1 from './ConnectAbilityTest1'
-export default function testsuite() {
- ConnectAbilityTest1();
- ConnectAbilityTest();
- connectAbilityTest_PA();
-}
\ No newline at end of file
+export default function testsuite() {
+ connectAbilityTest_PA();
+ ConnectAbilityTest();
+ ConnectAbilityTest1();
+}
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets
index 4299794aa59c635b3c6da78178c9863b26e89c9e..eb881f329b0e0e150018be662d788eb9fae51037 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility/test/connectAbilityTest_PA.ets
@@ -26,7 +26,7 @@ export default function connectAbilityTest_PA() {
var subscriber;
var subscribeInfo = {
events: ["service_event", "service2_event", "service3_event", "service4_event", "service5_event",
- "service6_event", "service7_event", "service8_event", "service9_event", "service10_event", "service11_event"]
+ "service6_event", "service7_event", "service8_event", "service9_event", "service10_event", "service11_event"]
};
function sleep(time) {
@@ -39,8 +39,8 @@ export default function connectAbilityTest_PA() {
.then((data) => {
console.info(msg + ' startService successful. Data: ' + JSON.stringify(data));
}).catch((error) => {
- console.error(msg + ' startService failed. Cause: ' + JSON.stringify(error));
- })
+ console.error(msg + ' startService failed. Cause: ' + JSON.stringify(error));
+ })
}
function checkParameters(msg1, data) {
@@ -144,14 +144,14 @@ export default function connectAbilityTest_PA() {
dataAssert = ""
await sleep(1000);
if ("FreeInstall_FA_ConnectAbility_PA_1100" === TAG) {
- var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
- abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => {
- console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- }
- await sleep(500);
- done();
- });
+ var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
+ abilityDelegator.executeShellCommand(cmd14, (err: any, d: any) => {
+ console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ }
+ await sleep(500);
+ done();
+ });
/*
* @tc.number FreeInstall_FA_ConnectAbility_PA_0100
@@ -163,24 +163,23 @@ export default function connectAbilityTest_PA() {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0100-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0100";
var cmdmyapp7 = "cp data/test/ConnectFaMyApplication7.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
- "haps/entry/files";
+ "haps/entry/files";
abilityDelegator.executeShellCommand(cmdmyapp7, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- var str1 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility",
- }
- };
- startService(TAG, str1);
- setTimeout(function () {
+ setTimeout(async () => {
+ var str1 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility",
+ }
+ };
+ startService(TAG, str1);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0100-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -196,20 +195,19 @@ export default function connectAbilityTest_PA() {
abilityDelegator.executeShellCommand(cmdapp9, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- var str2 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility2",
- }
- };
- startService(TAG, str2);
- setTimeout(function () {
+ setTimeout(async () => {
+ var str2 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility2",
+ }
+ };
+ startService(TAG, str2);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0200-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -221,19 +219,19 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0300", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0300-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0300";
- var str3 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility3",
- }
- };
- startService(TAG, str3);
- setTimeout(function () {
+ setTimeout(async () => {
+ var str3 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility3",
+ }
+ };
+ startService(TAG, str3);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0300-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -244,20 +242,20 @@ export default function connectAbilityTest_PA() {
*/
it("FreeInstall_FA_ConnectAbility_PA_0400", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0400-------------");
- TAG = "FreeInstall_FA_ConnectAbility_PA_0400";
- var str4 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility4",
- }
- };
- startService(TAG, str4);
- setTimeout(function () {
+ setTimeout(async () => {
+ TAG = "FreeInstall_FA_ConnectAbility_PA_0400";
+ var str4 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility4",
+ }
+ };
+ startService(TAG, str4);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0400-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -273,20 +271,19 @@ export default function connectAbilityTest_PA() {
abilityDelegator.executeShellCommand(cmdin, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- var str5 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility5",
- }
- };
- startService(TAG, str5);
- setTimeout(function () {
+ setTimeout(async () => {
+ var str5 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility5",
+ }
+ };
+ startService(TAG, str5);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0500-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -298,19 +295,19 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0600", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0600-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0600";
- var str6 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility6",
- }
- };
- startService(TAG, str6);
- setTimeout(function () {
+ setTimeout(async () => {
+ var str6 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility6",
+ }
+ };
+ startService(TAG, str6);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0600-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -322,19 +319,20 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0700", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0700-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0700";
- var str7 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility7",
- }
- };
- startService(TAG, str7);
- setTimeout(function () {
+
+ setTimeout(async () => {
+ var str7 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility7",
+ }
+ };
+ startService(TAG, str7);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0700-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -346,19 +344,20 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_0800", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_0800-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_0800";
- var str8 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility8",
- }
- };
- startService(TAG, str8);
- setTimeout(function () {
+
+ setTimeout(async () => {
+ var str8 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility8",
+ }
+ };
+ startService(TAG, str8);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0800-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -374,20 +373,21 @@ export default function connectAbilityTest_PA() {
abilityDelegator.executeShellCommand(cmdrm, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- var str9 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility9",
- }
- };
- startService(TAG, str9);
- setTimeout(function () {
+
+ setTimeout(async () => {
+ await sleep(500);
+ var str9 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility9",
+ }
+ };
+ startService(TAG, str9);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_0900-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -399,19 +399,20 @@ export default function connectAbilityTest_PA() {
it("FreeInstall_FA_ConnectAbility_PA_1000", 0, async function (done) {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_1000-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_1000";
- var str10 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility10",
- }
- };
- startService(TAG, str10);
- setTimeout(function () {
+
+ setTimeout(async () => {
+ var str10 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility10",
+ }
+ };
+ startService(TAG, str10);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onFailed");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_1000-------------");
- done();
}, 4000);
+ done();
});
/*
@@ -424,24 +425,24 @@ export default function connectAbilityTest_PA() {
console.log("------------start FreeInstall_FA_ConnectAbility_PA_1100-------------");
TAG = "FreeInstall_FA_ConnectAbility_PA_1100";
var cmdmyapp8 = "cp data/test/ConnectFaMyApplication8.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
- "haps/entry/files";
+ "haps/entry/files";
abilityDelegator.executeShellCommand(cmdmyapp8, (err: any, d: any) => {
console.info(TAG + " executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(1000);
- var str11 = {
- "want": {
- "bundleName": "com.example.myapplication.hmservice",
- "abilityName": "com.example.myapplication.ServiceAbility11",
- }
- };
- startService(TAG, str11);
- setTimeout(function () {
+
+ setTimeout(async () => {
+ var str11 = {
+ "want": {
+ "bundleName": "com.example.myapplication.hmservice",
+ "abilityName": "com.example.myapplication.ServiceAbility11",
+ }
+ };
+ startService(TAG, str11);
console.info(TAG + " SubscribeCallBack data: " + JSON.stringify(dataAssert));
expect(dataAssert).assertEqual("onConnect");
console.log("------------end FreeInstall_FA_ConnectAbility_PA_1100-------------");
- done();
}, 4000);
+ done();
});
}
)
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets
index aa1409851eb7fb28004f07317e1dfda41bba854e..e8365db76032242ed94923794cb515d0e0e77555 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/actsfreeinstallconnectabilityfatest/entry/src/main/ets/MainAbility2/app.ets
@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility';
export default {
onCreate() {
console.info('Application onCreate')
- setTimeout(function () {
+ setTimeout(()=> {
featureAbility.terminateSelf()
.then((data) => {
console.info('[Demo] MainAbility2 terminateself succeeded: ' + data);
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json
index 8f91deeb5036e3c086c8cf2dd76f7cc48db8bbd9..a44ae73f28adf7a47dbf4173dbf6f558b3894485 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectdifferentapplication/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/entry/src/main/config.json
index 703f0577eae146eaa0b690c75865e82df32afe55..72d22a6dabe6a140ff5c3ff7f5ab8ff8efa89002 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication1/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/entry/src/main/config.json
index c9c5fcbc8c1809937dd4ad3233f736d4d53af693..7142d1ac2e1f44d85e03e785afad711cd71ca9f8 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication10/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/entry/src/main/config.json
index 479a7ba322aa1f377769d0e16b288179fcab7d56..08da3726530de9713e7b7af3735b84668c5e4a1e 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication11/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/entry/src/main/config.json
index 7f010dcdae4e669ff6d6f705646d921cbed6f850..0aa213f4efd9f8cf1d47e7c8b160b462ddd66345 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication2/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/entry/src/main/config.json
index d1f33c1f4ebdb047fa85ae995612dddcd86100e4..62552e6ef1d8daa4c186ddbf35456d8fd1a659a4 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication4/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/entry/src/main/config.json
index 7a109ddf89c5462ed09dcd56abac2e780b08fceb..b4aff27cf1b30a96ffeb662468bbc3492b802cc0 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication5/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/entry/src/main/config.json
index 6d5e2c816058156690c09c387696e3be51590203..c8d4f645ff73d94728bd8a11165cdfcabc5260da 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication6/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/entry/src/main/config.json
index d9aa6532c25b50ebafc085db7afd2e7b04b9c810..911a5f7486df757bcc1cefe02860b7f3fe0e4b19 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication7/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/entry/src/main/config.json
index bc9ea9babe948f2c9e1179f0227ee3a07d5662c1..6e36e87bfaf0459c8503e4c9f3ff84ac72506fa7 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication8/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/entry/src/main/config.json
index 757fd90f50233b0c623bb58343119bbf2b1e4484..842927fc82bb3043c919bd46a311c2d8fa6da9e7 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilityfatest/connectfamyapplication9/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json
index 47f0bca2d9956d38a116df21d565011472d37045..119d4f70cb81bbf3d0a5d160f753ea5ea9238a33 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/actsfreeinstallconnectabilitystagetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -127,6 +128,12 @@
},
{
"name": "ohos.permission.LISTEN_BUNDLE_CHANGE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/module.json
index 1a3c2e9173298878d9b23c8d7f8513008841980d..75fe4e0258090ac2a915c927b612300a8354577f 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication0/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/module.json
index 8b9c287be9a857cd7cd1087b3a8b54f85ede0bca..609fcefb22c536b15b2d806d36c270fbd590a095 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication1/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication1_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/module.json
index fce091ee5fccedbeeb5274cd179b889ff3a61335..0753984bb59be5c95cae46bdb14d7601ab8cd1db 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication2/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication2_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/module.json
index 25a7ed0e2a6651ba7c28063e01ca3d750f0bb973..cafff6f8341b79e912473480a3d6a0ec69a438fb 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication3/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication3_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/module.json
index cb1a0efba3f82c9b46cfe215035f6346a1d8eebd..e0844712b1be4a9c4a5cd01bc4ffb9e82065eb75 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication4/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication4_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/module.json
index 6f03fd45fe31968ae3335059a02807e055b44f00..232318e7dc97ac97f5735f84f848b49b7fb1e2a9 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication5/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication5_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/module.json
index c13e1b937c97b9cd294b1ce7ac6027b5235e30bf..7e0b93abd1c4c8791949554dbb5ce90f66284538 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication6/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication6_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/module.json
index 67b9e978b8350ebb6c81a513711d84171d362027..6744f7fc629030589a367c33dc39dcbc15977298 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication7/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication7_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/module.json
index 1fdc3aa1c43acaf76c27107539cc3f0cbe0470a1..478e6066b8bb697d139d09f01e67e0960643ba5b 100644
--- a/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/connectabilitystagetest/connectstagemyapplication8/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication8_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json
index a004f10a8b3aca76970352096e3bb3f8f2323bdf..cd3297539c7ca54522e1ff0772576beee51e0a5d 100644
--- a/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/mockservice/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"requestPermissions": [ {"name": "ohos.permission.INSTALL_BUNDLE"}],
diff --git a/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json
index a004f10a8b3aca76970352096e3bb3f8f2323bdf..cd3297539c7ca54522e1ff0772576beee51e0a5d 100644
--- a/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/mockservicetimeout/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"requestPermissions": [ {"name": "ohos.permission.INSTALL_BUNDLE"}],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json
index 97395cdbcdb1ab33a3816a1f542469fc0397a015..22e9f23d20f69da208b361df93a323035c33fe65 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/config.json
@@ -19,6 +19,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
@@ -133,6 +134,14 @@
{
"reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE",
"name": "ohos.permission.LISTEN_BUNDLE_CHANGE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets
index 5520cafb598681e15e1865a692ab3625e1010040..fdb535cd8c0e5211210e681105fe2bf335e008a3 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsfreeinstallstartabilityfatest/entry/src/main/ets/MainAbility/test/StartAbility.test2.ets
@@ -23,214 +23,211 @@ import commonEvent from '@ohos.commonEvent';
export default function startAbilityTest2() {
- describe('startAbilityTest2', function () {
+ describe('startAbilityTest2', function () {
- var TAG = "";
+ var TAG = "";
- var delegator = AbilityDelegatorRegistry.getAbilityDelegator();
+ var delegator = AbilityDelegatorRegistry.getAbilityDelegator();
- function sleep(time) {
- return new Promise((resolve) => setTimeout(resolve, time))
- }
+ function sleep(time) {
+ return new Promise((resolve) => setTimeout(resolve, time))
+ }
- beforeAll(async function (done) {
- console.info("StartAbilityForResult before all called");
- var cmd = "bm install -p data/test/MockService.hap";
- console.info("cmd : " + cmd)
- delegator.executeShellCommand(cmd, (err: any, d: any) => {
- console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
- delegator.executeShellCommand(cmd1, (err: any, d: any) => {
- console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
- delegator.executeShellCommand(cmd2, (err: any, d: any) => {
- console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd3 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
- delegator.executeShellCommand(cmd3, (err: any, d: any) => {
- console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- done();
- })
- });
+ beforeAll(async function (done) {
+ console.info("StartAbilityForResult before all called");
+ var cmd = "bm install -p data/test/MockService.hap";
+ console.info("cmd : " + cmd)
+ delegator.executeShellCommand(cmd, (err: any, d: any) => {
+ console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await sleep(500);
+ var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
+ delegator.executeShellCommand(cmd1, (err: any, d: any) => {
+ console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await sleep(500);
+ var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
+ delegator.executeShellCommand(cmd2, (err: any, d: any) => {
+ console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await sleep(500);
+ var cmd3 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
+ "entry/files";
+ delegator.executeShellCommand(cmd3, (err: any, d: any) => {
+ console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ done();
+ })
+ });
- afterEach(async function (done) {
- console.info("StartAbilityTest after each called");
- if ("FreeInstall_FA_Local_StartAbility_2000" === TAG) {
- var cmd4 = "bm uninstall -n com.example.qianyiyingyong.hmservice";
- delegator.executeShellCommand(cmd4, (err: any, d: any) => {
- console.info("executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- }
+ afterEach(async function (done) {
+ console.info("StartAbilityTest after each called");
+ if ("FreeInstall_FA_Local_StartAbility_2000" === TAG) {
+ var cmd4 = "bm uninstall -n com.example.qianyiyingyong.hmservice";
+ delegator.executeShellCommand(cmd4, (err: any, d: any) => {
+ console.info("executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await sleep(500);
+ }
- if ("FreeInstall_FA_Local_StartAbility_2500" === TAG) {
- var cmd5 = "bm uninstall -n com.ohos.hag.famanager";
- delegator.executeShellCommand(cmd5, (err: any, d: any) => {
- console.info("executeShellCommand5 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- }
- await sleep(500);
- done();
- });
+ if ("FreeInstall_FA_Local_StartAbility_2500" === TAG) {
+ var cmd5 = "bm uninstall -n com.ohos.hag.famanager";
+ delegator.executeShellCommand(cmd5, (err: any, d: any) => {
+ console.info("executeShellCommand5 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ }
+ await sleep(500);
+ done();
+ });
- /*
- * @tc.number FreeInstall_FA_Local_StartAbility_1900
- * @tc.name The current service is not in the foreground. Page a jumps to page B first.
- There are HAP packages that need not be installed under the specified path
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_Local_StartAbility_1900", 0, async function (done) {
- console.info("------------start FreeInstall_FA_Local_StartAbility_1900-------------");
- TAG = "FreeInstall_FA_Local_StartAbility_1900";
- let wrong;
- var str1 = {
- 'want': {
- "bundleName": "com.open.harmony.startAbility",
- "abilityName": "com.open.harmony.startAbility.PageAbility",
- "moduleName": "entry",
- }
- }
- featureAbility.startAbility(str1)
- .then((data) => {
- console.info(TAG + ' StartAbility successful. Promise Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
- })
- await sleep(3000);
- var str = {
- 'want': {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND
- }
- }
- await featureAbility.startAbility(str).then((data) => {
- console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
- }).catch((error) => {
- wrong = error;
- console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
- });
- await sleep(2000);
- expect(wrong.code).assertEqual(13);
- console.info("------------end FreeInstall_FA_Local_StartAbility_1900-------------");
- done();
+ /*
+ * @tc.number FreeInstall_FA_Local_StartAbility_1900
+ * @tc.name The current service is not in the foreground. Page a jumps to page B first.
+ There are HAP packages that need not be installed under the specified path
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_Local_StartAbility_1900", 0, async function (done) {
+ console.info("------------start FreeInstall_FA_Local_StartAbility_1900-------------");
+ TAG = "FreeInstall_FA_Local_StartAbility_1900";
+ let wrong;
+ var str1 = {
+ 'want': {
+ "bundleName": "com.open.harmony.startAbility",
+ "abilityName": "com.open.harmony.startAbility.PageAbility",
+ "moduleName": "entry",
+ }
+ }
+ featureAbility.startAbility(str1)
+ .then((data) => {
+ console.info(TAG + ' StartAbility successful. Promise Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
+ })
+ setTimeout(async () => {
+ var str = {
+ 'want': {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND
+ }
+ }
+ await featureAbility.startAbility(str).then((data) => {
+ console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
+ }).catch((error) => {
+ wrong = error;
+ console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
});
+ expect(wrong.code).assertEqual(13);
+ }, 2000)
+ console.info("------------end FreeInstall_FA_Local_StartAbility_1900-------------");
+ done();
+ });
- /*
- * @tc.number FreeInstall_FA_Local_StartAbility_2000
- * @tc.name The current service is not in the foreground. Page a jumps to page B first.
- The atomized HAP package has been installed
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_Local_StartAbility_2000", 0, async function (done) {
- console.info("------------start FreeInstall_FA_Local_StartAbility_2000-------------");
- TAG = "FreeInstall_FA_Local_StartAbility_2000";
- var cmd2000 = "bm install -p data/test/AtomizationFaEntry.hap";
- delegator.executeShellCommand(cmd2000, (err: any, d: any) => {
- console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- let wrong;
- var str1 = {
- 'want': {
- "bundleName": "com.open.harmony.startAbility",
- "abilityName": "com.open.harmony.startAbility.PageAbility",
- "moduleName": "entry",
- }
- }
- featureAbility.startAbility(str1)
- .then((data) => {
- console.info(TAG + ' StartAbility successful. Promise Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
- })
- await sleep(3000);
- var str = {
- 'want': {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND
- }
- }
- await featureAbility.startAbility(str).then((data) => {
- console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
- }).catch((error) => {
- wrong = error;
- console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
- });
- await sleep(2000);
- expect(wrong.code).assertEqual(13);
- console.info("------------end FreeInstall_FA_Local_StartAbility_2000-------------");
- await sleep(2000);
- done();
+ /*
+ * @tc.number FreeInstall_FA_Local_StartAbility_2000
+ * @tc.name The current service is not in the foreground. Page a jumps to page B first.
+ The atomized HAP package has been installed
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_Local_StartAbility_2000", 0, async function (done) {
+ console.info("------------start FreeInstall_FA_Local_StartAbility_2000-------------");
+ TAG = "FreeInstall_FA_Local_StartAbility_2000";
+ var cmd2000 = "bm install -p data/test/AtomizationFaEntry.hap";
+ delegator.executeShellCommand(cmd2000, (err: any, d: any) => {
+ console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await sleep(500);
+ let wrong;
+ var str1 = {
+ 'want': {
+ "bundleName": "com.open.harmony.startAbility",
+ "abilityName": "com.open.harmony.startAbility.PageAbility",
+ "moduleName": "entry",
+ }
+ }
+ featureAbility.startAbility(str1)
+ .then((data) => {
+ console.info(TAG + ' StartAbility successful. Promise Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
+ })
+ setTimeout(async () => {
+ var str = {
+ 'want': {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND
+ }
+ }
+ await featureAbility.startAbility(str).then((data) => {
+ console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
+ }).catch((error) => {
+ wrong = error;
+ console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
});
+ await sleep(2000);
+ expect(wrong.code).assertEqual(13);
+ }, 2000)
+ console.info("------------end FreeInstall_FA_Local_StartAbility_2000-------------");
+ done();
+ });
- /*
- * @tc.number FreeInstall_FA_Local_StartAbility_2500
- * @tc.name FA Service Center installation free timeout
- * @tc.desc Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_Local_StartAbility_2500", 0, async function (done) {
- console.info("------------start FreeInstall_FA_Local_StartAbility_2500-------------");
- TAG = "FreeInstall_FA_Local_StartAbility_2500";
- var cmd2500 = "bm uninstall -n com.ohos.hag.famanager";
- delegator.executeShellCommand(cmd2500, (err: any, d: any) => {
- console.info("executeShellCommand2500 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd2501 = "bm install -p data/test/MockServiceTimeout.hap";
- delegator.executeShellCommand(cmd2501, (err: any, d: any) => {
- console.info("executeShellCommand2501 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd2502 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
- delegator.executeShellCommand(cmd2502, (err: any, d: any) => {
- console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd2503 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
- delegator.executeShellCommand(cmd2503, (err: any, d: any) => {
- console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- var cmd2504 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" +
- "/entry/files";
- delegator.executeShellCommand(cmd2504, (err: any, d: any) => {
- console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await sleep(500);
- let wrong;
- var str = {
- 'want': {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- }
- featureAbility.startAbility(str).then((data) => {
- console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
- }).catch((error) => {
- wrong = error;
- console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
- });
- await sleep(35000);
- expect(wrong.code).assertEqual(3);
- console.info("------------end FreeInstall_FA_Local_StartAbility_2500-------------");
- done();
+ /*
+ * @tc.number FreeInstall_FA_Local_StartAbility_2500
+ * @tc.name FA Service Center installation free timeout
+ * @tc.desc Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_Local_StartAbility_2500", 0, async function (done) {
+ console.info("------------start FreeInstall_FA_Local_StartAbility_2500-------------");
+ TAG = "FreeInstall_FA_Local_StartAbility_2500";
+ var cmd2500 = "bm uninstall -n com.ohos.hag.famanager";
+ delegator.executeShellCommand(cmd2500, (err: any, d: any) => {
+ console.info("executeShellCommand2500 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var cmd2501 = "bm install -p data/test/MockServiceTimeout.hap";
+ delegator.executeShellCommand(cmd2501, (err: any, d: any) => {
+ console.info("executeShellCommand2501 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var cmd2502 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
+ delegator.executeShellCommand(cmd2502, (err: any, d: any) => {
+ console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var cmd2503 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
+ delegator.executeShellCommand(cmd2503, (err: any, d: any) => {
+ console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ var cmd2504 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps" +
+ "/entry/files";
+ delegator.executeShellCommand(cmd2504, (err: any, d: any) => {
+ console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ let wrong;
+ var str = {
+ 'want': {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ }
+ featureAbility.startAbility(str).then((data) => {
+ console.log(TAG + ": startAbility success. data: " + JSON.stringify(data));
+ }).catch((error) => {
+ wrong = error;
+ console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
});
+ await sleep(35000);
+ expect(wrong.code).assertEqual(3);
+ }, 2000)
+ console.info("------------end FreeInstall_FA_Local_StartAbility_2500-------------");
+ done();
+ });
- console.info("-------------FA model--> startAbilityXTS Test end----------------")
- })
+ console.info("-------------FA model--> startAbilityXTS Test end----------------")
+ })
}
\ No newline at end of file
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json
index 9e0d55cc184ebced325cd195b9331128a6eaa16a..e2a3d25c2b71227c182bf28786b744189281b29e 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets
index 7b12f12ab40b4f04131c8bd4f025a4284131e11a..06e87987a486a82d5ae429e650e32d0829d8d4f1 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/actsstartabilitynotargetbundlelistfatest/entry/src/main/ets/MainAbility/test/StartAbility.test.ets
@@ -22,189 +22,191 @@ import wantConstant from '@ohos.ability.wantConstant';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
export default function StartAbilityTest() {
- var TAG = "";
+ var TAG = "";
- describe('StartAbilityTest', function () {
- var delegator = AbilityDelegatorRegistry.getAbilityDelegator();
- beforeAll(async function (done) {
- console.info("StartAbilityTest before all called");
- var cmd = "bm install -p data/test/MockService.hap";
- console.info("cmd : " + cmd)
- delegator.executeShellCommand(cmd, (err: any, d: any) => {
- console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await Utils.sleep(500);
- var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
- delegator.executeShellCommand(cmd1, (err: any, d: any) => {
- console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await Utils.sleep(500);
- var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
- delegator.executeShellCommand(cmd2, (err: any, d: any) => {
- console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await Utils.sleep(500);
- var cmd3 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
- delegator.executeShellCommand(cmd3, (err: any, d: any) => {
- console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- done();
- })
- });
+ describe('StartAbilityTest', function () {
+ var delegator = AbilityDelegatorRegistry.getAbilityDelegator();
+ beforeAll(async function (done) {
+ console.info("StartAbilityTest before all called");
+ var cmd = "bm install -p data/test/MockService.hap";
+ console.info("cmd : " + cmd)
+ delegator.executeShellCommand(cmd, (err: any, d: any) => {
+ console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await Utils.sleep(500);
+ var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
+ delegator.executeShellCommand(cmd1, (err: any, d: any) => {
+ console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await Utils.sleep(500);
+ var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
+ delegator.executeShellCommand(cmd2, (err: any, d: any) => {
+ console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await Utils.sleep(500);
+ var cmd3 = "cp data/test/AtomizationFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
+ "entry/files";
+ delegator.executeShellCommand(cmd3, (err: any, d: any) => {
+ console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ done();
+ })
+ });
- afterEach(async function (done) {
- console.info("StartAbilityTest after each called");
- if ("FreeInstall_FA_StartAbility_2800" === TAG || "FreeInstall_FA_StartAbility_3900") {
- var cmd5 = "bm uninstall -n com.example.qianyiyingyong.hmservice";
- delegator.executeShellCommand(cmd5, (err: any, d: any) => {
- console.info("executeShellCommand5: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- }
- await Utils.sleep(500);
- if ("FreeInstall_FA_StartAbility_3900" === TAG) {
- var cmd4 = "bm uninstall -n com.ohos.hag.famanager";
- delegator.executeShellCommand(cmd4, (err: any, d: any) => {
- console.info("executeShellCommand4: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- }
- await Utils.sleep(500);
- done();
- });
+ afterEach(async function (done) {
+ console.info("StartAbilityTest after each called");
+ if ("FreeInstall_FA_StartAbility_2800" === TAG || "FreeInstall_FA_StartAbility_3900") {
+ var cmd5 = "bm uninstall -n com.example.qianyiyingyong.hmservice";
+ delegator.executeShellCommand(cmd5, (err: any, d: any) => {
+ console.info("executeShellCommand5: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ }
+ await Utils.sleep(500);
+ if ("FreeInstall_FA_StartAbility_3900" === TAG) {
+ var cmd4 = "bm uninstall -n com.ohos.hag.famanager";
+ delegator.executeShellCommand(cmd4, (err: any, d: any) => {
+ console.info("executeShellCommand4: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ }
+ await Utils.sleep(500);
+ done();
+ });
- /*
- * @tc.number: FreeInstall_FA_StartAbility_2600
- * @tc.name: startAbility: NoTargetBundleList,free install successfully.
- * @tc.desc: Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_StartAbility_2600", 0, async function (done) {
- console.log("------------start FreeInstall_FA_StartAbility_2600-------------");
- TAG = "FreeInstall_FA_StartAbility_2600";
- let details;
- var str = {
- 'want': {
- "deviceId": "",
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- }
- await featureAbility.startAbility(str).then((data) => {
- details = data;
- console.info(TAG + ' StartAbility successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
- })
- await Utils.sleep(2000);
- expect(details).assertEqual(0);
- done();
- });
+ /*
+ * @tc.number: FreeInstall_FA_StartAbility_2600
+ * @tc.name: startAbility: NoTargetBundleList,free install successfully.
+ * @tc.desc: Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_StartAbility_2600", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_StartAbility_2600-------------");
+ TAG = "FreeInstall_FA_StartAbility_2600";
+ setTimeout(async () => {
+ let details;
+ var str = {
+ 'want': {
+ "deviceId": "",
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ }
+ await featureAbility.startAbility(str).then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbility successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
+ })
+ expect(details).assertEqual(0);
+ }, 2000)
+ done();
+ });
- /*
- * @tc.number: FreeInstall_FA_StartAbility_2700
- * @tc.name: startAbility: NoTargetBundleList and yuanzihua already installed,startAbility successfully.
- * @tc.desc: Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_StartAbility_2700", 0, async function (done) {
- console.log("------------start FreeInstall_FA_StartAbility_2700-------------");
- TAG = "FreeInstall_FA_StartAbility_2700";
- var cmd6 = "bm install -p data/test/AtomizationFaEntry.hap";
- delegator.executeShellCommand(cmd6, (err: any, d: any) => {
- console.info("executeShellCommand6: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await Utils.sleep(500);
- let details;
- var str = {
- 'want': {
- "deviceId": "",
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- }
- await featureAbility.startAbility(str).then((data) => {
- details = data;
- console.info(TAG + ' StartAbility successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
- })
- await Utils.sleep(2000);
- expect(details).assertEqual(0);
- done();
- });
+ /*
+ * @tc.number: FreeInstall_FA_StartAbility_2700
+ * @tc.name: startAbility: NoTargetBundleList and yuanzihua already installed,startAbility successfully.
+ * @tc.desc: Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_StartAbility_2700", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_StartAbility_2700-------------");
+ TAG = "FreeInstall_FA_StartAbility_2700";
+ var cmd6 = "bm install -p data/test/AtomizationFaEntry.hap";
+ delegator.executeShellCommand(cmd6, (err: any, d: any) => {
+ console.info("executeShellCommand6: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ let details;
+ var str = {
+ 'want': {
+ "deviceId": "",
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ }
+ await featureAbility.startAbility(str).then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbility2700 successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbility2700 failed. error: ' + JSON.stringify(error));
+ })
+ expect(details).assertEqual(0);
+ }, 2000)
+ done();
+ });
- /*
- * @tc.number: FreeInstall_FA_StartAbility_2800
- * @tc.name: startAbility: The same application does not need to check targetbundlelist,
- start feature hap successfully.
- * @tc.desc: Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_StartAbility_2800", 0, async function (done) {
- console.log("------------start FreeInstall_FA_StartAbility_2800-------------");
- TAG = "FreeInstall_FA_StartAbility_2800";
- var cmd7 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaEntry.hap";
- delegator.executeShellCommand(cmd7, (err: any, d: any) => {
- console.info("executeShellCommand7 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await Utils.sleep(500);
- var cmd8 = "cp data/test/FaMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
- delegator.executeShellCommand(cmd8, (err: any, d: any) => {
- console.info("executeShellCommand8 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- await Utils.sleep(500);
- let details;
- var str = {
- 'want': {
- "bundleName": "com.open.harmony.startAbility",
- "abilityName": "com.example.myapplication1.MainAbility1",
- "moduleName": "myapplication1",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- }
- await featureAbility.startAbility(str).then((data) => {
- details = data;
- console.info(TAG + ' StartAbility successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
- })
- await Utils.sleep(2000);
- expect(details).assertEqual(0);
- done();
- });
+ /*
+ * @tc.number: FreeInstall_FA_StartAbility_2800
+ * @tc.name: startAbility: The same application does not need to check targetbundlelist,
+ start feature hap successfully.
+ * @tc.desc: Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_StartAbility_2800", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_StartAbility_2800-------------");
+ TAG = "FreeInstall_FA_StartAbility_2800";
+ var cmd7 = "rm /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files/AtomizationFaEntry.hap";
+ delegator.executeShellCommand(cmd7, (err: any, d: any) => {
+ console.info("executeShellCommand7 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ await Utils.sleep(500);
+ var cmd8 = "cp data/test/FaMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
+ "entry/files";
+ delegator.executeShellCommand(cmd8, (err: any, d: any) => {
+ console.info("executeShellCommand8 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ setTimeout(async () => {
+ let details;
+ var str = {
+ 'want': {
+ "bundleName": "com.open.harmony.startAbility",
+ "abilityName": "com.example.myapplication1.MainAbility1",
+ "moduleName": "myapplication1",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ }
+ await featureAbility.startAbility(str).then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbility successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
+ })
+ expect(details).assertEqual(0);
+ }, 2000)
+ done();
+ });
- /*
- * @tc.number: FreeInstall_FA_StartAbility_3900
- * @tc.name: startAbility: The same application does not need to check targetbundlelist,add BACKGROUND flags
- start feature hap successfully.
- * @tc.desc: Function test
- * @tc.level 0
- */
- it("FreeInstall_FA_StartAbility_3900", 0, async function (done) {
- console.log("------------start FreeInstall_FA_StartAbility_3900-------------");
- TAG = "FreeInstall_FA_StartAbility_3900";
- let details;
- var str = {
- 'want': {
- "bundleName": "com.open.harmony.startAbility",
- "abilityName": "com.example.myapplication1.MainAbility1",
- "moduleName": "myapplication1",
- "flags": wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE|wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- }
- await featureAbility.startAbility(str).then((data) => {
- details = data;
- console.info(TAG + ' StartAbility successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
- })
- await Utils.sleep(2000);
- expect(details).assertEqual(0);
- done();
- });
- })
+ /*
+ * @tc.number: FreeInstall_FA_StartAbility_3900
+ * @tc.name: startAbility: The same application does not need to check targetbundlelist,add BACKGROUND flags
+ start feature hap successfully.
+ * @tc.desc: Function test
+ * @tc.level 0
+ */
+ it("FreeInstall_FA_StartAbility_3900", 0, async function (done) {
+ console.log("------------start FreeInstall_FA_StartAbility_3900-------------");
+ TAG = "FreeInstall_FA_StartAbility_3900";
+ setTimeout(async () => {
+ let details;
+ var str = {
+ 'want': {
+ "bundleName": "com.open.harmony.startAbility",
+ "abilityName": "com.example.myapplication1.MainAbility1",
+ "moduleName": "myapplication1",
+ "flags": wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE | wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ }
+ await featureAbility.startAbility(str).then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbility successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbility failed. error: ' + JSON.stringify(error));
+ })
+ expect(details).assertEqual(0);
+ }, 2000);
+ done();
+ });
+ })
}
\ No newline at end of file
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json
index 5f34d6beac8cc14c6252a9727f1e6ebd5268069b..f82162213ed91525c777e48f0a32b9a3ab7085c9 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfaentry/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/config.json
index 955bdfd3893ca836c467e7197348a0d757360d28..73338153dad2dd3c3ca4bc4b88c1658981e32e58 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm2/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/config.json
index 196f92b9e193372f7559658e8c75810258051cc1..3e52e38ff495c675067f1f285016766991187f55 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/atomizationfahm4/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json
index 55e61015dc7ce7a49ebf939e46b0f2b1091d3839..88c725016b67225f518daa2507c351507818a68a 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityfatest/famyapplication1/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility1",
"deviceType": [
+ "default",
"phone"
],
"abilities": [
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn
index ab193bea006822e479a426cd5dca1fcb9da44556..6eaaef710dd27d7eed72c0b6e82764b521acfbdb 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/BUILD.gn
@@ -26,7 +26,9 @@ ohos_js_hap_suite("ActsFreeInstallStartAbilityForResultFaTest") {
part_name = "ability_runtime"
}
ohos_js_assets("actsfreeinstallstartabilityforresultfatest_ets_assets") {
- source_dir = "./entry/src/main/ets/MainAbility"
+ source_dir = "./entry/src/main/ets"
+ hap_profile = "entry/src/main/config.json"
+ ets2abc = true
}
ohos_resources("actsfreeinstallstartabilityforresultfatest_ets_resources") {
sources = [ "./entry/src/main/resources" ]
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json
index b7ed08ebb5437bc1b8398a30442d82f9da3e71a1..2759e09a7ec5a27835991f2441f4f2c4290e35c7 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json
@@ -20,6 +20,7 @@
"type": "ShellKit",
"run-command": [
"remount",
+ "param set persist.sys.suspend_manager_enabled 0",
"mkdir /data/test/"
]
},
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json
index acdffda30fa4546cc034ff80b0364f472fecb598..35447c5a7b873d87c7d03928a753ef4dc5298b05 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json
@@ -19,6 +19,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
@@ -44,7 +45,7 @@
"formsEnabled": false,
"label": "$string:MainAbility_label",
"type": "page",
- "launchType": "standard"
+ "launchType": "singleton"
},
{
"orientation": "unspecified",
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets
index e50dc2a8943d97888deef5b4b36106f52663efc1..b29c8974fa850c06194f75c059dcc8bff64ee553 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets
@@ -12,10 +12,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from "./test/List.test";
export default {
onCreate() {
console.info('Application onCreate')
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets
index 2fb0fdf90bd41c7ded1e7b863c96947703d0d297..ccab691e36398896206b6b9fee6da9960897da57 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets
@@ -38,12 +38,6 @@ async function routePage() {
struct Index {
aboutToAppear() {
console.info("aboutToAppear start!!!!")
- var abilityDelegator: any
- abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
- var abilityDelegatorArguments: any
- abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
- console.info('start run testcase!!!')
- Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets
index 721bc3f77cff4306e122ac3430c1b0b34ca75b5c..f4cab635c44f8785fa1d827d0cac1fdee7107283 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets
@@ -74,6 +74,18 @@ export default function StartAbilityForResult() {
console.info("executeShellCommand4: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
await Utils.sleep(500);
+ var str = {
+ 'want': {
+ "bundleName": "com.open.harmony.startAbilityForResult",
+ "abilityName": "com.open.harmony.startAbilityForResult.MainAbility",
+ }
+ }
+ await featureAbility.startAbility(str).then((data) => {
+ console.info(' StartAbilityPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(' StartAbilityPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ await Utils.sleep(500);
}
if ("FreeInstall_FA_StartAbilityForResult_3200" === TAG) {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets
index 589c442c1c8d16eecb5bae91517d674d417383d9..7f45dc03b683c337e60e13f41cb0d79d286fb5ee 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult2.test.ets
@@ -46,7 +46,7 @@ export default function StartAbilityForResult2() {
})
await Utils.sleep(500);
var cmd3 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
+ "entry/files";
delegator.executeShellCommand(cmd3, (err: any, d: any) => {
console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
done();
@@ -92,10 +92,10 @@ export default function StartAbilityForResult2() {
}
featureAbility.startAbilityForResult(str1)
.then((data) => {
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ console.info(TAG + ' StartAbilityForResultPromise2200 successful. Data: ' + JSON.stringify(data))
}).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
+ console.info(TAG + ' StartAbilityForResultPromise2200 failed. Cause: ' + JSON.stringify(error));
+ })
await Utils.sleep(3000);
let wrong;
var str = {
@@ -108,10 +108,10 @@ export default function StartAbilityForResult2() {
}
await featureAbility.startAbilityForResult(str)
.then((data) => {
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ console.info(TAG + ' StartAbilityForResultPromise2200 successful. Data: ' + JSON.stringify(data))
}).catch((error) => {
wrong = error;
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ console.info(TAG + ' StartAbilityForResultPromise2200 failed. Cause: ' + JSON.stringify(error));
})
await Utils.sleep(2000);
expect(wrong.code).assertEqual(13);
@@ -128,7 +128,8 @@ export default function StartAbilityForResult2() {
it("FreeInstall_FA_StartAbilityForResult_2300", 0, async function (done) {
console.log("------------start FreeInstall_FA_StartAbilityForResult_2300-------------");
TAG = "FreeInstall_FA_StartAbilityForResult_2300";
- var cmd19 = "bm install -p data/test/AtomizationResultFaEntry.hap";
+ var cmd19 = "bm install -rp /data/test/AtomizationResultFaEntry.hap";
+ console.log("------------start FreeInstall_FA_StartAbilityForResult_2300------install-------");
delegator.executeShellCommand(cmd19, (err: any, d: any) => {
console.info("executeShellCommand19: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
@@ -142,29 +143,30 @@ export default function StartAbilityForResult2() {
}
featureAbility.startAbilityForResult(str1)
.then((data) => {
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ console.info(TAG + ' StartAbilityForResultPromise2300 successful. Data1: ' + JSON.stringify(data))
}).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await Utils.sleep(3000);
- let wrong;
- var str = {
- 'want': {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- }
- await featureAbility.startAbilityForResult(str)
- .then((data) => {
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- wrong = error;
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ console.info(TAG + ' StartAbilityForResultPromise2300 failed. Cause1: ' + JSON.stringify(error));
})
- await Utils.sleep(2000);
- expect(wrong.code).assertEqual(13);
+ await Utils.sleep(1000);
+ setTimeout(async () => {
+ var wrong;
+ var str = {
+ 'want': {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ }
+ await featureAbility.startAbilityForResult(str)
+ .then((data) => {
+ console.info(TAG + ' StartAbilityForResultPromise2300 successful. 1Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ wrong = error;
+ console.info(TAG + ' StartAbilityForResultPromise2300 failed. 1Cause: ' + JSON.stringify(error));
+ })
+ expect(wrong.code).assertEqual(13);
+ }, 2000)
done();
});
@@ -181,47 +183,45 @@ export default function StartAbilityForResult2() {
delegator.executeShellCommand(cmd20, (err: any, d: any) => {
console.info("executeShellCommand20: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await Utils.sleep(500);
var cmd21 = "bm install -p data/test/MockServiceTimeout.hap";
delegator.executeShellCommand(cmd21, (err: any, d: any) => {
console.info("executeShellCommand21: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await Utils.sleep(500);
var cmd1 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
delegator.executeShellCommand(cmd1, (err: any, d: any) => {
- console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ console.info("executeShellCommand11 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await Utils.sleep(500);
var cmd2 = "mkdir -p /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
delegator.executeShellCommand(cmd2, (err: any, d: any) => {
- console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ console.info("executeShellCommand21 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await Utils.sleep(500);
var cmd3 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
+ "entry/files";
delegator.executeShellCommand(cmd3, (err: any, d: any) => {
- console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ console.info("executeShellCommand31 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await Utils.sleep(500);
- let wrong;
- var str = {
- 'want': {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+
+ setTimeout(async () => {
+ var wrong;
+ var str = {
+ 'want': {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
}
- }
- featureAbility.startAbilityForResult(str)
- .then((data) => {
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- wrong = error;
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await Utils.sleep(35000);
- expect(wrong.code).assertEqual(13);
+ await featureAbility.startAbilityForResult(str)
+ .then((data) => {
+ console.info(TAG + ' StartAbilityForResultPromise2600 successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ wrong = error;
+ console.info(TAG + ' StartAbilityForResultPromise2600 failed. Cause: ' + JSON.stringify(error));
+ })
+ expect(wrong.code).assertEqual(3)
+ }, 20000)
done();
});
+
})
-}
\ No newline at end of file
+}
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets
index f7a6eb27919fa676345d20369d39aa6ef9b0b87f..6e34a29cfb28013273b59fb90ffcb15f2bcdc7b9 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/PageAbility/app.ets
@@ -16,19 +16,19 @@
import featureAbility from '@ohos.ability.featureAbility';
export default {
- onCreate() {
- console.info('Application onCreate')
- setTimeout(function () {
- featureAbility.terminateSelf()
- .then((data) => {
- console.info('PageAbility terminateself succeeded: ' + data);
- }).catch((error) => {
- console.error('PageAbility terminateself failed. Cause: ' + error);
- })
- }, 8000);
- },
+ onCreate() {
+ console.info('Applicationfa onCreate')
+ setTimeout(async () => {
+ await featureAbility.terminateSelf()
+ .then((data) => {
+ console.info('PageAbilityfa terminateself succeeded: ' + data);
+ }).catch((error) => {
+ console.error('PageAbilityfa terminateself failed. Cause: ' + error);
+ })
+ }, 8000);
+ },
- onDestroy() {
- console.info('Application onDestroy')
- },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
}
\ No newline at end of file
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json
index c9018fcfd254b06ce0a6c57a9ba8bca7433cb4af..74248c803da3dee50446036a300692ee35ed62f2 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets
index 22fcd645c35315ad3119043d6a210c14f7a1c7fe..62743ea45b6d88a160dce83e9cb4fde774378304 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsstartabilityforresultnotargetfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets
@@ -45,7 +45,7 @@ export default function StartAbilityForResult() {
})
await Utils.sleep(500);
var cmd3 = "cp data/test/AtomizationResultFaEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/" +
- "files";
+ "files";
delegator.executeShellCommand(cmd3, (err: any, d: any) => {
console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
done();
@@ -88,16 +88,17 @@ export default function StartAbilityForResult() {
"flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
}
}
- await featureAbility.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResult successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResult failed. error: ' + JSON.stringify(error));
- })
- await Utils.sleep(1000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ await featureAbility.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResult successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResult failed. error: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ },2000);
done();
});
@@ -114,7 +115,6 @@ export default function StartAbilityForResult() {
delegator.executeShellCommand(cmd6, (err: any, d: any) => {
console.info("executeShellCommand6: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await Utils.sleep(500);
let details;
var str = {
'want': {
@@ -125,16 +125,17 @@ export default function StartAbilityForResult() {
"flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
}
}
- await featureAbility.startAbilityForResult(str)
+ setTimeout(async ()=>{
+ await featureAbility.startAbilityForResult(str)
.then((data) => {
details = data;
console.info(TAG + ' StartAbilityForResult successful. Data: ' + JSON.stringify(data))
}).catch((error) => {
console.info(TAG + ' StartAbilityForResult failed. error: ' + JSON.stringify(error));
})
- await Utils.sleep(1000);
console.log(TAG + " resultCode: " + details.resultCode);
expect(details.resultCode).assertEqual(1);
+ },2000);
done();
});
@@ -154,30 +155,30 @@ export default function StartAbilityForResult() {
})
await Utils.sleep(500);
var cmd8 = "cp data/test/FaResultMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
+ "entry/files";
delegator.executeShellCommand(cmd8, (err: any, d: any) => {
console.info("executeShellCommand8: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await Utils.sleep(500);
- let details;
- var str = {
- 'want': {
- "bundleName": "com.open.harmony.startAbilityForResult",
- "abilityName": "com.example.myapplication1.MainAbility1",
- "moduleName": "myapplication1",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ setTimeout(async ()=>{
+ let details;
+ var str = {
+ 'want': {
+ "bundleName": "com.open.harmony.startAbilityForResult",
+ "abilityName": "com.example.myapplication1.MainAbility1",
+ "moduleName": "myapplication1",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
}
- }
- await featureAbility.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResult successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResult failed. error: ' + JSON.stringify(error));
- })
- await Utils.sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ await featureAbility.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResult successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResult failed. error: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ },2000);
done();
});
})
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/config.json
index 05f73cce051b1b6a832891a2a107525bb7cd4e6d..410ec6177992754ac6b30b665fc42479f0459ec0 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresulta/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json
index ceaaeed30ef39694f4ef451d016a3e8130cc1339..bf2c4bdd8f7d0e761f94bf37154811d60b3d89ba 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets
index c3a2854faa2a78073ca79b7e4801ea1ba870ba84..d779e6c276a31e1412c0d654c2c8719eef0aefad 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets
@@ -40,7 +40,6 @@ export default {
},
}
);
- featureAbility.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
},
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/config.json
index 1befc4efe23c420b3d387e25d08419cb70faa2af..98cb3fa6087f83a95df813a4a4b452390c4354eb 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets
index 881d9152e264e8415299fdcab1052e1f68f9ce73..f9c7aa4179805e4010f742aa28fcef016eed746b 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets
@@ -33,7 +33,6 @@ export default {
},
}
);
- featureAbility.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
},
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/config.json
index 225b1a21bb7dd12153bde34267da643de1377398..ba68362c3ee51da950503666fa32b179f0e1f96c 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets
index 881d9152e264e8415299fdcab1052e1f68f9ce73..f9c7aa4179805e4010f742aa28fcef016eed746b 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets
@@ -33,7 +33,6 @@ export default {
},
}
);
- featureAbility.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
},
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/config.json
index 2f51d1544830ffc0a58e73c23885676e0a2a3e75..72cb78a7a42902feb2f17d95420be6901851f930 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/config.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/config.json
@@ -16,6 +16,7 @@
"module": {
"mainAbility": ".MainAbility1",
"deviceType": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/ets/MainAbility/app.ets
index 15d6b37d6a7f89f4e76db0180c838725ab29467d..fa0bfa0402f95f35798bb282e4f210fe8a4d1774 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/ets/MainAbility/app.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/faresultmyapplication1/entry/src/main/ets/MainAbility/app.ets
@@ -34,7 +34,6 @@ export default {
},
}
);
- featureAbility.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
},
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets
index bab8df845a87af42654e5e5668861a7ab3ab4548..526581a8ffb2acc39328ec1020299cdb9fb19c82 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/ets/test/StartAbilityForResult.ets
@@ -34,21 +34,24 @@ export default function StartAbilityForResult(abilityContext) {
beforeAll(async function (done) {
console.info("StartAbilityForResult before all called");
var cmd = "bm install -p data/test/MockService.hap";
- console.info("cmd : "+cmd)
+ console.info("cmd : " + cmd)
globalThis.delegator.executeShellCommand(cmd, (err: any, d: any) => {
- console.info("executeShellCommand : err : " + JSON.stringify(err)," data : " + JSON.stringify(d));})
+ console.info("executeShellCommand : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
await sleep(500);
var cmd1 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry";
globalThis.delegator.executeShellCommand(cmd1, (err: any, d: any) => {
- console.info("executeShellCommand1 : err : " + JSON.stringify(err)," data : " + JSON.stringify(d));})
+ console.info("executeShellCommand1 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
await sleep(500);
var cmd2 = "mkdir /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
globalThis.delegator.executeShellCommand(cmd2, (err: any, d: any) => {
- console.info("executeShellCommand2 : err : " + JSON.stringify(err)," data : " + JSON.stringify(d));})
+ console.info("executeShellCommand2 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
await sleep(500);
- var cmd3 ="cp data/test/AtomizationResultStageEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
+ var cmd3 = "cp data/test/AtomizationResultStageEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/entry/files";
globalThis.delegator.executeShellCommand(cmd3, (err: any, d: any) => {
- console.info("executeShellCommand3 : err : " + JSON.stringify(err)," data : " + JSON.stringify(d));
+ console.info("executeShellCommand3 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
done();
})
});
@@ -56,8 +59,8 @@ export default function StartAbilityForResult(abilityContext) {
afterEach(async function (done) {
console.info("StartAbilityForResult after each called");
if ("FreeInstall_Stage_StartAbilityForResult_0100" === TAG ||
- "FreeInstall_Stage_StartAbilityForResult_0500" === TAG ||
- "FreeInstall_Stage_StartAbilityForResult_2800" === TAG) {
+ "FreeInstall_Stage_StartAbilityForResult_0500" === TAG ||
+ "FreeInstall_Stage_StartAbilityForResult_2800" === TAG) {
var cmd4 = "bm uninstall -n com.example.qianyiyingyong.hmservice";
globalThis.delegator.executeShellCommand(cmd4, (err: any, d: any) => {
console.info("executeShellCommand4 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
@@ -71,18 +74,18 @@ export default function StartAbilityForResult(abilityContext) {
})
await sleep(500);
var cmd6 = "cp data/test/AtomizationResultStageEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
+ "entry/files";
globalThis.delegator.executeShellCommand(cmd6, (err: any, d: any) => {
console.info("executeShellCommand6 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
await sleep(500);
}
- if ("FreeInstall_Stage_StartAbilityForResult_2600" === TAG) {
- var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
- globalThis.delegator.executeShellCommand(cmd14, (err: any, d: any) => {
- console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
- })
- }
+ if ("FreeInstall_Stage_StartAbilityForResult_2600" === TAG) {
+ var cmd14 = "bm uninstall -n com.ohos.hag.famanager";
+ globalThis.delegator.executeShellCommand(cmd14, (err: any, d: any) => {
+ console.info("executeShellCommand14 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
+ })
+ }
await sleep(500);
done();
});
@@ -96,24 +99,25 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_0100", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_0100-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_0100";
- let details;
- var str = {
- "deviceId": "",
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "deviceId": "",
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -126,26 +130,27 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_0400", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_0400-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_0400";
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- var options = {
- "windowMode": 0, "displayId": 2
- }
- await globalThis.abilityContext.startAbilityForResult(str, options)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ var options = {
+ "windowMode": 0, "displayId": 2
+ }
+ await globalThis.abilityContext.startAbilityForResult(str, options)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -158,23 +163,24 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_0500", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_0500-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_0500";
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -197,24 +203,25 @@ export default function StartAbilityForResult(abilityContext) {
});
console.log(" checkAbilityInfo deviceId : " + details1.ability.deviceId);
DeviceId = details1.ability.deviceId;
- await sleep(500);
- var str = {
- "deviceId": DeviceId,
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details2 = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details2.resultCode);
- expect(details2.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ var str = {
+ "deviceId": DeviceId,
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details2 = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ await sleep(2000);
+ console.log(TAG + " resultCode: " + details2.resultCode);
+ expect(details2.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -236,24 +243,25 @@ export default function StartAbilityForResult(abilityContext) {
globalThis.delegator.executeShellCommand(cmd8, (err: any, d: any) => {
console.info("executeShellCommand8: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.hm2.MainAbility",
- "moduleName": "hnm2",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.hm2.MainAbility",
+ "moduleName": "hnm2",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ await sleep(2000);
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -266,24 +274,25 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_0800", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_0800-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_0800";
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- var options = {
- "windowMode": 0, "displayId": 2
- }
- await globalThis.abilityContext.startAbilityForResult(str, options, (err, data) => {
- console.log(TAG + ": StartAbilityForResultCallBack success, err: " + JSON.stringify(err) +
- ",data: " + JSON.stringify(data));
- details = data;
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ var options = {
+ "windowMode": 0, "displayId": 2
+ }
+ await globalThis.abilityContext.startAbilityForResult(str, options, (err, data) => {
+ console.log(TAG + ": StartAbilityForResultCallBack success, err: " + JSON.stringify(err) +
+ ",data: " + JSON.stringify(data));
+ details = data;
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -296,23 +305,24 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_1200", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_1200-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_1200";
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- 'flags': '11'
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ 'flags': '11'
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -325,26 +335,28 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_1400", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_1400-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_1400";
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- 'flags': '11'
- }
- var options = {
- "windowMode": 0, "displayId": 2
- }
- await globalThis.abilityContext.startAbilityForResult(str, options)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ 'flags': '11'
+ }
+ var options = {
+ "windowMode": 0, "displayId": 2
+ }
+ await globalThis.abilityContext.startAbilityForResult(str, options)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ await sleep(2000);
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -357,23 +369,24 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_1600", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_1600-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_1600";
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- 'flags': ''
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ 'flags': ''
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -386,26 +399,27 @@ export default function StartAbilityForResult(abilityContext) {
it("FreeInstall_Stage_StartAbilityForResult_1800", 0, async function (done) {
console.log("------------start FreeInstall_Stage_StartAbilityForResult_1800-------------");
TAG = "FreeInstall_Stage_StartAbilityForResult_1800";
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- 'flags': ''
- }
- var options = {
- "windowMode": 0, "displayId": 2
- }
- await globalThis.abilityContext.startAbilityForResult(str, options)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ 'flags': ''
+ }
+ var options = {
+ "windowMode": 0, "displayId": 2
+ }
+ await globalThis.abilityContext.startAbilityForResult(str, options)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -422,24 +436,25 @@ export default function StartAbilityForResult(abilityContext) {
globalThis.delegator.executeShellCommand(cmd9, (err: any, d: any) => {
console.info("executeShellCommand9: err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- let details;
- var str = {
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "hnm2",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "hnm2",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ await sleep(2000);
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -458,30 +473,31 @@ export default function StartAbilityForResult(abilityContext) {
})
await sleep(500);
var cmd11 = "cp data/test/AtomizationResultStageEntry.hap /data/app/el2/100/base/com.ohos.hag.famanager/" +
- "haps/entry/files";
+ "haps/entry/files";
globalThis.delegator.executeShellCommand(cmd11, (err: any, d: any) => {
console.info("executeShellCommand11 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- let details;
- var str = {
- 'deviceId': '',
- "bundleName": "com.example.qianyiyingyong.hmservice",
- "abilityName": "com.example.qianyiyingyong.MainAbility",
- "moduleName": "entry",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- 'parameters': {"name": "1111", "Ext2": "ExtValue2","site":"很开心看到你!"}
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ 'deviceId': '',
+ "bundleName": "com.example.qianyiyingyong.hmservice",
+ "abilityName": "com.example.qianyiyingyong.MainAbility",
+ "moduleName": "entry",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ 'parameters': { "name": "1111", "Ext2": "ExtValue2", "site": "很开心看到你!" }
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ await sleep(2000);
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
@@ -500,29 +516,30 @@ export default function StartAbilityForResult(abilityContext) {
})
await sleep(500);
var cmd13 = "cp data/test/StageResultMyApplication1.hap /data/app/el2/100/base/com.ohos.hag.famanager/haps/" +
- "entry/files";
+ "entry/files";
globalThis.delegator.executeShellCommand(cmd13, (err: any, d: any) => {
console.info("executeShellCommand13 : err : " + JSON.stringify(err), " data : " + JSON.stringify(d));
})
- await sleep(500);
- let details;
- var str = {
- "deviceId": "",
- "bundleName": "com.example.startAbilityForResult.hmservice",
- "abilityName": "MainAbility1",
- "moduleName": "myapplication1",
- "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
- }
- await globalThis.abilityContext.startAbilityForResult(str)
- .then((data) => {
- details = data;
- console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
- }).catch((error) => {
- console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
- })
- await sleep(2000);
- console.log(TAG + " resultCode: " + details.resultCode);
- expect(details.resultCode).assertEqual(1);
+ setTimeout(async () => {
+ let details;
+ var str = {
+ "deviceId": "",
+ "bundleName": "com.example.startAbilityForResult.hmservice",
+ "abilityName": "MainAbility1",
+ "moduleName": "myapplication1",
+ "flags": wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
+ }
+ await globalThis.abilityContext.startAbilityForResult(str)
+ .then((data) => {
+ details = data;
+ console.info(TAG + ' StartAbilityForResultPromise successful. Data: ' + JSON.stringify(data))
+ }).catch((error) => {
+ console.info(TAG + ' StartAbilityForResultPromise failed. Cause: ' + JSON.stringify(error));
+ })
+ await sleep(2000);
+ console.log(TAG + " resultCode: " + details.resultCode);
+ expect(details.resultCode).assertEqual(1);
+ }, 2000)
done();
});
})
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json
index f1ba526b0e06b898cfd8cdc6e67ed5d4bd584985..af04d14f6f4ac6b6ef5ff0526733d6bd42f8625b 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsfreeinstallstartabilityforresultstagetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json
index f1ba526b0e06b898cfd8cdc6e67ed5d4bd584985..af04d14f6f4ac6b6ef5ff0526733d6bd42f8625b 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/actsstartabilityforresultnotargetbundleliststagetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/MainAbility/MainAbility.ts
index fb41b82036e4a81e2dfee7464b6a0a139bec45d4..6a7c9df682d496822f9dc34ea86969f0d9dad119 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -52,7 +52,6 @@ export default class MainAbility extends Ability {
},
}
);
- globalThis.abilityContext.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
}
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/module.json
index 2f4cd628c66961230f25795be61b8c448743d45d..3ecd447eccee6a2fc1419efb3f4394e1f052c5e3 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/MainAbility/MainAbility.ts
index 1d022ce9f570c68679325688e05cfe14ad39a6c7..4efeca31a9e028332c29370a1f1c5d0e738f6af2 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -52,7 +52,6 @@ export default class MainAbility extends Ability {
},
}
);
- globalThis.abilityContext.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
}
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/module.json
index 12ecea716d57ff14c14c72866175e9521ac9d0db..f22c3e8febec8666b3e7c77773acf18c0609d52e 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hnm2_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/MainAbility/MainAbility.ts
index 1d022ce9f570c68679325688e05cfe14ad39a6c7..4efeca31a9e028332c29370a1f1c5d0e738f6af2 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -52,7 +52,6 @@ export default class MainAbility extends Ability {
},
}
);
- globalThis.abilityContext.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
}
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/module.json
index 14ecbbe576f2cf026f8c4a7b7737dee204ab13b3..1569ee82ba65465e72c4b6e7102713e8757b726d 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hnm2_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/ets/MainAbility1/MainAbility1.ts b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/ets/MainAbility1/MainAbility1.ts
index af7509fe368a0f12f5f634bd87f37cdff85dd3f0..1031a55f562925339bd4cdf6cec4e74ad14060ad 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/ets/MainAbility1/MainAbility1.ts
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/ets/MainAbility1/MainAbility1.ts
@@ -52,7 +52,6 @@ export default class MainAbility1 extends Ability {
},
}
);
- globalThis.abilityContext.terminateSelf();
console.info('fAStartAbilityForResultPromise terminateSelfWithResult END');
}, 1000);
}
diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/module.json
index 418fe1a5343885817705a3967670e4d56b45e542..88c6c58c2f8e6a8dbb3d1fa4dd81d6312f34580d 100644
--- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/stageresultmyapplication1/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication1_desc",
"mainElement": "MainAbility1",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets
index 94642e7d33b4313a1cf07b4226dc598f285ad340..cdbfb219fc2285ed0ebe799c2e390360628e081d 100644
--- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets
+++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets
@@ -820,7 +820,7 @@ export default function startAbilityTest(abilityContext) {
abilityForeground(TAG);
await sleep(1000);
abilityBackground(TAG);
- await sleep(5000);
+ await sleep(2000);
var str = {
"bundleName": "com.example.qianyiyingyong.hmservice",
"abilityName": "com.example.qianyiyingyong.MainAbility",
@@ -855,7 +855,7 @@ export default function startAbilityTest(abilityContext) {
abilityForeground(TAG);
await sleep(1000);
abilityBackground(TAG);
- await sleep(5000);
+ await sleep(2000);
var str = {
"bundleName": "com.example.qianyiyingyong.hmservice",
"abilityName": "com.example.qianyiyingyong.MainAbility",
@@ -916,7 +916,7 @@ export default function startAbilityTest(abilityContext) {
console.log(TAG + ": startAbility fail. err: " + JSON.stringify(error));
expect(error.code == 3).assertTrue();
});
- await sleep(35000);
+ await sleep(2000);
console.info("------------end FreeInstall_Stage_Local_StartAbility_2500-------------");
done();
});
@@ -1168,7 +1168,7 @@ export default function startAbilityTest(abilityContext) {
}).catch((error) => {
console.log(TAG + ": Mainability2 startAbility fail. err: " + JSON.stringify(error));
});
- await sleep(5000);
+ await sleep(2000);
abilityBackground(TAG);
await sleep(1000);
var str2 = {
@@ -1215,7 +1215,7 @@ export default function startAbilityTest(abilityContext) {
}).catch((error) => {
console.log(TAG + ": Mainability2 startAbility fail. err: " + JSON.stringify(error));
});
- await sleep(5000);
+ await sleep(2000);
abilityBackground(TAG);
await sleep(1000);
var str2 = {
diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json
index 07b378b1f951143a31af615e8069c8d28e4697bc..e4c26cd0c21c7104f549af8582039ef54ae0f101 100644
--- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -52,6 +53,12 @@
},
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY"
}
],
"extensionAbilities": [
diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/module.json
index 93a744ea7a2a64d1d1f115e06cad1e79ab8677b8..2050df38be0c0c93f3e9ea30375fc817d9db3b17 100644
--- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/actsstartabilitynotargetbundleliststagetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json
index 8d4674b1563b9b3b0df355d5ba11c3458b5cb6a2..a9bc619bd0130884826a3c9eb4b6ec5617957936 100644
--- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json
index 752f06755763e5fcbc77016cb5bf2222165e8b6a..ae8721b06bcf0c38e5f048dfe92baa1f1770c864 100644
--- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm2/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hnm2_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/entry/src/main/module.json
index 02755db069282541460533e8f38a8b58fb0eae78..9321c9b2513d0e06576920ef6e742d21c7a00e04 100644
--- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstagehm4/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hm4_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/entry/src/main/module.json b/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/entry/src/main/module.json
index 85af6ede85105ff19afa4698bdef7b07fdd4a3a2..973365f5d3512e35b86b60c807395d69af2f3229 100644
--- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/entry/src/main/module.json
+++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/stagemyapplication1/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:myapplication1_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json
index 6bcf8cc50e5744c28ddbecff85eff36c52292f62..d64acbeb232bb9ca36d3d886fcb714dec6f2b040 100644
--- a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json
+++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts
index 553641481ef812ee7fe5997aed5239dfa725310b..717657a0c8f0bf4ccfb444169ff61435adc644aa 100644
--- a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -13,6 +13,9 @@
* limitations under the License.
*/
import Ability from '@ohos.application.Ability'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
@@ -20,6 +23,14 @@ export default class MainAbility extends Ability {
// Ability is creating, initialize resources for this ability
console.log("MainAbility onCreate")
globalThis.abilityWant = want;
+ globalThis.abilityContext = this.context
+ 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)
}
onDestroy() {
@@ -30,7 +41,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("MainAbility onWindowStageCreate")
- globalThis.abilityContext = this.context
+
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
}
diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/pages/index/index.ets
index 18591878efec8e048ce0aca66617cd847c5e6617..d10df7d7f9eaf60fa1082f1767a352ce5bb9a9ab 100644
--- a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/pages/index/index.ets
+++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/MainAbility/pages/index/index.ets
@@ -13,20 +13,10 @@
* 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 }) {
diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets
index fdfab03ef658f7c572dd10cf99bc13cbb716b05f..daf5122ee552106eeb4e9d079466e4a9e2957ae5 100644
--- a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/ets/test/Ability.test.ets
@@ -42,6 +42,22 @@ export default function killProcessWithAccountTest() {
})
})
+ afterEach(async (done) => {
+ console.log("ACTS_KillProcessWithAccount afterEach called");
+ let wantInfo = {
+ bundleName: "com.acts.killprocesswithaccount",
+ abilityName: "com.acts.killprocesswithaccount.MainAbility"
+ }
+ await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
+ console.log("ACTS_KillProcessWithAccount startAbility data : " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("ACTS_KillProcessWithAccount startAbility err : " + JSON.stringify(err));
+ })
+ setTimeout(function () {
+ console.log("ACTS_KillProcessWithAccount afterEach end");
+ done();
+ }, 500);
+ })
beforeEach(async (done) => {
console.log('======>beforeEach killProcessWithAccountTest<=======' + flag);
diff --git a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json
index cf635c27fcebe0b370f622173adb8a542a22492b..ee7c929a84a5d0a5fceff42e847b912698042cd0 100644
--- a/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json
+++ b/ability/ability_runtime/killprocesswithaccountstage/ActsKillProcessWithAccountTest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -21,6 +22,7 @@
"label": "$string:entry_label",
"visible": true,
"orientation": "portrait",
+ "launchType": "singleton",
"skills": [
{
"actions": [
@@ -34,7 +36,7 @@
}
],
"requestPermissions": [
- {
+ {
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
@@ -69,6 +71,14 @@
{
"name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json
index 2b2738b6e0a640428d6ed6b37945c1148058a32e..8f852119ca050d04352c54a134ac0db9c1ef3ee8 100644
--- a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json
+++ b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.newwanthapapi7",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -69,6 +70,10 @@
{
"name":"ohos.permission.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
],
"js": [
diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js
index 2b9f6f6691f15f6773cd981d6de18614c57f1cd8..c0fc27e25b690f0c5292f9ab5cd70b9da8877b9a 100644
--- a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js
+++ b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js
@@ -22,6 +22,15 @@ import featureAbility from '@ohos.ability.featureAbility'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
+function sleep(delay) {
+ let start = new Date().getTime();
+ while (true) {
+ if (new Date().getTime() - start > delay) {
+ break;
+ }
+ }
+}
+
export default {
data: {
title: ""
@@ -38,7 +47,7 @@ export default {
},
async onShow() {
console.info('ACTS_NewWant Api7 onShow');
-
+ sleep(1000)
await featureAbility.startAbility(
{
want:
diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
index 950088fc292fc6cd326ff6121b47cf943ebbb19c..9962ff55df8eeb24c19a5ff74a6f330b99f6bc6d 100644
--- a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
+function sleep(delay) {
+ let start = new Date().getTime();
+ while (true) {
+ if (new Date().getTime() - start > delay) {
+ break;
+ }
+ }
+}
+
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
@@ -48,6 +57,7 @@ export default class MainAbility extends Ability {
}
onForeground() {
+ sleep(1000)
// Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startHapC') {
diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json
index 7dd56920a8940087dea3f74f42c759d80a4bafae..90b1bea00b96035d87d8f967804c26e8349f3173 100644
--- a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -58,6 +59,10 @@
{
"name":"ohos.permission.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
diff --git a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
index 70dd29e22def32f76e65823d8a300886ce0899a8..8e74ecba1184139d319dcacccca2bf5f5f1bd501 100644
--- a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
+function sleep(delay) {
+ let start = new Date().getTime();
+ while (true) {
+ if (new Date().getTime() - start > delay) {
+ break;
+ }
+ }
+}
+
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
@@ -48,6 +57,7 @@ export default class MainAbility extends Ability {
}
onForeground() {
+ sleep(1000)
// Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startHapB') {
diff --git a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json
index 3b33503efa2e175ab55e125347b936b82e92839a..053048272a8840737cae5c7b6d99bd39321cb9b1 100644
--- a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -58,6 +59,10 @@
{
"name":"ohos.permission.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
index 8dbd22aa90fc244b2217842c1deaafb29e75d487..153190f2bd79b7052d7119b2c30b8786211f088e 100644
--- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
+function sleep(delay) {
+ let start = new Date().getTime();
+ while (true) {
+ if (new Date().getTime() - start > delay) {
+ break;
+ }
+ }
+}
+
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
@@ -48,6 +57,7 @@ export default class MainAbility extends Ability {
}
onForeground() {
+ sleep(1000)
// Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startStandard0400') {
diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
index 9f0688daa9e0d7534fac867c7279eae255ba0a59..3faed4fc184b3e4259d26d18a1e86bb7ae43ac95 100644
--- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
+++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts
@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
+function sleep(delay) {
+ let start = new Date().getTime();
+ while (true) {
+ if (new Date().getTime() - start > delay) {
+ break;
+ }
+ }
+}
+
export default class SecondAbility extends Ability {
onCreate(want, launchParam) {
@@ -48,6 +57,7 @@ export default class SecondAbility extends Ability {
}
onForeground() {
+ sleep(1000)
// Ability has brought to foreground
var connId;
console.log("ACTS_NewWant SecondAbility onForeground")
diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
index b1c64a7122966536fc31b8745f021a08888f1052..213d8a9b8b8c9edbf692aa94ab21dbc540496f9e 100644
--- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
@@ -17,6 +17,15 @@ import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import rpc from "@ohos.rpc";
+function sleep(delay) {
+ let start = new Date().getTime();
+ while (true) {
+ if (new Date().getTime() - start > delay) {
+ break;
+ }
+ }
+}
+
export default class ServiceAbility extends ServiceExtension {
onCreate(want: Want) {
globalThis.abilityWant = want;
@@ -28,6 +37,7 @@ export default class ServiceAbility extends ServiceExtension {
}
onConnect(want) {
+ sleep(1000)
var connId;
console.log('ACTS_NewWant ServiceAbility onConnect, want:' + want.abilityName);
globalThis.extensionContext = this.context
diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json
index 1c9da0c5dd6ab3a761929c0504118abf35d16c1f..f226b824474f572604ee4622cf19e7388f5ad0bf 100644
--- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -79,6 +80,10 @@
{
"name":"ohos.permission.INSTALL_BUNDLE",
"reason":"need use ohos.permission.INSTALL_BUNDLE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts
index 2e7d00667eda224bc5e25c2eab34ad1987b1aa56..f59e7275010954155d0cf84c42d690d9cb308f88 100644
--- a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -14,6 +14,9 @@
*/
import Ability from '@ohos.application.Ability'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
@@ -21,6 +24,15 @@ export default class MainAbility extends Ability {
// Ability is creating, initialize resources for this ability
console.log("MainAbility onCreate")
globalThis.abilityWant = want;
+
+ globalThis.abilityContext = this.context
+ 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)
}
onDestroy() {
@@ -31,7 +43,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("MainAbility onWindowStageCreate")
- globalThis.abilityContext = this.context
+
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
}
diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/pages/index/index.ets
index b2438dfdf6b68001495268bff1bc2cdb5ab6c01d..bc18d0e15e33ca45d70f69187330e712eba1d974 100644
--- a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/pages/index/index.ets
+++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/MainAbility/pages/index/index.ets
@@ -14,23 +14,13 @@
*/
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)
+ aboutToAppear(){
}
build() {
diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
index 5cc6c752a544020ebf4a6219ae2e9c5a955330dd..fcec00efd9314b4d6d3d5db9ab62ee95a40b91e8 100644
--- a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets
@@ -15,6 +15,7 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
import commonEvent from '@ohos.commonEvent'
+import backgroundTaskManager from '@ohos.backgroundTaskManager';
let subscriberInfo = {
events: ['onCreateMain_To_Test_CommonEvent',
@@ -38,6 +39,31 @@ let flagNewWant = false;
export default function abilityTest() {
describe('ActsNewWantTest', function () {
+ let TAG1 = 'ACTS_NewWant_Test : '
+ let id = undefined;
+ beforeAll(async (done) => {
+ console.log(TAG1 + "beforeAll called");
+ let myReason = 'test ActsNewWantTest';
+ let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
+ console.log(TAG1 + "Request suspension delay will time out.");
+ })
+ id = delayInfo.requestId;
+ console.log(TAG1 + "requestId is : " + id);
+ setTimeout(function () {
+ console.log(TAG1 + "beforeAll end");
+ done();
+ }, 1000);
+ })
+
+ afterAll(async (done) => {
+ console.log(TAG1 + "afterAll called");
+ backgroundTaskManager.cancelSuspendDelay(id);
+ setTimeout(function () {
+ console.log(TAG1 + "afterAll end");
+ done();
+ }, 1000);
+ })
+
/**
* @tc.number: ACTS_NewWant_Test_0100
* @tc.name: Starting standard Ability for the first time does not trigger onNewWant.
@@ -562,7 +588,7 @@ export default function abilityTest() {
+ JSON.stringify(error) + ", " + JSON.stringify(data))
})
-
+
function SubscribeCallBack(err, data) {
console.debug("ACTS_NewWant_Test_0800====>Subscribe CallBack data:====>"
diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json
index 3ecfc06f7d7dabe7f0b63024032048553cc03d25..fad375b738d49b02aba8f87ad8346ad8a5cf7d86 100644
--- a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json
+++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -21,6 +22,7 @@
"label": "$string:entry_label",
"visible": true,
"orientation": "portrait",
+ "launchType": "singleton",
"skills": [
{
"actions": [
@@ -73,6 +75,10 @@
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
diff --git a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json
index c8dcd29a0f33491db39c44ba7f883c19cc8d8434..7d0bbbc30d0798a2cd4c0c01a4e091b13668cf3f 100644
--- a/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json
+++ b/ability/ability_runtime/non_concurrent/acts_systemappa_test/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -115,7 +116,15 @@
{
"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS",
"reason":"need use ohos.permission.GET_RUNNING_INFO"
- }
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
]
}
}
diff --git a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json
index 620defb9517f2064e42340b499e501a5bb0495b6..d6e32dc293ce5b3b316c745983a7df9c467e4c4e 100644
--- a/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json
+++ b/ability/ability_runtime/non_concurrent/acts_systemappone_rely_test/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json
index 1089647e9fb653e300e0171eec1bfeb6f0f948bc..05b2fb1fd043de0022f35a02a50c6364d1f772e3 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapaarelyhap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json
index 7e3387923982544d81cdb08dd8d4b42847cb1abc..d72dfee719aea74a6915acca4a0c61976109633d 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapabrelyhap/entry/src/main/module.json
@@ -7,6 +7,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json
index 73bdcb7f6e2337ee4f47bb0bf8e68b4b9e70d6cf..7cf6ec52373110f66bd8d3aaaaec9fb69aea0a9a 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbarelyhap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json
index 9d46fa80fb140233ed4123ccac174955be6e7c18..ac8458c673a70377beab2b2d912cf955dca9b8e6 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbbrelyhap/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json
index e14379235d134cb582c13ee15d79b7c8a4ddd7c1..815f276fbff0db6c968e5496f9e51bae8ee2a9f4 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbcrelyhap/entry/src/main/module.json
@@ -7,6 +7,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json
index ead67d4bb61501de77df770112d8cf5eb9c1e4e9..2e6a60ec78e4e703aeaa81568c924b8a7468b5bc 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbdrelyhap/entry/src/main/module.json
@@ -7,6 +7,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json
index 527f67cd10dce15b822d892de226fe979b6a20c6..0ed216baf25de7d793ef17bb73be2577779d83c9 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapberelyhap/entry/src/main/module.json
@@ -7,6 +7,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json
index d9eb79683ad4de3182dbc17e6ff3faa1a1205042..405388a616a8be18f7ad0b088407e08d9977bb21 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancehapbfrelyhap/entry/src/main/module.json
@@ -7,6 +7,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
index 5d9cb94eb1b16f32da7f1ba0b9896c87323bca11..03bed122d3c2e0b39d8aaff168f1b14e030d01ed 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -13,12 +13,24 @@
* limitations under the License.
*/
import Ability from '@ohos.application.Ability'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
onCreate(want,launchParam){
// Ability is creating, initialize resources for this ability
console.log("MainAbility onCreate")
globalThis.abilityWant = want;
+
+ globalThis.abilityContext = this.context
+ 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)
}
onDestroy() {
@@ -29,7 +41,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("MainAbility onWindowStageCreate")
- globalThis.abilityContext = this.context
+
windowStage.setUIContent(this.context, "MainAbility/pages/index/index", null)
}
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/pages/index/index.ets
index bebda07c2cf21dccd43f7cc4b980205ca56a6168..acd879f64b9dada49873347dd652cda4ea9fb2ea 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/pages/index/index.ets
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/MainAbility/pages/index/index.ets
@@ -13,9 +13,6 @@
* 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
@@ -23,13 +20,6 @@ import testsuite from '../../../test/List.test'
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() {
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets
index 860b27faba41b3ff9a5cf999a46bc3747eb62b18..93b1791ecefaeef9eac44898534ddb9e73d7fd53 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/ets/test/Ability.test.ets
@@ -16,7 +16,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import commonEvent from '@ohos.commonEvent'
import abilityManager from '@ohos.application.abilityManager';
import appManager from '@ohos.application.appManager'
-import missionManager from '@ohos.application.missionManager'
const TIMEOUT = 1000;
var subscriberInfo = {
@@ -35,6 +34,9 @@ var processNameA = "com.example.multiinstancehapa";
var processNameB = "com.example.multiinstancehapb";
var processNameC = "com.example.multiinstancehapc";
+function sleep(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+}
export default function abilityTest() {
describe('ActsProcessMultiInstanceTest', function () {
@@ -43,7 +45,20 @@ export default function abilityTest() {
await appManager.killProcessesByBundleName("com.example.multiinstancehapa");
await appManager.killProcessesByBundleName("com.example.multiinstancehapb");
- done();
+ let wantInfo = {
+ bundleName: "com.example.processmultiinstance",
+ abilityName: "com.example.processmultiinstance.MainAbility"
+ }
+ await globalThis.abilityContext.startAbility(wantInfo).then((data) => {
+ console.log("ACTS_Process_MultiInstance startAbility data: " + JSON.stringify(data));
+ }).catch((err) => {
+ console.log("ACTS_Process_MultiInstance startAbility err: " + JSON.stringify(err));
+ })
+
+ setTimeout(function () {
+ console.log("ACTS_Process_MultiInstance afterEach end");
+ done();
+ }, 500);
})
/**
@@ -138,6 +153,7 @@ export default function abilityTest() {
done();
}
}
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapba.MainAbility",
@@ -145,6 +161,7 @@ export default function abilityTest() {
console.log('ACTS_Process_MultiInstance_0100 - startAbilityhapba: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbb.MainAbility",
@@ -247,6 +264,7 @@ export default function abilityTest() {
done();
}
}
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbc.MainAbility",
@@ -254,6 +272,7 @@ export default function abilityTest() {
console.log('ACTS_Process_MultiInstance_0200 - startAbilityhapbc: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbd.MainAbility",
@@ -361,6 +380,7 @@ export default function abilityTest() {
done();
}
}
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbd.MainAbility",
@@ -368,6 +388,7 @@ export default function abilityTest() {
console.log('ACTS_Process_MultiInstance_0300 - startAbilityhapbd: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbe.MainAbility",
@@ -472,6 +493,7 @@ export default function abilityTest() {
done();
}
}
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapba.MainAbility",
@@ -479,6 +501,7 @@ export default function abilityTest() {
console.log('ACTS_Process_MultiInstance_0400 - startAbilityhapba: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbf.MainAbility",
@@ -583,6 +606,7 @@ export default function abilityTest() {
done();
}
}
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapa",
abilityName: "com.example.multiinstancehapaa.MainAbility",
@@ -590,6 +614,7 @@ export default function abilityTest() {
console.log('ACTS_Process_MultiInstance_0500 - startAbilityhapaa: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbe.MainAbility",
@@ -697,6 +722,7 @@ export default function abilityTest() {
done();
}
}
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapa",
abilityName: "com.example.multiinstancehapaa.MainAbility",
@@ -704,6 +730,7 @@ export default function abilityTest() {
console.log('ACTS_Process_MultiInstance_0600 - startAbilityhapaa: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbf.MainAbility",
@@ -810,6 +837,7 @@ export default function abilityTest() {
done();
}
}
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapa",
abilityName: "com.example.multiinstancehapab.MainAbility",
@@ -817,6 +845,7 @@ export default function abilityTest() {
console.log('ACTS_Process_MultiInstance_0700 - startAbilityhapab: '
+ JSON.stringify(err) + ", " + JSON.stringify(data))
})
+ await sleep(500)
globalThis.abilityContext.startAbility({
bundleName: "com.example.multiinstancehapb",
abilityName: "com.example.multiinstancehapbc.MainAbility",
diff --git a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json
index 0152946dc4cd7e2cd788feae646b840fcd02f670..ec10420819e7778998bd2d1615ba15490e38381f 100644
--- a/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json
+++ b/ability/ability_runtime/processmultiinstance/actsamsprocessmultiinstancetest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -21,6 +22,7 @@
"label": "$string:entry_label",
"visible": true,
"orientation": "portrait",
+ "launchType": "singleton",
"skills": [
{
"actions": [
@@ -73,6 +75,10 @@
{
"name":"ohos.permission.CLEAN_APPLICATION_DATA",
"reason":"need use ohos.permission.CLEAN_APPLICATION_DATA"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
diff --git a/ability/ability_runtime/stage/actslifecyclemultihap2/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihap2/entry/src/main/module.json
index 9f1792371629b9a9fec9279715236ac9ba85fe8a..f2c1d762c17fed734dab46759222bfd5348d3fd6 100644
--- a/ability/ability_runtime/stage/actslifecyclemultihap2/entry/src/main/module.json
+++ b/ability/ability_runtime/stage/actslifecyclemultihap2/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hap2_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/stage/actslifecyclemultihap3/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihap3/entry/src/main/module.json
index 52dbb626fe4faa2b956997a1f1bcc7a086ef7819..5165038ad82fcb5326ae499150a04f62c8ef3eda 100644
--- a/ability/ability_runtime/stage/actslifecyclemultihap3/entry/src/main/module.json
+++ b/ability/ability_runtime/stage/actslifecyclemultihap3/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hap3_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json
index b2a1749da88ed99a65c7bd6e56f29745c8b45176..564159e9f0a917ad1c614f8037333a87d52dedd6 100644
--- a/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json
+++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -100,6 +101,12 @@
},
{
"name": "ohos.permission.LISTEN_BUNDLE_CHANGE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json
index 3bac8ff18e11056201cbf3171df82893faaedd94..3c9d185aca7a80a84837ee82da4f4bf711e8be91 100644
--- a/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json
+++ b/ability/ability_runtime/stage/actslifecyclemultihaptest/hap4/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hap4_desc",
"mainElement": "Hap4MainAbility1",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
index d1dd39f8f60df31efc4ffa1995941c7bb984cd0e..1e84d94fb59d475842e3cb523c92dcadfc5ac5a3 100644
--- a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
+++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
@@ -483,26 +483,33 @@ export default function lifecycleTest() {
console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1));
var strtemp = "";
var listtemp = [];
+ var listtemp2 = [];
for (var i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12);
- if (strtemp == "MainAbility5" || strtemp == "MainAbility2") {
- listtemp.push(globalThis.list1[i]);
+ if (strtemp == "MainAbility2") {
+ listtemp.push(globalThis.list1[i]);
+ } else if (strtemp == "MainAbility5") {
+ listtemp2.push(globalThis.list1[i]);
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
+ console.log(TAG + " listtemp2 is :" + JSON.stringify(listtemp2));
let exlist = listtemp;
- expect(exlist[0]).assertEqual("MainAbility5 onAbilityCreate");
- expect(exlist[1]).assertEqual("MainAbility5 onWindowStageCreate");
- expect(exlist[2]).assertEqual("MainAbility5 onAbilityForeground");
- expect(exlist[3]).assertEqual("MainAbility5 onAbilityBackground");
- expect(exlist[4]).assertEqual("MainAbility5 onWindowStageDestroy");
- expect(exlist[5]).assertEqual("MainAbility5 onAbilityDestroy");
- expect(exlist[6]).assertEqual("MainAbility2 onAbilityCreate");
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageCreate");
- expect(exlist[8]).assertEqual("MainAbility2 onAbilityForeground");
- expect(exlist[9]).assertEqual("MainAbility2 onAbilityBackground");
- expect(exlist[10]).assertEqual("MainAbility2 onWindowStageDestroy");
- expect(exlist[11]).assertEqual("MainAbility2 onAbilityDestroy");
+ let exlist2 = listtemp2;
+ expect(exlist[0]).assertEqual("MainAbility2 onAbilityCreate");
+ expect(exlist[1]).assertEqual("MainAbility2 onWindowStageCreate");
+ expect(exlist[2]).assertEqual("MainAbility2 onAbilityForeground");
+ expect(exlist[3]).assertEqual("MainAbility2 onAbilityBackground");
+ expect(exlist[4]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(exlist[5]).assertEqual("MainAbility2 onAbilityDestroy");
+
+ expect(exlist2[0]).assertEqual("MainAbility5 onAbilityCreate");
+ expect(exlist2[1]).assertEqual("MainAbility5 onWindowStageCreate");
+ expect(exlist2[2]).assertEqual("MainAbility5 onAbilityForeground");
+ expect(exlist2[3]).assertEqual("MainAbility5 onAbilityBackground");
+ expect(exlist2[4]).assertEqual("MainAbility5 onWindowStageDestroy");
+ expect(exlist2[5]).assertEqual("MainAbility5 onAbilityDestroy");
+
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
diff --git a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json
index 52411d94f2f676054edf3ae4be231530026e943c..0e9c03ada5357df552a006ee37a6aeb3e67b3264 100644
--- a/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json
+++ b/ability/ability_runtime/stage/actslifecyclesinglehaptest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -132,6 +133,16 @@
"description": "$string:MainAbility12_desc",
"icon": "$media:icon",
"label": "$string:MainAbility12_label"
- }]
+ }],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
+ ]
}
}
diff --git a/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets b/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets
index e11d1fccb80bb3c2b15517a50424c80e1e818c82..f235c47d5b9615c41f6e6c26edfbd8ce4693af87 100755
--- a/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets
+++ b/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/ets/test/LifecycleTest.ets
@@ -66,6 +66,7 @@ export default function abilityTest() {
console.info("---------------Multihap_WindowStageLifecycleTest_001 is start---------------")
TAG = "Multihap_WindowStageLifecycleTest_001";
listKeyTemp = [];
+ var transferStr0 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.lifecycletest",
@@ -87,14 +88,15 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) {
if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility3") {
listKeyTemp.push(globalThis.mainAbility4ListKey[i]);
+ transferStr0 += globalThis.mainAbility4ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility3 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility3 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility3 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap2MainAbility3 onWindowStageDestroy");
+ expect(transferStr0.indexOf("Hap2MainAbility3 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility3 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility3 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility3 onWindowStageDestroy")!=-1).assertTrue();
console.info(TAG + "globalThis.ApplicationContext4 is :" + JSON.stringify(globalThis.ApplicationContext4));
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
@@ -118,6 +120,7 @@ export default function abilityTest() {
console.log("------------Multihap_WindowStageLifecycleTest_002 start-------------");
TAG = "Multihap_WindowStageLifecycleTest_002";
listKeyTemp = [];
+ var transferStr0 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.lifecycletest",
@@ -149,15 +152,15 @@ export default function abilityTest() {
for (var i = 0; i < globalThis.mainAbility4ListKey.length; i++) {
if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility4") {
listKeyTemp.push(globalThis.mainAbility4ListKey[i]);
+ transferStr0 += globalThis.mainAbility4ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility4 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility4 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility4 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap2MainAbility4 onWindowStageInactive");
- expect(listKeyTemp[4]).assertEqual("Hap2MainAbility4 onWindowStageDestroy");
+ expect(transferStr0.indexOf("Hap2MainAbility4 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility4 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility4 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility4 onWindowStageDestroy")!=-1).assertTrue();
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -180,6 +183,7 @@ export default function abilityTest() {
console.log("------------Multihap_WindowStageLifecycleTest_003 start-------------");
TAG = "Multihap_WindowStageLifecycleTest_003";
listKeyTemp = [];
+ var transferStr0 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.lifecycletest",
@@ -211,19 +215,19 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) {
if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility5") {
listKeyTemp.push(globalThis.mainAbility4ListKey[i]);
+ transferStr0 += globalThis.mainAbility4ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility5 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility5 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility5 onWindowStageCreate");
- var transferStr0 = listKeyTemp[3] + listKeyTemp[4];
+ expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageDestroy")!=-1).assertTrue();
expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageInactive")!=-1).assertTrue();
- expect(listKeyTemp[5]).assertEqual("Hap2MainAbility5 onWindowStageDestroy");
- expect(listKeyTemp[6]).assertEqual("Hap2MainAbility5 onWindowStageInactive");
- expect(listKeyTemp[7]).assertEqual("Hap2MainAbility5 onWindowStageDestroy");
+ expect(transferStr0.indexOf("Hap2MainAbility5 onWindowStageDestroy")!=-1).assertTrue();
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -247,6 +251,8 @@ export default function abilityTest() {
TAG = "Multihap_WindowStageLifecycleTest_004";
listKeyTemp = [];
listKeyTemp1 = [];
+ var transferStr0 = "";
+ var transferStr1 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.lifecycletest",
@@ -278,23 +284,24 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) {
if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility6") {
listKeyTemp.push(globalThis.mainAbility4ListKey[i]);
+ transferStr0 += globalThis.mainAbility4ListKey[i];
} else if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap3MainAbility2") {
listKeyTemp1.push(globalThis.mainAbility4ListKey[i]);
+ transferStr1 += globalThis.mainAbility4ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "listKeyTemp1 is :" + listKeyTemp1);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility6 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility6 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility6 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap2MainAbility6 onWindowStageDestroy");
-
- expect(listKeyTemp1[0]).assertEqual("Hap3MainAbility2 onWindowStageCreate");
- expect(listKeyTemp1[1]).assertEqual("Hap3MainAbility2 onWindowStageActive");
- expect(listKeyTemp1[2]).assertEqual("Hap3MainAbility2 onWindowStageInactive");
- expect(listKeyTemp1[3]).assertEqual("Hap3MainAbility2 onWindowStageDestroy");
-
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageDestroy")!=-1).assertTrue();
+
+ expect(transferStr1.indexOf("Hap3MainAbility2 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility2 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -318,6 +325,8 @@ export default function abilityTest() {
TAG = "Multihap_WindowStageLifecycleTest_005";
listKeyTemp = [];
listKeyTemp1 = [];
+ var transferStr0 = "";
+ var transferStr1 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.lifecycletest",
@@ -349,22 +358,24 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) {
if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility6") {
listKeyTemp.push(globalThis.mainAbility4ListKey[i]);
+ transferStr0 += globalThis.mainAbility4ListKey[i];
} else if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility7") {
listKeyTemp1.push(globalThis.mainAbility4ListKey[i]);
+ transferStr1 += globalThis.mainAbility4ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "listKeyTemp1 is :" + listKeyTemp1);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility6 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility6 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility6 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap2MainAbility6 onWindowStageDestroy");
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageDestroy")!=-1).assertTrue();
- expect(listKeyTemp1[0]).assertEqual("Hap2MainAbility7 onWindowStageCreate");
- expect(listKeyTemp1[1]).assertEqual("Hap2MainAbility7 onWindowStageActive");
- expect(listKeyTemp1[2]).assertEqual("Hap2MainAbility7 onWindowStageInactive");
- expect(listKeyTemp1[3]).assertEqual("Hap2MainAbility7 onWindowStageDestroy");
+ expect(transferStr1.indexOf("Hap2MainAbility7 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap2MainAbility7 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap2MainAbility7 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap2MainAbility7 onWindowStageDestroy")!=-1).assertTrue();
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
@@ -471,6 +482,8 @@ export default function abilityTest() {
TAG = "Multihap_WindowStageLifecycleTest_007";
listKeyTemp = [];
listKeyTemp1 = [];
+ var transferStr0 = "";
+ var transferStr1 = "";
var callBackId1;
var callBackId2;
var flag;
@@ -495,17 +508,17 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility6ListKey.length; i++) {
if (globalThis.mainAbility6ListKey[i].substring(0, 16) == "Hap2MainAbility9") {
listKeyTemp.push(globalThis.mainAbility6ListKey[i]);
+ transferStr0 += globalThis.mainAbility6ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "first globalThis.mainAbility6CallBackId is :" + globalThis.mainAbility6CallBackId);
callBackId1 = globalThis.mainAbility6CallBackId
console.log(TAG + "callBackId1 is :" + callBackId1);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility9 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility9 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility9 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap2MainAbility9 onWindowStageDestroy");
-
+ expect(transferStr0.indexOf("Hap2MainAbility9 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility9 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility9 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility9 onWindowStageDestroy")!=-1).assertTrue();
globalThis.ApplicationContext6
.unregisterAbilityLifecycleCallback(globalThis.mainAbility6CallBackId, (error, data) => {
console.log(TAG + ": first unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -543,6 +556,7 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility6ListKey.length; i++) {
if (globalThis.mainAbility6ListKey[i].substring(0, 16) == "Hap2MainAbility9") {
listKeyTemp1.push(globalThis.mainAbility6ListKey[i]);
+ transferStr1 += globalThis.mainAbility6ListKey[i];
}
}
console.log(TAG + "listKeyTemp1 is :" + listKeyTemp1);
@@ -550,11 +564,10 @@ export default function abilityTest() {
callBackId2 = globalThis.mainAbility6CallBackId
console.log(TAG + "callBackId2 is :" + callBackId2);
expect(callBackId2).assertEqual(callBackId1 + 1)
- expect(listKeyTemp1[0]).assertEqual("Hap2MainAbility9 onWindowStageCreate");
- expect(listKeyTemp1[1]).assertEqual("Hap2MainAbility9 onWindowStageActive");
- expect(listKeyTemp1[2]).assertEqual("Hap2MainAbility9 onWindowStageInactive");
- expect(listKeyTemp1[3]).assertEqual("Hap2MainAbility9 onWindowStageDestroy");
-
+ expect(transferStr1.indexOf("Hap2MainAbility9 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap2MainAbility9 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap2MainAbility9 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap2MainAbility9 onWindowStageDestroy")!=-1).assertTrue();
globalThis.ApplicationContext6
.unregisterAbilityLifecycleCallback(globalThis.mainAbility6CallBackId, (error, data) => {
console.log(TAG + ": second unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -582,6 +595,7 @@ export default function abilityTest() {
console.log("------------Multihap_WindowStageLifecycleTest_008 start-------------");
TAG = "Multihap_WindowStageLifecycleTest_008";
listKeyTemp = [];
+ var transferStr0 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.lifecycletest",
@@ -604,15 +618,15 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) {
if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap2MainAbility6") {
listKeyTemp.push(globalThis.mainAbility4ListKey[i]);
+ transferStr0 += globalThis.mainAbility4ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility6 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility6 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility6 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap2MainAbility6 onWindowStageDestroy");
-
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility6 onWindowStageDestroy")!=-1).assertTrue();
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
console.log(TAG + ": first unregisterAbilityLifecycleCallback, err: " + JSON.stringify(error) +
@@ -642,6 +656,8 @@ export default function abilityTest() {
TAG = "Multihap_WindowStageLifecycleTest_009";
listKeyTemp = [];
listKeyTemp1 = [];
+ var transferStr0 = "";
+ var transferStr1 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.lifecycletest",
@@ -710,29 +726,30 @@ export default function abilityTest() {
for (var i = 0;i < globalThis.mainAbility4ListKey.length; i++) {
if (globalThis.mainAbility4ListKey[i].substring(0, 17) == "Hap2MainAbility10") {
listKeyTemp.push(globalThis.mainAbility4ListKey[i]);
+ transferStr0 += globalThis.mainAbility4ListKey[i];
} else if (globalThis.mainAbility4ListKey[i].substring(0, 16) == "Hap3MainAbility3") {
listKeyTemp1.push(globalThis.mainAbility4ListKey[i]);
+ transferStr1 += globalThis.mainAbility4ListKey[i];
}
}
console.log(TAG + " listKeyTemp is :" + listKeyTemp);
console.log(TAG + " listKeyTemp1 is :" + listKeyTemp1);
console.log(TAG + " globalThis.mainAbility4CallBackId is :" + globalThis.mainAbility4CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap2MainAbility10 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap2MainAbility10 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap2MainAbility10 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap2MainAbility10 onWindowStageActive");
- expect(listKeyTemp[4]).assertEqual("Hap2MainAbility10 onWindowStageInactive");
- expect(listKeyTemp[5]).assertEqual("Hap2MainAbility10 onWindowStageActive");
- expect(listKeyTemp[6]).assertEqual("Hap2MainAbility10 onWindowStageInactive");
-
- expect(listKeyTemp1[0]).assertEqual("Hap3MainAbility3 onWindowStageCreate");
- expect(listKeyTemp1[1]).assertEqual("Hap3MainAbility3 onWindowStageActive");
- expect(listKeyTemp1[2]).assertEqual("Hap3MainAbility3 onWindowStageInactive");
- expect(listKeyTemp1[3]).assertEqual("Hap3MainAbility3 onWindowStageActive");
- expect(listKeyTemp1[4]).assertEqual("Hap3MainAbility3 onWindowStageInactive");
- expect(listKeyTemp1[5]).assertEqual("Hap3MainAbility3 onWindowStageActive");
-
+ expect(transferStr0.indexOf("Hap2MainAbility10 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility10 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility10 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility10 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility10 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility10 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap2MainAbility10 onWindowStageInactive")!=-1).assertTrue();
+
+ expect(transferStr1.indexOf("Hap3MainAbility3 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility3 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility3 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility3 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility3 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("Hap3MainAbility3 onWindowStageActive")!=-1).assertTrue();
globalThis.ApplicationContext4
.unregisterAbilityLifecycleCallback(globalThis.mainAbility4CallBackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -796,4 +813,4 @@ export default function abilityTest() {
console.info("---------------Multihap_WindowStageLifecycleTest_010 is end---------------")
})
})
-}
\ No newline at end of file
+}
diff --git a/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/module.json b/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/module.json
index b2a1749da88ed99a65c7bd6e56f29745c8b45176..564159e9f0a917ad1c614f8037333a87d52dedd6 100755
--- a/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/module.json
+++ b/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
@@ -100,6 +101,12 @@
},
{
"name": "ohos.permission.LISTEN_BUNDLE_CHANGE"
+ },
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
diff --git a/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/hap4/src/main/module.json b/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/hap4/src/main/module.json
index 3bac8ff18e11056201cbf3171df82893faaedd94..3c9d185aca7a80a84837ee82da4f4bf711e8be91 100755
--- a/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/hap4/src/main/module.json
+++ b/ability/ability_runtime/stage/actswindowstagelifecyclemultihaptest/hap4/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:hap4_desc",
"mainElement": "Hap4MainAbility1",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets b/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
index 5676654b5911ae3bdfcec0f427d1713e6bd89d64..52691b5b223b131c5eeb2b4b2780999f307da019 100755
--- a/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
+++ b/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/ets/test/LifeCycleTest.ets
@@ -96,14 +96,15 @@ export default function lifecycleTest() {
console.log(TAG + " registerAbilityLifecycleCallback tempCallbackId : " + JSON.stringify(tempCallbackId));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list.length; i++) {
strtemp = globalThis.list[i].substring(0, 12);
if (strtemp === "MainAbility2") {
listtemp.push(globalThis.list[i]);
+ transferStr0 += globalThis.list[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
- let exlist = listtemp;
globalThis.applicationContext
.unregisterAbilityLifecycleCallback(tempCallbackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -111,10 +112,10 @@ export default function lifecycleTest() {
code = error.code;
});
setTimeout(function () {
- expect(exlist[0]).assertEqual("MainAbility2 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility2 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageInactive");
- expect(exlist[3]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(code).assertEqual(0);
console.log("------------Singlehap_WindowStageLifeCycleTest_0100 END-------------");
done();
@@ -159,14 +160,15 @@ export default function lifecycleTest() {
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1" || strtemp === "MainAbility2") {
listtemp.push(globalThis.list1[i]);
+ transferStr0 += globalThis.list1[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
- let exlist = listtemp;
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -174,16 +176,14 @@ export default function lifecycleTest() {
code = error.code;
})
setTimeout(function () {
- expect(exlist[0]).assertEqual("MainAbility1 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility1 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[3] + exlist[4];
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
- var transferStr1 = exlist[5] + exlist[6];
- expect(transferStr1.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
- expect(transferStr1.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(code).assertEqual(0);
console.log("------------Singlehap_WindowStageLifeCycleTest_0200 END-------------");
done();
@@ -228,14 +228,15 @@ export default function lifecycleTest() {
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1" || strtemp === "MainAbility2") {
listtemp.push(globalThis.list1[i]);
+ transferStr0 += globalThis.list1[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
- let exlist = listtemp;
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1)
.then((data) => {
@@ -254,16 +255,14 @@ export default function lifecycleTest() {
})
}, 500);
setTimeout(function () {
- expect(exlist[0]).assertEqual("MainAbility1 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility1 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[3] + exlist[4];
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
- var transferStr0 = exlist[5] + exlist[6];
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(code).assertEqual(1);
console.log("------------Singlehap_WindowStageLifeCycleTest_0300 END-------------");
done();
@@ -308,10 +307,12 @@ export default function lifecycleTest() {
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid3));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list3.length; i++) {
strtemp = globalThis.list3[i].substring(0, 12);
if (strtemp === "MainAbility3" || strtemp === "MainAbility2") {
listtemp.push(globalThis.list3[i]);
+ transferStr0 += globalThis.list3[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
@@ -339,16 +340,14 @@ export default function lifecycleTest() {
})
}, 500);
setTimeout(function () {
- expect(exlist[0]).assertEqual("MainAbility3 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility3 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[3] + exlist[4];
+ expect(transferStr0.indexOf("MainAbility3 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility3 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility3 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
- var transferStr0 = exlist[5] + exlist[6];
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility3 onWindowStageActive")!=-1).assertTrue();
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(code).assertEqual(0);
console.log("------------Singlehap_WindowStageLifeCycleTest_0400 END-------------");
done();
@@ -404,23 +403,23 @@ export default function lifecycleTest() {
console.log(TAG + " callbackid1 : " + JSON.stringify(globalThis.callbackid1));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp == "MainAbility5" || strtemp == "MainAbility2") {
listtemp.push(globalThis.list1[i]);
+ transferStr0 += globalThis.list1[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
- let exlist = listtemp;
- expect(exlist[0]).assertEqual("MainAbility5 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility5 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[3] + exlist[4];
+ expect(transferStr0.indexOf("MainAbility5 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility5 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility5 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist[5]).assertEqual("MainAbility5 onWindowStageDestroy");
- expect(exlist[6]).assertEqual("MainAbility2 onWindowStageInactive");
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility5 onWindowStageDestroy")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -428,7 +427,7 @@ export default function lifecycleTest() {
console.log("------------Singlehap_WindowStageLifeCycleTest_0500 END-------------");
done();
})
- }, 4200);
+ }, 3800);
});
/*
@@ -493,34 +492,30 @@ export default function lifecycleTest() {
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1" || strtemp === "MainAbility2") {
listtemp.push(globalThis.list1[i]);
+ transferStr0 += globalThis.list1[i];
}
}
console.log(TAG + " listtemp is :" + listtemp);
- let exlist = listtemp;
- expect(exlist[0]).assertEqual("MainAbility1 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility1 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[3] + exlist[4];
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageInactive")!=-1).assertTrue();
- var transferStr0 = exlist[5] + exlist[6];
expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageDestroy");
- expect(exlist[8]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[9] + exlist[10];
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageInactive")!=-1).assertTrue();
- var transferStr0 = exlist[11] + exlist[12];
expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist[13]).assertEqual("MainAbility2 onWindowStageDestroy");
- expect(exlist[14]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[15] + exlist[16];
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageInactive")!=-1).assertTrue();
globalThis.applicationContext1
@@ -581,32 +576,29 @@ export default function lifecycleTest() {
console.log(TAG + " registerAbilityLifecycleCallback callbackid : " + JSON.stringify(globalThis.callbackid1));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list1.length; i++) {
strtemp = globalThis.list1[i].substring(0, 12);
if (strtemp === "MainAbility1" || strtemp === "MainAbility2") {
listtemp.push(globalThis.list1[i]);
+ transferStr0 += globalThis.list1[i];
}
}
console.log(TAG + " listtemp is :" + listtemp);
- let exlist = listtemp;
- expect(exlist[0]).assertEqual("MainAbility1 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility1 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[3] + exlist[4];
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageInactive")!=-1).assertTrue();
- var transferStr0 = exlist[5] + exlist[6];
expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageDestroy");
- expect(exlist[8]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[9] + exlist[10];
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility1 onWindowStageInactive")!=-1).assertTrue();
- var transferStr0 = exlist[11] + exlist[12];
expect(transferStr0.indexOf("MainAbility1 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist[13]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
globalThis.applicationContext1
.unregisterAbilityLifecycleCallback(globalThis.callbackid1, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -680,6 +672,7 @@ export default function lifecycleTest() {
console.log("------------Singlehap_WindowStageLifeCycleTest_0900 start-------------");
TAG = "Singlehap_WindowStageLifeCycleTest_0900";
listKeyTemp = [];
+ var transferStr0 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.windowstagelifecycle_xts",
abilityName: "MainAbility9"
@@ -706,15 +699,15 @@ export default function lifecycleTest() {
for (var i = 0; i < globalThis.mainAbility9ListKey.length; i++) {
if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility1") {
listKeyTemp.push(globalThis.mainAbility9ListKey[i]);
+ transferStr0 += globalThis.mainAbility9ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "globalThis.mainAbility9CallBackId is :" + globalThis.mainAbility9CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap1MainAbility1 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap1MainAbility1 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap1MainAbility1 onWindowStageInactive");
- expect(listKeyTemp[3]).assertEqual("Hap1MainAbility1 onWindowStageInactive");
- expect(listKeyTemp[4]).assertEqual("Hap1MainAbility1 onWindowStageDestroy");
+ expect(transferStr0.indexOf("Hap1MainAbility1 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap1MainAbility1 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap1MainAbility1 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap1MainAbility1 onWindowStageDestroy")!=-1).assertTrue();
globalThis.applicationContext9
.unregisterAbilityLifecycleCallback(globalThis.mainAbility9CallBackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -736,6 +729,7 @@ export default function lifecycleTest() {
console.log("------------Singlehap_WindowStageLifeCycleTest_1000 start-------------");
TAG = "Singlehap_WindowStageLifeCycleTest_1000";
listKeyTemp = [];
+ var transferStr0 = "";
globalThis.abilityContext.startAbility({
bundleName: "com.example.windowstagelifecycle_xts",
abilityName: "MainAbility9"
@@ -762,19 +756,19 @@ export default function lifecycleTest() {
for (var i = 0;i < globalThis.mainAbility9ListKey.length; i++) {
if (globalThis.mainAbility9ListKey[i].substring(0, 16) == "Hap1MainAbility2") {
listKeyTemp.push(globalThis.mainAbility9ListKey[i]);
+ transferStr0 += globalThis.mainAbility9ListKey[i];
}
}
console.log(TAG + "listKeyTemp is :" + listKeyTemp);
console.log(TAG + "globalThis.mainAbility9CallBackId is :" + globalThis.mainAbility9CallBackId);
- expect(listKeyTemp[0]).assertEqual("Hap1MainAbility2 onWindowStageCreate");
- expect(listKeyTemp[1]).assertEqual("Hap1MainAbility2 onWindowStageActive");
- expect(listKeyTemp[2]).assertEqual("Hap1MainAbility2 onWindowStageCreate");
- var transferStr0 = listKeyTemp[3] + listKeyTemp[4];
+ expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(listKeyTemp[5]).assertEqual("Hap1MainAbility2 onWindowStageDestroy");
- expect(listKeyTemp[6]).assertEqual("Hap1MainAbility2 onWindowStageInactive");
- expect(listKeyTemp[7]).assertEqual("Hap1MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("Hap1MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
globalThis.applicationContext9
.unregisterAbilityLifecycleCallback(globalThis.mainAbility9CallBackId, (error, data) => {
console.log(TAG + ": unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error) +
@@ -853,18 +847,19 @@ export default function lifecycleTest() {
console.log(TAG + " secondCallback id : " + JSON.stringify(id2));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list11.length; i++) {
strtemp = globalThis.list11[i].substring(0, 12);
if (strtemp == "MainAbility2") {
listtemp.push(globalThis.list11[i]);
+ transferStr0 += globalThis.list11[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
- let exlist = listtemp;
- expect(exlist[0]).assertEqual("MainAbility2 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility2 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageInactive");
- expect(exlist[3]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(id1 + 1).assertEqual(id2);
globalThis.applicationContext11
.unregisterAbilityLifecycleCallback(globalThis.callbackid11, (error, data) => {
@@ -960,18 +955,19 @@ export default function lifecycleTest() {
console.log(TAG + " secondCallback id : " + JSON.stringify(id2));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < globalThis.list12.length; i++) {
strtemp = globalThis.list12[i].substring(0, 12);
if (strtemp == "MainAbility2") {
listtemp.push(globalThis.list12[i]);
+ transferStr0 += globalThis.list12[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
- let exlist = listtemp;
- expect(exlist[0]).assertEqual("MainAbility2 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility2 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageInactive");
- expect(exlist[3]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(id1 + 1).assertEqual(id2);
globalThis.applicationContext12
.unregisterAbilityLifecycleCallback(id2, (error, data) => {
@@ -1122,40 +1118,39 @@ export default function lifecycleTest() {
console.log(TAG + " secondCallback id12 : " + JSON.stringify(id4));
var strtemp = "";
var listtemp = [];
+ var transferStr0 = "";
for (var i = 0; i < templist1.length; i++) {
strtemp = templist1[i].substring(0, 13);
if (strtemp === "MainAbility2 " || strtemp === "MainAbility12") {
listtemp.push(templist1[i]);
+ transferStr0 += templist1[i];
}
}
console.log(TAG + " listtemp is :" + JSON.stringify(listtemp));
setTimeout(function () {
var strtemp1 = "";
var listtemp1 = [];
+ var transferStr1 = "";
for (var j = 0; j < templist2.length; j++) {
strtemp1 = templist2[j].substring(0, 12);
if (strtemp1 === "MainAbility2") {
listtemp1.push(templist2[j]);
+ transferStr1 += templist2[j];
}
}
console.log(TAG + " listtemp1 is :" + JSON.stringify(listtemp1));
- let exlist = listtemp;
- let exlist1 = listtemp1;
- expect(exlist[0]).assertEqual("MainAbility12 onWindowStageCreate");
- expect(exlist[1]).assertEqual("MainAbility12 onWindowStageActive");
- expect(exlist[2]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist[3] + exlist[4];
+ expect(transferStr0.indexOf("MainAbility12 onWindowStageCreate")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility12 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility12 onWindowStageInactive")!=-1).assertTrue();
- var transferStr0 = exlist[5] + exlist[6];
expect(transferStr0.indexOf("MainAbility12 onWindowStageActive")!=-1).assertTrue();
expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist[7]).assertEqual("MainAbility2 onWindowStageDestroy");
- expect(exlist1[0]).assertEqual("MainAbility2 onWindowStageCreate");
- var transferStr0 = exlist1[1] + exlist1[2];
- expect(transferStr0.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
- expect(transferStr0.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
- expect(exlist1[3]).assertEqual("MainAbility2 onWindowStageDestroy");
+ expect(transferStr0.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
+ expect(transferStr1.indexOf("MainAbility2 onWindowStageCreate")!=-1).assertTrue();;
+ expect(transferStr1.indexOf("MainAbility2 onWindowStageActive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("MainAbility2 onWindowStageInactive")!=-1).assertTrue();
+ expect(transferStr1.indexOf("MainAbility2 onWindowStageDestroy")!=-1).assertTrue();
expect(id1 + 1).assertEqual(id2);
expect(id3 + 1).assertEqual(id4);
globalThis.applicationContext12
diff --git a/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/module.json b/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/module.json
index acbdfcd9d999e14c2c802796fa8d5426daa67a8d..dec743967831396c2c80db96b9ad9b95211f9a38 100755
--- a/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/module.json
+++ b/ability/ability_runtime/stage/actswindowstagelifecyclesinglehaptest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone",
"tablet"
],
@@ -132,6 +133,16 @@
"description": "$string:MainAbility12_desc",
"icon": "$media:icon",
"label": "$string:MainAbility12_label"
- }]
+ }],
+ "requestPermissions": [
+ {
+ "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
+ "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
+ },
+ {
+ "name":"ohos.permission.START_INVISIBLE_ABILITY",
+ "reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
+ }
+ ]
}
}
diff --git a/ability/ability_runtime/want/BUILD.gn b/ability/ability_runtime/want/BUILD.gn
index 815bea294b3aacd103f1a4ffea3117225f5dc0e8..fe2d26693b0b09e1ff0692fcb2e86a18608d5e31 100644
--- a/ability/ability_runtime/want/BUILD.gn
+++ b/ability/ability_runtime/want/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/want/actsgetwantalltest/BUILD.gn b/ability/ability_runtime/want/actsgetwantalltest/BUILD.gn
index 3214ed3b1b76c65d1c8725cd6f31b0691d0bd874..660ff523df966d781a82dc8b2a4ffad84e80695d 100644
--- a/ability/ability_runtime/want/actsgetwantalltest/BUILD.gn
+++ b/ability/ability_runtime/want/actsgetwantalltest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/ability_runtime/want/actsgetwantalltest/src/main/config.json b/ability/ability_runtime/want/actsgetwantalltest/src/main/config.json
index efa31c7362fe6bbf13d3b4893aa1ea545a2238c6..2f2347ebd9415044f3b42d1720d7fb36f7dbf918 100644
--- a/ability/ability_runtime/want/actsgetwantalltest/src/main/config.json
+++ b/ability/ability_runtime/want/actsgetwantalltest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsgetwantalltest",
"name": ".entry",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/config.json b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/config.json
index cee293b11598b0b884db050de54cbf9b935ae6bd..f8546baa5a399f59a14089f26580b2f7438490de 100644
--- a/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/config.json
+++ b/ability/ability_runtime/want/sceneProject/actsgetwantalltesthap/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsgetwantallhap",
"name": "com.example.actsgetwantalltesthap.MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/ability_runtime/workercontextcover/workercontexttest/entry/src/main/module.json b/ability/ability_runtime/workercontextcover/workercontexttest/entry/src/main/module.json
index 3cc8a78ba369000de6357c5414e3f2fd9c0e55ec..c49dee47dee5b74a9f7a10e2370cdb3bc467475a 100644
--- a/ability/ability_runtime/workercontextcover/workercontexttest/entry/src/main/module.json
+++ b/ability/ability_runtime/workercontextcover/workercontexttest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json
index 831fb3d8118747dad4cfed307da30e4f1de0575a..a914a1a8a94f1e8c9113311eb067961fc9f96cf4 100644
--- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json
+++ b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json
index a30b037489b5d261b7405e566bc6352014518367..64a6a860fa96bae7530531b40e450c6eb2af64d9 100644
--- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json
+++ b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/ability/dmsfwk/continuationmanagertest/BUILD.gn b/ability/dmsfwk/continuationmanagertest/BUILD.gn
index b3d2e5dff1cfdb6ac2581eb54670da32c3727399..6709681f47cb8f02942d359d6114ac3126a1f199 100644
--- a/ability/dmsfwk/continuationmanagertest/BUILD.gn
+++ b/ability/dmsfwk/continuationmanagertest/BUILD.gn
@@ -9,7 +9,7 @@
# 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.
+# limitations under the License.
import("//test/xts/tools/build/suite.gni")
diff --git a/ability/dmsfwk/continuationmanagertest/src/main/config.json b/ability/dmsfwk/continuationmanagertest/src/main/config.json
index 73664228baca03b9cd85ed6d2e4a22fcfcae8b9e..d8366edba49748e546a6d4c52903a3a710c316b4 100644
--- a/ability/dmsfwk/continuationmanagertest/src/main/config.json
+++ b/ability/dmsfwk/continuationmanagertest/src/main/config.json
@@ -17,6 +17,7 @@
"name": ".entry",
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js b/ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
index b2d4b262e1a69f5935df6f55c19308c25ccc330f..65b1f395e4f76ff2513e626a93adbaef6642e39b 100644
--- a/ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
+++ b/ability/dmsfwk/continuationmanagertest/src/main/js/test/ContinuationManagerJsunit.test.js
@@ -80,6 +80,7 @@ describe('continuationManagerTest', function() {
try {
let continuationExtraParams = {
deviceType: [],
+ targetBundle: "",
description: "",
filter: "",
continuationMode: null,
@@ -106,6 +107,7 @@ describe('continuationManagerTest', function() {
try {
let continuationExtraParams = {
deviceType: ["00E"],
+ targetBundle: "ohos.example.test",
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: 10,
@@ -132,6 +134,7 @@ describe('continuationManagerTest', function() {
try {
let continuationExtraParams = {
deviceType: ["00E"],
+ targetBundle: "ohos.example.test",
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_MULTIPLE,
@@ -159,6 +162,7 @@ describe('continuationManagerTest', function() {
try {
let continuationExtraParams = {
deviceType: ["00E"],
+ targetBundle: "ohos.example.test",
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE,
@@ -185,6 +189,7 @@ describe('continuationManagerTest', function() {
try {
let continuationExtraParams = {
deviceType: ["00E"],
+ targetBundle: "ohos.example.test",
description: "description",
filter: {"name": "authInfo","length": 8},
continuationMode: continuationManager.ContinuationMode.COLLABORATION_SINGLE,
diff --git a/ability_lite/ability_posix/BUILD.gn b/ability_lite/ability_posix/BUILD.gn
index fbcdb8dce899d9cfcd99d184cf46e70e21c2b57c..b44a16ec7da3dee30e22b8142c92bf2288395e62 100755
--- a/ability_lite/ability_posix/BUILD.gn
+++ b/ability_lite/ability_posix/BUILD.gn
@@ -53,7 +53,7 @@ hcpptest_suite("ActsAbilityMgrTest") {
"//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
"//third_party/bounds_checking_function/include",
"//third_party/cJSON",
- "//utils/native/lite/include",
+ "//commonlibrary/utils_lite/include",
"${appexecfwk_lite_path}/interfaces/innerkits/bundlemgr_lite",
"//foundation/graphic/ui/interfaces/kits",
"//foundation/graphic/utils/interfaces/innerkits",
diff --git a/ability_lite/ability_posix/Test.json b/ability_lite/ability_posix/Test.json
index 26a46f4f094bba48706456936c44bb8b99321eb0..790edb7618ee877452d1b495d26b4f471aa6255d 100755
--- a/ability_lite/ability_posix/Test.json
+++ b/ability_lite/ability_posix/Test.json
@@ -12,7 +12,7 @@
"server": "NfsServer",
"mount": [
{
- "source": "testcases/aafwk",
+ "source": "testcases/ability",
"target": "/test_root/aafwk"
},{
"source": "resource/aafwk",
diff --git a/account/OsAccountTest_js/src/main/config.json b/account/OsAccountTest_js/src/main/config.json
index 2ed8950e0d75e5997286b43a59bf1f94b888a755..fd7e2fd62b1434e72b956a90bca72172dddb67f6 100644
--- a/account/OsAccountTest_js/src/main/config.json
+++ b/account/OsAccountTest_js/src/main/config.json
@@ -18,6 +18,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/BUILD.gn b/account/appaccount/BUILD.gn
index f1f890f6e43ea15eafb224c4f53afc1881da0d01..c5a5c0d20fcb1ab04ab69bee51dd9a30833d7a76 100644
--- a/account/appaccount/BUILD.gn
+++ b/account/appaccount/BUILD.gn
@@ -18,6 +18,7 @@ group("appaccount_hap") {
if (is_standard_system) {
deps = [
"actsaccounttest:ActsAccountTest",
+ "actsaccounttstest:ActsAccountTsTest",
"actsgetallaccounts:ActsGetAllAccountsTest",
"actssetchecksyncenable:ActsSetCheckSyncEnableTest",
"getallaccessibleaccounts:accessibleaccounts",
diff --git a/account/appaccount/actsaccounttest/src/main/config.json b/account/appaccount/actsaccounttest/src/main/config.json
index e47e0d633e3b22fa3b1f853a4dd6822a91edd311..666c83c70540443e228bda9a0d32be658e59a8cd 100644
--- a/account/appaccount/actsaccounttest/src/main/config.json
+++ b/account/appaccount/actsaccounttest/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsaccounttest",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/actsaccounttest/src/main/js/test/AssociatedData.test.js b/account/appaccount/actsaccounttest/src/main/js/test/AssociatedData.test.js
index 1cc7a8081cc16d955f357c84396a025d81de737c..226cd16e5df5a482f1cd2a7676d00ebb303f6d79 100755
--- a/account/appaccount/actsaccounttest/src/main/js/test/AssociatedData.test.js
+++ b/account/appaccount/actsaccounttest/src/main/js/test/AssociatedData.test.js
@@ -1161,5 +1161,35 @@ export default function ActsAccountAssociatedData() {
}
}
})
+
+
+ /*
+ * @tc.number : ActsAccountAssociatedData_3100
+ * @tc.name : The correct calls setAssociatedData and getAssociatedData get the value
+ * @tc.desc : The setAssociatedData setting valueis called when the forwarding parameters
+ * are correct, and then getAssociatedData is called for the value(callback)
+ */
+ it('ActsAccountAssociatedData_3100', 0, async function (done) {
+ console.debug("====>ActsAccountAssociatedData_3100 start====");
+ var appAccountManager = account.createAppAccountManager();
+ console.debug("====>creat finish====");
+ appAccountManager.addAccount("account_name_3100",(err)=>{
+ console.debug("====>add ActsAccountAssociatedData_3100 err:" + JSON.stringify(err));
+ expect(err).assertEqual(null);
+ appAccountManager.setAssociatedData("account_name_3100", "key31", "value31", (err)=>{
+ console.debug("====>setAssociatedData ActsAccountAssociatedData_3100 err:" + JSON.stringify(err));
+ expect(err).assertEqual(null);
+ var result = appAccountManager.getAssociatedDataSync("account_name_3100", "key31")
+ console.debug("====>getAssociatedData ActsAccountAssociatedData_3100 result:" + JSON.stringify(result));
+ expect(result).assertEqual("value31");
+ appAccountManager.deleteAccount("account_name_3100", (err)=>{
+ console.debug("====>delete Account 0100 err:" + JSON.stringify(err));
+ expect(err).assertEqual(null);
+ console.debug("====>ActsAccountAssociatedData_3100 end====");
+ done();
+ });
+ });
+ });
+ });
})
}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js b/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js
index 6de90a72c8e9be2d23aadccb2a3d9526f9b85faf..a0928b1c80d3add2f46b6abd7bf03e470899b71d 100644
--- a/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js
+++ b/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import account from '@ohos.account.appAccount'
+import featureAbility from '@ohos.ability.featureAbility'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const NAMELIMIT = 512;
@@ -22,6 +23,18 @@ const owner = 'com.example.accountauthenticator'
export default function ActsAccountAppAccess() {
describe('ActsAccountAuthenticator', function () {
+ function sleep(delay) {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ resolve()
+ }, delay)
+ }).then(() => {
+ console.info(`sleep #{time} over ...`)
+ })
+ }
+ beforeAll(async function (done) {
+ done();
+ });
/*
* @tc.number : ActsAccountCheckAccountLabels_0100
* @tc.name : Check Account Labels callback form
@@ -568,7 +581,21 @@ export default function ActsAccountAppAccess() {
* @tc.desc :
*/
- it('ActsAccountSelectAccountByOptions_0100', 0, async function (done) {
+ it('ActsAccountSelectAccountByOptions_0100', 0, async function (done) {
+ await featureAbility.startAbility(
+ {
+ want:
+ {
+ deviceId: "",
+ bundleName: "com.example.accountauthenticator",
+ abilityName: "com.example.accountauthenticator.MainAbility",
+ action: "action1",
+ parameters:
+ {},
+ },
+ },
+ )
+ await sleep(1000)
console.debug("====>ActsAccountSelectAccountByOptions_0100 start====");
var appAccountManager = account.createAppAccountManager();
var select_options = {allowedAccounts:[{"name":name,"owner":owner}]}
@@ -579,9 +606,9 @@ export default function ActsAccountAppAccess() {
try {
var data = await appAccountManager.selectAccountsByOptions(select_options)
console.debug("====>ActsAccountSelectAccountByOptions_0100 data:" + JSON.stringify(data));
- expect(data.length).assertEqual(1)
+ expect(data.length).assertEqual(1)
} catch(err) {
- onsole.debug("====>ActsAccountSelectAccountByOptions_0100 err:" + JSON.stringify(err));
+ console.debug("====>ActsAccountSelectAccountByOptions_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
@@ -593,7 +620,7 @@ export default function ActsAccountAppAccess() {
console.debug('====>ActsAccountSelectAccountByOptions_0100 deleteAccount_err')
expect().assertFail()
done();
- }
+ }
});
});
@@ -604,6 +631,20 @@ export default function ActsAccountAppAccess() {
*/
it('ActsAccountSelectAccountByOptions_0200', 0, async function (done) {
+ await featureAbility.startAbility(
+ {
+ want:
+ {
+ deviceId: "",
+ bundleName: "com.example.accountauthenticator",
+ abilityName: "com.example.accountauthenticator.MainAbility",
+ action: "action1",
+ parameters:
+ {},
+ },
+ },
+ )
+ await sleep(1000)
console.debug("====>ActsAccountSelectAccountByOptions_0200 start====");
var appAccountManager = account.createAppAccountManager();
var select_options = {allowedOwners: [owner]}
@@ -616,7 +657,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>ActsAccountSelectAccountByOptions_0200 data:" + JSON.stringify(data));
expect(data.length).assertEqual(3)
} catch(err) {
- onsole.debug("====>ActsAccountSelectAccountByOptions_0200 err:" + JSON.stringify(err));
+ console.debug("====>ActsAccountSelectAccountByOptions_0200 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
@@ -640,6 +681,20 @@ export default function ActsAccountAppAccess() {
*/
it('ActsAccountSelectAccountByOptions_0300', 0, async function (done) {
+ await featureAbility.startAbility(
+ {
+ want:
+ {
+ deviceId: "",
+ bundleName: "com.example.accountauthenticator",
+ abilityName: "com.example.accountauthenticator.MainAbility",
+ action: "action1",
+ parameters:
+ {},
+ },
+ },
+ )
+ await sleep(1000)
console.debug("====>ActsAccountSelectAccountByOptions_0300 start====");
var appAccountManager = account.createAppAccountManager();
var options = {requiredLabels: ["male", "30-40"]}
@@ -652,7 +707,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>ActsAccountSelectAccountByOptions_0300 data:" + JSON.stringify(data));
expect(data.length).assertEqual(1)
} catch(err) {
- onsole.debug("====>ActsAccountSelectAccountByOptions_0300 err:" + JSON.stringify(err));
+ console.debug("====>ActsAccountSelectAccountByOptions_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
diff --git a/account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js b/account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js
index 5fa9b267b0661f4f3294200b79946ee095e65d08..b901cce6d59a1e1fcb63e2ebd6f279ae07d3c406 100755
--- a/account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js
+++ b/account/appaccount/actsaccounttest/src/main/js/test/NoPermission.test.js
@@ -198,7 +198,8 @@ export default function ActsAccountNoPermission() {
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 0700 err:" + JSON.stringify(err));
- expect(err.code).assertEqual(account.ResultCode.ERROR_PERMISSION_DENIED);
+ expect(err).assertEqual(null);
+ expect(data.length>0).assertEqual(true);
appAccountManager.deleteAccount("getAll_callback_nopermission", (err)=>{
console.debug("====>delete account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
diff --git a/account/appaccount/actsaccounttest/src/main/js/test/OnOff.js b/account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
index b66091f139c02bdb9f70d2ac3515937e4900bcf7..c5020391e75ab38b21de17027fe8c9ba2fae3a4c 100644
--- a/account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
+++ b/account/appaccount/actsaccounttest/src/main/js/test/OnOff.js
@@ -30,7 +30,11 @@ export default function ActsAccountChangeOnOff() {
console.info(`sleep #{time} over ...`)
})
}
- beforeAll(async function (done) {
+ beforeAll(async function (done) {
+ done();
+ });
+
+ async function testInit(){
console.debug("====>startAbility start====");
await featureAbility.startAbility(
{
@@ -46,8 +50,7 @@ export default function ActsAccountChangeOnOff() {
},
);
await sleep(TIMEOUT);
- done();
- });
+ }
/*
* @tc.number : ActsAccountChangeOnOff_0100
@@ -56,6 +59,7 @@ export default function ActsAccountChangeOnOff() {
* the additional information
*/
it('ActsAccountChangeOnOff_0100', 0, async function (done) {
+ testInit();
console.debug("====>ActsAccountChangeOnOff_0100 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
@@ -124,6 +128,7 @@ export default function ActsAccountChangeOnOff() {
* the associatal data
*/
it('ActsAccountChangeOnOff_0200', 0, async function (done) {
+ testInit();
console.debug("====>ActsAccountChangeOnOff_0200 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
@@ -187,6 +192,7 @@ export default function ActsAccountChangeOnOff() {
* the credential
*/
it('ActsAccountChangeOnOff_0300', 0, async function (done) {
+ testInit();
console.debug("====>ActsAccountChangeOnOff_0300 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
@@ -250,6 +256,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
*/
it('ActsAccountChangeOnOff_0400', 0, async function (done) {
+ testInit();
console.debug("====>ActsAccountChangeOnOff_0400 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
@@ -317,6 +324,7 @@ export default function ActsAccountChangeOnOff() {
* the only authorized account
*/
it('ActsAccountChangeOnOff_0500', 0, async function (done) {
+ testInit();
console.debug("====>ActsAccountChangeOnOff_0500 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
@@ -325,7 +333,7 @@ export default function ActsAccountChangeOnOff() {
console.debug("====>enableAppAccess ActsAccountChangeOnOff_0500 start");
await appAccountManager.enableAppAccess("onoff_delete", "com.example.actsaccountsceneonoff");
function unSubscriberCallback(err){
- console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err));
+ console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err));
}
function subscriberCallback(err, data){
console.debug("====>subscriberCallback 0500 data:" + JSON.stringify(data));
@@ -375,6 +383,7 @@ export default function ActsAccountChangeOnOff() {
* authorized account
*/
it('ActsAccountChangeOnOff_0600', 0, async function (done) {
+ testInit();
console.debug("====>ActsAccountChangeOnOff_0600 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
@@ -446,6 +455,7 @@ export default function ActsAccountChangeOnOff() {
* the only authorized account
*/
it('ActsAccountChangeOnOff_0700', 0, async function (done) {
+ testInit();
console.debug("====>ActsAccountChangeOnOff_0700 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>creat appAccountManager finish");
diff --git a/account/appaccount/actsaccounttstest/AppScope/app.json b/account/appaccount/actsaccounttstest/AppScope/app.json
new file mode 100644
index 0000000000000000000000000000000000000000..ea1d2221fe937e340d83cd80336a8c8a4b3090ff
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/AppScope/app.json
@@ -0,0 +1,21 @@
+{
+ "app": {
+ "bundleName": "com.example.accounttstest",
+ "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
+ }
+ }
+}
diff --git a/account/appaccount/actsaccounttstest/AppScope/resources/base/element/string.json b/account/appaccount/actsaccounttstest/AppScope/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ee69f9a861d9dc269ed6638735d52674583498e1
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/AppScope/resources/base/element/string.json
@@ -0,0 +1,8 @@
+{
+ "string":[
+ {
+ "name":"app_name",
+ "value":"ohosProject"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/AppScope/resources/base/media/app_icon.png b/account/appaccount/actsaccounttstest/AppScope/resources/base/media/app_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023
Binary files /dev/null and b/account/appaccount/actsaccounttstest/AppScope/resources/base/media/app_icon.png differ
diff --git a/account/appaccount/actsaccounttstest/BUILD.gn b/account/appaccount/actsaccounttstest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..15f72696b6c2359c50d7e64bcbc34941b2c411c6
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/BUILD.gn
@@ -0,0 +1,43 @@
+# 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("ActsAccountTsTest") {
+ hap_profile = "./entry/src/main/module.json"
+ js_build_mode = "debug"
+ deps = [
+ ":accounttstest_js_assets",
+ ":accounttstest_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "signature/openharmony_sx.p7b"
+ hap_name = "ActsAccountTsTest"
+ part_name = "accessibility"
+ subsystem_name = "barrierfree"
+}
+
+ohos_app_scope("accounttstest_app_profile") {
+ app_profile = "AppScope/app.json"
+ sources = [ "AppScope/resources" ]
+}
+
+ohos_js_assets("accounttstest_js_assets") {
+ source_dir = "./entry/src/main/ets"
+}
+
+ohos_resources("accounttstest_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ deps = [ ":accounttstest_app_profile" ]
+ hap_profile = "./entry/src/main/module.json"
+}
diff --git a/account/appaccount/actsaccounttstest/Test.json b/account/appaccount/actsaccounttstest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..c264c134bdd33a66b58453487b9fa9b75aae83ce
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/Test.json
@@ -0,0 +1,26 @@
+{
+ "description": "Configuration for hjunit demo Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "180000",
+ "bundle-name": "com.example.accounttstest",
+ "module-name": "phone",
+ "shell-timeout": "180000",
+ "testcase-timeout": 70000
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsAccountTsTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ },
+ {
+ "type": "ShellKit",
+ "teardown-command":[
+ "bm uninstall -n com.example.accounttstest"
+ ]
+ }
+ ]
+}
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/Application/AbilityStage.ts b/account/appaccount/actsaccounttstest/entry/src/main/ets/Application/AbilityStage.ts
new file mode 100644
index 0000000000000000000000000000000000000000..32dfe93ccff0375201857794de902cec4d239442
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/Application/AbilityStage.ts
@@ -0,0 +1,7 @@
+import AbilityStage from "@ohos.application.AbilityStage"
+
+export default class MyAbilityStage extends AbilityStage {
+ onCreate() {
+ console.log("[Demo] MyAbilityStage onCreate")
+ }
+}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/MainAbility/MainAbility.ts b/account/appaccount/actsaccounttstest/entry/src/main/ets/MainAbility/MainAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cd47e022551551b3c393359b8cccafb7462c600a
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/MainAbility/MainAbility.ts
@@ -0,0 +1,61 @@
+/*
+ * 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'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from '@ohos/hypium'
+import testsuite from '../test/List.test'
+
+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;
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ }
+
+ 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 windowStage=" + windowStage)
+ //globalThis.windowStage = windowStage
+ //globalThis.abilityStorage = this.storage
+ 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
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/MainAbility/pages/index/index.ets b/account/appaccount/actsaccounttstest/entry/src/main/ets/MainAbility/pages/index/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..83a21e8ff3279e5e8588a6d30cab940c15968c2b
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/MainAbility/pages/index/index.ets
@@ -0,0 +1,37 @@
+/*
+ * 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 {
+ @State message: string = 'accessibilityEvent For Gesture';
+
+ aboutToAppear(){
+ console.info("start run testcase!!!!");
+ }
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/TestAbility/TestAbility.ts b/account/appaccount/actsaccounttstest/entry/src/main/ets/TestAbility/TestAbility.ts
new file mode 100644
index 0000000000000000000000000000000000000000..89a84730505783ba229175ab4b55d37f91a16266
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/TestAbility/TestAbility.ts
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import Ability from '@ohos.application.Ability'
+
+export default class TestAbility extends Ability {
+ onCreate(want, launchParam) {
+ console.log('TestAbility onCreate')
+ }
+
+ onDestroy() {
+ console.log('TestAbility onDestroy')
+ }
+
+ onWindowStageCreate(windowStage) {
+ console.log('TestAbility onWindowStageCreate')
+ windowStage.loadContent("TestAbility/pages/index", (err, data) => {
+ if (err.code) {
+ console.error('Failed to load the content. Cause:' + JSON.stringify(err));
+ return;
+ }
+ console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data))
+ });
+
+ globalThis.abilityContext = this.context;
+ }
+
+ onWindowStageDestroy() {
+ console.log('TestAbility onWindowStageDestroy')
+ }
+
+ onForeground() {
+ console.log('TestAbility onForeground')
+ }
+
+ onBackground() {
+ console.log('TestAbility onBackground')
+ }
+};
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/TestAbility/pages/index.ets b/account/appaccount/actsaccounttstest/entry/src/main/ets/TestAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b93567f962921124b282f78c8ef123965d1460c9
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/TestAbility/pages/index.ets
@@ -0,0 +1,48 @@
+/*
+ * 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
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/account/appaccount/actsaccounttstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9a67c520cc1abcae08847f4eb729f564fd34df03
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import TestRunner from '@ohos.application.testRunner'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+var abilityDelegator = undefined
+var abilityDelegatorArguments = undefined
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s it',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s dryRun'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ targetParams = `${targetParams} ${key} ${parameters[key]}`
+ }
+ }
+ return targetParams.trim()
+}
+
+async function onAbilityCreateCallback() {
+ console.log("onAbilityCreateCallback");
+}
+
+async function addAbilityMonitorCallback(err: any) {
+ console.info("addAbilityMonitorCallback : " + JSON.stringify(err))
+}
+
+export default class OpenHarmonyTestRunner implements TestRunner {
+ constructor() {
+ }
+
+ onPrepare() {
+ console.info("OpenHarmonyTestRunner OnPrepare ")
+ }
+
+ async onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility'
+ let lMonitor = {
+ abilityName: testAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a com.example.accounttstest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName
+ cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters)
+ var debug = abilityDelegatorArguments.parameters["-D"]
+ if (debug == 'true')
+ {
+ cmd += ' -D'
+ }
+ console.info('cmd : '+cmd)
+ abilityDelegator.executeShellCommand(cmd,
+ (err: any, d: any) => {
+ console.info('executeShellCommand : err : ' + JSON.stringify(err));
+ console.info('executeShellCommand : data : ' + d.stdResult);
+ console.info('executeShellCommand : data : ' + d.exitCode);
+ })
+ console.info('OpenHarmonyTestRunner onRun end')
+ }
+};
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/test/List.test.ets b/account/appaccount/actsaccounttstest/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..484485f4d827531fb876d0acecb48cc1808bb1d2
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,19 @@
+/*
+ * 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 oauthTokenInfoTest from './OAuthTokenInfoTest.test.ets'
+
+export default function testsuite() {
+ oauthTokenInfoTest()
+}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/ets/test/OAuthTokenInfoTest.test.ets b/account/appaccount/actsaccounttstest/entry/src/main/ets/test/OAuthTokenInfoTest.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6c778f6d83cc391ed34121fa62e8b6d05fd25261
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/ets/test/OAuthTokenInfoTest.test.ets
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
+import appAccount from "@ohos.account.appAccount"
+
+export default function oauthTokenInfoTest() {
+ describe('OAuthTokenInfoTest', function () {
+ beforeAll(async function (done) {
+ console.info('AccountTsTest: beforeAll');
+ done();
+ })
+
+ afterAll(async function (done) {
+ console.info('AccountTsTest: afterAll');
+ done();
+ })
+
+ beforeEach(async function (done) {
+ console.info('AccountTsTest: beforeEach');
+ done();
+ })
+
+ afterEach(async function (done) {
+ console.info('AccountTsTest: afterEach');
+ done();
+ })
+
+ /*
+ * @tc.number OAuthTokenInfoTest_0100
+ * @tc.name OAuthTokenInfoTest_0100
+ * @tc.desc OAuthTokenInfo without account.
+ * @tc.size SmallTest
+ * @tc.type User
+ */
+ it('OAuthTokenInfoTest_0100', 0, async function (done) {
+ let info : appAccount.OAuthTokenInfo = {
+ authType: "getSocialData",
+ token: "xxxxx"
+ }
+ console.log("OAuthTokenInfoTest_0100 info: " + JSON.stringify(info));
+ expect(info.hasOwnProperty("accounts")).assertEqual(false)
+ expect(info.hasOwnProperty("account")).assertEqual(false)
+ done()
+ })
+
+ /*
+ * @tc.number OAuthTokenInfoTest_0200
+ * @tc.name OAuthTokenInfoTest_0200
+ * @tc.desc OAuthTokenInfo with account.
+ * @tc.size SmallTest
+ * @tc.type User
+ */
+ it('OAuthTokenInfoTest_0200', 0, async function (done) {
+ let info : appAccount.OAuthTokenInfo = {
+ authType: "getSocialData",
+ token: "xxxxx",
+ account: {
+ name: "zhangsan",
+ owner: "com.ohos.testapp"
+ }
+ }
+ console.log("OAuthTokenInfoTest_0200 info: " + JSON.stringify(info))
+ expect(info.hasOwnProperty("accounts")).assertEqual(false)
+ expect(info.hasOwnProperty("account")).assertEqual(true)
+ expect(info.account.owner).assertEqual("com.ohos.testapp")
+ done();
+ })
+ })
+}
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/module.json b/account/appaccount/actsaccounttstest/entry/src/main/module.json
new file mode 100644
index 0000000000000000000000000000000000000000..b21a851e79f97f1a6120f5d741ab056e837cf798
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/module.json
@@ -0,0 +1,34 @@
+{
+ "module": {
+ "name": "phone",
+ "type": "entry",
+ "srcEntrance": "./ets/Application/AbilityStage.ts",
+ "description": "$string:phone_entry_dsc",
+ "mainElement": "MainAbility",
+ "deviceTypes": [
+ "default",
+ "phone"
+ ],
+ "deliveryWithInstall": true,
+ "installationFree": false,
+ "uiSyntax": "ets",
+ "pages": "$profile:main_pages",
+ "abilities": [{
+ "name": "com.example.accounttstest.MainAbility",
+ "srcEntrance": "./ets/MainAbility/MainAbility.ts",
+ "description": "$string:phone_entry_main",
+ "icon": "$media:icon",
+ "label": "$string:entry_label",
+ "visible": true,
+ "orientation": "portrait",
+ "skills": [{
+ "actions": [
+ "action.system.home"
+ ],
+ "entities": [
+ "entity.system.home"
+ ]
+ }]
+ }]
+ }
+}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/resources/base/element/string.json b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..0f52cffe3fbc6dc1639e0f6348c3027884d08d7a
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,40 @@
+{
+ "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": "AccountTsTest"
+ },
+ {
+ "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": "AccountTsTest_desc",
+ "value": "AccountTsTest_description"
+ },
+ {
+ "name": "AccountTsTest_label",
+ "value": "AccountTsTest"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/resources/base/media/icon.png b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023
Binary files /dev/null and b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/media/icon.png differ
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/resources/base/profile/accessibility_config.json b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/profile/accessibility_config.json
new file mode 100644
index 0000000000000000000000000000000000000000..c3562ab303d502e6d285bf9daae51fad0f07367a
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/profile/accessibility_config.json
@@ -0,0 +1,9 @@
+{
+ "accessibilityCapabilities": [
+ "retrieve",
+ "touchGuide",
+ "gesture"
+ ],
+ "accessibilityCapabilityRationale": "a11y_rationale",
+ "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting"
+}
\ No newline at end of file
diff --git a/account/appaccount/actsaccounttstest/entry/src/main/resources/base/profile/main_pages.json b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/profile/main_pages.json
new file mode 100644
index 0000000000000000000000000000000000000000..a99e380b1101058975a15da3ddab9efc0f72972a
--- /dev/null
+++ b/account/appaccount/actsaccounttstest/entry/src/main/resources/base/profile/main_pages.json
@@ -0,0 +1,5 @@
+{
+ "src": [
+ "MainAbility/pages/index/index"
+ ]
+}
diff --git a/account/appaccount/actsaccounttstest/signature/openharmony_sx.p7b b/account/appaccount/actsaccounttstest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..7ffcdc78527c5c1aa24520ab7e913c5f47c703f0
Binary files /dev/null and b/account/appaccount/actsaccounttstest/signature/openharmony_sx.p7b differ
diff --git a/account/appaccount/actsgetallaccounts/src/main/config.json b/account/appaccount/actsgetallaccounts/src/main/config.json
index 96bc2a2bb660c048e17515080ba1c2cb6fc372c5..0e0a22a317aa16eaa530d48032a053279a7cb43a 100644
--- a/account/appaccount/actsgetallaccounts/src/main/config.json
+++ b/account/appaccount/actsgetallaccounts/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js b/account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js
index 34ad23ba284f04bdd6b6e70aa6b1d0d29700d440..dace9ca6566eb97e56234f66ee0d055877d46259 100755
--- a/account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js
+++ b/account/appaccount/actsgetallaccounts/src/main/js/test/Getallaccounts.test.js
@@ -459,6 +459,8 @@ export default function ActsGetAllAccounts() {
var nonexistentBundle = "com.example.actsgetallaccountsnonexistent";
try{
var data = await appAccountManager.getAllAccounts(nonexistentBundle);
+ expect().assertFail();
+ done();
}
catch(err){
console.debug("====>getAllAccounts 1400 err:" + JSON.stringify(err));
diff --git a/account/appaccount/actssetchecksyncenable/src/main/config.json b/account/appaccount/actssetchecksyncenable/src/main/config.json
index b0165606aae85d240e2eafa83def35d3283edd77..2a8a8e31b1f04e5dcf049ec2ed522aab3fe783f5 100644
--- a/account/appaccount/actssetchecksyncenable/src/main/config.json
+++ b/account/appaccount/actssetchecksyncenable/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/src/main/config.json b/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/src/main/config.json
index ab9f8fb4255b8f2077c367f9c199b9dff3e07e7a..4e1fb96ac5ed6626f8d2db079a234de1d8b52253 100644
--- a/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/src/main/config.json
+++ b/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/src/main/config.json b/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/src/main/config.json
index ae92671ab59bf880e98bde100618bfac61ba5ec0..bc0e5918556d7fb87261b73c7926df60467fcf14 100644
--- a/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/src/main/config.json
+++ b/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/config.json b/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/config.json
index c5f83a58a6558d522aacf6910d5cacdf72755b7f..76f00100dda7bf00bbf12a92ea147b532e083019 100755
--- a/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsaccountaccessiblefirst",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsaccountaccessibleSecond/entry/src/main/config.json b/account/appaccount/sceneProject/actsaccountaccessibleSecond/entry/src/main/config.json
index 3b381d659f71c7893bb9a3c7250db5369480c7ed..17605cbf06fb531dee3e484224f9011f951a593c 100755
--- a/account/appaccount/sceneProject/actsaccountaccessibleSecond/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsaccountaccessibleSecond/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsaccountaccessiblesecond",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/config.json b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/config.json
index dd3a529063f3022a8dff5982d44d325e1970ed2f..522ea39becee3f1dee844936da2e5bbbe40973d3 100644
--- a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/config.json
@@ -15,6 +15,7 @@
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
+ "default",
"default",
"tablet"
],
@@ -33,7 +34,7 @@
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
- "name": ".MainAbility",
+ "name": "com.example.accountauthenticator.MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
diff --git a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js
index dfb69f41b7cacdad4716664c5796c47096b6d287..7fb28fa798f5d0189e8358d3e0d703f07dc54b1c 100644
--- a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js
+++ b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js
@@ -12,6 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+import account_appAccount from '@ohos.account.appAccount';
+import featureAbility from '@ohos.ability.featureAbility'
export default {
data: {
@@ -20,4 +22,29 @@ export default {
onInit() {
this.title = this.$t('strings.world');
},
-}
+ onShow() {
+ console.info('ServiceAbility onStart');
+ var accountMgr = account_appAccount.createAppAccountManager();
+ console.info('ServiceAbility lcc addAccount 01 onStart');
+ accountMgr.addAccount("zhangsan", "",(data)=>{
+ console.info('ServiceAbility lcc enableAppAccess 01 onStart');
+ accountMgr.enableAppAccess("zhangsan", "com.example.actsaccounttest");
+ console.info('ServiceAbility lcc addAccount 02 onStart');
+ accountMgr.addAccount("lisi", "",(err)=>{
+ console.info('ServiceAbility lcc enableAppAccess 02 onStart');
+ accountMgr.enableAppAccess("lisi", "com.example.actsaccounttest");
+ console.info('ServiceAbility lcc addAccount 03 onStart');
+ accountMgr.addAccount("wangwu", "",(err)=>{
+ console.info('ServiceAbility lcc enableAppAccess 03 onStart');
+ accountMgr.enableAppAccess("wangwu", "com.example.actsaccounttest",(err)=>{
+ featureAbility.terminateSelf();
+ console.info('ServiceAbility add end');
+ });
+ });
+ });
+ });
+ console.info('ServiceAbility onStart end');
+ },
+ onReady() {
+ },
+}
\ No newline at end of file
diff --git a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/ServiceAbility/service.js b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/ServiceAbility/service.js
index 2f531f3bbc0c731c45f8fcc156f89dcb1c1e2060..4eb1de03bc83a5fd5d1ca225ba2ba4172023f269 100644
--- a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/ServiceAbility/service.js
+++ b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/ServiceAbility/service.js
@@ -13,25 +13,14 @@
* limitations under the License.
*/
import account_appAccount from '@ohos.account.appAccount';
+import featureAbility from '@ohos.ability.featureAbility'
import {MyAuthenticator} from '../Common/utils'
var TAG = "[AccountTest]"
var authenticator = null
export default {
- async onStart(want) {
+ onStart(want) {
console.info('ServiceAbility onStart');
- var accountMgr = account_appAccount.createAppAccountManager();
- try {
- await accountMgr.addAccount("zhangsan", "");
- await accountMgr.enableAppAccess("zhangsan", "com.example.actsaccounttest");
- await accountMgr.addAccount("lisi", "");
- await accountMgr.enableAppAccess("lisi", "com.example.actsaccounttest");
- await accountMgr.addAccount("wangwu", "");
- await accountMgr.enableAppAccess("wangwu", "com.example.actsaccounttest");
- } catch(err) {
- console.error(TAG + "addAccount or enableAppAccess failed, error: " + JSON.stringify(err))
- }
- console.info('ServiceAbility onStart end');
},
async onStop() {
console.info('ServiceAbility onStop');
diff --git a/account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/config.json b/account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/config.json
index d1aa1804079485ff6ba21e6d05711f35e54dd647..ad8171ba799f944c2d9f02d652c95498c502fe8f 100644
--- a/account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsaccountOauthtoken",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsaccountsceneaccessible/entry/src/main/config.json b/account/appaccount/sceneProject/actsaccountsceneaccessible/entry/src/main/config.json
index 65b0eb38c5358a4bf5625e30efa35f7988f3c8b4..83c6627e58f2f1262b18f5c155b948ba9b8624e8 100755
--- a/account/appaccount/sceneProject/actsaccountsceneaccessible/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsaccountsceneaccessible/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsaccountsceneaccessible",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsaccountsceneappaccess/entry/src/main/config.json b/account/appaccount/sceneProject/actsaccountsceneappaccess/entry/src/main/config.json
index f0465cae8823a8cdd54b493e92ba4548c45d9b80..4b8cfeaf9297fa1a6e3ee2a2b0e325e63e9c1ee0 100755
--- a/account/appaccount/sceneProject/actsaccountsceneappaccess/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsaccountsceneappaccess/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsaccountsceneappaccess",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/config.json b/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/config.json
index afe851d9e2dbae23256e3382566e6035bb136dc5..c75955f35fd29408b7ef9b04d8368860a4c0ad00 100755
--- a/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsaccountsceneonoff",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js b/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js
index 2a4d51d25c03f6a122eeb69bebeb447e563bb658..769e6af03e548a0331c45a68555e52220fdc23a9 100755
--- a/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js
+++ b/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js
@@ -14,6 +14,7 @@
*/
import account from '@ohos.account.appAccount'
import commonevent from '@ohos.commonEvent'
+import featureAbility from '@ohos.ability.featureAbility'
const ACCOUNT_TEST_ONOFF_EXTRA = 1
const ACCOUNT_TEST_ONOFF_ASSOCIATEDDATA = 2
@@ -46,6 +47,7 @@ export default {
appAccountManager.off('change', function (){
console.debug("====>scene off finish====");
});
+ featureAbility.terminateSelf()
}
// Subscribe to the callback of account information changes, verify the received account information, and send
@@ -247,7 +249,7 @@ export default {
default:
console.debug("====>receive event enter default====");
break;
- }
+ }
}
var subscriber
commonevent.createSubscriber(commonEventSubscribeInfo).then(function (data){
diff --git a/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/config.json b/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/config.json
index 96089241228b621b8aa29ebe88db2891a7b296f4..ed3690be367ec99432658c4ae34b0ff51ba53b93 100755
--- a/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/config.json
+++ b/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/config.json
@@ -17,6 +17,7 @@
"package": "com.example.actsscenegetallaccounts",
"name": ".MyApplication",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/js/default/pages/index/index.js b/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/js/default/pages/index/index.js
index 080d2bb3a37e3ec7fa3d30b373404c94887f5dd4..172e91fc0d5b23990a6cc0340b722b9373f3d719 100755
--- a/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/js/default/pages/index/index.js
+++ b/account/appaccount/sceneProject/actsscenegetallaccounts/entry/src/main/js/default/pages/index/index.js
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import account from '@ohos.account.appAccount'
+import featureAbility from '@ohos.ability.featureAbility'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
@@ -33,6 +34,7 @@ export default {
console.debug("====>add account scene err:" + JSON.stringify(err));
appAccountManager.enableAppAccess("account_name_scene_single", enableBundle, (err)=>{
console.debug("====>enableAppAccess scene err:" + JSON.stringify(err));
+ featureAbility.terminateSelf()
});
});
},
diff --git a/account/osaccount/actsosaccountthirdpartytest/src/main/config.json b/account/osaccount/actsosaccountthirdpartytest/src/main/config.json
index 5a0e9c58625b0ffd5f5b9f2978d6ac152807e29e..a4bab43b508003a8f9c61091ff8f2a8165797ff0 100755
--- a/account/osaccount/actsosaccountthirdpartytest/src/main/config.json
+++ b/account/osaccount/actsosaccountthirdpartytest/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath":"",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js b/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
old mode 100755
new mode 100644
index d14f497fd9b6cc1bb08386b9019e2e0e3cc73617..dd89d0c57749377fc175bffdcfd69e9e45bfca65
--- a/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
+++ b/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountGet.test.js
@@ -235,7 +235,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>get AccountManager finish====");
- osAccountManager.getSerialNumberByOsAccountLocalId(100, (err, serialNumber)=>{
+ osAccountManager.getSerialNumberByOsAccountLocalId(testLocalId, (err, serialNumber)=>{
console.debug("====>ger serialNumber err:" + JSON.stringify(err));
console.debug("====>get serialNumber:" + serialNumber + " by localId: 100" );
expect(err).assertEqual(null);
@@ -349,6 +349,12 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
expect(data.isVerified).assertEqual(false);
expect(data.distributedInfo.name != null).assertEqual(true);
expect(data.domainInfo.domain == "").assertEqual(true);
+ expect(data.photo == "").assertEqual(true);
+ expect(data.createTime != "").assertEqual(true);
+ expect(data.lastLoginTime>=0).assertEqual(true);
+ expect(data.serialNumber.toString().length == 16).assertEqual(true);
+ expect(data.isActived).assertEqual(false);
+ expect(data.isCreateCompleted).assertEqual(true)
localId = data.localId;
osAccountManager.getSerialNumberByOsAccountLocalId(localId, (err, serialNumber)=>{
console.debug("====>queryOsAccountById err:" + JSON.stringify(err));
@@ -487,5 +493,192 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
console.debug("====>ActsOsAccountGetCount_0200 end====");
done();
})
+
+ /*
+ * @tc.number : ActsOsAccountQueryActivedOsAccountIds_0100
+ * @tc.name : queryActivatedOsAccountIds callback
+ * @tc.desc : query activated osAccount Ids
+ */
+ it('ActsOsAccountQueryActivedOsAccountIds_0100', 0, async function (done) {
+ console.debug("====>ActsOsAccountQueryActivedOsAccountIds_0100 start====");
+ var osAccountManager = osaccount.getAccountManager();
+ osAccountManager.queryActivatedOsAccountIds((err,dataArray)=>{
+ console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 err :" + JSON.stringify(err));
+ expect(err).assertEqual(null)
+ console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray" + dataArray.length);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : ActsOsAccountQueryActivedOsAccountIds_0200
+ * @tc.name : queryActivatedOsAccountIds promise
+ * @tc.desc : query activated osAccount Ids
+ */
+ it('ActsOsAccountQueryActivedOsAccountIds_0200', 0, async function (done) {
+ console.debug("====>ActsOsAccountQueryActivedOsAccountIds_0200 start====");
+ var osAccountManager = osaccount.getAccountManager();
+ osAccountManager.queryActivatedOsAccountIds().then((data)=>{
+ console.debug("====>ActsOsAccountQueryActivedOsAccountIds_0200 data" + JSON.stringify(data))
+ done();
+ }).catch((err)=>{
+ console.info("====>ActsOsAccountQueryActivedOsAccountIds_0200 err " + JSON.stringify(err));
+ expect(err).assertEqual(null)
+ done();
+ });
+ })
+
+
+ /*
+ * @tc.number : ActsOsAccountConstraints_0300
+ * @tc.name : Constraints callback
+ * @tc.desc : get 0 local user all constraints
+ */
+ it('ActsOsAccountConstraints_3100', 0, async function(done){
+ console.debug("====>ActsOsAccountConstraints_3100 start====");
+ var AccountManager = osaccount.getAccountManager();
+ console.debug("====>get AccountManager finish====");
+ AccountManager.getOsAccountAllConstraints(0, (err, constraints)=>{
+ console.debug("====>getOsAccountAllConstraints err:" + JSON.stringify(err));
+ console.debug("====>getOsAccountAllConstraints:" + JSON.stringify(constraints));
+ expect(err).assertEqual(null);
+ expect(constraints.length).assertEqual(0);
+ console.debug("====>ActsOsAccountConstraints_3100 end====");
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : ActsOsAccountConstraints_0400
+ * @tc.name : Constraints promise
+ * @tc.desc : get 0 local user all constraints
+ */
+ it('ActsOsAccountConstraints_3200', 0, async function(done){
+ console.debug("====>ActsOsAccountConstraints_3200 start====");
+ var AccountManager = osaccount.getAccountManager();
+ console.debug("get AccountManager finish====");
+ AccountManager.getOsAccountAllConstraints(0).then((data)=>{
+ console.debug("====>ActsOsAccountConstraints_3200 getOsAccountAllConstraints data:" + data);
+ done();
+ }).catch((err)=>{
+ console.debug("====>ActsOsAccountConstraints_3200 getOsAccountAllConstraints err:" + JSON.stringify(err));
+ expect().assertFalse()
+ done();
+ })
+ })
+
+ /**
+ * @tc.number ActsAccountDomainTest_0300
+ * @tc.name Test createOsAccountForDomain getOsAccountLocalIdFromDomain callback
+ * @tc.desc Test createOsAccountForDomain getOsAccountLocalIdFromDomain API functionality
+ */
+ it('ActsOsAccountDomainTest_0300', 0, async function (done) {
+ console.debug("====>ActsOsAccountDomainTest_0100 start====");
+ var osAccountManager = osaccount.getAccountManager();
+ osAccountManager.getOsAccountLocalIdFromDomain({domain: "", accountName: ""}, (err)=>{
+ console.debug("====>ActsOsAccountDomainTest_0300 err:" + JSON.stringify(err));
+ expect(err.code != 0).assertEqual(true)
+ console.debug("====>ActsOsAccountDomainTest_0300 end====");
+ done();
+ })
+ });
+
+ /**
+ * @tc.number ActsAccountDomainTest_0400
+ * @tc.name Test createOsAccountForDomain getOsAccountLocalIdFromDomain pormise
+ * @tc.desc Test createOsAccountForDomain getOsAccountLocalIdFromDomain API functionality
+ */
+ it('ActsOsAccountDomainTest_0400', 0, async function (done) {
+ console.debug("====>ActsOsAccountDomainTest_0400 start====");
+ var osAccountManager = osaccount.getAccountManager();
+ osAccountManager.getOsAccountLocalIdFromDomain({domain: "", accountName: ""}).then((accountID)=>{
+ console.debug("ActsOsAccountDomainTest_0400 accountID:" + JSON.stringify(accountID))
+ done();
+ }).catch((err)=>{
+ console.debug("ActsOsAccountDomainTest_0400 err:" + JSON.stringify(err))
+ expect(err.code != 0).assertEqual(true)
+ done();
+ })
+ });
+
+ /*
+ * @tc.number : ActsOsAccountQuery_1700
+ * @tc.name : queryCurrentOsAccount callback
+ * @tc.desc : Get the os account information to which the application belongs
+ */
+ it('ActsOsAccountQuery_2100', 0, async function(done){
+ console.debug("====>ActsOsAccountQuery_2100 start====");
+ var AccountManager = osaccount.getAccountManager();
+ console.debug("====>get os AccountManager finish====");
+ AccountManager.queryCurrentOsAccount((err, data)=>{
+ console.debug("====>queryCurrentOsAccount err:" + JSON.stringify(err));
+ console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data));
+ expect(err).assertEqual(null);
+ console.debug("====>ActsOsAccountQuery_2100 end====");
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : ActsOsAccountQuery_1800
+ * @tc.name : queryCurrentOsAccount promise
+ * @tc.desc : Get the os account information to which the application belongs
+ */
+ it('ActsOsAccountQuery_2200', 0, async function(done){
+ console.debug("====>ActsOsAccountQuery_2200 start====");
+ var AccountManager = osaccount.getAccountManager();
+ console.debug("====>get os AccountManager finish====");
+ var data = await AccountManager.queryCurrentOsAccount();
+ console.debug("====>queryCurrentOsAccount data:" + JSON.stringify(data));
+ expect(data.localId).assertEqual(100);
+ expect(data.type.ADMIN).assertEqual(0);
+ var serialNumberStr = data.serialNumber.toString();
+ var serialIntercept = serialNumberStr.substring(8);
+ console.debug("====>truncate the last eight characters: " + serialIntercept);
+ expect(serialIntercept).assertEqual("00000001");
+ expect(data.isCreateCompleted).assertTrue();
+ console.debug("====>ActsOsAccountQuery_2200 end====");
+ done();
+ })
+
+
+ /*
+ * @tc.number : ActsOsAccountPermission_3300
+ * @tc.name : isOsAccountConstraintEnable callback
+ * @tc.desc : the application call interface does not meet the permissions
+ */
+ it('ActsOsAccountConstraints_3300', 0, async function(done){
+ console.debug("====>ActsOsAccountConstraints_3300 start====");
+ var AccountManager = osaccount.getAccountManager();
+ console.debug("====>get os AccountManager finish====");
+ AccountManager.isOsAccountConstraintEnable(100, "constraint.bluetooth", (err, result)=>{
+ console.debug("====>isOsAccountConstraintEnable err:" + JSON.stringify(err));
+ expect(err).assertEqual(null);
+ expect(result).assertTrue();
+ console.debug("====>ActsOsAccountConstraints_3300 end====");
+ done();
+ })
+ })
+
+ /*
+ * @tc.number : ActsOsAccountPermission_3400
+ * @tc.name : isOsAccountConstraintEnable promise
+ * @tc.desc : the application call interface does not meet the permissions
+ */
+ it('ActsOsAccountConstraints_3400', 0, async function(done){
+ console.debug("====>ActsOsAccountConstraints_3400 start====");
+ var AccountManager = osaccount.getAccountManager();
+ console.debug("====>get os AccountManager finish====");
+ try{
+ await AccountManager.isOsAccountConstraintEnable(100, "constraint.bluetooth");
+ done();
+ }
+ catch(err){
+ console.debug("====>isOsAccountConstraintEnable err:" + JSON.stringify(err));
+ expect(err).assertEqual(null);
+ console.debug("====>ActsOsAccountConstraints_3400 end====");
+ done();
+ }
+ })
})
}
\ No newline at end of file
diff --git a/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js b/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
index b2f55d16a6bd94c3477339c0e724513664513671..1cebbcce23078fcd682492d0c4dab2f433075873 100755
--- a/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
+++ b/account/osaccount/actsosaccountthirdpartytest/src/main/js/test/OsAccountIs.test.js
@@ -499,5 +499,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console.debug("====>ActsOsAccountIsTest_0200 end====");
done();
})
+
+
})
}
\ No newline at end of file
diff --git a/ai_lite/ai_engine_posix/base/BUILD.gn b/ai_lite/ai_engine_posix/base/BUILD.gn
index be3e0c8c6e780be0fc0853e1d03aa15e418025d8..648eec53f5fc383acaa7899c0a5159c521fb5869 100644
--- a/ai_lite/ai_engine_posix/base/BUILD.gn
+++ b/ai_lite/ai_engine_posix/base/BUILD.gn
@@ -44,7 +44,7 @@ hcpptest_suite("ActsAiEngineTest") {
"//foundation/ai/engine/services/algorithmsdk",
"//foundation/ai/engine/services/server/plugin",
"//third_party/bounds_checking_function/include",
- "//utils/native/lite/include",
+ "//commonlibrary/utils_lite/include",
"//kernel/liteos-a/kernel/include",
"//kernel/liteos-a/kernel/common",
"//foundation/systemabilitymgr/samgr_lite/interfaces/innerkits/registry",
diff --git a/appexecfwk_lite/appexecfwk_hal/src/bundle_mgr_test.c b/appexecfwk_lite/appexecfwk_hal/src/bundle_mgr_test.c
index ae9256903db003be8fedbfd3ae9480feb6d6e736..dff1b21e013beb44127432cd3b9330e932986e80 100755
--- a/appexecfwk_lite/appexecfwk_hal/src/bundle_mgr_test.c
+++ b/appexecfwk_lite/appexecfwk_hal/src/bundle_mgr_test.c
@@ -53,8 +53,13 @@ LITE_TEST_CASE(BundleMgrTestSuite, testClearAbilityInfoLegal, Function | MediumT
AbilityInfo abilityInfo;
int result = memset_s(&abilityInfo, sizeof(abilityInfo), 0, sizeof(abilityInfo));
TEST_ASSERT_TRUE(result == 0);
- abilityInfo.bundleName = "com.openharmony.testjsdemo";
- TEST_ASSERT_EQUAL_STRING(abilityInfo.bundleName, "com.openharmony.testjsdemo");
+ char *name = "com.openharmony.testjsdemo";
+ size_t len = strlen(name);
+ abilityInfo.bundleName = (char *)malloc(len + 1);
+ TEST_ASSERT_NOT_NULL(abilityInfo.bundleName);
+ errno_t err = strncpy_s(abilityInfo.bundleName, len + 1, name, len);
+ TEST_ASSERT_EQUAL(err, EOK);
+ TEST_ASSERT_EQUAL_STRING(abilityInfo.bundleName, name);
ClearAbilityInfo(&abilityInfo);
TEST_ASSERT_EQUAL_STRING(abilityInfo.bundleName, NULL);
printf("------end testClearAbilityInfo------\n");
@@ -71,9 +76,14 @@ LITE_TEST_CASE(BundleMgrTestSuite, testClearAbilityInfoIllegal, Function | Mediu
AbilityInfo abilityInfo = { 0 };
int result = memset_s(&abilityInfo, sizeof(abilityInfo), 0, sizeof(abilityInfo));
TEST_ASSERT_TRUE(result == 0);
- abilityInfo.bundleName = "com.openharmony.testjsdemo";
+ char *name = "com.openharmony.testjsdemo";
+ size_t len = strlen(name);
+ abilityInfo.bundleName = (char *)malloc(len + 1);
+ TEST_ASSERT_NOT_NULL(abilityInfo.bundleName);
+ errno_t err = strncpy_s(abilityInfo.bundleName, len + 1, name, len);
+ TEST_ASSERT_EQUAL(err, EOK);
ClearAbilityInfo(NULL);
- TEST_ASSERT_EQUAL_STRING(abilityInfo.bundleName, "com.openharmony.testjsdemo");
+ TEST_ASSERT_EQUAL_STRING(abilityInfo.bundleName, name);
printf("------end testClearAbilityInfoIllegal------\n");
}
@@ -88,8 +98,13 @@ LITE_TEST_CASE(BundleMgrTestSuite, testClearBundleInfoLegal, Function | MediumTe
BundleInfo bundleInfo = { 0 };
int result = memset_s(&bundleInfo, sizeof(bundleInfo), 0, sizeof(bundleInfo));
TEST_ASSERT_TRUE(result == 0);
- bundleInfo.bundleName = "com.openharmony.testjsdemo";
- TEST_ASSERT_EQUAL_STRING(bundleInfo.bundleName, "com.openharmony.testjsdemo");
+ char *name = "com.openharmony.testjsdemo";
+ size_t len = strlen(name);
+ bundleInfo.bundleName = (char *)malloc(len + 1);
+ TEST_ASSERT_NOT_NULL(bundleInfo.bundleName);
+ errno_t err = strncpy_s(bundleInfo.bundleName, len + 1, name, len);
+ TEST_ASSERT_EQUAL(err, EOK);
+ TEST_ASSERT_EQUAL_STRING(bundleInfo.bundleName, name);
ClearBundleInfo(&bundleInfo);
TEST_ASSERT_EQUAL_STRING(bundleInfo.bundleName, NULL);
printf("------end testClearBundleInfo------\n");
@@ -106,9 +121,14 @@ LITE_TEST_CASE(BundleMgrTestSuite, testClearBundleInfoIllegal, Function | Medium
BundleInfo bundleInfo;
int result = memset_s(&bundleInfo, sizeof(bundleInfo), 0, sizeof(bundleInfo));
TEST_ASSERT_TRUE(result == 0);
- bundleInfo.bundleName = "com.openharmony.testjsdemo";
+ char *name = "com.openharmony.testjsdemo";
+ size_t len = strlen(name);
+ bundleInfo.bundleName = (char *)malloc(len + 1);
+ TEST_ASSERT_NOT_NULL(bundleInfo.bundleName);
+ errno_t err = strncpy_s(bundleInfo.bundleName, len + 1, name, len);
+ TEST_ASSERT_EQUAL(err, EOK);
ClearBundleInfo(NULL);
- TEST_ASSERT_EQUAL_STRING(bundleInfo.bundleName, "com.openharmony.testjsdemo");
+ TEST_ASSERT_EQUAL_STRING(bundleInfo.bundleName, name);
printf("------end testClearBundleInfoIllegal------\n");
}
@@ -123,8 +143,13 @@ LITE_TEST_CASE(BundleMgrTestSuite, testClearModuleInfoLegal, Function | MediumTe
ModuleInfo moduleInfo = { 0 };
int result = memset_s(&moduleInfo, sizeof(moduleInfo), 0, sizeof(moduleInfo));
TEST_ASSERT_TRUE(result == 0);
- moduleInfo.moduleName = "test";
- TEST_ASSERT_EQUAL_STRING(moduleInfo.moduleName, "test");
+ char *name = "test";
+ size_t len = strlen(name);
+ moduleInfo.moduleName = (char *)malloc(len + 1);
+ TEST_ASSERT_NOT_NULL(moduleInfo.moduleName);
+ errno_t err = strncpy_s(moduleInfo.moduleName, len + 1, name, len);
+ TEST_ASSERT_EQUAL(err, EOK);
+ TEST_ASSERT_EQUAL_STRING(moduleInfo.moduleName, name);
ClearModuleInfo(&moduleInfo);
TEST_ASSERT_EQUAL_STRING(moduleInfo.moduleName, NULL);
printf("------end testClearModuleInfo------\n");
@@ -141,9 +166,14 @@ LITE_TEST_CASE(BundleMgrTestSuite, testClearModuleInfoIllegal, Function | Medium
ModuleInfo moduleInfo = { 0 };
int result = memset_s(&moduleInfo, sizeof(moduleInfo), 0, sizeof(moduleInfo));
TEST_ASSERT_TRUE(result == 0);
- moduleInfo.moduleName = "test";
+ char *name = "test";
+ size_t len = strlen(name);
+ moduleInfo.moduleName = (char *)malloc(len + 1);
+ TEST_ASSERT_NOT_NULL(moduleInfo.moduleName);
+ errno_t err = strncpy_s(moduleInfo.moduleName, len + 1, name, len);
+ TEST_ASSERT_EQUAL(err, EOK);
ClearModuleInfo(NULL);
- TEST_ASSERT_EQUAL_STRING(moduleInfo.moduleName, "test");
+ TEST_ASSERT_EQUAL_STRING(moduleInfo.moduleName, name);
printf("------end testClearModuleInfoIllegal------\n");
}
diff --git a/appexecfwk_lite/appexecfwk_posix/BUILD.gn b/appexecfwk_lite/appexecfwk_posix/BUILD.gn
index dc03af3c07a4d3c2d5cf7c57de20fd187db028d9..a83149246bbf6da6145254c5d919131e49e4aad9 100755
--- a/appexecfwk_lite/appexecfwk_posix/BUILD.gn
+++ b/appexecfwk_lite/appexecfwk_posix/BUILD.gn
@@ -29,7 +29,7 @@ hcpptest_suite("ActsBundleMgrTest") {
"//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
"//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry",
"//third_party/googletest/googletest/include",
- "//utils/native/lite/include",
+ "//commonlibrary/utils_lite/include",
"${aafwk_lite_path}/interfaces/innerkits/intent_lite",
"//third_party/cJSON",
]
diff --git a/applications/BUILD.gn b/applications/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..c11d1209e10c48b5e9af49f49abf844158b6865a
--- /dev/null
+++ b/applications/BUILD.gn
@@ -0,0 +1,17 @@
+# 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.
+
+group("applications") {
+ testonly = true
+ deps = [ "settingsdata:settingsdata" ]
+}
diff --git a/applications/kitframework/BUILD.gn b/applications/kitframework/BUILD.gn
index 482ad489f11c33896e93ddd926d6b5b8cac13fab..1c98b65b95b3b46c224aa7e1c39bc82441a4bc91 100644
--- a/applications/kitframework/BUILD.gn
+++ b/applications/kitframework/BUILD.gn
@@ -21,7 +21,7 @@ hctest_suite("ActsKitFwkApiTest") {
include_dirs = [
"//test/xts/tools/lite/hctest/include",
"//third_party/unity/src",
- "//utils/native/lite/include",
+ "//commonlibrary/utils_lite/include",
"//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
"//third_party/bounds_checking_function/include/",
"//third_party/mbedtls/include/",
diff --git a/applications/settingsdata/BUILD.gn b/applications/settingsdata/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..dd277e22ba19016fa144657b6d83270cd6165690
--- /dev/null
+++ b/applications/settingsdata/BUILD.gn
@@ -0,0 +1,17 @@
+# 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.
+
+group("settingsdata") {
+ testonly = true
+ deps = [ "settings_ets:SettingsEtsTest" ]
+}
diff --git a/applications/settingsdata/settings_ets/BUILD.gn b/applications/settingsdata/settings_ets/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..7a002f2bc1df61adf8b0e14856126642b7b4d659
--- /dev/null
+++ b/applications/settingsdata/settings_ets/BUILD.gn
@@ -0,0 +1,36 @@
+# 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("SettingsEtsTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":settings_ets_assets",
+ ":settings_ets_resources",
+ ":settings_ets_test_assets",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsSettingsEtsTest"
+}
+ohos_js_assets("settings_ets_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_js_assets("settings_ets_test_assets") {
+ source_dir = "./entry/src/main/ets/TestAbility"
+}
+ohos_resources("settings_ets_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/applications/settingsdata/settings_ets/Test.json b/applications/settingsdata/settings_ets/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..648902a808fa7fad7758022a3c136c511b5d4a34
--- /dev/null
+++ b/applications/settingsdata/settings_ets/Test.json
@@ -0,0 +1,19 @@
+{
+ "description": "Configuration for settings Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.open.harmony.settings",
+ "package-name": "com.open.harmony.settings",
+ "shell-timeout": "600000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsSettingsEtsTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/applications/settingsdata/settings_ets/entry/src/main/config.json b/applications/settingsdata/settings_ets/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..59bda1d473c84dc8eb71384020045e6f8f6516fb
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/config.json
@@ -0,0 +1,106 @@
+{
+ "app": {
+ "bundleName": "com.open.harmony.settings",
+ "vendor": "open",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 7,
+ "releaseType": "Release",
+ "target": 7
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.open.harmony.settings",
+ "name": ".MyApplication",
+ "mainAbility": "com.open.harmony.settings.MainAbility",
+ "srcPath": "",
+ "deviceType": [
+ "default",
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry",
+ "installationFree": false
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:description_mainability",
+ "formsEnabled": false,
+ "label": "$string:entry_MainAbility",
+ "type": "page",
+ "launchType": "standard"
+ },
+ {
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "TestAbility",
+ "name": ".TestAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:TestAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:TestAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "reqPermissions": [
+ {
+ "name":"ohos.permission.MANAGE_SECURE_SETTINGS",
+ "reason":"need use ohos.permission.,MANAGE_SECURE_SETTINGS"
+ }
+ ],
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ },
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".TestAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fc86a0485f5fa3d43dc0d7a7d858e3f41ed87304
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,22 @@
+/**
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..5e23de1ad4a2900759944907b90d5324c7054dcb
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,37 @@
+// @ts-nocheck
+/**
+ * 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.
+ */
+
+@Entry
+@Component
+struct MyComponent {
+ aboutToAppear() {
+ }
+
+ build() {
+ Flex({
+ direction: FlexDirection.Column,
+ alignItems: ItemAlign.Center,
+ justifyContent: FlexAlign.Center
+ }) {
+ Text('Settings ETS TEST')
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
+
diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1405dd359f629939894b86e2b285cb2cc1b37aa6
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets
@@ -0,0 +1,32 @@
+/*
+ * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from 'hypium/index'
+import testsuite from '../test/List.test'
+
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..52663437cb619d4598126cf403d3689cb31ba131
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/*
+ * 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 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
diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/applications/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..14e78a653e030645860bcc3e7eb6c600b098127b
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import TestRunner from '@ohos.application.testRunner'
+import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+
+var abilityDelegator = undefined
+var abilityDelegatorArguments = undefined
+
+function translateParamsToString(parameters) {
+ const keySet = new Set([
+ '-s class', '-s notClass', '-s suite', '-s itName',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s package'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ 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')
+ }
+
+ onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+
+ let lMonitor = {
+ abilityName: testAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -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 call abilityDelegator.getAppContext')
+ var context = abilityDelegator.getAppContext()
+ console.info('getAppContext : ' + JSON.stringify(context))
+ console.info('OpenHarmonyTestRunner onRun end')
+ }
+};
\ No newline at end of file
diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..de54e5512c7bd01eb0eb724945bbde56334b81b5
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,19 @@
+/**
+ * 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 settingUiJsunit from './SettingUiJsunit.test.ets';
+
+export default function testsuite() {
+ settingUiJsunit();
+}
\ No newline at end of file
diff --git a/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..15c3b907422d8bf0f2e94caa64d2094da29b148e
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets
@@ -0,0 +1,1257 @@
+// @ts-nocheck
+/**
+ * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index";
+import settings from '@ohos.settings'
+import featureAbility from '@ohos.ability.featureAbility';
+
+export default function settingUiJsunit() {
+ describe('appInfoTest', function () {
+ console.log("************* settings Test start*************");
+ it('settings_uri_test_001', 0,async function (done) {
+ var name = 'settings.screen.test';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_uri_test_001] uri is: " + uri);
+ var uri2 = settings.getUriSync(name);
+ console.info("[settings_uri_test_001] uri2 is: " + uri2);
+ expect(uri).assertEqual(uri2);
+ done();
+ });
+
+ it('settings_uri_test_002', 0, async function (done) {
+ var name = '';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_uri_test_002] uri is: " + uri);
+ expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility')
+ done();
+ });
+
+ it('settings_uri_test_003', 0, async function (done) {
+ var name = 122.00;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_uri_test_003] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_uri_test_003] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_uri_test_004', 0, async function (done) {
+ var name = 'settings.screen.brightness';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_uri_test_004] uri is: " + uri);
+ expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility/settings.screen.brightness')
+ done();
+ });
+
+ it('settings_get_value_005', 0, async function (done) {
+ var name = 'settings.screen.brightness20';
+ var uri = settings.getUriSync(name);
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let value = settings.getValueSync(helper, name, "test getValueSync");
+ console.info("[settings_get_value_005] value is: " + value);
+ expect(value).assertEqual("test getValueSync");
+ done();
+ });
+
+ it('settings_get_value_006', 0, async function (done) {
+ var name = 'settings.screen.brightness2';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_006] uri is: " + uri);
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = {
+ aa: "aa"
+ }
+ try {
+ let value = settings.getValueSync(helper, name, obj);
+ console.info("[settings_get_value_006] value is: " + value);
+ expect(value).assertEqual("test getValueSync");
+ } catch (err) {
+ console.error("[settings_get_value_006] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_007', 0, async function (done) {
+ var name = 'settings.screen.brightness3';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_007] uri is: " + uri);
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = '';
+ try {
+ let value = settings.getValueSync(helper, name, obj);
+ console.info("[settings_get_value_007] value is: " + value);
+ expect(value).assertEqual('');
+ } catch (err) {
+ console.error("[settings_get_value_007] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_008', 0, async function (done) {
+ var name = 'settings.screen.brightness4';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_008] uri is: " + uri);
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = null;
+ try {
+ let value = settings.getValueSync(helper, name, obj);
+ console.info("[settings_get_value_008] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_008] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_009', 0, async function (done) {
+ var name = 'settings.screen.brightness5';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_009] uri is: " + uri);
+ var helper = "helper";
+ try {
+ let value = settings.getValueSync(helper, name, "test getValueSync");
+ console.info("[settings_get_value_009] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_009] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_010', 0, async function (done) {
+ var name = 'settings.screen.brightness6';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_010] uri is: " + uri);
+ var helper = null;
+ try {
+ let value = settings.getValueSync(helper, name, "test getValueSync");
+ console.info("[settings_get_value_010] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_010] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_0011', 0, async function (done) {
+ var name = 'settings.screen.brightness7';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_0011] uri is: " + uri);
+ var helper = "helper";
+ let obj = 121;
+ try {
+ let value = settings.getValueSync(helper, name, obj);
+ console.info("[settings_get_value_0011] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_0011] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_0012', 0, async function (done) {
+ var name = 'settings.screen.brightness8';
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_0012] uri is: " + uri);
+ var helper = null;
+ let obj = null;
+ try {
+ let value = settings.getValueSync(helper, name, obj);
+ console.info("[settings_get_value_0012] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_0012] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_013', 0, async function (done) {
+ var name = 1322.00;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_013] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_get_value_013] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ try {
+ let value = settings.getValueSync(helper, name, "test getValueSync");
+ console.info("[settings_get_value_013] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_013] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_014', 0, async function (done) {
+ let name = null;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_014] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_get_value_014] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ try {
+ let value = settings.getValueSync(helper, name, "test getValueSync");
+ console.info("[settings_get_value_014] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_014] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_0015', 0, async function (done) {
+ let name = 1332;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_0015] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_get_value_0015] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = 22223;
+ try {
+ let value = settings.getValueSync(helper, name, obj);
+ console.info("[settings_get_value_0015] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_0015] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_0016', 0, async function (done) {
+ let name = 1332;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_0016] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_get_value_0016] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = "helper";
+ try {
+ let value = settings.getValueSync(helper, name, "test getValueSync");
+ console.info("[settings_get_value_0016] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_0016] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_0017', 0, async function (done) {
+ let name = 1332;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_get_value_0017] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_get_value_0017] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = "helper";
+ let obj = 221323;
+ try {
+ let value = settings.getValueSync(helper, name, obj);
+ console.info("[settings_get_value_0017] value is: " + value);
+ } catch (err) {
+ console.error("[settings_get_value_0017] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_018', 0, async function (done) {
+ let name = 'settings.screen.brightness10';
+ var uri = settings.getUriSync(name);
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let value = settings.setValueSync(helper, name, "test getValueSync");
+ expect(value).assertEqual(true);
+ done();
+ });
+
+ it('settings_set_value_019', 0, async function (done) {
+ let name = 'settings.screen.brightness11';
+ var uri = settings.getUriSync(name);
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = 32344.00;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ console.info("[settings_set_value_019] value is: " + value);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_019] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_020', 0, async function (done) {
+ let name = 'settings.screen.brightness12';
+ var uri = settings.getUriSync(name);
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = null;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ console.info("[settings_set_value_020] value is: " + value);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_020] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_021', 0, async function (done) {
+ let name = 'settings.screen.brightness13';
+ var helper = "helper";
+ try {
+ let value = settings.setValueSync(helper, name, "test getValueSync");
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_021] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_022', 0, async function (done) {
+ let name = 'settings.screen.brightness13';
+ var helper = null;
+ try {
+ let value = settings.setValueSync(helper, name, "test getValueSync");
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_022] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_023', 0, async function (done) {
+ let name = 'settings.screen.brightness14';
+ var helper = "helper";
+ let obj = 343434.00;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_023] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_024', 0, async function (done) {
+ let name = 'settings.screen.brightness14';
+ var helper = "helper";
+ let obj = null;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_024] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_025', 0, async function (done) {
+ let name = 'settings.screen.brightness14';
+ var helper = null;
+ let obj = 2323.00;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_025] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_026', 0, async function (done) {
+ let name = 1332;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_set_value_026] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_set_value_026] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ try {
+ let value = settings.setValueSync(helper, name, "test getValueSync");
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_026] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_027', 0, async function (done) {
+ let name = null;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_set_value_027] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_set_value_027] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ try {
+ let value = settings.setValueSync(helper, name, "test getValueSync");
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_027] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_028', 0, async function (done) {
+ let name = 2323;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_set_value_028] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_set_value_028] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = 232.00;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_028] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_029', 0, async function (done) {
+ let name = 2323;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_set_value_029] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_set_value_029] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = featureAbility.acquireDataAbilityHelper(uri);
+ let obj = null;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_029] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_030', 0, async function (done) {
+ let name = 2323;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_set_value_030] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_set_value_030] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = "helper";
+ try {
+ let value = settings.setValueSync(helper, name, "text value");
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_030] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_031', 0, async function (done) {
+ let name = 2323;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_set_value_031] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_set_value_031] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = null;
+ try {
+ let value = settings.setValueSync(helper, name, "text value");
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_031] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_set_value_032', 0, async function (done) {
+ let name = 2323;
+ try {
+ var uri = settings.getUriSync(name);
+ console.info("[settings_set_value_032] uri is: " + uri);
+ } catch (err) {
+ let errMsg = err;
+ console.error("[settings_set_value_032] error = " + errMsg);
+ expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.")
+ .assertTrue();
+ }
+ var helper = "helper";
+ let obj = 2323;
+ try {
+ let value = settings.setValueSync(helper, name, obj);
+ expect(value).assertEqual(true);
+ } catch (err) {
+ console.error("[settings_set_value_032] error = " + err);
+ expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.")
+ .assertTrue();
+ }
+ done();
+ });
+
+ it('settings_get_value_033', 0, async function (done){
+ let uri = 'dataability:///com.ohos.settingsdata.DataAbility';
+ let helper = featureAbility.acquireDataAbilityHelper(uri);
+
+ let name = 'settings.screen.brightness33';
+ let value = 'brightness33'
+ try{
+ settings.setValueSync(helper, name, value);
+ settings.getValue(helper, name, ret =>{
+ console.info("[settings_get_value_033] value is: " + ret);
+ expect(ret).assertEqual(value);
+ done();
+ })
+ } catch(err){
+ console.info("[settings_get_value_033] error is: " + toString(error));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_034', 0, async function (done){
+ let uri = 'dataability:///com.ohos.settingsdata.DataAbility';
+ let helper = featureAbility.acquireDataAbilityHelper(uri);
+
+ let name = 'settings.screen.brightness34';
+ let value = 'brightness34'
+
+ try{
+ settings.setValueSync(helper, name, value);
+ settings.getValue(helper, name).then(ret =>{
+ console.info("[settings_get_value_034] value is: " + ret);
+ expect(ret).assertEqual(value);
+ done();
+ })
+ } catch(err){
+ console.info("[settings_get_value_034] error is: " + toString(error));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_035', 0, async function (done){
+ var name = 'settings.screen.brightness35';
+ let uriPrefix = 'dataability:///com.ohos.settingsdata.DataAbility'
+ let expectValue = uriPrefix + '/' + name;
+ try{
+ settings.getURI(name).then(data => {
+ console.info("[settings_get_uri_035] uri is: " + data);
+ expect(data).assertEqual(expectValue);
+ done();
+ })
+ } catch(err){
+ console.info("[settings_get_uri_035] error is: " + toString(error));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_036', 0, async function (done){
+ var name = 'settings.screen.brightness36';
+ let uriPrefix = 'dataability:///com.ohos.settingsdata.DataAbility'
+ let expectValue = uriPrefix + '/' + name;
+ try{
+ settings.getURI(name, (data) =>{
+ console.info("[settings_get_uri_036] uri is: " + data);
+ expect(data).assertEqual(expectValue);
+ done();
+ })
+ }catch(err){
+ console.info("[settings_get_uri_036] error is: " + toString(error));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_037',0,async function (done) {
+ var str ="settings.date.date_format"
+ expect(str).assertEqual(settings.date.DATE_FORMAT);
+ done();
+ });
+
+ it('settings_get_value_038',0,async function (done) {
+ var str ="settings.date.time_format"
+ expect(str).assertEqual(settings.date.TIME_FORMAT);
+ done();
+ });
+
+ it('settings_get_value_039',0,async function (done) {
+ var str ="settings.date.auto_gain_time"
+ expect(str).assertEqual(settings.date.AUTO_GAIN_TIME);
+ done();
+ });
+
+ it('settings_get_value_040',0,async function (done) {
+ var str ="settings.date.auto_gain_time_zone"
+ expect(str).assertEqual(settings.date.AUTO_GAIN_TIME_ZONE);
+ done();
+ });
+
+ it('settings_get_value_041',0,async function (done) {
+ var str ="settings.display.font_scale"
+ expect(str).assertEqual(settings.display.FONT_SCALE);
+ done();
+ });
+
+ it('settings_get_value_042',0,async function (done) {
+ var str ="settings.display.screen_brightness_status"
+ expect(str).assertEqual(settings.display.SCREEN_BRIGHTNESS_STATUS);
+ done();
+ });
+
+ it('settings_get_value_043',0,async function (done) {
+ var str ="settings.display.auto_screen_brightness"
+ expect(str).assertEqual(settings.display.AUTO_SCREEN_BRIGHTNESS);
+ done();
+ });
+
+ it('settings_get_value_044',0,async function (done) {
+ var int = 1
+ expect(int).assertEqual(settings.display.AUTO_SCREEN_BRIGHTNESS_MODE);
+ done();
+ });
+
+ it('settings_get_value_045',0,async function (done) {
+ var int = 0
+ expect(int).assertEqual(settings.display.MANUAL_SCREEN_BRIGHTNESS_MODE);
+ done();
+ });
+
+ it('settings_get_value_046',0,async function (done) {
+ var str ="settings.display.screen_off_timeout"
+ expect(str).assertEqual(settings.display.SCREEN_OFF_TIMEOUT);
+ done();
+ });
+
+ it('settings_get_value_047',0,async function (done) {
+ var str ="settings.display.default_screen_rotation"
+ expect(str).assertEqual(settings.display.DEFAULT_SCREEN_ROTATION);
+ done();
+ });
+
+ it('settings_get_value_048',0,async function (done) {
+ var str ="settings.display.animator_duration_scale"
+ expect(str).assertEqual(settings.display.ANIMATOR_DURATION_SCALE);
+ done();
+ });
+
+ it('settings_get_value_049',0,async function (done) {
+ var str ="settings.display.transition_animation_scale"
+ expect(str).assertEqual(settings.display.TRANSITION_ANIMATION_SCALE);
+ done();
+ });
+
+ it('settings_get_value_050',0,async function (done) {
+ var str ="settings.display.window_animation_scale"
+ expect(str).assertEqual(settings.display.WINDOW_ANIMATION_SCALE);
+ done();
+ });
+
+ it('settings_get_value_051',0,async function (done) {
+ var str = "settings.display.display_inversion_status"
+ expect(str).assertEqual(settings.display.DISPLAY_INVERSION_STATUS);
+ done();
+ });
+
+ it('settings_get_value_052',0,async function (done) {
+ var str = "settings.general.setup_wizard_finished"
+ expect(str).assertEqual(settings.general.SETUP_WIZARD_FINISHED);
+ done();
+ });
+
+ it('settings_get_value_053',0,async function (done) {
+ var str = "settings.general.end_button_action"
+ expect(str).assertEqual(settings.general.END_BUTTON_ACTION);
+ done();
+ });
+
+ it('settings_get_value_054',0,async function (done) {
+ var str = "settings.general.airplane_mode_status"
+ expect(str).assertEqual(settings.general.AIRPLANE_MODE_STATUS);
+ done();
+ });
+
+ it('settings_get_value_055',0,async function (done) {
+ var str = "settings.general.accelerometer_rotation_status"
+ expect(str).assertEqual(settings.general.ACCELEROMETER_ROTATION_STATUS);
+ done();
+ });
+
+ it('settings_get_value_056',0,async function (done) {
+ var str = "settings.general.device_provision_status"
+ expect(str).assertEqual(settings.general.DEVICE_PROVISION_STATUS);
+ done();
+ });
+
+ it('settings_get_value_057',0,async function (done) {
+ var str = "settings.general.hdc_status"
+ expect(str).assertEqual(settings.general.HDC_STATUS);
+ done();
+ });
+
+
+
+ it('settings_get_value_058',0,async function (done) {
+ var str = "settings.general.boot_counting"
+ expect(str).assertEqual(settings.general.BOOT_COUNTING);
+ done();
+ });
+
+ it('settings_get_value_059',0,async function (done) {
+ var str = "settings.general.contact_metadata_sync_status"
+ expect(str).assertEqual(settings.general.CONTACT_METADATA_SYNC_STATUS);
+ done();
+ });
+
+ it('settings_get_value_060',0,async function (done) {
+ var str = "settings.general.development_settings_status"
+ expect(str).assertEqual(settings.general.DEVELOPMENT_SETTINGS_STATUS);
+ done();
+ });
+
+ it('settings_get_value_061',0,async function (done) {
+ var str = "settings.general.device_name"
+ expect(str).assertEqual(settings.general.DEVICE_NAME);
+ done();
+ });
+
+ it('settings_get_value_062',0,async function (done) {
+ var str = "settings.general.usb_storage_status"
+ expect(str).assertEqual(settings.general.USB_STORAGE_STATUS);
+ done();
+ });
+
+ it('settings_get_value_063',0,async function (done) {
+ var str = "settings.general.debugger_waiting"
+ expect(str).assertEqual(settings.general.DEBUGGER_WAITING);
+ done();
+ });
+
+ it('settings_get_value_064',0,async function (done) {
+ var str = "settings.general.debug_app_package"
+ expect(str).assertEqual(settings.general.DEBUG_APP_PACKAGE);
+ done();
+ });
+
+ it('settings_get_value_065',0,async function (done) {
+ var str = "settings.general.accessibility_status"
+ expect(str).assertEqual(settings.general.ACCESSIBILITY_STATUS);
+ done();
+ });
+
+ it('settings_get_value_066',0,async function (done) {
+ var str = "settings.general.activated_accessibility_services"
+ expect(str).assertEqual(settings.general.ACTIVATED_ACCESSIBILITY_SERVICES);
+ done();
+ });
+
+ it('settings_get_value_067',0,async function (done) {
+ var str = "settings.general.geolocation_origins_allowed"
+ expect(str).assertEqual(settings.general.GEOLOCATION_ORIGINS_ALLOWED);
+ done();
+ });
+
+ it('settings_get_value_068',0,async function (done) {
+ var str = "settings.general.skip_use_hints"
+ expect(str).assertEqual(settings.general.SKIP_USE_HINTS);
+ done();
+ });
+
+ it('settings_get_value_069',0,async function (done) {
+ var str = "settings.general.touch_exploration_status"
+ expect(str).assertEqual(settings.general.TOUCH_EXPLORATION_STATUS);
+ done();
+ });
+
+ it('settings_get_value_070',0,async function (done) {
+ var str = "settings.input.default_input_method"
+ expect(str).assertEqual(settings.input.DEFAULT_INPUT_METHOD);
+ done();
+ });
+
+ it('settings_get_value_071',0,async function (done){
+ var str = "settings.input.activated_input_method_submode"
+ let expectValue:string=settings.input.ACTIVATED_INPUT_METHOD_SUB_MODE;
+ expect(str).assertEqual(expectValue);
+ done();
+ });
+
+
+ it('settings_get_value_072',0,async function (done){
+ var str = "settings.input.activated_input_methods"
+ expect(str).assertEqual(settings.input.ACTIVATED_INPUT_METHODS);
+ done();
+ });
+
+
+ it('settings_get_value_073',0,async function (done){
+ var str = "settings.input.selector_visibility_for_input_method"
+ expect(str).assertEqual(settings.input.SELECTOR_VISIBILITY_FOR_INPUT_METHOD);
+ done();
+ });
+
+
+ it('settings_get_value_074',0,async function (done){
+ var str = "settings.input.auto_caps_text_input"
+ expect(str).assertEqual(settings.input.AUTO_CAPS_TEXT_INPUT);
+ done();
+ });
+
+
+ it('settings_get_value_075',0,async function (done){
+ var str = "settings.input.auto_punctuate_text_input"
+ expect(str).assertEqual(settings.input.AUTO_PUNCTUATE_TEXT_INPUT);
+ done();
+ });
+
+
+ it('settings_get_value_076',0,async function (done){
+ var str = "settings.input.auto_replace_text_input"
+ expect(str).assertEqual(settings.input.AUTO_REPLACE_TEXT_INPUT);
+ done();
+ });
+
+
+ it('settings_get_value_077',0,async function (done){
+ var str = "settings.input.show_password_text_input"
+ expect(str).assertEqual(settings.input.SHOW_PASSWORD_TEXT_INPUT);
+ done();
+ });
+
+
+ it('settings_get_value_078',0,async function (done){
+ var str = "settings.network.data_roaming_status"
+ expect(str).assertEqual(settings.network.DATA_ROAMING_STATUS);
+ done();
+ });
+
+
+ it('settings_get_value_079',0,async function (done){
+ var str = "settings.network.http_proxy_cfg"
+ expect(str).assertEqual(settings.network.HTTP_PROXY_CFG);
+ done();
+ });
+
+
+ it('settings_get_value_080',0,async function (done){
+ var str = "settings.network.network_preference_usage"
+ expect(str).assertEqual(settings.network.NETWORK_PREFERENCE_USAGE);
+ done();
+ });
+
+
+ it('settings_get_value_081',0,async function (done){
+ var str = "settings.phone.rtt_calling_status"
+ expect(str).assertEqual(settings.phone.RTT_CALLING_STATUS);
+ done();
+ });
+
+
+ it('settings_get_value_082',0,async function (done){
+ var str = "settings.sound.vibrate_while_ringing"
+ expect(str).assertEqual(settings.sound.VIBRATE_WHILE_RINGING);
+ done();
+ });
+
+
+ it('settings_get_value_083',0,async function (done){
+ var str = "settings.sound.default_alarm_alert"
+ expect(str).assertEqual(settings.sound.DEFAULT_ALARM_ALERT);
+ done();
+ });
+
+
+ it('settings_get_value_084',0,async function (done){
+ var str = "settings.sound.dtmf_tone_type_while_dialing"
+ expect(str).assertEqual(settings.sound.DTMF_TONE_TYPE_WHILE_DIALING);
+ done();
+ });
+
+
+ it('settings_get_value_085',0,async function (done){
+ var str = "settings.sound.dtmf_tone_while_dialing"
+ expect(str).assertEqual(settings.sound.DTMF_TONE_WHILE_DIALING);
+ done();
+ });
+
+
+ it('settings_get_value_086',0,async function (done){
+ var str = "settings.sound.haptic_feedback_status"
+ expect(str).assertEqual(settings.sound.HAPTIC_FEEDBACK_STATUS);
+ done();
+ });
+
+
+ it('settings_get_value_087',0,async function (done){
+ var str = "settings.sound.affected_mode_ringer_streams"
+ expect(str).assertEqual(settings.sound.AFFECTED_MODE_RINGER_STREAMS);
+ done();
+ });
+
+
+ it('settings_get_value_088',0,async function (done){
+ var str = "settings.sound.affected_mute_streams"
+ expect(str).assertEqual(settings.sound.AFFECTED_MUTE_STREAMS);
+ done();
+ });
+
+
+ it('settings_get_value_089',0,async function (done){
+ var str = "settings.sound.default_notification_sound"
+ expect(str).assertEqual(settings.sound.DEFAULT_NOTIFICATION_SOUND);
+ done();
+ });
+
+
+ it('settings_get_value_090',0,async function (done){
+ var str = "settings.sound.default_ringtone"
+ expect(str).assertEqual(settings.sound.DEFAULT_RINGTONE);
+ done();
+ });
+
+ it('settings_get_value_091',0,async function (done) {
+ var str ="settings.sound.sound_effects_status"
+ expect(str).assertEqual(settings.sound.SOUND_EFFECTS_STATUS);
+ done();
+ });
+
+ it('settings_get_value_092',0,async function (done) {
+ var str ="settings.sound.vibrate_status"
+ expect(str).assertEqual(settings.sound.VIBRATE_STATUS);
+ done();
+ });
+
+ it('settings_get_value_093',0,async function (done) {
+ var str ="settings.tts.default_tts_pitch"
+ expect(str).assertEqual(settings.tts.DEFAULT_TTS_PITCH);
+ done();
+ });
+
+ it('settings_get_value_094',0,async function (done) {
+ var str ="settings.tts.default_tts_rate"
+ expect(str).assertEqual(settings.tts.DEFAULT_TTS_RATE);
+ done();
+ });
+
+ it('settings_get_value_095',0,async function (done) {
+ var str ="settings.tts.default_tts_synth"
+ expect(str).assertEqual(settings.tts.DEFAULT_TTS_SYNTH);
+ done();
+ });
+
+ it('settings_get_value_096',0,async function (done) {
+ var str ="settings.tts.enabled_tts_plugins"
+ expect(str).assertEqual(settings.tts.ENABLED_TTS_PLUGINS);
+ done();
+ });
+
+ it('settings_get_value_097',0,async function (done) {
+ var str ="settings.wireless.bluetooth_radio"
+ expect(str).assertEqual(settings.wireless.BLUETOOTH_RADIO);
+ done();
+ });
+
+ it('settings_get_value_098',0,async function (done) {
+ var str ="settings.wireless.cell_radio"
+ expect(str).assertEqual(settings.wireless.CELL_RADIO);
+ done();
+ });
+
+ it('settings_get_value_099',0,async function (done) {
+ var str ="settings.wireless.nfc_radio"
+ expect(str).assertEqual(settings.wireless.NFC_RADIO);
+ done();
+ });
+
+ it('settings_get_value_100',0,async function (done) {
+ var str ="settings.wireless.airplane_mode_radios"
+ expect(str).assertEqual(settings.wireless.AIRPLANE_MODE_RADIOS);
+ done();
+ });
+
+ it('settings_get_value_101',0,async function (done) {
+ var str ="settings.wireless.bluetooth_status"
+ expect(str).assertEqual(settings.wireless.BLUETOOTH_STATUS);
+ done();
+ });
+
+ it('settings_get_value_102',0,async function (done) {
+ var str ="settings.wireless.bluetooth_discoverability_status"
+ expect(str).assertEqual(settings.wireless.BLUETOOTH_DISCOVER_ABILITY_STATUS);
+ done();
+ });
+
+ it('settings_get_value_103',0,async function (done) {
+ var str ="settings.wireless.bluetooth_discover_timeout"
+ expect(str).assertEqual(settings.wireless.BLUETOOTH_DISCOVER_TIMEOUT);
+ done();
+ });
+
+ it('settings_get_value_104',0,async function (done) {
+ var str ="settings.wireless.wifi_dhcp_max_retry_count"
+ expect(str).assertEqual(settings.wireless.WIFI_DHCP_MAX_RETRY_COUNT);
+ done();
+ });
+
+ it('settings_get_value_105',0,async function (done) {
+ var str ="settings.wireless.wifi_to_mobile_data_awake_timeout"
+ expect(str).assertEqual(settings.wireless.WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT);
+ done();
+ });
+
+ it('settings_get_value_106',0,async function (done) {
+ var str ="settings.wireless.wifi_status"
+ expect(str).assertEqual(settings.wireless.WIFI_STATUS);
+ done();
+ });
+
+ it('settings_get_value_107',0,async function (done) {
+ var str ="settings.wireless.wifi_watchdog_status"
+ expect(str).assertEqual(settings.wireless.WIFI_WATCHDOG_STATUS);
+ done();
+ });
+
+ it('settings_get_value_108',0,async function (done) {
+ var str ="settings.wireless.wifi_radio"
+ expect(str).assertEqual(settings.wireless.WIFI_RADIO);
+ done();
+ });
+
+ it('settings_get_value_109',0,async function (done) {
+ var str ="settings.wireless.owner_lockdown_wifi_cfg"
+ expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG);
+ done();
+ });
+
+ it('settings_get_value_110',0,async function (done) {
+ var str ="settings.wireless.owner_lockdown_wifi_cfg"
+ expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG);
+ done();
+ });
+
+ it('settings_get_value_111',0,async function (done) {
+ let uri = 'dataability:///com.ohos.settingsdata.DataAbility';
+ let helper = featureAbility.acquireDataAbilityHelper(uri);
+ let name = 'settings.screen.brightness111';//关键字
+ let value = 'brightness111'//值
+ try{
+ settings.setValue(helper, name, value,(data)=>{
+ console.info("[settings_get_value_111] value is:" + data);
+ settings.getValue(helper, name).then(ret => {
+ console.info("[settings_get_value_111] value is:" + ret);
+ expect(ret).assertEqual(value);
+ done();
+ })
+ });
+ }catch(err){
+ console.info("[settings_get_value_111] error is:" + toString(error));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_112',0,async function (done) {
+ let uri = 'dataability:///com.ohos.settingsdata.DataAbility';
+ let helper = featureAbility.acquireDataAbilityHelper(uri);
+ let name = 'settings.screen.brightness112';//关键字
+ let value = 'brightness112'//值
+ try{
+ settings.setValue(helper, name, value)
+ .then((data)=>{
+ console.info("[settings_get_value_112] value is:" + data);
+ settings.getValue(helper, name).then(ret => {
+ console.info("[settings_get_value_112] value is:" + ret);
+ expect(ret).assertEqual(value);
+ done();
+ })
+ })
+ .catch((err)=>{
+ console.info("[settings_get_value_112] error is:" + toString(error));
+ expect(true).assertTrue();
+ done();
+ return;
+ })
+ }catch(err){
+ console.info("[settings_get_value_112] error is:" + toString(error));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_113',0,async function(done){
+ try{console.info('test settings_get_value_113 start');
+ settings.enableAirplaneMode(false,(err,data)=>{console.info('settings test enableAirplaneMode callback ssss');
+ console.info('settings test enableAirplaneMode callback err'+JSON.stringify(err.code));
+ expect(JSON.stringify(err.code)).assertEqual("801");
+ done();
+ })
+ }catch(err){console.info('settings test enableAirplaneMode try catch err');
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_114',0,async function(done){
+ try{
+ settings.enableAirplaneMode(false).then((data)=>{
+ console.info('settings test enableAirplaneMode promise data'+JSON.stringify(data));
+ expect(false).assertTrue();
+ done();
+ }).catch((err)=>{
+ console.info('settings test enableAirplaneMode promise err'+JSON.stringify(err.code));
+ expect(JSON.stringify(err.code)).assertEqual("801");
+ done();
+ return;
+ })
+ }catch(err){
+ console.info('settings test enableAirplaneMode try catch err'+JSON.stringify(err));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_115',0,async function (done) {
+ try{
+ settings.canShowFloating((err,data)=>{
+ console.info('settings test canShowFloating promise err'+JSON.stringify(err.code));
+ expect(JSON.stringify(err.code)).assertEqual("801");
+ done();
+ })
+ }catch(err){
+ console.info('settings test canShowFloating promise err'+toString(err));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+
+ it('settings_get_value_116',0,async function (done) {
+ try{
+ let str = {"code":801};
+ settings.canShowFloating().then((data)=>{
+ console.info('settings test canShowFloating promise err'+toString(data));
+ expect(toString(err)).assertEqual(str);
+ done();
+ }).catch((err)=>{
+ console.info('settings test canShowFloating promise err'+JSON.stringify(err.code));
+ expect(JSON.stringify(err.code)).assertEqual("801");
+ done();
+ return;
+ })
+ }catch(err){
+ console.info('settings test canShowFloating promise err'+toString(err));
+ expect(true).assertTrue();
+ done();
+ return;
+ }
+ });
+ })
+}
diff --git a/applications/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json b/applications/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..498677efbde065c36668727190d3613cbf278bfc
--- /dev/null
+++ b/applications/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,20 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "entry_MainAbility"
+ },
+ {
+ "name": "description_mainability",
+ "value": "ETS_Empty Ability"
+ },
+ {
+ "name": "TestAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "TestAbility_label",
+ "value": "label"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/applications/settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png b/applications/settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/applications/settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png differ
diff --git a/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b b/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..5111110cf2b932e65f2e898499e8a6f1fd81c93a
Binary files /dev/null and b/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b differ
diff --git a/arkXtest/uitest/src/main/config.json b/arkXtest/uitest/src/main/config.json
index 3dcbc4e08dd3cd552cb289e819cdc4475caec0d6..cffd5b6786c2e53d8cf3d10aa925aadbfb1bfbde 100644
--- a/arkXtest/uitest/src/main/config.json
+++ b/arkXtest/uitest/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -49,7 +50,7 @@
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
- "launchType": "standard"
+ "launchType": "singleton"
},
{
"orientation": "unspecified",
@@ -62,7 +63,7 @@
"description": "$string:TestAbility_desc",
"label": "$string:TestAbility_label",
"type": "page",
- "launchType": "standard"
+ "launchType": "singleton"
}
],
"js": [
diff --git a/arkXtest/uitest/src/main/ets/test/uitest.test.ets b/arkXtest/uitest/src/main/ets/test/uitest.test.ets
index 6520fcc95ab41cb12afd39265aae1639c3cb418a..6e884b202fc4054d02c5a3c0f5f88b904d7e294a 100644
--- a/arkXtest/uitest/src/main/ets/test/uitest.test.ets
+++ b/arkXtest/uitest/src/main/ets/test/uitest.test.ets
@@ -658,6 +658,7 @@ export default function UiTest() {
await driver.delayMs(waitUiReadyMs)
let button = await driver.findComponent(BY.text('jump'))
await button.click()
+ await driver.delayMs(waitUiReadyMs)
let image1 = await driver.findComponent(BY.type('Image'))
let bounds1 = await image1.getBounds()
await image1.pinchIn(0.5);
@@ -684,6 +685,7 @@ export default function UiTest() {
await driver.delayMs(waitUiReadyMs)
let button = await driver.findComponent(BY.text('jump'))
await button.click()
+ await driver.delayMs(waitUiReadyMs)
let image1 = await driver.findComponent(BY.type('Image'))
let bounds1 = await image1.getBounds()
let pointer = PointerMatrix.create(2,11)
@@ -735,6 +737,8 @@ export default function UiTest() {
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let mode2 = await window2.getWindowMode()
expect(mode2 == WindowMode.FLOATING).assertTrue()
+ expect(mode2 != WindowMode.SECONDARY).assertTrue()
+ expect(mode2 != WindowMode.PRIMARY).assertTrue()
await stopApplication('com.uitestScene.acts')
}
catch (err) {
@@ -897,17 +901,19 @@ export default function UiTest() {
/*
* @tc.number: uiTest_4400
- * @tc.name: testWindowFocus
+ * @tc.name: testWindowAttr
* @tc.desc: set the focused status of this UiWindow.
*/
- it('testWindowFocus', 0, async function () {
+ it('testWindowAttr', 0, async function () {
await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility')
let driver = UiDriver.create()
await driver.delayMs(waitUiReadyMs)
- let window = await driver.findWindow({bundleName:'com.uitestScene.acts',focused:true,actived:true})
+ let window = await driver.findWindow({bundleName:'com.uitestScene.acts',focused:true,actived:true,title:''})
await window.focus()
let isFocused = await window.isFocused()
+ let isActived = await window.isActived()
expect(isFocused == true).assertTrue()
+ expect(isActived == true).assertTrue()
await stopApplication('com.uitestScene.acts')
})
@@ -1113,5 +1119,75 @@ export default function UiTest() {
expect(idled = true).assertTrue()
await stopApplication('com.uitestScene.acts')
})
+
+ /*
+ * @tc.number: uiTest_5600
+ * @tc.name: testDrag
+ * @tc.desc: drag on the screen between the specified points.
+ */
+ it('testDrag', 0, async function () {
+ await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility')
+ let driver = UiDriver.create()
+ await driver.delayMs(waitUiReadyMs)
+ let button = await driver.findComponent(BY.text('jump'))
+ await button.longClick()
+ await driver.delayMs(waitUiReadyMs)
+ let text1 = await driver.findComponent(BY.text('orange'))
+ let text2 = await driver.findComponent(BY.text('one'))
+ let point1 = await text1.getBoundsCenter()
+ let point2 = await text2.getBoundsCenter()
+ await driver.drag(point1.X, point1.Y, point2.X, point2.Y)
+ await driver.delayMs(waitUiReadyMs)
+ let text = await driver.findComponent(BY.text('four'))
+ expect(text == null).assertTrue()
+ await stopApplication('com.uitestScene.acts')
+ })
+
+ /*
+ * @tc.number: uiTest_5700
+ * @tc.name: testDragTos
+ * @tc.desc: drag this UiComponent to the bounds rect of target UiComponent.
+ */
+ it('testDragTo', 0, async function () {
+ await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility')
+ let driver = UiDriver.create()
+ await driver.delayMs(waitUiReadyMs)
+ let button = await driver.findComponent(BY.text('jump'))
+ await button.longClick()
+ await driver.delayMs(waitUiReadyMs)
+ let text1 = await driver.findComponent(BY.text('orange'))
+ let text2 = await driver.findComponent(BY.text('one'))
+ await text1.dragTo(text2)
+ await driver.delayMs(waitUiReadyMs)
+ let text = await driver.findComponent(BY.text('four'))
+ expect(text == null).assertTrue()
+ await stopApplication('com.uitestScene.acts')
+ })
+
+ /*
+ * @tc.number: uiTest_5800
+ * @tc.name: testSplit
+ * @tc.desc: change this UiWindow into split screen mode.
+ */
+ it('testSplit', 0, async function () {
+ await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility')
+ let driver = UiDriver.create()
+ await driver.delayMs(waitUiReadyMs)
+ let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
+ try {
+ await window1.split()
+ await driver.delayMs(waitUiReadyMs)
+ let window2 = await driver.findWindow({bundleName:'com.ohos.systemui'})
+ expect(window2 == null).assertTrue()
+ }
+ catch (err) {
+ if (err.message == 'this device can not support this action') {
+ expect(window1 != null).assertTrue()
+ } else {
+ expect(false).assertTrue()
+ }
+ }
+ await stopApplication('com.uitestScene.acts')
+ })
})
}
\ No newline at end of file
diff --git a/arkXtest/uitestScene/src/main/config.json b/arkXtest/uitestScene/src/main/config.json
index eda00378bc047b58ca90d30e6d287620c9f4692c..7df9b84f09a5de3eb3a09bdf3cc63de9182a8e22 100644
--- a/arkXtest/uitestScene/src/main/config.json
+++ b/arkXtest/uitestScene/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
@@ -49,7 +50,7 @@
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
- "launchType": "standard"
+ "launchType": "singleton"
}
],
"js": [
@@ -63,7 +64,8 @@
"pages/second",
"pages/third",
"pages/fourth",
- "pages/screen"
+ "pages/screen",
+ "pages/drag"
],
"name": ".MainAbility",
"window": {
diff --git a/arkXtest/uitestScene/src/main/ets/MainAbility/pages/drag.ets b/arkXtest/uitestScene/src/main/ets/MainAbility/pages/drag.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4cc5dbbcec59dbab8f5039d30ea2631a14fb1ef7
--- /dev/null
+++ b/arkXtest/uitestScene/src/main/ets/MainAbility/pages/drag.ets
@@ -0,0 +1,118 @@
+/**
+ * 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 DragExample {
+ @State numbers: string[] = ['one', 'two', 'three', 'four', 'five', 'six']
+ @State text: string = ''
+ @State bool: boolean = false
+ @State bool1: boolean = false
+ @State appleVisible: Visibility = Visibility.Visible
+ @State orangeVisible: Visibility = Visibility.Visible
+ @State bananaVisible: Visibility = Visibility.Visible
+ @State select: number = 0
+
+ @Builder pixelMapBuilder() {
+ Column() {
+ Text(this.text)
+ .width('50%').height(60).fontSize(16).borderRadius(10)
+ .textAlign(TextAlign.Center).backgroundColor(Color.Yellow)
+ }
+ }
+
+ build() {
+ Column() {
+ Text('There are three Text elements here')
+ .fontSize(12).fontColor(0xCCCCCC).width('90%')
+ .textAlign(TextAlign.Start).margin(5)
+ Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) {
+ Text('apple').width('25%').height(35).fontSize(16)
+ .textAlign(TextAlign.Center).backgroundColor(0xAFEEEE)
+ .visibility(this.appleVisible)
+ .onDragStart(() => {
+ this.bool = true
+ this.text = 'apple'
+ this.appleVisible = Visibility.Hidden
+ return this.pixelMapBuilder
+ })
+ Text('orange').width('25%').height(35).fontSize(16)
+ .textAlign(TextAlign.Center).backgroundColor(0xAFEEEE)
+ .visibility(this.orangeVisible)
+ .onDragStart(() => {
+ this.bool = true
+ this.text = 'orange'
+ this.orangeVisible = Visibility.Hidden
+ return this.pixelMapBuilder
+ })
+ Text('banana').width('25%').height(35).fontSize(16)
+ .textAlign(TextAlign.Center).backgroundColor(0xAFEEEE)
+ .visibility(this.bananaVisible)
+ .onDragStart((event: DragEvent, extraParams: string) => {
+ console.log('Text onDragStarts, ' + extraParams)
+ this.bool = true
+ this.text = 'banana'
+ this.bananaVisible = Visibility.Hidden
+ return this.pixelMapBuilder
+ })
+ }.border({ width: 1 }).width('90%').padding({ top: 10, bottom: 10 }).margin(10)
+
+ Text('This is a List element').fontSize(12)
+ .fontColor(0xCCCCCC).width('90%')
+ .textAlign(TextAlign.Start).margin(15)
+ List({ space: 20, initialIndex: 0 }) {
+ ForEach(this.numbers, (item) => {
+ ListItem() {
+ Text('' + item)
+ .width('100%').height(80).fontSize(16).borderRadius(10)
+ .textAlign(TextAlign.Center).backgroundColor(0xAFEEEE)
+ }
+ .onDragStart((event: DragEvent, extraParams: string) => {
+ console.log('ListItem onDragStarts, ' + extraParams)
+ var jsonString = JSON.parse(extraParams)
+ this.bool1 = true
+ this.text = this.numbers[jsonString.selectedIndex]
+ this.select = jsonString.selectedIndex
+ return this.pixelMapBuilder
+ })
+ }, item => item)
+ }
+ .editMode(true)
+ .height('50%').width('90%').border({ width: 1 })
+ .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 })
+ .onDragEnter((event: DragEvent, extraParams: string) => {
+ console.log('List onDragEnter, ' + extraParams)
+ })
+ .onDragMove((event: DragEvent, extraParams: string) => {
+ console.log('List onDragMove, ' + extraParams)
+ })
+ .onDragLeave((event: DragEvent, extraParams: string) => {
+ console.log('List onDragLeave, ' + extraParams)
+ })
+ .onDrop((event: DragEvent, extraParams: string) => {
+ var jsonString = JSON.parse(extraParams)
+ if (this.bool) {
+ this.numbers.splice(jsonString.insertIndex, 0, this.text)
+ this.bool = false
+ } else if (this.bool1) {
+ this.numbers.splice(jsonString.selectedIndex, 1)
+ this.numbers.splice(jsonString.insertIndex, 0, this.text)
+ this.bool = false
+ this.bool1 = false
+ }
+ })
+ }.width('100%').height('100%').padding({ top: 20 }).margin({ top: 20 })
+ }
+}
\ No newline at end of file
diff --git a/arkXtest/uitestScene/src/main/ets/MainAbility/pages/index.ets b/arkXtest/uitestScene/src/main/ets/MainAbility/pages/index.ets
index 30ad95ebd61572ae6eac5e65a404413c8ae20b1c..b8609d4003cf5d22f8cd8789793f1761c4f8d23a 100644
--- a/arkXtest/uitestScene/src/main/ets/MainAbility/pages/index.ets
+++ b/arkXtest/uitestScene/src/main/ets/MainAbility/pages/index.ets
@@ -69,6 +69,12 @@ struct ScrollExample {
.onClick(() => {
router.push({ uri: 'pages/screen' })
})
+ .gesture(
+ LongPressGesture({ repeat: false })
+ .onAction((event: GestureEvent) => {
+ router.push({ uri: 'pages/drag' })
+ })
+ )
Checkbox({ name: 'hi' })
.size({ width: 30, height: 30 })
TextInput({ placeholder: 'welcome', text: 'Hello World' })
diff --git a/arkui/BUILD.gn b/arkui/BUILD.gn
index 9ea27f67ca26aca3c49dfa4ce299214e7183814e..32f916b04e97c443ba6ea74cbc61265143fd71bf 100644
--- a/arkui/BUILD.gn
+++ b/arkui/BUILD.gn
@@ -15,6 +15,9 @@ group("arkui") {
testonly = true
deps = [
"ace_ets_component:ActsAceEtsComponentTest",
+
+ # "ace_ets_component_apilack:ActsAceEtsApiLackTest",
+ # "ace_ets_component_attrlack:ActsAceEtsAttrLackTest",
"ace_ets_component_five:ActsAceEtsComponentFiveTest",
"ace_ets_component_four:ActsAceEtsComponentFourTest",
"ace_ets_component_three:ActsAceEtsComponentThreeTest",
@@ -24,7 +27,9 @@ group("arkui") {
"ace_ets_test:ActsAceEtsTest",
"ace_ets_third_test:ActsAceEtsThirdTest",
"ace_ets_web_dev:ActsAceWebDevTest",
+ "ace_ets_web_dev_two:ActsAceWebDevTwoTest",
"ace_ets_xcomponent:ActsAceXComponentEtsTest",
+ "ace_js_attribute_api:ActsAceJsApiTest",
"ace_napi_test:ActsAceNapiEtsTest",
"ace_standard:ActsAceStandardTest",
"ace_standard_video:ActsAceStandardVideoTest",
diff --git a/arkui/ace_ets_component/entry/src/main/config.json b/arkui/ace_ets_component/entry/src/main/config.json
index f363e993fa0899ff8eb6778cd8f55ade9da6c081..bb926decd72612989659f64a6a9546d3d0cb7d08 100644
--- a/arkui/ace_ets_component/entry/src/main/config.json
+++ b/arkui/ace_ets_component/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": "com.open.harmony.acetest.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets
index 56a265e1bfbad12a08c680d3cc20d99e7860ebec..73c6e8b1206dcc98099e8e5ddc763c39485d946c 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets
@@ -22,7 +22,7 @@ import prompt from '@system.prompt'
@Component
struct AppearExample {
@State isShow: boolean = true
- @State appearFlag: boolean = false
+ @State appearFlag: string = "appearStatusOff"
@State disAppearFlag: boolean = false
private changeAppear: string = 'Hide Text'
private myText: string = 'Text for onAppear'
@@ -52,26 +52,41 @@ struct AppearExample {
.key('appear')
.onClick(() => {
this.isShow = !this.isShow
+ try {
+ var backData = {
+ data: {
+ "ACTION": this.isShow,
+ }
+ }
+ var backEvent = {
+ eventId: 58,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("appearFlag start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch {
+ console.info("appearFlag emit action state err: " + JSON.stringify(err.message))
+ }
}).margin(3).backgroundColor(0x2788D9)
if (this.isShow) {
Text(this.myText)
.onAppear(() => {
- this.appearFlag = true
+ this.appearFlag = "appearStatusOn"
this.changeAppear = 'Show Text'
console.info('appearFlag current action state is: ' + this.appearFlag);
prompt.showToast({ message: 'The text is shown', duration: 2000 })
try {
- var backData = {
+ var backData2 = {
data: {
- "ACTION": this.appearFlag,
+ "APPEAR": this.appearFlag,
}
}
- var backEvent = {
+ var backEvent2 = {
eventId: 59,
priority: events_emitter.EventPriority.LOW
}
console.info("appearFlag start to emit action state")
- events_emitter.emit(backEvent, backData)
+ events_emitter.emit(backEvent2, backData2)
} catch {
console.info("appearFlag emit action state err: " + JSON.stringify(err.message))
}
@@ -82,17 +97,17 @@ struct AppearExample {
console.info('disAppearFlag current action state is: ' + this.disAppearFlag);
prompt.showToast({ message: 'The text is hidden', duration: 2000 })
try {
- var backData = {
+ var backData1 = {
data: {
"ACTION": this.disAppearFlag,
}
}
- var backEvent = {
+ var backEvent1 = {
eventId: 60,
priority: events_emitter.EventPriority.LOW
}
console.info("disAppearFlag start to emit action state")
- events_emitter.emit(backEvent, backData)
+ events_emitter.emit(backEvent1, backData1)
} catch {
console.info("disAppearFlag emit action state err: " + JSON.stringify(err.message))
}
diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets
index d10d1b0b37eccb934850cea206e8af0e8f0c4f41..1aa54fa0ae8d336a717d7537b12a20380ff19b1f 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets
@@ -54,17 +54,17 @@ struct AreaExample {
this.onActionCalled = true;
console.info('onAreaChange current action state is: ' + this.onActionCalled);
try {
- var backData = {
+ var backData1 = {
data: {
"ACTION": this.onActionCalled,
}
}
- var backEvent = {
+ var backEvent1 = {
eventId: 62,
priority: events_emitter.EventPriority.LOW
}
console.info("onAreaChange start to emit action state")
- events_emitter.emit(backEvent, backData)
+ events_emitter.emit(backEvent1, backData1)
} catch (err) {
console.info("onAreaChange emit action state err: " + JSON.stringify(err.message))
}
diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets
index 55b4ab91431cb94fb2c186969a7e8e5b4829b8e4..1b4a677937b94b92f00f9634b914c58390b83da4 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/global.ets
@@ -21,6 +21,7 @@ struct GlobalExample {
private settings: RenderingContextSettings = new RenderingContextSettings (true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(300, 300, this.settings);
+ private img: ImageBitmap = new ImageBitmap("/images/bg.jpg")
onPageShow() {
console.info("global page called")
@@ -35,50 +36,33 @@ struct GlobalExample {
Canvas(this.context)
.width('100%').height('40%').backgroundColor('#00ffff')
.onReady(() => {
- this.context.imageSmoothingEnabled = false
+ this.offContext.imageSmoothingEnabled = false
this.testImageBitmapSize();
this.testOffscreenCanvas();
this.testImageData();
- this.testImage();
})
}.width('100%').height('100%')
}
testImageBitmapSize() {
- let img = new ImageBitmap("/images/bg.jpg");
- let width = img.width;
- let height = img.height;
- this.context.imageSmoothingEnabled = false;
- this.context.drawImage(img, 30, 950, 160, 100);
+ let width = this.img.width;
+ let height = this.img.height;
+ this.offContext.imageSmoothingEnabled = false;
+ this.offContext.drawImage(this.img, 30, 950, 160, 100);
console.log("imagebitmap_width=" + width);
console.log("imagebitmap_height=" + height);
}
testOffscreenCanvas() {
- var offCanvas2 = this.offContext.getContext("2d");
- var img = new Image();
- img.src = "/images/bg.jpg";
- offCanvas2.drawImage(img, 0, 0, 100, 100);
-
- var bitmap = offscreen.transferToImageBitmap();
- this.ctx.transferFromImageBitmap(bitmap);
+ this.offContext.drawImage(this.img, 0, 0, 100, 100);
+ var bitmap = this.offContext.transferToImageBitmap();
+ this.context.transferFromImageBitmap(bitmap);
}
testImageData() {
- var offCanvas2 = this.offContext.getContext("2d");
- var imageData = offCanvas2.createImageData(100, 100);
+ var imageData = this.offContext.createImageData(100, 100);
var imgData = imageData.data;
console.log("imageData_width=" + imageData.width);
console.log("imageData_height=" + imageData.height);
}
-
- testImage() {
- var img = new Image("/images/bg.jpg", 100, 100)
- .onload(() => {
- })
- .onerror(() => {
- });
- console.log("img_width=" + img.width);
- console.log("img_height=" + img.height);
- }
}
\ No newline at end of file
diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets
index 47a6761c1c5805aeb7619f251de0eaa2e69a19bb..285f05337f9167adf4b5c33597c6bd3883374974 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets
@@ -210,7 +210,7 @@ struct SwiperExample {
this.loop = eventData.data.loop;
}
if (eventData.data.duration != null) {
- this.duration = parseInt(eventData.data.duration);
+ this.duration = eventData.data.duration;
}
if (eventData.data.vertical != null) {
this.vertical = eventData.data.vertical;
diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets
index b9c1e90260c42b10fe2f101c6b25ef0d19167830..7efd3aeeb82f4195c41a6197c865913a8605a9bf 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets
@@ -22,25 +22,6 @@ import events_emitter from '@ohos.events.emitter';
struct TouchAbleExample {
@State text1: string = '';
@State text2: string = '';
- @State touchableValue: boolean = false;
- private stateChangCallBack = (eventData) => {
- console.info("[TouchAble] page stateChangCallBack");
- if (eventData != null) {
- console.info("[TouchAble] page state change called:" + JSON.stringify(eventData));
- if (eventData.data.touchableValue != null) {
- this.touchableValue = eventData.data.touchableValue;
- }
- }
- }
-
- onPageShow() {
- console.info('[TouchAble] page show called');
- var stateChangeEvent = {
- eventId: 44,
- priority: events_emitter.EventPriority.LOW
- }
- events_emitter.on(stateChangeEvent, this.stateChangCallBack);
- }
build() {
Stack() {
@@ -52,6 +33,7 @@ struct TouchAbleExample {
console.info(this.text1 = 'Rect Clicked')
})
.overlay(this.text1, { align: Alignment.Bottom, offset: { x: 0, y: 20 } })
+
Ellipse()
.fill(Color.Pink)
.width(150)
diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets
index 3f75b0047c18065ed5ef7bf8ed4972ba783d1a87..3af4e73de7ff6705ba618ee732b62a9cc34f7da7 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/visibility.ets
@@ -38,7 +38,7 @@ struct VisibilityExample {
eventId: 1116,
priority: events_emitter.EventPriority.LOW
}
- events_emitter.on(stateChangeEvent2, this.stateChangCallBack);
+ events_emitter.on(stateChangeEvent2, this.hiddenChangCallBack);
}
private hiddenChangCallBack = (eventData) => {
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets
index af956d80da41c4cf0f7a63719956c35725ae00f2..f5979dedf63c7bd8287eef81f02e0f1b7caa300d 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets
@@ -51,45 +51,29 @@ export default function appearJsunit() {
console.info('[testAppear01] START');
await Utils.sleep(1000);
try {
- let callBackAppear = (backData) => {
- console.info("testAppear01 get appearEvent result is: " + JSON.stringify(appearEvent));
- expect(backData.data.ACTION).assertEqual(true);
+ let callBackAppear1 = (backData) => {
+ console.info("testAppear01 get appearEvent result is: " + JSON.stringify(backData));
+ expect(backData.data.ACTION).assertEqual(false);
+ done();
}
- var appearEvent = {
+ var appearEvent1 = {
eventId: 58,
priority: events_emitter.EventPriority.LOW
}
- events_emitter.on(appearEvent, callBackAppear);
+ events_emitter.on(appearEvent1, callBackAppear1);
} catch (err) {
console.info("testAppear01 on appearEvent err : " + JSON.stringify(err));
}
console.info("testAppear01 click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
console.info('[testAppear01] END');
- done();
- });
- it('testAppear02', 0, async function (done) {
console.info('[testAppear02] START');
- await Utils.sleep(1000);
- try {
- let callBackAppear = (backData) => {
- console.info("testAppear02 get appearEvent result is: " + JSON.stringify(appearEvent));
- expect(backData.data.ACTION).assertEqual(true);
- }
- var appearEvent = {
- eventId: 59,
- priority: events_emitter.EventPriority.LOW
- }
- events_emitter.on(appearEvent, callBackAppear);
- } catch (err) {
- console.info("testAppear02 on appearEvent err : " + JSON.stringify(err));
- }
- console.info("testAppear02 appearEvent click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
-
try {
- let callBackDisAppear = (backData) => {
- console.info("testAppear02 get disAppearEvent result is: " + JSON.stringify(disAppearEvent));
- expect(backData.data.ACTION).assertEqual(true);
+ let callBackDisAppear = (backData1) => {
+ console.info("testAppear02 get disAppearEvent result is: " + JSON.stringify(backData1));
+ console.info("testAppear02 get backData1.data.ACTION result is: " + backData1.data.ACTION);
+ expect(backData1.data.ACTION).assertEqual(true);
+ done();
}
var disAppearEvent = {
eventId: 60,
@@ -99,10 +83,25 @@ export default function appearJsunit() {
} catch (err) {
console.info("testAppear02 on disAppearEvent err : " + JSON.stringify(err));
}
- console.info("testAppear02 disAppearEvent click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
- console.info('[testAppear02] END');
- done();
- });
+ await Utils.sleep(1000);
+ console.info('[testAppear03] START');
+ let callBackAppear2 = (backData2) => {
+ console.info("testAppear03 get appearEvent result is: " + JSON.stringify(backData2));
+ console.info("testAppear03 get backData2.data.APPEAR: " + backData2.data.APPEAR);
+ expect(backData2.data.APPEAR).assertEqual("appearStatusOn");
+ done();
+ }
+ var appearEvent2 = {
+ eventId: 59,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ console.info("testAppear03 appearEvent click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
+ events_emitter.on(appearEvent2, callBackAppear2);
+ } catch (err) {
+ console.info("testAppear03 on appearEvent err : " + JSON.stringify(err));
+ }
+ });
})
}
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets
index 03b855c1e7bf728ab31ed2cfe5a8b32b1cedbcaa..de746a9537cc6725d81bcf91c2c28e80f8d65bb5 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets
@@ -48,9 +48,10 @@ export default function areaChangeJsunit() {
it('areaChangeTest_0300', 0, async function (done) {
console.info('areaChangeTest_0300 START');
await Utils.sleep(1000);
- let callback = (indexEvent) => {
- console.info("areaChangeTest_0300 get state result is: " + JSON.stringify(indexEvent));
- expect(indexEvent.data.value).assertEqual('TextText');
+ let callback = (backData) => {
+ console.info("areaChangeTest_0300 get state result is: " + JSON.stringify(backData));
+ expect(backData.data.value).assertEqual('TextText');
+ done();
}
let indexEvent = {
eventId: 61,
@@ -61,44 +62,24 @@ export default function areaChangeJsunit() {
} catch (err) {
console.info("areaChangeTest_0300 on events_emitter err : " + JSON.stringify(err));
}
- console.info("areaChangeTest_0300 click result is: " + JSON.stringify(sendEventByKey('text1', 10, "")));
- var innerEventOne = {
- eventId: 62,
- priority: events_emitter.EventPriority.LOW
- }
- await Utils.sleep(1500);
- var callback1 = (eventData) => {
- console.info("areaChangeTest_0300 get event state result is: " + JSON.stringify(eventData));
- expect(eventData.data.ACTION).assertEqual(true);
- }
- try {
- events_emitter.on(innerEventOne, callback1);
- } catch (err) {
- console.info("areaChangeTest_0300 on events_emitter err : " + JSON.stringify(err));
- }
- console.info('areaChangeTest_0300 END');
- done();
- });
- it('areaChangeTest_0400', 0, async function (done) {
console.info('areaChangeTest_0400 START');
await Utils.sleep(1000);
- let callback = (indexEvent) => {
- console.info("areaChangeTest_0400 get state result is: " + JSON.stringify(indexEvent));
- expect(indexEvent.data.value).assertEqual('TextTextText');
+ let callback1 = (eventData) => {
+ console.info("areaChangeTest_0400 get state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.ACTION).assertEqual(true);
+ done();
}
- let indexEvent = {
+ let indexEvent1 = {
eventId: 62,
priority: events_emitter.EventPriority.LOW
}
try {
- events_emitter.on(indexEvent, callback);
+ events_emitter.on(indexEvent1, callback1);
} catch (err) {
console.info("areaChangeTest_0400 on events_emitter err : " + JSON.stringify(err));
}
- console.info("areaChangeTest_0400 click result is: " + JSON.stringify(sendEventByKey('text1', 10, "")));
- console.info('areaChangeTest_0400 END');
- done();
+ console.info("areaChangeTest_0300 click result is: " + JSON.stringify(sendEventByKey('text1', 10, "")));
});
})
}
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets
index bfc2c388e2c94f43f3ba1dc3806e9288c34b45f0..d143fe13227dd667dcec532ac2092a32e346734f 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/ImageEffectsJsunit.test.ets
@@ -405,7 +405,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('centerRow5');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects015] component objNew is: " + JSON.stringify(objNew));
- expect(objNew.$attrs.brightness).assertEqual(0.0000019999999949504854);
+ expect(objNew.$attrs.brightness).assertEqual(0);
done();
});
@@ -520,7 +520,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('centerRow6');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects020] component objNew is: " + JSON.stringify(objNew));
- expect(objNew.$attrs.saturate).assertEqual(0.0000019999999949504854);
+ expect(objNew.$attrs.saturate).assertEqual(0);
done();
});
@@ -634,7 +634,7 @@ export default function imageEffectsJsunit() {
let strJsonNew = getInspectorByKey('centerRow7');
let objNew = JSON.parse(strJsonNew);
console.info("[testImageEffects025] component objNew is: " + JSON.stringify(objNew));
- expect(objNew.$attrs.contrast).assertEqual(0.0000019999999949504854);
+ expect(objNew.$attrs.contrast).assertEqual(0);
done();
});
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets
index 2afff72531b3adbcab8d60eac26d874ace197055..05e5295167fb06666c25834a9c72e57b6ff85f77 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets
@@ -52,6 +52,7 @@ export default function marqueeJsunit() {
let callback = (indexEvent) => {
console.info("testMarquee_0100 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.start).assertEqual(true);
+ done();
}
let indexEvent = {
eventId: 130,
@@ -67,6 +68,7 @@ export default function marqueeJsunit() {
var callback1 = (eventData) => {
console.info("testMarquee_0100 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.fontColor).assertEqual(Color.Blue);
+ done();
}
var innerEventOne = {
eventId: 127,
@@ -78,7 +80,6 @@ export default function marqueeJsunit() {
console.info("testMarquee_0100 on events_emitter err : " + JSON.stringify(err));
}
console.info('testMarquee_0100 END');
- done();
});
it('testMarquee_0200', 0, async function (done) {
@@ -87,6 +88,7 @@ export default function marqueeJsunit() {
let callback = (indexEvent) => {
console.info("testMarquee_0200 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.start).assertEqual(true);
+ done();
}
let indexEvent = {
eventId: 130,
@@ -102,6 +104,7 @@ export default function marqueeJsunit() {
var callback1 = (eventData) => {
console.info("testMarquee_0200 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.fontSize).assertEqual(50);
+ done();
}
var innerEventOne = {
eventId: 128,
@@ -113,7 +116,6 @@ export default function marqueeJsunit() {
console.info("testMarquee_0200 on events_emitter err : " + JSON.stringify(err));
}
console.info('testMarquee_0200 END');
- done();
});
it('testMarquee_0300', 0, async function (done) {
@@ -122,6 +124,7 @@ export default function marqueeJsunit() {
let callback = (indexEvent) => {
console.info("testMarquee_0300 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.start).assertEqual(true);
+ done();
}
let indexEvent = {
eventId: 130,
@@ -137,6 +140,7 @@ export default function marqueeJsunit() {
var callback1 = (eventData) => {
console.info("testMarquee_0300 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual(true);
+ done();
}
var innerEventOne = {
eventId: 129,
@@ -148,7 +152,6 @@ export default function marqueeJsunit() {
console.info("testMarquee_0300 on events_emitter err : " + JSON.stringify(err));
}
console.info('testMarquee_0300 END');
- done();
});
})
}
\ No newline at end of file
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets
index 6ba651339cad3115a62fa2fb2ca4761803aaca2d..84c213f762a9d675bc6547698225ffd28db33254 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets
@@ -164,6 +164,7 @@ export default function swiperJsunit() {
let callback = (indexEvent) => {
console.info("swiperTest_0800 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
+ done();
}
let indexEvent = {
eventId: 205,
@@ -177,7 +178,6 @@ export default function swiperJsunit() {
console.info("swiperTest_0800 click result is: " + JSON.stringify(sendEventByKey('button1', 10, "")));
await Utils.sleep(1000);
console.info('swiperTest_0800 END');
- done();
});
it('swiperTest_0900', 0, async function (done) {
@@ -186,6 +186,7 @@ export default function swiperJsunit() {
let callback = (indexEvent) => {
console.info("swiperTest_0900 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
+ done();
}
let indexEvent = {
eventId: 206,
@@ -199,7 +200,6 @@ export default function swiperJsunit() {
console.info("swiperTest_0900 click result is: " + JSON.stringify(sendEventByKey('button2', 10, "")));
await Utils.sleep(1000);
console.info('swiperTest_0900 END');
- done();
});
it('swiperTest_1000', 0, async function (done) {
@@ -208,6 +208,7 @@ export default function swiperJsunit() {
let callbackOne = (indexEventOne) => {
console.info("swiperTest_1000 get state result is: " + JSON.stringify(indexEventOne));
expect(indexEventOne.data.ACTION).assertEqual(true);
+ done();
}
let indexEventOne = {
eventId: 206,
@@ -223,6 +224,7 @@ export default function swiperJsunit() {
let callback = (indexEvent) => {
console.info("swiperTest_1000 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
+ done();
}
let indexEvent = {
eventId: 204,
@@ -234,7 +236,6 @@ export default function swiperJsunit() {
console.info("swiperTest_1000 on events_emitter err : " + JSON.stringify(err));
}
console.info('swiperTest_1000 END');
- done();
});
it('swiperTest_1100', 0, async function (done) {
@@ -450,7 +451,7 @@ export default function swiperJsunit() {
try {
let eventData = {
data: {
- "duration": "nan"
+ "duration": "0"
}
}
let indexEvent = {
@@ -466,7 +467,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1900 component objNew is: " + JSON.stringify(objNew));
- expect(objNew.$attrs.duration).assertEqual('nan');
+ expect(objNew.$attrs.duration).assertEqual('0.000000');
console.info('swiperTest_1900 END');
done();
});
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets
index 6e0e2cbe0b29f901c0ab529f0f38570e1f6f2072..6ca13464c02c0faaa04c9ffff87196eba3e42eb6 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets
@@ -60,6 +60,8 @@ export default function touchAbleJsunit() {
var callbackTwo = (eventData) => {
console.info("[testTouchAble002] get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual('Ellipse Clicked')
+ console.info('[testTouchAble002] END');
+ done();
}
var innerEventTwo = {
eventId: 237,
@@ -70,10 +72,7 @@ export default function touchAbleJsunit() {
} catch (err) {
console.info("[testTouchAble002] on events_emitter err : " + JSON.stringify(err));
}
- console.info('[testClickEvent001] sendEventByKey ' + JSON.stringify(sendEventByKey('ellipse', 10, "")));
- await Utils.sleep(1000)
- console.info('[testTouchAble002] END');
- done();
+ console.info("testClickEvent002 click result is: " + JSON.stringify(sendEventByKey('ellipse', 10, "")));
});
})
}
\ No newline at end of file
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets
index 8819f9e3b394a2de014fb9d43166b26a04441cbf..8b1bc86b9f746ce7582fd97afebed74b4547ced5 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets
@@ -55,6 +55,7 @@ export default function touchJsunit() {
console.info("testTouch01 get backEvent result is: " + JSON.stringify(backEvent));
console.info("testTouch01 get flag result is: " + JSON.stringify(backData.data.ACTION));
expect(backData.data.ACTION).assertEqual(true);
+ done();
}
var backEvent = {
eventId: 43,
@@ -66,7 +67,6 @@ export default function touchJsunit() {
}
console.info("testTouch01 click result is: " + JSON.stringify(sendEventByKey('touch', 10, "")));
console.info('[testTouch01] END');
- done();
});
})
}
diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets
index 8ee65d56a153792b68bc5e89346ad1f5b5f59da2..87a981ad4908357170d5293e797ed807f1b570ea 100644
--- a/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets
+++ b/arkui/ace_ets_component/entry/src/main/ets/test/VisibilityJsunit.test.ets
@@ -130,7 +130,7 @@ export default function visibilityJsunit() {
let strJson = getInspectorByKey('box');
let obj = JSON.parse(strJson);
console.info("[testVisibility04] obj is: " + JSON.stringify(obj));
- expect(obj.$attrs.visibility).assertEqual('Visibility.None');
+ expect(obj.$attrs.visibility).assertEqual('Visibility.Visible');
console.info('[testVisibility04] END');
done();
});
@@ -156,7 +156,7 @@ export default function visibilityJsunit() {
let strJson = getInspectorByKey('box');
let obj = JSON.parse(strJson);
console.info("[testVisibility05] obj is: " + JSON.stringify(obj));
- expect(obj.$attrs.visibility).assertEqual('Visibility.None');
+ expect(obj.$attrs.visibility).assertEqual('Visibility.Visible');
console.info('[testVisibility05] END');
done();
});
diff --git a/arkui/ace_ets_component_apilack/BUILD.gn b/arkui/ace_ets_component_apilack/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..b10a77056f2aa80a93d65f71b3536a37cf110e31
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/BUILD.gn
@@ -0,0 +1,38 @@
+# 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("ActsAceEtsApiLackTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":ace_ets_assets",
+ ":ace_ets_resources",
+ ":ace_ets_test_assets",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsAceEtsApiLackTest"
+ subsystem_name = "arkui"
+ part_name = "ace_engine"
+}
+ohos_js_assets("ace_ets_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_js_assets("ace_ets_test_assets") {
+ source_dir = "./entry/src/main/ets/TestAbility"
+}
+ohos_resources("ace_ets_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/arkui/ace_ets_component_apilack/Test.json b/arkui/ace_ets_component_apilack/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..0ef09c69cd641ca5e16e67a8c79796bb903203c6
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/Test.json
@@ -0,0 +1,19 @@
+{
+ "description": "Configuration for aceEtsApiLack Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.open.harmony.aceEtsApiLack",
+ "package-name": "com.open.harmony.aceEtsApiLack",
+ "shell-timeout": "600000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsAceEtsApiLackTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/config.json b/arkui/ace_ets_component_apilack/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..f960a814e09795ba0312d613045a2d6564634906
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/config.json
@@ -0,0 +1,155 @@
+{
+ "app": {
+ "bundleName": "com.open.harmony.aceEtsApiLack",
+ "vendor": "open",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 7,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.open.harmony.aceEtsApiLack",
+ "name": ".MyApplication",
+ "mainAbility": "com.open.harmony.aceEtsApiLack.MainAbility",
+ "deviceType": [
+ "default",
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry",
+ "installationFree": false
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:description_mainability",
+ "formsEnabled": false,
+ "label": "$string:entry_MainAbility",
+ "type": "page",
+ "launchType": "standard"
+ },
+ {
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "TestAbility",
+ "name": ".TestAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:TestAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:TestAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index",
+ "pages/abilityComponent",
+ "pages/alphabetIndexer",
+ "pages/checkBoxGroup",
+ "pages/circle",
+ "pages/common",
+ "pages/common_ts_ets_api",
+ "pages/curves",
+ "pages/dom",
+ "pages/ellipse",
+ "pages/featureAbility",
+ "pages/focusControl",
+ "pages/form_component",
+ "pages/gauge",
+ "pages/global",
+ "pages/grid",
+ "pages/grid_col",
+ "pages/grid_row",
+ "pages/gridItem",
+ "pages/image",
+ "pages/inspector",
+ "pages/lazyForEach",
+ "pages/line",
+ "pages/list",
+ "pages/list_item",
+ "pages/mediaQuery",
+ "pages/navigator",
+ "pages/onVisibleAreaChange",
+ "pages/page1",
+ "pages/pageRoute",
+ "pages/page_transition",
+ "pages/panel",
+ "pages/path",
+ "pages/pluginComponent",
+ "pages/polygon",
+ "pages/polyLine",
+ "pages/progress",
+ "pages/prompt",
+ "pages/rect",
+ "pages/router",
+ "pages/scroll",
+ "pages/search",
+ "pages/select",
+ "pages/shape",
+ "pages/sideBar",
+ "pages/stack",
+ "pages/stateManagement",
+ "pages/swiper",
+ "pages/tabs",
+ "pages/text",
+ "pages/textArea",
+ "pages/textInput",
+ "pages/textPicker",
+ "pages/uiAppearance",
+ "pages/video",
+ "pages/web",
+ "pages/xcomponent"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ },
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".TestAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/app.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..07722b56d3d02df5fb59b51789007b844b43e63c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from 'hypium/index'
+import testsuite from '../test/List.test'
+
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/common/Log.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/common/Log.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f4526b3304e19ee408543fbfca9f4d6a626f5008
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/common/Log.ets
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const TAG = 'ets_apiLack_add';
+
+/**
+ * Basic log class
+ */
+export default class Log {
+
+ /**
+ * print info level log
+ *
+ * @param {string} tag - Page or class tag
+ * @param {string} log - Log needs to be printed
+ */
+ static showInfo(tag, log) {
+ console.info(`${TAG} tag: ${tag} --> ${log}`);
+ }
+
+ /**
+ * print debug level log
+ *
+ * @param {string} tag - Page or class tag
+ * @param {string} log - Log needs to be printed
+ */
+ static showDebug(tag, log) {
+ console.debug(`${TAG} tag: ${tag} --> ${log}`);
+ }
+
+ /**
+ * print error level log
+ *
+ * @param {string} tag - Page or class tag
+ * @param {string} log - Log needs to be printed
+ */
+ static showError(tag, log) {
+ console.error(`${TAG} tag: ${tag} --> ${log}`);
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/common/plugin_component.js b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/common/plugin_component.js
new file mode 100644
index 0000000000000000000000000000000000000000..6a3b4ed6c92a847bc0c1a8421cefc8a5b8b52d1c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/common/plugin_component.js
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 pluginComponentManager from '@ohos.pluginComponent'
+
+function onPushListener(source, template, data, extraData) {
+ console.log("onPushListener template.source=" + template.source)
+ var jsonObject = JSON.parse(data.componentTemplate.source)
+ console.log("request_callback1:source json object" + jsonObject)
+ var jsonArry = jsonObject.ExternalComponent
+ for (var i in jsonArry) {
+ console.log(jsonArry[i])
+ }
+ console.log("onPushListener:source json object" + jsonObject)
+ console.log("onPushListener:source json string" + JSON.stringify(jsonObject))
+ console.log("onPushListener template.ability=" + template.ability)
+ console.log("onPushListener data=" + JSON.stringify(data))
+ console.log("onPushListener extraData=" + JSON.stringify(extraData))
+}
+
+function onRequestListener(source, name, data)
+{
+ console.log("onRequestListener name=" + name);
+ console.log("onRequestListener data=" + JSON.stringify(data));
+ return {template:"plugintemplate", data:data};
+}
+
+export default {
+ //register listener
+ onListener() {
+ pluginComponentManager.on("push", onPushListener)
+ pluginComponentManager.on("request", onRequestListener)
+ },
+ Push() {
+ // 组件提供方主动发送事件
+ pluginComponentManager.push(
+ {
+ want: {
+ bundleName: "com.example.myapplication",
+ abilityName: "com.example.myapplication.MainAbility",
+ },
+ name: "plugintemplate",
+ data: {
+ "key_1": "plugin component test",
+ "key_2": 34234
+ },
+ extraData: {
+ "extra_str": "this is push event"
+ },
+ jsonPath: "",
+ },
+ (err, data) => {
+ console.log("push_callback: push ok!");
+ }
+ )
+ },
+ Request() {
+ // 组件使用方主动发送事件
+ pluginComponentManager.request({
+ want: {
+ bundleName: "com.example.myapplication",
+ abilityName: "com.example.myapplication.MainAbility",
+ },
+ name: "plugintemplate",
+ data: {
+ "key_1": "plugin component test",
+ "key_2": 34234
+ },
+ jsonPath: "",
+ },
+ (err, data) => {
+ console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability)
+ console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source)
+ var jsonObject = JSON.parse(data.componentTemplate.source)
+ console.log("request_callback:source json object" + jsonObject)
+ var jsonArry = jsonObject.ExternalComponent
+ for (var i in jsonArry) {
+ console.log(jsonArry[i])
+ }
+ console.log("request_callback:source json string" + JSON.stringify(jsonObject))
+ console.log("request_callback: data=" + JSON.stringify(data.data))
+ console.log("request_callback: extraData=" + JSON.stringify(data.extraData))
+ }
+ )
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/PluginProviderExample.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/PluginProviderExample.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6a97a6fb48d2fd1961f1b88bee8ebc0e5f2bde06
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/PluginProviderExample.ets
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 plugin from "plugin_component.js"
+
+@Entry
+@Component
+struct PluginProviderExample {
+ @State message: string = 'no click!'
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Button('Register Push Listener')
+ .fontSize(30)
+ .width(400)
+ .height(100)
+ .margin({top:20})
+ .onClick(()=>{
+ plugin.onListener()
+ console.log("Button('Register Push Listener')")
+ })
+ Button('Push')
+ .fontSize(30)
+ .width(400)
+ .height(100)
+ .margin({top:20})
+ .onClick(()=>{
+ plugin.Push()
+ this.message = "Button('Push')"
+ console.log("Button('Push')")
+ })
+ Text(this.message)
+ .height(150)
+ .fontSize(30)
+ .padding(5)
+ .margin(5)
+ }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/abilityComponent.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/abilityComponent.ets
new file mode 100644
index 0000000000000000000000000000000000000000..cb697d6f4c9f62ede9bb05b09b9aa66051d37163
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/abilityComponent.ets
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import prompt from '@ohos.prompt'
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+
+@Entry
+@Component
+struct MyComponent {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear AbilityComponent start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear AbilityComponent end`)
+ }
+
+ build() {
+ Column() {
+ AbilityComponent({
+ want: {
+ bundleName: '',
+ abilityName: ''
+ },
+ })
+ .onConnect(() => {
+ console.log('AbilityComponent connect');
+ })
+ .onDisconnect(() => {
+ console.log('AbilityComponent disconnect');
+ })
+ }
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/alphabetIndexer.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/alphabetIndexer.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8eeeba40826894f296e43153c7934eb58fd4af7d
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/alphabetIndexer.ets
@@ -0,0 +1,113 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import prompt from '@ohos.prompt'
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct AlphabetIndexerOnSelect {
+ private value: string[] = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N']
+ private content: string = "AlphabetIndexer Page"
+ @State onSelectStatus: boolean = false;
+ @State onRequestPopupDataStatus: boolean = false;
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear AlphabetIndexerOnSelect start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear AlphabetIndexerOnSelect end`)
+ }
+
+ showToast(message) {
+ prompt.showToast({
+ message: message,
+ duration: 2000
+ });
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+ Text(`${this.content}`)
+ .fontSize(20)
+ .align(Alignment.Center)
+ .fontWeight(FontWeight.Bold)
+ AlphabetIndexer({ arrayValue: this.value, selected: 0 })
+ .color('#FFFF0000')
+ .selectedColor(0xffffff)
+ .key('alphabetIndexer')
+ .popupColor('#FF48D1CC')
+ .selectedBackgroundColor('#FF0000E6')
+ .popupBackground('#FF00DDDD')
+ .usingPopup(true)
+ .selectedFont({ size: 16, weight: FontWeight.Regular })
+ .popupFont({ size: 30, weight: FontWeight.Bolder, style: FontStyle.Normal })
+ .itemSize(28)
+ .width(100)
+ .height(300)
+ .alignStyle(IndexerAlign.Left)
+ .onSelect((index: number) => {
+ console.info(this.value[index] + 'on onSelect')
+ this.showToast("onSelect() " + index)
+ this.onSelectStatus = true;
+ try {
+ var backData = {
+ data: {
+ "STATUS": this.onSelectStatus
+ }
+ }
+ let backEvent = {
+ eventId: 60201,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onSelect start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onSelect emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .onPopupSelect((index: number) => {
+ console.info(this.value[index] + 'on onPopupSelect')
+ this.showToast("onPopupSelect() " + index)
+ })
+ .onRequestPopupData((index: number) => {
+ console.info(this.value[index] + 'on onRequestPopupData')
+ this.showToast("onRequestPopupData() " + index)
+ this.onRequestPopupDataStatus = true
+ try {
+ var backData = {
+ data: {
+ "STATUS": this.onRequestPopupDataStatus
+ }
+ }
+ let backEvent = {
+ eventId: 60202,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onRequestPopupData start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onRequestPopupData emit action state err: " + JSON.stringify(err.message))
+ }
+ return ['1', '2', '3', '4', '5']
+
+ })
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets
new file mode 100644
index 0000000000000000000000000000000000000000..daded4fbea872129b4248c0636957ffab425441f
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets
@@ -0,0 +1,111 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 prompt from '@ohos.prompt'
+import events_emitter from '@ohos.events.emitter';
+import Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct CheckBoxGroupSelectAll {
+ @State isSelect: boolean = true;
+
+ onPageShow() {
+ console.info('[CheckBoxGroup] page show called');
+ var stateChangeEvent = {
+ eventId: 60203,
+ priority: events_emitter.EventPriority.LOW
+ }
+ events_emitter.on(stateChangeEvent, this.stateChangCallBack);
+ }
+
+ private stateChangCallBack = (eventData) => {
+ console.info("[CheckBoxGroup] page stateChangCallBack");
+ if (eventData != null) {
+ console.info("[CheckBoxGroup] page state change called:" + JSON.stringify(eventData));
+ if (eventData.data.isSelect != null) {
+ this.isSelect = eventData.data.isSelect;
+ }
+ }
+ }
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CheckBoxGroupSelectAll start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear CheckBoxGroupSelectAll end`)
+ }
+
+ showToast(message) {
+ prompt.showToast({
+ message: message,
+ duration: 2000
+ });
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("checkBoxGroup-SelectAll")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("selectAllText")
+
+ Scroll() {
+ Column() {
+ CheckboxGroup({group : 'checkboxGroup'})
+ .selectedColor(0xed6f21)
+ .key('CheckboxGroup')
+ .selectAll(this.isSelect)
+ .onChange((itemName:CheckboxGroupResult) => {
+ console.info("TextPicker::dialogResult is" + JSON.stringify(itemName))
+ this.showToast(itemName.status.valueOf() == 0 ? "selectAll true" : "selectAll false");
+ })
+ Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
+ .selectedColor(0x39a2db)
+ .key("CheckboxOne")
+ .onChange((value: boolean) => {
+ console.info('Checkbox1 change is' + value)
+ })
+ Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
+ .selectedColor(0x39a2db)
+ .onChange((value: boolean) => {
+ console.info('Checkbox2 change is' + value)
+ })
+ Checkbox({ name: 'checkbox3', group: 'checkboxGroup' })
+ .selectedColor(0x39a2db)
+ .onChange((value: boolean) => {
+ console.info('Checkbox3 change is' + value)
+ })
+ }
+ }
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets
new file mode 100644
index 0000000000000000000000000000000000000000..78d0d36e54a23383149119e53f33401885ed4387
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct CircleNe {
+ @State w: string = "100px";
+ @State h: string = "100px";
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CircleNew start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear CircleNew end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("circle-New")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+
+ Circle()
+ .width(`${this.w}`)
+ .height(`${this.h}`)
+ .key('circle')
+
+ Image($rawfile('test.png'))
+ .mask(new Circle({ width: '150px', height: '150px' }).fill(Color.Gray))
+ .width('500px').height('280px')
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d25aa5d921a18abf47e0512c4f555cef32654cb1
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common.ets
@@ -0,0 +1,320 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import inputEventClient from '@ohos.multimodalInput.inputEventClient';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct CommonBackgroundBlurStyle {
+ @State value: string = ''
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CommonBackgroundBlurStyle start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear CommonBackgroundBlurStyle end`)
+ }
+
+ onPageHide(): void {
+ Log.showInfo(TAG, `onPageHide CommonBackgroundBlurStyle start`)
+ }
+
+ onBackPress(): void {
+ Log.showInfo(TAG, `onBackPress CommonBackgroundBlurStyle start`)
+ }
+
+ @Styles pressedStyles() {
+ .backgroundColor('red')
+ .opacity(1)
+ }
+
+ buttonTab(){
+ let keyEventDown = {
+ isPressed: true,
+ keyCode: 2049,
+ keyDownDuration: 0,
+ isIntercepted: false
+ }
+ let res1 = inputEventClient.injectEvent({KeyEvent: keyEventDown});
+
+ let keyEventUp = {
+ isPressed: false,
+ keyCode: 2049,
+ keyDownDuration: 0,
+ isIntercepted: false
+ }
+ let res2 = inputEventClient.injectEvent({KeyEvent: keyEventUp});
+ }
+
+ buttonOnKey(){
+ let keyEventDown = {
+ isPressed: true,
+ keyCode: 2054,
+ keyDownDuration: 0,
+ isIntercepted: false
+ }
+ let res3 = inputEventClient.injectEvent({KeyEvent: keyEventDown});
+
+ let keyEventUp = {
+ isPressed: false,
+ keyCode: 2054,
+ keyDownDuration: 0,
+ isIntercepted: false
+ }
+ let res4 = inputEventClient.injectEvent({KeyEvent: keyEventUp});
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("common-BackgroundBlurStyle")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("backgroundBlurStyleText")
+ .backgroundBlurStyle(BlurStyle.Thick)
+
+ Text("common-BorderImage")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("borderImageText")
+ .borderImage({
+ source: {
+ angle: 90,
+ direction: GradientDirection.Left,
+ colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]]
+ },
+ slice: { top: 10, bottom: 10, left: 10, right: 10 },
+ width: { top: "10px", bottom: "10px", left: "10px", right: "10px" },
+ repeat: RepeatMode.Stretch,
+ fill: false
+ })
+
+ Text("common-HoverEffectHighlight")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("hoverEffectText")
+ .hoverEffect(HoverEffect.Highlight)
+
+ Text("common-HoverEffectScale")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("hoverEffectScaleText")
+ .hoverEffect(HoverEffect.Scale)
+
+ Text("common-OnKeyEvent")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onKeyEventText")
+
+ Button('common-OnKeyEvent')
+ .onClick(()=>{
+ this.buttonTab()
+ this.buttonOnKey()
+ })
+ .key("onKeyEventButton")
+ .onKeyEvent((event: KeyEvent) => {
+ if (event.keyCode === 2054) {
+ console.info("onKeyEvent 2054 inject Success ");
+ }
+ if (event.type === KeyType.Down) {
+ Log.showInfo(TAG, `Down`)
+ }
+ if (event.type === KeyType.Up) {
+ Log.showInfo(TAG, `Up`)
+ }
+ Log.showInfo(TAG, 'KeyType:' + event.type + ';keyCode:' + event.keyCode + ';keyText:' + event.keyText)
+ })
+
+ Text("common-TabIndex")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("tabIndexText")
+ .tabIndex(1)
+
+ Text("common-ParallelGesture" + '\n' + this.value)
+ .width(320)
+ .height(100)
+ .fontSize(12)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(15)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("parallelGestureText")
+ .parallelGesture(TapGesture().onAction(() => {
+ // 并行手势
+ this.value = 'gesture onAction'
+ }))
+
+ Text("common-Sepia")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("sepiaText")
+ .backgroundColor('#E78282')
+ .sepia(1)
+
+ Button('Button 1')
+ .id('target')
+
+ Text("common-AlignRules")
+ .width(260)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("alignRulesText")
+ .alignRules({
+ top: { anchor: 'target', align: VerticalAlign.Bottom },
+ right: { anchor: "target", align: HorizontalAlign.Center }
+ })
+
+ Text("common-StateStyles")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("stateStylesText")
+ .stateStyles({
+ pressed: this.pressedStyles
+ })
+
+ Text("common-OnVisibleAreaChange")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onVisibleAreaChangeText")
+
+ Text("common-OnPageHide")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onPageHideText")
+
+ Text("common-OnBackPress")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onBackPressText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common_ts_ets_api.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common_ts_ets_api.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4ad9aa342f7673d7834fc9f5607595e89f5091e9
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common_ts_ets_api.ets
@@ -0,0 +1,145 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+
+let varA = AppStorage.Link('varA')
+
+//Environment.EnvProp("accessibilityEnabled", "default")
+PersistentStorage.PersistProp("highScore", 0)
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct Common_ts_ets_apiStaticClear {
+ @StorageLink('varA') varA: number = 2
+ private label: string = 'count'
+ @StorageLink('highScore') highScore: number = 0
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear Common_ts_ets_apiStaticClear start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear Common_ts_ets_apiStaticClear end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text(`${this.label}: ${this.varA}`)
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("labelA")
+ .onClick(() => {
+ AppStorage.Set('varA', AppStorage.Get('varA') + 1)
+ })
+
+ Text("common_ts_ets_api-StaticClear")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("staticClearText")
+ .onClick(() => {
+ AppStorage.staticClear()
+ })
+
+ Text("common_ts_ets_api-EnvProp")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("EnvPropText")
+ .onClick(() => {
+ var enable = AppStorage.Get("accessibilityEnabled");
+ try {
+ var backData = {
+ data: {
+ "Result": (enable != null)
+ }
+ }
+ let backEvent = {
+ eventId: 60231,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("PersistProp start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("PersistProp emit action state err: " + JSON.stringify(err.message))
+ }
+
+ })
+
+ Text(`common_ts_ets_api-PersistProp : ${this.highScore}`)
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("PersistPropText")
+ .onClick(() => {
+ this.highScore = this.highScore + 1
+ try {
+ var backData = {
+ data: {
+ "Score": "Score"
+ }
+ }
+ let backEvent = {
+ eventId: 60230,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("PersistProp start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("PersistProp emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/curves.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/curves.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ff120314467a52aa92b4282f80cc6a2995f4b358
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/curves.ets
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+import Curves from '@ohos.curves'
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct CurvesSteps {
+ @State curveApi:string = "success"
+ @State curve1:ICurve = Curves.springMotion(0.40, 0.99, 0)
+ @State curve2:ICurve = Curves.responsiveSpringMotion(0.40, 0.99, 0);
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CurvesSteps start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear CurvesSteps end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Text("curves-Steps")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("stepsText")
+ .onClick(() => {
+ try{
+ let curve = Curves.steps(1, true)
+ console.info("curve is" + curve)
+ this.curveApi = "callBackSuccess"
+ }catch(err){
+ console.info("curve onClick err: " + JSON.stringify(err.message))
+ this.curveApi = "callBackFail"
+ }
+ try {
+ var backData = {
+ data: {
+ "curveApi": this.curveApi,
+ "curveSpringMotion": this.curve1,
+ "curveResSpringMotion": this.curve2
+ }
+ }
+ let backEvent = {
+ eventId: 60229,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("curveApi onClick start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("curveApi onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/dom.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/dom.ets
new file mode 100644
index 0000000000000000000000000000000000000000..61eeaa5aa4cbe09a0244014e4154af5862038310
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/dom.ets
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct DomCreateElement {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear DomCreateElement start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear DomCreateElement end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("dom-CreateElement")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("createElementText")
+ .onClick(() => {
+// dom.createElement('div')
+ })
+
+ }.width("100%").height("100%")
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ab5d5e0aecafb7a0f0fb480d66c0985bdba5521c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct EllipseNe {
+ @State w: string = "300.00px";
+ @State h: string = "300.00px";
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear EllipseNe start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear EllipseNe end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("ellipse-Ne")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+
+ Image($rawfile('test.png'))
+ .mask(new Ellipse({ width: '150px', height: '150px' }).fill(Color.Gray))
+ .width('500px').height('280px')
+
+ Ellipse().width(`${this.w}`).height(`${this.h}`).key('ellipse')
+ }.width('100%').height('100%')
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/featureAbility.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/featureAbility.ets
new file mode 100644
index 0000000000000000000000000000000000000000..750d4e41feb3c6e6010bf9690c14dc58ae07a919
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/featureAbility.ets
@@ -0,0 +1,266 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct FeatureAbilityStartAbility {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear FeatureAbilityStartAbility start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear FeatureAbilityStartAbility end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("featureAbility-StartAbility")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("startAbilityText")
+ .onClick(() => {
+ FeatureAbility.startAbility({
+ bundleName: "com.example.testapp",
+ abilityName: "com.example.testApp.MainAbility"
+ })
+ })
+
+ Text("featureAbility-StartAbilityForResult")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("startAbilityForResultText")
+ .onClick(() => {
+ FeatureAbility.startAbilityForResult({
+ bundleName: "com.example.testapp",
+ abilityName: "com.example.testApp.MainAbility" })
+ })
+
+ Text("featureAbility-FinishWithResult")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("finishWithResultText")
+ .onClick(() => {
+ FeatureAbility.finishWithResult({ code: 200, result: null })
+ })
+
+ Text("featureAbility-GetDeviceList")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("getDeviceListText")
+ .onClick(() => {
+ FeatureAbility.getDeviceList(1)
+ })
+
+ Text("featureAbility-CallAbility")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("callAbilityText")
+ .onClick(() => {
+ FeatureAbility.callAbility({
+ bundleName: "com.example.testapp",
+ abilityName: "com.example.testApp.MainAbility",
+ messageCode: 200,
+ abilityType: 1
+ })
+ })
+
+ Text("featureAbility-ContinueAbility")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("continueAbilityText")
+ .onClick(() => {
+ FeatureAbility.continueAbility()
+ })
+
+ Text("featureAbility-SubscribeAbilityEvent")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeAbilityEventText")
+ .onClick(() => {
+ FeatureAbility.subscribeAbilityEvent({
+ bundleName: "com.example.testapp",
+ abilityName: "com.example.testApp.MainAbility",
+ messageCode: 200,
+ abilityType: 1
+ }, () => {
+ })
+ })
+
+ Text("featureAbility-UnsubscribeAbilityEvent")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("unsubscribeAbilityEventText")
+ .onClick(() => {
+ FeatureAbility.unsubscribeAbilityEvent({
+ bundleName: "com.example.testapp",
+ abilityName: "com.example.testApp.MainAbility",
+ messageCode: 200,
+ abilityType: 1
+ })
+ })
+
+ Text("featureAbility-SendMsg")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("sendMsgText")
+ .onClick(() => {
+ FeatureAbility.sendMsg({
+ deviceId: '1001',
+ bundleName: "com.example.testapp",
+ abilityName: "com.example.testApp.MainAbility",
+ message: 'success',
+ success: () => {
+ Log.showInfo(TAG, `FeatureAbility.sendMsg success`)
+ },
+ fail: (data, code) => {
+ Log.showInfo(TAG, `FeatureAbility.sendMsg fail: data: ${data},code: ${code}`)
+ },
+ complete: () => {
+ Log.showInfo(TAG, `FeatureAbility.sendMsg complete`)
+ }
+ })
+ })
+
+ Text("featureAbility-SubscribeMsg")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeMsgText")
+ .onClick(() => {
+ FeatureAbility.subscribeMsg({
+ success: (data) => {
+ Log.showInfo(TAG, `FeatureAbility.subscribeMsg success: data: ${JSON.stringify(data)}`)
+ },
+ fail: (data, code) => {
+ Log.showInfo(TAG, `FeatureAbility.subscribeMsg fail: data: ${data},code: ${code}`)
+ }
+ })
+ })
+
+ Text("featureAbility-UnsubscribeMsg")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("unsubscribeMsgText")
+ .onClick(() => {
+ FeatureAbility.unsubscribeMsg()
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1fbe15140fe6844b86875686773d66ff66f7dbb8
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets
@@ -0,0 +1,277 @@
+/**
+ * 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 events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+struct FocusControlExample {
+ @State inputValue: string = ''
+ @State touchOnFocusName: string = 'OnTouchGrpBtn'
+ @State touchOnFocusName1: string = 'OnTouchBtn1'
+ @State touchOnFocusName2: string = 'OnTouchBtn2'
+ @State touchOnFocusName3: string = 'OnTouchBtn3'
+ @State touchOnFocusName4: string = 'OnTouchBtn4'
+
+ build() {
+ Scroll() {
+ Row({ space: 20 }) {
+ Column({ space: 20 }) {
+ Column({ space: 5 }) {
+ Button(this.touchOnFocusName)
+ .width(165)
+ .height(40)
+ .key('OnTouchGrpBtn')
+ .fontColor(Color.White)
+ .focusable(true)
+ .onFocus(() => {
+ try {
+ this.touchOnFocusName = 'Focus' + this.touchOnFocusName
+ console.info("onFocus value changed " + this.touchOnFocusName)
+ var eventData = {
+ data: {
+ "value": this.touchOnFocusName,
+ }
+ }
+ var event = {
+ eventId: 60232,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("OnTouchGrpBtn start to emit action state")
+ events_emitter.emit(event, eventData)
+ } catch (err) {
+ console.info("OnTouchGrpBtn emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .focusOnTouch(true) //该Button组件点击后可获焦
+ Row({ space: 5 }) {
+ Button(this.touchOnFocusName1)
+ .width(80)
+ .height(40)
+ .key('OnTouchBtn1')
+ .fontColor(Color.White)
+ .focusable(true)
+ .onFocus(() => {
+ try {
+ this.touchOnFocusName1 = 'Focus' + this.touchOnFocusName1
+ console.info("onFocus value changed " + this.touchOnFocusName1)
+ var eventData = {
+ data: {
+ "value": this.touchOnFocusName1,
+ }
+ }
+ var event = {
+ eventId: 60233,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("OnTouchBtn1 start to emit action state")
+ events_emitter.emit(event, eventData)
+ } catch (err) {
+ console.info("OnTouchBtn1 emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .focusOnTouch(true)
+ Button(this.touchOnFocusName2)
+ .width(80)
+ .height(40)
+ .key('OnTouchBtn2')
+ .fontColor(Color.White)
+ .focusable(true)
+ .onFocus(() => {
+ try {
+ this.touchOnFocusName2 = 'Focus' + this.touchOnFocusName2
+ console.info("onFocus value changed " + this.touchOnFocusName2)
+ var eventData = {
+ data: {
+ "value": this.touchOnFocusName2,
+ }
+ }
+ var event = {
+ eventId: 60234,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("OnTouchBtn2 start to emit action state")
+ events_emitter.emit(event, eventData)
+ } catch (err) {
+ console.info("OnTouchBtn2 emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .focusOnTouch(true) //该Button组件点击后可获焦
+ }
+ Row({ space: 5 }) {
+ Button(this.touchOnFocusName3)
+ .width(80)
+ .height(40)
+ .key('OnTouchBtn3')
+ .fontColor(Color.White)
+ .focusable(true)
+ .onFocus(() => {
+ this.touchOnFocusName3 = 'Focus' + this.touchOnFocusName3
+ console.info("onFocus value changed " + this.touchOnFocusName3)
+ })
+ .onClick(() => {
+ try {
+ var eventData = {
+ data: {
+ "value": this.touchOnFocusName3,
+ }
+ }
+ var event = {
+ eventId: 60235,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("OnTouchBtn3 start to emit action state")
+ events_emitter.emit(event, eventData)
+ } catch (err) {
+ console.info("OnTouchBtn3 emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Button(this.touchOnFocusName4)
+ .width(80)
+ .height(40)
+ .key('OnTouchBtn4')
+ .fontColor(Color.White)
+ .focusable(true)
+ .onFocus(() => {
+ this.touchOnFocusName4 = 'Focus' + this.touchOnFocusName4
+ console.info("onFocus value changed " + this.touchOnFocusName4)
+ })
+ .onClick(() => {
+ try {
+ console.info("onClick event " + this.touchOnFocusName4)
+ var eventData = {
+ data: {
+ "value": this.touchOnFocusName4,
+ }
+ }
+ var event = {
+ eventId: 60236,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("OnTouchBtn4 start to emit action state")
+ events_emitter.emit(event, eventData)
+ } catch (err) {
+ console.info("OnTouchBtn4 emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ }
+ }.borderWidth(2).borderColor(Color.Red).borderStyle(BorderStyle.Dashed)
+ .tabIndex(1) //该Column组件为按TAB键走焦的第一个获焦的组件
+ Column({ space: 5 }) {
+ Button('Group2')
+ .width(165)
+ .height(40)
+ .fontColor(Color.White)
+ Row({ space: 5 }) {
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ .groupDefaultFocus(true) //该Button组件上级Column组件获焦时获焦
+ }
+ Row({ space: 5 }) {
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ }
+ }.borderWidth(2).borderColor(Color.Green).borderStyle(BorderStyle.Dashed)
+ .tabIndex(2) //该Column组件为按TAB键走焦的第二个获焦的组件
+ }
+ Column({ space: 5 }) {
+ TextInput({placeholder: 'input', text: this.inputValue})
+ .onChange((value: string) => {
+ this.inputValue = value
+ })
+ .fontColor(Color.Blue)
+ .focusable(true)
+ .key('defaultFocusText')
+ .onFocus(() => {
+ try {
+ this.inputValue = 'defaultFocus'
+ console.info("onFocus value changed " + this.inputValue)
+ var eventData = {
+ data: {
+ "value": this.inputValue,
+ }
+ }
+ var event = {
+ eventId: 60237,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("defaultFocus test start to emit action start")
+ events_emitter.emit(event, eventData)
+ } catch (err) {
+ console.info("defaultFocus test emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .defaultFocus(true) //该TextInput组件为页面的初始默认焦点
+ Button('Group3')
+ .width(165)
+ .height(40)
+ .fontColor(Color.White)
+ Row({ space: 5 }) {
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ }
+ Button()
+ .width(165)
+ .height(40)
+ .fontColor(Color.White)
+ Row({ space: 5 }) {
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ }
+ Button()
+ .width(165)
+ .height(40)
+ .fontColor(Color.White)
+ Row({ space: 5 }) {
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ Button()
+ .width(80)
+ .height(40)
+ .fontColor(Color.White)
+ }
+ }.borderWidth(2).borderColor(Color.Orange).borderStyle(BorderStyle.Dashed)
+ .tabIndex(3) //该Column组件为按TAB键走焦的第三个获焦的组件
+ }.alignItems(VerticalAlign.Top)
+ }
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/form_component.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/form_component.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6b9b0a166f4f0defab64d79db1b48489650efdd6
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/form_component.ets
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+@Entry
+@Component
+struct Index {
+ @State formId: number = 0;
+ @State bundle: string = "com.form.formsystemtestservicea.hmservice";
+ @State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility";
+ @State moduleName: string = "entry";
+ @State name: string = "Form_Js001";
+ @State allowUpate: boolean = true;
+ @State isShowing: boolean = true;
+
+ private dimension: FormDimension = FormDimension.Dimension_1_2;
+
+ private deleteForm = false;
+ private deleteId = "-1";
+ private temporaryId="-1";
+ private temporary = false;
+ private castForm = false;
+
+ build() {
+ Column() {
+ Text('form component test begin')
+ Column() {
+ FormComponent({
+ id: this.formId,
+ name: this.name,
+ bundle: this.bundle,
+ ability: this.ability,
+ module: this.moduleName,
+ dimension: this.dimension,
+ temporary: this.temporary,
+ })
+ .allowUpdate(this.allowUpate)
+ .visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden)
+ .onUninstall((info) => {
+ console.log("[FormComponent] onUninstall:" + JSON.stringify(info));
+ })
+ .onError((error) => {
+ console.log("[FormComponent.host] error code:" + error.errcode);
+ console.log("[FormComponent.host] error msg:" + error.msg);
+ })
+ }
+ .backgroundColor(Color.White)
+ Text('form component test end')
+ }
+ .backgroundColor(Color.White)
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gauge.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gauge.ets
new file mode 100644
index 0000000000000000000000000000000000000000..244635ab655655e166661fda0b84131f30b3a48b
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gauge.ets
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct GaugeColors {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GaugeColors start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear GaugeColors end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("gauge-Colors")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("colorsText")
+ Gauge({ value: 50, min: 0, max: 100 })
+ .startAngle(210).endAngle(150)
+ .colors([[0x317AF7, 1], [0x5BA854, 1], [0xE08C3A, 1], [0x9C554B, 1], [0xD94838, 1]])
+ .strokeWidth(20)
+ .width(200).height(200)
+ .key("Gauge")
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gesture.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gesture.ets
new file mode 100644
index 0000000000000000000000000000000000000000..88b5ebdb228f85521b5eb9eb338a5e6fcac246e1
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gesture.ets
@@ -0,0 +1,180 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+export default
+struct GestureSetDirection {
+ @State offsetX: number = 10
+ @State offsetY: number = 10
+ @State directionV: PanDirection = PanDirection.Vertical
+ @State directionH: PanDirection = PanDirection.Horizontal
+ @State numberDistance: number = 5.0
+ @State numberFingers: number = 1
+ @State panDirection: PanDirection = PanDirection.Horizontal
+ panGesture: PanGestureOptions = new PanGestureOptions({direction:this.directionV, distance:10})
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GestureSetDirection start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear GestureSetDirection end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("gesture-SetDirection")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .gesture(
+ PanGesture({options: PanGestureOptions=> {
+ }})
+ .key('setDirectionPanGesture')
+ .onClick(()=>{
+ this.panDirection = PanDirection.Vertical
+ options.setDirection(this.panDirection)
+ try {
+ var backData = {
+ data: {
+ "STATUS": this.panDirection
+ }
+ }
+ let backEvent = {
+ eventId: 60204,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("setDirectionPanGesture onClick start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("setDirectionPanGesture onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ )
+ .key("setDirectionText")
+
+ Text("gesture-SetDistance")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .gesture(
+ PanGesture({options: PanGestureOptions=> {
+ }})
+ .key('setDistancePanGesture')
+ .onClick(()=>{
+ this.numberDistance = 4.0
+ options.setDistance(this.numberDistance)
+ try {
+ var backData = {
+ data: {
+ "STATUS": this.numberDistance
+ }
+ }
+ let backEvent = {
+ eventId: 60205,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onClick start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ )
+ .key("setDistanceText")
+
+ Text("gesture-SetFingers")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .gesture(
+ PanGesture({options: PanGestureOptions=> {
+ }})
+ .key('setFingersPanGesture')
+ .onClick(()=>{
+ this.numberFingers = 2
+ options.setFingers(this.numberFingers)
+ try {
+ var backData = {
+ data: {
+ "STATUS": this.numberFingers
+ }
+ }
+ let backEvent = {
+ eventId: 60206,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onClick start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ )
+ .key("setFingersText")
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
+ Text('PanGesture offset:\nX: ' + this.offsetX + '\n' + 'Y: ' + this.offsetY)
+ }
+ .key('panDirection').height(100).width(200).padding(20).border({ width: 1 }).margin(80)
+ .translate({ x: this.offsetX, y: this.offsetY, z: 5 })
+ .gesture(
+ PanGesture(this.panGesture)
+ .onActionStart((event: GestureEvent) => {
+ console.info('Pan start')
+ })
+ .onActionUpdate((event: GestureEvent) => {
+ this.offsetX = event.offsetX
+ this.offsetY = event.offsetY
+ })
+ .onActionEnd(() => {
+ console.info('Pan end')
+ this.panGesture.setDistance(10)
+ this.panGesture.setDirection(this.directionH)
+ this.panGesture.setFingers(1)
+ })
+ )
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/global.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/global.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ea6537e9e02501f52bd996fafcf74b06dbf3d007
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/global.ets
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct GlobalLack {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GlobalLack start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear GlobalLack end`)
+ }
+
+ build() {
+ Column() {
+ Button("Click2").fontSize(50)
+ .onClick(() => {
+ console.info("Click2" + JSON.stringify(sendEventByKey("Del", 10, "")));
+ }).key("Click2")
+ List({space:10}) {
+ ListItem() {
+ Text("Hello world") {
+ }
+ .width('100%')
+ .height(100)
+ .fontSize(16)
+ .textAlign(TextAlign.Center)
+ .borderRadius(10)
+ .backgroundColor(0xFFFFFF)
+ }
+ .key("ListItem")
+ .sticky(Sticky.None)
+ .selectable(false)
+ .editable(true)
+ }
+ }
+ .padding(10)
+ .backgroundColor(0xDCDCDC)
+ .width('100%')
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid.ets
new file mode 100644
index 0000000000000000000000000000000000000000..bf3fce866dbe7437c751c12d8d296ade1f3f5096
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid.ets
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct GridMaxCount {
+ @State Number: String[] = ['5', '6', '7', '8', '9']
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GridMaxCount start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear GridMaxCount end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("grid-MaxCount")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("maxCountText")
+
+
+ Column({ space: 5 }) {
+ Grid() {
+ ForEach(this.Number, (day: string) => {
+ ForEach(this.Number, (day: string) => {
+ GridItem() {
+ Text(day)
+ .fontSize(16)
+ .backgroundColor(0xF9CF93)
+ .width('100%')
+ .height('100%')
+ .textAlign(TextAlign.Center)
+ }
+ }, day => day)
+ }, day => day)
+ }
+ .columnsTemplate('1fr 1fr 1fr 1fr 1fr')
+ .rowsTemplate('1fr 1fr 1fr 1fr 1fr')
+ .columnsGap(10)
+ .rowsGap(10)
+ .width('90%')
+ .backgroundColor(0xFAEEE0)
+ .height(300)
+ .maxCount(5)
+ .key("maxCountTest")
+
+ }
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gridItem.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gridItem.ets
new file mode 100644
index 0000000000000000000000000000000000000000..bbbfd5e4fc06f48510fe28ed101cc2457f314a33
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/gridItem.ets
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+export default
+struct GridItemOnSelect {
+ @State Number: String[] = ['5', '6', '7', '8', '9']
+ @State isSelect: boolean = false;
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GridItemOnSelect start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear GridItemOnSelect end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("gridItem-OnSelect")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onSelectText")
+
+ Column({ space: 5 }) {
+ Grid() {
+ ForEach(this.Number, (day: string) => {
+ ForEach(this.Number, (day: string) => {
+ GridItem() {
+ Text(day)
+ .fontSize(16)
+ .backgroundColor(0xF9CF93)
+ .width('100%')
+ .height('100%')
+ .textAlign(TextAlign.Center)
+ .key("onSelected")
+ }.onSelect((isSelect)=>{
+ console.info("Select:" + isSelect)
+ //this.showToast("onSelect() " + index)
+ this.isSelect = true;
+ try {
+ var backData = {
+ data: {
+ "STATUS": this.isSelect
+ }
+ }
+ let backEvent = {
+ eventId: 60207,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onSelect start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onSelect emit action state err: " + JSON.stringify(err))
+ }
+ })
+ }, day => day)
+ }, day => day)
+ }
+ .columnsTemplate('1fr 1fr 1fr 1fr 1fr')
+ .rowsTemplate('1fr 1fr 1fr 1fr 1fr')
+ .columnsGap(10)
+ .rowsGap(10)
+ .width('90%')
+ .backgroundColor(0xFAEEE0)
+ .height(300)
+ }
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid_col.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid_col.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a0abac00e2aa9c30b13196a1308128688cfd319c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid_col.ets
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct Grid_colSpan {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear Grid_colSpan start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear Grid_colSpan end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("grid_col-Span")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("spanText")
+
+ Text("grid_col-Order")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("orderText")
+
+ GridCol({span: 10, offset:50, order: 10}){
+ }
+ .width(100)
+ .height(100)
+ .backgroundColor(0x308014)
+ .backgroundColor(0xf1f3f5)
+ .margin({ top: 10 })
+ .key('gridContainer')
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid_row.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid_row.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f472d6cf88bbcb58fa29ca469708d6144b822421
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/grid_row.ets
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct Grid_rowOnBreakpointChange {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear Grid_rowOnBreakpointChange start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear Grid_rowOnBreakpointChange end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("grid_row-OnBreakpointChange")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onBreakpointChangeText")
+
+ GridContainer({ sizeType: SizeType.SM }) {
+ GridRow({gutter: 10, columns:50, direction: GridRowDirection.Row}){
+ }
+ .key("GridRow")
+ .width(100)
+ .height(100)
+ .backgroundColor(0xFF0000)
+ .onBreakpointChange((breakpoints: string) => {
+ console.info("onBreakpointChange=" + breakpoints)
+ })
+ }
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fc877f9decc374f41c3d385625a05bf0fa497ff8
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+export default
+struct ImageExample {
+ build() {
+ Column() {
+ Column() {
+ Column() {
+ Image($rawfile('test.png'))
+ .width(240).height(240)
+ .colorFilter([1,2,3])
+ .overlay('colorFilter', { align: Alignment.Bottom, offset: { x: 0, y: -15 } })
+ }.border({ color: Color.Black, width: 2 })
+ }.width('100%')
+ }.padding({ top: 20 })
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/index.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..dacc1f3a5f8b033fbc33ba34afe0b354df16a45b
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+@Entry
+@Component
+struct MyComponent {
+ aboutToAppear() {
+ }
+
+ build() {
+ Flex({
+ direction: FlexDirection.Column,
+ alignItems: ItemAlign.Center,
+ justifyContent: FlexAlign.Center
+ }) {
+ Text('ace ApiLack ets test')
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets
new file mode 100644
index 0000000000000000000000000000000000000000..906244a7dab816c8473d22629ee7d0a3ceb78cb0
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets
@@ -0,0 +1,159 @@
+
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+export default
+struct Inspector {
+ @State message: string = 'test'
+ @State setColor:string = '#F9CF93'
+ @State catchStatus:string = "success"
+
+ onPageShow() {
+ console.info('[inspector] page show called');
+ var stateChangeEvent = {
+ eventId: 60211,
+ priority: events_emitter.EventPriority.LOW
+ }
+ events_emitter.on(stateChangeEvent, this.stateChangCallBack);
+ }
+
+ private stateChangCallBack = (eventData) => {
+ console.info("[inspector] page stateChangCallBack");
+ if (eventData != null) {
+ console.info("[inspector] page state change called:" + JSON.stringify(eventData));
+ if (eventData.data.setColor != null) {
+ this.setColor = eventData.data.setColor;
+ }
+ }
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("inspector")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+
+ Row() {
+ Column() {
+ Text(this.message)
+ .key("inspectorApiOne")
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ .onClick(()=> {
+ let getInspectorNodesObj = JSON.stringify(getInspectorNodes())
+ try {
+ var backData = {
+ data: {
+ "getInspectorNodes": getInspectorNodesObj,
+ "result":"success"
+ }
+ }
+ let backEvent = {
+ eventId: 60208,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("inspector_101 onClick start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("inspector_101 onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ Text("inspectorApiTwo")
+ .key("inspectorApiTwo")
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ .onClick(()=> {
+ try {
+ let i = JSON.parse(JSON.stringify(getInspectorNodes()))["inspectors"][0]["id"]
+ let getInspectorNodeByIdObj = JSON.stringify(getInspectorNodeById(parseInt(i)))
+ console.info("getInspectorNodeByIdObj is " + getInspectorNodeByIdObj)
+ var backData1 = {
+ data: {
+ "result": "success",
+ }
+ }
+ let backEvent1 = {
+ eventId: 60209,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("inspector_102 onClick start to emit action state")
+ events_emitter.emit(backEvent1, backData1)
+ } catch (err) {
+ console.info("inspector_102 onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text("inspectorApiThree")
+ .key("inspectorApiThree")
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ .onClick(()=> {
+ setAppBgColor('#F9CF93');
+ })
+
+ Text("inspectorApiFour")
+ .key("inspectorApiFour")
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ .onClick(()=> {
+ try{
+ Profiler.registerVsyncCallback((info: string) => {
+ console.info("VsyncCallback" + info)
+ });
+ Profiler.unregisterVsyncCallback();
+ this.catchStatus = "callBackSuccess"
+ }catch(err){
+ console.info("inspector_103 onClick err: " + JSON.stringify(err.message))
+ this.catchStatus = "callBackFail"
+ }
+ try {
+ var backData2 = {
+ data: {
+ "catchStatus": this.catchStatus,
+ }
+ }
+ let backEvent2 = {
+ eventId: 60210,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("inspector_103 onClick start to emit action state")
+ events_emitter.emit(backEvent2, backData2)
+ } catch (err) {
+ console.info("inspector_103 onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ }
+ .width('100%')
+ }
+ .height('100%')
+
+ }.width("100%").height("100%")
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3bd6d00859b6557f44423b5e9c256aaabd7a27b2
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
@@ -0,0 +1,386 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import Log from '../common/Log.ets';
+
+class BasicDataSource implements IDataSource {
+ private listeners: DataChangeListener[] = []
+
+ public totalCount(): number {
+ return 0
+ }
+ public getData(index: number): any {
+ return undefined
+ }
+
+ registerDataChangeListener(listener: DataChangeListener): void {
+ if (this.listeners.indexOf(listener) < 0) {
+ console.info('add listener')
+ this.listeners.push(listener)
+ }
+ }
+ unregisterDataChangeListener(listener: DataChangeListener): void {
+ const pos = this.listeners.indexOf(listener);
+ if (pos >= 0) {
+ console.info('remove listener')
+ this.listeners.splice(pos, 1)
+ }
+ }
+
+ notifyDataReload(): void {
+ this.listeners.forEach(listener => {
+ listener.onDataReloaded()
+ })
+ }
+ notifyDataAdd(index: number): void {
+ this.listeners.forEach(listener => {
+ listener.onDataAdd(index)
+ })
+ }
+ notifyDataChange(index: number): void {
+ this.listeners.forEach(listener => {
+ listener.onDataChange(index)
+ })
+ }
+ notifyDataDelete(index: number): void {
+ this.listeners.forEach(listener => {
+ listener.onDataDelete(index)
+ })
+ }
+ notifyDataMove(from: number, to: number): void {
+ this.listeners.forEach(listener => {
+ listener.onDataMove(from, to)
+ })
+ }
+}
+
+class MyDataSource extends BasicDataSource {
+ private dataArray: string[] = ['/path/image0', '/path/image1', '/path/image2', '/path/image3']
+
+ public totalCount(): number {
+ return this.dataArray.length
+ }
+ public getData(index: number): any {
+ return this.dataArray[index]
+ }
+
+ public addData(index: number, data: string): void {
+ this.dataArray.splice(index, 0, data)
+ var datatest=this.dataArray.length
+ console.info('lenghth = '+ datatest)
+ for(var i = 0; i index2){
+ var temp = this.dataArray[index1]
+ for(var i = index1 ; i > index2; i--){
+ this.dataArray[i] = this.dataArray[i-1]
+ }
+ this.dataArray[index2] = temp
+
+ for(var j = 0 ; j < this.dataArray.length ; j++){
+ console.info('after moving :' + this.dataArray[j])
+ }
+ }
+ this.notifyDataMove(index1,index2)
+ }
+
+ public popData(): void {
+ this.dataArray.pop()
+ this.notifyDataDelete(this.dataArray.length)
+ var datatest=this.dataArray.length
+ console.info('lenghth = '+ datatest)
+ for(var i = 0; i {
+ ListItem() {
+ Row() {
+ Image(item).width("30%").height(50)
+ Text(item).fontSize(20).margin({ left: 10 })
+ }.margin({ left: 10, right: 10 })
+ }
+ .key("listItemOne")
+ .onClick(() => {
+ try{
+ this.data.pushData('/path/image' + this.data.totalCount())
+ console.info("this.data.totalCount() is :" + this.data.totalCount())
+ }catch(err){
+ this.result_101 = false
+ console.info("LazyForEachOnDataAdd_101 onClick emit action err: " + JSON.stringify(err.message))
+ }
+
+ try {
+ var backData1 = {
+ data: {
+ "result1": this.result_101,
+ }
+ }
+ let backEvent1 = {
+ eventId: 60212,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("LazyForEachOnDataAdd_101 onClick start to emit action")
+ events_emitter.emit(backEvent1, backData1)
+ } catch (err) {
+ console.info("LazyForEachOnDataAdd_101 onClick emit action err: " + JSON.stringify(err.message))
+ }
+ })
+ }, item => item)
+ }
+
+ Text("lazyForEach-OnDataMove")
+ .width(300)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onDataMoveText")
+
+ List({ space: 3 }) {
+ LazyForEach(this.data, (item: string) => {
+ ListItem() {
+ Row() {
+ Image(item).width("30%").height(50)
+ Text(item).fontSize(20).margin({ left: 10 })
+ }.margin({ left: 10, right: 10 })
+ }
+ .key("listItemTwo")
+ .onClick(() => {
+ try{
+ this.data.moveData(3, 1)
+ }catch(err){
+ this.result_102 = false
+ console.info("LazyForEachOnDataAdd_102 onClick emit action err: " + JSON.stringify(err.message))
+ }
+
+ try {
+ var backData2 = {
+ data: {
+ "result2": this.result_102,
+ }
+ }
+ let backEvent2 = {
+ eventId: 60213,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("LazyForEachOnDataAdd_102 onClick start to emit action")
+ events_emitter.emit(backEvent2, backData2)
+ } catch (err) {
+ console.info("LazyForEachOnDataAdd_102 onClick emit action err: " + JSON.stringify(err.message))
+ }
+ })
+ }, item => item)
+ }
+
+ Text("lazyForEach-OnDataDelete")
+ .width(300)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onDataDeleteText")
+
+ List({ space: 3 }) {
+ LazyForEach(this.data, (item: string) => {
+ ListItem() {
+ Row() {
+ Image(item).width("30%").height(50)
+ Text(item).fontSize(20).margin({ left: 10 })
+ }.margin({ left: 10, right: 10 })
+ }
+ .key("listItemThree")
+ .onClick(() => {
+ try{
+ this.data.popData()
+ }catch(err){
+ this.result_103 = false
+ console.info("LazyForEachOnDataAdd_103 onClick emit action err: " + JSON.stringify(err.message))
+ }
+
+ try {
+ var backData3 = {
+ data: {
+ "result3": this.result_103,
+ }
+ }
+ let backEvent3 = {
+ eventId: 60214,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("LazyForEachOnDataAdd_103 onClick start to emit action")
+ events_emitter.emit(backEvent3, backData3)
+ } catch (err) {
+ console.info("LazyForEachOnDataAdd_103 onClick emit action err: " + JSON.stringify(err.message))
+ }
+
+ })
+ }, item => item)
+ }
+
+ Text("lazyForEach-OnDataChange")
+ .width(300)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onDataChangeText")
+
+ List({ space: 3 }) {
+ LazyForEach(this.data, (item: string) => {
+ ListItem() {
+ Row() {
+ Image(item).width("30%").height(50)
+ Text(item).fontSize(20).margin({ left: 10 })
+ }.margin({ left: 10, right: 10 })
+ }
+ .key("listItemFour")
+ .onClick(() => {
+ try{
+ this.data.changeData(2)
+ }catch(err){
+ this.result_104 = false
+ console.info("LazyForEachOnDataAdd_104 onClick emit action err: " + JSON.stringify(err.message))
+ }
+
+ try {
+ var backData4 = {
+ data: {
+ "result4": this.result_104,
+ }
+ }
+ let backEvent4 = {
+ eventId: 60215,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("LazyForEachOnDataAdd_104 onClick start to emit action")
+ events_emitter.emit(backEvent4, backData4)
+ } catch (err) {
+ console.info("LazyForEachOnDataAdd_104 onClick emit action err: " + JSON.stringify(err.message))
+ }
+ })
+ }, item => item)
+ }
+ }.width("100%").height("100%")
+ }
+ }
+ }
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/line.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/line.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0f29bf5f99cd068d1638564caa7e2c6580656bf4
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/line.ets
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+let my_line = new Line()
+
+@Entry
+@Component
+export default
+struct LineNe {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear LineNe start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear LineNe end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("line-Ne")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+ Line({ width: 50, height: 100 }).startPoint([0, 0]).endPoint([50, 100]).key("line1")
+ Line().width(200).height(200).startPoint([50, 50]).endPoint([150, 400]).key("line2")
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f33a87cfdd26751f645982bb905c3939a37ff6da
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets
@@ -0,0 +1,163 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+export default
+struct ListLanes {
+ private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ @State listPosition: number = 0 // 0代表滚动到List顶部,1代表中间值,2代表滚动到List底
+ private scroller: Scroller = new Scroller()
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear ListLanes start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear ListLanes end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("list-Lanes")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("lanesText")
+
+ Text("list-AlignListItem")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("alignListItemText")
+
+ Text("list-OnScrollBegin")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onScrollBeginText")
+
+ Stack({ alignContent: Alignment.TopStart }) {
+ Scroll(this.scroller) {
+ List({ space: 20, initialIndex: 0 }) {
+ ForEach(this.arr, (item) => {
+ ListItem() {
+ Text('' + item)
+ .width('100%')
+ .height(100)
+ .fontSize(18)
+
+ }
+ .border({ width: 2, color: Color.Green })
+ }, item => item)
+ }
+ .key("list1")
+ .height(300)
+ .width("90%")
+ .editMode(true)
+ .alignListItem(ListItemAlign.Start)
+ .border({ width: 3, color: Color.Red })
+ .lanes({ minLength: 40, maxLength: 60 })
+ .onScrollBegin((dx: number, dy: number) => {
+ if ((this.listPosition == 0 && dy >= 0) || (this.listPosition == 2 && dy <= 0)) {
+ this.scroller.scrollBy(0, -dy)
+ return { dxRemain: dx, dyRemain: 0 }
+ }
+ this.listPosition = 1;
+ return { dxRemain: dx, dyRemain: dy }
+
+ try {
+ var backData = {
+ data: {
+ "result":"success"
+ }
+ }
+ let backEvent = {
+ eventId: 60216,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onScrollBegin onClick start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onScrollBegin onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ }
+ .scrollable(ScrollDirection.Vertical)
+ .scrollBar(BarState.On)
+ .scrollBarColor(Color.Gray)
+ .scrollBarWidth(30)
+ .onScroll((xOffset: number, yOffset: number) => {
+ console.info(xOffset + ' ' + yOffset)
+ })
+ .onScrollEdge((side: Edge) => {
+ console.info('To the edge')
+ })
+ .onScrollEnd(() => {
+ console.info('Scroll Stop')
+ })
+
+ Button('scroll 100')
+
+ .onClick(() => { // 点击后下滑100.0距离
+ this.scroller.scrollTo({ xOffset: 0, yOffset: this.scroller.currentOffset().yOffset + 100 })
+ })
+ .margin({ top: 10, left: 20 })
+ Button('back top')
+ .onClick(() => { // 点击后回到顶部
+ this.scroller.scrollEdge(Edge.Top)
+ })
+ .margin({ top: 60, left: 20 })
+ Button('next page')
+ .key("onScrollBegin")
+ .onClick(() => { // 点击后下滑到底部
+ this.scroller.scrollPage({ next: true })
+ })
+ .margin({ top: 110, left: 20 })
+ }.width('100%').height('100%').backgroundColor(0xDCDCDC)
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list_item.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list_item.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e6c3fc94a0039f83736dcda0f072a2612705a67c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list_item.ets
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+export default
+struct List_itemOnSelect {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear List_itemOnSelect start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear List_itemOnSelect end`)
+ }
+
+ @Builder itemEnd() {
+ Row () {
+ Button("Del").margin("4vp").key("Del")
+ Button("Set").margin("4vp").key("Set")
+ }.padding("4vp").justifyContent(FlexAlign.SpaceEvenly)
+ }
+
+ build() {
+ Column() {
+ Button("Click2").fontSize(50)
+ .onClick(() => {
+ console.info("Click2" + JSON.stringify(sendEventByKey("Del", 10, "")));
+ }).key("Click2")
+ List({space:10}) {
+ ListItem() {
+ Text("Hello world") {
+ }
+ .width('100%')
+ .height(100)
+ .fontSize(16)
+ .textAlign(TextAlign.Center)
+ .borderRadius(10)
+ .backgroundColor(0xFFFFFF)
+ }
+ .key("ListItem")
+ .sticky(Sticky.None)
+ .selectable(false)
+ .editable(true)
+ .swipeAction({ end:this.itemEnd})
+ }
+ }
+ .padding(10)
+ .backgroundColor(0xDCDCDC)
+ .width('100%')
+ .height('100%')
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/mediaQuery.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/mediaQuery.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f05a02d0f56a0cd2c5ad3910beea58ce19d7324d
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/mediaQuery.ets
@@ -0,0 +1,137 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+import mediaquery from '@ohos.mediaquery'
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct MediaQueryOff {
+ @State color: string = '#000'
+ @State text: string = 'Test'
+ listener = mediaquery.matchMediaSync('(orientation: landscape)')
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear MediaQueryOff start`)
+ this.listener.on('change', (mediaQueryResult) => {
+ if (mediaQueryResult.matches) {
+ this.color = '#FFD700'
+ this.text = 'Landscape'
+ } else {
+ this.color = '#DB7093'
+ this.text = 'Portrait'
+ }
+ })
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear MediaQueryOff end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+
+ Text("mediaQuery-Off")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("offText")
+ .onClick(() => {
+ this.listener.off('change', (mediaQueryResult) => {
+ console.log(JSON.stringify(mediaQueryResult))
+ var result=true
+ try {
+ var backData = {
+ data: {
+ "STATUS": result
+ }
+ }
+ let backEvent = {
+ eventId: 60218,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onSelect start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onSelect emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ })
+
+ Text("mediaQuery-MatchMediaSync")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("matchMediaSyncText")
+ .onClick(() => {
+ console.log('mediaQuery-MatchMediaSync: ' + JSON.stringify(this.listener))
+ var result=(this.listener!=null)
+ try {
+ var backData = {
+ data: {
+ "STATUS": result
+ }
+ }
+ let backEvent = {
+ eventId: 60219,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onSelect start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onSelect emit action state err: " + JSON.stringify(err.message))
+ }
+
+ })
+
+ Text(this.text)
+ .fontSize(50)
+ .fontColor(this.color)
+ // .width(100)
+ // .height(70)
+ // .fontSize(20)
+ // .opacity(1)
+ // .align(Alignment.TopStart)
+ // .fontColor(0xCCCCCC)
+ // .lineHeight(25)
+ // .border({ width: 1 })
+ // .padding(10)
+ // .textAlign(TextAlign.Center)
+ // .textOverflow({ overflow: TextOverflow.None })
+ // .key("offText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ecd76d5e343d6a8db4ecc41c851789b1ae7b54f2
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct NavigatorTarget {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear NavigatorTarget start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear NavigatorTarget end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("navigator-Target")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("targetText")
+
+ Navigator({ target: '', type: NavigationType.Push }) {
+ Text('Go to target page')
+ .width('100%').textAlign(TextAlign.Center)
+ }.params({ text: 'target' }).target('pages/index')
+ .key("Navigator")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/onVisibleAreaChange.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/onVisibleAreaChange.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0dfdcd6ccc8ed12a0aaa8518fa4c0b3ccdba1952
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/onVisibleAreaChange.ets
@@ -0,0 +1,109 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 ScrollExample {
+ scroller: Scroller = new Scroller()
+ private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ @State testTextStr: string = "test"
+ @State testRowStr: string = "test"
+
+ build() {
+ Column() {
+ Column() {
+ Text(this.testTextStr)
+ .fontSize(20)
+
+ Text(this.testRowStr)
+ .fontSize(20)
+ }
+ .height(100)
+ .backgroundColor(Color.Gray)
+ .opacity(0.3)
+
+ Scroll(this.scroller) {
+ Column() {
+ Text("Test Text Visible Change")
+ .fontSize(20)
+ .height(200)
+ .margin({ top: 50, bottom: 20 })
+ .backgroundColor(Color.Green)
+ // 通过设置ratios为[0.0, 1.0],实现当组件完全显示或完全消失在屏幕中时触发回调
+ .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
+ console.info("Test Text isVisible: " + isVisible + ", currentRatio:" + currentRatio)
+ if (isVisible && currentRatio >= 1.0) {
+ console.info("Test Text is fully visible. currentRatio:" + currentRatio)
+ this.testTextStr = "Test Text is fully visible"
+ }
+
+ if (!isVisible && currentRatio <= 0.0) {
+ console.info("Test Text is completely invisible.")
+ this.testTextStr = "Test Text is completely invisible"
+ }
+ })
+
+ Row() {
+ Text("Test Row Visible Change")
+ .fontSize(20)
+ .margin({ bottom: 20 })
+
+ }
+ .height(200)
+ .backgroundColor(Color.Yellow)
+ .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
+ console.info("Test Row isVisible:" + isVisible + ", currentRatio:" + currentRatio)
+ if (isVisible && currentRatio >= 1.0) {
+ console.info("Test Row is fully visible.")
+ this.testRowStr = "Test Row is fully visible"
+ }
+
+ if (!isVisible && currentRatio <= 0.0) {
+ console.info("Test Row is is completely invisible.")
+ this.testRowStr = "Test Row is is completely invisible"
+ }
+ })
+
+ ForEach(this.arr, (item) => {
+ Text(item.toString())
+ .width('90%')
+ .height(150)
+ .backgroundColor(0xFFFFFF)
+ .borderRadius(15)
+ .fontSize(16)
+ .textAlign(TextAlign.Center)
+ .margin({ top: 10 })
+ }, item => item)
+
+ }.width('100%')
+ }
+ .backgroundColor(0x317aff)
+ .scrollable(ScrollDirection.Vertical)
+ .scrollBar(BarState.On)
+ .scrollBarColor(Color.Gray)
+ .scrollBarWidth(30)
+ .onScroll((xOffset: number, yOffset: number) => {
+ console.info(xOffset + ' ' + yOffset)
+ })
+ .onScrollEdge((side: Edge) => {
+ console.info('To the edge')
+ })
+ .onScrollEnd(() => {
+ console.info('Scroll Stop')
+ })
+
+ }.width('100%').height('100%').backgroundColor(0xDCDCDC)
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/page1.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/page1.ets
new file mode 100644
index 0000000000000000000000000000000000000000..99bf8452dfb3b8f11e759a755ec58628b0590f05
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/page1.ets
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 AExample {
+ @State scale2: number = 1
+ @State opacity2: number = 1
+
+ build() {
+ Column() {
+ Navigator({ target: 'pages/page_transition' ,type: NavigationType.Push}) {
+ Image($r('app.media.icon')).width("100%").height("100%")
+ }
+ }.height("100%").width("100%").scale({ x: this.scale2 }).opacity(this.opacity2)
+ }
+ // 自定义方式1:完全自定义转场过程的效果
+ pageTransition() {
+ PageTransitionEnter({ duration: 1200, curve: Curve.Linear })
+ .onEnter((type: RouteType, progress: number) => {
+ this.scale2 = 1
+ this.opacity2 = progress
+ }) // 进场过程中会逐帧触发onEnter回调,入参为动效的归一化进度(0% -- 100%)
+ PageTransitionExit({ duration: 1500, curve: Curve.Ease })
+ .onExit((type: RouteType, progress: number) => {
+ this.scale2 = 1 - progress
+ this.opacity2 = 1
+ }) // 退场过程中会逐帧触发onExit回调,入参为动效的归一化进度(0% -- 100%)
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pageRoute.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pageRoute.ets
new file mode 100644
index 0000000000000000000000000000000000000000..50200e32378ead284ad1f941c84e0feb37883da0
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pageRoute.ets
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+struct PageRouteExample {
+ @State private angle:number = 1;
+ @State private imageSize:number = 2;
+ @State private speed:number = 5;
+ @State private interval:number = 0;
+ @State private state:string = '';
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center })
+ {
+ Image($rawfile('test.png'))
+ .width(100).height(100).objectFit(ImageFit.Contain)
+ .margin({top:50,bottom:150,right:10})
+ .rotate({ x: 0, y: 0, z: 2, angle:this.angle}) // 组件以(1,1,1)为旋转轴,中心点顺时针旋转 300度
+ .scale({ x: this.imageSize, y: this.imageSize })
+ Text('speed '+ this.speed)
+ .fontSize(20).fontWeight(FontWeight.Bold)
+ Slider({
+ value: this.speed,
+ min: 1,
+ max: 50,
+ step: 1,
+ style: SliderStyle.OutSet
+ })
+ .blockColor(Color.Orange)
+ .onChange((value: number) => {
+ this.speed = value
+ })
+ Button('Next', { type: ButtonType.Capsule, stateEffect: true })
+ .backgroundColor(0x317aff)
+ .width(90)
+ .key('next')
+ .onClick(() => {
+ console.info('to next page')
+ router.push({
+ uri:'pages/index'
+ })
+ })
+ }
+ .width('100%')
+ .height('100%')
+ }
+ speedChange(){
+ var that = this
+ this.interval = setInterval(function(){
+ that.angle += that.speed
+ },15)
+ }
+
+ onPageHide() {
+ console.info('current page will be hidden, value changed')
+ this.state = 'onPageHide'
+ try {
+ var eventData = {
+ data: {
+ "value": this.state,
+ }
+ }
+ var event = {
+ eventId: 10,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("page start to emit action state")
+ events_emitter.emit(event, eventData)
+ } catch(err) {
+ console.info("page emit action state err: " + JSON.stringify(err.message))
+ }
+ }
+
+ onPageShow(){
+ this.speedChange()
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/page_transition.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/page_transition.ets
new file mode 100644
index 0000000000000000000000000000000000000000..052cbf8eaf38ee477e94737ffe37d6afc14540c3
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/page_transition.ets
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 PageTransitionExample1 {
+ @State scale1: number = 1
+ @State opacity1: number = 1
+
+ build() {
+ Column() {
+ Navigator({ target: 'pages/page1', type: NavigationType.Push }) {
+ Image($r('app.media.icon')).width("100%").height("100%")
+ }
+ }.scale({ x: this.scale1 }).opacity(this.opacity1)
+ }
+
+ pageTransition() {
+ PageTransitionEnter({ duration: 1200, curve: Curve.Linear })
+ .onEnter((type: RouteType, progress: number) => {
+ this.scale1 = 1
+ this.opacity1 = progress
+ })
+ PageTransitionExit({ duration: 1500, curve: Curve.Ease })
+ .onExit((type: RouteType, progress: number) => {
+ this.scale1 = 1 - progress
+ this.opacity1 = 1
+ })
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/panel.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/panel.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4aeb79f585041843fcd5bae2b53144541a6c8033
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/panel.ets
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct PanelBackgroundMask {
+ @State mode: PanelMode = PanelMode.Full
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear PanelBackgroundMask start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear PanelBackgroundMask end`)
+ }
+
+ build() {
+ Column() {
+
+ Text("panel-OnHeightChange")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onHeightChangeText")
+ .onClick(() => {
+ this.mode = PanelMode.Half
+ })
+
+ Panel(true) {
+ Column() {
+ Text("panel-BackgroundMask").fontSize(30)
+ }
+ }
+ .key("panel")
+ .mode(this.mode)
+ .backgroundColor('green')
+ .type(PanelType.Foldable)
+ .dragBar(false)
+ .halfHeight(300)
+ .onChange((width: number, height: number, mode: PanelMode) => {
+ Log.showInfo(TAG, `width:${width},height:${height},mode:${mode}`)
+ })
+ .backgroundMask('red')
+ .onHeightChange((value: number) => {
+ Log.showInfo(TAG, 'onHeightChange: ' + value)
+ try {
+ var backData = {
+ data: {
+ "result":"success"
+ }
+ }
+ let backEvent = {
+ eventId: 10111,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onHeightChange start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("testpanelOnHeightChange0002 emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ }.width("100%").height("100%")
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/path.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/path.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2282bc2c1bab80fe8b63e1a4cc87104da1575494
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/path.ets
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct PathNew {
+ private path: any = new Path({
+ width: 100,
+ height: 100,
+ commands: 'M150 0 L300 300 L0 300 Z'
+ })
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear PathNew start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear PathNew end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("path-New")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+
+ Path().width("100px").height("100px").commands('M150 0 L300 300 L0 300 Z')
+ .key("Path")
+
+ Image($rawfile('test.png'))
+ .mask(new Path({ width: '150px', height: '150px' }).fill(Color.Gray))
+ .width('500px').height('280px')
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pluginComponent.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pluginComponent.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e1310d6f783df35ccad68be0204f2764013ac9d6
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pluginComponent.ets
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 plugin from "../common/plugin_component.js"
+
+@Entry
+@Component
+struct PluginUserExample {
+ @StorageLink("plugincount") plugincount: Object[] = [
+ { source: 'plugincomponent1', ability: 'com.example.plugin' },
+ { source: 'plugintemplate', ability: 'com.example.myapplication' },
+ { source: 'plugintemplate', ability: 'com.example.myapplication' }]
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Text('Hello World')
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Button('Register Request Listener')
+ .fontSize(30)
+ .width(400)
+ .height(100)
+ .margin({top:20})
+ .onClick(()=>{
+ plugin.onListener()
+ console.log("Button('Register Request Listener')")
+ })
+ Button('Request')
+ .fontSize(50)
+ .width(400)
+ .height(100)
+ .margin({ top: 20 })
+ .onClick(() => {
+ plugin.Request()
+ console.log("Button('Request')")
+ })
+ ForEach(this.plugincount, item => {
+ PluginComponent({
+ template: { source: 'plugincomponent1', ability: 'com.example.plugin' },
+ data: { 'countDownStartValue': 'new countDownStartValue' }
+ }).size({ width: 500, height: 100 })
+ .onComplete(() => {
+ console.log("onComplete")
+ })
+ .onError(({errcode, msg}) => {
+ console.log("onComplete" + errcode + ":" + msg)
+ })
+ })
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/polyLine.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/polyLine.ets
new file mode 100644
index 0000000000000000000000000000000000000000..db719f67eddf09465b666047c84ad8d082f27bd4
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/polyLine.ets
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct PolyLineNe {
+ private polyline: PolylineAttribute = new Polyline({
+ width: 100,
+ height: 100
+ })
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear PolyLineNe start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear PolyLineNe end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("polyLine-Ne")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+
+ Polyline().width("100px").height("100px").points([[0, 0], [0, 100], [100, 100]])
+ .key("Polyline")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/polygon.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/polygon.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f0beb3aba6e3e691c89cf252dbc76a6285ae1268
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/polygon.ets
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct PolygonNe {
+ private polygon: PolygonAttribute = new Polygon({
+ width: 100,
+ height: 100
+ })
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear PolygonNe start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear PolygonNe end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("polygon-Ne")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+
+ Polygon({ width: "100px", height: "100px" }).points([[0, 0], [50, 100], [100, 0]])
+ .key("Polygon")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets
new file mode 100644
index 0000000000000000000000000000000000000000..95598b3857b61d01ba0979967caf584e923534d8
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct ProgressStyle {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear ProgressStyle start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear ProgressStyle end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("progress-Style")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("styleText")
+ Row({ space: 40 }) {
+ Progress({ value: 20, total: 150, type: ProgressType.Ring })
+ .color(Color.Green).value(50).width(100)
+ .style({ strokeWidth: 20, scaleCount: 30, scaleWidth: 20 })
+ .key("Progress")
+ }
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/prompt.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/prompt.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e54b80ab6c2fb1ea661ae0c8fd88aa13fef96ffc
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/prompt.ets
@@ -0,0 +1,100 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 prompt from '@ohos.prompt'
+import Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct PromptShowDialog {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear PromptShowDialog start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear PromptShowDialog end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("prompt-ShowDialog")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("showDialogText")
+ .onClick(() => {
+ try {
+ var backData = {
+ data: {
+ "STATUS": true
+ }
+ }
+ let backEvent = {
+ eventId: 60220,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("showDialog start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("showDialog emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text("prompt-ShowActionMenu")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("showActionMenuText")
+ .onClick(() => {
+ try {
+ var backData1 = {
+ data: {
+ "STATUS": true
+ }
+ }
+ let backEvent1 = {
+ eventId: 60221,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("showActionMenu start to emit action state")
+ events_emitter.emit(backEvent1, backData1)
+ } catch (err) {
+ console.info("showActionMenu emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/promptApi.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/promptApi.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6326cb1218d942d3e012a56ccd1dbdb44b0b6fdb
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/promptApi.ets
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 prompt from '@ohos.prompt'
+import Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct PromptShowDialog {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear PromptShowDialog start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear PromptShowDialog end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("prompt-ShowDialog")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .onClick(() => {
+ prompt.showDialog({
+ title: 'Title Info',
+ message: 'Message Info',
+ buttons: [
+ { text: 'button1', color: 'red' },
+ { text: 'button2', color: 'blue' }
+ ]
+ }).then(data => {
+ console.info('showDialog success, click button: ' + data.index)
+ }).catch(err => {
+ console.info('showDialog error: ' + err)
+ })
+ })
+
+ Text("prompt-ShowActionMenu")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .onClick(() => {
+ prompt.showActionMenu({
+ title: 'Title Info',
+ buttons: [
+ { text: 'item1', color: '#666666' },
+ { text: 'item2', color: '#000000' }
+ ]
+ }).then(data => {
+ var result=true
+ console.info('showDialog success, click button: ' + data.index)
+ }).catch(err => {
+ console.info('showDialog error: ' + err)
+ })
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/rect.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/rect.ets
new file mode 100644
index 0000000000000000000000000000000000000000..714e1765c8591458752ca63c649024a424303788
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/rect.ets
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct RectNe {
+ private rect: RectAttribute = new Rect({
+ width: '90%',
+ height: 50,
+ radiusHeight: 20,
+ radiusWidth: 20
+ })
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear RectNe start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear RectNe end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("rect-Ne")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+
+ Rect({ width: '90%', height: "50px" }).radiusHeight(20).radiusWidth(20)
+ .key("Rect")
+
+ Image($rawfile('test.png'))
+ .mask(new Rect({ width: '150px', height: '150px' }).fill(Color.Gray))
+ .width('500px').height('280px')
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/router.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/router.ets
new file mode 100644
index 0000000000000000000000000000000000000000..dbde00df9c1df3c54ed475e240a9a1816d42ef83
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/router.ets
@@ -0,0 +1,121 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import router1 from '@ohos.router'
+import router2 from '@system.router'
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct RouterEnableAlertBeforeBackPage {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear RouterEnableAlertBeforeBackPage start`)
+
+ router1.enableAlertBeforeBackPage({
+ message: 'Message Info'
+ })
+
+ router2.enableAlertBeforeBackPage({
+ message: 'Message Info',
+ success: function () {
+ console.log('success')
+ },
+ cancel: function () {
+ console.log('fail')
+ },
+ })
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear RouterEnableAlertBeforeBackPage end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("ohos-router-EnableAlertBeforeBackPage")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("enableAlertBeforeBackPageText")
+ .onClick(() => {
+ router1.back()
+ })
+
+ Text("router-DisableAlertBeforeBackPage")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("disableAlertBeforeBackPageText")
+ .onClick(() => {
+ router1.disableAlertBeforeBackPage()
+ })
+
+ Text("router-EnableAlertBeforeBackPage")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("enableAlertBeforeBackPageText1")
+ .onClick(() => {
+ router2.back()
+ })
+
+ Text("router-DisableAlertBeforeBackPage")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("disableAlertBeforeBackPageText")
+ .onClick(() => {
+ router2.disableAlertBeforeBackPage()
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/scroll.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/scroll.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8d997149f226eb3d3c3724a1b97c55c1adabf4fa
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/scroll.ets
@@ -0,0 +1,87 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct ScrollOnScrollBegin {
+ scroller: Scroller = new Scroller()
+ private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear ScrollOnScrollBegin start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear ScrollOnScrollBegin end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("scroll-OnScrollBegin")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onScrollBeginText")
+ Scroll(this.scroller) {
+ Column() {
+ ForEach(this.arr, (item) => {
+ Text(item.toString())
+ .width('90%')
+ .height(150)
+ .backgroundColor(0xFFFFFF)
+ .borderRadius(15)
+ .fontSize(16)
+ .textAlign(TextAlign.Center)
+ .margin({ top: 10 })
+ }, item => item)
+ }.width('100%')
+ }
+ .scrollable(ScrollDirection.Vertical)
+ .onScrollBegin((dx: number, dy: number) => {
+ console.info('dx=' + dx + ",dy=" + dy)
+ return { dxRemain: dx, dyRemain: dy }
+ })
+ .scrollBar(BarState.On)
+ .scrollBarColor(Color.Gray)
+ .scrollBarWidth(30)
+ .onScroll((xOffset: number, yOffset: number) => {
+ console.info(xOffset + ' ' + yOffset)
+ })
+ .onScrollEdge((side: Edge) => {
+ console.info('To the edge')
+ })
+ .onScrollEnd(() => {
+ console.info('Scroll Stop')
+ })
+ .key("Scroll")
+ .width("100%")
+ .height("100%")
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e2a8045741bba287449289db4037d9483fe095ca
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets
@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct SearchOnCut {
+ controller: SearchController = new SearchController()
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear SearchOnCut start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear SearchOnCut end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("search-OnCut")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onCutText")
+
+ Search({ value: '', placeholder: 'search-OnCut', controller: this.controller })
+ .searchButton('Search')
+ .textFont({ size: 20 })
+ .placeholderFont({ size: 20 })
+ .onCut((value: string) => {
+ console.log('onCut: ' + value)
+ })
+ .key("OnCut")
+
+ Text("search-OnPaste")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onPasteText")
+
+ Search({ value: '', placeholder: 'search-OnPaste', controller: this.controller })
+ .searchButton('Search')
+ .textFont({ size: 20 })
+ .placeholderFont({ size: 20 })
+ .onPaste((value: string) => {
+ console.log('onPaste: ' + value)
+ })
+ .key("OnPaste")
+
+ Text("search-CopyOption")
+ .width(320)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("copyOptionText")
+
+ Search({ value: '', placeholder: 'search-CopyOption', controller: this.controller })
+ .searchButton('Search')
+ .textFont({ size: 20 })
+ .placeholderFont({ size: 20 })
+ .key("CopyOption")
+
+ }.width("100%").height("100%")
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/select.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/select.ets
new file mode 100644
index 0000000000000000000000000000000000000000..56acfb074570b795801454fbd6af6be5f622a282
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/select.ets
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+import events_emitter from '@ohos.events.emitter';
+
+@Entry
+@Component
+export default
+struct SelectOnSelect {
+ @State selectIndex:number = 1
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear SelectOnSelect start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear SelectOnSelect end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+ Column() {
+ Select([{value:'aaa',icon: "/common/1.png"},
+ {value:'bbb',icon: "/common/2.png"},
+ {value:'ccc',icon: "/common/3.png"},
+ {value:'ddd',icon: "/common/4.png"}])
+ .key("Select")
+ .selected(2)
+ .value('TTT')
+ .font({size: 30, weight:400, family: 'serif', style: FontStyle.Normal })
+ .selectedOptionFont({size: 40, weight: 500, family: 'serif', style: FontStyle.Normal })
+ .optionFont({size: 30, weight: 400, family: 'serif', style: FontStyle.Normal })
+ .onSelect((index:number)=>{
+ console.info("Select:" + index)
+ this.selectIndex = index
+ try {
+ var backData = {
+ data: {
+ "selectIndex": this.selectIndex
+ }
+ }
+ let backEvent = {
+ eventId: 60222,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("SelectOnSelect start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("SelectOnSelect emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ }
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/shape.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/shape.ets
new file mode 100644
index 0000000000000000000000000000000000000000..52e516025c1c19020e37f77047b1493b2d366c01
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/shape.ets
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+let my_shape = new Shape()
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct ShapeNe {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear ShapeNe start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear ShapeNe end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("shape-Ne")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("neText")
+
+ Shape() {
+ Path().width(300).height(10).commands('M0 0 L900 0')
+ }
+ .viewPort({ x: 0, y: -5, width: 300, height: 20 })
+ .stroke(0xEE8443).strokeWidth(10).strokeDashArray([20]).strokeDashOffset(10)
+
+ Shape() {
+ Path().width(300).height(10).commands('M0 0 L900 0')
+ }.viewPort({ x: 0, y: -5, width: 300, height: 20 }).stroke(0xEE8443).strokeWidth(10).strokeOpacity(0.5)
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/sideBar.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/sideBar.ets
new file mode 100644
index 0000000000000000000000000000000000000000..10fb672b2d215452cbb39f6bbfaad774228cc9d5
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/sideBar.ets
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct SideBarShowSideBar {
+ normalIcon : Resource = $r("app.media.user")
+ selectedIcon: Resource = $r("app.media.userFull")
+ @State arr: number[] = [1, 2, 3]
+ @State current: number = 1
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear SideBarShowSideBar start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear SideBarShowSideBar end`)
+ }
+
+ build() {
+ SideBarContainer(SideBarContainerType.Embed)
+ {
+ Column() {
+ ForEach(this.arr, (item, index) => {
+ Column({ space: 5 }) {
+ Image(this.current === item ? this.selectedIcon : this.normalIcon).width(64).height(64)
+ Text("Index0" + item)
+ .fontSize(25)
+ .fontColor(this.current === item ? '#0A59F7' : '#999')
+ .fontFamily('source-sans-pro,cursive,sans-serif')
+ }
+ .onClick(() => {
+ this.current = item
+ })
+ }, item => item)
+ }.width('100%')
+ .justifyContent(FlexAlign.SpaceEvenly)
+ .backgroundColor('#19000000')
+ RowSplit() {
+ Column(){
+ Text('Split page one').fontSize(30)
+ }.justifyContent(FlexAlign.Center)
+ Column(){
+ Text('Split page two').fontSize(30)
+ }.justifyContent(FlexAlign.Center)
+ }.width('100%')
+ }
+ .key("SideBarContainer")
+ .showSideBar(true)
+ .autoHide(false)
+ .sideBarWidth(240)
+ .sideBarPosition(SideBarPosition.End)
+ .minSideBarWidth(210)
+ .maxSideBarWidth(260)
+ .onChange((value: boolean) => {
+ console.info('status:' + value)
+ })
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/stack.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/stack.ets
new file mode 100644
index 0000000000000000000000000000000000000000..bfe6cdef09caa5b798c1382691b45bdd93c793cf
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/stack.ets
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct StackAlignContent {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear StackAlignContent start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear StackAlignContent end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("stack-AlignContent")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("alignContentText")
+
+
+ Stack({ alignContent: Alignment.Bottom }) {
+ Text('First child, show in bottom')
+ .width('95%')
+ .width('90%')
+ .height('100%')
+ .backgroundColor(0xd2cab3)
+ .align(Alignment.Top)
+ Text('Second child, show in top')
+ .width('70%')
+ .height('60%')
+ .backgroundColor(0xc1cbac)
+ .align(Alignment.Top)
+ }.key("Stack")
+ .width('100%').height(150).margin({ top: 5 })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/stateManagement.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/stateManagement.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1c1a29d6434186aaf6394f91c4ee0a2e5635d777
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/stateManagement.ets
@@ -0,0 +1,138 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+import events_emitter from '@ohos.events.emitter';
+
+let storage1 = LocalStorage.GetShared()
+let storage2 = new LocalStorage({"PropA":47});
+
+@Entry(storage1)
+@Component
+export default
+struct StateManagementGetShared {
+ @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear StateManagementGetShared start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear StateManagementGetShared end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text(`Parent from LocalStorage ${ this.simpleVarName }`)
+ .key("GetSharedText")
+ .onClick(()=>{
+ try {
+ var backDataOne = {
+ data: {
+ "Result": (storage1 != null)
+ }
+ }
+ let backEventOne = {
+ eventId: 60223,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("GetShared start to emit action state")
+ events_emitter.emit(backEventOne, backDataOne)
+ } catch (err) {
+ console.info("GetShared emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text(`Parent from LocalStorage ${ this.simpleVarName }`)
+ .key("setAndLinkText")
+ .onClick(()=>{
+ try {
+ var backDataTwo = {
+ data: {
+ "Result": "callback2"
+ }
+ }
+ let backEventTwo = {
+ eventId: 60224,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("setAndLink start to emit action state")
+ events_emitter.emit(backEventTwo, backDataTwo)
+ } catch (err) {
+ console.info("setAndLink emit action state err: " + JSON.stringify(err.message))
+ }
+ storage1.setAndLink("storageSimpleProp",48)
+ console.log("storage1.setAndLink('PropA',48) :" + this.simpleVarName )
+ })
+
+ Text(`Parent from LocalStorage ${ this.simpleVarName }`)
+ .key("setOrCreateText")
+ .onClick(()=>{
+ try {
+ var backDataThree = {
+ data: {
+ "Result": "callback3"
+ }
+ }
+ let backEventThree = {
+ eventId: 60225,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("setOrCreate start to emit action state")
+ events_emitter.emit(backEventThree, backDataThree)
+ } catch (err) {
+ console.info("setOrCreate emit action state err: " + JSON.stringify(err.message))
+ }
+ storage1.setOrCreate("storageSimpleProp",47)
+ console.log("storageSimpleProp setOrCreate is : " + this.simpleVarName)
+ })
+
+ Text(`Parent from LocalStorage ${ this.simpleVarName }`)
+ .key("setAndPropText")
+ .onClick(()=>{
+ try {
+ var backDataFour = {
+ data: {
+ "Result": "callback4"
+ }
+ }
+ let backEventFour = {
+ eventId: 60226,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("setAndProp start to emit action state")
+ events_emitter.emit(backEventFour, backDataFour)
+ } catch (err) {
+ console.info("setAndProp emit action state err: " + JSON.stringify(err.message))
+ }
+
+ storage1.setAndProp("storageSimpleProp",49)
+ console.log("storageSimpleProp setAndProp is : " + this.simpleVarName)
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
+@Component
+struct Child{
+ @LocalStorageLink("PropA") storLink: number = 1;
+ build() {
+ Text(`Parent from LocalStorage ${ this.storLink }`)
+ .onClick(()=>this.storLink+=1)
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/storage.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/storage.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0ff3d695aa4abfee1a69fdde33b6d073279a8b72
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/storage.ets
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 {
+ storage : LocalStorage
+ onCreate(want) {
+ this.storage = new LocalStorage();
+ this.storage.setOrCreate("storageSimpleProp",121);
+ console.log("[Demo MainAbility onCreate]");
+ globalThis.abilityWant = want;
+ }
+ onDestroy() {
+ console.log("[Demo MainAbility onDestroy]")
+ }
+ onWindowStageCreate(windowStage) {
+ windowStage.setUIContent(this.context,"pages/index",this.storage)
+ }
+ onWindowStageDestroy() {
+ console.log("[Demo] MainAbility onWindoeStageDestroy")
+ }
+ onForeground() {
+ console.log("[Demo] MainAbility onForeground")
+ }
+ onBackground() {
+ console.log("[Demo] MainAbility onBackground")
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4d295994a9ef8d5f11c699b4ef853d7ea57ede4e
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets
@@ -0,0 +1,122 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+class MyDataSource implements IDataSource {
+ private list: number[] = []
+ private listener: DataChangeListener
+
+ constructor(list: number[]) {
+ this.list = list
+ }
+
+ totalCount(): number {
+ return this.list.length
+ }
+
+ getData(index: number): any {
+ return this.list[index]
+ }
+
+ registerDataChangeListener(listener: DataChangeListener): void {
+ this.listener = listener
+ }
+
+ unregisterDataChangeListener() {
+ }
+}
+
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct SwiperCurve {
+
+ private swiperController: SwiperController = new SwiperController()
+ private data: MyDataSource = new MyDataSource([])
+
+ aboutToAppear(): void {
+ Log.showInfo(TAG, `aboutToAppear SwiperCurve start`)
+ let list = []
+ for (var i = 1; i <= 10; i++) {
+ list.push(i.toString());
+ }
+ this.data = new MyDataSource(list)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear SwiperCurve end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Column({ space: 5 }) {
+
+ Swiper(this.swiperController) {
+ LazyForEach(this.data, (item: string) => {
+ Text(item).width('90%').height(160).backgroundColor(0xAFEEEE).textAlign(TextAlign.Center).fontSize(20)
+ }, item => item)
+ }
+ .key("swiper")
+ .cachedCount(2)
+ .index(1)
+ .autoPlay(true)
+ .interval(4000)
+ .indicator(true) // 默认开启指示点
+ .loop(false) // 默认开启循环播放
+ .duration(1000)
+ .vertical(false) // 默认横向切换
+ .itemSpace("0px")
+ .curve(Curve.Linear) // 动画曲线
+ .onChange((index: number) => {
+ console.info(index.toString())
+ })
+
+ Flex({ justifyContent: FlexAlign.SpaceAround }) {
+ Button('next')
+ .onClick(() => {
+ this.swiperController.showNext()
+ })
+ Button('preview')
+ .onClick(() => {
+ this.swiperController.showPrevious()
+ })
+ }
+ }.margin({ top: 5 })
+
+
+ Text("swiper-Curve")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("curveText")
+
+ }.width("100%").height("100%")
+
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets
new file mode 100644
index 0000000000000000000000000000000000000000..35d3af266a23e61e4bd6e4f5ef4309b75f754597
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct TabsBarPosition {
+
+ private controller: TabsController = new TabsController()
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear TabsBarPosition start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear TabsBarPosition end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("tabs-BarPosition")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("barPositionText")
+
+
+ Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
+ TabContent() {
+ Column().width('100%').height('100%').backgroundColor(Color.Pink)
+ }.tabBar('pink')
+
+ TabContent() {
+ Column().width('100%').height('100%').backgroundColor(Color.Yellow)
+ }.tabBar('yellow')
+
+ }
+ .key("barPositionTabs")
+ .vertical(true).scrollable(true).barMode(BarMode.Fixed)
+ .barWidth(70).barHeight(150).animationDuration(400)
+ .onChange((index: number) => {
+ console.info(index.toString())
+ })
+ .width('90%').backgroundColor(0xF5F5F5)
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets
new file mode 100644
index 0000000000000000000000000000000000000000..dbaf1e6c69ea955ae15d16570b4bb89c5448039b
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct TextMinFontSize {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear TextMinFontSize start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear TextMinFontSize end `)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("text-MinFontSize")
+ .width(100)
+ .height(70)
+ .fontSize('30px')
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("minFontSizeText")
+ .minFontSize('50px')
+
+ Text("text-CopyOption")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("copyOptionText")
+ .copyOption(0)
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a071527ccc6be1eb414936c782eb52eef5bdbf47
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct TextAreaOnCut {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear TextAreaOnCut start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear TextAreaOnCut end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ TextArea({placeholder: "textArea-OnCut" })
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ //input输入框中的文字被剪切时触发
+ .onCut(() => {
+ console.log('onCut method is triggered');
+ })
+ .key("onCutText")
+
+ TextArea({placeholder: "textArea-OnPaste" })
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ //input输入框中的粘贴文字时触发
+ .onPaste(() => {
+ console.log("onPaste method is triggered")
+ })
+ .key("onPasteText")
+
+ TextArea({placeholder: "textArea-CopyOption" })
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ /**copyOption(value: boolean | CopyOption):
+ * 设置复制选项时调用
+ * InApp = 0,Share in app.
+ * LocalDevice = 1,Share in local device.
+ * CrossDevice = 2,Share cross device.
+ */
+ .copyOption(0)
+ .key("textAreaCopyOptionText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets
new file mode 100644
index 0000000000000000000000000000000000000000..9103407baf777469c59a9a3700fb3f91e3b0749f
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct TextInputOnEditChange {
+ @State num: number = 0
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear TextInputOnEditChange start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear TextInputOnEditChange end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ TextInput({placeholder: "textInput-OnEditChange" })
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .onEditChange(() => {
+ console.log(`Input state changed ${this.num++}`)
+ })
+ .key("onEditChangeText")
+
+ TextInput({placeholder:"textInput-OnCut"})
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ //input输入框中的文字被剪切时触发
+ .onCut(() =>{
+ console.log("onCut method is triggered")
+ })
+ .key("onCutText")
+
+ TextInput({placeholder:"textInput-OnPaste"})
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ //input输入框中的粘贴文字时触发
+ .onPaste(() => {
+ console.log("onPaste method is triggered")
+ })
+ .key("onPasteText")
+
+ TextInput({placeholder:"textInput-CopyOption"})
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ //设置复制选项时调用
+ .copyOption(0)
+ .key("textInputCopyOptionText")
+
+ TextInput({placeholder:"textInput-ShowPasswordIcon"})
+ .type(InputType.Password)
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ //设置密码显示/隐藏图标时调用
+ .showPasswordIcon(true)
+ .key("showPasswordIconText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets
new file mode 100644
index 0000000000000000000000000000000000000000..cfc3d49e9593eef45ee5fa0b64ead8828dc6eca9
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct TextPickerDefaultPickerItemHeight {
+ private select: number = 1
+ private fruits: string[] = ['1.apple', '2.orange','3.peach', '4.grape']
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear TextPickerDefaultPickerItemHeight start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear TextPickerDefaultPickerItemHeight end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ TextPicker({range: this.fruits, selected: this.select})
+ .onChange((value: string, index: number) => {
+ console.info('Picker item changed, value: ' + value + ', index: ' + index)
+ })
+ .defaultPickerItemHeight('80px')
+ .key("defaultPickerItemHeightText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/uiAppearance.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/uiAppearance.ets
new file mode 100644
index 0000000000000000000000000000000000000000..83ac98b2ae28fdb864609984a5df4cda53a8184f
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/uiAppearance.ets
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import uiAppearance from '@ohos.uiAppearance'
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct uiAppearanceSetDarkMode {
+ xcomponentController: XComponentController = new XComponentController()
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear uiAppearanceSetDarkMode start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear uiAppearanceSetDarkMode end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("uiAppearance-setDarkMode1")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("uiAppearance-setDarkMode1Text")
+ .onClick(() => {
+ uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, (err) => {
+ console.info(`uiAppearance.setDarkMode: ${err}`);
+ })
+ })
+
+ Text("uiAppearance-getDarkMode")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("uiAppearance-getDarkModeText")
+ .onClick(() => {
+ console.log('uiAppearance.getDarkMode: ' + JSON.stringify(uiAppearance.getDarkMode()))
+ })
+
+ Text("uiAppearance-setDarkMode2")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("uiAppearance-setDarkMode2Text")
+ .onClick(() => {
+ uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK)
+ })
+
+ }.width("100%").height("100%")
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d6790351bef7a39571d556ce07da1814d19d4ec0
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets
@@ -0,0 +1,122 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct VideoOnFullscreenChange {
+
+ @State srcs: Resource = $rawfile('videoTest.mp4');
+ @State currentProgressRates: number = 1;
+ @State autoPlays: boolean = false;
+ controller: VideoController = new VideoController();
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear VideoOnFullscreenChange start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear VideoOnFullscreenChange end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Video({
+ src: this.srcs,
+ currentProgressRate: this.currentProgressRates,
+ controller: this.controller
+ }).width(600).height(400)
+ .autoPlay(this.autoPlays)
+ .key("onFullscreenChangeText")
+ .onStart(() => {
+ console.error('onStart');
+ })
+ .onFullscreenChange(() => {
+ console.log('screen is changed')
+ console.info('screen is changed')
+ console.error('screen is changed')
+ console.warn('screen is changed')
+ try{
+ var backData = {
+ data: {
+ "result": "success"
+ }
+ }
+ let backEvent = {
+ eventId: 60227,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("video_101 onClick start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch(err) {
+ console.info("video_101 onClick emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .onPause(() => {
+ console.error('onPause');
+ })
+ .onFinish(() => {
+ console.error('onFinish');
+ })
+ .onError(() => {
+ console.error('onFinish');
+ })
+ .onPrepared((e) => {
+ console.error('onPrepared is ' + e.duration);
+ })
+ .onSeeking((e) => {
+ console.error('onSeeking is ' + e.time);
+ })
+ .onSeeked((e) => {
+ console.error('onSeekedis ' + e.time);
+ })
+ .onUpdate((e) => {
+ console.error('onUpdateis ' + e.time);
+ })
+ Row() {
+ Button("FullScreen")
+ .key("fullScreen")
+ .onClick(() => {
+ this.controller.requestFullscreen(true)
+ });
+
+ Button("ExitFullScreen")
+ .key("exitFullScreen")
+ .onClick(() => {
+ this.controller.exitFullscreen()
+ });
+ }
+
+ Row() {
+ Button("start").onClick(() => {
+ this.controller.start();
+ });
+ Button("pause").onClick(() => {
+ this.controller.pause();
+ });
+ Button("stop").onClick(() => {
+ this.controller.stop();
+ });
+ }
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4a4c1638b2a324e7db705f455262f54a42a11c41
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/web.ets
@@ -0,0 +1,187 @@
+/*
+ * 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 Log from '../common/Log.ets';
+
+@Entry
+@Component
+struct WebComponent {
+ @State progress: number = 0;
+ @State hideProgress: boolean = true;
+ fileAccess: boolean = true;
+ // 定义Web组件的控制器controller
+ controller: WebController = new WebController();
+ webResourceResponse: WebResourceResponse = new WebResourceResponse();
+ build() {
+ Column() {
+ Text('Hello world!')
+ .fontSize(20)
+ Progress({value: this.progress, total: 100})
+ .color('#0000ff')
+ .visibility(this.hideProgress ? Visibility.None : Visibility.Visible)
+ // 初始化Web组件,并绑定controller
+ Web({ src: $rawfile('index.html'), controller: this.controller })
+ .key("getTitleText")
+ .fileAccess(this.fileAccess)
+ .javaScriptAccess(true)
+ .height(500)
+ .padding(20)
+ .blur(2)
+ .userAgent("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36")
+ .fileFromUrlAccess(true)
+ .initialScale(2)
+ .webDebuggingAccess(true)
+ .onPrompt((event) => {
+ console.info('onPrompt url: ', event.url);
+ console.info('onPrompt message: ', event.message);
+ console.info('onPrompt result: ', event.result);
+ console.info('onPrompt handlePromptConfirm: ', event.result.handlePromptConfirm("confirm"));
+ return true;
+ })
+ .onShowFileSelector((event) => {
+ console.info('onShowFileSelector getAcceptType: ', event.fileSelector.getAcceptType());
+ console.info('onShowFileSelector getTitle: ', event.fileSelector.getTitle());
+ console.info('onShowFileSelector getMode: ', event.fileSelector.getMode());
+ console.info('onShowFileSelector isCapture: ', event.fileSelector.isCapture());
+ event.result.handleFileList(["D:\DevEcoStudioProjects","D:\DevEcoStudioProjects"])
+ return true;
+ })
+ .onRenderExited((event) => {
+ console.info('onRenderExited getAcceptType: ', event.renderExitReason);
+ })
+ .onProgressChange(e => {
+ this.progress = e.newProgress;
+ if (this.progress === 100) {
+ this.hideProgress = true;
+ } else {
+ this.hideProgress = false;
+ }
+ })
+ .onResourceLoad((event) => {
+ console.info('onResourceLoad url: ', event.url);
+ return true;
+ })
+ .onPageEnd(e => {
+ // test()在index.html中定义
+ this.controller.runJavaScript({ script: 'test()' });
+ console.info('url: ', e.url);
+ })
+ .onHttpAuthRequest((event) => {
+ console.info('onHttpAuthRequest host: ', event.host);
+ console.info('onHttpAuthRequest realm: ', event.realm);
+ console.info('onHttpAuthRequest isHttpAuthInfoSaved: ', event.handler.isHttpAuthInfoSaved());
+ let result = event.handler;
+ return true;
+ })
+ .onInterceptRequest((event) => {
+ console.info('onInterceptRequest getRequestUrl: ', event.request.getRequestUrl());
+ console.info('onInterceptRequest isMainFrame: ', event.request.isMainFrame());
+ console.info('onInterceptRequest isRedirect: ', event.request.isRedirect());
+ console.info('onInterceptRequest isRequestGesture: ', event.request.isRequestGesture());
+ let result = event.request.getRequestHeader();
+ console.log('The request header result size is ' + result.length);
+ for (let i of result) {
+ console.log('The request header key is : ' + i.headerKey + ' , value is : ' + i.headerValue);
+ }
+ return this.webResourceResponse;
+ })
+// .onContextMenuShow((event) => {
+// console.info("x coord = " + event.param.x());
+// console.info("y coord = " + event.param.y());
+// console.info("link url = " + event.param.getLinkUrl());
+// console.info("unfilterendLinkUrl = " + event.param.getUnfilterendLinkUrl());
+// console.info("sourceUrl = " + event.param.getSourceUrl());
+// console.info("existsImageContents = " + event.param.existsImageContents());
+// console.info("closeContextMenu = " + event.result.closeContextMenu());
+// console.info("copyImage = " + event.result.copyImage());
+// })
+// .onPermissionRequest((event) => {
+// AlertDialog.show({
+// title: 'title',
+// message: 'text',
+// confirm: {
+// value: 'onConfirm',
+// action: () => {
+// event.request.grant(event.request.getAccessibleResource());
+// console.info('onPermissionRequest getAccessibleResource: ', event.request.getAccessibleResource());
+// console.info('onPermissionRequest getOrigin: ', event.request.getOrigin());
+// }
+// },
+// cancel: () => {
+// event.request.deny();
+// }
+// })
+// })
+ .onScaleChange((event) => {
+ console.info('onScaleChange oldScale: ', event.oldScale);
+ console.info('onScaleChange newScale: ', event.newScale);
+ })
+ .onHttpErrorReceive((event) => {
+ console.log('url:' + event.request.getRequestUrl());
+ console.log('isMainFrame:' + event.request.isMainFrame());
+ console.log('isRedirect:' + event.request.isRedirect());
+ console.log('isRequestGesture:' + event.request.isRequestGesture());
+ console.log('getResponseData:' + event.response.getResponseData());
+ console.log('getResponseEncoding:' + event.response.getResponseEncoding());
+ console.log('getResponseMimeType:' + event.response.getResponseMimeType());
+ console.log('getResponseCode:' + event.response.getResponseCode());
+ console.log('getReasonMessage:' + event.response.getReasonMessage());
+ console.log('setResponseData:' + event.response.setResponseData("ResponseData"));
+ console.log('setReasonMessage:' + event.response.setReasonMessage("success"));
+ console.log('setResponseCode:' + event.response.setResponseCode(200));
+ console.log('setResponseEncoding:' + event.response.setResponseEncoding("UTF-8"));
+ console.log('setResponseMimeType:' + event.response.setResponseMimeType("application/json"));
+ console.log('setResponseHeader:' + event.response.setResponseHeader([]));
+ console.log('web getExtra:' + this.controller.getHitTestValue().getExtra());
+ console.log('web getType:' + this.controller.getHitTestValue().getType());
+ console.log('web getCookieManager:' + this.controller.getCookieManager());
+ console.log('web getCookie:' + this.controller.getCookieManager().getCookie("www.baidu.com"));
+ console.log('web existCookie:' + this.controller.getCookieManager().existCookie());
+ console.log('web deleteEntireCookie:' + this.controller.getCookieManager().deleteEntireCookie());
+ console.log('web deleteExpiredCookie:' + this.controller.getCookieManager().deleteExpiredCookie());
+ console.log('web deleteSessionCookie:' + this.controller.getCookieManager().deleteSessionCookie());
+ console.log('web isCookieAllowed:' + this.controller.getCookieManager().isCookieAllowed());
+ console.log('web isFileURICookieAllowed:' + this.controller.getCookieManager().isFileURICookieAllowed());
+ console.log('web isThirdPartyCookieAllowed:' + this.controller.getCookieManager().isThirdPartyCookieAllowed());
+ console.log('web putAcceptCookieEnabled:' + this.controller.getCookieManager().putAcceptCookieEnabled(true));
+ console.log('web putAcceptFileURICookieEnabled:' + this.controller.getCookieManager().putAcceptFileURICookieEnabled(true));
+ console.log('web putAcceptThirdPartyCookieEnabled:' + this.controller.getCookieManager().putAcceptThirdPartyCookieEnabled(true));
+ console.log('web saveCookieSync:' + this.controller.getCookieManager().saveCookieSync());
+ console.log('web zoomIn:' + this.controller.zoomIn());
+ console.log('web zoomOut:' + this.controller.zoomOut());
+ console.log('web zoom:' + this.controller.zoom(2));
+ console.log('web getWebId:' + this.controller.getWebId());
+ console.log('web getDefaultUserAgent:' + this.controller.getDefaultUserAgent());
+ console.log('web getTitle:' + this.controller.getTitle());
+ console.log('web getPageHeight:' + this.controller.getPageHeight());
+ console.log('web backOrForward:' + this.controller.backOrForward(2));
+
+
+ let result = event.request.getRequestHeader();
+ console.log('The request header result size is ' + result.length);
+ for (let i of result) {
+ console.log('The request header key is : ' + i.headerKey + ' , value is : ' + i.headerValue);
+ }
+ let resph = event.response.getResponseHeader();
+ console.log('The response header result size is ' + resph.length);
+ for (let i of resph) {
+ console.log('The response header key is : ' + i.headerKey + ' , value is : ' + i.headerValue);
+ }
+ })
+ Text('End')
+ .fontSize(20)
+ }
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/xcomponent.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/xcomponent.ets
new file mode 100644
index 0000000000000000000000000000000000000000..55db887769128f45259f8e642399897829f802ae
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/xcomponent.ets
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct XcomponentGetXComponentContext {
+ xcomponentController: XComponentController = new XComponentController()
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear XcomponentGetXComponentContext start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear XcomponentGetXComponentContext end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("xcomponent-GetXComponentContext")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("getXComponentContextText")
+ .onClick(() => {
+ try {
+ Log.showInfo(TAG, 'xcomponentController.getXComponentContext' + JSON.stringify(this.xcomponentController.getXComponentContext()))
+ var result = (this.xcomponentController.getXComponentContext() != null)
+ var backData = {
+ data: {
+ "STATUS": "callBackSuccess"
+ }
+ }
+ let backEvent = {
+ eventId: 60228,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("xcomponentController start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("xcomponentController emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text("xcomponent-SetXComponentSurfaceSize")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("setXComponentSurfaceSizeText")
+ .onClick(() => {
+ this.xcomponentController.setXComponentSurfaceSize({
+ surfaceWidth: 200,
+ surfaceHeight: 200
+ })
+ })
+
+ }.width("100%").height("100%")
+ }
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6b29cb8048a4edbca5f8fbc6197c0fb227c00f64
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/app.ets
@@ -0,0 +1,33 @@
+// @ts-nocheck
+/**
+ * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from 'hypium/index'
+import testsuite from '../test/List.test'
+
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0d0efe0a85177331cccf9524a7cd747c966dcbe5
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestAbility/pages/index.ets
@@ -0,0 +1,50 @@
+// @ts-nocheck
+/**
+ * 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 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
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..07cb0b784984c6c4cc6d911c3c82643bff9df263
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,78 @@
+// @ts-nocheck
+/**
+ * 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 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 itName',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s package'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ 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')
+ }
+
+ onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+
+ let lMonitor = {
+ abilityName: testAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -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 call abilityDelegator.getAppContext')
+ var context = abilityDelegator.getAppContext()
+ console.info('getAppContext : ' + JSON.stringify(context))
+ console.info('OpenHarmonyTestRunner onRun end')
+ }
+};
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..cc24bb089574b838dc00a3635034bf487863c6c6
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets
@@ -0,0 +1,186 @@
+/**
+ * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import router from '@system.router';
+import events_emitter from '@ohos.events.emitter'
+import Utils from './Utils';
+
+export default function focusControlJsunit() {
+ describe('focusControlTest', function () {
+ beforeEach(async function (done) {
+ console.info("focusControlTest beforeEach start");
+ let options = {
+ uri: 'pages/focusControl',
+ }
+ let result;
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get focus state pages: " + JSON.stringify(pages));
+ if (!("focusControl" == pages.name)) {
+ console.info("get focus state pages.name: " + JSON.stringify(pages.name));
+ result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push focus page result: " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push focus page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("focus after each called");
+ })
+
+ it('testFocusOnTouch01', 0, async function (done) {
+ console.info('[testFocusOnTouch01] START');
+ await Utils.sleep(1000);
+ var callback = (eventData) => {
+ if (eventData != null) {
+ console.info("[testFocusOnTouch01] get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.value).assertEqual('FocusOnTouchGrpBtn')
+ done()
+ }
+ }
+ var innerEvent = {
+ eventId: 60232,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ console.info("testFocusOnTouch01 click result is: " + JSON.stringify(sendEventByKey('OnTouchGrpBtn', 10, "")));
+ events_emitter.on(innerEvent, callback)
+ } catch (err) {
+ console.info("[testFocusOnTouch01] on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('[testFocusOnTouch01] testSendTouchEvent END');
+ });
+
+ it('testFocusOnTouch02', 0, async function (done) {
+ console.info('[testFocusOnTouch02] START');
+ await Utils.sleep(1000);
+ var callback = (eventData) => {
+ if (eventData != null) {
+ console.info("[testFocusOnTouch02] get event state result is: " + JSON.stringify(eventData))
+ expect(eventData.data.value).assertEqual('FocusOnTouchBtn1')
+ done()
+ }
+ }
+ var innerEvent = {
+ eventId: 60233,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ console.info("testFocusOnTouch02 click result is: " + JSON.stringify(sendEventByKey('OnTouchBtn1', 10, "")));
+ events_emitter.on(innerEvent, callback)
+ } catch (err) {
+ console.info("[testFocusOnTouch02] on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('[testFocusOnTouch02] testSendTouchEvent END');
+ });
+
+ it('testFocusOnTouch03', 0, async function (done) {
+ console.info('[testFocusOnTouch03] START');
+ await Utils.sleep(1000);
+ var callback = (eventData) => {
+ if (eventData != null) {
+ console.info("[testFocusOnTouch03] get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.value).assertEqual('FocusOnTouchBtn2')
+ done()
+ }
+ }
+ var innerEvent = {
+ eventId: 60234,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ console.info("testFocusOnTouch03 click result is: " + JSON.stringify(sendEventByKey('OnTouchBtn2', 10, "")));
+ events_emitter.on(innerEvent, callback)
+ } catch (err) {
+ console.info("[testFocusOnTouch03] on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('[testFocusOnTouch03] testSendTouchEvent END');
+ });
+
+ it('testFocusOnTouch04', 0, async function (done) {
+ console.info('[testFocusOnTouch04] START');
+ await Utils.sleep(1000);
+ var callback = (eventData) => {
+ if (eventData != null) {
+ console.info("[testFocusOnTouch04] get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.value).assertEqual('OnTouchBtn3')
+ done()
+ }
+ }
+ var innerEvent = {
+ eventId: 60235,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ console.info("testFocusOnTouch04 click result is: " + JSON.stringify(sendEventByKey('OnTouchBtn3', 10, "")));
+ events_emitter.on(innerEvent, callback)
+ } catch (err) {
+ console.info("[testFocusOnTouch04] on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('[testFocusOnTouch04] testSendTouchEvent END');
+ });
+
+ it('testFocusOnTouch05', 0, async function (done) {
+ console.info('[testFocusOnTouch05] START');
+ await Utils.sleep(1000);
+ var callback = (eventData) => {
+ if (eventData != null) {
+ console.info("[testFocusOnTouch05] get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.value).assertEqual('OnTouchBtn4')
+ done()
+ }
+ }
+ var innerEvent = {
+ eventId: 60236,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ console.info("testFocusOnTouch05 click result is: " + JSON.stringify(sendEventByKey('OnTouchBtn4', 10, "")));
+ events_emitter.on(innerEvent, callback)
+ } catch (err) {
+ console.info("[testFocusOnTouch05] on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('[testFocusOnTouch05] testSendTouchEvent END');
+ });
+
+ it('testDefaultFocus06', 0, async function (done) {
+ console.info('[testDefaultFocus06] START');
+ await Utils.sleep(1000);
+ var callback = (eventData) => {
+ if (eventData != null) {
+ console.info("[testDefaultFocus06] get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.value).assertEqual('defaultFocus')
+ done()
+ }
+ }
+ var innerEvent = {
+ eventId: 60237,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ events_emitter.on(innerEvent, callback)
+ } catch (err) {
+ console.info("[testDefaultFocus06] on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('[testDefaultFocus06] END');
+ });
+ })
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ead1df032237f27f1495b033b71e891db91813bf
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,107 @@
+/**
+ * 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 alphabetIndexerOnSelectJsunit from './alphabetIndexer.test.ets';
+import checkBoxGroupSelectAllJsunit from './checkBoxGroup.test.ets';
+import circleNewJsunit from './circle.test.ets';
+import curvesStepsJsunit from './curves.test.ets';
+import commonBackgroundBlurStyleJsunit from './common.test.ets';
+import common_ts_ets_apiStaticClearJsunit from './common_ts_ets_api.test.ets';
+import ellipseNeJsunit from './ellipse.test.ets';
+import featureAbilityStartAbilityJsunit from './featureAbility.test.ets';
+import focusControlJsunit from './FocusControlJsunit.test.ets'
+import gaugeColorsJsunit from './gauge.test.ets';
+import gestureSetDirectionJsunit from './gesture.test.ets';
+import globalJsunit from './global.test.ets';
+import gridMaxCountJsunit from './grid.test.ets';
+import gridItemOnSelectJsunit from './gridItem.test.ets';
+import grid_colSpanJsunit from './grid_col.test.ets';
+import grid_rowOnBreakpointChangeJsunit from './grid_row.test.ets';
+import inspectorJsunit from './inspector.test.ets'
+import lazyForEachOnDataAddJsunit from './lazyForEach.test.ets';
+import lineNeJsunit from './line.test.ets';
+import listNewJsunit from './listTest.test.ets';
+import list_itemOnSelectJsunit from './list_item.test.ets';
+import mediaQueryOffJsunit from './mediaQuery.test.ets';
+import navigatorTargetJsunit from './navigator.test.ets'
+import pageRouteTest from './pageRoute.test.ets'
+import panelBackgroundMaskJsunit from './panel.test.ets';
+import pathNewTest from './path.test.ets';
+import polygonNewJsunit from './polygon.test.ets';
+import polyLineNeJsunit from './polyLine.test.ets';
+import progressScaleCountJsunit from './progress.test.ets';
+import promptShowDialogJsunit from './prompt.test.ets';
+import rectNeJsunit from './rect.test.ets';
+import scrollOnScrollBeginJsunit from './scroll.test.ets';
+import searchOnCutJsunit from './search.test.ets'
+import selectOnSelectJsunit from './select.test.ets';
+import sideBarShowSideBarJsunit from './sideBar.test.ets';
+import stackAlignContentJsunit from './stack.test.ets';
+import stateManagementGetSharedJsunit from './stateManagement.test.ets';
+import swiperCurveJsunit from './swiper.test.ets';
+import tabsBarPositionJsunit from './tabs.test.ets';
+import textMinFontSizeJsunit from './text.test.ets';
+import textAreaOnCutJsunit from './textArea.test.ets';
+import textInputOnEditChangeJsunit from './textInput.test.ets';
+import textPickerDefaultPickerItemHeightJsunit from './textPicker.test.ets';
+import videoOnFullscreenChangeJsunit from './video.test.ets';
+import webGetTitleJsunit from './web.test.ets';
+import xcomponentGetXComponentContextJsunit from './xcomponent.test.ets';
+
+export default function testsuite() {
+ lazyForEachOnDataAddJsunit()
+ alphabetIndexerOnSelectJsunit()
+ checkBoxGroupSelectAllJsunit()
+ circleNewJsunit()
+ curvesStepsJsunit()
+ common_ts_ets_apiStaticClearJsunit()
+ commonBackgroundBlurStyleJsunit()
+ ellipseNeJsunit()
+ featureAbilityStartAbilityJsunit()
+ gaugeColorsJsunit()
+ gestureSetDirectionJsunit()
+ globalJsunit()
+ gridMaxCountJsunit()
+ gridItemOnSelectJsunit()
+ inspectorJsunit()
+ lineNeJsunit()
+ listNewJsunit()
+ list_itemOnSelectJsunit()
+ mediaQueryOffJsunit()
+ navigatorTargetJsunit()
+ pageRouteTest()
+ panelBackgroundMaskJsunit()
+ pathNewTest()
+ polygonNewJsunit()
+ polyLineNeJsunit()
+ progressScaleCountJsunit()
+ promptShowDialogJsunit()
+ rectNeJsunit()
+ scrollOnScrollBeginJsunit()
+ searchOnCutJsunit()
+ selectOnSelectJsunit()
+ sideBarShowSideBarJsunit()
+ stackAlignContentJsunit()
+ stateManagementGetSharedJsunit()
+ swiperCurveJsunit()
+ tabsBarPositionJsunit()
+ textMinFontSizeJsunit()
+ textAreaOnCutJsunit()
+ textInputOnEditChangeJsunit()
+ textPickerDefaultPickerItemHeightJsunit()
+ videoOnFullscreenChangeJsunit()
+ webGetTitleJsunit()
+ xcomponentGetXComponentContextJsunit()
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets
new file mode 100644
index 0000000000000000000000000000000000000000..aa94fe4f7e0a3a0c066b9141e118b2229c839a96
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/Utils.ets
@@ -0,0 +1,118 @@
+// @ts-nocheck
+/**
+ * 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 class Utils {
+ static rect_left;
+ static rect_top;
+ static rect_right;
+ static rect_bottom;
+ static rect_value;
+
+ static sleep(time) {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ resolve()
+ }, time)
+ }).then(() => {
+ console.info(`sleep ${time} over...`)
+ })
+ }
+
+ static getComponentRect(key) {
+ let strJson = getInspectorByKey(key);
+ let obj = JSON.parse(strJson);
+ console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
+ let rectInfo = JSON.parse('[' + obj.$rect + ']')
+ console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
+ this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
+ this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
+ this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
+ this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
+ return this.rect_value = {
+ "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
+ }
+ }
+
+ static async swipe(downX, downY, upX, upY, steps) {
+ console.info('start to swipe')
+ this.drags(downX, downY, upX, upY, steps, false)
+ }
+
+ static async drag(downX, downY, upX, upY, steps) {
+ console.info('start to drag')
+ this.drags(downX, downY, upX, upY, steps, true)
+ }
+
+ static async drags(downX, downY, upX, upY, steps, drag) {
+ var xStep;
+ var yStep;
+ var swipeSteps;
+ var ret;
+ xStep = 0;
+ yStep = 0;
+ ret = false;
+ swipeSteps = steps;
+ if (swipeSteps == 0) {
+ swipeSteps = 1;
+ }
+ xStep = (upX - downX) / swipeSteps;
+ yStep = (upY - downY) / swipeSteps;
+ console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
+ var downPonit: TouchObject = {
+ id: 1,
+ x: downX,
+ y: downY,
+ type: TouchType.Down,
+ }
+ console.info('down touch started: ' + JSON.stringify(downPonit))
+ sendTouchEvent(downPonit);
+ console.info('start to move')
+ if (drag) {
+ await this.sleep(500)
+ }
+ for (var i = 1;i <= swipeSteps; i++) {
+ var movePoint: TouchObject = {
+ id: 1,
+ x: downX + (xStep * i),
+ y: downY + (yStep * i),
+ type: TouchType.Move
+ }
+ console.info('move touch started: ' + JSON.stringify(movePoint))
+ ret = sendTouchEvent(movePoint)
+ if (ret == false) {
+ break;
+ }
+ await this.sleep(5)
+ }
+ console.info('start to up')
+ if (drag) {
+ await this.sleep(100)
+ }
+ var upPoint: TouchObject = {
+ id: 1,
+ x: upX,
+ y: upY,
+ type: TouchType.Up,
+ }
+ console.info('up touch started: ' + JSON.stringify(upPoint))
+ sendTouchEvent(upPoint)
+ await this.sleep(500)
+ }
+}
+
+
+
+
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..896dea30e7d5b8c31af09e9bcdee8702748d5495
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets
@@ -0,0 +1,262 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import events_emitter from '@ohos.events.emitter';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function alphabetIndexerOnSelectJsunit() {
+ describe('alphabetIndexerOnSelectTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/alphabetIndexer',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get alphabetIndexer state success " + JSON.stringify(pages));
+ if (!("alphabetIndexer" == pages.name)) {
+ console.info("get alphabetIndexer state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push alphabetIndexer page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push alphabetIndexer page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("alphabetIndexerOnSelect after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testalphabetIndexer0001
+ * @tc.desic acealphabetIndexerEtsTest0001
+ */
+ it('testalphabetIndexerWidth0001', 0, async function (done) {
+ console.info('alphabetIndexerWidth testalphabetIndexerWidth0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerWidth0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testalphabetIndexerWidth0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testalphabetIndexer0002
+ * @tc.desic acealphabetIndexerEtsTest0002
+ */
+ it('testalphabetIndexerHeight0002', 0, async function (done) {
+ console.info('alphabetIndexerHeight testalphabetIndexerHeight0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerHeight0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.height).assertEqual("300.00vp");
+ console.info("[testalphabetIndexerHeight0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testalphabetIndexer0003
+ * @tc.desic acealphabetIndexerEtsTest0003
+ */
+ it('testalphabetIndexerColor0003', 0, async function (done) {
+ console.info('alphabetIndexerColor testalphabetIndexerColor0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerColor0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.color).assertEqual(undefined);
+ console.info("[testalphabetIndexerColor0003] color value :" + obj.$attrs.color);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testalphabetIndexer0004
+ * @tc.desic acealphabetIndexerEtsTest0004
+ */
+ it('testalphabetIndexerSelectedColor0004', 0, async function (done) {
+ console.info('alphabetIndexerSelectedColor testalphabetIndexerSelectedColor0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerOnSelect0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.selectedColor).assertEqual("#FFFFFFFF");
+ console.info("[testalphabetIndexerSelectedColor0004] selectedColor value :" + obj.$attrs.selectedColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testalphabetIndexer0005
+ * @tc.desic acealphabetIndexerEtsTest0005
+ */
+ it('testalphabetIndexerPopupColor0005', 0, async function (done) {
+ console.info('alphabetIndexerPopupColor testalphabetIndexerPopupColor0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerPopupColor0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.popupColor).assertEqual("#FF48D1CC");
+ console.info("[testalphabetIndexerPopupColor0005] popupColor value :" + obj.$attrs.popupColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testalphabetIndexer0006
+ * @tc.desic acealphabetIndexerEtsTest0006
+ */
+ it('testalphabetIndexerSelectedBackgroundColor0006', 0, async function (done) {
+ console.info('alphabetIndexerSelectedBackgroundColor testalphabetIndexerSelectedBackgroundColor0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerSelectedBackgroundColor0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.selectedBackgroundColor).assertEqual("#FF0000E6");
+ console.info("[testalphabetIndexerSelectedBackgroundColor0006] selectedBackgroundColor value :" + obj.$attrs.selectedBackgroundColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testalphabetIndexer0007
+ * @tc.desic acealphabetIndexerEtsTest0007
+ */
+ it('testalphabetIndexerPopupBackground0007', 0, async function (done) {
+ console.info('alphabetIndexerPopupBackground testalphabetIndexerPopupBackground0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerPopupBackground0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.popupBackground).assertEqual("#E500DDDD");
+ console.info("[testalphabetIndexerPopupBackground0007] popupBackground value :" + obj.$attrs.popupBackground);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testalphabetIndexer0009
+ * @tc.desic acealphabetIndexerEtsTest0009
+ */
+ it('testalphabetIndexerUsingPopup0009', 0, async function (done) {
+ console.info('alphabetIndexerUsingPopup testalphabetIndexerUsingPopup009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerUsingPopup0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.usingPopup).assertEqual(true);
+ console.info("[testalphabetIndexerUsingPopup0009] usingPopup value :" + obj.$attrs.usingPopup);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testalphabetIndexer0010
+ * @tc.desic acealphabetIndexerEtsTest0010
+ */
+ it('testalphabetIndexerItemSize0010', 0, async function (done) {
+ console.info('alphabetIndexerItemSize testalphabetIndexerItemSize0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerItemSize0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.itemSize).assertEqual("28.000000");
+ console.info("[testalphabetIndexerItemSize0010] itemSize value :" + obj.$attrs.itemSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testalphabetIndexer0011
+ * @tc.desic acealphabetIndexerEtsTest0011
+ */
+ it('testalphabetIndexerAlignStyle0011', 0, async function (done) {
+ console.info('alphabetIndexerAlignStyle testalphabetIndexerAlignStyle0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alphabetIndexer');
+ console.info("[testalphabetIndexerAlignStyle0011] component strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('AlphabetIndexer');
+ expect(obj.$attrs.alignStyle).assertEqual("AlignStyle.Left");
+ console.info("[testalphabetIndexerItemSize0010] alignStyle value :" + obj.$attrs.alignStyle);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0012
+ * @tc.name testalphabetIndexerOnSelect0012
+ * @tc.desic acealphabetIndexerOnSelectEtsTest0012
+ */
+ it('testalphabetIndexerOnSelect0012', 0, async function (done) {
+ console.info('alphabetIndexerOnSelect testalphabetIndexerOnSelect0011 START');
+ await Utils.sleep(2000);
+ try{
+ let callback = (indexEvent) => {
+ console.info("onSelect_0012 get state result is: " + JSON.stringify(indexEvent));
+ expect(indexEvent.data.STATUS).assertEqual(true);
+ }
+ let indexEvent = {
+ eventId: 60201,
+ priority: events_emitter.EventPriority.LOW
+ }
+ sendEventByKey('alphabetIndexer', 10, "")
+ events_emitter.on(indexEvent, callback);
+ }catch(err){
+ console.info("onSelect_0012 on events_emitter err : " + JSON.stringify(err));
+ }
+
+ await Utils.sleep(2000);
+ try {
+ var innerEventOne = {
+ eventId: 60202,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("onRequestPopupData_0012 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(true);
+ }
+ console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('alphabetIndexer', 10, "")));
+ events_emitter.on(innerEventOne, callback1);
+ } catch (err) {
+ console.info("onRequestPopupData_0012 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testalphabetIndexerOnSelect0012 END');
+ done();
+
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a5dafdaaaaa17c6273d18c0feaacd43ceaafb909
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function checkBoxGroupSelectAllJsunit() {
+ describe('checkBoxGroupSelectAllTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/checkBoxGroup',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get checkBoxGroup state success " + JSON.stringify(pages));
+ if (!("checkBoxGroup" == pages.name)) {
+ console.info("get checkBoxGroup state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push checkBoxGroup page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push checkBoxGroup page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("checkBoxGroupSelectAll after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testcheckBoxGroupSelectAll0001
+ * @tc.desic acecheckBoxGroupSelectAllEtsTest0001
+ */
+ it('testcheckBoxGroupSelectAll0001', 0, async function (done) {
+ console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('CheckboxGroup');
+ console.info("[testcheckBoxGroupSelectAll0001] component selectedColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('CheckboxGroup');
+ expect(obj.$attrs.selectedColor).assertEqual("#FFED6F21");
+ console.info("[testcheckBoxGroupSelectAll0001] selectedColor value :" + obj.$attrs.selectedColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testcheckBoxGroupSelectAll0002
+ * @tc.desic acecheckBoxGroupSelectAllEtsTest0002
+ */
+ it('testcheckBoxGroupSelectAll0002', 0, async function (done) {
+ console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0002 START');
+ try {
+ var eventData = {
+ data: {
+ "isSelect": false
+ }
+ }
+ var innerEvent = {
+ eventId: 60203,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("[testcheckBoxGroupSelectAll0002] start to publish emit");
+ events_emitter.emit(innerEvent, eventData);
+ } catch (err) {
+ console.log("[testcheckBoxGroupSelectAll0002] change component data error: " + err.message);
+ }
+ await Utils.sleep(2000);
+
+ let strJson = getInspectorByKey('CheckboxOne');
+ let obj = JSON.parse(strJson);
+ console.info("[testcheckBoxGroupSelectAll0002] obj is: " + JSON.stringify(obj));
+ expect(obj.$attrs.selectedColor).assertEqual("#FF39A2DB");
+ console.info("[testcheckBoxGroupSelectAll0002] selectedColor value :" + obj.$attrs.selectedColor);
+ console.info('testcheckBoxGroupSelectAll0002 END');
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8103bd827ba1ad14121dfb88edc8957dc26c99d9
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function circleNewJsunit() {
+ describe('circleNewTest', function () {
+ beforeAll(async function (done) {
+ console.info("circle beforeEach start");
+ let options = {
+ uri: 'pages/circle',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get circle state success " + JSON.stringify(pages));
+ if (!("circle" == pages.name)) {
+ console.info("get circle state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push circle page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push circle page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("circleNew after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name testcircleNew001
+ * @tc.desic acecircleNewEtsTest001
+ */
+ it('testcircleNew001', 0, async function (done) {
+ console.info('circleNew testcircleNew0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('circle');
+ console.info("[testcircleNew001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("100.00px");
+ console.info("[testcircleNew001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_002
+ * @tc.name testcircleNew002
+ * @tc.desic acecircleNewEtsTest002
+ */
+ it('testcircleNew002', 0, async function (done) {
+ console.info('circleNew testcircleNew002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('circle');
+ console.info("[testcircleNew002] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("100.00px");
+ console.info("[testcircleNew002] width value :" + obj.$attrs.width);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..71a6d9ac64b0fbad1f47e35e5a8cf56776e4be65
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common.test.ets
@@ -0,0 +1,200 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function commonBackgroundBlurStyleJsunit() {
+ describe('commonBackgroundBlurStyleTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/common',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get common state success " + JSON.stringify(pages));
+ if (!("common" == pages.name)) {
+ console.info("get common state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push common page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push common page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("commonBackgroundBlurStyle after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name testcommonBackgroundBlurStyle001
+ * @tc.desic acecommonBackgroundBlurStyleEtsTest001
+ */
+ it('testcommonBackgroundBlurStyle001', 0, async function (done) {
+ console.info('commonBackgroundBlurStyle testcommonBackgroundBlurStyle001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('borderImageText');
+ console.info("[testcommonBackgroundBlurStyle001] component borderImage strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+
+ let targetValue = {
+ source: {
+ angle: 90,
+ direction: GradientDirection.Left,
+ colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]]
+ },
+ slice: {
+ top: 10, bottom: 10, left: 10, right: 10
+ },
+ width: {
+ top: "10px", bottom: "10px", left: "10px", right: "10px"
+ },
+ repeat: RepeatMode.Stretch,
+ fill: false
+ };
+ expect(obj.$attrs.borderImage).assertEqual(undefined);
+ console.info("[testcommonBackgroundBlurStyle001] borderImage value :" + JSON.stringify(obj.$attrs.borderImage));
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_002
+ * @tc.name testcommonBackgroundBlurStyle002
+ * @tc.desic acecommonBackgroundBlurStyleEtsTest002
+ */
+ it('testcommonBackgroundBlurStyle002', 0, async function (done) {
+ console.info('commonBackgroundBlurStyle testcommonBackgroundBlurStyle002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('tabIndexText');
+ console.info("[testcommonBackgroundBlurStyle002] component tabIndex strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.tabIndex).assertEqual(undefined);
+ console.info("[testcommonBackgroundBlurStyle002] tabIndex value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_003
+ * @tc.name testcommonBackgroundBlurStyle003
+ * @tc.desic acecommonBackgroundBlurStyleEtsTest003
+ */
+ it('testcommonBackgroundBlurStyle003', 0, async function (done) {
+ console.info('commonBackgroundBlurStyle testcommonBackgroundBlurStyle003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('sepiaText');
+ console.info("[testcommonBackgroundBlurStyle003] component sepia strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.sepia).assertEqual(1);
+ console.info("[testcommonBackgroundBlurStyle003] sepia value :" + obj.$attrs.sepia);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_004
+ * @tc.name testcommonBackgroundBlurStyle004
+ * @tc.desic acecommonBackgroundBlurStyleEtsTest004
+ */
+ it('testcommonBackgroundBlurStyle004', 0, async function (done) {
+ console.info('commonBackgroundBlurStyle testcommonBackgroundBlurStyle004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('alignRulesText');
+ console.info("[testcommonBackgroundBlurStyle004] component alignRules strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ let targetValue = {
+ top: {
+ anchor: 'target', align: VerticalAlign.Bottom
+ },
+ right: {
+ anchor: "target", align: HorizontalAlign.Center
+ }
+ };
+ expect(obj.$attrs.alignRules).assertEqual(undefined);
+ console.info("[testcommonBackgroundBlurStyle004] alignRules value :" + JSON.stringify(obj.$attrs.alignRules));
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_005
+ * @tc.name testcommonBackgroundBlurStyle005
+ * @tc.desic acecommonBackgroundBlurStyleEtsTest005
+ */
+ it('testcommonBackgroundBlurStyle005', 0, async function (done) {
+ console.info('commonBackgroundBlurStyle testcommonBackgroundBlurStyle005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('backgroundBlurStyleText');
+ console.info("[testcommonBackgroundBlurStyle005] component backgroundBlurStyle strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined);
+ console.info("[testcommonBackgroundBlurStyle005] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_006
+ * @tc.name testcommonBackgroundBlurStyle006
+ * @tc.desic acecommonBackgroundBlurStyleEtsTest006
+ */
+ it('testcommonBackgroundBlurStyle006', 0, async function (done) {
+ console.info('commonBackgroundBlurStyle testcommonBackgroundBlurStyle006 START');
+ console.info("common onKeyEvent click result is: " + JSON.stringify(sendEventByKey('onKeyEventButton', 10, "")));
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testcommonHoverEffectHighlight0006
+ * @tc.desic acecommonHoverEffectHighlightEtsTest0006
+ */
+ it('testcommonHoverEffectHighlight0001', 0, async function (done) {
+ console.info('commonHoverEffectHighlight testcommonHoverEffectHighlight0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('hoverEffectText');
+ console.info("[testcommonHoverEffectHighlight0001] component hoverEffect strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$attrs.hoverEffect).assertEqual(undefined);
+ console.info("[testcommonHoverEffectHighlight0001] hoverEffect value :" + obj.$attrs.hoverEffect);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testcommonHoverEffectScale0007
+ * @tc.desic acecommonHoverEffectScaleEtsTest0007
+ */
+ it('testcommonHoverEffectScale0001', 0, async function (done) {
+ console.info('commonHoverEffectScale testcommonHoverEffectScale0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('hoverEffectScaleText');
+ console.info("[testcommonHoverEffectScale0001] component hoverEffect strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$attrs.hoverEffect).assertEqual(undefined);
+ console.info("[testcommonHoverEffectScale0001] hoverEffect value :" + obj.$attrs.hoverEffect);
+ done();
+ });
+
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common_ts_ets_api.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common_ts_ets_api.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0f3b42d3c4370f5f178c8050f42f24dcfd57578c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/common_ts_ets_api.test.ets
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function common_ts_ets_apiStaticClearJsunit() {
+ describe('common_ts_ets_apiStaticClearTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/common_ts_ets_api',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get common_ts_ets_api state success " + JSON.stringify(pages));
+ if (!("common_ts_ets_api" == pages.name)) {
+ console.info("get common_ts_ets_api state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push common_ts_ets_api page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push common_ts_ets_api page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("common_ts_ets_apiStaticClear after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testcommon_ts_ets_apiPersistProp0001
+ * @tc.desic acecommon_ts_ets_apiPersistPropEtsTest0001
+ */
+ it('testcommon_ts_ets_apiPersistProp0001', 0, async function (done) {
+ console.info('common_ts_ets_apiPersistProp testcommon_ts_ets_apiPersistProp0001 START');
+ await Utils.sleep(2000);
+ try {
+ var innerEvent = {
+ eventId: 60230,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("common_ts_ets_apiPersistProp0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Score).assertEqual("Score");
+ done()
+ }
+ console.info("PersistProp0001 click result is: " + JSON.stringify(sendEventByKey('PersistPropText', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("common_ts_ets_apiPersistProp0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testcommon_ts_ets_apiEnvProp0001
+ * @tc.desic acecommon_ts_ets_apiEnvPropEtsTest0001
+ */
+ it('testcommon_ts_ets_apiEnvProp0001', 0, async function (done) {
+ console.info('common_ts_ets_apiEnvProp testcommon_ts_ets_apiEnvProp0001 START');
+ await Utils.sleep(2000);
+ try {
+ var innerEvent = {
+ eventId: 60231,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("common_ts_ets_apiEnvProp0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual(false);
+ done()
+ }
+ console.info("EnvProp0001 click result is: " + JSON.stringify(sendEventByKey('EnvPropText', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("common_ts_ets_apiEnvProp0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/curves.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/curves.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b88e91194994842e54df01ecec234eff0aa5666b
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/curves.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function curvesStepsJsunit() {
+ describe('curvesStepsTest', function () {
+
+ /**
+ * run before testcase
+ */
+ beforeAll(async function (done) {
+ console.info('[curvesStepsTest] before each called')
+
+ let result;
+ let options = {
+ uri: 'pages/curves'
+ }
+ try {
+ result = router.push(options)
+ console.info("push curves page success " + JSON.stringify(result));
+ } catch (err) {
+ console.error("push curves page error " + JSON.stringify(result));
+ }
+ await Utils.sleep(4000)
+ done()
+ });
+
+ /**
+ * run after testcase
+ */
+ afterAll(async function () {
+ console.info('[curvesStepsTest] after each called')
+ await Utils.sleep(1000)
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testcurvesSteps0001
+ * @tc.desic acecurvesStepsEtsTest0001
+ */
+ it('testcurvesSteps0001', 0, async function (done) {
+ console.info('curvesSteps testcurvesSteps0001 START');
+ var innerEvent = {
+ eventId: 60229,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ try{
+ console.info("callback success" );
+ console.info("curveApi eventData.data.curveApi result is: " + eventData.data.curveApi);
+ expect(eventData.data.curveApi).assertEqual("callBackSuccess");
+ console.info("curveApi end");
+ }catch(err){
+ console.info("curveApi on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try{
+ console.info("curveApi click result is: " + JSON.stringify(sendEventByKey('stepsText', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ }catch(err){
+ console.info("curveApi on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e0ec74a398c381554af21da2acf80478d6f98616
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function ellipseNeJsunit() {
+ describe('ellipseNeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/ellipse',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get ellipse state success " + JSON.stringify(pages));
+ if (!("ellipse" == pages.name)) {
+ console.info("get ellipse state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push ellipse page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push ellipse page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("ellipseNe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testellipseNe0001
+ * @tc.desic aceellipseNeEtsTest0001
+ */
+ it('testellipseNe0001', 0, async function (done) {
+ console.info('ellipseNe testellipseNe0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ellipse');
+ console.info("[testellipseNe0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("300.00px");
+ console.info("[testellipseNe0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testellipseNe0002
+ * @tc.desic aceellipseNeEtsTest0002
+ */
+ it('testellipseNe0002', 0, async function (done) {
+ console.info('ellipseNe testellipseNe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ellipse');
+ console.info("[testellipseNe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("300.00px");
+ console.info("[testellipseNe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/featureAbility.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/featureAbility.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f62604e03f4e86c095c7153b659433aac35ff0ac
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/featureAbility.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function featureAbilityStartAbilityJsunit() {
+ describe('featureAbilityStartAbilityTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/featureAbility',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get featureAbility state success " + JSON.stringify(pages));
+ if (!("featureAbility" == pages.name)) {
+ console.info("get featureAbility state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push featureAbility page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push featureAbility page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("featureAbilityStartAbility after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testfeatureAbilityStartAbility0001
+ * @tc.desic acefeatureAbilityStartAbilityEtsTest0001
+ */
+ it('testfeatureAbilityStartAbility0001', 0, async function (done) {
+ console.info('featureAbilityStartAbility testfeatureAbilityStartAbility0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('startAbilityText');
+ console.info("[testfeatureAbilityStartAbility0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual("320.00vp");
+ console.info("[testfeatureAbilityStartAbility0001] width value :" + obj.$attrs.width);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gauge.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gauge.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0d536a37a54b6d2b2de62e596863b58ca83d7675
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gauge.test.ets
@@ -0,0 +1,150 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function gaugeColorsJsunit() {
+ describe('gaugeColorsTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/gauge',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get gauge state success " + JSON.stringify(pages));
+ if (!("gauge" == pages.name)) {
+ console.info("get gauge state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push gauge page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push gauge page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("gaugeColors after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testgaugeColors0001
+ * @tc.desic acegaugeColorsEtsTest0001
+ */
+ it('testgaugeColors0001', 0, async function (done) {
+ console.info('gaugeColors testgaugeColors0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Gauge');
+ console.info("[testgaugeColors0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Gauge');
+ expect(obj.$attrs.width).assertEqual("200.00vp");
+ console.info("[testgaugeColors0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testgaugeColors0002
+ * @tc.desic acegaugeColorsEtsTest0002
+ */
+ it('testgaugeColors0002', 0, async function (done) {
+ console.info('gaugeColors testgaugeColors0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Gauge');
+ console.info("[testgaugeColors0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Gauge');
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ console.info("[testgaugeColors0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testgaugeColors0003
+ * @tc.desic acegaugeColorsEtsTest0003
+ */
+ it('testgaugeColors0003', 0, async function (done) {
+ console.info('gaugeColors testgaugeColors0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Gauge');
+ console.info("[testgaugeColors0003] component startAngle strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Gauge');
+ expect(obj.$attrs.startAngle).assertEqual("210.00");
+ console.info("[testgaugeColors0003] startAngle value :" + obj.$attrs.startAngle);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testgaugeColors0004
+ * @tc.desic acegaugeColorsEtsTest0004
+ */
+ it('testgaugeColors0004', 0, async function (done) {
+ console.info('gaugeColors testgaugeColors0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Gauge');
+ console.info("[testgaugeColors0004] component endAngle strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Gauge');
+ expect(obj.$attrs.endAngle).assertEqual("150.00");
+ console.info("[testgaugeColors0004] endAngle value :" + obj.$attrs.endAngle);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testgaugeColors0005
+ * @tc.desic acegaugeColorsEtsTest0005
+ */
+ it('testgaugeColors0005', 0, async function (done) {
+ console.info('gaugeColors testgaugeColors0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Gauge');
+ console.info("[testgaugeColors0005] component strokeWidth strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Gauge');
+ expect(obj.$attrs.strokeWidth).assertEqual("20.00vp");
+ console.info("[testgaugeColors0005] strokeWidth value :" + obj.$attrs.strokeWidth);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testgaugeColors0006
+ * @tc.desic acegaugeColorsEtsTest0006
+ */
+ it('testgaugeColors0006', 0, async function (done) {
+ console.info('gaugeColors testgaugeColors0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Gauge');
+ console.info("[testgaugeColors0006] component colors strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Gauge');
+ expect(obj.$attrs.colors).assertEqual('["#FF317AF7","#FF5BA854","#FFE08C3A","#FF9C554B","#FFD94838"]');
+ console.info("[testgaugeColors0006] colors value :" + obj.$attrs.colors);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gesture.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gesture.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b5859c8793b8d35a775a2581e4f840dbace13fbe
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gesture.test.ets
@@ -0,0 +1,128 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function gestureSetDirectionJsunit() {
+ describe('gestureSetDirectionTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/gesture',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get gesture state success " + JSON.stringify(pages));
+ if (!("gesture" == pages.name)) {
+ console.info("get gesture state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push gesture page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push gesture page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("gestureSetDirection after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testgestureSetDirection0001
+ * @tc.desic acegestureSetDirectionEtsTest0001
+ */
+ it('testgestureSetDirection0001', 0, async function (done) {
+ console.info('gestureSetDirection testgestureSetDirection0001 START');
+ await Utils.sleep(2000);
+ try{
+ let callback = (indexEvent) => {
+ console.info("onClick_0001 get state result is: " + JSON.stringify(indexEvent));
+ expect(indexEvent.data.STATUS).assertEqual(PanDirection.Vertical);
+ }
+ let indexEvent = {
+ eventId: 60204,
+ priority: events_emitter.EventPriority.LOW
+ }
+ sendEventByKey('setDirectionPanGesture', 10, "")
+ events_emitter.on(indexEvent, callback);
+ }catch(err){
+ console.info("onClick_0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('gestureSetDirection testgestureSetDirection0002 END')
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testgestureSetDistance0002
+ * @tc.desic acegestureSetDistanceEtsTest0002
+ */
+ it('testgestureSetDistance0002', 0, async function (done) {
+ console.info('gestureSetDistance testgestureSetDistance0002 START');
+ await Utils.sleep(2000);
+ try{
+ let callback = (indexEvent) => {
+ console.info("onClick_0002 get state result is: " + JSON.stringify(indexEvent));
+ expect(indexEvent.data.STATUS).assertEqual(4.0);
+ }
+ let indexEvent = {
+ eventId: 60205,
+ priority: events_emitter.EventPriority.LOW
+ }
+ sendEventByKey('setDistancePanGesture', 10, "")
+ events_emitter.on(indexEvent, callback);
+ }catch(err){
+ console.info("onClick_0002 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('gestureSetDistance testgestureSetDistance0002 END');
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testgestureSetFingers0003
+ * @tc.desic acegestureSetFingersEtsTest0003
+ */
+ it('testgestureSetFingers0003', 0, async function (done) {
+ console.info('gestureSetFingers testgestureSetFingers0003 START');
+ await Utils.sleep(2000);
+ try{
+ let callback = (indexEvent) => {
+ console.info("onClick_0003 get state result is: " + JSON.stringify(indexEvent));
+ expect(indexEvent.data.STATUS).assertEqual(true);
+ }
+ let indexEvent = {
+ eventId: 60206,
+ priority: events_emitter.EventPriority.LOW
+ }
+ sendEventByKey('setFingersPanGesture', 10, "")
+ events_emitter.on(indexEvent, callback);
+ }catch(err){
+ console.info("onClick_0003 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('gestureSetFingers testgestureSetFingers0003 END');
+ done();
+ });
+
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/global.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/global.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..5e2cbde4c685427a7f37c5f6407fdb88136fb1c0
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/global.test.ets
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import events_emitter from '@ohos.events.emitter';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function globalJsunit() {
+ describe('globalJsunit', function () {
+ beforeEach(async function (done) {
+ console.info("global beforeEach start");
+ let options = {
+ uri: 'pages/global',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get global state pages:" + JSON.stringify(pages));
+ if (!("global" == pages.name)) {
+ console.info("get global state pages.name:" + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push global page result:" + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push global page error:" + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testglobal_getInspectorTree0001
+ * @tc.desic aceGlobal_getInspectorTree0001
+ */
+ it('testglobal_getInspectorTree0001', 0, async function (done) {
+ console.info('testglobal_getInspectorTree0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorTree();
+ console.info("[testglobal_getInspectorTree0001] strJson:" + strJson);
+ expect(strJson !== null).assertTrue();
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testglobal_sendKeyEvent0002
+ * @tc.desic aceGlobal_sendKeyEvent0002
+ */
+ it('testglobal_sendKeyEvent0002', 0, async function (done) {
+ console.info('testglobal_sendKeyEvent0002 START');
+ await Utils.sleep(2000);
+ let KeyEvent = {type:1,keyCode:2027,keyText:"Unknown",keySource:4,deviceId:7,metaKey:0,timestamp:5284417765376};
+ let result = sendKeyEvent(KeyEvent);
+ console.info("[testglobal_sendKeyEvent0002] result:" + result);
+ expect(JSON.stringify(result)).assertEqual("true");
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testglobal_sendMouseEvent0003
+ * @tc.desic aceGlobal_sendMouseEvent0003
+ */
+ it('testglobal_sendMouseEvent0003', 0, async function (done) {
+ console.info('testglobal_sendMouseEvent0003 START');
+ await Utils.sleep(2000);
+ let mouseEvent = {button:0,action:3,screenX:202.66666666666666,screenY:102.66666666666667,x:34,y:34,timestamp:8261302454000,source:1,
+ target:{area:{position:{x:158.66666666666666,y:58.666666666666664},globalPosition:{x:168.66666666666666,y:68.66666666666666},width:142.66666666666666,height:58.666666666666664}}};
+ let result = sendMouseEvent(mouseEvent);
+ console.info("[testglobal_sendMouseEvent0003] result:" + result);
+ expect(JSON.stringify(result)).assertEqual("true");
+ done();
+ });
+ })
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..137a40f4813114592cc0c84d03d3b1699b7e3bd3
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid.test.ets
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import events_emitter from '@ohos.events.emitter';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function gridMaxCountJsunit() {
+ describe('gridMaxCountTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/grid',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get grid state success " + JSON.stringify(pages));
+ if (!("grid" == pages.name)) {
+ console.info("get grid state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push grid page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push grid page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("gridMaxCount after each called");
+ });
+
+ it('testcheckgridMaxCount0001', 0, async function (done) {
+ console.info('testcheckgridMaxCount testcheckgridMaxCount0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('maxCountTest');
+ console.info("[testcheckgridMaxCount0001] component selectedMaxcount strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Grid');
+ expect(obj.$attrs.maxCount).assertEqual("5");
+ console.info("[testcheckgridMaxCount0001] selectedMaxCount value :" + obj.$attrs.maxCount);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gridItem.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gridItem.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..62ea6348b9b60b90400d38c2152ecbe26488703e
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/gridItem.test.ets
@@ -0,0 +1,74 @@
+
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function gridItemOnSelectJsunit() {
+ describe('gridItemOnSelectTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/gridItem',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get gridItem state success " + JSON.stringify(pages));
+ if (!("gridItem" == pages.name)) {
+ console.info("get gridItem state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push gridItem page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push gridItem page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("gridItemOnSelect after each called");
+ });
+
+
+ it('testgridItemOnSelect0001', 0, async function (done) {
+ console.info('testgridItemOnSelect testgridItemOnSelect0001 START');
+ await Utils.sleep(2000);
+ let callback = (indexEvent) => {
+ console.info("onSelect_0001 get state result is: " + JSON.stringify(indexEvent));
+ expect(indexEvent.data.STATUS).assertEqual(true);
+ done();
+ }
+ let indexEvent = {
+ eventId: 60207,
+ priority: events_emitter.EventPriority.LOW
+ }
+ sendEventByKey('onSelected', 10, "")
+ try {
+ events_emitter.on(indexEvent, callback);
+ } catch (err) {
+ console.info("onSelect_0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testgridItemOnSelect0001 END');
+ done();
+ });
+
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_col.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_col.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..13bbd28b904957798da51e9508a1aeaf94f3abb4
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_col.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function grid_colSpanJsunit() {
+ describe('grid_colSpanTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/grid_col',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get grid_col state success " + JSON.stringify(pages));
+ if (!("grid_col" == pages.name)) {
+ console.info("get grid_col state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push grid_col page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push grid_col page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("grid_colSpan after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testgrid_colSpan0001
+ * @tc.desic acegrid_colSpanEtsTest0001
+ */
+ it('testgrid_colSpan0001', 0, async function (done) {
+ console.info('grid_rowOnBreakpointChange testgrid_colSpan0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('gridContainer');
+ console.info("[testgrid_colSpan0001] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('GridCol');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testgrid_colSpan0001] width value :" + obj.$attrs.width);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_row.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_row.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..26ce142740b502d35bde75e70285f52a53e268b2
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/grid_row.test.ets
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function grid_rowOnBreakpointChangeJsunit() {
+ describe('grid_rowOnBreakpointChangeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/grid_row',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get grid_row state success " + JSON.stringify(pages));
+ if (!("grid_row" == pages.name)) {
+ console.info("get grid_row state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push grid_row page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push grid_row page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("grid_rowOnBreakpointChange after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name testgrid_rowOnBreakpointChange001
+ * @tc.desic acegrid_rowOnBreakpointChangeEtsTest001
+ */
+ it('testgrid_rowOnBreakpointChange001', 0, async function (done) {
+ console.info('grid_rowOnBreakpointChange testgrid_rowOnBreakpointChange001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('GridRow');
+ console.info("[testgrid_rowOnBreakpointChange001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('GridRow');
+ expect(obj.$attrs.width).assertEqual("100vp");
+ console.info("[testgrid_rowOnBreakpointChange001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_002
+ * @tc.name testgrid_rowOnBreakpointChange002
+ * @tc.desic acegrid_rowOnBreakpointChangeEtsTest002
+ */
+ it('testgrid_rowOnBreakpointChange002', 0, async function (done) {
+ console.info('grid_rowOnBreakpointChange testgrid_rowOnBreakpointChange002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('GridRow');
+ console.info("[testgrid_rowOnBreakpointChange002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('GridRow');
+ expect(obj.$attrs.height).assertEqual("100vp");
+ console.info("[testgrid_rowOnBreakpointChange002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_003
+ * @tc.name testgrid_rowOnBreakpointChange003
+ * @tc.desic acegrid_rowOnBreakpointChangeEtsTest003
+ */
+ it('testgrid_rowOnBreakpointChange003', 0, async function (done) {
+ console.info('grid_rowOnBreakpointChange testgrid_rowOnBreakpointChange003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('GridRow');
+ console.info("[testgrid_rowOnBreakpointChange003] component backgroundColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('GridRow');
+ expect(obj.$attrs.backgroundColor).assertEqual("0xFF0000");
+ console.info("[testgrid_rowOnBreakpointChange003] backgroundColor value :" + obj.$attrs.backgroundColor);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7e069eeed4342bf4795a7bd31d74464b14698e2c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets
@@ -0,0 +1,200 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import events_emitter from '@ohos.events.emitter';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function inspectorJsunit() {
+ describe('inspectorTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/inspector',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get inspector state success " + JSON.stringify(pages));
+ if (!("inspector" == pages.name)) {
+ console.info("get inspector state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push inspector page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push inspector page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ console.info("inspectorTest after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testlazyForEachOnDataAdd0001
+ * @tc.desic acelazyForEachOnDataAddEtsTest0001
+ */
+ it('testInspectorTestAdd0001', 0, async function (done) {
+ console.info('Inspector testInspectorTestAdd0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('inspectorApiOne');
+ console.info("[testInspectorTestAdd0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontSize).assertEqual("50.00fp");
+ console.info("[testInspectorTestAdd0001] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testInspectorTestAdd0002
+ * @tc.desic aceTestInspectorTestAdd0002
+ */
+ it('testInspectorTestAdd0002', 0, async function (done) {
+ console.info('Inspector testInspectorTestAdd0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('inspectorApiOne');
+ console.info("[testInspectorTestAdd0002] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bold");
+ console.info("[testInspectorTestAdd0002] fontWeight value :" + obj.$attrs.fontWeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testInspectorTestAdd0003
+ * @tc.desic aceTestInspectorTestAdd0003
+ */
+ it('testInspectorTestAdd0003', 0, async function (done) {
+ console.info("testInspectorTestAdd0003 start test");
+ var innerEvent1 = {
+ eventId: 60208,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("eventData.data.getInspectorNodes result is: " + eventData.data.getInspectorNodes);
+ try{
+ console.info("callback1 success" );
+ console.info("inspector_101 eventData.data.result result is: " + eventData.data.result);
+ expect(eventData.data.result).assertEqual("success");
+ console.info("inspector_101 end: ");
+ if(eventData.data.getInspectorNodes != null){
+ console.info("eventData.data.result result is: " + eventData.data.result);
+ expect(eventData.data.result).assertEqual("success");
+ }
+ }catch(err){
+ console.info("inspector_101 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try {
+ events_emitter.on(innerEvent1, callback1);
+ console.info("inspector_101 click result is: " + JSON.stringify(sendEventByKey('inspectorApiOne', 10, "")));
+ } catch (err) {
+ console.info("inspector_101 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testInspectorTestAdd0004
+ * @tc.desic aceTestInspectorTestAdd0004
+ */
+ it('testInspectorTestAdd0004', 0, async function (done) {
+ var innerEvent2 = {
+ eventId: 60209,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback2 = (eventData) => {
+ console.info("eventData.data.getInspectorNodeById result is: " + eventData.data.getInspectorNodeById);
+ try{
+ console.info("callback2 success" );
+ console.info("inspector_102 eventData.data.result result is: " + eventData.data.result);
+ expect(eventData.data.result).assertEqual("success");
+ console.info("inspector_102 end");
+ }catch(err){
+ console.info("inspector_102 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try{
+ console.info("inspector_102 click result is: " + JSON.stringify(sendEventByKey('inspectorApiTwo', 10, "")));
+ events_emitter.on(innerEvent2, callback2);
+ }catch(err){
+ console.info("inspector_102 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testInspectorTestAdd0005
+ * @tc.desic aceTestInspectorTestAdd0005
+ */
+ it('testInspectorTestAdd0005', 0, async function (done) {
+ console.info('testInspectorTestAdd0005 START');
+ try {
+ var eventData = {
+ data: {
+ "setColor": 'red'
+ }
+ }
+ var innerEvent = {
+ eventId: 60211,
+ priority: events_emitter.EventPriority.LOW
+ }
+ events_emitter.emit(innerEvent, eventData);
+ } catch (err) {
+ console.log("[testInspectorTestAdd0005] change component data error: " + err.message);
+ }
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testInspectorTestAdd0006
+ * @tc.desic aceTestInspectorTestAdd0006
+ */
+ it('testInspectorTestAdd0006', 0, async function (done) {
+ var innerEvent3 = {
+ eventId: 60210,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback3 = (eventData) => {
+ try{
+ console.info("callback3 success" );
+ console.info("inspector_103 eventData.data.result result is: " + eventData.data.catchStatus);
+ expect(eventData.data.catchStatus).assertEqual("callBackSuccess");
+ console.info("inspector_103 end");
+ }catch(err){
+ console.info("inspector_103 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try{
+ console.info("inspector_103 click result is: " + JSON.stringify(sendEventByKey('inspectorApiFour', 10, "")));
+ events_emitter.on(innerEvent3, callback3);
+ }catch(err){
+ console.info("inspector_103 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b7843c5e44f2cb038e08470d3e069dcef9edf08d
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets
@@ -0,0 +1,177 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function lazyForEachOnDataAddJsunit() {
+ describe('lazyForEachOnDataAddTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/lazyForEach',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get lazyForEach state success " + JSON.stringify(pages));
+ if (!("lazyForEach" == pages.name)) {
+ console.info("get lazyForEach state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push lazyForEach page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push lazyForEach page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("lazyForEachOnDataAdd after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testlazyForEachOnDataAdd0001
+ * @tc.desic acelazyForEachOnDataAddEtsTest0001
+ */
+ it('testlazyForEachOnDataAdd0001', 0, async function (done) {
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0001 START');
+
+ var innerEvent1 = {
+ eventId: 60212,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("eventData.data.result1 result is: " + eventData.data.result1);
+ try{
+ console.info("callback1 success" );
+ console.info("Lazy_101 eventData.data.result1 result is: " + eventData.data.result1);
+ expect(eventData.data.result1).assertEqual(true);
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0001 END');
+ }catch(err){
+ console.info("Lazy_101 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try{
+ console.info("Lazy_101 click result is:" + JSON.stringify(sendEventByKey('listItemOne', 10, "")));
+ events_emitter.on(innerEvent1, callback1);
+ }catch(err){
+ console.info("Lazy_101 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testlazyForEachOnDataAdd0002
+ * @tc.desic acelazyForEachOnDataAddEtsTest0002
+ */
+ it('testlazyForEachOnDataAdd0002', 0, async function (done) {
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0002 START');
+
+ var innerEvent2 = {
+ eventId: 60213,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback2 = (eventData) => {
+ console.info("eventData.data.result2 result is: " + eventData.data.result2);
+ try{
+ console.info("callback2 success" );
+ console.info("Lazy_102 eventData.data.result2 result is: " + eventData.data.result2);
+ expect(eventData.data.result2).assertEqual(true);
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0002 END');
+ }catch(err){
+ console.info("Lazy_102 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try{
+ console.info("Lazy_102 click result is:" + JSON.stringify(sendEventByKey('listItemTwo', 10, "")));
+ events_emitter.on(innerEvent2, callback2);
+ }catch(err){
+ console.info("Lazy_102 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testlazyForEachOnDataAdd0003
+ * @tc.desic acelazyForEachOnDataAddEtsTest0003
+ */
+ it('testlazyForEachOnDataAdd0003', 0, async function (done) {
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0003 START');
+
+ var innerEvent3 = {
+ eventId: 60214,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback3 = (eventData) => {
+ console.info("eventData.data.result3 result is: " + eventData.data.result3);
+ try{
+ console.info("callback3 success" );
+ console.info("Lazy_103 eventData.data.result3 result is: " + eventData.data.result3);
+ expect(eventData.data.result3).assertEqual(true);
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0003 END');
+ }catch(err){
+ console.info("Lazy_103 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try{
+ console.info("Lazy_103 click result is:" + JSON.stringify(sendEventByKey('listItemThree', 10, "")));
+ events_emitter.on(innerEvent3, callback3);
+ }catch(err){
+ console.info("Lazy_103 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testlazyForEachOnDataAdd0004
+ * @tc.desic acelazyForEachOnDataAddEtsTest0004
+ */
+ it('testlazyForEachOnDataAdd0004', 0, async function (done) {
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0004 START');
+
+ var innerEvent4 = {
+ eventId: 60215,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback4 = (eventData) => {
+ console.info("eventData.data.result4 result is: " + eventData.data.result4);
+ try{
+ console.info("callback4 success" );
+ console.info("Lazy_104 eventData.data.result4 result is: " + eventData.data.result4);
+ expect(eventData.data.result4).assertEqual(true);
+ console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0004 END');
+ }catch(err){
+ console.info("Lazy_104 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try{
+ console.info("Lazy_104 click result is:" + JSON.stringify(sendEventByKey('listItemFour', 10, "")));
+ events_emitter.on(innerEvent4, callback4);
+ }catch(err){
+ console.info("Lazy_104 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/line.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/line.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a97b85248d8dac9093a3ae28a56a8642941268e7
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/line.test.ets
@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function lineNeJsunit() {
+ describe('lineNeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/line',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get line state success " + JSON.stringify(pages));
+ if (!("line" == pages.name)) {
+ console.info("get line state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push line page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push line page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("lineNe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testlineNe0001
+ * @tc.desic acelineNeEtsTest0001
+ */
+ it('testlineNe0001', 0, async function (done) {
+ console.info('lineNe testlineNe0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('line1');
+ console.info("[testlineNe0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("75.00px");
+ console.info("[testlineNe0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testlineNe0002
+ * @tc.desic acelineNeEtsTest0002
+ */
+ it('testlineNe0002', 0, async function (done) {
+ console.info('lineNe testlineNe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('line1');
+ console.info("[testlineNe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("150.00px");
+ console.info("[testlineNe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testlineNe0005
+ * @tc.desic acelineNeEtsTest0005
+ */
+ it('testlineNe0005', 0, async function (done) {
+ console.info('lineNe testlineNe0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('line2');
+ console.info("[testlineNe0005] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("300.00px");
+ console.info("[testlineNe0005] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testlineNe0006
+ * @tc.desic acelineNeEtsTest0006
+ */
+ it('testlineNe0006', 0, async function (done) {
+ console.info('lineNe testlineNe0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('line2');
+ console.info("[testlineNe0006] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("300.00px");
+ console.info("[testlineNe0006] height value :" + obj.$attrs.height);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..83a3668e78ebb7c00baa571a1113a9ae9d2f5621
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets
@@ -0,0 +1,181 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function listNewJsunit() {
+ describe('listNewJsunit', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/list',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get list state success " + JSON.stringify(pages));
+ if (!("list" == pages.name)) {
+ console.info("get list state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push list page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push list page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("listNe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testListNew0001
+ * @tc.desic acelistNewEtsTest0001
+ */
+ it('testListNew0001', 0, async function (done) {
+ console.info('listNe testListNew0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('list1');
+ console.info("[testListNew0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('List');
+ expect(obj.$attrs.width).assertEqual("90.00%");
+ console.info("[testListNew0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testListNe0002
+ * @tc.desic acelistNeEtsTest0002
+ */
+ it('testListNe0002', 0, async function (done) {
+ console.info('listNe testListNe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('list1');
+ console.info("[testListNe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('List');
+ expect(obj.$attrs.height).assertEqual("300.00vp");
+ console.info("[testListNe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testListNe0003
+ * @tc.desic acelistNeEtsTest0003
+ */
+ it('testListNe0003', 0, async function (done) {
+ console.info('listNe testListNe0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('list1');
+ console.info("[testListNe0003] component editMode strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('List');
+ expect(obj.$attrs.editMode).assertEqual("true");
+ console.info("[testListNe0003] editMode value :" + obj.$attrs.editMode);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testListNe0004
+ * @tc.desic acelistNeEtsTest0004
+ */
+ it('testListNe0004', 0, async function (done) {
+ console.info('listNe testListNe0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('list1');
+ console.info("[testListNe0004] component alignListItem strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('List');
+ expect(obj.$attrs.alignListItem).assertEqual(undefined);
+ console.info("[testListNe0004] alignListItem value :" + obj.$attrs.alignListItem);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testListNe0006
+ * @tc.desic acelistNeEtsTest0006
+ */
+ it('testListNe0006', 0, async function (done) {
+ console.info('listNe testListNe0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('list1');
+ console.info("[testListNe0006] component lanes strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('List');
+ expect(obj.$attrs.lanes).assertEqual(undefined);
+ console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testListNe0006
+ * @tc.desic acelistNeEtsTest0006
+ */
+ it('testListNe0006', 0, async function (done) {
+ console.info('listNe testListNe0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('list1');
+ console.info("[testListNe0006] component lanes strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('List');
+ expect(obj.$attrs.lanes).assertEqual(undefined);
+ console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testListNe0007
+ * @tc.desic acelistNeEtsTest0007
+ */
+ it('testListNe0007', 0, async function (done) {
+ console.info('listNe testListNe0007 START');
+ var innerEvent = {
+ eventId: 60216,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ try{
+ console.info("callback success" );
+ console.info("testListNe0007 eventData.data.result result is: " + eventData.data.result);
+ expect(eventData.data.result).assertEqual("success");
+ console.info("testListNe0007 end");
+ }catch(err){
+ console.info("testListNe0007 on events_emitter err : " + JSON.stringify(err));
+ }
+ }
+ try{
+ console.info("testListNe0007 click result is: " + JSON.stringify(sendEventByKey('onScrollBegin', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ }catch(err){
+ console.info("testListNe0007 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f10dc1c67a892377be8877d287b0da08a02e8d7f
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets
@@ -0,0 +1,113 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function list_itemOnSelectJsunit() {
+ describe('list_itemOnSelectTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/list_item',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get list_item state success " + JSON.stringify(pages));
+ if (!("list_item" == pages.name)) {
+ console.info("get list_item state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push list_item page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push list_item page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("list_itemOnSelect after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testlist_itemOnSelect0001
+ * @tc.desic acelist_itemOnSelectEtsTest0001
+ */
+ it('testlist_itemOnSelect0001', 0, async function (done) {
+ console.info('selectOnSelect testlist_itemOnSelect0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ListItem');
+ console.info("[testlist_itemOnSelect0001] component border strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ListItem');
+ expect(obj.$attrs.editable).assertEqual("true");
+ console.info("[testlist_itemOnSelect0001] editable value :" + obj.$attrs.editable);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testlist_itemOnSelect0002
+ * @tc.desic acelist_itemOnSelectEtsTest0002
+ */
+ it('testlist_itemOnSelect0002', 0, async function (done) {
+ console.info('selectOnSelect testlist_itemOnSelect0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ListItem');
+ console.info("[testlist_itemOnSelect0002] component border strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ListItem');
+ expect(obj.$attrs.selectable).assertEqual(undefined);
+ console.info("[testlist_itemOnSelect0002] selectable value :" + obj.$attrs.selectable);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testlist_itemOnSelect0003
+ * @tc.desic acelist_itemOnSelectEtsTest0002
+ */
+ it('testlist_itemOnSelect0003', 0, async function (done) {
+ console.info('selectOnSelect testlist_itemOnSelect0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ListItem');
+ console.info("[testlist_itemOnSelect0003] component border strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ListItem');
+ expect(obj.$attrs.sticky).assertEqual("Sticky.None");
+ console.info("[testlist_itemOnSelect0003] sticky value :" + obj.$attrs.sticky);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testlist_itemSwipeAction0004
+ * @tc.desic acelist_itemSwipeActionEtsTest0004
+ */
+ it('testlist_itemSwipeAction0004', 0, async function (done) {
+ console.info('selectOnSelect testlist_itemSwipeAction0004 START');
+ await Utils.sleep(2000);
+ let obj = JSON.stringify(sendEventByKey('Del', 10, ""))
+ expect(obj).assertEqual('false');
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/mediaQuery.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/mediaQuery.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c4db15026871176dcea7f84edbd896b8c7a4c46e
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/mediaQuery.test.ets
@@ -0,0 +1,257 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function mediaQueryOffJsunit() {
+ describe('mediaQueryOffTest', function () {
+
+ /**
+ * run before testcase
+ */
+ beforeAll(async function (done) {
+ console.info('[mediaQueryOffTest] before each called')
+
+ let result;
+ let options = {
+ uri: 'pages/mediaQuery'
+ }
+ try {
+ result = router.push(options)
+ console.info("push mediaQuery page success " + JSON.stringify(result));
+ } catch (err) {
+ console.error("push mediaQuery page error " + JSON.stringify(result));
+ }
+ await Utils.sleep(4000)
+ done()
+ });
+
+ /**
+ * run after testcase
+ */
+ afterAll(async function () {
+ console.info('[mediaQueryOffTest] after each called')
+ await Utils.sleep(1000)
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testmediaQueryOff0001
+ * @tc.desic acemediaQueryOffEtsTest0001
+ */
+ it('testmediaQueryOff0001', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testmediaQueryOff0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testmediaQueryOff0002
+ * @tc.desic acemediaQueryOffEtsTest0002
+ */
+ it('testmediaQueryOff0002', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.height).assertEqual("70.00vp");
+ console.info("[testmediaQueryOff0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testmediaQueryOff0003
+ * @tc.desic acemediaQueryOffEtsTest0003
+ */
+ it('testmediaQueryOff0003', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontSize).assertEqual("20.00fp");
+ console.info("[testmediaQueryOff0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testmediaQueryOff0004
+ * @tc.desic acemediaQueryOffEtsTest0004
+ */
+ it('testmediaQueryOff0004', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testmediaQueryOff0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testmediaQueryOff0005
+ * @tc.desic acemediaQueryOffEtsTest0005
+ */
+ it('testmediaQueryOff0005', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
+ console.info("[testmediaQueryOff0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testmediaQueryOff0006
+ * @tc.desic acemediaQueryOffEtsTest0006
+ */
+ it('testmediaQueryOff0006', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
+ console.info("[testmediaQueryOff0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testmediaQueryOff0007
+ * @tc.desic acemediaQueryOffEtsTest0007
+ */
+ it('testmediaQueryOff0007', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
+ console.info("[testmediaQueryOff0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testmediaQueryOff0009
+ * @tc.desic acemediaQueryOffEtsTest0009
+ */
+ it('testmediaQueryOff0009', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.padding).assertEqual("10.00vp");
+ console.info("[testmediaQueryOff0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testmediaQueryOff0010
+ * @tc.desic acemediaQueryOffEtsTest0010
+ */
+ it('testmediaQueryOff0010', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('offText');
+ console.info("[testmediaQueryOff0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
+ console.info("[testmediaQueryOff0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testmediaQueryOff0011
+ * @tc.desic acemediaQueryOffEtsTest0011
+ */
+ it('testmediaQueryOff0011', 0, async function (done) {
+ console.info('mediaQueryOff testmediaQueryOff0011 START');
+ await Utils.sleep(2000);
+ try {
+ var innerEventOne = {
+ eventId: 60218,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("onRequestPopupData_0012 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(true);
+ }
+ console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('offText', 10, "")));
+ events_emitter.on(innerEventOne, callback1);
+ } catch (err) {
+ console.info("onRequestPopupData_0012 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testmediaQueryOff0011 END');
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testmatchMediaSync0001
+ * @tc.desic acetestmatchMediaSyncEtsTest0001
+ */
+ it('testmatchMediaSync0001', 0, async function (done) {
+ console.info('matchMediaSync testmatchMediaSync0001 START');
+ await Utils.sleep(2000);
+ try {
+ var innerEventOne = {
+ eventId: 60219,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("onRequestPopupData_0012 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(true);
+ }
+ console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('matchMediaSyncText', 10, "")));
+ events_emitter.on(innerEventOne, callback1);
+ } catch (err) {
+ console.info("onRequestPopupData_0012 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testmatchMediaSync0001 END');
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..540890439a82bd6e9d07bb4d07c0de06d79d560e
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function navigatorTargetJsunit() {
+ describe('navigatorTargetTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/navigator',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get navigator state success " + JSON.stringify(pages));
+ if (!("navigator" == pages.name)) {
+ console.info("get navigator state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push navigator page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push navigator page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("navigatorTarget after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testnavigatorTarget0001
+ * @tc.desic acenavigatorTargetEtsTest0001
+ */
+ it('testnavigatorTarget0001', 0, async function (done) {
+ console.info('navigatorTarget testnavigatorTarget0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Navigator');
+ console.info("[testnavigatorTarget0001] component strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Navigator');
+ expect(obj.$attrs.target).assertEqual("pages/index");
+ console.info("[testnavigatorTarget0001] target value :" + obj.$attrs.target);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fac4fc55c035f646fafff3627baef2740edb0cc8
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
+import router from '@system.router';
+import events_emitter from '@ohos.events.emitter'
+import Utils from './Utils'
+
+export default function pageRouteTest() {
+ describe('pageRouteTest', function () {
+ beforeEach(async function (done) {
+ console.info("pageRouteTest beforeEach start");
+ let options = {
+ uri: 'pages/pageRoute',
+ }
+ let result;
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get pageRouteTest pages: " + JSON.stringify(pages));
+ if (!("pageRoute" == pages.name)) {
+ console.info("get pageRouteTest pages.name: " + JSON.stringify(pages.name));
+ result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("pageRouteTest page result: " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("pageRouteTest page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("pageRouteTest after each called");
+ })
+
+ it('testOnPageHide01', 0, async function (done) {
+ console.info('[testOnPageHide01] START');
+ var callback = (eventData) => {
+ console.info("[testOnPageHide01] get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.value).assertEqual('onPageHide')
+ done();
+ }
+ var innerEvent = {
+ eventId: 10,
+ priority: events_emitter.EventPriority.LOW
+ }
+ try {
+ events_emitter.on(innerEvent, callback)
+ console.info("testOnPageHide01 click result is: " + JSON.stringify(sendEventByKey('next', 10, "")));
+ } catch (err) {
+ console.info("[testOnPageHide01] on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('[testOnPageHide01] testSendTouchEvent END');
+ });
+ })
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/panel.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/panel.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..07d434e17712d6c5d0703b7af9c1b368ee92fd27
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/panel.test.ets
@@ -0,0 +1,97 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import events_emitter from '@ohos.events.emitter';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function panelBackgroundMaskJsunit() {
+ describe('panelBackgroundMaskTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/panel',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get panel state success " + JSON.stringify(pages));
+ if (!("panel" == pages.name)) {
+ console.info("get panel state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push panel page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push panel page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("panelBackgroundMask after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testpanelBackgroundMask0001
+ * @tc.desic acepanelBackgroundMaskEtsTest0001
+ */
+ it('testpanelBackgroundMask0001', 0, async function (done) {
+ console.info('panelBackgroundMask testpanelBackgroundMask0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('panel');
+ let obj = JSON.parse(strJson);
+ console.info("get inspector value is: " + JSON.stringify(obj));
+ console.log(JSON.stringify(obj.$type))
+ expect(obj.$type).assertEqual('Panel')
+ console.log('Panel‘s backgroundMask is ' + JSON.stringify(obj.$attrs.backgroundMask))
+ expect(obj.$attrs.backgroundMask).assertEqual('#FFFF0000');
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testpanelOnHeightChange0002
+ * @tc.desic acepanelBackgroundMaskEtsTest0002
+ */
+ it('testpanelOnHeightChange0002', 0, async function (done) {
+ console.info('panelBackgroundMask testpanelOnHeightChange0002 START');
+ var panelOnHeightChangeEvent = {
+ eventId: 10111,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (backData) => {
+ console.info("testpanelOnHeightChange0002 backData.data.result is: " + backData.data.result);
+ try{
+ console.info("testpanelOnHeightChange0002 callback1 success" );
+ expect(backData.data.result).assertEqual("success");
+ done();
+ }catch(err){
+ console.info("testpanelOnHeightChange0002 on events_emitter err : " + JSON.stringify(err));
+ }
+ }
+ try {
+ console.info("testpanelOnHeightChange0002 click result is: " + JSON.stringify(sendEventByKey('onHeightChangeText', 10, "")));
+ events_emitter.on(panelOnHeightChangeEvent, callback1);
+ } catch (err) {
+ console.info("testpanelOnHeightChange0002 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/path.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/path.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..53d8c756b002df03d66d5b886ae26d137f618e08
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/path.test.ets
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function pathNewTest() {
+ describe('pathNewTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/path',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get path state success " + JSON.stringify(pages));
+ if (!("path" == pages.name)) {
+ console.info("get path state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push path page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push path page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("pathNe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testpathNe0001
+ * @tc.desic acepathNeEtsTest0001
+ */
+ it('testpathNe0001', 0, async function (done) {
+ console.info('pathNe testpathNe0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Path');
+ console.info("[testpathNe0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("100.00px");
+ console.info("[testpathNe0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testpathNe0002
+ * @tc.desic acepathNeEtsTest0002
+ */
+ it('testpathNe0002', 0, async function (done) {
+ console.info('pathNe testpathNe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Path');
+ console.info("[testpathNe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("100.00px");
+ console.info("[testpathNe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testpathNe0003
+ * @tc.desic acepathNeEtsTest0003
+ */
+ it('testpathNe0003', 0, async function (done) {
+ console.info('pathNe testpathNe0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Path');
+ console.info("[testpathNe0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.commands).assertEqual("M150 0 L300 300 L0 300 Z");
+ console.info("[testpathNe0003] commands value :" + obj.$attrs.commands);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1f871bf4713138bb3cb70684378ddfe13f8f0c9c
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function polyLineNeJsunit() {
+ describe('polyLineNeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/polyLine',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get polyLine state success " + JSON.stringify(pages));
+ if (!("polyLine" == pages.name)) {
+ console.info("get polyLine state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push polyLine page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push polyLine page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("polyLineNe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testpolyLineNe0001
+ * @tc.desic acepolyLineNeEtsTest0001
+ */
+ it('testpolyLineNe0001', 0, async function (done) {
+ console.info('polyLineNe testpolyLineNe0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Polyline');
+ console.info("[testpolyLineNe0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("100.00px");
+ console.info("[testpolyLineNe0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testpolyLineNe0002
+ * @tc.desic acepolyLineNeEtsTest0002
+ */
+ it('testpolyLineNe0002', 0, async function (done) {
+ console.info('polyLineNe testpolyLineNe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Polyline');
+ console.info("[testpolyLineNe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("100.00px");
+ console.info("[testpolyLineNe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polygon.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polygon.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..24d6c478f48d7cf54d67271e5eee6dc85cc9f055
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polygon.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function polygonNewJsunit() {
+ describe('polygonNewJsunit', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/polygon',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get polygon state success " + JSON.stringify(pages));
+ if (!("polygon" == pages.name)) {
+ console.info("get polygon state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push polygon page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push polygon page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("polygonNe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testpolygonNe0001
+ * @tc.desic acepolygonNeEtsTest0001
+ */
+ it('testpolygonNe0001', 0, async function (done) {
+ console.info('polygonNe testpolygonNe0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Polygon');
+ console.info("[testpolygonNe0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("100.00px");
+ console.info("[testpolygonNe0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testpolygonNe0002
+ * @tc.desic acepolygonNeEtsTest0002
+ */
+ it('testpolygonNe0002', 0, async function (done) {
+ console.info('polygonNe testpolygonNe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Polygon');
+ console.info("[testpolygonNe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("100.00px");
+ console.info("[testpolygonNe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a01034c224cc8c3a2c46db398abbc6323d9b5945
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets
@@ -0,0 +1,150 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function progressStyleJsunit() {
+ describe('progressStyleTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/progress',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get progress state success " + JSON.stringify(pages));
+ if (!("progress" == pages.name)) {
+ console.info("get progress state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push progress page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push progress page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("progressStyle after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testprogressStyle0001
+ * @tc.desic aceprogressStyleEtsTest0001
+ */
+ it('testprogressStyle0001', 0, async function (done) {
+ console.info('progressStyle testprogressStyle0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Progress');
+ console.info("[testprogressStyle0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testprogressStyle0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testprogressStyle0002
+ * @tc.desic aceprogressStyleEtsTest0002
+ */
+ it('testprogressStyle0002', 0, async function (done) {
+ console.info('progressStyle testprogressStyle0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Progress');
+ console.info("[testprogressStyle0002] component color strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.color).assertEqual("#FF008000");
+ console.info("[testprogressStyle0002] color value :" + obj.$attrs.color);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testprogressStyle0003
+ * @tc.desic aceprogressStyleEtsTest0003
+ */
+ it('testprogressStyle0003', 0, async function (done) {
+ console.info('progressStyle testprogressStyle0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Progress');
+ console.info("[testprogressStyle0003] component value strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.value).assertEqual("50.000000");
+ console.info("[testprogressStyle0003] value value :" + obj.$attrs.value);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testprogressStyle0004
+ * @tc.desic aceprogressStyleEtsTest0004
+ */
+ it('testprogressStyle0004', 0, async function (done) {
+ console.info('progressStyle testprogressStyle0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Progress');
+ console.info("[testprogressStyle0004] component style strokeWidth strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.style.strokeWidth).assertEqual("20.00vp");
+ console.info("[testprogressStyle0004] style strokeWidth value :" + obj.$attrs.style.strokeWidth);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testprogressStyle0005
+ * @tc.desic aceprogressStyleEtsTest0005
+ */
+ it('testprogressStyle0005', 0, async function (done) {
+ console.info('progressStyle testprogressStyle0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Progress');
+ console.info("[testprogressStyle0005] component style scaleCount strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.style.scaleCount).assertEqual("30");
+ console.info("[testprogressStyle0005] style scaleCount value :" + obj.$attrs.style.scaleCount);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testprogressStyle0006
+ * @tc.desic aceprogressStyleEtsTest0006
+ */
+ it('testprogressStyle0006', 0, async function (done) {
+ console.info('progressStyle testprogressStyle0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Progress');
+ console.info("[testprogressStyle0006] component style scaleWidth strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.style.scaleWidth).assertEqual("20.00vp");
+ console.info("[testprogressStyle0006] style scaleWidth value :" + obj.$attrs.style.scaleWidth);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/prompt.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/prompt.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..459ef283f67d03cce873afa1605f66f1a0c1be12
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/prompt.test.ets
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function promptShowDialogJsunit() {
+ describe('promptShowDialogTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/prompt',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get prompt state success " + JSON.stringify(pages));
+ if (!("prompt" == pages.name)) {
+ console.info("get prompt state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push prompt page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push prompt page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("promptShowDialog after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name testpromptShowDialog001
+ * @tc.desic acepromptShowDialogEtsTest001
+ */
+ it('testpromptShowDialog001', 0, async function (done) {
+ console.info('promptShowDialog testpromptShowDialog001 START');
+ await Utils.sleep(1000);
+ try {
+ var innerEventOne = {
+ eventId: 60220,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("testpromptShowDialog001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(true);
+ done();
+ }
+ console.info("onSelect_001 click result is: " + JSON.stringify(sendEventByKey('showDialogText', 10, "")));
+ events_emitter.on(innerEventOne, callback1);
+ } catch (err) {
+ console.info("testpromptShowDialog001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testpromptShowDialog001 END');
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_002
+ * @tc.name testshowActionMenu0001
+ * @tc.desic aceshowActionMenuEtsTest0001
+ */
+ it('testshowActionMenu0001', 0, async function (done) {
+ console.info('promptShowDialog testshowActionMenu0001 START');
+ await Utils.sleep(1000);
+ try {
+ var innerEventTwo = {
+ eventId: 60221,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback2 = (backData1) => {
+ console.info("onRequestPopupData_0011 get event state result is: " + JSON.stringify(backData1));
+ expect(backData1.data.STATUS).assertEqual(true);
+ done();
+ }
+ console.info("onSelect_002 click result is: " + JSON.stringify(sendEventByKey('showActionMenuText', 10, "")));
+ events_emitter.on(innerEventTwo, callback2);
+ } catch (err) {
+ console.info("onRequestPopupData_0011 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testshowActionMenu0001 END');
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/rect.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/rect.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..10604cdf8e57a4256924de2e4762fcabe2b217cf
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/rect.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function rectNeJsunit() {
+ describe('rectNeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/rect',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get rect state success " + JSON.stringify(pages));
+ if (!("rect" == pages.name)) {
+ console.info("get rect state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push rect page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push rect page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("rectNe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testrectNe0001
+ * @tc.desic acerectNeEtsTest0001
+ */
+ it('testrectNe0001', 0, async function (done) {
+ console.info('rectNe testrectNe0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Rect');
+ console.info("[testrectNe0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.width).assertEqual("90.00%");
+ console.info("[testrectNe0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testrectNe0002
+ * @tc.desic acerectNeEtsTest0002
+ */
+ it('testrectNe0002', 0, async function (done) {
+ console.info('rectNe testrectNe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Rect');
+ console.info("[testrectNe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Shape');
+ expect(obj.$attrs.height).assertEqual("50.00px");
+ console.info("[testrectNe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/scroll.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/scroll.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..867a4feb0d32fb4e7108cc53a17057ff51548743
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/scroll.test.ets
@@ -0,0 +1,162 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function scrollOnScrollBeginJsunit() {
+ describe('scrollOnScrollBeginTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/scroll',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get scroll state success " + JSON.stringify(pages));
+ if (!("scroll" == pages.name)) {
+ console.info("get scroll state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push scroll page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push scroll page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("scrollOnScrollBegin after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testscrollOnScrollBegin0001
+ * @tc.desic acescrollOnScrollBeginEtsTest0001
+ */
+ it('testscrollOnScrollBegin0001', 0, async function (done) {
+ console.info('scrollOnScrollBegin testscrollOnScrollBegin0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Scroll');
+ console.info("[testscrollOnScrollBegin0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Scroll');
+ expect(obj.$attrs.width).assertEqual("100.00%");
+ console.info("[testscrollOnScrollBegin0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testscrollOnScrollBegin0002
+ * @tc.desic acescrollOnScrollBeginEtsTest0002
+ */
+ it('testscrollOnScrollBegin0002', 0, async function (done) {
+ console.info('scrollOnScrollBegin testscrollOnScrollBegin0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Scroll');
+ console.info("[testscrollOnScrollBegin0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Scroll');
+ expect(obj.$attrs.height).assertEqual("100.00%");
+ console.info("[testscrollOnScrollBegin0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testscrollOnScrollBegin0003
+ * @tc.desic acescrollOnScrollBeginEtsTest0003
+ */
+ it('testscrollOnScrollBegin0003', 0, async function (done) {
+ console.info('scrollOnScrollBegin testscrollOnScrollBegin0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Scroll');
+ console.info("[testscrollOnScrollBegin0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Scroll');
+ expect(obj.$attrs.scrollBar).assertEqual("BarState.On");
+ console.info("[testscrollOnScrollBegin0003] scrollBar value :" + obj.$attrs.scrollBar);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testscrollOnScrollBegin0004
+ * @tc.desic acescrollOnScrollBeginEtsTest0004
+ */
+ it('testscrollOnScrollBegin0004', 0, async function (done) {
+ console.info('scrollOnScrollBegin testscrollOnScrollBegin0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Scroll');
+ console.info("[testscrollOnScrollBegin0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Scroll');
+ expect(obj.$attrs.scrollBarColor).assertEqual("#FF808080");
+ console.info("[testscrollOnScrollBegin0004] scrollBarColor value :" + obj.$attrs.scrollBarColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testscrollOnScrollBegin0005
+ * @tc.desic acescrollOnScrollBeginEtsTest0005
+ */
+ it('testscrollOnScrollBegin0005', 0, async function (done) {
+ console.info('scrollOnScrollBegin testscrollOnScrollBegin0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Scroll');
+ console.info("[testscrollOnScrollBegin0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Scroll');
+ expect(obj.$attrs.scrollBarWidth).assertEqual("30.00px");
+ console.info("[testscrollOnScrollBegin0005] scrollBarWidth value :" + obj.$attrs.scrollBarWidth);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0012
+ * @tc.name testscrollOnScrollBegin0005
+ * @tc.desic acescrollOnScrollBeginEtsTest0006
+ */
+ it('testscrollOnScrollBegin0006', 0, async function (done) {
+ console.info('scrollOnScrollBegin testscrollOnScrollBegin0006 START');
+ await Utils.sleep(2000);
+
+ let callback = (indexEvent) => {
+ console.info("scrollOnScrollBegin get state result is: " + JSON.stringify(indexEvent));
+ expect(indexEvent.data.STATUS).assertEqual(true);
+ }
+ let indexEvent = {
+ eventId: 10086,
+ priority: events_emitter.EventPriority.LOW
+ }
+ sendEventByKey('Scroll', 10, "")
+ try {
+ events_emitter.on(indexEvent, callback);
+ } catch (err) {
+ console.info("scrollOnScrollBegin on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testscrollOnScrollBegin0006 END');
+ done();
+
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..567a45048076c18d9b7e42936d9204bc297ab421
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets
@@ -0,0 +1,201 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function searchOnCutJsunit() {
+ describe('searchOnCutTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/search',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get search state success " + JSON.stringify(pages));
+ if (!("search" == pages.name)) {
+ console.info("get search state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push search page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push search page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("searchOnCut after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testsearchOnCut0001
+ * @tc.desic acesearchOnCutEtsTest0001
+ */
+ it('testsearchOnCut0001', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual("320.00vp");
+ console.info("[testsearchOnCut0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testsearchOnCut0002
+ * @tc.desic acesearchOnCutEtsTest0002
+ */
+ it('testsearchOnCut0002', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.height).assertEqual("70.00vp");
+ console.info("[testsearchOnCut0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testsearchOnCut0003
+ * @tc.desic acesearchOnCutEtsTest0003
+ */
+ it('testsearchOnCut0003', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontSize).assertEqual("20.00fp");
+ console.info("[testsearchOnCut0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testsearchOnCut0004
+ * @tc.desic acesearchOnCutEtsTest0004
+ */
+ it('testsearchOnCut0004', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testsearchOnCut0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testsearchOnCut0005
+ * @tc.desic acesearchOnCutEtsTest0005
+ */
+ it('testsearchOnCut0005', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
+ console.info("[testsearchOnCut0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testsearchOnCut0006
+ * @tc.desic acesearchOnCutEtsTest0006
+ */
+ it('testsearchOnCut0006', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
+ console.info("[testsearchOnCut0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testsearchOnCut0007
+ * @tc.desic acesearchOnCutEtsTest0007
+ */
+ it('testsearchOnCut0007', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
+ console.info("[testsearchOnCut0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testsearchOnCut0009
+ * @tc.desic acesearchOnCutEtsTest0009
+ */
+ it('testsearchOnCut0009', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.padding).assertEqual("10.00vp");
+ console.info("[testsearchOnCut0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testsearchOnCut0010
+ * @tc.desic acesearchOnCutEtsTest0010
+ */
+ it('testsearchOnCut0010', 0, async function (done) {
+ console.info('searchOnCut testsearchOnCut0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testsearchOnCut0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
+ console.info("[testsearchOnCut0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/select.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/select.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..bbefe189d4fc7e9672cc7b5c1db22b77cffd6d5e
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/select.test.ets
@@ -0,0 +1,83 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function selectOnSelectJsunit() {
+ describe('selectOnSelectTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/select',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get select state success " + JSON.stringify(pages));
+ if (!("select" == pages.name)) {
+ console.info("get select state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push select page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push select page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("selectOnSelect after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testselectOnSelect0001
+ * @tc.desic aceselectOnSelectEtsTest0001
+ */
+ it('testselectOnSelect0001', 0, async function (done) {
+ console.info('selectOnSelect testselectOnSelect0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Select');
+ console.info("[testselectOnSelect0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Select');
+ expect(obj.$attrs.selected).assertEqual("2");
+ console.info("[testselectOnSelect0001] selected value :" + obj.$attrs.selected);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testselectOnSelect0002
+ * @tc.desic aceselectOnSelectEtsTest0002
+ */
+ it('testselectOnSelect0002', 0, async function (done) {
+ console.info('selectOnSelect testselectOnSelect0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Select');
+ console.info("[testselectOnSelect0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Select');
+ expect(obj.$attrs.value).assertEqual("TTT");
+ console.info("[testselectOnSelect0002] height value :" + obj.$attrs.height);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..991bec94f35e9ed7c7bba74be637a966c82063c2
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function sideBarShowSideBarJsunit() {
+ describe('sideBarShowSideBarTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/sideBar',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get sideBar state success " + JSON.stringify(pages));
+ if (!("sideBar" == pages.name)) {
+ console.info("get sideBar state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push sideBar page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push sideBar page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("sideBarShowSideBar after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testsideBarShowSideBar0001
+ * @tc.desic acesideBarShowSideBarEtsTest0001
+ */
+ it('testsideBarShowSideBar0001', 0, async function (done) {
+ console.info('sideBarShowSideBar testsideBarShowSideBar0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('SideBarContainer');
+ console.info("[testsideBarShowSideBar0001] component showSideBar strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('SideBarContainer');
+ expect(obj.$attrs.showSideBar).assertEqual("true");
+ console.info("[testsideBarShowSideBar0001] showSideBar value :" + obj.$attrs.showSideBar);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testsideBarShowSideBar0002
+ * @tc.desic acesideBarShowSideBarEtsTest0002
+ */
+ it('testsideBarShowSideBar0002', 0, async function (done) {
+ console.info('sideBarShowSideBar testsideBarShowSideBar0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('SideBarContainer');
+ console.info("[testsideBarShowSideBar0002] component autoHide strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('SideBarContainer');
+ expect(obj.$attrs.autoHide).assertEqual(undefined);
+ console.info("[testsideBarShowSideBar0002] autoHide value :" + obj.$attrs.autoHide);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testsideBarShowSideBar0003
+ * @tc.desic acesideBarShowSideBarEtsTest0003
+ */
+ it('testsideBarShowSideBar0003', 0, async function (done) {
+ console.info('sideBarShowSideBar testsideBarShowSideBar0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('SideBarContainer');
+ console.info("[testsideBarShowSideBar0003] component autoHide strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('SideBarContainer');
+ expect(obj.$attrs.sideBarPosition).assertEqual(undefined);
+ console.info("[testsideBarShowSideBar0003] autoHide value :" + obj.$attrs.autoHide);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stack.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stack.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b3e2c91c61ad7dd62dd94b6f186f3ee43d3285cf
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stack.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function stackAlignContentJsunit() {
+ describe('stackAlignContentTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/stack',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get stack state success " + JSON.stringify(pages));
+ if (!("stack" == pages.name)) {
+ console.info("get stack state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push stack page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push stack page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("stackAlignContent after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name teststackAlignContent0001
+ * @tc.desic acestackAlignContentEtsTest0001
+ */
+ it('teststackAlignContent0001', 0, async function (done) {
+ console.info('stackAlignContent teststackAlignContent0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Stack');
+ console.info("[teststackAlignContent0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Stack');
+ expect(obj.$attrs.width).assertEqual("100.00%");
+ console.info("[teststackAlignContent0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name teststackAlignContent0002
+ * @tc.desic acestackAlignContentEtsTest0002
+ */
+ it('teststackAlignContent0002', 0, async function (done) {
+ console.info('stackAlignContent teststackAlignContent0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Stack');
+ console.info("[teststackAlignContent0002] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Stack');
+ expect(obj.$attrs.height).assertEqual("150.00vp");
+ console.info("[teststackAlignContent0002] width value :" + obj.$attrs.width);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stateManagement.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stateManagement.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ad3f342453523aea2e0fdc8ce774679d0072c473
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/stateManagement.test.ets
@@ -0,0 +1,154 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function stateManagementGetSharedJsunit() {
+ describe('stateManagementGetSharedTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/stateManagement',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get stateManagement state success " + JSON.stringify(pages));
+ if (!("stateManagement" == pages.name)) {
+ console.info("get stateManagement state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push stateManagement page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push stateManagement page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("stateManagementGetShared after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name teststateManagementGetShared0001
+ * @tc.desic acestateManagementGetSharedEtsTest0001
+ */
+ it('teststateManagementGetShared0001', 0, async function (done) {
+ console.info('stateManagementGetShared teststateManagementGetShared0001 START');
+ await Utils.sleep(2000);
+ try {
+ var EventOne = {
+ eventId: 60223,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callbackOne = (eventData) => {
+ console.info("teststateManagementGetShared_0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual(false);
+ done();
+ }
+ console.info("GetShared_0001 click result is: " + JSON.stringify(sendEventByKey('GetSharedText', 10, "")));
+ events_emitter.on(EventOne, callbackOne);
+ } catch (err) {
+ console.info("stateManagementGetShared0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('teststateManagementGetShared0001 END');
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name teststateManagementsetAndLink0001
+ * @tc.desic acestateManagementsetAndLinkEtsTest0001
+ */
+ it('teststateManagementsetAndLink0001', 0, async function (done) {
+ console.info('stateManagementsetAndLink teststateManagementsetAndLink0001 START');
+ await Utils.sleep(1000);
+ try {
+ var EventTwo = {
+ eventId: 60224,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callbackTwo = (eventData) => {
+ console.info("teststateManagementsetAndLink_0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual("callback2");
+ done();
+ }
+ console.info("setAndLink_0001 click result is: " + JSON.stringify(sendEventByKey('setAndLinkText', 10, "")));
+ events_emitter.on(EventTwo, callbackTwo);
+ } catch (err) {
+ console.info("stateManagementsetAndLink0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('teststateManagementsetAndLink0001 END');
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name teststateManagementsetOrCreate0001
+ * @tc.desic acestateManagementsetOrCreateEtsTest0001
+ */
+ it('teststateManagementsetOrCreate0001', 0, async function (done) {
+ console.info('stateManagementsetOrCreate teststateManagementsetOrCreate0001 START');
+ await Utils.sleep(1000);
+ try {
+ var EventThree = {
+ eventId: 60225,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callbackThree = (eventData) => {
+ console.info("teststateManagementsetOrCreate_0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual("callback3");
+ done();
+ }
+ console.info("setOrCreate_0001 click result is: " + JSON.stringify(sendEventByKey('setOrCreateText', 10, "")));
+ events_emitter.on(EventThree, callbackThree);
+ } catch (err) {
+ console.info("stateManagementsetOrCreate0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('teststateManagementsetOrCreate0001 END');
+
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name teststateManagementsetAndProp0001
+ * @tc.desic acestateManagementsetAndPropEtsTest0001
+ */
+ it('teststateManagementsetAndProp0001', 0, async function (done) {
+ console.info('stateManagementsetAndProp teststateManagementsetAndProp0001 START');
+ await Utils.sleep(1000);
+ try {
+ var EventFour = {
+ eventId: 60226,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callbackFour = (eventData) => {
+ console.info("teststateManagementsetAndProp_0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual("callback4");
+ done();
+ }
+ console.info("setAndProp_0001 click result is: " + JSON.stringify(sendEventByKey('setAndPropText', 10, "")));
+ events_emitter.on(EventFour, callbackFour);
+ } catch (err) {
+ console.info("stateManagementsetAndProp0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('teststateManagementsetAndProp0001 END');
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..5d80ac2efcba8c9a9c652474777cdc96a9add0f4
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets
@@ -0,0 +1,240 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function swiperCurveJsunit() {
+ describe('swiperCurveTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/swiper',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get swiper state success " + JSON.stringify(pages));
+ if (!("swiper" == pages.name)) {
+ console.info("get swiper state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push swiper page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push swiper page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("swiperCurve after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testswiperCurve0001
+ * @tc.desic aceswiperCurveEtsTest0001
+ */
+ it('testswiperCurve0001', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.curve).assertEqual("Curves.Linear");
+ console.info("[testswiperCurve0001] curve value :" + obj.$attrs.curve);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testswiperCurve0002
+ * @tc.desic aceswiperCurveEtsTest0002
+ */
+ it('testswiperCurve0002', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0002] component cachedCount strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.cachedCount).assertEqual("2");
+ console.info("[testswiperCurve0002] cachedCount value :" + obj.$attrs.cachedCount);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testswiperCurve0003
+ * @tc.desic aceswiperCurveEtsTest0003
+ */
+ it('testswiperCurve0003', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0003] component index strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.index).assertEqual("3");
+ console.info("[testswiperCurve0003] index value :" + obj.$attrs.index);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testswiperCurve0004
+ * @tc.desic aceswiperCurveEtsTest0004
+ */
+ it('testswiperCurve0004', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0004] component autoPlay strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.autoPlay).assertEqual("true");
+ console.info("[testswiperCurve0004] autoPlay value :" + obj.$attrs.autoPlay);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testswiperCurve0005
+ * @tc.desic aceswiperCurveEtsTest0005
+ */
+ it('testswiperCurve0005', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0005] component interval strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.interval).assertEqual("4000");
+ console.info("[testswiperCurve0005] interval value :" + obj.$attrs.interval);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testswiperCurve0006
+ * @tc.desic aceswiperCurveEtsTest0006
+ */
+ it('testswiperCurve0006', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0006] component indicator strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.indicator).assertEqual("true");
+ console.info("[testswiperCurve0006] indicator value :" + obj.$attrs.indicator);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testswiperCurve0007
+ * @tc.desic aceswiperCurveEtsTest0007
+ */
+ it('testswiperCurve0007', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0007] component loop strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.loop).assertEqual("false");
+ console.info("[testswiperCurve0007] loop value :" + obj.$attrs.loop);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0008
+ * @tc.name testswiperCurve0008
+ * @tc.desic aceswiperCurveEtsTest0008
+ */
+ it('testswiperCurve0008', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0008 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0008] component duration strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.duration).assertEqual("1000.000000");
+ console.info("[testswiperCurve0008] duration value :" + obj.$attrs.duration);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testswiperCurve0009
+ * @tc.desic aceswiperCurveEtsTest0009
+ */
+ it('testswiperCurve0009', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve0009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve0009] component vertical strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.vertical).assertEqual("false");
+ console.info("[testswiperCurve0009] vertical value :" + obj.$attrs.vertical);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testswiperCurve0010
+ * @tc.desic aceswiperCurveEtsTest0010
+ */
+ it('testswiperCurve00010', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve00010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve00010] component itemSpace strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.itemSpace).assertEqual("0.00px");
+ console.info("[testswiperCurve00010] itemSpace value :" + obj.$attrs.itemSpace);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testswiperCurve0011
+ * @tc.desic aceswiperCurveEtsTest0011
+ */
+ /***有问题***/
+ it('testswiperCurve00011', 0, async function (done) {
+ console.info('swiperCurve testswiperCurve00011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('swiper');
+ console.info("[testswiperCurve00011] component onChange strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ try {
+ obj.$attrs.isOn = !obj.$attrs.isOn //尝试用isOn的改变来触发Onchange()事件
+ } catch(err) {
+ console.info("testswiperCurve00011 on event err : " + JSON.stringify(err));
+ }
+ console.info("[testswiperCurve00011] onChange value :" + obj.$attrs.onChange);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c73b2403af693e5b1501072b746a50e633c5b201
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets
@@ -0,0 +1,218 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function tabsBarPositionJsunit() {
+ describe('tabsBarPositionTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/tabs',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get tabs state success " + JSON.stringify(pages));
+ if (!("tabs" == pages.name)) {
+ console.info("get tabs state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push tabs page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push tabs page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("tabsBarPosition after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testtabsBarPosition0001
+ * @tc.desic acetabsBarPositionEtsTest0001
+ */
+ it('testtabsBarPosition0001', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testtabsBarPosition0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testtabsBarPosition0002
+ * @tc.desic acetabsBarPositionEtsTest0002
+ */
+ it('testtabsBarPosition0002', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.height).assertEqual("70.00vp");
+ console.info("[testtabsBarPosition0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testtabsBarPosition0003
+ * @tc.desic acetabsBarPositionEtsTest0003
+ */
+ it('testtabsBarPosition0003', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontSize).assertEqual("20.00fp");
+ console.info("[testtabsBarPosition0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testtabsBarPosition0004
+ * @tc.desic acetabsBarPositionEtsTest0004
+ */
+ it('testtabsBarPosition0004', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testtabsBarPosition0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testtabsBarPosition0005
+ * @tc.desic acetabsBarPositionEtsTest0005
+ */
+ it('testtabsBarPosition0005', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
+ console.info("[testtabsBarPosition0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testtabsBarPosition0006
+ * @tc.desic acetabsBarPositionEtsTest0006
+ */
+ it('testtabsBarPosition0006', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
+ console.info("[testtabsBarPosition0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testtabsBarPosition0007
+ * @tc.desic acetabsBarPositionEtsTest0007
+ */
+ it('testtabsBarPosition0007', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
+ console.info("[testtabsBarPosition0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testtabsBarPosition0009
+ * @tc.desic acetabsBarPositionEtsTest0009
+ */
+ it('testtabsBarPosition0009', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.padding).assertEqual("10.00vp");
+ console.info("[testtabsBarPosition0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testtabsBarPosition0010
+ * @tc.desic acetabsBarPositionEtsTest0010
+ */
+ it('testtabsBarPosition0010', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionText');
+ console.info("[testtabsBarPosition0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
+ console.info("[testtabsBarPosition0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testtabsBarPosition0011
+ * @tc.desic acetabsBarPositionEtsTest0011
+ */
+ it('testtabsBarPosition0011', 0, async function (done) {
+ console.info('tabsBarPosition testtabsBarPosition0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('barPositionTabs');
+ console.info("[testtabsBarPosition0011] component barPosition strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Tabs');
+ expect(obj.$attrs.barPosition).assertEqual("BarPosition.Start");
+ console.info("[testtabsBarPosition0011] barPosition value :" + obj.$attrs.barPosition);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2e0706dd05482641d5123ede0d0cb5b380b2f775
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets
@@ -0,0 +1,226 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function textMinFontSizeJsunit() {
+ describe('textMinFontSizeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/text',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get text state success " + JSON.stringify(pages));
+ if (!("text" == pages.name)) {
+ console.info("get text state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push text page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push text page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("textMinFontSize after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testtextMinFontSize0001
+ * @tc.desic acetextMinFontSizeEtsTest0001
+ */
+ it('testtextMinFontSize0001', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testtextMinFontSize0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testtextMinFontSize0002
+ * @tc.desic acetextMinFontSizeEtsTest0002
+ */
+ it('testtextMinFontSize0002', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.height).assertEqual("70.00vp");
+ console.info("[testtextMinFontSize0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testtextMinFontSize0003
+ * @tc.desic acetextMinFontSizeEtsTest0003
+ */
+ it('testtextMinFontSize0003', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontSize).assertEqual("30.00px");
+ console.info("[testtextMinFontSize0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testtextMinFontSize0004
+ * @tc.desic acetextMinFontSizeEtsTest0004
+ */
+ it('testtextMinFontSize0004', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testtextMinFontSize0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testtextMinFontSize0005
+ * @tc.desic acetextMinFontSizeEtsTest0005
+ */
+ it('testtextMinFontSize0005', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
+ console.info("[testtextMinFontSize0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testtextMinFontSize0006
+ * @tc.desic acetextMinFontSizeEtsTest0006
+ */
+ it('testtextMinFontSize0006', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
+ console.info("[testtextMinFontSize0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testtextMinFontSize0007
+ * @tc.desic acetextMinFontSizeEtsTest0007
+ */
+ it('testtextMinFontSize0007', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
+ console.info("[testtextMinFontSize0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testtextMinFontSize0009
+ * @tc.desic acetextMinFontSizeEtsTest0009
+ */
+ it('testtextMinFontSize0009', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.padding).assertEqual("10.00vp");
+ console.info("[testtextMinFontSize0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testtextMinFontSize0010
+ * @tc.desic acetextMinFontSizeEtsTest0010
+ */
+ it('testtextMinFontSize0010', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
+ console.info("[testtextMinFontSize0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ it('testtextMinFontSize0011', 0, async function (done) {
+ console.info('textMinFontSize testtextMinFontSize0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minFontSizeText');
+ console.info("[testtextMinFontSize0011] component minFontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.minFontSize).assertEqual(undefined);
+ console.info("[testtextMinFontSize0011] minFontSize value :" + obj.$attrs.minFontSize);
+ done();
+ });
+
+ it('testtextCopyOptionText0001', 0, async function (done) {
+ console.info('textMinFontSize testtextCopyOptionText0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('copyOptionText');
+ console.info("[testtextCopyOptionText0001] component copyOption strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.copyOption).assertEqual(undefined);
+ console.info("[testtextCopyOptionText0001] copyOption value :" + obj.$attrs.copyOption);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d109dcb851f57e3a50c6fddc55dfb13afc70c65d
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets
@@ -0,0 +1,220 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function textAreaOnCutJsunit() {
+ describe('textAreaOnCutTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/textArea',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get textArea state success " + JSON.stringify(pages));
+ if (!("textArea" == pages.name)) {
+ console.info("get textArea state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push textArea page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push textArea page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("textAreaOnCut after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testtextAreaOnCut0001
+ * @tc.desic acetextAreaOnCutEtsTest0001
+ */
+ it('testtextAreaOnCut0001', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testtextAreaOnCut0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testtextAreaOnCut0002
+ * @tc.desic acetextAreaOnCutEtsTest0002
+ */
+ it('testtextAreaOnCut0002', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.height).assertEqual("70.00vp");
+ console.info("[testtextAreaOnCut0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testtextAreaOnCut0003
+ * @tc.desic acetextAreaOnCutEtsTest0003
+ */
+ it('testtextAreaOnCut0003', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.fontSize).assertEqual("20.00fp");
+ console.info("[testtextAreaOnCut0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testtextAreaOnCut0004
+ * @tc.desic acetextAreaOnCutEtsTest0004
+ */
+ it('testtextAreaOnCut0004', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testtextAreaOnCut0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testtextAreaOnCut0005
+ * @tc.desic acetextAreaOnCutEtsTest0005
+ */
+ it('testtextAreaOnCut0005', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
+ console.info("[testtextAreaOnCut0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testtextAreaOnCut0006
+ * @tc.desic acetextAreaOnCutEtsTest0006
+ */
+ it('testtextAreaOnCut0006', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
+ console.info("[testtextAreaOnCut0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testtextAreaOnCut0007
+ * @tc.desic acetextAreaOnCutEtsTest0007
+ */
+ it('testtextAreaOnCut0007', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.lineHeight).assertEqual(undefined);
+ console.info("[testtextAreaOnCut0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testtextAreaOnCut0009
+ * @tc.desic acetextAreaOnCutEtsTest0009
+ */
+ it('testtextAreaOnCut0009', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.padding).assertEqual("0.00px");
+ console.info("[testtextAreaOnCut0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testtextAreaOnCut0010
+ * @tc.desic acetextAreaOnCutEtsTest0010
+ */
+ it('testtextAreaOnCut0010', 0, async function (done) {
+ console.info('textAreaOnCut testtextAreaOnCut0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onCutText');
+ console.info("[testtextAreaOnCut0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center");
+ console.info("[testtextAreaOnCut0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testtextAreaOnCut0011
+ * @tc.desic acetextAreaOnCutEtsTest0011
+ */
+ it('testtextAreaCopyOption0011', 0, async function (done) {
+ console.info('textAreaCopyOption testtextAreaCopyOption0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('textAreaCopyOptionText');
+ console.info("[testtextAreaCopyOption0011] component copyOption strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextArea');
+ expect(obj.$attrs.copyOption).assertEqual(undefined);
+ console.info("[testtextAreaCopyOption0011] copyOption value :" + obj.$attrs.copyOption);
+ done();
+ });
+
+
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a5225f0775f78bde9e27497563b8dc506a6b5021
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets
@@ -0,0 +1,225 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function textInputOnEditChangeJsunit() {
+ describe('textInputOnEditChangeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/textInput',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get textInput state success " + JSON.stringify(pages));
+ if (!("textInput" == pages.name)) {
+ console.info("get textInput state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push textInput page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push textInput page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("textInputOnEditChange after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testtextInputOnEditChange0001
+ * @tc.desic acetextInputOnEditChangeEtsTest0001
+ */
+ it('testtextInputOnEditChange0001', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testtextInputOnEditChange0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testtextInputOnEditChange0002
+ * @tc.desic acetextInputOnEditChangeEtsTest0002
+ */
+ it('testtextInputOnEditChange0002', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.height).assertEqual("70.00vp");
+ console.info("[testtextInputOnEditChange0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testtextInputOnEditChange0003
+ * @tc.desic acetextInputOnEditChangeEtsTest0003
+ */
+ it('testtextInputOnEditChange0003', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.fontSize).assertEqual("20.00fp");
+ console.info("[testtextInputOnEditChange0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testtextInputOnEditChange0004
+ * @tc.desic acetextInputOnEditChangeEtsTest0004
+ */
+ it('testtextInputOnEditChange0004', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testtextInputOnEditChange0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testtextInputOnEditChange0005
+ * @tc.desic acetextInputOnEditChangeEtsTest0005
+ */
+ it('testtextInputOnEditChange0005', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
+ console.info("[testtextInputOnEditChange0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testtextInputOnEditChange0006
+ * @tc.desic acetextInputOnEditChangeEtsTest0006
+ */
+ it('testtextInputOnEditChange0006', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
+ console.info("[testtextInputOnEditChange0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testtextInputOnEditChange0007
+ * @tc.desic acetextInputOnEditChangeEtsTest0007
+ */
+ it('testtextInputOnEditChange0007', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.lineHeight).assertEqual(undefined);
+ console.info("[testtextInputOnEditChange0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testtextInputOnEditChange0009
+ * @tc.desic acetextInputOnEditChangeEtsTest0009
+ */
+ it('testtextInputOnEditChange0009', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.padding).assertEqual("0.00px");
+ console.info("[testtextInputOnEditChange0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testtextInputOnEditChange0010
+ * @tc.desic acetextInputOnEditChangeEtsTest0010
+ */
+ it('testtextInputOnEditChange0010', 0, async function (done) {
+ console.info('textInputOnEditChange testtextInputOnEditChange0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onEditChangeText');
+ console.info("[testtextInputOnEditChange0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.textAlign).assertEqual(undefined);
+ console.info("[testtextInputOnEditChange0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ it('testtextInputCopyOption0001', 0, async function (done) {
+ console.info('textInputCopyOption testtextInputCopyOption0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('textInputCopyOptionText');
+ console.info("[testtextInputCopyOption0001] component copyOption strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.copyOption).assertEqual(undefined);
+ console.info("[testtextInputCopyOption0001] copyOption value :" + obj.$attrs.copyOption);
+ done();
+ });
+
+ it('testtextInputShowPasswordIcon0001', 0, async function (done) {
+ console.info('textInputShowPasswordIcon testtextInputShowPasswordIcon0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('showPasswordIconText');
+ console.info("[testtextInputShowPasswordIcon0001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.showPasswordIcon).assertEqual(undefined);
+ console.info("[testtextInputShowPasswordIcon0001] showPasswordIcon value :" + obj.$attrs.showPasswordIcon);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2c48faf0096ac00e2a0e81ee37968b3aa80323b0
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets
@@ -0,0 +1,218 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function textPickerDefaultPickerItemHeightJsunit() {
+ describe('textPickerDefaultPickerItemHeightTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/textPicker',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get textPicker state success " + JSON.stringify(pages));
+ if (!("textPicker" == pages.name)) {
+ console.info("get textPicker state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push textPicker page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push textPicker page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("textPickerDefaultPickerItemHeight after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testtextPickerDefaultPickerItemHeight0001
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0001
+ */
+ it('testtextPickerDefaultPickerItemHeight0001', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.width).assertEqual("-");
+ console.info("[testtextPickerDefaultPickerItemHeight0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testtextPickerDefaultPickerItemHeight0002
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0002
+ */
+ it('testtextPickerDefaultPickerItemHeight0002', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.height).assertEqual("-");
+ console.info("[testtextPickerDefaultPickerItemHeight0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testtextPickerDefaultPickerItemHeight0003
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0003
+ */
+ it('testtextPickerDefaultPickerItemHeight0003', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.fontSize).assertEqual(undefined);
+ console.info("[testtextPickerDefaultPickerItemHeight0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testtextPickerDefaultPickerItemHeight0004
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0004
+ */
+ it('testtextPickerDefaultPickerItemHeight0004', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testtextPickerDefaultPickerItemHeight0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testtextPickerDefaultPickerItemHeight0005
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0005
+ */
+ it('testtextPickerDefaultPickerItemHeight0005', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.align).assertEqual("Alignment.Center");
+ console.info("[testtextPickerDefaultPickerItemHeight0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testtextPickerDefaultPickerItemHeight0006
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0006
+ */
+ it('testtextPickerDefaultPickerItemHeight0006', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.fontColor).assertEqual(undefined);
+ console.info("[testtextPickerDefaultPickerItemHeight0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testtextPickerDefaultPickerItemHeight0007
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0007
+ */
+ it('testtextPickerDefaultPickerItemHeight0007', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.lineHeight).assertEqual(undefined);
+ console.info("[testtextPickerDefaultPickerItemHeight0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testtextPickerDefaultPickerItemHeight0009
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0009
+ */
+ it('testtextPickerDefaultPickerItemHeight0009', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.padding).assertEqual("0.00px");
+ console.info("[testtextPickerDefaultPickerItemHeight0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testtextPickerDefaultPickerItemHeight0010
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0010
+ */
+ it('testtextPickerDefaultPickerItemHeight0010', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.textAlign).assertEqual(undefined);
+ console.info("[testtextPickerDefaultPickerItemHeight0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testtextPickerDefaultPickerItemHeight0011
+ * @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0011
+ */
+ it('testtextPickerDefaultPickerItemHeight0011', 0, async function (done) {
+ console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('defaultPickerItemHeightText');
+ console.info("[testtextPickerDefaultPickerItemHeight0011] component defaultPickerItemHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextPicker');
+ expect(obj.$attrs.defaultPickerItemHeight).assertEqual("80.00px");
+ console.info("[testtextPickerDefaultPickerItemHeight0011] defaultPickerItemHeight value :" + obj.$attrs.defaultPickerItemHeight);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7ae83e2f61e12de10375abbd70bf39a29126f4f9
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets
@@ -0,0 +1,227 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function videoOnFullscreenChangeJsunit() {
+ describe('videoOnFullscreenChangeTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/video',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get video state success " + JSON.stringify(pages));
+ if (!("video" == pages.name)) {
+ console.info("get video state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push video page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push video page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("videoOnFullscreenChange after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testvideoOnFullscreenChange0001
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0001
+ */
+ it('testvideoOnFullscreenChange0001', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.width).assertEqual("600.00vp");
+ console.info("[testvideoOnFullscreenChange0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testvideoOnFullscreenChange0002
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0002
+ */
+ it('testvideoOnFullscreenChange0002', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.height).assertEqual("400.00vp");
+ console.info("[testvideoOnFullscreenChange0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testvideoOnFullscreenChange0003
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0003
+ */
+ it('testvideoOnFullscreenChange0003', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.fontSize).assertEqual(undefined);
+ console.info("[testvideoOnFullscreenChange0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testvideoOnFullscreenChange0004
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0004
+ */
+ it('testvideoOnFullscreenChange0004', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testvideoOnFullscreenChange0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testvideoOnFullscreenChange0005
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0005
+ */
+ it('testvideoOnFullscreenChange0005', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.align).assertEqual("Alignment.Center");
+ console.info("[testvideoOnFullscreenChange0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testvideoOnFullscreenChange0006
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0006
+ */
+ it('testvideoOnFullscreenChange0006', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.fontColor).assertEqual(undefined);
+ console.info("[testvideoOnFullscreenChange0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testvideoOnFullscreenChange0007
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0007
+ */
+ it('testvideoOnFullscreenChange0007', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.lineHeight).assertEqual(undefined);
+ console.info("[testvideoOnFullscreenChange0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testvideoOnFullscreenChange0009
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0009
+ */
+ it('testvideoOnFullscreenChange0009', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.padding).assertEqual("0.00px");
+ console.info("[testvideoOnFullscreenChange0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testvideoOnFullscreenChange0010
+ * @tc.desic acevideoOnFullscreenChangeEtsTest0010
+ */
+ it('testvideoOnFullscreenChange0010', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onFullscreenChangeText');
+ console.info("[testvideoOnFullscreenChange0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Video');
+ expect(obj.$attrs.textAlign).assertEqual(undefined);
+ console.info("[testvideoOnFullscreenChange0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+
+ it('testvideoOnFullscreenChange0011', 0, async function (done) {
+ console.info('videoOnFullscreenChange testvideoOnFullscreenChange0011 START');
+ var innerEvent = {
+ eventId: 60227,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ try{
+ console.info("callback success" );
+ console.info("eventData.data.result result is: " + eventData.data.result);
+ expect(eventData.data.result).assertEqual("success");
+ console.info("video_101 end: ");
+ }catch(err){
+ console.info("video_101 on events_emitter err : " + JSON.stringify(err));
+ }
+ done();
+ }
+ try {
+ events_emitter.on(innerEvent, callback);
+ console.info("video_101 click result is: " + JSON.stringify(sendEventByKey('fullScreen', 10, "")));
+ } catch (err) {
+ console.info("video_101 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/web.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/web.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c135bf9a0ef13962269ced88bf18f3b4ed6d949b
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/web.test.ets
@@ -0,0 +1,161 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function webGetTitleJsunit() {
+ describe('webGetTitleTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/web',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get web state success " + JSON.stringify(pages));
+ if (!("web" == pages.name)) {
+ console.info("get web state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push web page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push web page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("webGetTitle after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testwebGetTitle0002
+ * @tc.desic acewebGetTitleEtsTest0002
+ */
+ it('testwebGetTitle0001', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0001] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.height).assertEqual("500.00vp");
+ console.info("[testwebGetTitle0001] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ it('testwebGetTitle0002', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0002] component fileAccess strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.fileAccess).assertEqual(undefined);
+ console.info("[testwebGetTitle0002] fileAccess value :" + obj.$attrs.fileAccess);
+ done();
+ });
+
+ it('testwebGetTitle0003', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0003] component javaScriptAccess strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.javaScriptAccess).assertEqual(undefined);
+ console.info("[testwebGetTitle0003] javaScriptAccess value :" + obj.$attrs.javaScriptAccess);
+ done();
+ });
+
+ it('testwebGetTitle0004', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0004] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.padding).assertEqual("20.00vp");
+ console.info("[testwebGetTitle0004] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ it('testwebGetTitle0005', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0005] component blur strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.blur).assertEqual(2);
+ console.info("[testwebGetTitle0005] blur value :" + obj.$attrs.blur);
+ done();
+ });
+
+ it('testwebGetTitle0006', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0006] component userAgent strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.userAgent).assertEqual(undefined);
+ console.info("[testwebGetTitle0006] userAgent value :" + obj.$attrs.userAgent);
+ done();
+ });
+
+ it('testwebGetTitle0007', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0007] component fileFromUrlAccess strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.fileFromUrlAccess).assertEqual(undefined);
+ console.info("[testwebGetTitle0007] fileFromUrlAccess value :" + obj.$attrs.fileFromUrlAccess);
+ done();
+ });
+
+ it('testwebGetTitle0008', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0008 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0008] component initialScale strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.initialScale).assertEqual(undefined);
+ console.info("[testwebGetTitle0008] initialScale value :" + obj.$attrs.initialScale);
+ done();
+ });
+
+ it('testwebGetTitle0009', 0, async function (done) {
+ console.info('webGetTitle testwebGetTitle0009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('getTitleText');
+ console.info("[testwebGetTitle0009] component webDebuggingAccess strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Web');
+ expect(obj.$attrs.webDebuggingAccess).assertEqual(undefined);
+ console.info("[testwebGetTitle0009] webDebuggingAccess value :" + obj.$attrs.webDebuggingAccess);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..aa6fa0580c21415b2493e2730beefa4b522da9ae
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets
@@ -0,0 +1,111 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function xcomponentGetXComponentContextJsunit() {
+ describe('xcomponentGetXComponentContextTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/xcomponent',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get xcomponent state success " + JSON.stringify(pages));
+ if (!("xcomponent" == pages.name)) {
+ console.info("get xcomponent state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push xcomponent page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push xcomponent page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("xcomponentGetXComponentContext after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testxcomponentGetXComponentContext0010
+ * @tc.desic acexcomponentGetXComponentContextEtsTest0010
+ */
+ it('testxcomponentGetXComponentContext0010', 0, async function (done) {
+ console.info('xcomponentGetXComponentContext testxcomponentGetXComponentContext0010 START');
+ await Utils.sleep(1000);
+ try {
+ var innerEventOne = {
+ eventId: 60228,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("onRequestPopupData_0010 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual("callBackSuccess");
+ done();
+ }
+ console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('getXComponentContextText', 10, "")));
+ events_emitter.on(innerEventOne, callback1);
+ } catch (err) {
+ console.info("onRequestPopupData_0010 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testxcomponentGetXComponentContext0010 END');
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testxcomponentSetXComponentSurfaceSize0001
+ * @tc.desic acexcomponentSetXComponentSurfaceSizeEtsTest0001
+ */
+ it('testxcomponentSetXComponentSurfaceSize0001', 0, async function (done) {
+ console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0001 START');
+ await Utils.sleep(2000);
+ console.info("setXComponentSurfaceSize0001 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, "")))
+ let strJson = getInspectorByKey('setXComponentSurfaceSizeText');
+ //console
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual("Text");
+ expect(obj.$attrs.surfaceWidth).assertEqual(undefined);
+ console.info('testxcomponentSetXComponentSurfaceSize0001 END');
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testxcomponentSetXComponentSurfaceSize0002
+ * @tc.desic acexcomponentSetXComponentSurfaceSizeEtsTest0002
+ */
+ it('testxcomponentSetXComponentSurfaceSize0002', 0, async function (done) {
+ console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0002 START');
+ await Utils.sleep(2000);
+ console.info("testxcomponentSetXComponentSurfaceSize0002 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, "")))
+ let strJson = getInspectorByKey('setXComponentSurfaceSizeText');
+ //console
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual("Text");
+ expect(obj.$attrs.surfaceHeight).assertEqual(undefined);
+ console.info('testxcomponentSetXComponentSurfaceSize0002 END');
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/color.json b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..68f8331ba0fbe3404fe8ab5ede5ecb98a0a76d80
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/color.json
@@ -0,0 +1,12 @@
+{
+ "color": [
+ {
+ "name": "color_hello",
+ "value": "#ffff0000"
+ },
+ {
+ "name": "color_world",
+ "value": "#ff0000ff"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/float.json b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/float.json
new file mode 100644
index 0000000000000000000000000000000000000000..f26020ff03a653a81ecc6fa8fdef0d9a3b067f96
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/float.json
@@ -0,0 +1,12 @@
+{
+ "float":[
+ {
+ "name":"font_hello",
+ "value":"28.0fp"
+ },
+ {
+ "name":"font_world",
+ "value":"20.0fp"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/string.json b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..ea42b011821112702135f8fa17059eec183ef638
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,32 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "entry_MainAbility"
+ },
+ {
+ "name": "description_mainability",
+ "value": "ETS_Empty Ability"
+ },
+ {
+ "name": "TestAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "TestAbility_label",
+ "value": "label"
+ },
+ {
+ "name":"string_hello",
+ "value":"Hello"
+ },
+ {
+ "name":"string_world",
+ "value":"World"
+ },
+ {
+ "name":"message_arrive",
+ "value":"We will arrive at %s."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/icon.png b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/icon.png differ
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/user.png b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/user.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/user.png differ
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/userFull.png b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/userFull.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/arkui/ace_ets_component_apilack/entry/src/main/resources/base/media/userFull.png differ
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/rawfile/test.png b/arkui/ace_ets_component_apilack/entry/src/main/resources/rawfile/test.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/arkui/ace_ets_component_apilack/entry/src/main/resources/rawfile/test.png differ
diff --git a/arkui/ace_ets_component_apilack/entry/src/main/resources/rawfile/videoTest.mp4 b/arkui/ace_ets_component_apilack/entry/src/main/resources/rawfile/videoTest.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..e01d970ffb78c5b2ab2fc20b60ea2cf3b1829cb3
--- /dev/null
+++ b/arkui/ace_ets_component_apilack/entry/src/main/resources/rawfile/videoTest.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5717f7f3d650e3bce5d159a013fd8a5d62cdde02ec76945cb473406e64f38203
+size 6301943
diff --git a/notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/signature/openharmony_sx.p7b b/arkui/ace_ets_component_apilack/signature/openharmony_sx.p7b
similarity index 100%
rename from notification/ces_standard/subscribeandpublish/actssubscriberunordersystemtest/signature/openharmony_sx.p7b
rename to arkui/ace_ets_component_apilack/signature/openharmony_sx.p7b
diff --git a/arkui/ace_ets_component_attrlack/BUILD.gn b/arkui/ace_ets_component_attrlack/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..afada8b8fbb59d885f37f9ff3b48eddceee06925
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/BUILD.gn
@@ -0,0 +1,36 @@
+# 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("ActsAceEtsAttrLackTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":ace_ets_dev_assets",
+ ":ace_ets_dev_resources",
+ ":ace_ets_dev_test_assets",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsAceEtsAttrLackTest"
+}
+ohos_js_assets("ace_ets_dev_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_js_assets("ace_ets_dev_test_assets") {
+ source_dir = "./entry/src/main/ets/TestAbility"
+}
+ohos_resources("ace_ets_dev_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/arkui/ace_ets_component_attrlack/Test.json b/arkui/ace_ets_component_attrlack/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..7a568e735eb08f4683506d00b2f34d20cf18e3d4
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/Test.json
@@ -0,0 +1,19 @@
+{
+ "description": "Configuration for aceEtsAttrLack Tests",
+ "driver": {
+ "type": "OHJSUnitTest",
+ "test-timeout": "600000",
+ "bundle-name": "com.open.harmony.aceEtsAttrLack",
+ "package-name": "com.open.harmony.aceEtsAttrLack",
+ "shell-timeout": "600000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsAceEtsAttrLackTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/config.json b/arkui/ace_ets_component_attrlack/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..10dd537aa5f3062ea7060f42a857b7f7b04b270a
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/config.json
@@ -0,0 +1,142 @@
+{
+ "app": {
+ "bundleName": "com.open.harmony.aceEtsAttrLack",
+ "vendor": "open",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 7,
+ "releaseType": "Release",
+ "target": 8
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.open.harmony.aceEtsAttrLack",
+ "name": ".MyApplication",
+ "mainAbility": "com.open.harmony.aceEtsAttrLack.MainAbility",
+ "deviceType": [
+ "default",
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry",
+ "installationFree": false
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "MainAbility",
+ "name": ".MainAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:description_mainability",
+ "formsEnabled": false,
+ "label": "$string:entry_MainAbility",
+ "type": "page",
+ "launchType": "standard"
+ },
+ {
+ "orientation": "unspecified",
+ "visible": true,
+ "srcPath": "TestAbility",
+ "name": ".TestAbility",
+ "srcLanguage": "ets",
+ "icon": "$media:icon",
+ "description": "$string:TestAbility_desc",
+ "formsEnabled": false,
+ "label": "$string:TestAbility_label",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index",
+ "pages/page1",
+ "pages/page2",
+ "pages/alertDialog",
+ "pages/animate_play_mode",
+ "pages/animator",
+ "pages/app",
+ "pages/attr_animate",
+ "pages/canvas",
+ "pages/checkBox",
+ "pages/checkBoxGroup",
+ "pages/common",
+ "pages/curves",
+ "pages/datePicker",
+ "pages/edgeEffect",
+ "pages/enums",
+ "pages/featureAbility",
+ "pages/fill_mode",
+ "pages/gesture",
+ "pages/gridCol",
+ "pages/gridRow",
+ "pages/listtest",
+ "pages/list_item_group",
+ "pages/loadingProgress",
+ "pages/pluginComponent",
+ "pages/progress",
+ "pages/radio",
+ "pages/refresh",
+ "pages/remoteWindow",
+ "pages/router",
+ "pages/scroll_edge",
+ "pages/sidebar",
+ "pages/slider",
+ "pages/stateManagement",
+ "pages/stepperItem",
+ "pages/swiper",
+ "pages/text_input",
+ "pages/units",
+ "pages/web",
+ "pages/copyOption",
+ "pages/responseType",
+ "pages/hoverEffect",
+ "pages/hitTestMode",
+ "pages/color"
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ },
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+ ],
+ "name": ".TestAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/app.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..07722b56d3d02df5fb59b51789007b844b43e63c
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from 'hypium/index'
+import testsuite from '../test/List.test'
+
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Log.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Log.ets
new file mode 100644
index 0000000000000000000000000000000000000000..018658e2911600fe489bd6a8430e8879be2b78eb
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Log.ets
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+const TAG = 'ets_apiLack_add';
+
+/**
+ * Basic log class
+ */
+export default class Log {
+
+ /**
+ * print info level log
+ *
+ * @param {string} tag - Page or class tag
+ * @param {string} log - Log needs to be printed
+ */
+ static showInfo(tag, log) {
+ console.info(`${TAG} tag: ${tag} --> ${log}`);
+ }
+
+ /**
+ * print debug level log
+ *
+ * @param {string} tag - Page or class tag
+ * @param {string} log - Log needs to be printed
+ */
+ static showDebug(tag, log) {
+ console.debug(`${TAG} tag: ${tag} --> ${log}`);
+ }
+
+ /**
+ * print error level log
+ *
+ * @param {string} tag - Page or class tag
+ * @param {string} log - Log needs to be printed
+ */
+ static showError(tag, log) {
+ console.error(`${TAG} tag: ${tag} --> ${log}`);
+ }
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Utils.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Utils.ets
new file mode 100644
index 0000000000000000000000000000000000000000..9ca8c904c5373019759b101f63fe919e1fab5658
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/Utils.ets
@@ -0,0 +1,118 @@
+// @ts-nocheck
+/**
+ * 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 class Utils {
+ static rect_left;
+ static rect_top;
+ static rect_right;
+ static rect_bottom;
+ static rect_value;
+
+ static sleep(time) {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ resolve()
+ }, time)
+ }).then(() => {
+ console.info(`sleep ${time} over...`)
+ })
+ }
+
+ static getComponentRect(key) {
+ let strJson = getInspectorByKey(key);
+ let obj = JSON.parse(strJson);
+ console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
+ let rectInfo = JSON.parse('[' + obj.$rect + ']')
+ console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
+ this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
+ this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
+ this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
+ this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
+ return this.rect_value = {
+ "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
+ }
+ }
+
+ static async swipe(downX, downY, upX, upY, steps) {
+ console.info('start to swipe')
+ this.drags(downX, downY, upX, upY, steps, false)
+ }
+
+ static async drag(downX, downY, upX, upY, steps) {
+ console.info('start to drag')
+ this.drags(downX, downY, upX, upY, steps, true)
+ }
+
+ static async drags(downX, downY, upX, upY, steps, drag) {
+ var xStep;
+ var yStep;
+ var swipeSteps;
+ var ret;
+ xStep = 0;
+ yStep = 0;
+ ret = false;
+ swipeSteps = steps;
+ if (swipeSteps == 0) {
+ swipeSteps = 1;
+ }
+ xStep = (upX - downX) / swipeSteps;
+ yStep = (upY - downY) / swipeSteps;
+ console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
+ var downPoint: TouchObject = {
+ id: 1,
+ x: downX,
+ y: downY,
+ type: TouchType.Down,
+ }
+ console.info('down touch started: ' + JSON.stringify(downPonit))
+ sendTouchEvent(downPoint);
+ console.info('start to move')
+ if (drag) {
+ await this.sleep(500)
+ }
+ for (var i = 1;i <= swipeSteps; i++) {
+ var movePoint: TouchObject = {
+ id: 1,
+ x: downX + (xStep * i),
+ y: downY + (yStep * i),
+ type: TouchType.Move
+ }
+ console.info('move touch started: ' + JSON.stringify(movePoint))
+ ret = sendTouchEvent(movePoint)
+ if (ret == false) {
+ break;
+ }
+ await this.sleep(5)
+ }
+ console.info('start to up')
+ if (drag) {
+ await this.sleep(100)
+ }
+ var upPoint: TouchObject = {
+ id: 1,
+ x: upX,
+ y: upY,
+ type: TouchType.Up,
+ }
+ console.info('up touch started: ' + JSON.stringify(upPoint))
+ sendTouchEvent(upPoint)
+ await this.sleep(500)
+ }
+}
+
+
+
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/bg1.png b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/bg1.png
new file mode 100644
index 0000000000000000000000000000000000000000..f97eae0b4cd0f7b3b2ef8c4db1af68ce861181e9
Binary files /dev/null and b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/bg1.png differ
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/bg2.png b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/bg2.png
new file mode 100644
index 0000000000000000000000000000000000000000..187dad546d1c335de78e8469c1ad0dd06e20a045
Binary files /dev/null and b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/bg2.png differ
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/plugin_component.js b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/plugin_component.js
new file mode 100644
index 0000000000000000000000000000000000000000..b0d7eea42d114f3d45dce42d90176137d8f410a0
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/plugin_component.js
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 pluginComponentManager from '@ohos.pluginComponent'
+
+function onPushListener(source, template, data, extraData) {
+ console.log("onPushListener template.source=" + template.source)
+ var jsonObject = JSON.parse(data.componentTemplate.source)
+ console.log("request_callback1:source json object" + jsonObject)
+ var jsonArry = jsonObject.ExternalComponent
+ for (var i in jsonArry) {
+ console.log(jsonArry[i])
+ }
+ console.log("onPushListener:source json object" + jsonObject)
+ console.log("onPushListener:source json string" + JSON.stringify(jsonObject))
+ console.log("onPushListener template.ability=" + template.ability)
+ console.log("onPushListener data=" + JSON.stringify(data))
+ console.log("onPushListener extraData=" + JSON.stringify(extraData))
+}
+
+function onRequestListener(source, name, data)
+{
+ console.log("onRequestListener name=" + name);
+ console.log("onRequestListener data=" + JSON.stringify(data));
+ return {template:"plugintemplate", data:data};
+}
+
+export default {
+ //register listener
+ onListener() {
+ pluginComponentManager.on("push", onPushListener)
+ pluginComponentManager.on("request", onRequestListener)
+ },
+ Push() {
+ // 组件提供方主动发送事件
+ pluginComponentManager.push(
+ {
+ want: {
+ bundleName: "com.example.myapplication",
+ abilityName: "com.example.myapplication.MainAbility",
+ "parameters": {
+ DIMENSION_KEY: FormDimension.Dimension_1_2
+ }
+ },
+ name: "plugintemplate",
+ data: {
+ "key_1": "plugin component test",
+ "key_2": 34234
+ },
+ extraData: {
+ "extra_str": "this is push event"
+ },
+ jsonPath: "",
+ },
+ (err, data) => {
+ console.log("push_callback: push ok!");
+ }
+ )
+ },
+ Request() {
+ // 组件使用方主动发送事件
+ pluginComponentManager.request({
+ want: {
+ bundleName: "com.example.myapplication",
+ abilityName: "com.example.myapplication.MainAbility",
+ },
+ name: "plugintemplate",
+ data: {
+ "key_1": "plugin component test",
+ "key_2": 34234
+ },
+ jsonPath: "",
+ },
+ (err, data) => {
+ console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability)
+ console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source)
+ var jsonObject = JSON.parse(data.componentTemplate.source)
+ console.log("request_callback:source json object" + jsonObject)
+ var jsonArry = jsonObject.ExternalComponent
+ for (var i in jsonArry) {
+ console.log(jsonArry[i])
+ }
+ console.log("request_callback:source json string" + JSON.stringify(jsonObject))
+ console.log("request_callback: data=" + JSON.stringify(data.data))
+ console.log("request_callback: extraData=" + JSON.stringify(data.extraData))
+ }
+ )
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/PluginProviderExample.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/PluginProviderExample.ets
new file mode 100644
index 0000000000000000000000000000000000000000..aad3c88d5f177af57db81cac083cb9ddd05e209c
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/PluginProviderExample.ets
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 plugin from "../common/plugin_component.js"
+
+@Entry
+@Component
+struct PluginProviderExample {
+ @State message: string = 'no click!'
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Button('Register Push Listener')
+ .fontSize(30)
+ .width(400)
+ .height(100)
+ .margin({top:20})
+ .onClick(()=>{
+ plugin.onListener()
+ console.log("Button('Register Push Listener')")
+ })
+ Button('Push')
+ .fontSize(30)
+ .width(400)
+ .height(100)
+ .margin({top:20})
+ .onClick(()=>{
+ plugin.Push()
+ this.message = "Button('Push')"
+ console.log("Button('Push')")
+ })
+ Text(this.message)
+ .height(150)
+ .fontSize(30)
+ .padding(5)
+ .margin(5)
+ }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/alertDialog.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/alertDialog.ets
new file mode 100644
index 0000000000000000000000000000000000000000..56667c8963b12bd1b54045fc29c9b43ea8d0f7c6
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/alertDialog.ets
@@ -0,0 +1,146 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct AlertDialogCenterStart {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear AlertDialogCenterStart start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear AlertDialogCenterStart end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("alertDialog-CenterStart")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("CenterStartText")
+
+ Text("alertDialog-CenterEnd")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("CenterEndText")
+
+ Button('one button dialog')
+ .key("CenterStartButton")
+ .onClick(() => {
+ AlertDialog.show(
+ {
+ title: 'title',
+ message: 'text',
+ confirm: {
+ value: 'button',
+ action: () => {
+ console.info('Button-clicking callback')
+ }
+ },
+ cancel: () => {
+ console.info('Closed callbacks')
+ },
+ alignment:DialogAlignment.CenterStart
+ }
+ )
+ try {
+ var backData = {
+ data: {
+ "Result": true
+ }
+ }
+ let backEvent = {
+ eventId: 81601,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("CenterStart start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("CenterStart emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .backgroundColor(0x317aff)
+
+ Button('two button dialog')
+ .key("CenterEndButton")
+ .onClick(() => {
+ AlertDialog.show(
+ {
+ title: 'title',
+ message: 'text',
+ primaryButton: {
+ value: 'cancel',
+ action: () => {
+ console.info('Callback when the first button is clicked')
+ }
+ },
+ secondaryButton: {
+ value: 'ok',
+ action: () => {
+ console.info('Callback when the second button is clicked')
+ }
+ },
+ cancel: () => {
+ console.info('Closed callbacks')
+ },
+ alignment:DialogAlignment.CenterEnd
+ }
+ )
+ try {
+ var backData = {
+ data: {
+ "Result": true
+ }
+ }
+ let backEvent = {
+ eventId: 81602,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("CenterEnd start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("CenterEnd emit action state err: " + JSON.stringify(err.message))
+ }
+ }).backgroundColor(0x317aff)
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animate_play_mode.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animate_play_mode.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fb499e08453ac1aa9ba0ee94c90371ee52d290d0
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animate_play_mode.ets
@@ -0,0 +1,125 @@
+/**
+ * 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct AttrAnimationExample {
+ @State widthSize: number = 200
+ @State heightSize: number = 100
+ @State flag: boolean = true
+
+ @State widthSizeAlternate: number = 200
+ @State heightSizeAlternate: number = 100
+ @State flagAlternate: boolean = true
+ @State widthSizeNormal: number = 200
+ @State heightSizeNormal: number = 100
+ @State flagNormal: boolean = true
+
+ @State widthSizeAlternateReverse: number = 200
+ @State heightSizeAlternateReverse: number = 100
+ @State flagAlternateReverse: boolean = true
+
+ build() {
+ Column() {
+ Button('PlayMode.Reverse')
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 200
+ this.heightSize = 100
+ }
+ this.flag = !this.flag
+ })
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .key("Reverse")
+ .animation({
+ duration: 3000, // 动画时长
+ curve: Curve.EaseOut, // 动画曲线
+ delay: 1000, // 动画延迟
+ iterations: 1, // 播放次数
+ playMode: PlayMode.Reverse // 动画模式
+ }) // 对Button组件的宽高属性进行动画配置
+
+ Button('PlayMode.Alternate')
+ .onClick((event: ClickEvent) => {
+ if (this.flagAlternate) {
+ this.widthSizeAlternate = 100
+ this.heightSizeAlternate = 50
+ } else {
+ this.widthSizeAlternate = 200
+ this.heightSizeAlternate = 100
+ }
+ this.flagAlternate = !this.flagAlternate
+ })
+ .width(this.widthSizeAlternate).height(this.heightSizeAlternate).backgroundColor(0x317aff)
+ .key("Alternate")
+ .animation({
+ duration: 3000,
+ curve: Curve.EaseOut,
+ delay: 1000,
+ iterations: 1,
+ playMode: PlayMode.Alternate
+ })
+
+ Button('PlayMode.Normal')
+ .onClick((event: ClickEvent) => {
+ if (this.flagNormal) {
+ this.widthSizeNormal = 100
+ this.heightSizeNormal = 50
+ } else {
+ this.widthSizeNormal = 200
+ this.heightSizeNormal = 100
+ }
+ this.flagNormal = !this.flagNormal
+ })
+ .width(this.widthSizeNormal).height(this.heightSizeNormal).backgroundColor(0x317aff)
+ .key("Normal")
+ .animation({
+ duration: 3000,
+ curve: Curve.EaseOut,
+ delay: 1000,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('PlayMode.AlternateReverse')
+ .onClick((event: ClickEvent) => {
+ if (this.flagAlternateReverse) {
+ this.widthSizeAlternateReverse = 100
+ this.heightSizeAlternateReverse = 50
+ } else {
+ this.widthSizeAlternateReverse = 200
+ this.heightSizeAlternateReverse = 100
+ }
+ this.flagAlternateReverse = !this.flagAlternateReverse
+ })
+ .width(this.widthSizeAlternateReverse).height(this.heightSizeAlternateReverse).backgroundColor(0x317aff)
+ .key("AlternateReverse")
+ .animation({
+ duration: 3000,
+ curve: Curve.EaseOut,
+ delay: 1000,
+ iterations: 1,
+ playMode: PlayMode.AlternateReverse
+ })
+ }.width('100%').margin({ top: 5 })
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animator.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animator.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7bb0c726ad120268e713e303fce85504369e6abb
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/animator.ets
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct AnimatorOnframe {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear AnimatorOnframe start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear AnimatorOnframe end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("animator-Onframe")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onframeText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/app.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..48ea7769373274c8e64d77a2e7a9629beb595409
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/app.ets
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 app from '@system.app';
+import events_emitter from '@ohos.events.emitter';
+
+import Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct AppVersionCode {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear AppVersionCode start:`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear AppVersionCode end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("app-VersionCode")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("versionCodeText")
+ .onClick(()=>{
+ app.getInfo().versionCode = 1
+ try {
+ var backData = {
+ data: {
+ "Code": app.getInfo().versionCode
+ }
+ }
+ let backEvent = {
+ eventId: 60302,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("versionCode start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("versionCode emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/attr_animate.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/attr_animate.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c1a2014a7efd7631a6f99029b85133cd5cb619b9
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/attr_animate.ets
@@ -0,0 +1,267 @@
+/**
+ * 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct AttrAnimationExample {
+ @State widthSize: number = 200
+ @State heightSize: number = 80
+ @State flag: boolean = true
+
+ @State widthSizeEaseOut: number = 200
+ @State heightSizeEaseOut: number = 80
+ @State flagEaseOut: boolean = true
+
+ @State widthSizeFastOutSlowIn: number = 200
+ @State heightSizeFastOutSlowIn: number = 80
+ @State flagFastOutSlowIn: boolean = true
+
+ @State widthSizeLinearOutSlowIn: number = 200
+ @State heightSizeLinearOutSlowIn: number = 80
+ @State flagLinearOutSlowIn: boolean = true
+
+ @State widthSizeFastOutLinearIn: number = 200
+ @State heightSizeFastOutLinearIn: number = 80
+ @State flagFastOutLinearIn: boolean = true
+
+ @State widthSizeExtremeDeceleration: number = 200
+ @State heightSizeExtremeDeceleration: number = 80
+ @State flagExtremeDeceleration: boolean = true
+
+ @State widthSizeSharp: number = 200
+ @State heightSizeSharp: number = 80
+ @State flagSharp: boolean = true
+
+ @State widthSizeRhythm: number = 200
+ @State heightSizeRhythm: number = 80
+ @State flagRhythm: boolean = true
+
+ @State widthSizeSmooth: number = 200
+ @State heightSizeSmooth: number = 80
+ @State flagSmooth: boolean = true
+
+ @State widthSizeFriction: number = 200
+ @State heightSizeFriction: number = 80
+ @State flagFriction: boolean = true
+
+ build() {
+ Column() {
+ Button('EaseInOut')
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 200
+ this.heightSize = 80
+ }
+ this.flag = !this.flag
+ })
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000, // 动画时长
+ curve: Curve.EaseInOut, // 动画曲线
+ delay: 500, // 动画延迟
+ iterations: 1, // 播放次数
+ playMode: PlayMode.Normal // 动画模式
+ })
+
+ Button('Curve.EaseOut')
+ .onClick((event: ClickEvent) => {
+ if (this.flagEaseOut) {
+ this.widthSizeEaseOut = 100
+ this.heightSizeEaseOut = 50
+ } else {
+ this.widthSizeEaseOut = 200
+ this.heightSizeEaseOut = 80
+ }
+ this.flagEaseOut = !this.flagEaseOut
+ })
+ .width(this.widthSizeEaseOut).height(this.heightSizeEaseOut).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.EaseOut,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('FastOutSlowIn')
+ .onClick((event: ClickEvent) => {
+ if (this.flagFastOutSlowIn) {
+ this.widthSizeFastOutSlowIn = 100
+ this.heightSizeFastOutSlowIn = 50
+ } else {
+ this.widthSizeFastOutSlowIn = 200
+ this.heightSizeFastOutSlowIn = 80
+ }
+ this.flagFastOutSlowIn = !this.flagFastOutSlowIn
+ })
+ .width(this.widthSizeFastOutSlowIn).height(this.heightSizeFastOutSlowIn).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.FastOutSlowIn,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('LinearOutSlowIn')
+ .onClick((event: ClickEvent) => {
+ if (this.flagLinearOutSlowIn) {
+ this.widthSizeLinearOutSlowIn = 100
+ this.heightSizeLinearOutSlowIn = 50
+ } else {
+ this.widthSizeLinearOutSlowIn = 200
+ this.heightSizeLinearOutSlowIn = 80
+ }
+ this.flagLinearOutSlowIn = !this.flagLinearOutSlowIn
+ })
+ .width(this.widthSizeLinearOutSlowIn).height(this.heightSizeLinearOutSlowIn).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.LinearOutSlowIn,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('FastOutLinearIn')
+ .onClick((event: ClickEvent) => {
+ if (this.flagFastOutLinearIn) {
+ this.widthSizeFastOutLinearIn = 100
+ this.heightSizeFastOutLinearIn = 50
+ } else {
+ this.widthSizeFastOutLinearIn = 200
+ this.heightSizeFastOutLinearIn = 80
+ }
+ this.flagFastOutLinearIn = !this.flagFastOutLinearIn
+ })
+ .width(this.widthSizeFastOutLinearIn).height(this.heightSizeFastOutLinearIn).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.FastOutLinearIn,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('ExtremeDeceleration')
+ .onClick((event: ClickEvent) => {
+ if (this.flagExtremeDeceleration) {
+ this.widthSizeExtremeDeceleration = 100
+ this.heightSizeExtremeDeceleration = 50
+ } else {
+ this.widthSizeExtremeDeceleration = 200
+ this.heightSizeExtremeDeceleration = 80
+ }
+ this.flagExtremeDeceleration = !this.flagExtremeDeceleration
+ })
+ .width(this.widthSizeExtremeDeceleration).height(this.heightSizeExtremeDeceleration).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.ExtremeDeceleration,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('Sharp')
+ .onClick((event: ClickEvent) => {
+ if (this.flagSharp) {
+ this.widthSizeSharp = 100
+ this.heightSizeSharp = 50
+ } else {
+ this.widthSizeSharp = 200
+ this.heightSizeSharp = 80
+ }
+ this.flagSharp = !this.flagSharp
+ })
+ .width(this.widthSizeSharp).height(this.heightSizeSharp).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.Sharp,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('Rhythm')
+ .onClick((event: ClickEvent) => {
+ if (this.flagRhythm) {
+ this.widthSizeRhythm = 100
+ this.heightSizeRhythm = 50
+ } else {
+ this.widthSizeRhythm = 200
+ this.heightSizeRhythm = 80
+ }
+ this.flagRhythm = !this.flagRhythm
+ })
+ .width(this.widthSizeRhythm).height(this.heightSizeRhythm).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.Rhythm,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('Smooth')
+ .onClick((event: ClickEvent) => {
+ if (this.flagSmooth) {
+ this.widthSizeSmooth = 100
+ this.heightSizeSmooth = 50
+ } else {
+ this.widthSizeSmooth = 200
+ this.heightSizeSmooth = 80
+ }
+ this.flagSmooth = !this.flagSmooth
+ })
+ .width(this.widthSizeSmooth).height(this.heightSizeSmooth).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.Smooth,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('Friction')
+ .onClick((event: ClickEvent) => {
+ if (this.flagFriction) {
+ this.widthSizeFriction = 100
+ this.heightSizeFriction = 50
+ } else {
+ this.widthSizeFriction = 200
+ this.heightSizeFriction = 80
+ }
+ this.flagFriction = !this.flagFriction
+ })
+ .width(this.widthSizeFriction).height(this.heightSizeFriction).backgroundColor(0x317aff)
+ .animation({
+ duration: 2000,
+ curve: Curve.Friction,
+ delay: 500,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ }.width('100%').margin({ top: 5 })
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/calendar.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/calendar.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7be4f5545d0b194f859f2a6baa7c4125c5bfec01
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/calendar.ets
@@ -0,0 +1,91 @@
+/*
+ * 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct calendar {
+ @State curMonth: MonthData = { year: 0, month: 0, data: [] };
+ @State preMonth: MonthData = { year: 0, month: 0, data: [] };
+ @State nextMonth: MonthData = { year: 0, month: 0, data: [] }
+ @State year: number = 0
+ @State month: number = 0
+ Controller: CalendarController = new CalendarController();
+ private lunarMonthDays: string[] = [
+ '初一', '初二', '初三', '初四', '初五', '初六', '初七', '初八', '初九', '初十',
+ '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十',
+ '廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '三十']
+ private lunarMonthNames: string[] = ['正月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '冬月', '腊月']
+
+ build() {
+ Calendar({
+ date: { year: 2021, month: 8, day: 35 },
+ currentData: this.curMonth,
+ preData: this.preMonth,
+ nextData: this.nextMonth,
+ controller: this.Controller
+ })
+ .showLunar(true)
+ .showHoliday(true)
+ .needSlide(true)
+ .offDays(Week.Fri | Week.Sat | Week.Mon | Week.Thur)
+ .startOfWeek(Week.Sun)
+ .direction(Axis.Horizontal)
+ .currentDayStyle({
+ dayColor: Color.Black,
+ lunarColor: Color.Gray,
+ markLunarColor: Color.Black,
+ dayFontSize: 15,
+ lunarDayFontSize: 10,
+ boundaryColOffset: 10,
+ })
+ .nonCurrentDayStyle({
+ nonCurrentMonthDayColor: Color.Black,
+ nonCurrentMonthLunarColor: Color.Gray,
+ nonCurrentMonthWorkDayMarkColor: Color.Green,
+ nonCurrentMonthOffDayMarkColor: Color.Brown,
+ })
+ .todayStyle({
+ focusedDayColor: Color.Red,
+ focusedLunarColor: Color.Orange,
+ focusedAreaBackgroundColor: Color.Blue,
+ focusedAreaRadius: 20
+ })
+ .weekStyle({
+ weekColor: Color.Black,
+ weekendDayColor: Color.Orange,
+ weekendLunarColor: Color.Blue,
+ weekFontSize: 20,
+ weekHeight: 5,
+ weekWidth: 48,
+ })
+ .workStateStyle({
+ workDayMarkColor: Color.Red,
+ offDayMarkColor: Color.Orange,
+ workDayMarkSize: 10,
+ offDayMarkSize: 2,
+ workStateWidth: 12,
+ workStateHorizontalMovingDistance: 0,
+ workStateVerticalMovingDistance: 12,
+ })
+ .onSelectChange((request) => {
+ this.year = request.year;
+ this.month = request.month;
+ console.info('On Select change: ' + this.year + '/' + this.month)
+ })
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/canvas.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/canvas.ets
new file mode 100644
index 0000000000000000000000000000000000000000..68eb1ed29b6b272dc327979e9be5f85b301da6d4
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/canvas.ets
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct CanvasActualBoundingBoxAscent {
+
+ private settings: RenderingContextSettings = new RenderingContextSettings(true)//antialias:boolean
+ private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
+
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CanvasActualBoundingBoxAscent start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear CanvasActualBoundingBoxAscent end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Canvas(this.context)
+ .key('Canvas')
+ .width('100%')
+ .height('100%')
+ .backgroundColor('#ffff00')
+ .position({x:3,y:5})
+ .align(Alignment.Center)
+ .onReady(() =>{
+ this.context.font = '50px sans-serif'
+ this.context.fillText("Hello World!", 20, 100)
+ this.context.textBaseline = 'top'
+ this.context.fillText("width:" + this.context.measureText("Hello World!").width, 20, 150)
+ this.context.fillText("actualBoundingBoxAscent:" + this.context.measureText("Hello World!").actualBoundingBoxAscent, 20, 200)
+ this.context.fillText("actualBoundingBoxDescent:" + this.context.measureText("Hello World!").actualBoundingBoxDescent, 20, 250)
+ this.context.fillText("actualBoundingBoxLeft:" + this.context.measureText("Hello World!").actualBoundingBoxLeft, 20, 300)
+ this.context.fillText("actualBoundingBoxRight:" + this.context.measureText("Hello World!").actualBoundingBoxRight, 20, 350)
+ this.context.fillText("alphabeticBaseline:" + this.context.measureText("Hello World!").alphabeticBaseline, 20, 400)
+ this.context.fillText("emHeightAscent:" + this.context.measureText("Hello World!").emHeightAscent, 20, 450)
+ this.context.fillText("emHeightDescent:" + this.context.measureText("Hello World!").emHeightDescent, 20, 500)
+ this.context.fillText("fontBoundingBoxAscent:" + this.context.measureText("Hello World!").fontBoundingBoxAscent, 20, 550)
+ this.context.fillText("fontBoundingBoxDescent:" + this.context.measureText("Hello World!").fontBoundingBoxDescent, 20, 600)
+ this.context.fillText("hangingBaseline:" + this.context.measureText("Hello World!").hangingBaseline, 20, 650)
+ this.context.fillText("ideographicBaseline" + this.context.measureText("Hello World!").ideographicBaseline, 20, 700)
+// this.context.fillText("antialias" + this.context.measureText("Hello World!").antialias, 20, 700)
+ })
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBox.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBox.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a5e30c37435814541ade95cac85dab10c9bdf12f
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBox.ets
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct CheckBoxGroup {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CheckBoxGroup start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear CheckBoxGroup end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("checkBox-Group")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("groupText")
+
+ Row() {
+ CheckboxGroup({group : 'checkboxGroup'})
+ .selectedColor(0xed6f21)
+ .key('CheckboxGroup')
+ .onChange((itemName:CheckboxGroupResult) => {
+ console.info("TextPicker::dialogResult is" + JSON.stringify(itemName))
+ })
+ Text('select all').fontSize(20)
+ Checkbox({name: 'checkbox1', group: 'checkboxGroup'})
+ .key('Checkbox1')
+ .select(true)
+ .selectedColor(0xed6f21)
+ .onChange((value: boolean) => {
+ console.info('Checkbox1 change is'+ value)
+ })
+ Checkbox({name: 'checkbox2', group: 'checkboxGroup'})
+ .key('Checkbox2')
+ .select(false)
+ .selectedColor(0x39a2db)
+ .onChange((value: boolean) => {
+ console.info('Checkbox2 change is'+ value)
+ })
+ }
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets
new file mode 100644
index 0000000000000000000000000000000000000000..59c3785e25d392190ae2ed36dabca17d61a69c7a
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+import Utils from '../../test/Utils.ets'
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct CheckBoxGroupPart {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CheckBoxGroupPart start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear CheckBoxGroupPart end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("checkBoxGroup-Part")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("PartText")
+
+ Text("checkBoxGroup-Group")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("groupText")
+
+ CheckboxGroup({group : 'checkboxGroup'})
+ .key('CheckboxGroup')
+ .selectedColor(0xed6f21)
+ .onChange((itemName:CheckboxGroupResult) => {
+ console.info("TextPicker::dialogResult is" + JSON.stringify(itemName))
+ console.info("TextPicker::dialogResult is" + JSON.stringify(itemName.status))
+ try {
+ var backData = {
+ data: {
+ "STATUS": itemName.status
+ }
+ }
+ let backEvent = {
+ eventId: 60301,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("Part start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("Part emit action state err: " + JSON.stringify(err.message))
+ }
+ Utils.sleep(1000);
+ if(itemName.status === SelectStatus.Part){
+ console.info("CheckboxGroup SelectStatus.Part")
+ }
+ })
+ Text('select all').fontSize(20)
+ Checkbox({name: 'checkbox1', group: 'checkboxGroup'})
+ .key('Checkbox1')
+ .select(true)
+ .selectedColor(0xed6f21)
+ .onChange((value: boolean) => {
+ console.info('Checkbox1 change is'+ value)
+ })
+ Checkbox({name: 'checkbox2', group: 'checkboxGroup'})
+ .key('Checkbox2')
+ .select(false)
+ .selectedColor(0x39a2db)
+ .onChange((value: boolean) => {
+ console.info('Checkbox2 change is'+ value)
+ })
+
+
+ }.width("100%").height("100%")
+
+
+
+
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/color.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/color.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4afa006f0d6b60229e546a5b665e4be4f3bf1650
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/color.ets
@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct ColorEnum {
+ build() {
+ Column() {
+ Text('Transparent')
+ .fontColor(Color.Transparent)
+ .backgroundColor(Color.Yellow)
+ .fontSize(50)
+ .key('Transparent')
+ .onClick(() => {
+ let strJson = getInspectorByKey('Transparent');
+ let obj = JSON.parse(strJson);
+ console.info("testTransparent fontColor is" + obj.$attrs.fontColor);
+ })
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/common.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/common.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d5e9b6245e5b7ab86f800a8b9a6d38ea771d9ec3
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/common.ets
@@ -0,0 +1,634 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct CommonColorMode {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CommonColorMode start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear CommonColorMode end`)
+ }
+
+ @Styles normalStyles() {
+ .backgroundColor("#0A59F7")
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("common-FontScale")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("fontScaleText")
+
+ Text("common-OnFinish")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("onFinishText")
+ .animation({
+ onFinish: () => {
+ Log.showInfo(TAG, 'animation onFinish success')
+ }
+ })
+
+ Text("common-MotionPath")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("motionPathText")
+ .sharedTransition('motionPathText', {
+ motionPath: {
+ path: ''
+ }
+ })
+
+ Text("common-Middle")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("middleText")
+ .alignRules({
+ middle: { anchor: 'string', align: HorizontalAlign.Center }
+ })
+
+ Text("common-Area")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("areaText")
+ .onClick((event) => {
+ Log.showInfo(TAG, 'JSON.stringify area : ' + JSON.stringify(event.target.area))
+ const area = JSON.stringify(event.target.area)
+ console.info("area value1 is: " + area)
+ console.info("area value3 is: " + JSON.parse(JSON.stringify(event.target.area))["width"])
+ let value = JSON.parse(JSON.stringify(event.target.area))["width"]
+ try {
+ var backData = {
+ data: {
+ "STATUS": value
+ }
+ }
+ let backEvent = {
+ eventId: 60312,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("areaValue start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("areaValue emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ Text("common-Repeat")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("RepeatText")
+ .borderImage({
+ source: { angle: 90,
+ direction: GradientDirection.Left,
+ colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]]
+ },
+ slice: { top: 10, bottom: 10, left: 10, right: 10 },
+ width: { top: "10px", bottom: "10px", left: "10px", right: "10px" },
+ repeat: RepeatMode.Repeat,
+ fill: false
+ });
+
+ Text("common-Space")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("SpaceText")
+ .borderImage({
+ source: { angle: 90,
+ direction: GradientDirection.Left,
+ colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]]
+ },
+ slice: { top: 10, bottom: 10, left: 10, right: 10 },
+ width: { top: "10px", bottom: "10px", left: "10px", right: "10px" },
+ repeat: RepeatMode.Space,
+ fill: false
+ });
+
+ Text("common-Thin")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ThinText")
+ .backgroundBlurStyle(BlurStyle.Thin)
+
+ Text("common-Thick")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ThickText")
+ .backgroundBlurStyle(BlurStyle.Thick)
+
+ Text("common-Slice")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("sliceText")
+ .borderImage({
+ source: { angle: 90,
+ direction: GradientDirection.Left,
+ colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]]
+ },
+ slice: { top: 10, bottom: 10, left: 10, right: 10 },
+ width: { top: "10px", bottom: "10px", left: "10px", right: "10px" },
+ repeat: RepeatMode.Stretch,
+ fill: false
+ });
+
+ Text("common-Outset")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("outsetText")
+ .borderImage({
+ source: { angle: 90,
+ direction: GradientDirection.Left,
+ colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]]
+ },
+ slice: { top: 10, bottom: 10, left: 10, right: 10 },
+ width: { top: "10px", bottom: "10px", left: "10px", right: "10px" },
+ repeat: RepeatMode.Stretch,
+ fill: false,
+ outset: 2
+ });
+
+
+ Text("common-Touches")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("touchesText")
+ .onTouch((event) => {
+ Log.showInfo(TAG, 'touches: ' + JSON.stringify(event.touches))
+ const touchesValue = JSON.stringify(event.touches)
+ console.info("touches value1 is: " + touchesValue)
+ console.info("touches value3 is: " + JSON.stringify(event.touches)[0]["type"])
+ let value = JSON.stringify(event.touches)[0]["type"]
+ try {
+ var backData1 = {
+ data: {
+ "STATUS": value
+ }
+ }
+ let backEvent1 = {
+ eventId: 60313,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("touchesValue start to emit action state")
+ events_emitter.emit(backEvent1, backData1)
+ } catch (err) {
+ console.info("touchesValue emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text("common-ChangedTouches")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("changedTouchesText")
+ .onTouch((event) => {
+ Log.showInfo(TAG, 'changedTouches: ' + JSON.stringify(event.changedTouches))
+ const changedTouchesValue = JSON.stringify(event.changedTouches)
+ console.info("changedTouchesValue value1 is: " + changedTouchesValue)
+ console.info("changedTouchesValue value3 is: " + changedTouchesValue[0]["type"])
+ let value = changedTouchesValue[0]["type"]
+ try {
+ var backData2 = {
+ data: {
+ "STATUS": value
+ }
+ }
+ let backEvent2 = {
+ eventId: 60314,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("touchesValue start to emit action state")
+ events_emitter.emit(backEvent2, backData2)
+ } catch (err) {
+ console.info("touchesValue emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text("common-KeyCode")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("keyCodeText")
+ .onKeyEvent((event) => {
+ Log.showInfo(TAG, 'keyCode: ' + event.keyCode)
+ })
+
+ Text("common-KeyText")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("keyTextText")
+ .onKeyEvent((event) => {
+ Log.showInfo(TAG, 'keyText: ' + event.keyText)
+ })
+
+ Text("common-KeySource")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("keySourceText")
+ .onKeyEvent((event) => {
+ Log.showInfo(TAG, 'keySource: ' + event.keySource)
+ })
+
+ Text("common-DeviceId")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("deviceIdText")
+ .onKeyEvent((event) => {
+ Log.showInfo(TAG, 'deviceId: ' + event.deviceId)
+ })
+
+ Text("common-MetaKey")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("metaKeyText")
+ .onKeyEvent((event) => {
+ Log.showInfo(TAG, 'metaKey: ' + event.metaKey)
+ })
+
+ Text("common-Normal")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("normalText")
+ .stateStyles({ normal: this.normalStyles })
+
+ Text("common-Pressed")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("pressedText")
+ .stateStyles({ pressed: this.normalStyles })
+
+ Text("common-Focused")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("focusedText")
+ .stateStyles({ focused: this.normalStyles })
+
+ Text("common-Clicked")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("clickedText")
+ .stateStyles({ clicked: this.normalStyles })
+
+ }.width("100%").height("100%")
+ }
+}
+
+@Preview({
+ locale: 'locale'
+})
+@Component
+struct PreviewParamsLocale {
+ build() {
+ Flex() {
+ Text("common-locale")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("LocaleText")
+ }
+ }
+}
+
+@Preview({
+ colorMode: 'red',
+})
+@Component
+struct PreviewParamsColorMode {
+ build() {
+ Flex() {
+ Text("common-colorMode")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ColorModeText")
+ }
+ }
+}
+
+@Preview({
+ deviceType: 'phone'
+})
+@Component
+struct PreviewParamsDeviceType {
+ build() {
+ Flex() {
+ Text("common-deviceType")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("DeviceTypeText")
+ }
+ }
+}
+
+@Preview({
+ dpi: 160
+})
+@Component
+struct PreviewParamsDpi {
+ build() {
+ Flex() {
+ Text("common-dpi")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("DpiText")
+ }
+ }
+}
+
+@Preview({
+ orientation: ''
+})
+@Component
+struct PreviewParamsOrientation {
+ build() {
+ Flex() {
+ Text("common-orientation")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("OrientationText")
+ }
+ }
+}
+
+@Preview({
+ roundScreen: true
+})
+@Component
+struct PreviewParamsRoundScreen {
+ build() {
+ Flex() {
+ Text("common-roundScreen")
+ .width(320)
+ .height(40)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("RoundScreenText")
+ }
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/copyOption.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/copyOption.ets
new file mode 100644
index 0000000000000000000000000000000000000000..45d9185f2dd57dd13ebc2dc0a0d3380b62dee6e4
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/copyOption.ets
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct CopyOption {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CopyOption start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear CopyOption end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+ Text("copyOption-InApp")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("InAppText")
+// .copyOption(CopyOption.InApp)
+ .visibility(Visibility.None)
+
+ Text("copyOption-LocalDevice")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("LocalDeviceText")
+// .copyOption(CopyOption.LocalDevice)
+ .visibility(Visibility.None)
+
+ }.width("100%").height("100%")
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/curves.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/curves.ets
new file mode 100644
index 0000000000000000000000000000000000000000..234d01e3ec45155bc8677943cc80aeaa56545cc0
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/curves.ets
@@ -0,0 +1,262 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct CurvesEaseOut {
+ @State widthSize: number = 400
+ @State heightSize: number = 200
+ @State flag: boolean = true
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear CurvesEaseOut start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear CurvesEaseOut end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("EaseOutText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000, // 动画时长
+ curve: Curve.EaseOut, // 动画曲线:以低速结束
+ delay: 100, // 动画延迟
+ iterations: 1, // 播放次数
+ playMode: PlayMode.Normal // 动画模式
+ }) // 对Button组件的宽高属性进行动画配置
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("EaseInOutText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.EaseInOut, //以低速开始和结束
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("FastOutSlowInText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.FastOutSlowIn, //标准曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("LinearOutSlowInText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.LinearOutSlowIn, //减速曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("FastOutLinearInText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.FastOutLinearIn, //加速曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("ExtremeDecelerationText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.ExtremeDeceleration, //急缓曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("SharpText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.Sharp, //锐利曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("RhythmText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.Rhythm, //节奏曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("SmoothText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.Smooth, //平滑曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ Button('click me')
+ .align(Alignment.Center)
+ .onClick((event: ClickEvent) => {
+ if (this.flag) {
+ this.widthSize = 100
+ this.heightSize = 50
+ } else {
+ this.widthSize = 400
+ this.heightSize = 200
+ }
+ this.flag = !this.flag
+ })
+ .key("FrictionText")
+ .width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
+ .animation({
+ duration: 1000,
+ curve: Curve.Friction, //阻尼曲线
+ delay: 100,
+ iterations: 1,
+ playMode: PlayMode.Normal
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/datePicker.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/datePicker.ets
new file mode 100644
index 0000000000000000000000000000000000000000..558b73166c484a252e8963d6c50b240ad480a15a
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/datePicker.ets
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct DatePickerLunar {
+ private selectedDate: Date = new Date('2021-08-08')
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear DatePickerLunar start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear DatePickerLunar end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("datePicker-Lunar")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("lunarText")
+
+ DatePicker({
+ start: new Date('1970-1-1'),
+ end: new Date('2100-1-1'),
+ selected: this.selectedDate,
+ })
+ .key("DatePicker")
+ .lunar(true)
+ .onChange((date: DatePickerResult) => {
+ Log.showInfo(TAG, 'select current date is: ' + JSON.stringify(date))
+ })
+
+ DatePicker({
+ start: new Date('1970-1-1'),
+ end: new Date('2100-1-1'),
+ selected: this.selectedDate,
+ })
+ .lunar(false)
+ .onChange((date: DatePickerResult) => {
+ Log.showInfo(TAG, 'select current date is: ' + JSON.stringify(date))
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/edgeEffect.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/edgeEffect.ets
new file mode 100644
index 0000000000000000000000000000000000000000..6f5db39807d791c938aa184e7f61c75d86a97d38
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/edgeEffect.ets
@@ -0,0 +1,59 @@
+/**
+ * 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 events_emitter from '@ohos.events.emitter';
+
+import Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct ListExample {
+ private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ @State edgeEffect: EdgeEffect = EdgeEffect.Fade
+
+ build() {
+ Stack({ alignContent: Alignment.TopStart }) {
+ Column() {
+ List({ space: 20, initialIndex: 0 }) {
+ ForEach(this.arr, (item) => {
+ ListItem() {
+ Text('' + item)
+ .width('100%').height(100).fontSize(16)
+ .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF)
+ }.editable(true)
+ }, item => item)
+ }
+ .key('list')
+ .listDirection(Axis.Vertical) // 排列方向
+ .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线
+ .edgeEffect(this.edgeEffect) // 滑动到边缘无效果
+ .chainAnimation(false) // 联动特效关闭
+ .onScrollIndex((firstIndex: number, lastIndex: number) => {
+ console.info('first' + firstIndex)
+ console.info('last' + lastIndex)
+ })
+ .onItemDelete((index: number) => {
+ console.info(this.arr[index] + 'Delete')
+ this.arr.splice(index, 1)
+ console.info(JSON.stringify(this.arr))
+ return true
+ }).width('90%')
+ }.width('100%')
+
+ }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/enums.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/enums.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8a658286538e07ee855ae2c970eb7b4e86321441
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/enums.ets
@@ -0,0 +1,623 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct EnumsCancel {
+
+ @State widthSize: number = 200
+ @State heightSize: number = 100
+ @State flag: boolean = true
+
+ @State state: AnimationStatus = AnimationStatus.Initial
+ @State reverse: boolean = false
+ @State iterations: number = 1
+
+ @State value: string = ''
+ @State text: string = ''
+ @State eventType: string = ''
+
+ @State mouseText: string = 'MouseText'
+
+ @Styles pressedStyles() {
+ .backgroundColor('red')
+ .opacity(1)
+ }
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear EnumsCancel start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear EnumsCancel end`)
+ }
+
+ @State responseTypeClick: ResponseType = ResponseType.RightClick;
+ @State responseTypePress: ResponseType = ResponseType.LongPress;
+ @Builder ContextMenuBuilder() {
+ Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
+ Text('text3')
+ .fontSize(20)
+ .width(100)
+ .height(50)
+ .textAlign(TextAlign.Center)
+ Divider().height(10)
+ }
+ }
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("enums-Cancel")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("CancelText")
+ .visibility(Visibility.None)
+
+ Text("enums-Middle")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("MiddleText")
+ .visibility(Visibility.None)
+
+ Text("enums-Forward")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ForwardText")
+ .visibility(Visibility.None)
+
+ Text("enums-Press")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("PressText")
+ .visibility(Visibility.None)
+
+ Text("enums-EaseOut")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("EaseOutText")
+ .visibility(Visibility.None)
+
+ Text("enums-EaseInOut")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("EaseInOutText")
+ .visibility(Visibility.None)
+
+ Text("enums-FastOutSlowIn")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FastOutSlowInText")
+ .visibility(Visibility.None)
+
+ Text("enums-LinearOutSlowIn")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("LinearOutSlowInText")
+ .visibility(Visibility.None)
+
+ Text("enums-FastOutLinearIn")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FastOutLinearInText")
+ .visibility(Visibility.None)
+
+ Text("enums-ExtremeDeceleration")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ExtremeDecelerationText")
+ .visibility(Visibility.None)
+
+ Text("enums-Sharp")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("SharpText")
+ .visibility(Visibility.None)
+
+ Text("enums-Rhythm")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("RhythmText")
+ .visibility(Visibility.None)
+
+ Text("enums-Smooth")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("SmoothText")
+ .visibility(Visibility.None)
+
+ Text("enums-Friction")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FrictionText")
+ .visibility(Visibility.None)
+
+ Text("enums-Forwards")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ForwardsText")
+ .visibility(Visibility.None)
+
+ Text("enums-Reverse")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ReverseText")
+ .visibility(Visibility.None)
+
+ Text("enums-Alternate")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("AlternateText")
+ .visibility(Visibility.None)
+
+ Text("enums-Keyboard")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("KeyboardText")
+ .visibility(Visibility.None)
+
+ Text("enums-Middle")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("MiddleText")
+ .visibility(Visibility.None)
+
+ Text("enums-Mon")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("MonText")
+ .visibility(Visibility.None)
+
+ Text("enums-Thur")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ThurText")
+ .visibility(Visibility.None)
+
+ Text("enums-Fri")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FriText")
+ .visibility(Visibility.None)
+
+ Text("enums-Sat")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("SatText")
+ .visibility(Visibility.None)
+
+ Text("enums-Fade")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FadeText")
+ .visibility(Visibility.None)
+
+ Text("enums-FILL")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FILLText")
+ .visibility(Visibility.None)
+
+ Text("enums-FIT")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FITText")
+ .visibility(Visibility.None)
+
+ Text("enums-RightClick")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("RightClickText")
+ .bindContextMenu(this.ContextMenuBuilder(), this.responseTypeClick)
+ .visibility(Visibility.None)
+
+ Text("enums-LongPress")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("LongPressText")
+ .bindContextMenu(this.ContextMenuBuilder(), this.responseTypePress)
+ .visibility(Visibility.None)
+
+ Text("enums-Scale")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ScaleText")
+ .hoverEffect(HoverEffect.Scale)
+ .visibility(Visibility.None)
+
+ Text("enums-Highlight")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("HighlightText")
+ .hoverEffect(HoverEffect.Highlight)
+ .visibility(Visibility.None)
+
+ Text("enums-InApp")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("InAppText")
+ .copyOption(CopyOptions.InApp)
+ .visibility(Visibility.None)
+
+ Text("enums-LocalDevice")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("LocalDeviceText")
+ .copyOption(CopyOptions.LocalDevice)
+ .visibility(Visibility.None)
+ Text("enums-CrossDevice")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("CrossDeviceText")
+// .copyOption(CopyOptions.CrossDevice)
+ .visibility(Visibility.None)
+
+ Button('Touch').backgroundColor(0x2788D9).height(40).width(80)
+ .onTouch((event: TouchEvent) => {
+ if (event.type === TouchType.Down) {
+ this.eventType = 'Down'
+ }
+ if (event.type === TouchType.Up) {
+ this.eventType = 'Up'
+ }
+ if (event.type === TouchType.Move) {
+ this.eventType = 'Move'
+ }
+ if (event.type === TouchType.Cancel) {
+ this.eventType = 'Cancel'
+ }
+ console.info(this.text = 'TouchType:' + this.eventType + '\nDistance between touch point and touch element:\nx: '
+ + event.touches[0].x + '\n' + 'y: ' + event.touches[0].y + '\ncomponent globalPos:('
+ + event.target.area.globalPosition.x + ',' + event.target.area.globalPosition.y + ')\nwidth:'
+ + event.target.area.width + '\nheight:' + event.target.area.height)
+ })
+ Text(this.text)
+
+ Button(this.mouseText)
+ .onMouse((event: MouseEvent) => {
+ if (MouseAction.Press || MouseButton.Middle) {
+ console.log(this.mouseText = 'onMouse:\nButton = ' + event.button +
+ '\nAction = ' + event.action + '\nlocalXY=(' + event.x + ',' + event.y + ')' +
+ '\nscreenXY=(' + event.screenX + ',' + event.screenY + ')')
+ }
+ else if (MouseAction.Press && MouseButton.Forward) {
+ console.log(this.mouseText = 'onMouse:\nButton = ' + event.button +
+ '\nAction = ' + event.action + '\nlocalXY=(' + event.x + ',' + event.y + ')' +
+ '\nscreenXY=(' + event.screenX + ',' + event.screenY + ')')
+ }
+ else if (MouseAction.Press) {
+ console.info("pressed")
+ }
+ })
+
+ Text("enums-FillMode")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FillModeText")
+ .visibility(Visibility.None)
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/featureAbility.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/featureAbility.ets
new file mode 100644
index 0000000000000000000000000000000000000000..f8c72d5fc13bbcf0075c450a36d218d66a037efb
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/featureAbility.ets
@@ -0,0 +1,402 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct FeatureAbilityAbilityName {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear FeatureAbilityAbilityName start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear FeatureAbilityAbilityName end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("featureAbility-SubscribeMessageResponse-DeviceId")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeMessageResponseDeviceIdText")
+ .onClick(() => {
+ FeatureAbility.subscribeMsg({
+ success: (data) => {
+ console.log(`deviceId: ${data.deviceId}`)
+ },
+ fail: (data, code) => {
+ console.log(`data: ${data} code: ${code}`)
+ }
+ })
+ })
+
+ Text("featureAbility-SubscribeMessageResponse-AbilityName")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeMessageResponseAbilityNameText")
+ .onClick(() => {
+ FeatureAbility.subscribeMsg({
+ success: (data) => {
+ console.log(`deviceId: ${data.abilityName}`)
+ },
+ fail: (data, code) => {
+ console.log(`data: ${data} code: ${code}`)
+ }
+ })
+ })
+
+ Text("featureAbility-CallAbilityParam-AbilityName")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("callAbilityParamAbilityNameText")
+ .onClick(() => {
+ FeatureAbility.callAbility({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1001,
+ data: {
+ firstNum: 1024,
+ secondNum: 2048
+ },
+ abilityType: 0,
+ syncOption: 0
+ })
+ })
+
+ Text("featureAbility-CallAbilityParam-MessageCode")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("callAbilityParamMessageCodeText")
+ .onClick(() => {
+ FeatureAbility.callAbility({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1001,
+ data: {
+ firstNum: 1024,
+ secondNum: 2048
+ },
+ abilityType: 0,
+ syncOption: 0
+ })
+ })
+
+ Text("featureAbility-CallAbilityParam-AbilityType")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("callAbilityParamAbilityTypeText")
+ .onClick(() => {
+ FeatureAbility.callAbility({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1001,
+ data: {
+ firstNum: 1024,
+ secondNum: 2048
+ },
+ abilityType: 0,
+ syncOption: 0
+ })
+ })
+
+ Text("featureAbility-CallAbilityParam-SyncOption")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("callAbilityParamSyncOptionText")
+ .onClick(() => {
+ FeatureAbility.callAbility({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1001,
+ data: {
+ firstNum: 1024,
+ secondNum: 2048
+ },
+ abilityType: 0,
+ syncOption: 0
+ })
+ })
+
+ Text("featureAbility-SubscribeAbilityEventParam-AbilityName")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeAbilityEventParamAbilityNameText")
+ .onClick(() => {
+ FeatureAbility.subscribeAbilityEvent({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1005,
+ abilityType: 0,
+ syncOption: 0
+ }, (callbackData) => {
+ var callbackJson = JSON.parse(callbackData);
+ console.info('eventData is: ' + JSON.stringify(callbackJson.data));
+ })
+ })
+
+ Text("featureAbility-SubscribeAbilityEventParam-MessageCode")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeAbilityEventParammessageCodeText")
+ .onClick(() => {
+ FeatureAbility.subscribeAbilityEvent({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1005,
+ abilityType: 0,
+ syncOption: 0
+ }, (callbackData) => {
+ var callbackJson = JSON.parse(callbackData);
+ console.info('eventData is: ' + JSON.stringify(callbackJson.data));
+ })
+ })
+
+ Text("featureAbility-SubscribeAbilityEventParam-AbilityType")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeAbilityEventParamAbilityTypeText")
+ .onClick(() => {
+ FeatureAbility.subscribeAbilityEvent({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1005,
+ abilityType: 0,
+ syncOption: 0
+ }, (callbackData) => {
+ var callbackJson = JSON.parse(callbackData);
+ console.info('eventData is: ' + JSON.stringify(callbackJson.data));
+ })
+ })
+
+ Text("featureAbility-SubscribeAbilityEventParam-SyncOption")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("subscribeAbilityEventParamSyncOptionText")
+ .onClick(() => {
+ FeatureAbility.subscribeAbilityEvent({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ messageCode: 1005,
+ abilityType: 0,
+ syncOption: 0
+ }, (callbackData) => {
+ var callbackJson = JSON.parse(callbackData);
+ console.info('eventData is: ' + JSON.stringify(callbackJson.data));
+ })
+ })
+
+
+ Text("featureAbility-SendMessageOptions-DeviceId")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("sendMessageOptionsDeviceIdText")
+ .onClick(() => {
+ FeatureAbility.sendMsg({
+ deviceId: '1001',
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility'
+ })
+ })
+
+ Text("featureAbility-SendMessageOptions-AbilityName")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("sendMessageOptionsAbilityNameText")
+ .onClick(() => {
+ FeatureAbility.sendMsg({
+ deviceId: '1001',
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility'
+ })
+ })
+
+ Text("featureAbility-RequestParams-AbilityName")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("requestParamsAbilityNameText")
+ .onClick(() => {
+ FeatureAbility.startAbility({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility'
+ })
+ })
+
+ Text("featureAbility-Entities")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("entitiesText")
+ .onClick(() => {
+ FeatureAbility.startAbility({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ entities: ["this is a test"]
+ })
+ })
+
+ Text("featureAbility-DeviceType")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("deviceTypeText")
+ .onClick(() => {
+ FeatureAbility.startAbility({
+ bundleName: 'com.example.hiaceservice',
+ abilityName: 'com.example.hiaceservice.ComputeServiceAbility',
+ deviceType: 1001
+ })
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/fill_mode.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/fill_mode.ets
new file mode 100644
index 0000000000000000000000000000000000000000..57eb7a70fe83ea7156a4e2123d271fb4328eb83a
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/fill_mode.ets
@@ -0,0 +1,111 @@
+/**
+ * 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct ImageAnimatorExample {
+ @State state: AnimationStatus = AnimationStatus.Initial
+ @State reverse: boolean = false
+ @State iterations: number = 1
+
+ build() {
+ Column({ space:5 }) {
+ ImageAnimator()
+ .images([
+ {
+ src: '/comment/bg1.png',
+ duration: 500,
+ width: 325,
+ height: 200,
+ top: 0,
+ left: 0
+ },
+ {
+ src: '/comment/bg2.png',
+ duration: 500,
+ width: 325,
+ height: 200,
+ top: 0,
+ left: 0
+ },
+ {
+ src: $rawfile('bg3.png'),
+ duration: 500,
+ width: 325,
+ height: 200,
+ top: 0,
+ left: 0
+ },
+ {
+ src: $rawfile('bg4.png'),
+ duration: 500,
+ width: 325,
+ height: 200,
+ top: 0,
+ left: 0
+ }
+ ])
+ .key("ImageAnimator")
+ .state(this.state).reverse(this.reverse).fixedSize(false).preDecode(2)
+ .fillMode(FillMode.Forwards)
+ .iterations(this.iterations)
+ .width(325)
+ .height(210)
+ .margin({top:100})
+ .onStart(() => { // 当帧动画开始播放后触发
+ console.info('Start')
+ })
+ .onPause(() => {
+ console.info('Pause')
+ })
+ .onRepeat(() => {
+ console.info('Repeat')
+ })
+ .onCancel(() => {
+ console.info('Cancel')
+ })
+ .onFinish(() => { // 当帧动画播放完成后触发
+ this.state = AnimationStatus.Stopped
+ console.info('Finish')
+ })
+ Row() {
+ Button('start').width(100).padding(5).onClick(() => {
+ this.state = AnimationStatus.Running
+ })
+ Button('pause').width(100).padding(5).onClick(() => {
+ this.state = AnimationStatus.Paused
+ })
+ Button('stop').width(100).padding(5).onClick(() => {
+ this.state = AnimationStatus.Stopped
+ })
+ }
+ Row() {
+ Button('reverse').width(100).padding(5).onClick(() => {
+ this.reverse = !this.reverse
+ })
+ Button('once').width(100).padding(5).onClick(() => {
+ this.iterations = 1
+ })
+ Button('iteration').width(100).padding(5).onClick(() => {
+ this.iterations = -1
+ })
+ }
+ }.width('100%').height('100%').backgroundColor(0xF1F3F5)
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gesture.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gesture.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b9a951d76a3f39c623b4d91a6cc25428bab5697b
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gesture.ets
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct GestureParallel {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GestureParallel start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear GestureParallel end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("gesture-Parallel")
+ .width(320)
+ .height(120)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ParallelText")
+ .gesture(
+ GestureGroup(GestureMode.Parallel,
+ LongPressGesture({ repeat: true })
+ .onAction((event: GestureEvent) => {
+ Log.showInfo(TAG, `LongPress onAction`)
+ })
+ .onActionEnd(() => {
+ Log.showInfo(TAG, `LongPress end`)
+ }),
+ PanGesture({})
+ .onActionStart(() => {
+ Log.showInfo(TAG, `onActionStart`)
+ })
+ .onActionUpdate((event: GestureEvent) => {
+ Log.showInfo(TAG, `onActionUpdate`)
+ })
+ )
+ )
+
+ Text("gesture-Exclusive")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ExclusiveText")
+ .gesture(
+ GestureGroup(GestureMode.Exclusive,
+ LongPressGesture({ repeat: true })
+ .onAction((event: GestureEvent) => {
+ Log.showInfo(TAG, `LongPress onAction`)
+ })
+ .onActionEnd(() => {
+ Log.showInfo(TAG, `LongPress end`)
+ }),
+ PanGesture({})
+ .onActionStart(() => {
+ Log.showInfo(TAG, `onActionStart`)
+ })
+ .onActionUpdate((event: GestureEvent) => {
+ Log.showInfo(TAG, `onActionUpdate`)
+ })
+ )
+ )
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gridCol.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gridCol.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0d949160c18b711c61c61d7e4a916ed052961342
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gridCol.ets
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct GridColXl {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GridColXl start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear GridColXl end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ GridRow(){
+ GridCol({ span: { xl: 2 } }){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol({ span: { xl: 2 } }){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("xlText")
+
+ GridRow(){
+ GridCol({ span: { xxl: 2 } }){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol({ span: { xxl: 2 } }){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("xxlText")
+
+ GridRow(){
+ GridCol({ span: { xl: 2 } }){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .key("GridCol")
+ .order({xl: 10})
+ .backgroundColor(Color.Green)
+ GridCol({ span: { xl: 2 } }){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .order(10)
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("orderText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gridRow.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gridRow.ets
new file mode 100644
index 0000000000000000000000000000000000000000..95ca6fdfff9a6a4c6ff8b87e5939b26a01a9af53
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/gridRow.ets
@@ -0,0 +1,186 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct GridRowXl {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear GridRowXl start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear GridRowXl end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+
+ GridRow({columns: {xl: 2}}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }
+ .backgroundColor(Color.Red)
+ .key("GridRowColumnOption——xl")
+
+ GridRow({columns: {xxl: 2}}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("GridRowColumnOption——xxl")
+
+ GridRow({gutter:{x: {xl: 2}}}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("GridRowSizeOption——xl")
+
+ GridRow({gutter:{x: {xxl: 2}}}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("GridRowSizeOption——xxl")
+
+ GridRow({breakpoints: { reference: BreakpointsReference.WindowSize }}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("WindowSizeText")
+
+ GridRow({breakpoints: { reference: BreakpointsReference.ComponentSize }}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("ComponentSizeText")
+
+ GridRow({breakpoints: { reference: BreakpointsReference.ComponentSize }}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("referenceText")
+
+ GridRow({breakpoints: { reference: BreakpointsReference.ComponentSize }}){
+ GridCol(){
+ Text('Hello')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Green)
+ GridCol(){
+ Text('World')
+ .width(100)
+ .height(70)
+ .align(Alignment.Center)
+ }
+ .backgroundColor(Color.Blue)
+ }.backgroundColor(Color.Red)
+ .key("breakpointsText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c883c70f477c9eae4a7cc027130a9c222c9c0801
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct HitTestMode {
+ build() {
+ Column() {
+ // outer stack 1
+ Stack() {
+ Button('outer button')
+ .onTouch((event) => {
+ console.info('HitTestMode outer button touched type: ' + event.type)
+ })
+ // inner stack
+ Stack() {
+ Button('inner button')
+ .key("innnerButton")
+ .onTouch((event) => {
+ console.info('HitTestMode inner button touched type: ' + event.type)
+ })
+ }
+ .key("Block")
+ .width("100%")
+ .height("100%")
+// .hitTestBehavior(HitTestMode.Block)
+ .onTouch((event) => {
+ console.info('HitTestMode inner stack touched type: ' + event.type)
+ })
+
+ Text('Transparent')
+ .key("Transparent")
+// .hitTestBehavior(HitTestMode.Transparent)
+ .width("100%")
+ .height("50%")
+ .onTouch((event) => {
+ console.info('HitTestMode text touched type: ' + event.type)
+ let strJson = getInspectorByKey('Transparent');
+ let obj = JSON.parse(strJson);
+ console.info("HitTestMode hitTestBehavior is " + obj.$attrs.hitTestBehavior);
+ let strJson2 = getInspectorByKey('Block');
+ let obj2 = JSON.parse(strJson2);
+ console.info("HitTestMode hitTestBehavior is " + obj2.$attrs.hitTestBehavior);
+ })
+ }.width(300).height(300).backgroundColor(Color.Gray)
+ }.width('100%').height('100%')
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hoverEffect.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hoverEffect.ets
new file mode 100644
index 0000000000000000000000000000000000000000..28aec9fabce9ad5b8b24d2c43e1c07731f301683
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hoverEffect.ets
@@ -0,0 +1,70 @@
+//@ts-nocheck
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct HoverEffect {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear HoverEffect start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear HoverEffect end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+ Text("hoverEffect-Scale")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ScaleText")
+ .hoverEffect(HoverEffect.Scale)
+ .visibility(Visibility.None)
+
+ Text("hoverEffect-Highlight")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("HighlightText")
+ .hoverEffect(HoverEffect.Highlight)
+ .visibility(Visibility.None)
+
+ }.width("100%").height("100%")
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/index.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3a6b007e1fd812f435b9a4df440d690df9524363
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct MyComponent {
+ aboutToAppear() {
+ }
+
+ build() {
+ Flex({
+ direction: FlexDirection.Column,
+ alignItems: ItemAlign.Center,
+ justifyContent: FlexAlign.Center
+ }) {
+ Text('ace AttrLack ets test')
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/keysource.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/keysource.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fe91c2bb2cdb3b7c76d12949f5229ad33648cdff
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/keysource.ets
@@ -0,0 +1,42 @@
+/**
+ * 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct KeyEventExample {
+ @State text: string = ''
+ @State eventType: string = ''
+
+ build() {
+ Column() {
+ Button('KeyEvent').backgroundColor(0x2788D9)
+ .onKeyEvent((event: KeyEvent) => {
+ if (event.type === KeyType.Down) {
+ this.eventType = 'Down'
+ }
+ if (event.type === KeyType.Up) {
+ this.eventType = 'Up'
+ }
+ console.info(this.text = 'KeyType:' + this.eventType + '\nkeyCode:' + event.keyCode + '\nkeyText:' + event.keyText +
+ '\nKeyboard:' + event.keySource.Keyboard)
+ })
+ Text(this.text).padding(15)
+ }.height(300).width('100%').padding(35)
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c589dd3e9f52d16b872acc5e4f2b18d046566f73
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets
@@ -0,0 +1,85 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+function itemHeadBuilder(text: string) {
+ @Builder function itemHead() {
+ Text(text)
+ .fontSize(20)
+ .backgroundColor(0xAABBCC)
+ .width("100%")
+ .padding(10)
+ }
+ return itemHead
+}
+
+function itemFootBuilder(num: number) {
+ @Builder function itemFoot() {
+ Text('共' + num + "节课")
+ .fontSize(16)
+ .backgroundColor(0xAABBCC)
+ .width("100%")
+ .padding(5)
+ }
+ return itemFoot
+}
+
+@Entry
+@Component
+struct ListItemGroupExample {
+ private timetable: any = [
+ {
+ title:'Mon',
+ projects:['语文', '数学', '英语']
+ },
+ {
+ title:'Tues',
+ projects:['物理', '化学', '生物']
+ },
+ {
+ title:'Wens',
+ projects:['历史', '地理', '政治']
+ },
+ {
+ title:'Thur',
+ projects:['美术', '音乐', '体育']
+ }
+ ]
+
+ build() {
+ Column() {
+ List({ space: 20 }) {
+ ForEach(this.timetable, (item) => {
+ ListItemGroup({ header:itemHeadBuilder(item.title), footer:itemFootBuilder(item.projects.length) }) {
+ ForEach(item.projects, (project) => {
+ ListItem() {
+ Text(project)
+ .width("100%").height(100).fontSize(20)
+ .textAlign(TextAlign.Center).backgroundColor(0xFFFFFF)
+ }
+ }, item => item)
+ }
+ .key(item)
+ .borderRadius(20)
+ .divider({ strokeWidth: 1, color: Color.Blue}) // 每行之间的分界线
+ })
+ }
+ .width('90%')
+ .sticky(StickyStyle.Header | StickyStyle.Footer)
+ }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
+ }
+ }
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/listtest.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/listtest.ets
new file mode 100644
index 0000000000000000000000000000000000000000..058bb23a538f2738d820568d6a4751df24f55fbd
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/listtest.ets
@@ -0,0 +1,151 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct ListIdle {
+ private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ @State editFlag: boolean = false
+ private scroller: Scroller = new Scroller()
+ @State onScroll: boolean = false
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear ListIdle start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear ListIdle end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("list-Idle")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("IdleText")
+
+ Text("list-Scroll")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ScrollText")
+
+ Text("list-Fling")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("FlingText")
+
+ Stack({ alignContent: Alignment.TopStart }) {
+ Scroll(this.scroller) {
+ List({ space: 20, initialIndex: 0 }) {
+ ForEach(this.arr, (item) => {
+ ListItem() {
+ Text('' + item)
+ .width('100%').height(100).fontSize(16)
+ .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF)
+ }.editable(true)
+ }, item => item)
+
+ }
+ .editMode(true)
+ .key("ScrollList")
+ .listDirection(Axis.Vertical) // 排列方向
+ .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线
+ .edgeEffect(EdgeEffect.None) // 滑动到边缘无效果
+ .chainAnimation(false) // 联动特效关闭
+ .onScroll((scrollOffset: 5, scrollState:ScrollState) => {
+ console.info('scrollOffset' + scrollOffset)
+ console.info('scrollState ' + ScrollState.Scroll)
+ console.info('scrollState ' + ScrollState.Idle)
+ console.info('scrollState ' + ScrollState.Fling)
+ })
+ .onClick(()=>{
+ try {
+ var backData = {
+ data: {
+ "State": this.onScroll
+ }
+ }
+ let backEvent = {
+ eventId: 60303,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("Scroll start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("Scroll emit action state err: " + JSON.stringify(err.message))
+ }
+ try {
+ this.scroller.scrollPage({ next: true })
+ this.onScroll = true
+ } catch (err) {
+ console.info("Scroll emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ }
+ .scrollable(ScrollDirection.Vertical)
+ .scrollBar(BarState.On)
+ .scrollBarColor(Color.Gray)
+ .scrollBarWidth(30)
+ .onScroll((xOffset: number, yOffset: number) => {
+ console.info(xOffset + ' ' + yOffset)
+ })
+ .onScrollEdge((side: Edge) => {
+ console.info('To the edge')
+ })
+ .onScrollEnd(() => {
+ console.info('Scroll Stop')
+ })
+ }
+ }.width("100%").height("100%")
+
+
+
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/loadingProgress.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/loadingProgress.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1353d00b78f82b9957c54f1afb626110fc8a6802
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/loadingProgress.ets
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct LoadingProgressCircular {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear LoadingProgressCircular start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear LoadingProgressCircular end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("loadingProgress-Circular")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("CircularText")
+
+ Text("loadingProgress-Orbital")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("OrbitalText")
+
+ Text('Orbital LoadingProgress ').fontSize(9).fontColor(0xCCCCCC).width('100%')
+ LoadingProgress()
+ .color(Color.Blue)
+ }.width("100%").height("100%")
+ }
+}
+
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/onFrame.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/onFrame.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4fd2052f3a1e7cc3d4da105fe2aebf2641b7cdc3
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/onFrame.ets
@@ -0,0 +1,126 @@
+/**
+ * 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 animator from '@ohos.animator';
+import prompt from '@system.prompt';
+
+import Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct ColumnExample {
+ @State divWidth: number = 120;
+ @State divHeight: number = 120;
+ @State animation: AnimatorResult = animator.createAnimator({
+ duration: 3000,
+ fill: 'forwards',
+ direction: "normal",
+ begin: 200,
+ end: 270
+ });
+
+ onPageShow() {
+ this.animation.onrepeat(() => {
+ var repeatoptions = {
+ duration: 2000,
+ iterations: 1,
+ direction: 'alternate',
+ begin: 180,
+ end: 240
+ };
+ this.animation.update(repeatoptions);
+ this.animation.play();
+ });
+ }
+
+ playAnimation() {
+ var _this = this;
+ this.animation.onframe = function(value) {
+ _this.translateVal= value
+ };
+ this.animation.play();
+ }
+
+ build() {
+ Column() {
+ Column() {
+ Column() {
+ Column().width(this.divWidth).height(this.divHeight).backgroundColor(0xAFEEEE)
+ }.width('100%')
+ }.width('100%').padding({ top: 5 })
+
+ Column() {
+ Row() {
+ Button('play')
+ .borderRadius(8)
+ .backgroundColor(0x317aff)
+ .width(90)
+ .key("button1")
+ .onClick(() => {
+ this.animation.onframe((value) => {
+ this.divWidth = value
+ this.divHeight = value
+ });
+ this.animation.play();
+ });
+ Button('update').borderRadius(8).backgroundColor(0x317aff).width(90).onClick(() => {
+ var newoptions = {
+ duration: 5000,
+ iterations: 2,
+ begin: 120,
+ end: 180
+ };
+ this.animation.update(newoptions);
+ this.animation.play();
+ });
+ }.margin({ top: 5 })
+
+ Row() {
+ Button('pause').borderRadius(8).backgroundColor(0x317aff).width(90).onClick(() => {
+ this.animation.pause();
+ });
+ Button('finish').borderRadius(8).backgroundColor(0x317aff).width(90).onClick(() => {
+ this.animation.onfinish(() => {
+ prompt.showToast({
+ message: 'finish'
+ })
+ });
+ this.animation.finish();
+ });
+ }.margin({ top: 5 })
+
+ Row() {
+ Button('cancel').borderRadius(8).backgroundColor(0x317aff).width(90).onClick(() => {
+ this.animation.cancel();
+ });
+ Button('reverse').borderRadius(8).backgroundColor(0x317aff).width(90).onClick(() => {
+ this.animation.reverse();
+ });
+ }.margin({ top: 5 })
+
+ Row() {
+ Button('onframe')
+ .key("button1")
+ .borderRadius(8).backgroundColor(0x317aff).width(90).onClick(() => {
+ this.playAnimation()
+ });
+ }.margin({ top: 5 })
+ }.margin({ top: 30 })
+ }
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page1.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page1.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0a3cea52a5108a0fc35925c3a4cb32a0c945e651
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page1.ets
@@ -0,0 +1,66 @@
+/**
+ * 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.
+ */
+
+//在second页面中接收传递过来的参数
+import router from '@ohos.router'
+import events_emitter from '@ohos.events.emitter';
+import Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct Second {
+ private content: string = "这是第二页"
+ @State text: string = router.getParams()['text']
+ @State data: any = router.getParams()['data']
+ @State secondData : string = ''
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Text(`${this.content}`)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text(this.text)
+ .fontSize(30)
+ .key("DataText")
+ .onClick(()=>{
+ this.secondData = (this.data.array[1]).toString()
+ try {
+ var backData = {
+ data: {
+ "ArrayData": this.secondData
+ }
+ }
+ let backEvent = {
+ eventId: 101,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("page1 start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("page1 emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .margin({top:20})
+ Text('第一页传来的数值是' + ' ' + this.secondData)
+ .fontSize(20)
+ .margin({top:20})
+ .backgroundColor('red')
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets
new file mode 100644
index 0000000000000000000000000000000000000000..72be9f5739354996e17186ec6e5f5c39066165c9
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets
@@ -0,0 +1,66 @@
+/**
+ * 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.
+ */
+
+//在second页面中接收传递过来的参数
+import router from '@ohos.router'
+import events_emitter from '@ohos.events.emitter';
+import Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct Second {
+ private content: string = "这是第二页"
+ @State text: string = router.getParams()['text']
+ @State data: any = router.getParams()['data']
+ @State secondData : string = ''
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Text(`${this.content}`)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Text(this.text)
+ .fontSize(30)
+ .key("SingleDataText")
+ .onClick(()=>{
+ this.secondData = (this.data.array[1]).toString()
+ try {
+ var backData = {
+ data: {
+ "ArrayData": this.secondData
+ }
+ }
+ let backEvent = {
+ eventId: 102,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("page1 start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("page1 emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .margin({top:20})
+ Text('第一页传来的数值是' + ' ' + this.secondData)
+ .fontSize(20)
+ .margin({top:20})
+ .backgroundColor('red')
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/pluginComponent.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/pluginComponent.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e1310d6f783df35ccad68be0204f2764013ac9d6
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/pluginComponent.ets
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 plugin from "../common/plugin_component.js"
+
+@Entry
+@Component
+struct PluginUserExample {
+ @StorageLink("plugincount") plugincount: Object[] = [
+ { source: 'plugincomponent1', ability: 'com.example.plugin' },
+ { source: 'plugintemplate', ability: 'com.example.myapplication' },
+ { source: 'plugintemplate', ability: 'com.example.myapplication' }]
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+ Text('Hello World')
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Button('Register Request Listener')
+ .fontSize(30)
+ .width(400)
+ .height(100)
+ .margin({top:20})
+ .onClick(()=>{
+ plugin.onListener()
+ console.log("Button('Register Request Listener')")
+ })
+ Button('Request')
+ .fontSize(50)
+ .width(400)
+ .height(100)
+ .margin({ top: 20 })
+ .onClick(() => {
+ plugin.Request()
+ console.log("Button('Request')")
+ })
+ ForEach(this.plugincount, item => {
+ PluginComponent({
+ template: { source: 'plugincomponent1', ability: 'com.example.plugin' },
+ data: { 'countDownStartValue': 'new countDownStartValue' }
+ }).size({ width: 500, height: 100 })
+ .onComplete(() => {
+ console.log("onComplete")
+ })
+ .onError(({errcode, msg}) => {
+ console.log("onComplete" + errcode + ":" + msg)
+ })
+ })
+ }
+ .width('100%')
+ .height('100%')
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets
new file mode 100644
index 0000000000000000000000000000000000000000..66f889a177338ef50f69cf573eb8f3ad8190de4b
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets
@@ -0,0 +1,99 @@
+/**
+ * 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 Log from '../common/Log.ets';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct PopupExample {
+ @State noHandlePopup: boolean = false
+ @State handlePopup: boolean = false
+ @State customPopup: boolean = false
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear Popup start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear Popup end`)
+ }
+
+ @Builder popupBuilder() {
+ Row({ space: 2 }) {
+ Image($rawfile('test.png')).width(24).height(24).margin({ left: -5 })
+ Text('Custom Popup').fontSize(10)
+ }.width(100).height(50).backgroundColor(Color.White)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column }) {
+ Button('no handle popup')
+ .onClick(() => {
+ this.noHandlePopup = !this.noHandlePopup
+ })
+ .bindPopup(this.noHandlePopup, {
+ message: 'content1 content1',
+ placementOnTop: false,
+ arrowOffset: "100px",
+ onStateChange: (e) => {
+ console.info(e.isVisible.toString())
+ if (!e.isVisible) {
+ this.noHandlePopup = false
+ }
+ }
+ })
+ .position({ x: 100, y: 50 })
+
+ Button('with handle popup')
+ .onClick(() => {
+ this.handlePopup = !this.handlePopup
+ })
+ .bindPopup(this.handlePopup, {
+ message: 'content2 content2',
+ placementOnTop: true,
+ primaryButton: {
+ value: 'ok',
+ action: () => {
+ this.handlePopup = !this.handlePopup
+ console.info('secondaryButton click')
+ }
+ },
+ onStateChange: (e) => {
+ console.info(e.isVisible.toString())
+ }
+ })
+ .position({ x: 100, y: 200 })
+
+ Button('custom popup')
+ .onClick(() => {
+ this.customPopup = !this.customPopup
+ })
+ .bindPopup(this.customPopup, {
+ builder: this.popupBuilder,
+ placement: Placement.Bottom,
+ maskColor: 0x33000000,
+ popupColor: Color.White,
+ enableArrow: true,
+ onStateChange: (e) => {
+ if (!e.isVisible) {
+ this.customPopup = false
+ }
+ }
+ })
+ .position({ x: 100, y: 350 })
+ }.width('100%').padding({ top: 5 })
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/progress.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/progress.ets
new file mode 100644
index 0000000000000000000000000000000000000000..057015c5faab833b68bed41a12e1239b78896771
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/progress.ets
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct ProgressScaleCount {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear ProgressScaleCount start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear ProgressScaleCount end`)
+ }
+
+ build() {
+ Column({ space: 15 }) {
+ Text('Linear Progress').fontSize(9).fontColor(0xCCCCCC).width('90%')
+ Progress({ value: 10, type: ProgressType.Linear }).width(200)
+ Progress({ value: 20, total: 150, type: ProgressType.Linear }).color(Color.Grey).value(50).width(200)
+
+ Text('Eclipse Progress').fontSize(9).fontColor(0xCCCCCC).width('90%')
+ Row({ space: 40 }) {
+ Progress({ value: 10, type: ProgressType.Eclipse }).width(100)
+ Progress({ value: 20, total: 150, type: ProgressType.Eclipse }).color(Color.Grey).value(50).width(100)
+ }
+
+ Text('ScaleRing Progress').fontSize(9).fontColor(0xCCCCCC).width('90%')
+ Row({ space: 40 }) {
+ Progress({ value: 10, type: ProgressType.ScaleRing }).width(100)
+ Progress({ value: 20, total: 150, type: ProgressType.ScaleRing })
+ .key("progressStyleOptions")
+ .color(Color.Grey).value(50).width(100)
+ .style({ strokeWidth: 15, scaleCount: 15, scaleWidth: 5 })
+ }
+
+ Text('Ring Progress').fontSize(9).fontColor(0xCCCCCC).width('90%')
+ Row({ space: 40 }) {
+ Progress({ value: 10, type: ProgressType.Ring }).width(100)
+ Progress({ value: 20, total: 150, type: ProgressType.Ring })
+ .color(Color.Grey).value(50).width(100)
+ .style({ strokeWidth: 20, scaleCount: 30, scaleWidth: 20 })
+ }
+
+ Text('Capsule Progress').fontSize(9).fontColor(0xCCCCCC).width('90%')
+ Row({ space: 40 }) {
+ Progress({ value: 10, type: ProgressType.Capsule }).width(100).height(50)
+ Progress({ value: 20, total: 150, type: ProgressType.Capsule })
+ .color(Color.Grey)
+ .value(50)
+ .width(100)
+ .height(50)
+ }
+ }.width('100%').margin({ top: 30 })
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/radio.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/radio.ets
new file mode 100644
index 0000000000000000000000000000000000000000..17dab9a83e3135e812e619ac82a7563bfcea7d1e
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/radio.ets
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct RadioGroup {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear RadioGroup start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear RadioGroup end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("radio-Group")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("groupText")
+
+ Radio({ value: 'Radio1', group: 'radioGroup' })
+ .checked(true)
+ .key("RadioOne")
+ .height(50)
+ .width(50)
+ .onChange((value: boolean) => {
+ console.log('Radio1 status is ' + value)
+ })
+ Radio({ value: 'Radio2', group: 'radioGroup' })
+ .checked(false)
+ .key("RadioTwo")
+ .height(50)
+ .width(50)
+ .onChange((value: boolean) => {
+ console.log('Radio2 status is ' + value)
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/refresh.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/refresh.ets
new file mode 100644
index 0000000000000000000000000000000000000000..10c4660f49eaec9a2f492c4cea3735f3bc3968de
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/refresh.ets
@@ -0,0 +1,132 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import Utils from '../common/Utils.ets';
+import events_emitter from '@ohos.events.emitter';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct RefreshDrag {
+ dragRefresh() {
+ var rect = Utils.getComponentRect("Refresh")
+ Utils.drag(rect["left"],rect["top"],rect["right"],rect["bottom"],20)
+ }
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear RefreshDrag start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear RefreshDrag end`)
+ }
+
+ @State isRefreshing: boolean = false
+ @State counter: number = 0
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("refresh-Drag")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("DragText")
+
+ Text("refresh-Refresh")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("RefreshText")
+
+
+ Refresh({refreshing: this.isRefreshing, offset: 120, friction: 100}) {
+ Text('Pull Down and refresh: ' + this.counter)
+ .fontSize(30)
+ .margin(10)
+ }
+ .key("Refresh")
+ .onClick(()=>{
+ this.dragRefresh()
+ })
+ .onStateChange((refreshStatus: RefreshStatus) => {
+ console.info('Refresh onStatueChange state is ' + refreshStatus)
+ if(refreshStatus === RefreshStatus.Drag){
+ console.info("refreshStatus RefreshStatus.Drag")
+ }
+ if(refreshStatus === RefreshStatus.Refresh){
+ console.info("refreshStatus RefreshStatus.Refresh")
+ }
+ try {
+ var backDataTwo = {
+ data: {
+ "Result": true
+ }
+ }
+ let backEventTwo = {
+ eventId: 60305,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("Refresh start to emit action state")
+ events_emitter.emit(backEventTwo, backDataTwo)
+ } catch (err) {
+ console.info("Refresh emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .onRefreshing(() => {
+ setTimeout(() => {
+ this.counter++
+ this.isRefreshing = false
+ }, 1000)
+ console.log('onRefreshing test')
+ try {
+ var backData = {
+ data: {
+ "Result": true
+ }
+ }
+ let backEvent = {
+ eventId: 60304,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("Drag start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("Drag emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/remoteWindow.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/remoteWindow.ets
new file mode 100644
index 0000000000000000000000000000000000000000..40c64df19733671fdc145f14906ad09bb7456096
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/remoteWindow.ets
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct FormComponentFormDimension {
+ @State target: WindowAnimationTarget = undefined // 通过windowAnimationManager获取
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear Dimension start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear Dimension end`)
+ }
+
+ build() {
+ Row() {
+ Column({ space: 10 }) {
+ Text("formComponent-FormDimension-WindowBounds")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("formComponentFormDimensionWindowBoundsText")
+
+ RemoteWindow(this.target)
+ .translate({ x: 100, y: 200 })
+ .scale({ x: 0.5, y: 0.5 })
+ .opacity(0.8)
+ .position({ x: px2vp(this.target?.windowBounds.left), y: px2vp(this.target?.windowBounds.top) })
+ .width(px2vp(this.target?.windowBounds.width))
+ .height(px2vp(this.target?.windowBounds.height))
+ .key('remoteWindow')
+
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/responseType.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/responseType.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d892d7305c9042220d1d901320a68efc3e07e0f1
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/responseType.ets
@@ -0,0 +1,88 @@
+//@ts-nocheck
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct ResponseType {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear ResponseType start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear ResponseType end`)
+ }
+
+ @Builder ContextMenuBuilder() {
+ Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
+ Text('text3')
+ .fontSize(20)
+ .width(100)
+ .height(50)
+ .textAlign(TextAlign.Center)
+ Divider().height(10)
+ }
+}
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+ Text("responseType-RightClick")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("RightClickText")
+ .bindContextMenu(this.ContextMenuBuilder(), ResponseType.RightClick)
+ .visibility(Visibility.None)
+
+ Text("responseType-LongPress")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("LongPressText")
+ .bindContextMenu(this.ContextMenuBuilder(), ResponseType.LongPress)
+ .visibility(Visibility.None)
+
+ Column() {
+ Text('rightclick for menu')
+ }
+ .key("TestColumn")
+ .width('100%')
+ .margin({ top: 5 })
+ .bindContextMenu(this.MenuBuilder, ResponseType.RightClick)
+
+ }.width("100%").height("100%")
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets
new file mode 100644
index 0000000000000000000000000000000000000000..eb1ee208787174f03a7fd6604461e9ed06daefbb
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 uiAppearance from '@ohos.uiAppearance';
+
+import Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct RouterStandard {
+
+
+ async routePage() {
+ let options = {
+ url: 'pages/page1',
+ params: {
+ text: '这是第一页的值',
+ data: {
+ array: [12, 45, 78]
+ }
+ }
+ }
+ try {
+ await router.push(options,router.RouterMode.Standard)
+ } catch (err) {
+ console.info(`Standard Page fail callback, code: ${err.code}, msg: ${err.msg}`)
+ }
+ }
+
+ async routeSinglePage() {
+ let options = {
+ url: 'pages/page2',
+ params: {
+ text: '这是第二页的值',
+ data: {
+ array: [13, 46, 79]
+ }
+ }
+ }
+ try {
+ await router.push(options,router.RouterMode.Single)
+ } catch (err) {
+ console.info(`Single Page fail callback, code: ${err.code}, msg: ${err.msg}`)
+ }
+ }
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear RouterStandard start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear RouterStandard end`)
+ }
+
+ build(){
+
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("router-Standard")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("StandardText")
+ .onClick(() => {
+ this.routePage()
+ })
+
+ Text("router-Single")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("SingleText")
+ .onClick(() => {
+ this.routeSinglePage()
+ })
+
+ Text('这是第一页')
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ Button() {
+ Text('next page')
+ .fontSize(25)
+ .fontWeight(FontWeight.Bold)
+ }.type(ButtonType.Capsule)
+ .margin({ top: 20 })
+ .backgroundColor('#ccc')
+ .onClick(() => {
+ this.routePage()
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/scroll_edge.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/scroll_edge.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8b9cc0077bf0b50a1bbcbb1ee5693b5b790796f4
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/scroll_edge.ets
@@ -0,0 +1,73 @@
+/*
+ * 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+struct ScrollExample {
+ scroller: Scroller = new Scroller()
+ private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+ build() {
+ Stack({ alignContent: Alignment.TopStart }) {
+ Scroll(this.scroller) {
+ Column() {
+ ForEach(this.arr, (item) => {
+ Text(item.toString())
+ .width('90%').height(150).backgroundColor(0xFFFFFF)
+ .borderRadius(15).fontSize(16).textAlign(TextAlign.Center)
+ .margin({ top: 10 })
+ }, item => item)
+ }.width('100%')
+ }
+ .scrollable(ScrollDirection.Vertical).scrollBar(BarState.On)
+ .scrollBarColor(Color.Gray).scrollBarWidth(30)
+ .onScroll((xOffset: number, yOffset: number) => {
+ console.info(xOffset + ' ' + yOffset)
+ })
+ .onScrollEdge((side: Edge) => {
+ console.info('To the edge')
+ })
+ .onScrollEnd(() => {
+ console.info('Scroll Stop')
+ })
+ Button('back Middle')
+ .key("MiddleText")
+ .onClick(() => { // 点击后回到顶部
+ this.scroller.scrollEdge(Edge.Middle)
+ var result=(this.scroller.scrollEdge(Edge.Middle)!=null)
+ try {
+ var backData = {
+ data: {
+ "STATUS": result
+ }
+ }
+ let backEvent = {
+ eventId: 60306,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("onRequestPopupData start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("onRequestPopupData emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .margin({ top: 60, left: 20 })
+ }.width('100%').height('100%').backgroundColor(0xDCDCDC)
+ }
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/sidebar.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/sidebar.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ee12737a8ebfd56821557a7c18158461ddb14b04
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/sidebar.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct SidebarIcons {
+ @State arr: number[] = [1, 2]
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear SidebarIcons start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear SidebarIcons end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("sidebar-Icons")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("iconsText")
+
+ SideBarContainer(SideBarContainerType.Embed) {
+ Column() {
+ ForEach(this.arr, (item, index) => {
+ Column({ space: 5 }) {
+ Text("Index0" + item)
+ .fontSize(20)
+ }
+ }, item => item)
+ }.width('100%')
+ .justifyContent(FlexAlign.SpaceEvenly)
+ .backgroundColor('#19000000')
+
+ RowSplit() {
+ Column() {
+ Text('Split page').fontSize(30)
+ }
+ }.width('100%')
+ }
+ .key("SideBarContainer")
+ .sideBarWidth(240)
+ .minSideBarWidth(210)
+ .maxSideBarWidth(260)
+ .controlButton({
+ icons: {
+ shown: $r("app.media.icon"),
+ hidden: $r("app.media.icon")
+ }
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/slider.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/slider.ets
new file mode 100644
index 0000000000000000000000000000000000000000..91ee60b8f6021dd6fe2092cd04cc4a78df660df5
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/slider.ets
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import Utils from '../common/Utils.ets';
+import events_emitter from '@ohos.events.emitter';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct SliderMoving {
+ @State outSetValue: number = 40
+ slide() {
+ var rect = Utils.getComponentRect("Slider")
+ Utils.drag(rect["left"],rect["top"],rect["right"],rect["bottom"],20)
+ }
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear SliderMoving start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear SliderMoving end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("slider-Moving")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("MovingText")
+
+ Slider({
+ value: this.outSetValue,
+ min: 0,
+ max: 100,
+ step: 1,
+ style: SliderStyle.OutSet
+ })
+ .key("Slider")
+ .blockColor(Color.Blue)
+ .trackColor(Color.Gray)
+ .selectedColor(Color.Blue)
+ .showSteps(true)
+ .showTips(true)
+ .onChange((value: number, mode: SliderChangeMode) => {
+ Log.showInfo(TAG, 'SliderChangeMode.Moving: ' + SliderChangeMode.Moving.toString())
+ Log.showInfo(TAG, 'value:' + value + 'mode:' + mode.toString())
+ try {
+ var backData = {
+ data: {
+ "Mode": (mode==0)||(mode==1)||(mode==2)
+ }
+ }
+ let backEvent = {
+ eventId: 60307,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("Slider start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("Slider emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+ .onClick(() => {
+ this.slide()
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/stateManagement.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/stateManagement.ets
new file mode 100644
index 0000000000000000000000000000000000000000..99b385c0257c5ba609512300c0c9e82660c2fb4c
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/stateManagement.ets
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct StateManagementDARK {
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear StateManagementDARK start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear StateManagementDARK end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("stateManagement-DARK")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .backgroundColor(ColorMode.DARK)
+ .key("DARKText")
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/stepperItem.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/stepperItem.ets
new file mode 100644
index 0000000000000000000000000000000000000000..fd55e9512f41c981ed88e5afa95b48759aed4c42
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/stepperItem.ets
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct StepperItemDisabled {
+ @State currentIndex: number = 0
+ @State firstState: ItemState = ItemState.Normal
+ @State secondState: ItemState = ItemState.Normal
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear StepperItemDisabled start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear StepperItemDisabled end`)
+ }
+
+ build() {
+ Row() {
+ Column({ space: 10 }) {
+ Text('message')
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+
+ Stepper({
+ index: this.currentIndex
+ }) {
+ StepperItem() {
+ Text('Page One')
+ .fontSize(35)
+ .fontColor(Color.Blue)
+ .width(200)
+ .lineHeight(50)
+ .margin({ top: 250 })
+ }
+ .nextLabel('')
+ .position({ x: '35%', y: 0 })
+
+ StepperItem() {
+ Text('Page Two')
+ .fontSize(35)
+ .fontColor(Color.Blue)
+ .width(200)
+ .lineHeight(50)
+ .margin({ top: 250 })
+ .onClick(() => {
+ this.firstState = this.firstState === ItemState.Skip ? ItemState.Normal : ItemState.Skip
+ })
+ }
+ .key("StepperItem")
+ .nextLabel('Finish')
+ .prevLabel('Previous')
+ .status(this.firstState)
+ .position({ x: '35%', y: 0 })
+ .status(ItemState.Disabled)
+ }
+ .onFinish(() => {
+ Log.showInfo(TAG, 'onFinish')
+ })
+ .onSkip(() => {
+ Log.showInfo(TAG, 'onSkip')
+ })
+ .onChange((prevIndex: number, index: number) => {
+ this.currentIndex = index
+ })
+ .align(Alignment.Center)
+ .height('50%')
+
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/swiper.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/swiper.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2d10b8c60f11e1aa62ebb2be98210fcc8d9b7de2
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/swiper.ets
@@ -0,0 +1,112 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct SwiperMask {
+ private swiperController: SwiperController = new SwiperController()
+ private data: MyDataSource = new MyDataSource([])
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear SwiperMask start`)
+ let list = []
+ for (var i = 1; i <= 5; i++) {
+ list.push(i.toString());
+ }
+ this.data = new MyDataSource(list)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear SwiperMask end`)
+ }
+
+ build() {
+ Row() {
+ Column({ space: 10 }) {
+ Text("swiper-Mask")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("maskText")
+
+ Swiper(this.swiperController) {
+ LazyForEach(this.data, (item: string) => {
+ Text(item)
+ .width('90%')
+ .height(160)
+ .backgroundColor(0xAFEEEE)
+ .textAlign(TextAlign.Center)
+ .fontSize(20)
+ }, item => item)
+ }
+ .cachedCount(2)
+ .index(1)
+ .autoPlay(true)
+ .interval(4000)
+ .indicator(true) // 默认开启指示点
+ .loop(false) // 默认开启循环播放
+ .duration(1000)
+ .vertical(false) // 默认横向切换
+ .itemSpace(0)
+ .curve(Curve.Linear) // 动画曲线
+ .key("maskSwiper")
+ .indicatorStyle({
+ mask: false
+ })
+
+ }
+ .width('100%')
+ }
+ .height('100%')
+ }
+}
+
+
+class MyDataSource implements IDataSource {
+ private list: number[] = []
+ private listener: DataChangeListener
+
+ constructor(list: number[]) {
+ this.list = list
+ }
+
+ totalCount(): number {
+ return this.list.length
+ }
+
+ getData(index: number): any {
+ return this.list[index]
+ }
+
+ registerDataChangeListener(listener: DataChangeListener): void {
+ this.listener = listener
+ }
+
+ unregisterDataChangeListener() {
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/text_input.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/text_input.ets
new file mode 100644
index 0000000000000000000000000000000000000000..dd5271d4a3f7879f2a966b442eba4f89f979c745
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/text_input.ets
@@ -0,0 +1,88 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct Text_inputPhoneNumber {
+ @State text: string = ''
+ @State text1: string = 'PhoneNumber'
+ @State text2: string = 'Address'
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear Text_inputPhoneNumber start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear Text_inputPhoneNumber end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ TextInput({ placeholder: 'input your word' })
+ .key("PhoneNumberText")
+ .placeholderColor("rgb(0,0,225)")
+ .placeholderFont({ size: 30, weight: 100, family: 'cursive', style: FontStyle.Italic })
+ .caretColor(Color.Blue)
+ .height(50)
+ .fontSize(30)
+ .fontWeight(FontWeight.Bold)
+ .fontFamily("sans-serif")
+ .fontStyle(FontStyle.Normal)
+ .fontColor(Color.Red)
+ .type(InputType.PhoneNumber)
+ .onChange((value: string) => {
+ this.text = value
+ })
+
+ Text(this.text1).width('90%')
+ TextInput({ placeholder: 'input your word' })
+ .key('textInput1')
+ .type(InputType.PhoneNumber)
+ .placeholderColor("rgb(0,0,225)")
+ .placeholderFont({ size: 30, weight: 100, family: 'cursive', style: FontStyle.Italic })
+ .caretColor(Color.Blue)
+ .height(50)
+ .fontSize(30)
+ .fontWeight(FontWeight.Bold)
+ .fontFamily("sans-serif")
+ .fontStyle(FontStyle.Normal)
+ .fontColor(Color.Red)
+ .style(TextInputStyle.Default)
+
+ Text(this.text2).width('90%')
+ TextInput({ placeholder: 'input your word' })
+ .key('textInput2')
+ .type(InputType.PhoneNumber)
+ .placeholderColor("rgb(0,0,225)")
+ .placeholderFont({ size: 30, weight: 100, family: 'cursive', style: FontStyle.Italic })
+ .caretColor(Color.Blue)
+ .height(50)
+ .fontSize(30)
+ .fontWeight(FontWeight.Bold)
+ .fontFamily("sans-serif")
+ .fontStyle(FontStyle.Normal)
+ .fontColor(Color.Red)
+ .style(TextInputStyle.Inline)
+ .margin(10)
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/uiAppearance.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/uiAppearance.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3e5c60eb237ba6e725483fa5b7ca26bab1b19cf0
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/uiAppearance.ets
@@ -0,0 +1,113 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 uiAppearance from '@ohos.uiAppearance';
+import Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+
+const TAG = 'ets_apiLack_add';
+uiAppearance.DarkMode.ALWAYS_DARK
+
+@Entry
+@Component
+export default
+struct UiAppearanceALWAYS_DARK {
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear UiAppearanceALWAYS_DARK start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear UiAppearanceALWAYS_DARK end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+
+ Text("uiAppearance-ALWAYS_DARK")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ALWAYS_DARKText")
+ .onClick(()=>{
+ uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, (err) => {
+ console.info(`${err}`);
+ })
+ let darkMode = uiAppearance.getDarkMode();
+ try{
+ var backData = {
+ data: {
+ "Mode": darkMode
+ }
+ }
+ let backEvent = {
+ eventId: 60308,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("AlwaysDark start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch(err) {
+ console.info("AlwaysDark emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text("uiAppearance-ALWAYS_LIGHT")
+ .width(100)
+ .height(70)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("ALWAYS_LIGHTText")
+ .onClick(()=>{
+ uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_LIGHT, (err) => {
+ console.info(`${err}`);
+ })
+ let darkMode = uiAppearance.getDarkMode();
+ try{
+ var backData = {
+ data: {
+ "Mode": darkMode
+ }
+ }
+ let backEvent = {
+ eventId: 60309,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("AlwaysLight start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch(err) {
+ console.info("AlwaysLight emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/units.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/units.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3c0c963569e156b6c8de078ac3791bf08ca14d98
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/units.ets
@@ -0,0 +1,178 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+import events_emitter from '@ohos.events.emitter';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default struct UnitsModuleName {
+ @State textHeight: number = 50
+
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear UnitsModuleName start`)
+ }
+
+ aboutToDisappear() {
+ Log.showInfo(TAG, `aboutToDisAppear UnitsModuleName end`)
+ }
+
+ build() {
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
+
+ Text("units-ModuleName")
+ .width(320)
+ .height(this.textHeight)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("moduleNameText")
+ .onClick(() => {
+ console.log($r('app.string.MainAbility_label').bundleName)
+ try {
+ var backData = {
+ data: {
+ "ModuleName": ($r('app.string.MainAbility_label').bundleName != null)
+ }
+ }
+ let backEvent = {
+ eventId: 60310,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("ModuleName start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("ModuleName emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+ Text("units-GlobalPosition")
+ .width(320)
+ .height(this.textHeight)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("globalPositionText")
+ .onClick(() => {
+ this.textHeight = 100
+ })
+ .onAreaChange((oldValue: Area, newValue: Area) => {
+ console.info(`oldValue.globalPosition: ${JSON.stringify(oldValue.globalPosition)}`)
+ console.info(`newValue.globalPosition: ${JSON.stringify(newValue.globalPosition)}`)
+ try {
+ var backData = {
+ data: {
+ "Result": true
+ }
+ }
+ let backEvent = {
+ eventId: 60311,
+ priority: events_emitter.EventPriority.LOW
+ }
+ console.info("GlobalPosition start to emit action state")
+ events_emitter.emit(backEvent, backData)
+ } catch (err) {
+ console.info("GlobalPosition emit action state err: " + JSON.stringify(err.message))
+ }
+ })
+
+
+ Text("units-MinWidth")
+ .width(100)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("minWidthText")
+ .constraintSize({
+ minWidth: 200
+ })
+
+ Text("units-MaxWidth")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("maxWidthText")
+ .constraintSize({
+ maxWidth: 200
+ })
+
+ Text("units-MinHeight")
+ .width(320)
+ .height(50)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("minHeightText")
+
+ .constraintSize({
+ minHeight: 100
+ })
+
+ Text("units-MaxHeight")
+ .width(320)
+ .height(200)
+ .fontSize(20)
+ .opacity(1)
+ .align(Alignment.TopStart)
+ .fontColor(0xCCCCCC)
+ .lineHeight(25)
+ .border({ width: 1 })
+ .padding(10)
+ .textAlign(TextAlign.Center)
+ .textOverflow({ overflow: TextOverflow.None })
+ .key("maxHeightText")
+ .constraintSize({
+ maxHeight: 100
+ })
+
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/web.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b48af9231b452ac0d80c24792acc7ad449993de5
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/web.ets
@@ -0,0 +1,100 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
+
+const TAG = 'ets_apiLack_add';
+
+@Entry
+@Component
+export default
+struct WebEditText {
+ controller: WebController = new WebController();
+ webResourceResponse: WebResourceResponse = new WebResourceResponse();
+ aboutToAppear() {
+ Log.showInfo(TAG, `aboutToAppear WebEditText start`)
+ }
+
+ aboutToDisappear(){
+ Log.showInfo(TAG, `aboutToDisAppear WebEditText end`)
+ }
+
+ build(){
+ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
+ Web({ src:'www.baidu.com', controller:this.controller })
+ .javaScriptAccess(true)
+ .height(500)
+ .padding(20)
+ .blur(2)
+ .fileFromUrlAccess(true)
+ .initialScale(2)
+ .webDebuggingAccess(true)
+ .onRenderExited((event) => {
+ console.info('onRenderExited getAcceptType: ', event.renderExitReason);
+ })
+ .onShowFileSelector((event) => {
+ console.info('onShowFileSelector getAcceptType: ', event.fileSelector.getAcceptType());
+ console.info('onShowFileSelector getTitle: ', event.fileSelector.getTitle());
+ console.info('onShowFileSelector getMode: ', event.fileSelector.getMode());
+ console.info('onShowFileSelector isCapture: ', event.fileSelector.isCapture());
+ event.result.handleFileList(["D:\DevEcoStudioProjects","D:\DevEcoStudioProjects"])
+ return true;
+ })
+ .onInterceptRequest((event) => {
+ console.info('onInterceptRequest getRequestUrl: ', event.request.getRequestUrl());
+ console.info('onInterceptRequest isMainFrame: ', event.request.isMainFrame());
+ console.info('onInterceptRequest isRedirect: ', event.request.isRedirect());
+ console.info('onInterceptRequest isRequestGesture: ', event.request.isRequestGesture());
+ let result = event.request.getRequestHeader();
+ console.log('The request header result size is ' + result.length);
+ for (let i of result) {
+ console.log('The request header key is : ' + i.headerKey + ' , value is : ' + i.headerValue);
+ }
+ return this.webResourceResponse;
+ })
+ .onPermissionRequest((event) => {
+ AlertDialog.show({
+ title: 'title',
+ message: 'text',
+ confirm: {
+ value: 'onConfirm',
+ action: () => {
+ event.request.grant(event.request.getAccessibleResource());
+ }
+ },
+ cancel: () => {
+ event.request.deny();
+ }
+ })
+ })
+ .onHttpErrorReceive((event) => {
+ console.log('setResponseHeader:' + event.response.setResponseHeader([]));
+ console.log('web getExtra:' + this.controller.getHitTestValue().getExtra());
+ console.log('web getType:' + this.controller.getHitTestValue().getType());
+ let result = event.request.getRequestHeader();
+ console.log('The request header result size is ' + result.length);
+ for (let i of result) {
+ console.log('The request header key is : ' + i.headerKey + ' , value is : ' + i.headerValue);
+ }
+ let resph = event.response.getResponseHeader();
+ console.log('The response header result size is ' + resph.length);
+ for (let i of resph) {
+ console.log('The response header key is : ' + i.headerKey + ' , value is : ' + i.headerValue);
+ }
+ })
+ }.width("100%").height("100%")
+ }
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..0d04e3a8354e1f9224f2fef1df0ecccfd5311f25
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets
@@ -0,0 +1,32 @@
+/**
+ * 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+import { Hypium } from 'hypium/index'
+import testsuite from '../test/List.test'
+
+export default {
+ onCreate() {
+ console.info('Application onCreate')
+ var abilityDelegator: any
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+ var abilityDelegatorArguments: any
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ console.info('start run testcase!!!')
+ Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
+ },
+ onDestroy() {
+ console.info('Application onDestroy')
+ },
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c12e9993796c2c412a0846a03ef8bd2333d51e5f
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets
@@ -0,0 +1,49 @@
+/**
+ * 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 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
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
new file mode 100644
index 0000000000000000000000000000000000000000..af65ea87c0e54067f9f4b2d80003c81f7b14f53c
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
@@ -0,0 +1,77 @@
+/**
+ * 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 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 itName',
+ '-s level', '-s testType', '-s size', '-s timeout',
+ '-s package'
+ ])
+ let targetParams = '';
+ for (const key in parameters) {
+ if (keySet.has(key)) {
+ 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')
+ }
+
+ onRun() {
+ console.log('OpenHarmonyTestRunner onRun run')
+ abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
+ abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
+
+ let lMonitor = {
+ abilityName: testAbilityName,
+ onAbilityCreate: onAbilityCreateCallback,
+ };
+ var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
+ abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
+ var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -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 call abilityDelegator.getAppContext')
+ var context = abilityDelegator.getAppContext()
+ console.info('getAppContext : ' + JSON.stringify(context))
+ console.info('OpenHarmonyTestRunner onRun end')
+ }
+};
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..67cda3d6e9126d6b79953d50e4e2c5ca573132d9
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 animatorOnframeJsunit from './animator.test.ets';
+import curvesEaseOutJsunit from './curves.test.ets';
+import routerStandardJsunit from './router.test.ets';
+import uiAppearanceALWAYS_DARKJsunit from './uiAppearance.test.ets';
+import appVersionCodeJsunit from './app.test.ets';
+import alertDialogCenterStartJsunit from './alertDialog.test.ets';
+import canvasActualBoundingBoxAscentJsunit from './canvas.test.ets';
+import checkBoxGroupJsunit from './checkBox.test.ets';
+import checkBoxGroupPartJsunit from './checkBoxGroup.test.ets';
+import commonColorModeJsunit from './common.test.ets';
+import datePickerLunarJsunit from './datePicker.test.ets';
+import enumsCancelJsunit from './enums.test.ets';
+import gestureParallelJsunit from './gesture.test.ets';
+import listtestIdleJsunit from './listtest.test.ets';
+import list_item_groupJsunit from './list_item_group.test.ets'
+import loadingProgressCircularJsunit from './loadingProgress.test.ets';
+import progressScaleCountJsunit from './progress.test.ets';
+import radioGroupJsunit from './radio.test.ets';
+import refreshDragJsunit from './refresh.test.ets';
+import remoteWindowJsunit from './remoteWindow.test.ets'
+import sidebarIconsJsunit from './sidebar.test.ets';
+import sliderMovingJsunit from './slider.test.ets';
+import stateManagementDARKJsunit from './stateManagement.test.ets';
+import stepperItemDisabledJsunit from './stepperItem.test.ets';
+import swiperMaskJsunit from './swiper.test.ets';
+import text_inputPhoneNumberJsunit from './text_input.test.ets';
+import unitsModuleNameJsunit from './units.test.ets';
+import webEditTextJsunit from './web.test.ets';
+import hoverEffectJsunit from './hoverEffect.test.ets';
+import responseTypeJsunit from './responseType.test.ets';
+import copyOptionJsunit from './copyOption.test.ets';
+import hitTestModeJsunit from './hitTestMode.test.ets';
+import colorEnumJsunit from './color.test.ets';
+
+export default function testsuite() {
+ animatorOnframeJsunit()
+ routerStandardJsunit()
+ appVersionCodeJsunit()
+ alertDialogCenterStartJsunit()
+ canvasActualBoundingBoxAscentJsunit()
+ checkBoxGroupJsunit()
+ checkBoxGroupPartJsunit()
+ commonColorModeJsunit()
+ datePickerLunarJsunit()
+ gestureParallelJsunit()
+ listtestIdleJsunit()
+ loadingProgressCircularJsunit()
+ progressScaleCountJsunit()
+ radioGroupJsunit()
+ remoteWindowJsunit()
+ sidebarIconsJsunit()
+ sliderMovingJsunit()
+ stateManagementDARKJsunit()
+ stepperItemDisabledJsunit()
+ swiperMaskJsunit()
+ unitsModuleNameJsunit()
+ webEditTextJsunit()
+ hoverEffectJsunit()
+ responseTypeJsunit()
+ copyOptionJsunit()
+ hitTestModeJsunit()
+ colorEnumJsunit()
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/Utils.ets
new file mode 100644
index 0000000000000000000000000000000000000000..aa94fe4f7e0a3a0c066b9141e118b2229c839a96
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/Utils.ets
@@ -0,0 +1,118 @@
+// @ts-nocheck
+/**
+ * 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 class Utils {
+ static rect_left;
+ static rect_top;
+ static rect_right;
+ static rect_bottom;
+ static rect_value;
+
+ static sleep(time) {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ resolve()
+ }, time)
+ }).then(() => {
+ console.info(`sleep ${time} over...`)
+ })
+ }
+
+ static getComponentRect(key) {
+ let strJson = getInspectorByKey(key);
+ let obj = JSON.parse(strJson);
+ console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
+ let rectInfo = JSON.parse('[' + obj.$rect + ']')
+ console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
+ this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
+ this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
+ this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
+ this.rect_bottom = JSON.parse('[' + rectInfo[1] + ']')[1]
+ return this.rect_value = {
+ "left": this.rect_left, "top": this.rect_top, "right": this.rect_right, "bottom": this.rect_bottom
+ }
+ }
+
+ static async swipe(downX, downY, upX, upY, steps) {
+ console.info('start to swipe')
+ this.drags(downX, downY, upX, upY, steps, false)
+ }
+
+ static async drag(downX, downY, upX, upY, steps) {
+ console.info('start to drag')
+ this.drags(downX, downY, upX, upY, steps, true)
+ }
+
+ static async drags(downX, downY, upX, upY, steps, drag) {
+ var xStep;
+ var yStep;
+ var swipeSteps;
+ var ret;
+ xStep = 0;
+ yStep = 0;
+ ret = false;
+ swipeSteps = steps;
+ if (swipeSteps == 0) {
+ swipeSteps = 1;
+ }
+ xStep = (upX - downX) / swipeSteps;
+ yStep = (upY - downY) / swipeSteps;
+ console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
+ var downPonit: TouchObject = {
+ id: 1,
+ x: downX,
+ y: downY,
+ type: TouchType.Down,
+ }
+ console.info('down touch started: ' + JSON.stringify(downPonit))
+ sendTouchEvent(downPonit);
+ console.info('start to move')
+ if (drag) {
+ await this.sleep(500)
+ }
+ for (var i = 1;i <= swipeSteps; i++) {
+ var movePoint: TouchObject = {
+ id: 1,
+ x: downX + (xStep * i),
+ y: downY + (yStep * i),
+ type: TouchType.Move
+ }
+ console.info('move touch started: ' + JSON.stringify(movePoint))
+ ret = sendTouchEvent(movePoint)
+ if (ret == false) {
+ break;
+ }
+ await this.sleep(5)
+ }
+ console.info('start to up')
+ if (drag) {
+ await this.sleep(100)
+ }
+ var upPoint: TouchObject = {
+ id: 1,
+ x: upX,
+ y: upY,
+ type: TouchType.Up,
+ }
+ console.info('up touch started: ' + JSON.stringify(upPoint))
+ sendTouchEvent(upPoint)
+ await this.sleep(500)
+ }
+}
+
+
+
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2dca5c993afa6b9decc1dc0db4699970d56234dd
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function alertDialogCenterStartJsunit() {
+ describe('alertDialogCenterStartTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/alertDialog',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get alertDialog state success " + JSON.stringify(pages));
+ if (!("alertDialog" == pages.name)) {
+ console.info("get alertDialog state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push alertDialog page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push alertDialog page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("alertDialogCenterStart after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testalertDialogCenterStart0001
+ * @tc.desic acealertDialogCenterStartEtsTest0001
+ */
+ it('testalertDialogCenterStart0001', 0, async function (done) {
+ console.info('alertDialogCenterStart testalertDialogCenterStart0011 START');
+ await Utils.sleep(2000);
+ try {
+ var event = {
+ eventId: 81601,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testalertDialogCenterStart0001 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual(true);
+ console.info('testalertDialogCenterStart0011 END');
+ done();
+ }
+ console.info("testalertDialogCenterStart0001 click result is: " + JSON.stringify(sendEventByKey('CenterStartButton', 10, "")));
+ events_emitter.on(event, callback);
+ } catch (err) {
+ console.info("testalertDialogCenterStart0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animate_play_mode.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animate_play_mode.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d27f16274cc72bd705cd0bb66f060d9b8ec2a661
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animate_play_mode.test.ets
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+export default function playModeReverseJsunit() {
+ describe('playModeReverseTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/animate_play_mode',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get animate_play_mode state success " + JSON.stringify(pages));
+ if (!("PlayModeReverse" == pages.name)) {
+ console.info("get animate_play_mode state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push animate_play_mode page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push animate_play_mode page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("playModeReverse after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testPlayModeReverse0001
+ * @tc.desic acePlayModeReverseEtsTest0001
+ */
+ it('testPlayModeReverse0001', 0, async function (done) {
+ console.info('PlayModeReverse testPlayModeReverse0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Reverse');
+ console.info("[testradioGroup0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.animation).assertEqual({
+ duration: 3000, // 动画时长
+ curve: Curve.EaseOut, // 动画曲线
+ delay: 1000, // 动画延迟
+ iterations: 1, // 播放次数
+ playMode: PlayMode.Reverse // 动画模式
+ });
+ console.info("[testPlayModeReverse0001] width value :" + obj.$attrs.animation);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testPlayModeAlternate0001
+ * @tc.desic acePlayModeAlternateEtsTest0009
+ */
+ it('testPlayModeAlternate0001', 0, async function (done) {
+ console.info('radioGroup testPlayModeAlternate0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Alternate');
+ console.info("[testPlayModeAlternate0001] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.animation).assertEqual({
+ duration: 3000,
+ curve: Curve.EaseOut,
+ delay: 1000,
+ iterations: 1,
+ playMode: PlayMode.Alternate
+ });
+ console.info("[testPlayModeAlternate0001] padding value :" + obj.$attrs.animation);
+ done();
+ });
+
+ })
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animator.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animator.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..24f65f9b3227120a5e752ec2cc0c810b71c5210d
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/animator.test.ets
@@ -0,0 +1,202 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function animatorOnframeJsunit() {
+ describe('animatorOnframeTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/animator',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get animator state success " + JSON.stringify(pages));
+ if (!("animator" == pages.name)) {
+ console.info("get animator state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push animator page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push animator page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("animatorOnframe after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testanimatorOnframe0001
+ * @tc.desic aceanimatorOnframeEtsTest0001
+ */
+ it('testanimatorOnframe0001', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual("100.00vp");
+ console.info("[testanimatorOnframe0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testanimatorOnframe0002
+ * @tc.desic aceanimatorOnframeEtsTest0002
+ */
+ it('testanimatorOnframe0002', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.height).assertEqual("70.00vp");
+ console.info("[testanimatorOnframe0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testanimatorOnframe0003
+ * @tc.desic aceanimatorOnframeEtsTest0003
+ */
+ it('testanimatorOnframe0003', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontSize).assertEqual("20.00fp");
+ console.info("[testanimatorOnframe0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testanimatorOnframe0004
+ * @tc.desic aceanimatorOnframeEtsTest0004
+ */
+ it('testanimatorOnframe0004', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testanimatorOnframe0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testanimatorOnframe0005
+ * @tc.desic aceanimatorOnframeEtsTest0005
+ */
+ it('testanimatorOnframe0005', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
+ console.info("[testanimatorOnframe0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testanimatorOnframe0006
+ * @tc.desic aceanimatorOnframeEtsTest0006
+ */
+ it('testanimatorOnframe0006', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
+ console.info("[testanimatorOnframe0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testanimatorOnframe0007
+ * @tc.desic aceanimatorOnframeEtsTest0007
+ */
+ it('testanimatorOnframe0007', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
+ console.info("[testanimatorOnframe0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testanimatorOnframe0009
+ * @tc.desic aceanimatorOnframeEtsTest0009
+ */
+ it('testanimatorOnframe0009', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.padding).assertEqual("10.00vp");
+ console.info("[testanimatorOnframe0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testanimatorOnframe0010
+ * @tc.desic aceanimatorOnframeEtsTest0010
+ */
+ it('testanimatorOnframe0010', 0, async function (done) {
+ console.info('animatorOnframe testanimatorOnframe0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('onframeText');
+ console.info("[testanimatorOnframe0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
+ console.info("[testanimatorOnframe0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/app.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/app.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d1d4b22716f28e9e1758bcf205a36a159d5ba770
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/app.test.ets
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import events_emitter from '@ohos.events.emitter';
+import Utils from './Utils.ets'
+
+export default function appVersionCodeJsunit() {
+ describe('appVersionCodeTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/app',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get app state success " + JSON.stringify(pages));
+ if (!("app" == pages.name)) {
+ console.info("get app state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push app page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push app page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("appVersionCode after each called");
+ });
+
+ it('testappVersionCode0011', 0, async function (done) {
+ console.info('appVersionCode testappVersionCode0011 START');
+ await Utils.sleep(1000);
+ try {
+ var innerEvent = {
+ eventId: 60302,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testappVersionCode_0011 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Code).assertEqual("1");
+ }
+ console.info("testappVersion click result is: " + JSON.stringify(sendEventByKey('versionCodeText', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("testappVersionCode_0011 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testappVersionCode_0011 END');
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/canvas.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/canvas.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..27e88fa4f8102087e174ed2e3f61812383795834
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/canvas.test.ets
@@ -0,0 +1,109 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function canvasActualBoundingBoxAscentJsunit() {
+ describe('canvasActualBoundingBoxAscentTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/canvas',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get canvas state success " + JSON.stringify(pages));
+ if (!("canvas" == pages.name)) {
+ console.info("get canvas state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push canvas page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push canvas page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("canvasActualBoundingBoxAscent after each called");
+ });
+
+ it('testcanvasAttributes0001', 0, async function (done) {
+ console.info('canvasAttributes0001 testcanvasAttributes0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Canvas');
+ console.info("[testcanvasAttributes0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Canvas');
+ expect(obj.$attrs.width).assertEqual("100.00%");
+ console.info("[testcanvasAttributes0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ it('testcanvasAttributes0002', 0, async function (done) {
+ console.info('canvasAttributes0002 testcanvasAttributes0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Canvas');
+ console.info("[testcanvasAttributes0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Canvas');
+ expect(obj.$attrs.height).assertEqual("100.00%");
+ console.info("[testcanvasAttributes0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ it('testcanvasAttributes0003', 0, async function (done) {
+ console.info('canvasAttributes0003 testcanvasAttributes0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Canvas');
+ console.info("[testcanvasAttributes0003] component backgroundColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Canvas');
+ expect(obj.$attrs.backgroundColor).assertEqual("#FFFFFF00");
+ console.info("[testcanvasAttributes0003] backgroundColor value :" + obj.$attrs.backgroundColor);
+ done();
+ });
+
+ it('testcanvasAttributes0004', 0, async function (done) {
+ console.info('canvasAttributes0003 testcanvasAttributes0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Canvas');
+ console.info("[testcanvasAttributes0004] component position strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Canvas');
+ expect(obj.$attrs.position.x).assertEqual("3.00vp");
+ console.info("[testcanvasAttributes0004] position value :" + obj.$attrs.position);
+ done();
+ });
+
+ it('testcanvasAttributes0005', 0, async function (done) {
+ console.info('canvasAttributes0005 testcanvasAttributes0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Canvas');
+ console.info("[testcanvasAttributes0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Canvas');
+ expect(obj.$attrs.align).assertEqual("Alignment.Center");
+ console.info("[testcanvasAttributes0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBox.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBox.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..753af21a4fe9f9788d054dcb199c674f8c2b9811
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBox.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function checkBoxGroupJsunit() {
+ describe('checkBoxGroupTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/checkBox',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get checkBox state success " + JSON.stringify(pages));
+ if (!("checkBox" == pages.name)) {
+ console.info("get checkBox state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push checkBox page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push checkBox page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("checkBoxGroup after each called");
+ });
+
+ it('testcheckBoxGroup001', 0, async function (done) {
+ console.info('checkBoxGroup testcheckBoxGroup001 START');
+ await Utils.sleep(2000);
+ try {
+ console.info("testcheckBoxGroup_0011 click result is: " + JSON.stringify(sendEventByKey('CheckboxGroup', 10, "")));
+ let strJson = getInspectorByKey('Checkbox2');
+ console.info("[testcheckBoxGroup001] component select strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Checkbox');
+ expect(obj.$attrs.select).assertEqual("false");
+ } catch (err) {
+ console.info("testcheckBoxGroup_0011 on click err : " + JSON.stringify(err));
+ }
+ console.info('testcheckBoxGroup001 END');
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBoxGroup.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBoxGroup.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..55765c38521b11b6be3d8f700cb2243beb949997
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/checkBoxGroup.test.ets
@@ -0,0 +1,88 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import events_emitter from '@ohos.events.emitter';
+import Utils from './Utils.ets'
+
+export default function checkBoxGroupPartJsunit() {
+ describe('checkBoxGroupPartTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/checkBoxGroup',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get checkBoxGroup state success " + JSON.stringify(pages));
+ if (!("checkBoxGroup" == pages.name)) {
+ console.info("get checkBoxGroup state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push checkBoxGroup page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push checkBoxGroup page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("checkBoxGroupPart after each called");
+ });
+
+ it('testcheckBoxGroupPart0011', 0, async function (done) {
+ console.info('checkBoxGroupPart testcheckBoxGroupPart0011 START');
+ await Utils.sleep(2000);
+ try {
+ console.info("testcheckBoxGroupPart_0011 click result is: " + JSON.stringify(sendEventByKey('CheckboxGroup', 10, "")));
+ let strJson = getInspectorByKey('Checkbox2');
+ console.info("[testcheckBoxGroupPart0011] component select strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Checkbox');
+ expect(obj.$attrs.select).assertEqual("false");
+ } catch (err) {
+ console.info("testcheckBoxGroupPart_0011 on click err : " + JSON.stringify(err));
+ }
+ console.info('testcheckBoxGroupPart0011 END');
+ done();
+ });
+
+ it('testcheckBoxGroup0001', 0, async function (done) {
+ console.info('checkBoxGroup testcheckBoxGroup0001 START');
+ await Utils.sleep(2000);
+ try {
+ console.info("testcheckBoxGroup0001 click result is: " + JSON.stringify(sendEventByKey('CheckboxGroup', 10, "")));
+ var innerEvent = {
+ eventId: 60301,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testcheckBoxGroup0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(2);
+ done();
+ }
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("testcheckBoxGroup0001 on click err : " + JSON.stringify(err));
+ }
+ console.info('testcheckBoxGroup0001 END');
+ })
+ })
+}
+
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..5b7426766b35ee5196a0da2c896b58163510f942
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function colorEnumJsunit() {
+ describe('colorEnumJsunit', function () {
+ beforeEach(async function (done) {
+ console.info("color beforeEach start");
+ let options = {
+ uri: 'pages/color',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get color state success " + JSON.stringify(pages));
+ if (!("color" == pages.name)) {
+ console.info("get color state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(1000);
+ console.info("push color page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push color page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("colorEnumTest after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testcolorTransparent0001
+ * @tc.desic acecolorTransparentEtsTest0001
+ */
+ it('testcolorTransparent0001', 0, async function (done) {
+ console.info('colorEnumTest testcolorTransparent0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Transparent');
+ console.info("[testcolorTransparent0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ console.info("[testcolorTransparent0001] fontColor value :" + obj.$attrs.fontColor);
+ expect(obj.$attrs.fontColor).assertEqual("#FF000000");
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..95f35a18b1919ee687d3e0c145732f332575aea3
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets
@@ -0,0 +1,246 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function commonColorModeJsunit() {
+ describe('commonColorModeTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/common',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get common state success " + JSON.stringify(pages));
+ if (!("common" == pages.name)) {
+ console.info("get common state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push common page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push common page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("commonColorMode after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testCommonColorMode0011
+ * @tc.desic acecommonColorModeEtsTest0011
+ */
+ it('testCommonColorMode0011', 0, async function (done) {
+ console.info('commonColorMode testCommonColorMode0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ThinText');
+ console.info("[testCommonColorMode0011] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined);
+ console.info("[testCommonColorMode0011] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0012
+ * @tc.name testCommonColorMode0012
+ * @tc.desic acecommonColorModeEtsTest0012
+ */
+ it('testCommonColorMode0012', 0, async function (done) {
+ console.info('commonColorMode testCommonColorMode0012 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ThickText');
+ console.info("[testCommonColorMode0012] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined);
+ console.info("[testCommonColorMode0012] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00017
+ * @tc.name testCommonMiddle0001
+ * @tc.desic acecommonMiddleEtsTest0001
+ */
+ it('testCommonMiddle0001', 0, async function (done) {
+ console.info('commonMiddle testCommonMiddle0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('middleText');
+ console.info("[testCommonMiddle0001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ console.info("[testCommonMiddle0001] alignRules value :" + obj.$attrs.alignRules);
+ expect(obj.$attrs.alignRules).assertEqual(undefined);
+ console.info("[testCommonMiddle0001] alignRules value :" + obj.$attrs.alignRules);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00018
+ * @tc.name testCommonOutset0001
+ * @tc.desic acecommonOutsetEtsTest0001
+ */
+ it('testCommonOutset0001', 0, async function (done) {
+ console.info('commonOutset testCommonOutset0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('outsetText');
+ console.info("[testCommonOutset0001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ console.info("[testCommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
+ expect(obj.$attrs.borderImage).assertEqual(undefined);
+ console.info("[testCommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00019
+ * @tc.name testCommonRepeat0001
+ * @tc.desic acecommonRepeatEtsTest0001
+ */
+ it('testCommonRepeat0001', 0, async function (done) {
+ console.info('commonRepeat testCommonRepeat0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('RepeatText');
+ console.info("[testCommonRepeat0001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.borderImage).assertEqual(undefined);
+ console.info("[testCommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00020
+ * @tc.name testCommonSpace0001
+ * @tc.desic acecommonSpaceEtsTest0001
+ */
+ it('testCommonSpace0001', 0, async function (done) {
+ console.info('commonSpace testCommonSpace0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('SpaceText');
+ console.info("[testCommonSpace0001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.borderImage).assertEqual(undefined);
+ console.info("[testCommonSpace0001] borderImage value :" + obj.$attrs.borderImage);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00021
+ * @tc.name testCommonSlice0001
+ * @tc.desic acecommonSliceEtsTest0001
+ */
+ it('testCommonSlice0001', 0, async function (done) {
+ console.info('commonSlice testCommonSlice0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('sliceText');
+ console.info("[testCommonSlice0001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ console.info("[testCommonSlice0001] borderImage value :" + obj.$attrs.borderImage);
+ expect(obj.$attrs.borderImage).assertEqual(undefined);
+ console.info("[testCommonSlice0001] borderImage value :" + obj.$attrs.borderImage);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00022
+ * @tc.name testCommonArea0001
+ * @tc.desic acecommonAreaEtsTest0001
+ */
+ it('testCommonArea0001', 0, async function (done) {
+ console.info('commonSlice testCommonArea0001 START');
+ await Utils.sleep(500);
+ try {
+ var innerEvent = {
+ eventId: 60312,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testCommonArea0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(320);
+ done();
+ }
+ console.info("testCommonArea0001 click result is: " + JSON.stringify(sendEventByKey('areaText', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("testCommonArea0001 on click err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00023
+ * @tc.name testCommonTouches0001
+ * @tc.desic acecommonTouchesEtsTest0001
+ */
+ it('testCommonTouches0001', 0, async function (done) {
+ console.info('commonSlice testCommonTouches0001 START');
+ await Utils.sleep(500);
+ try {
+ var innerEvent = {
+ eventId: 60313,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testCommonTouches0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(undefined);
+ done();
+ }
+ console.info("testCommonTouches0001 click result is: " + JSON.stringify(sendEventByKey('touchesText', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("testCommonTouches0001 on click err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_00024
+ * @tc.name testCommonChangedTouches0001
+ * @tc.desic acecommonTouchesEtsTest0001
+ */
+ it('testCommonChangedTouches0001', 0, async function (done) {
+ console.info('commonSlice testCommonChangedTouches0001 START');
+ await Utils.sleep(500);
+ try {
+ var innerEvent = {
+ eventId: 60314,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testCommonChangedTouches0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(undefined);
+ done();
+ }
+ console.info("changedTouches0001 click is: " + JSON.stringify(sendEventByKey('changedTouchesText', 10, "")));
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("testCommonChangedTouches0001 on click err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/copyOption.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/copyOption.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b12cd1d3284d4fdc5d6bc205e246dd15defa4876
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/copyOption.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function copyOptionJsunit() {
+ describe('copyOptionTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/copyOption',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get copyOption state success " + JSON.stringify(pages));
+ if (!("copyOption" == pages.name)) {
+ console.info("get copyOption state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push copyOption page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push copyOption page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("copyOption after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testcopyOption0001
+ * @tc.desic acecopyOptionEtsTest0001
+ */
+ it('testcopyOption0001', 0, async function (done) {
+ console.info('hoverEffect testcopyOption0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('InAppText');
+ console.info("[testcopyOption0001] component copyOption strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.copyOption).assertEqual(undefined);
+ console.info("[testcopyOption0001] copyOption value :" + obj.$attrs.copyOption);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testcopyOption0002
+ * @tc.desic acecopyOptionEtsTest0002
+ */
+ it('testcopyOption0002', 0, async function (done) {
+ console.info('hoverEffect testcopyOption0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('LocalDeviceText');
+ console.info("[testcopyOption0002] component copyOption strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.copyOption).assertEqual(undefined);
+ console.info("[testcopyOption0002] copyOption value :" + obj.$attrs.copyOption);
+ done();
+ });
+ })
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/curves.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/curves.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..677aeb0f476a7a818474bfccda3631efb2f3f871
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/curves.test.ets
@@ -0,0 +1,262 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function curvesEaseOutJsunit() {
+ describe('curvesEaseOutTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/curves',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get curves state success " + JSON.stringify(pages));
+ if (!("curves" == pages.name)) {
+ console.info("get curves state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(1000);
+ console.info("push curves page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push curves page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("curvesEaseOut after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testeaseOutText0001
+ * @tc.desic aceeaseOutTextEtsTest0001
+ */
+ it('testeaseOutText0001', 0, async function (done){
+ console.info('easeOutText testeaseOutText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('EaseOutText')
+ console.info("[testeaseOutText0001] component EaseOutText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testeaseOutText0001] width value :" + obj.$attrs.width);
+ console.info("[testeaseOutText0001] height value :" + obj.$attrs.height);
+ console.info("[testeaseOutText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testeaseInOutText0001
+ * @tc.desic aceeaseInOutTextEtsTest0001
+ */
+ it('testeaseInOutText0001', 0, async function (done){
+ console.info('easeInOutText testeaseInOutText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('EaseInOutText')
+ console.info("[testeaseInOutText0001] component EaseInOutText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testeaseInOutText0001] width value :" + obj.$attrs.width);
+ console.info("[testeaseInOutText0001] height value :" + obj.$attrs.height);
+ console.info("[testeaseInOutText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ console.info("[testeaseInOutText0001] animation value :" + obj.$attrs.animation);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testfastOutSlowInText0001
+ * @tc.desic acefastOutSlowInTextEtsTest0001
+ */
+ it('testfastOutSlowInText0001', 0, async function (done){
+ console.info('fastOutSlowInText testfastOutSlowInText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('FastOutSlowInText')
+ console.info("[testfastOutSlowInText0001] component fastOutSlowInText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testfastOutSlowInText0001] width value :" + obj.$attrs.width);
+ console.info("[testfastOutSlowInText0001] height value :" + obj.$attrs.height);
+ console.info("[testfastOutSlowInText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ console.info("[testfastOutSlowInText0001] animation value :" + obj.$attrs.animation);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testlinearOutSlowInText0001
+ * @tc.desic acelinearOutSlowInTextEtsTest0001
+ */
+ it('testlinearOutSlowInText0001', 0, async function (done){
+ console.info('linearOutSlowInText testlinearOutSlowInText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('LinearOutSlowInText')
+ console.info("[testlinearOutSlowInText0001] component linearOutSlowInText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testlinearOutSlowInText0001] width value :" + obj.$attrs.width);
+ console.info("[testlinearOutSlowInText0001] height value :" + obj.$attrs.height);
+ console.info("[testlinearOutSlowInText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ console.info("[testlinearOutSlowInText0001] animation value :" + obj.$attrs.animation);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testfastOutLinearInText0001
+ * @tc.desic acefastOutLinearInTextEtsTest0001
+ */
+ it('testfastOutLinearInText0001', 0, async function (done){
+ console.info('fastOutLinearInText testfastOutLinearInText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('fastOutLinearInText')
+ console.info("[testfastOutLinearInText0001] component fastOutLinearInText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testfastOutLinearInText0001] width value :" + obj.$attrs.width);
+ console.info("[testfastOutLinearInText0001] height value :" + obj.$attrs.height);
+ console.info("[testfastOutLinearInText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testextremeDecelerationText0001
+ * @tc.desic aceextremeDecelerationTextEtsTest0001
+ */
+ it('testextremeDecelerationText0001', 0, async function (done){
+ console.info('extremeDecelerationText testextremeDecelerationText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('ExtremeDecelerationText')
+ console.info("[testextremeDecelerationText0001] component extremeDecelerationText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testextremeDecelerationText0001] width value :" + obj.$attrs.width);
+ console.info("[testextremeDecelerationText0001] height value :" + obj.$attrs.height);
+ console.info("[testextremeDecelerationText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ console.info("[testextremeDecelerationText0001] animation value :" + obj.$attrs.animation);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testsharpText0001
+ * @tc.desic acesharpTextEtsTest0001
+ */
+ it('testsharpText0001', 0, async function (done){
+ console.info('sharpText testsharpText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('SharpText')
+ console.info("[testSharpText0001] component sharpText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testsharpText0001] width value :" + obj.$attrs.width);
+ console.info("[testsharpText0001] height value :" + obj.$attrs.height);
+ console.info("[testsharpText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testrhythmText0001
+ * @tc.desic acerhythmTextEtsTest0001
+ */
+ it('testrhythmText0001', 0, async function (done){
+ console.info('rhythmText testrhythmText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('RhythmText');
+ console.info("[testrhythmText0001] component rhythmText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testrhythmText0001] width value :" + obj.$attrs.width);
+ console.info("[testrhythmText0001] height value :" + obj.$attrs.height);
+ console.info("[testrhythmText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testsmoothText0001
+ * @tc.desic acesmoothTextEtsTest0001
+ */
+ it('testsmoothText0001', 0, async function (done){
+ console.info('smoothText testsmoothText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('SmoothText');
+ console.info("[testsmoothText0001] component smoothText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testsmoothText0001] width value :" + obj.$attrs.width);
+ console.info("[testsmoothText0001] height value :" + obj.$attrs.height);
+ console.info("[testsmoothText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testfrictionText0001
+ * @tc.desic acefrictionTextEtsTest0001
+ */
+ it('testfrictionText0001', 0, async function (done){
+ console.info('frictionText testfrictionText0001 START');
+ await Utils.sleep(1000);
+ let strJson = getInspectorByKey('FrictionText');
+ console.info("[testfrictionText0001] component frictionText strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Button');
+ expect(obj.$attrs.width).assertEqual("400.00vp");
+ expect(obj.$attrs.height).assertEqual("200.00vp");
+ expect(obj.$attrs.backgroundColor).assertEqual("#FF317AFF");
+ expect(obj.$attrs.animation).assertEqual(undefined);
+ console.info("[testfrictionText0001] width value :" + obj.$attrs.width);
+ console.info("[testfrictionText0001] height value :" + obj.$attrs.height);
+ console.info("[testfrictionText0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/datePicker.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/datePicker.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c9590348458738454ac8b6f2a050db998bc97019
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/datePicker.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function datePickerLunarJsunit() {
+ describe('datePickerLunarTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/datePicker',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get datePicker state success " + JSON.stringify(pages));
+ if (!("datePicker" == pages.name)) {
+ console.info("get datePicker state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push datePicker page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push datePicker page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("datePickerLunar after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name testdatePickerLunar001
+ * @tc.desic acedatePickerLunarEtsTest001
+ */
+ it('testdatePickerLunar001', 0, async function (done) {
+ console.info('datePickerLunar testdatePickerLunar001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('DatePicker');
+ console.info("[testdatePickerLunar001] component lunar strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('DatePicker');
+ expect(obj.$attrs.lunar).assertEqual("true");
+ console.info("[testdatePickerLunar001] lunar value :" + obj.$attrs.lunar);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/enums.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/enums.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..daf073cbe404c4a91de46129d1dd7321934e8fb5
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/enums.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function enumsCancelJsunit() {
+ describe('enumsCancelTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/enums',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get enums state success " + JSON.stringify(pages));
+ if (!("enums" == pages.name)) {
+ console.info("get enums state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push enums page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push enums page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("enumsCancel after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testenumsCancel0001
+ * @tc.desic aceenumsCancelEtsTest0001
+ */
+ it('testenumsCancel0001', 0, async function (done) {
+ console.info('enumsCancel testenumsCancel0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('HighlightText');
+ console.info("[testenumsCancel0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.hoverEffect).assertEqual("HoverEffect.Highlight");
+ console.info("[testenumsCancel0001] hoverEffect value :" + obj.$attrs.hoverEffect);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/fill_mode.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/fill_mode.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c2985a5ce30a1079d35a7c71c8b47e76b1da37b8
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/fill_mode.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function fillModeForwardJsunit() {
+ describe('fillModeForwardTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/fill_mode',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get fill_mode state success " + JSON.stringify(pages));
+ if (!("fill_mode" == pages.name)) {
+ console.info("get fill_mode state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push fill_mode page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push fill_mode page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("fillModeForward after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testfillModeForward0001
+ * @tc.desic acefillModeForwardEtsTest0001
+ */
+ it('testfillModeForward0001', 0, async function (done) {
+ console.info('fillModeForward testfillModeForward0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ImageAnimator');
+ console.info("[testfillModeForward0001] component fillMode strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ImageAnimator');
+ expect(obj.$attrs.fillMode).assertEqual("FillMode.Forwards");
+ console.info("[testfillModeForward0001] fillMode value :" + obj.$attrs.fillMode);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gesture.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gesture.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..5cc59adc00f72447ca340430514ba9e8261c5733
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gesture.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function gestureParallelJsunit() {
+ describe('gestureParallelTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/gesture',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get gesture state success " + JSON.stringify(pages));
+ if (!("gesture" == pages.name)) {
+ console.info("get gesture state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push gesture page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push gesture page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("gestureParallel after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testgestureParallel0001
+ * @tc.desic acegestureParallelEtsTest0001
+ */
+ it('testgestureParallel0001', 0, async function (done) {
+ console.info('gestureParallel testgestureParallel0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ParallelText');
+ console.info("[testgestureParallel0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual("320.00vp");
+ console.info("[testgestureParallel0001] width value :" + obj.$attrs.width);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridCol.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridCol.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..a63d57bea0867ba5315c2854502de291f43a3eb8
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridCol.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function gridColXlJsunit() {
+ describe('gridColXlTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/gridCol',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get gridCol state success " + JSON.stringify(pages));
+ if (!("gridCol" == pages.name)) {
+ console.info("get gridCol state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push gridCol page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push gridCol page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("gridColXl after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testgridColXl0001
+ * @tc.desic acegridColXlEtsTest0001
+ */
+ it('testgridColXl0001', 0, async function (done) {
+ console.info('gridColXl testgridColXl0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('GridCol');
+ console.info("[testgridColXl0001] component order strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('GridCol');
+ expect(obj.$attrs.order).assertEqual("{xl: 10}");
+ console.info("[testgridColXl0001] order value :" + obj.$attrs.order);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testgridColXl0002
+ * @tc.desic acegridColXlEtsTest0002
+ */
+ it('testgridColXl0002', 0, async function (done) {
+ console.info('gridColXl testgridColXl0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('GridCol');
+ console.info("[testgridColXl0002] component backgroundColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Color.Green');
+ expect(obj.$attrs.backgroundColor).assertEqual("Color.Green");
+ console.info("[testgridColXl0002] backgroundColor value :" + obj.$attrs.backgroundColor);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridRow.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridRow.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e330facb710d599a6ea91ade48fc93839a88d92b
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/gridRow.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function gridRowXlJsunit() {
+ describe('gridRowXlTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/gridRow',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get gridRow state success " + JSON.stringify(pages));
+ if (!("gridRow" == pages.name)) {
+ console.info("get gridRow state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push gridRow page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push gridRow page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("gridRowXl after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testgridRowXl0001
+ * @tc.desic acegridRowXlEtsTest0001
+ */
+ it('testgridRowXl0001', 0, async function (done) {
+ console.info('gridRowXl testgridRowXl0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('GridRowColumnOption——xl');
+ console.info("[testgridRowXl0001] component backgroundColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('GridRow');
+ expect(obj.$attrs.backgroundColor).assertEqual("Color.Red");
+ console.info("[testgridRowXl0001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..863bee97f754eff2c079125d49206b49176aa356
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function hitTestModeJsunit() {
+ describe('hitTestModeJsunit', function () {
+ beforeEach(async function (done) {
+ console.info("hitTestMode beforeEach start");
+ let options = {
+ uri: 'pages/hitTestMode',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get hitTestMode state success " + JSON.stringify(pages));
+ if (!("hitTestMode" == pages.name)) {
+ console.info("get hitTestMode state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push hitTestMode page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push hitTestMode page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("hitTestModeTest after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testhitTestMode0002
+ * @tc.desic acehitTestModelEtsTest0002
+ */
+ it('testhitTestMode0002', 0, async function (done) {
+ console.info('hitTestMode testhitTestMode0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Block');
+ console.info("[testhitTestMode0002] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Stack');
+ console.info("[testhitTestMode0002] hitTestBehavior value :" + obj.$attrs.hitTestBehavior);
+// expect(obj.$attrs.hitTestBehavior).assertEqual(undefined);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hoverEffect.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hoverEffect.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7a321fdd96ce308060bc8ee0df322e497b563ec6
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hoverEffect.test.ets
@@ -0,0 +1,83 @@
+//@ts-nocheck
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function hoverEffectJsunit() {
+ describe('hoverEffectTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/hoverEffect',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get hoverEffect state success " + JSON.stringify(pages));
+ if (!("hoverEffect" == pages.name)) {
+ console.info("get hoverEffect state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push hoverEffect page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push hoverEffect page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("hoverEffect after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testhoverEffect0001
+ * @tc.desic acehoverEffectEtsTest0001
+ */
+ it('testhoverEffect0001', 0, async function (done) {
+ console.info('hoverEffect testhoverEffect0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ScaleText');
+ console.info("[testhoverEffect0001] component hoverEffect strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.hoverEffect).assertEqual(undefined);
+ console.info("[testhoverEffect0001] hoverEffect value :" + obj.$attrs.hoverEffect);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testhoverEffect0002
+ * @tc.desic acehoverEffectEtsTest0002
+ */
+ it('testhoverEffect0002', 0, async function (done) {
+ console.info('hoverEffect testhoverEffect0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('HighlightText');
+ console.info("[testhoverEffect0002] component hoverEffect strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.hoverEffect).assertEqual(undefined);
+ console.info("[testhoverEffect0002] hoverEffect value :" + obj.$attrs.hoverEffect);
+ done();
+ });
+ })
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..1acde951290c8ccca89fe9ab153ea649d72b4c4f
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
+import router from '@system.router';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function list_item_groupJsunit() {
+ describe('list_item_groupJsunit', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/list_item_group',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get list_item_group state success " + JSON.stringify(pages));
+ if (!("list_item" == pages.name)) {
+ console.info("get list_item_group state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push list_item_group page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push list_item_group page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("list_item_group after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testlist_itemOnSelect0001
+ * @tc.desic acelist_itemOnSelectEtsTest0001
+ */
+ it('testlist_item_group0001', 0, async function (done) {
+ console.info('testcase testlist_item_group0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Mon');
+ console.info("[testlist_item_group0001] component state strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ListItemGroup');
+ console.info("[testlist_item_group0001] editable value :" + obj.$type);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testlist_itemOnSelect0002
+ * @tc.desic acelist_itemOnSelectEtsTest0002
+ */
+ it('testlist_item_group0002', 0, async function (done) {
+ console.info('testcase testlist_item_group0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Tues');
+ console.info("[testlist_item_group0002] component border strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ListItemGroup');
+ console.info("[testlist_item_group0002] selectable value :" + obj.$type);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testlist_itemOnSelect0003
+ * @tc.desic acelist_itemOnSelectEtsTest0002
+ */
+ it('testlist_item_group0003', 0, async function (done) {
+ console.info('testcase testlist_item_group0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Wens');
+ console.info("[testlist_item_group0003] component border strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ListItemGroup');
+ expect(obj.$attrs.header).assertNotEqual(undefined);
+ console.info("[testlist_itemOnSelect0003] hear value :" + obj.$attrs.header);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testlist_itemSwipeAction0004
+ * @tc.desic acelist_itemSwipeActionEtsTest0004
+ */
+ it('testlist_item_group0004', 0, async function (done) {
+ console.info('testcase testlist_item_group0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('Thurs');
+ console.info("[testlist_item_group0004] component border strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('ListItemGroup');
+ expect(obj.$attrs.rooter).assertNotEqual(undefined);
+ console.info("[testlist_item_group0004] hear value :" + obj.$attrs.rooter);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/listtest.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/listtest.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..adad4c0d01e48288ac5142c0964985e8086411c3
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/listtest.test.ets
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function listtestIdleJsunit() {
+ describe('listtestIdleTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/listtest',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get listtest state success " + JSON.stringify(pages));
+ if (!("listtest" == pages.name)) {
+ console.info("get listtestI state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push listtest page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push listtest page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("listtestIdle after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testlisttestIdle0001
+ * @tc.desic acelisttestIdleEtsTest0001
+ */
+ it('testlisttestIdle0001', 0, async function (done) {
+ console.info('listtestIdle testlisttestIdle0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('ScrollList');
+ console.info("[testlisttestIdle0001] component controlButton strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('List');
+ expect(obj.$attrs.editMode).assertEqual("true");
+ console.info("[testlisttestIdle0001] editMode value :" + obj.$attrs.editMode);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/loadingProgress.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/loadingProgress.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..cea401c98a70c43152148d0689481df78ec69a16
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/loadingProgress.test.ets
@@ -0,0 +1,90 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function loadingProgressCircularJsunit() {
+ describe('loadingProgressCircularTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/loadingProgress',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get loadingProgress state success " + JSON.stringify(pages));
+ if (!("loadingProgress" == pages.name)) {
+ console.info("get loadingProgress state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push loadingProgress page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push loadingProgress page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("loadingProgressCircular after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testloadingProgressCircular0011
+ * @tc.desic aceloadingProgressCircularEtsTest0011
+ */
+ it('testloadingProgressCircular0011', 0, async function (done) {
+ console.info('loadingProgressCircular testloadingProgressCircular0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('CircularText');
+ console.info("[testloadingProgressCircular0011] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.color).assertEqual(undefined);
+ expect(obj.$attrs.width).assertEqual('100.00vp');
+ expect(obj.$attrs.margin).assertEqual('0.00px');
+ console.info("[testloadingProgressCircular0011] color value :" + obj.$attrs.color);
+ console.info("[testloadingProgressCircular0011] width value :" + obj.$attrs.width);
+ console.info("[testloadingProgressCircular0011] margin value :" + obj.$attrs.margin);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testloadingProgressCircular0001
+ * @tc.desic aceloadingProgressCircularEtsTest0011
+ */
+ it('testloadingProgressOrbital0001', 0, async function (done) {
+ console.info('loadingProgressOrbital testloadingProgressCircular0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('OrbitalText');
+ console.info("[testloadingProgressOrbital0001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.color).assertEqual(undefined);
+ expect(obj.$attrs.width).assertEqual('100.00vp');
+ expect(obj.$attrs.margin).assertEqual('0.00px');
+ console.info("[testloadingProgressOrbital0001] color value :" + obj.$attrs.color);
+ console.info("[testloadingProgressOrbital0001] width value :" + obj.$attrs.width);
+ console.info("[testloadingProgressOrbital0001] margin value :" + obj.$attrs.margin);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/pluginComponent.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/pluginComponent.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7ab1af3997cd58b6e0fbe8149ca896883f49b7c8
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/pluginComponent.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function pluginComponentKVObjectJsunit() {
+ describe('pluginComponentKVObjectTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/pluginComponent',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get pluginComponent state success " + JSON.stringify(pages));
+ if (!("pluginComponent" == pages.name)) {
+ console.info("get pluginComponent state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push pluginComponent page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push pluginComponent page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("pluginComponentKVObject after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testpluginComponentKVObject0001
+ * @tc.desic acepluginComponentKVObjectEtsTest0001
+ */
+ it('testpluginComponentKVObject0001', 0, async function (done) {
+ console.info('pluginComponentKVObject testpluginComponentKVObject0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('pluginComponent');
+ console.info("[testpluginComponentKVObject0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('PluginComponent');
+ expect(obj.$attrs.size.width).assertEqual('500.00vp');
+ console.info("[testpluginComponentKVObject0001] size.width value :" + obj.$attrs.size.width);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/progress.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/progress.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ed59e82d59b948d11600f1dec9eedefd735a1f59
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/progress.test.ets
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function progressScaleCountJsunit() {
+ describe('progressScaleCountTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/progress',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get progress state success " + JSON.stringify(pages));
+ if (!("progress" == pages.name)) {
+ console.info("get progress state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push progress page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push progress page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("progressScaleCount after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testprogressScaleCount0001
+ * @tc.desic aceprogressScaleCountEtsTest0001
+ */
+ it('testprogressScaleCount0001', 0, async function (done) {
+ console.info('progressScaleCount testprogressScaleCount0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('progressStyleOptions');
+ console.info("[testprogressScaleCount0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.style.scaleCount).assertEqual("15");
+ console.info("[testprogressScaleCount0001] style.scaleCount value :" + obj.$attrs.style.scaleCount);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testprogressScaleCount0002
+ * @tc.desic aceprogressScaleCountEtsTest0002
+ */
+ it('testprogressScaleCount0002', 0, async function (done) {
+ console.info('progressScaleCount testprogressScaleCount0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('progressStyleOptions');
+ console.info("[testprogressScaleCount0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Progress');
+ expect(obj.$attrs.style.scaleWidth).assertEqual('5.00vp');
+ console.info("[testprogressScaleCount0002] style.scaleWidth value :" + obj.$attrs.style.scaleWidth);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/radio.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/radio.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..9413f4ab7156af3ee4ed00a15a840e91e860e907
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/radio.test.ets
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function radioGroupJsunit() {
+ describe('radioGroupTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/radio',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get radio state success " + JSON.stringify(pages));
+ if (!("radio" == pages.name)) {
+ console.info("get radio state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push radio page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push radio page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("radioGroup after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name testradioGroup001
+ * @tc.desic aceradioGroupEtsTest001
+ */
+ it('testradioGroup001', 0, async function (done) {
+ console.info('radioGroup testradioGroup001 START');
+ await Utils.sleep(2000);
+ try {
+ console.info("testradioGroup_0011 click result is: " + JSON.stringify(sendEventByKey('RadioTwo', 10, "")));
+ let strJson = getInspectorByKey('RadioOne');
+ console.info("[testradioGroup001] component checked strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Radio');
+ expect(obj.$attrs.checked).assertEqual("true");
+ console.info("[testradioGroup001] checked value :" + obj.$attrs.checked);
+ } catch (err) {
+ console.info("testradioGroup_0011 on click err : " + JSON.stringify(err));
+ }
+ console.info('testradioGroup001 END');
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/refresh.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/refresh.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..d8eeefd2e654496d3d55e3ad517df0eae3ac7dc1
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/refresh.test.ets
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function refreshDragJsunit() {
+ describe('refreshDragTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/refresh',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get refresh state success " + JSON.stringify(pages));
+ if (!("refresh" == pages.name)) {
+ console.info("get refresh state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push refresh page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push refresh page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("refreshDrag after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testrefreshDrag0011
+ * @tc.desic acerefreshDragEtsTest0011
+ */
+ it('testrefreshDrag0011', 0, async function (done) {
+ console.info('refreshDrag testrefreshDrag0011 START');
+ await Utils.sleep(2000);
+ try {
+ var event = {
+ eventId: 60304,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testrefreshDrag0011 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual(true);
+ done();
+ }
+ console.info("testrefreshDrag0011 click result is: " + JSON.stringify(sendEventByKey('Refresh', 10, "")));
+ events_emitter.on(event, callback);
+ } catch (err) {
+ console.info("testrefreshDrag0011 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testrefreshDrag0011 END');
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0012
+ * @tc.name testrefreshRefresh0001
+ * @tc.desic acerefreshRefreshEtsTest0001
+ */
+ it('testrefreshRefresh0001', 0, async function (done) {
+ console.info('refreshDrag testrefreshRefresh0001 START');
+ await Utils.sleep(2000);
+ try {
+ var eventTwo = {
+ eventId: 60305,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callbackTwo = (eventData) => {
+ console.info("testrefreshRefresh0001 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual(true);
+ done();
+ }
+ console.info("testrefreshRefresh0001 click result is: " + JSON.stringify(sendEventByKey('Refresh', 10, "")));
+ events_emitter.on(eventTwo, callbackTwo);
+ } catch (err) {
+ console.info("testrefreshRefresh0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testrefreshRefresh0001 END');
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..748eb758e41ba810942a19cfedde51247741a76f
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets
@@ -0,0 +1,201 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function remoteWindowJsunit() {
+ describe('remoteWindowTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/remoteWindow',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get remoteWindow state success " + JSON.stringify(pages));
+ if (!("remoteWindow" == pages.name)) {
+ console.info("get RemoteWindow state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push remoteWindow page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push remoteWindow page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("remoteWindow after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testremoteWindow0001
+ * @tc.desic acesremoteWindowEtsTest0001
+ */
+ it('testRemoteWindow0001', 0, async function (done) {
+ console.info('remoteWindow testRemoteWindow0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0001] component width strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.width).assertEqual('100.00vp');
+ console.info("[testRemoteWindow0001] width value :" + obj.$attrs.width);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testRemoteWindow0002
+ * @tc.desic aceRemoteWindowEtsTest0002
+ */
+ it('testRemoteWindow0002', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0002] component height strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.height).assertEqual('70.00vp');
+ console.info("[testRemoteWindow0002] height value :" + obj.$attrs.height);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testRemoteWindow0003
+ * @tc.desic aceRemoteWindowEtsTest0003
+ */
+ it('testRemoteWindow0003', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0003] component fontSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontSize).assertEqual('20.00fp');
+ console.info("[testRemoteWindow0003] fontSize value :" + obj.$attrs.fontSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0004
+ * @tc.name testRemoteWindow0004
+ * @tc.desic aceRemoteWindowEtsTest0004
+ */
+ it('testRemoteWindow0004', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow0004 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0004] component opacity strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.opacity).assertEqual(1);
+ console.info("[testRemoteWindow0004] opacity value :" + obj.$attrs.opacity);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0005
+ * @tc.name testRemoteWindow0005
+ * @tc.desic aceRemoteWindowEtsTest0005
+ */
+ it('testRemoteWindow0005', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow0005 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0005] component align strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.align).assertEqual('Alignment.TopStart');
+ console.info("[testRemoteWindow0005] align value :" + obj.$attrs.align);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0006
+ * @tc.name testRemoteWindow0006
+ * @tc.desic aceRemoteWindowEtsTest0006
+ */
+ it('testRemoteWindow0006', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow0006 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0006] component fontColor strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.fontColor).assertEqual('#FFCCCCCC');
+ console.info("[testRemoteWindow0006] fontColor value :" + obj.$attrs.fontColor);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0007
+ * @tc.name testRemoteWindow0007
+ * @tc.desic aceRemoteWindowEtsTest0007
+ */
+ it('testRemoteWindow0007', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow0007 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0007] component lineHeight strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.lineHeight).assertEqual('25.00fp');
+ console.info("[testRemoteWindow0007] lineHeight value :" + obj.$attrs.lineHeight);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0009
+ * @tc.name testRemoteWindow0009
+ * @tc.desic aceRemoteWindowEtsTest0009
+ */
+ it('testRemoteWindow0009', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow009 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0009] component padding strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.padding).assertEqual('10.00vp');
+ console.info("[testRemoteWindow0009] padding value :" + obj.$attrs.padding);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0010
+ * @tc.name testRemoteWindow0010
+ * @tc.desic aceRemoteWindowEtsTest0010
+ */
+ it('testRemoteWindow0010', 0, async function (done) {
+ console.info('RemoteWindow testRemoteWindow0010 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText');
+ console.info("[testRemoteWindow0010] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.textAlign).assertEqual('TextAlign.Left');
+ console.info("[testRemoteWindow0010] textAlign value :" + obj.$attrs.textAlign);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/responseType.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/responseType.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2722356a164cbc6591c499b29261365eeee29431
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/responseType.test.ets
@@ -0,0 +1,83 @@
+//@ts-nocheck
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function responseTypeJsunit() {
+ describe('responseTypeTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/responseType',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get responseType state success " + JSON.stringify(pages));
+ if (!("responseType" == pages.name)) {
+ console.info("get responseType state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push responseType page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push responseType page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("responseType after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testresponseType0002
+ * @tc.desic acehoverEffectEtsTest0002
+ */
+ it('testresponseType0002', 0, async function (done) {
+ console.info('responseType testresponseType0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('RightClickText');
+ console.info("[testresponseType0002] component bindContextMenu strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.bindContextMenu).assertEqual("ResponseType.LongPress");
+ console.info("[testresponseType0002] bindContextMenu value :" + obj.$attrs.bindContextMenu);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testhoverEffect0003
+ * @tc.desic acehoverEffectEtsTest0003
+ */
+ it('testresponseType0003', 0, async function (done) {
+ console.info('responseType testresponseType0003 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('LongPressText');
+ console.info("[testresponseType0003] component bindContextMenu strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.bindContextMenu).assertEqual("ResponseType.LongPress");
+ console.info("[testresponseType0003] bindContextMenu value :" + obj.$attrs.bindContextMenu);
+ done();
+ });
+ })
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/router.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/router.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..955c82893abf8a7072b068da078a61accbc309fa
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/router.test.ets
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function routerStandardJsunit() {
+ describe('routerStandardTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/router',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get router state success " + JSON.stringify(pages));
+ if (!("router" == pages.name)) {
+ console.info("get router state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push router page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push router page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("routerStandard after each called");
+ });
+
+ it('testrouterStandard0011', 0, async function (done) {
+ console.info('routerStandard testrouterStandard0011 START');
+ await Utils.sleep(2000);
+ try {
+ var standardEvent = {
+ eventId: 101,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("testrouterStandard_0011 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.ArrayData).assertEqual("45");
+ done();
+ }
+ console.info("testrouterStandard_0011 click result1 is: " + JSON.stringify(sendEventByKey('StandardText', 10, "")));
+ await Utils.sleep(2000);
+ console.info("testrouterStandard_0011 click result2 is: " + JSON.stringify(sendEventByKey('DataText', 10, "")));
+ events_emitter.on(standardEvent, callback1);
+ } catch (err) {
+ console.info("testrouterStandard_0011 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testrouterStandard0011 END');
+ });
+
+ it('testrouterSingle0001', 0, async function (done) {
+ console.info('routerSingle testrouterSingle0001 START');
+ await Utils.sleep(2000);
+ try {
+ var singleEvent = {
+ eventId: 102,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback2 = (eventData) => {
+ console.info("testrouterSingle_0001 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.ArrayData).assertEqual("46");
+ done();
+ }
+ console.info("testrouterSingle_0001 click result1 is: " + JSON.stringify(sendEventByKey('SingleText', 10, "")));
+ await Utils.sleep(2000);
+ console.info("testrouterSingle_0001 click result2 is: " + JSON.stringify(sendEventByKey('SingleDataText', 10, "")));
+ events_emitter.on(singleEvent, callback2);
+ } catch (err) {
+ console.info("testrouterSingle_0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testrouterSingle_0001 END');
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..af1ae76fc8e34ebcdeb80ad79788b7da232a83fd
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/scrollEdge.test.ets
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import events_emitter from '@ohos.events.emitter';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function ScrollExampleJsunit() {
+ describe('ScrollExampleTest', function () {
+ beforeAll(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/scroll_edge',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get scroll_edge state success " + JSON.stringify(pages));
+ if (!("ScrollExample" == pages.name)) {
+ console.info("get scroll_edge state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push scroll_edge page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push scroll_edge page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("ScrollExample after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testscrollEdgeMiddle0001
+ * @tc.desic acescrollEdgeMiddleEtsTest0001
+ */
+ it('testscrollEdgeMiddle0001', 0, async function (done) {
+ console.info('scrollEdgeMiddle testscrollEdgeMiddle0001 START');
+
+ await Utils.sleep(2000);
+ try {
+ var innerEventOne = {
+ eventId: 60306,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback1 = (eventData) => {
+ console.info("testscrollEdgeMiddle0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.STATUS).assertEqual(true);
+ done();
+ }
+ console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('MiddleText', 10, "")));
+ events_emitter.on(innerEventOne, callback1);
+ } catch (err) {
+ console.info("testscrollEdgeMiddle0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testscrollEdgeMiddle0001 END');
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/sidebar.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/sidebar.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..ec91cfaa0fee9c4c337877753f9d038411407b49
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/sidebar.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function sidebarIconsJsunit() {
+ describe('sidebarIconsTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/sidebar',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get sidebar state success " + JSON.stringify(pages));
+ if (!("sidebarIcons" == pages.name)) {
+ console.info("get sidebar state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push sidebar page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push sidebar page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("sidebarIcons after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0011
+ * @tc.name testsidebarIcons0011
+ * @tc.desic acesidebarIconsEtsTest0011
+ */
+ it('testsidebarIcons0011', 0, async function (done) {
+ console.info('sidebarIcons testsidebarIcons0011 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('SideBarContainer');
+ console.info("[testsidebarIcons0011] component controlButton strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('SideBarContainer');
+ expect(obj.$attrs.controlButton.icons).assertEqual(undefined);
+ console.info("[testsidebarIcons0011] controlButton value :" + obj.$attrs.controlButton);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/slider.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/slider.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..4fc8e17b0ed3f2931133ea1981e175019869fe23
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/slider.test.ets
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function sliderMovingJsunit() {
+ describe('sliderMovingTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/slider',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get slider state success " + JSON.stringify(pages));
+ if (!("sliderMoving" == pages.name)) {
+ console.info("get slider state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push slider page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push slider page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("sliderMoving after each called");
+ });
+
+ it('testsliderMoving0011', 0, async function (done) {
+ console.info('sliderMoving testsliderMoving0011 START');
+ await Utils.sleep(2000);
+ try {
+ var event = {
+ eventId: 60307,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testsliderMoving0011 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.Mode).assertEqual(false);
+ done();
+ }
+ console.info("testsliderMoving0011 click result is: " + JSON.stringify(sendEventByKey('Slider', 10, "")));
+ events_emitter.on(event, callback);
+ } catch (err) {
+ console.info("testsliderMoving0011 on events_emitter err : " + JSON.stringify(err));
+ }
+ console.info('testsliderMoving0011 END');
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stateManagement.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stateManagement.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..3da471d3e8c5c608698e4c08f1223453e273629a
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stateManagement.test.ets
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function stateManagementDARKJsunit() {
+ describe('stateManagementDARKTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/stateManagement',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get stateManagement state success " + JSON.stringify(pages));
+ if (!("stateManagement" == pages.name)) {
+ console.info("get stateManagement state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push stateManagement page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push stateManagement page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("stateManagementDARK after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name teststateManagementDARK001
+ * @tc.desic acestateManagementDARKEtsTest001
+ */
+ it('teststateManagementDARK001', 0, async function (done) {
+ console.info('stateManagementDARK teststateManagementDARK001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('DARKText');
+ console.info("[teststateManagementDARK001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.backgroundColor).assertEqual('#FF000001');
+ console.info("[teststateManagementDARK001] backgroundColor value :" + obj.$attrs.backgroundColor);
+ done();
+ });
+
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stepperItem.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stepperItem.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..806c0a2a25a5efddc88fde3eef843553585151ca
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/stepperItem.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function stepperItemDisabledJsunit() {
+ describe('stepperItemDisabledTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/stepperItem',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get stepperItem state success " + JSON.stringify(pages));
+ if (!("stepperItem" == pages.name)) {
+ console.info("get stepperItem state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push stepperItem page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push stepperItem page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("stepperItemDisabled after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name teststepperItemDisabled0001
+ * @tc.desic acestepperItemDisabledEtsTest0001
+ */
+ it('teststepperItemDisabled0001', 0, async function (done) {
+ console.info('stepperItemDisabled teststepperItemDisabled0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('StepperItem');
+ console.info("[teststepperItemDisabled0001] component status strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('StepperItem');
+ expect(obj.$attrs.status).assertEqual("ItemState.Disabled");
+ console.info("[teststepperItemDisabled0001] status value :" + obj.$attrs.status);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..8e1e908a5f4b3944f46d29c1e711824bd3a07910
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function swiperMaskJsunit() {
+ describe('swiperMaskTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/swiper',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get swiper state success " + JSON.stringify(pages));
+ if (!("swiper" == pages.name)) {
+ console.info("get swiper state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push swiper page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push swiper page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("swiperMask after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_001
+ * @tc.name testswiperMask001
+ * @tc.desic aceswiperMaskEtsTest001
+ */
+ it('testswiperMask001', 0, async function (done) {
+ console.info('swiperMask testswiperMask001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('maskSwiper');
+ console.info("[testswiperMask001] component textAlign strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Swiper');
+ expect(obj.$attrs.indicatorStyle.mask).assertEqual(undefined);
+ console.info("[testswiperMask001] indicatorStyle value :" + obj.$attrs.indicatorStyle.mask);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..78f6960769179cd2dfc27eef02627e0b749b1bb2
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function text_inputPhoneNumberJsunit() {
+ describe('text_inputPhoneNumberTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/text_input',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get text_input state success " + JSON.stringify(pages));
+ if (!("text_input" == pages.name)) {
+ console.info("get text_input state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push text_input page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push text_input page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("text_inputPhoneNumber after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testtext_inputPhoneNumber0001
+ * @tc.desic acetext_inputPhoneNumberEtsTest0001
+ */
+ it('testtext_inputPhoneNumber0001', 0, async function (done) {
+ console.info('text_inputPhoneNumber testtext_inputPhoneNumber0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('PhoneNumberText');
+ console.info("[testtext_inputPhoneNumber0001] component type strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.type).assertEqual('InputType.Normal');
+ console.info("[testtext_inputPhoneNumber0001] type value :" + obj.$attrs.type);
+ done();
+ });
+
+ it('testtextInputStyle0001', 0, async function (done) {
+ console.info('textInputStyle testtextInputStyle0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('textInput1');
+ console.info("[testtextInputStyle0001] strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.style).assertEqual('TextInputStyle.Default');
+ console.info("[testtextInputStyle0001] textInput1 InputStyle value :" + obj.$attrs.style);
+ done();
+ });
+
+ it('testtextInputStyle0002', 0, async function (done) {
+ console.info('textInputStyle testtextInputStyle0002 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('textInput2');
+ console.info("[testtextInputStyle0002] strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('TextInput');
+ expect(obj.$attrs.style).assertEqual('TextInputStyle.Inline');
+ console.info("[testtextInputStyle0002] textInput2 inputStyle value :" + obj.$attrs.style);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/uiAppearance.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/uiAppearance.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..444381d884a26b17041eb07164ff2845a2198602
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/uiAppearance.test.ets
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function uiAppearanceALWAYS_DARKJsunit() {
+ describe('uiAppearanceALWAYS_DARKTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/uiAppearance',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get uiAppearance state success " + JSON.stringify(pages));
+ if (!("uiAppearance" == pages.name)) {
+ console.info("get uiAppearance state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push uiAppearance page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push uiAppearance page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("uiAppearanceALWAYS_DARK after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testuiAppearanceALWAYS_DARK0001
+ * @tc.desic aceuiAppearanceALWAYS_DARKEtsTest0001
+ */
+ it('testuiAppearanceALWAYS_DARK0001', 0, async function (done) {
+ console.info('uiAppearanceALWAYS_DARK testuiAppearanceALWAYS_DARK0001 START');
+ await Utils.sleep(2000);
+ try {
+ var event = {
+ eventId: 60308,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testuiAppearanceALWAYS_DARK0001 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.Mode).assertEqual(0);
+ console.info('testuiAppearanceALWAYS_DARK0001 END');
+ done();
+ }
+ console.info("testuiAppearanceALWAYS_DARK0001 click result is: " + JSON.stringify(sendEventByKey('ALWAYS_DARKText', 10, "")));
+ events_emitter.on(event, callback);
+ } catch (err) {
+ console.info("testuiAppearanceALWAYS_DARK0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testuiAppearanceALWAYS_LIGHT0001
+ * @tc.desic aceuiAppearanceALWAYS_LIGHTEtsTest0001
+ */
+ it('testuiAppearanceALWAYS_LIGHT0001', 0, async function (done) {
+ console.info('uiAppearanceALWAYS_LIGHT testuiAppearanceALWAYS_LIGHT0001 START');
+ await Utils.sleep(2000);
+ try {
+ var event = {
+ eventId: 60309,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testuiAppearanceALWAYS_LIGHT0001 get event data is: " + JSON.stringify(eventData));
+ expect(eventData.data.Mode).assertEqual(1);
+ console.info('testuiAppearanceALWAYS_LIGHT0001 END');
+ done();
+ }
+ console.info("testuiAppearanceALWAYS_LIGHT0001 click result is: " + JSON.stringify(sendEventByKey('ALWAYS_LIGHTText', 10, "")));
+ events_emitter.on(event, callback);
+ } catch (err) {
+ console.info("testuiAppearanceALWAYS_LIGHT0001 on events_emitter err : " + JSON.stringify(err));
+ }
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/units.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/units.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c0520d73d0a4ae089cd2c10385bf5856442b84c6
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/units.test.ets
@@ -0,0 +1,137 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+import events_emitter from '@ohos.events.emitter';
+
+export default function unitsModuleNameJsunit() {
+ describe('unitsModuleNameTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/units',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get units state success " + JSON.stringify(pages));
+ if (!("units" == pages.name)) {
+ console.info("get units state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push units page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push units page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("unitsModuleName after each called");
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0001
+ * @tc.name testunitsModuleName0001
+ * @tc.desic aceunitsModuleNameEtsTest0001
+ */
+ it('testunitsModuleName0001', 0, async function (done) {
+ console.info('unitsModuleName testunitsModuleName0001 START');
+ await Utils.sleep(2000);
+ try {
+ console.info("testunitsModuleName0001 click result is: " + JSON.stringify(sendEventByKey('moduleNameText', 10, "")));
+ var innerEvent = {
+ eventId: 60310,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testunitsModuleName0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.ModuleName).assertEqual(true);
+ }
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("testunitsModuleName0001 on click err : " + JSON.stringify(err));
+ }
+ console.info('testunitsModuleName0001 END');
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testunitsGlobalPosition0001
+ * @tc.desic aceunitsGlobalPositionEtsTest0001
+ */
+ it('testunitsGlobalPosition0001', 0, async function (done) {
+ console.info('unitsModuleName testunitsGlobalPosition0001 START');
+ await Utils.sleep(2000);
+ try {
+ console.info("testunitsGlobalPosition0001 click result is: " + JSON.stringify(sendEventByKey('globalPositionText', 10, "")));
+ var innerEvent = {
+ eventId: 60311,
+ priority: events_emitter.EventPriority.LOW
+ }
+ var callback = (eventData) => {
+ console.info("testunitsGlobalPosition0001 get event state result is: " + JSON.stringify(eventData));
+ expect(eventData.data.Result).assertEqual(true);
+ }
+ events_emitter.on(innerEvent, callback);
+ } catch (err) {
+ console.info("testunitsGlobalPosition0001 on click err : " + JSON.stringify(err));
+ }
+ console.info('testunitsGlobalPosition0001 END');
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0003
+ * @tc.name testunitsMinWidth0001
+ * @tc.desic aceunitsMinWidthEtsTest0001
+ */
+ it('testunitsMinWidth0001', 0, async function (done) {
+ console.info('unitsModuleName testunitsMinWidth0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minWidthText');
+ console.info("[testunitsMinWidth0001] component constraintSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ expect(obj.$attrs.constraintSize).assertEqual('{"minWidth":"200.00vp","minHeight":"0.00vp","maxWidth":"119846208990821053862485980936868943386622755140025217957449185986963312195176500631099345318391471397553524277795258607297703698567960268420438325781003880454605934667138922450849236563878474354509650486846713237047577973081895276546573889957650195146049445629577007136228474373133005395361920118602782998528.00vp","maxHeight":"0.00vp"}');
+ console.info("[testunitsMinWidth0001] constraintSize value :" + obj.$attrs.constraintSize);
+ done();
+ });
+
+ /*
+ * @tc.number SUB_ACE_BASIC_ETS_API_0002
+ * @tc.name testunitsMinWidth0002
+ * @tc.desic aceunitsMinWidthEtsTest0002
+ */
+ it('testunitsMinWidth0002', 0, async function (done) {
+ console.info('unitsModuleName testunitsMinWidth0001 START');
+ await Utils.sleep(2000);
+ let strJson = getInspectorByKey('minWidthText');
+ console.info("[testunitsMinWidth0002] component constraintSize strJson:" + strJson);
+ let obj = JSON.parse(strJson);
+ expect(obj.$type).assertEqual('Text');
+ let constraintSize = JSON.parse(obj.$attrs.constraintSize);
+ console.info("[testunitsMinWidth0002] constraintSize is : " + constraintSize);
+ expect(obj.$attrs.constraintSize.minWidth).assertEqual(undefined);
+ console.info("[testunitsMinWidth0002] constraintSize value :" + obj.$attrs.constraintSize);
+ done();
+ });
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/web.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/web.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..7c0517d018842420ec1b59b2ef0b0935e153519e
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/web.test.ets
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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';
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
+import Utils from './Utils.ets'
+
+export default function webEditTextJsunit() {
+ describe('webEditTextTest', function () {
+ beforeEach(async function (done) {
+ console.info("flex beforeEach start");
+ let options = {
+ uri: 'pages/web',
+ }
+ try {
+ router.clear();
+ let pages = router.getState();
+ console.info("get web state success " + JSON.stringify(pages));
+ if (!("web" == pages.name)) {
+ console.info("get web state success " + JSON.stringify(pages.name));
+ let result = await router.push(options);
+ await Utils.sleep(2000);
+ console.info("push web page success " + JSON.stringify(result));
+ }
+ } catch (err) {
+ console.error("push web page error: " + err);
+ }
+ done()
+ });
+
+ afterEach(async function () {
+ await Utils.sleep(1000);
+ console.info("webEditText after each called");
+ });
+
+ })
+}
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/color.json b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/color.json
new file mode 100644
index 0000000000000000000000000000000000000000..68f8331ba0fbe3404fe8ab5ede5ecb98a0a76d80
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/color.json
@@ -0,0 +1,12 @@
+{
+ "color": [
+ {
+ "name": "color_hello",
+ "value": "#ffff0000"
+ },
+ {
+ "name": "color_world",
+ "value": "#ff0000ff"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/float.json b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/float.json
new file mode 100644
index 0000000000000000000000000000000000000000..f26020ff03a653a81ecc6fa8fdef0d9a3b067f96
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/float.json
@@ -0,0 +1,12 @@
+{
+ "float":[
+ {
+ "name":"font_hello",
+ "value":"28.0fp"
+ },
+ {
+ "name":"font_world",
+ "value":"20.0fp"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/string.json b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..fa13b27d700b87e261e43fda028695c25d7a25ec
--- /dev/null
+++ b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,36 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "entry_MainAbility"
+ },
+ {
+ "name": "MainAbility_label",
+ "value": "MainAbility_label"
+ },
+ {
+ "name": "description_mainability",
+ "value": "ETS_Empty Ability"
+ },
+ {
+ "name": "TestAbility_desc",
+ "value": "description"
+ },
+ {
+ "name": "TestAbility_label",
+ "value": "label"
+ },
+ {
+ "name":"string_hello",
+ "value":"Hello"
+ },
+ {
+ "name":"string_world",
+ "value":"World"
+ },
+ {
+ "name":"message_arrive",
+ "value":"We will arrive at %s."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/media/icon.png b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/arkui/ace_ets_component_attrlack/entry/src/main/resources/base/media/icon.png differ
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/bg3.png b/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/bg3.png
new file mode 100644
index 0000000000000000000000000000000000000000..70224e6e8d74391b43b0fc9911900b5cbbeaabb5
Binary files /dev/null and b/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/bg3.png differ
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/bg4.png b/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/bg4.png
new file mode 100644
index 0000000000000000000000000000000000000000..f7f11a8f4f8296e2532f5a37bafd0d2f39bd2c17
Binary files /dev/null and b/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/bg4.png differ
diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/test.png b/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/test.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/arkui/ace_ets_component_attrlack/entry/src/main/resources/rawfile/test.png differ
diff --git a/settingsdata/settings_ets/signature/openharmony_sx.p7b b/arkui/ace_ets_component_attrlack/signature/openharmony_sx.p7b
similarity index 100%
rename from settingsdata/settings_ets/signature/openharmony_sx.p7b
rename to arkui/ace_ets_component_attrlack/signature/openharmony_sx.p7b
diff --git a/arkui/ace_ets_component_five/entry/src/main/config.json b/arkui/ace_ets_component_five/entry/src/main/config.json
index 14d932c725c6b3aebd760a6827bd68ff4ba79e7c..3954da961d1b1e4c7abfbf7041957d4edbf06fbf 100644
--- a/arkui/ace_ets_component_five/entry/src/main/config.json
+++ b/arkui/ace_ets_component_five/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": "com.open.harmony.acetestfive.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_component_four/entry/src/main/config.json b/arkui/ace_ets_component_four/entry/src/main/config.json
index ac28b43af5a27e5bcb2431bd9f0c7ac4831ce144..28af5ff4ba0e3a953ab2dacecc91006ec1bc386b 100644
--- a/arkui/ace_ets_component_four/entry/src/main/config.json
+++ b/arkui/ace_ets_component_four/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": "com.open.harmony.acetestfour.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_component_three/entry/src/main/config.json b/arkui/ace_ets_component_three/entry/src/main/config.json
index cf734e2e6d4bcf57a891de23af0d67db9c8eef96..14b317c2764790c676c1b57a5ae7b714836898a5 100644
--- a/arkui/ace_ets_component_three/entry/src/main/config.json
+++ b/arkui/ace_ets_component_three/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": "com.open.harmony.acetestthree.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/PanGesture.ets b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/PanGesture.ets
index fd9cf5e7a0c01c6497d814b02ec10b320101babf..9b90447d108899dbbdbab09bc2fa401f7ed669ab 100644
--- a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/PanGesture.ets
+++ b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/PanGesture.ets
@@ -22,15 +22,6 @@ struct PanGestureExample {
@State offsetY: number = 0
@State touchable: boolean = true;
@State isTouched: boolean = false;
-
- onPageShow() {
- let ChangeEvent = {
- eventId: 23,
- priority: events_emitter.EventPriority.LOW
- }
- events_emitter.on(ChangeEvent, this.ChangCallBack)
- }
-
private ChangCallBack = (eventData) => {
console.info("[PanGesture] ChangCallBack stateChangCallBack");
if (eventData != null) {
@@ -41,6 +32,14 @@ struct PanGestureExample {
}
}
+ onPageShow() {
+ var ChangeEvent = {
+ eventId: 23,
+ priority: events_emitter.EventPriority.LOW
+ }
+ events_emitter.on(ChangeEvent, this.ChangCallBack)
+ }
+
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Text('PanGesture offset:\nX: ' + this.offsetX + '\n' + 'Y: ' + this.offsetY)
@@ -54,8 +53,8 @@ struct PanGestureExample {
.translate({ x: this.offsetX, y: this.offsetY, z: 5 })
.touchable(this.touchable)
.gesture(
- PanGesture({ fingers: 1, direction: PanDirection.All, distance: 1 })
- .onActionStart((event: PanGestureEvent) => {
+ PanGesture({ fingers: 1, direction: PanDirection.All, distance: 1 })
+ .onActionStart((event: GestureEvent) => {
console.info('Pan start')
console.log('PanGesture globalX' + event.globalX);
console.log('PanGesture globalY' + event.globalY);
@@ -67,14 +66,15 @@ struct PanGestureExample {
console.log('PanGesture pinchCenterX' + event.pinchCenterX);
console.log('PanGesture pinchCenterY' + event.pinchCenterY);
})
- .onActionUpdate((event: PanGestureEvent) => {
+ .onActionUpdate((event: GestureEvent) => {
this.offsetX = event.offsetX
this.offsetY = event.offsetY
})
.onActionEnd(() => {
console.info('Pan end')
})
- .onTouch((event: TouchEvent) => {
+ )
+ .onTouch((event: TouchEvent) => {
console.log('[PanGesture] TouchType start');
this.isTouched = true
if (event.type === TouchType.Down) {
@@ -104,7 +104,5 @@ struct PanGestureExample {
console.info("[PanGesture] emit action state err: " + JSON.stringify(err.message))
}
})
- )
}
-}
-
+}
\ No newline at end of file
diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets b/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets
index 336dd90934bb6c4bd085995c2aa9d6a49eee956e..ef88dc7c4993bffcfeef60bcf2160aeb08871c32 100644
--- a/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets
+++ b/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets
@@ -157,7 +157,7 @@ export default function qrCodeJsunit() {
var strJson = getInspectorByKey('QrCodeColor');
var obj = JSON.parse(strJson);
console.info("[test_qrCode_005] component obj is: " + JSON.stringify(obj));
- expect(obj.$attrs.color).assertEqual('#0000014C');
+ expect(obj.$attrs.color).assertEqual('#FF00014C');
done();
});
@@ -209,7 +209,7 @@ export default function qrCodeJsunit() {
var strJson = getInspectorByKey('QrCodeColor');
var obj = JSON.parse(strJson);
console.info("[test_qrCode_007] component obj is: " + JSON.stringify(obj));
- expect(obj.$attrs.backgroundColor).assertEqual('#0000014D');
+ expect(obj.$attrs.backgroundColor).assertEqual('#FF00014D');
done();
});
})
diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets b/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets
index 3cf16855f857a0583b765e21ca70e6b25d4d5452..e14423e4dbc3e0979f53a327d88f092fd5e4c3c8 100644
--- a/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets
+++ b/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets
@@ -270,7 +270,7 @@ export default function textJsunit() {
let strJsonNew = getInspectorByKey('text');
let objNew = JSON.parse(strJsonNew);
console.info("testText_1200 component objNew is: " + JSON.stringify(objNew.$attrs.fontColor));
- expect(objNew.$attrs.fontColor).assertEqual('#00BC0229');
+ expect(objNew.$attrs.fontColor).assertEqual('#FFBC0229');
console.info('testText_1200 END');
done();
});
diff --git a/arkui/ace_ets_component_two/entry/src/main/config.json b/arkui/ace_ets_component_two/entry/src/main/config.json
index 8ea5ff43f45814bedba5243eec89260924a348f0..869c8c29a405a3ef23574cff781fb41b2ccf93b9 100644
--- a/arkui/ace_ets_component_two/entry/src/main/config.json
+++ b/arkui/ace_ets_component_two/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": "com.open.harmony.acetesttwo.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_dev/entry/src/main/config.json b/arkui/ace_ets_dev/entry/src/main/config.json
index d565956d1832f48419686c631cc0cfe304a05c6d..21582c4258229f6528e2fc09dab8a696093d7a3e 100644
--- a/arkui/ace_ets_dev/entry/src/main/config.json
+++ b/arkui/ace_ets_dev/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": "com.open.harmony.acedevtest.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_standard/entry/src/main/config.json b/arkui/ace_ets_standard/entry/src/main/config.json
index 72ae2b9d5578fefc3e009d0269f64f20f459c680..260a7a4b87d4aa222d48b55662a6ff5e3d3b19af 100644
--- a/arkui/ace_ets_standard/entry/src/main/config.json
+++ b/arkui/ace_ets_standard/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets b/arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets
index e77b544588c45f1fe989c7915c7c26c231b8dddb..ec1cf29ecf99a626ef5d9cc4fd53d9f7ff7123d0 100644
--- a/arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets
+++ b/arkui/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets
@@ -46,8 +46,8 @@ struct slider {
.blockColor('#FFFF0000')
.selectedColor('#FF0000FF')
.trackColor('#FF808080')
- .minLabel('10')
- .maxLabel('10')
+ .minLabel('0')
+ .maxLabel('100')
.showTips(false)
.showSteps(false)
.onChange((value: number, mode: SliderChangeMode) => {
diff --git a/arkui/ace_ets_test/entry/src/main/config.json b/arkui/ace_ets_test/entry/src/main/config.json
index 7e3aea13e6404d8a8a1cb615145ae6affd4558fe..469f7bd2e705e8a276d78b32af3fa383e6afbb5b 100644
--- a/arkui/ace_ets_test/entry/src/main/config.json
+++ b/arkui/ace_ets_test/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_third_test/entry/src/main/config.json b/arkui/ace_ets_third_test/entry/src/main/config.json
index 9a996c6d9ccae55fdfe77ff5dd3f6fbedadbbec1..d9d11fe20cfa8d9df8058d3ee19615a7f5fd7ea0 100644
--- a/arkui/ace_ets_third_test/entry/src/main/config.json
+++ b/arkui/ace_ets_third_test/entry/src/main/config.json
@@ -19,6 +19,7 @@
"mainAbility": ".MainAbility",
"srcPath": "",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_webView/entry/src/main/config.json b/arkui/ace_ets_webView/entry/src/main/config.json
index 12de22e4640f4384c34a0d9232ad44cb115c1422..6ea45d4d29984b702420d2fe5f6a6e2af4e662b5 100644
--- a/arkui/ace_ets_webView/entry/src/main/config.json
+++ b/arkui/ace_ets_webView/entry/src/main/config.json
@@ -18,6 +18,7 @@
"name": ".MyApplication",
"mainAbility": "com.open.harmony.webview.MainAbility",
"deviceType": [
+ "default",
"phone"
],
"distro": {
diff --git a/arkui/ace_ets_web_dev/Test.json b/arkui/ace_ets_web_dev/Test.json
index 5fbc03fba6a37e051a5413c50ad272d495d96ef7..9d98d84a5c0e57a6d257a72714dc6f42683a970e 100644
--- a/arkui/ace_ets_web_dev/Test.json
+++ b/arkui/ace_ets_web_dev/Test.json
@@ -14,5 +14,13 @@
],
"type": "AppInstallKit",
"cleanup-apps": true
- }]
+ },
+ {
+ "type": "ShellKit",
+ "run-command": [
+ "power-shell wakeup",
+ "power-shell setmode 602"
+ ]
+ }
+ ]
}
\ No newline at end of file
diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
index 2aaab4a36b71117b15abffc0e209840d4695325f..b8b08f00fbfe8a816817bd329030efb54253b39d 100644
--- a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
+++ b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
@@ -27,6 +27,34 @@ struct Index {
@State loadedResource:string=""
@State progress:string=""
@State newUrl:string=""
+ @State pageBegin:string=""
+ @State pageEnd:string=""
+ @State console:string=""
+ @State confirm:string=""
+ @State alert:string=""
+ @State errorReceive:string=""
+ @State httpErrorReceive:number=0
+ @State titleReceive:string=""
+ @State downloadStart:string=""
+ @State javaScriptAccess:boolean=true
+ @State fileAccess:boolean=true
+ @State domStorageAccess:boolean=false
+ @State imageAccess:boolean=true
+ @State geolocationAccess:boolean=true
+ @State onlineImageAccess:boolean=true
+ @State databaseAccess:boolean=true
+ @State overviewModeAccess:boolean=false
+ @State initialScale:number=100
+ @State enterPageEnd:boolean=false
+ @State newScale:number=0
+ @State scaleChange:boolean=false
+ @State geoShow:boolean=false
+ @State mixedMode:MixedMode=MixedMode.All
+ @State cacheMode:CacheMode=CacheMode.Default
+ @State cacheError:boolean=false
+ @State mixedSwitch:boolean=false
+ @State mixedAllSwitch:boolean=false
+ @State overViewFalseHeight:number=0
onPageShow(){
let valueChangeEvent={
eventId:10,
@@ -49,6 +77,10 @@ struct Index {
},
toString:(str)=>{
console.info("ets toString:"+String(str));
+ },
+ register:(res)=>{
+ Utils.emitEvent(res,86);
+ return "web222"
}
}
aboutToAppear(){
@@ -62,6 +94,17 @@ struct Index {
build(){
Column(){
Web({src:$rawfile('index.html'),controller:this.controller})
+ .javaScriptAccess(this.javaScriptAccess)
+ .fileAccess(this.fileAccess)
+ .imageAccess(this.imageAccess)
+ .domStorageAccess(this.domStorageAccess)
+ .geolocationAccess(this.geolocationAccess)
+ .onlineImageAccess(this.onlineImageAccess)
+ .databaseAccess(this.databaseAccess)
+ .cacheMode(this.cacheMode)
+ .initialScale(this.initialScale)
+ .mixedMode(this.mixedMode)
+ .overviewModeAccess(this.overviewModeAccess)
.userAgent("Mozila/5.0 (Linux; Andriod 9; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.4.1 MobileSafari/537.36")
.javaScriptProxy({
object:this.jsObj,
@@ -93,8 +136,100 @@ struct Index {
.onFocus(()=>{
Utils.emitEvent("requestFocus",126)
})
+ .onPageBegin((event) => {
+ this.pageBegin = event.url
+ })
+ .onPageEnd((event) => {
+ this.pageEnd = event.url
+ console.log("onPageEnd==>")
+ if(this.enterPageEnd){
+ Utils.emitEvent(this.newScale,97)
+ this.enterPageEnd=false
+ }
+ })
+ .onConsole((event) => {
+ this.console = event.message.getMessage()
+ let level=event.message.getMessageLevel()
+ let msg=event.message.getMessage()
+ console.log("html==>"+msg)
+ if(this.mixedSwitch){
+ Utils.emitEvent(msg,186)
+ this.mixedSwitch=false
+ }else if(this.mixedAllSwitch){
+ Utils.emitEvent(level,188)
+ this.mixedAllSwitch=false
+ }
+ return false
+ })
+ .onAlert((event) => {
+ this.alert = event.message
+ return false
+ })
+ .onConfirm((event) => {
+ this.confirm = event.message
+ return false
+ })
+ .onErrorReceive((event) => {
+ this.errorReceive = event.request.getRequestUrl()
+ console.log("onErrorReceive==>")
+ if(this.cacheError){
+ Utils.emitEvent("cacheError",182)
+ this.cacheError=false
+ }
+ })
+ .onHttpErrorReceive((event) => {
+ this.httpErrorReceive = event.response.getResponseCode()
+ })
+ .onTitleReceive((event) => {
+ this.titleReceive = event.title
+ })
+ .onDownloadStart((event) => {
+ this.downloadStart = event.url
+ })
+ .onScaleChange((event)=>{
+ console.log("onScaleChange==>")
+ this.newScale=event.newScale
+ if(this.scaleChange){
+ Utils.emitEvent("onScaleChange",98)
+ this.scaleChange=false
+ }
+ })
+ .onPrompt((event)=>{
+ event.result.handlePromptConfirm("onPrompt ok")
+ Utils.emitEvent(event.message,178)
+ return true
+ })
+ .onGeolocationShow(()=>{
+ console.log("onGeolocationShow==>")
+ if(this.geoShow){
+ Utils.emitEvent("onGeolocationShow",99)
+ this.geoShow=false
+ }
+ })
+ .onBlur(()=>{
+ console.info("onBlur==>")
+ this.controller.requestFocus()
+ })
+ TextInput({placeholder:"inputs your words"})
+ .key('textInput')
+ .type(InputType.Normal)
+ .placeholderColor(Color.Blue)
+ .placeholderFont({size:20,weight:FontWeight.Normal,family:"sans-serif",style:FontStyle.Normal})
+ .enterKeyType(EnterKeyType.Next)
+ .caretColor(Color.Green)
+ .height(60)
+ .fontSize(30)
+ .fontWeight(FontWeight.Bold)
+ .fontFamily("cursive")
+ .fontStyle(FontStyle.Italic)
+ .fontColor(Color.Red)
+ .maxLength(20)
+ .border({width:1,color:0x317AF7,radius:10,style:BorderStyle.Solid})
+ .onClick(()=>{
+ console.info("TextInput click")
+ })
Row(){
- Button("web click").key('webcomponent').onClick(()=>{
+ Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str)
switch(this.str){
case "emitUserAgent":{
@@ -179,7 +314,7 @@ struct Index {
let webPageHeight=this.controller.getPageHeight()+""
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
- console.info("getPageHeight==>"+res)
+ console.info("getPageHeight==>"+res)
Utils.emitEventTwo(res,webPageHeight,124)
}})
},3000)
@@ -187,7 +322,8 @@ struct Index {
}
case "emitGetRequestFocus":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"})
- this.controller.requestFocus()
+ await Utils.sleep(2000)
+ sendEventByKey('textInput',10,'')
break;
}
case "emitAccessBackward":{
@@ -229,6 +365,404 @@ struct Index {
},3000)
break;
}
+ case "emitGeolocationAccessFalse":{
+ this.geolocationAccess=false
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/geo.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getGeoResult()",callback:(res)=>{
+ console.info("getGeoResult==>"+res)
+ Utils.emitEvent(res,96)
+ }})
+ },3000)
+ break;
+ }
+ case "emitInitialScale":{
+ this.initialScale=120
+ await Utils.sleep(1000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"})
+ this.enterPageEnd=true
+ break;
+ }
+ case "emitOnscaleChange":{
+ this.initialScale=110
+ this.scaleChange=true
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"https://gitee.com/"})
+ break;
+ }
+ case "emitOnGeolocationShow":{
+ this.geolocationAccess=true
+ this.geoShow=true
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/geo.html"})
+ break;
+ }
+ case "emitDomStorageAccessFalse":{
+ this.domStorageAccess=false
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/domApi.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getDomResult()",callback:(res)=>{
+ console.info("getDomResult==>"+res)
+ Utils.emitEvent(res,144)
+ }})
+ },3000)
+ break;
+ }
+ case "emitDomStorageAccessTrue":{
+ this.domStorageAccess=true
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/domApi.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getDomResult()",callback:(res)=>{
+ console.info("getDomResult==>"+res)
+ Utils.emitEvent(res,146)
+ }})
+ },3000)
+ break;
+ }
+ case "emitImageAccessFalse":{
+ this.imageAccess=false
+ await Utils.sleep(1000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getImgResult()",callback:(res)=>{
+ console.info("getImgResult==>"+res)
+ Utils.emitEvent(res,148)
+ }})
+ },3000)
+ break;
+ }
+ case "emitImageAccessTrue":{
+ this.imageAccess=true
+ await Utils.sleep(1000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getImgResult()",callback:(res)=>{
+ console.info("getImgResult==>"+res)
+ Utils.emitEvent(res,150)
+ }})
+ },3000)
+ break;
+ }
+ case "emitOnlineImageAccessFalse":{
+ this.onlineImageAccess=false
+ await Utils.sleep(1000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/onlineImageAccess.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getImageLoadResult()",callback:(res)=>{
+ console.info("getImageLoadResult==>"+res)
+ Utils.emitEvent(res,156)
+ }})
+ },3000)
+ break;
+ }
+ case "emitOnlineImageAccessTrue":{
+ this.onlineImageAccess=true
+ await Utils.sleep(1000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/onlineImageAccess.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getImageLoadResult()",callback:(res)=>{
+ console.info("getImageLoadResult==>"+res)
+ Utils.emitEvent(res,158)
+ }})
+ },3000)
+ break;
+ }
+ case "emitDatabaseAccessTrue":{
+ this.databaseAccess=true
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/databaseAccess.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getDataResult()",callback:(res)=>{
+ console.info("getDataResult==>"+res)
+ Utils.emitEvent(res,164)
+ }})
+ },3000)
+ break;
+ }
+ case "emitOverviewModeAccessFalse":{
+ this.overviewModeAccess=false
+ await Utils.sleep(1000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/overview.html"})
+ setTimeout(()=>{
+ let webPageHeight=this.controller.getPageHeight()
+ this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
+ this.overViewFalseHeight=parseInt(res)
+ console.info("getViewResult==>"+res)
+ Utils.emitEventTwo(webPageHeight,res,168)
+ }})
+ },3000)
+ break;
+ }
+ case "emitOverviewModeAccessTrue":{
+ this.overviewModeAccess=true
+ await Utils.sleep(1000)
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/overview.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
+ console.info("getViewResult==>"+res)
+ Utils.emitEventTwo(this.overViewFalseHeight,parseInt(res),170)
+ }})
+ },3000)
+ break;
+ }
+ case "emitOnPrompt":{
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"toPrompt()"})
+ },3000)
+ break;
+ }
+ case "emitCacheModeOnly":{
+ this.cacheError=true
+ this.cacheMode=CacheMode.Only
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"https://www.openharmony.cn/mainPlay"})
+ break;
+ }
+ case "emitCacheModeDefault":{
+ this.cacheMode=CacheMode.Default
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"https://www.openharmony.cn/mainPlay"})
+ setTimeout(()=>{
+ let webTitle=this.controller.getTitle()
+ Utils.emitEvent(webTitle,184)
+ },3000)
+ break;
+ }
+ case "emitMixedModeNone":{
+ this.mixedSwitch=true
+ this.mixedMode=MixedMode.None
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"https://www.openharmony.cn/mainPlay"})
+ break;
+ }
+ case "emitMixedModeAll":{
+ this.mixedAllSwitch=true
+ this.mixedMode=MixedMode.All
+ await Utils.sleep(2000)
+ this.controller.loadUrl({url:"https://www.openharmony.cn/mainPlay"})
+ break;
+ }
+ case "emitFileAccessTrue":{
+ this.fileAccess=true
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
+ this.controller.runJavaScript({script:"openRawFile()"})
+ setTimeout(()=>{
+ let webTitle=this.controller.getTitle()
+ Utils.emitEvent(webTitle,190)
+ },3000)
+ break;
+ }
+ case "emitOnPageBegin":{
+ Utils.emitEvent(this.pageBegin,59)
+ break;
+ }
+ case "emitOnPageEnd":{
+ Utils.emitEvent(this.pageBegin,60)
+ break;
+ }
+ case "emitOnConsole":{
+ this.controller.runJavaScript({script:"consoleTest()"})
+ setTimeout(()=>{
+ Utils.emitEvent(this.console,62)
+ },3000)
+ break;
+ }
+ case "emitOnAlert":{
+ this.controller.runJavaScript({script:"alertTest()"})
+ setTimeout(()=>{
+ Utils.emitEvent(this.alert,63)
+ },3000)
+ break;
+ }
+ case "emitOnConfirm":{
+ this.controller.runJavaScript({script:"confirmTest()"})
+ setTimeout(()=>{
+ Utils.emitEvent(this.confirm,64)
+ },3000)
+ break;
+ }
+ case "emitOnErrorReceive":{
+ this.controller.loadUrl({url:'http://192.168.5.40:9006/sso_web/html/H5/doctor/aboutUs.html'})
+ setTimeout(()=>{
+ this.controller.loadUrl({url:'http://192.168.5.40:9006/sso_web/html/H5/doctor/aboutUs.html'})
+ setTimeout(() => {
+ Utils.emitEvent(this.errorReceive,65)
+ },3000)
+ },3000)
+ break;
+ }
+ case "emitOnHttpErrorReceive":{
+ this.controller.loadUrl({url:'https://example1.com/path/does/not/exist/index.jsp'})
+ setTimeout(()=>{
+ this.controller.loadUrl({url:'https://example1.com/path/does/not/exist/index.jsp'})
+ setTimeout(()=>{
+ Utils.emitEvent(this.httpErrorReceive,66)
+ },3000)
+ },3000)
+ break;
+ }
+ case "emitOnTitleReceive":{
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
+ setTimeout(()=>{
+ Utils.emitEvent(this.titleReceive,67)
+ },3000)
+ break;
+ }
+ case "emitOnDownloadStart":{
+ this.controller.loadUrl({url:"https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe"})
+ setTimeout(()=>{
+ Utils.emitEvent(this.downloadStart,68)
+ },5000)
+ break;
+ }
+ case "emitSetCookie":{
+ this.controller.getCookieManager().setCookie('http://www.baidu.com','e=f')
+ setTimeout(()=>{
+ let setCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
+ Utils.emitEvent(setCookieCalled,76)
+ },3000)
+ break;
+ }
+ case "emitGetCookie":{
+ this.controller.getCookieManager().setCookie('https://www.bilibili.com/','e=f')
+ setTimeout(()=>{
+ let getCookieCalled = this.controller.getCookieManager().getCookie('https://www.bilibili.com/')
+ Utils.emitEvent(getCookieCalled,69)
+ },3000)
+ break;
+ }
+ case "emitZoom":{
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
+ setTimeout(()=>{
+ this.controller.zoom(2)
+ setTimeout(() => {
+ if(this.controller.getPageHeight() > 1400){
+ var zoomCalled = true
+ }
+ Utils.emitEvent(zoomCalled,77)
+ },3000)
+ },5000)
+ break;
+ }
+ case "emitZoomOut":{
+ this.controller.zoomOut()
+ setTimeout(()=>{
+ if(this.controller.getPageHeight() < 1500){
+ var zoomOutCalled = true
+ }
+ Utils.emitEvent(zoomOutCalled,78)
+ },3000)
+ break;
+ }
+ case "emitZoomIn":{
+ this.controller.zoomIn()
+ setTimeout(()=>{
+ var zoomInCalled = false
+ if(this.controller.getPageHeight() > 1400){
+ zoomInCalled = true
+ }
+ Utils.emitEvent(zoomInCalled,79)
+ },3000)
+ break;
+ }
+ case "emitDeleteEntireCookie":{
+ this.controller.getCookieManager().deleteEntireCookie()
+ setTimeout(()=>{
+ let deleteEntireCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
+ Utils.emitEvent(deleteEntireCookieCalled,80)
+ },3000)
+ break;
+ }
+ case "emitSaveCookieSync":{
+ let saveCookieSyncCalled = this.controller.getCookieManager().saveCookieSync()
+ Utils.emitEvent(saveCookieSyncCalled,81)
+ break;
+ }
+ case "emitClearHistory":{
+ this.controller.loadUrl({url:"http://www.baidu.com/"})
+ setTimeout(()=>{
+ this.controller.clearHistory()
+ setTimeout(() => {
+ let clearHistoryCalled = this.controller.accessBackward()
+ Utils.emitEvent(clearHistoryCalled,82)
+ },5000)
+ },10000)
+ break;
+ }
+ case "emitStop":{
+ this.controller.loadUrl({url:"http://appgallery.huawei.com/"})
+ this.controller.stop()
+ setTimeout(()=>{
+ var stopCalled = false
+ if(this.pageEnd !== 'http://appgallery.huawei.com/'){
+ stopCalled = true
+ }
+ Utils.emitEvent(stopCalled,83)
+ },3000)
+ break;
+ }
+ case "emitOnInactive":{
+ this.controller.onInactive()
+ this.controller.zoomOut()
+ setTimeout(()=>{
+ var onInactiveCalled = false
+ if(this.controller.getPageHeight() < 2600){
+ onInactiveCalled = true
+ }
+ Utils.emitEvent(onInactiveCalled,84)
+ },3000)
+ break;
+ }
+ case "emitOnActive":{
+ this.controller.onActive()
+ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
+ setTimeout(()=>{
+ let onActiveCalled = this.pageBegin
+ Utils.emitEvent(onActiveCalled,85)
+ },5000)
+ break;
+ }
+ case "emitRegisterJavaScriptProxy":{
+ this.controller.registerJavaScriptProxy({object:this.jsObj,name:"objName",methodList:["test","toString","register"]})
+ this.controller.refresh()
+ setTimeout(()=>{
+ this.controller.runJavaScript({script:"proxy()"})
+ },3000)
+ break;
+ }
+ case "emitDeleteJavaScriptRegister":{
+ this.controller.deleteJavaScriptRegister("objName")
+ this.controller.runJavaScript({script:"registerTest()"})
+ setTimeout(()=>{
+ if(this.console !== "web222"){
+ let deleteEntireCookieCalled = true
+ Utils.emitEvent(deleteEntireCookieCalled,87)
+ }
+ },3000)
+ break;
+ }
+ case "emitJavaScriptAccess":{
+ this.javaScriptAccess = false
+ setTimeout(() => {
+ this.controller.runJavaScript({script:"jsAccess()"})
+ setTimeout(()=>{
+ if(this.console !== "web111"){
+ let javaScriptAccessCalled = true
+ Utils.emitEvent(javaScriptAccessCalled,88)
+ }
+ },3000)
+ },3000)
+ break;
+ }
+ case "emitGetCookieManager":{
+ let getCookieManagerCalled = this.controller.getCookieManager().setCookie("https://weibo.com","a=b")
+ Utils.emitEvent(getCookieManagerCalled,89)
+ break;
+ }
default:
console.info("can not match case")
}
diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets
index a53550f58088aa1d9b042b4595c06d7c7c1531a4..d8e0944a8887fe72e3e02cc31b9750c7d24feeda 100644
--- a/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets
+++ b/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets
@@ -115,4 +115,39 @@ export default class Utils {
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
+ static commitKey(emitKey){
+ try {
+ let backData = {
+ data: {
+ "ACTION": emitKey
+ }
+ }
+ let backEvent = {
+ eventId:10,
+ priority:events_emitter.EventPriority.LOW
+ }
+ console.info("start send emitKey");
+ events_emitter.emit(backEvent, backData);
+ } catch (err) {
+ console.info("emit emitKey err: " + JSON.stringify(err));
+ }
+ }
+ static registerLargerEvent(testCaseName,eventId,done){
+ console.info(`[${testCaseName}] START`);
+ try{
+ let callBack=(backData)=>{
+ console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
+ expect(backData.data.actualValue).assertLarger(backData.data.expectedValue);
+ console.info(`[${testCaseName}] END`);
+ done()
+ }
+ let innerEvent = {
+ eventId:eventId,
+ priority:events_emitter.EventPriority.LOW
+ }
+ events_emitter.on(innerEvent,callBack)
+ }catch(err){
+ console.info(`[${testCaseName}] err:`+JSON.stringify(err));
+ }
+ }
}
diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
index 9aba47efef75a44e17f7f8cdc6a2850ef47bc821..17ca26638ef2e8332d438c6591de32427ffd6082 100644
--- a/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
+++ b/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
@@ -79,6 +79,7 @@ export default function webJsunit() {
*tc.desic Triggered when the render process exits
*/
it('onRenderExited',0,async function(done){
+ Utils.commitKey("emitOnRenderExited")
emitKey="emitOnResourceLoad";
Utils.registerEvent("onRenderExited",2,106,done);
sendEventByKey('webcomponent',10,'');
@@ -237,9 +238,439 @@ export default function webJsunit() {
*tc.desic Goes forward or back backOrForward in the history of the web page
*/
it('backOrForward',0,async function(done){
- emitKey="emitBackOrForward";
+ emitKey="emitGeolocationAccessFalse";
Utils.registerEvent("backOrForward","index",138,done);
sendEventByKey('webcomponent',10,'');
})
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_021
+ *tc.name geolocationAccessFalse
+ *tc.desic Sets false not allow access to geographical locations
+ */
+ it('geolocationAccessFalse',0,async function(done){
+ emitKey="emitInitialScale";
+ Utils.registerContainEvent("geolocationAccessFalse","位置服务被拒绝",96,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_022
+ *tc.name initialScale
+ *tc.desic Sets the initial scale for the Web
+ */
+ it('initialScale',0,async function(done){
+ emitKey="emitOnscaleChange";
+ Utils.registerEvent("initialScale",120,97,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_023
+ *tc.name onScaleChange
+ *tc.desic Triggered when the scale of WebView changed
+ */
+ it('onScaleChange',0,async function(done){
+ emitKey="emitOnGeolocationShow";
+ Utils.registerContainEvent("onScaleChange","onScaleChange",98,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_024
+ *tc.name onGeolocationShow
+ *tc.desic Triggered when requesting to show the geolocation permission
+ */
+ it('onGeolocationShow',0,async function(done){
+ emitKey="emitDomStorageAccessFalse";
+ Utils.registerContainEvent("onGeolocationShow","onGeolocationShow",99,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_025
+ *tc.name domStorageAccessFalse
+ *tc.desic Sets not to enable the DOM Storage API permission
+ */
+ it('domStorageAccessFalse',0,async function(done){
+ emitKey="emitDomStorageAccessTrue";
+ Utils.registerContainEvent("domStorageAccessFalse","sorry",144,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_026
+ *tc.name domStorageAccessTrue
+ *tc.desic Sets enable the DOM Storage API permission
+ */
+ it('domStorageAccessTrue',0,async function(done){
+ emitKey="emitImageAccessFalse";
+ Utils.registerContainEvent("domStorageAccessTrue","domapi",146,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_027
+ *tc.name imageAccessFalse
+ *tc.desic Sets Web can not automatically load image resources
+ */
+ it('imageAccessFalse',0,async function(done){
+ emitKey="emitImageAccessTrue";
+ Utils.registerEvent("imageAccessFalse","null",148,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_028
+ *tc.name imageAccessTrue
+ *tc.desic Sets Web can automatically load image resources
+ */
+ it('imageAccessTrue',0,async function(done){
+ emitKey="emitOnlineImageAccessFalse";
+ Utils.registerContainEvent("imageAccessTrue","load complete",150,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_029
+ *tc.name onlineImageAccessFalse
+ *tc.desic Sets not to allow image resources to be loaded from the network
+ */
+ it('onlineImageAccessFalse',0,async function(done){
+ emitKey="emitOnlineImageAccessTrue";
+ Utils.registerEvent("onlineImageAccessFalse","null",156,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_030
+ *tc.name onlineImageAccessTrue
+ *tc.desic Sets allow image resources to be loaded from the network
+ */
+ it('onlineImageAccessTrue',0,async function(done){
+ emitKey="emitDatabaseAccessTrue";
+ Utils.registerContainEvent("onlineImageAccessTrue","load image complete",158,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_031
+ *tc.name databaseAccessTrue
+ *tc.desic Sets allow the Web access the database
+ */
+ it('databaseAccessTrue',0,async function(done){
+ emitKey="emitOverviewModeAccessFalse";
+ Utils.registerContainEvent("databaseAccessTrue","openDatabase",164,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_032
+ *tc.name overviewModeAccessFalse
+ *tc.desic Sets not allow the Web access overview mode
+ */
+ it('overviewModeAccessFalse',0,async function(done){
+ emitKey="emitOverviewModeAccessTrue";
+ Utils.registerEventTwo("overviewModeAccessFalse",168,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_033
+ *tc.name overviewModeAccessTrue
+ *tc.desic Sets allow the Web access overview mode
+ */
+ it('overviewModeAccessTrue',0,async function(done){
+ emitKey="emitOnPrompt";
+ Utils.registerLargerEvent("overviewModeAccessTrue",170,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_034
+ *tc.name onPrompt
+ *tc.desic Triggered when the web page wants to display a JavaScript prompt() dialog
+ */
+ it('onPrompt',0,async function(done){
+ emitKey="emitCacheModeOnly";
+ Utils.registerEvent("onPrompt","age",178,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_035
+ *tc.name cacheModeOnly
+ *tc.desic load cache and not online
+ */
+ it('cacheModeOnly',0,async function(done){
+ emitKey="emitCacheModeDefault";
+ Utils.registerEvent("cacheModeOnly","cacheError",182,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_036
+ *tc.name cacheModeDefault
+ *tc.desic load cache when they are available and not expired, otherwise load online
+ */
+ it('cacheModeDefault',0,async function(done){
+ emitKey="emitMixedModeNone";
+ Utils.registerContainEvent("cacheModeDefault","OpenHarmony",184,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_037
+ *tc.name mixedModeNone
+ *tc.desic Sets Don't allow unsecure sources from a secure origin
+ */
+ it('mixedModeNone',0,async function(done){
+ emitKey="emitMixedModeAll";
+ Utils.registerContainEvent("mixedModeNone","insecure",186,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_038
+ *tc.name mixedModeAll
+ *tc.desic Sets Allows all HTTP and HTTPS content can be loaded
+ */
+ it('mixedModeAll',0,async function(done){
+ emitKey="emitFileAccessTrue";
+ Utils.registerEvent("mixedModeAll",3,188,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_039
+ *tc.name fileAccessTrue
+ *tc.desic Sets enable local file system access in Web
+ */
+ it('fileAccessTrue',0,async function(done){
+ emitKey="emitOnPageBegin";
+ Utils.registerContainEvent("fileAccessTrue","index",190,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_040
+ *tc.name onPageBegin
+ *tc.desic Triggered when the page loading progress changes
+ */
+ it('onPageBegin',0,async function(done){
+ emitKey="emitOnPageEnd";
+ Utils.registerEvent("onPageBegin","file:///data/storage/el1/bundle/phone/resources/rawfile/index.html",59,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_041
+ *tc.name onPageEnd
+ *tc.desic Triggered at the begin of web page loading
+ */
+ it('onPageEnd',0,async function(done){
+ emitKey="emitOnConsole";
+ Utils.registerEvent("onPageEnd","file:///data/storage/el1/bundle/phone/resources/rawfile/index.html",60,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_042
+ *tc.name onConsole
+ *tc.desic Triggered when the web page receives a JavaScript console message
+ */
+ it('onConsole',0,async function(done){
+ emitKey="emitOnAlert";
+ Utils.registerEvent("onConsole","console test",62,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_043
+ *tc.name onAlert
+ *tc.desic Triggered when the Web wants to display a JavaScript alert() dialog
+ */
+ it('onAlert',0,async function(done){
+ emitKey="emitOnConfirm";
+ Utils.registerEvent("onAlert","alert test",63,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_044
+ *tc.name onConfirm
+ *tc.desic Triggered when the web page wants to display a JavaScript confirm() dialog
+ */
+ it('onConfirm',0,async function(done){
+ emitKey="emitOnErrorReceive";
+ Utils.registerEvent("onConfirm","confirm test",64,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_045
+ *tc.name onErrorReceive
+ *tc.desic Triggered when the web page receives a web resource loading error
+ */
+ it('onErrorReceive',0,async function(done){
+ emitKey="emitOnHttpErrorReceive";
+ Utils.registerEvent("onErrorReceive","http://192.168.5.40:9006/sso_web/html/H5/doctor/aboutUs.html",65,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_046
+ *tc.name onHttpErrorReceive
+ *tc.desic Triggered when the web page receives a web resource loading HTTP error
+ */
+ it('onHttpErrorReceive',0,async function(done){
+ emitKey="emitOnTitleReceive";
+ Utils.registerEvent("onHttpErrorReceive",404,66,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_047
+ *tc.name onTitleReceive
+ *tc.desic Triggered when the title of the main application document changes
+ */
+ it('onTitleReceive',0,async function(done){
+ emitKey="emitOnDownloadStart";
+ Utils.registerEvent("onTitleReceive","index",67,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_048
+ *tc.name onDownloadStart
+ *tc.desic Triggered when starting to download
+ */
+ it('onDownloadStart',0,async function(done){
+ emitKey="emitSetCookie";
+ Utils.registerEvent("onDownloadStart","https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe",68,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_049
+ *tc.name setCookie
+ *tc.desic Sets the cookie
+ */
+ it('setCookie',0,async function(done){
+ emitKey="emitGetCookie";
+ Utils.registerEvent("setCookie","e=f",76,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_050
+ *tc.name getCookie
+ *tc.desic Gets all cookies for the given URL
+ */
+ it('getCookie',0,async function(done){
+ emitKey="emitZoom";
+ Utils.registerEvent("getCookie","e=f",69,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_051
+ *tc.name zoom
+ *tc.desic Let the Web zoom by
+ */
+ it('zoom',0,async function(done){
+ emitKey="emitZoomOut";
+ Utils.registerEvent("zoom",true,77,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_052
+ *tc.name zoomOut
+ *tc.desic Let the Web zoom out
+ */
+ it('zoomOut',0,async function(done){
+ emitKey="emitZoomIn";
+ Utils.registerEvent("zoomOut",true,78,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_053
+ *tc.name zoomIn
+ *tc.desic Let the Web zoom in
+ */
+ it('zoomIn',0,async function(done){
+ emitKey="emitDeleteEntireCookie";
+ Utils.registerEvent("zoomIn",true,79,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_054
+ *tc.name deleteEntireCookie
+ *tc.desic Delete all cookies
+ */
+ it('deleteEntireCookie',0,async function(done){
+ emitKey="emitSaveCookieSync";
+ Utils.registerEvent("deleteEntireCookie","",80,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_055
+ *tc.name saveCookieSync
+ *tc.desic Saves the cookies
+ */
+ it('saveCookieSync',0,async function(done){
+ emitKey="emitClearHistory";
+ Utils.registerEvent("saveCookieSync",true,81,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_056
+ *tc.name clearHistory
+ *tc.desic Clears the history in the Web
+ */
+ it('clearHistory',0,async function(done){
+ emitKey="emitStop";
+ Utils.registerEvent("clearHistory",false,82,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_057
+ *tc.name stop
+ *tc.desic Stops the current load
+ */
+ it('stop',0,async function(done){
+ emitKey="emitOnInactive";
+ Utils.registerEvent("stop",true,83,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_058
+ *tc.name onInactive
+ *tc.desic Let the Web inactive.
+ */
+ it('onInactive',0,async function(done){
+ emitKey="emitOnActive";
+ Utils.registerEvent("onInactive",true,84,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_059
+ *tc.name onActive
+ *tc.desic Let the Web active
+ */
+ it('onActive',0,async function(done){
+ emitKey="emitRegisterJavaScriptProxy";
+ Utils.registerEvent("onActive","file:///data/storage/el1/bundle/phone/resources/rawfile/index.html",85,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_060
+ *tc.name registerJavaScriptProxy
+ *tc.desic Registers the JavaScript object and method list
+ */
+ it('registerJavaScriptProxy',0,async function(done){
+ emitKey="emitDeleteJavaScriptRegister";
+ Utils.registerEvent("registerJavaScriptProxy","backToEts",86,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_061
+ *tc.name deleteJavaScriptRegister
+ *tc.desic Deletes a registered JavaScript object with given name
+ */
+ it('deleteJavaScriptRegister',0,async function(done){
+ emitKey="emitJavaScriptAccess";
+ Utils.registerEvent("deleteJavaScriptRegister",true,87,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_062
+ *tc.name javaScriptAccess
+ *tc.desic Sets whether the Web allows JavaScript scripts to execute
+ */
+ it('javaScriptAccess',0,async function(done){
+ emitKey="emitGetCookieManager";
+ Utils.registerEvent("javaScriptAccess",true,88,done);
+ sendEventByKey('webcomponent',10,'');
+ })
+ /*
+ *tc.number SUB_ACE_BASIC_ETS_API_063
+ *tc.name getCookieManager
+ *tc.desic Gets network cookie manager
+ */
+ it('getCookieManager',0,async function(done){
+ emitKey="emitGetCookieManager";
+ Utils.registerEvent("getCookieManager",true,89,done);
+ sendEventByKey('webcomponent',10,'');
+ })
})
}
diff --git a/arkui/ace_ets_web_dev/entry/src/main/module.json b/arkui/ace_ets_web_dev/entry/src/main/module.json
index 1caeca096d756373af7eff5cea74a02a2c054cd0..dfe56dc90d0e3bb4563f8b8543f9bf7bf553634f 100644
--- a/arkui/ace_ets_web_dev/entry/src/main/module.json
+++ b/arkui/ace_ets_web_dev/entry/src/main/module.json
@@ -6,6 +6,7 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
+ "default",
"phone"
],
"deliveryWithInstall": true,
diff --git a/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/databaseAccess.html b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/databaseAccess.html
new file mode 100644
index 0000000000000000000000000000000000000000..e63a1944656e6a826aed2e69840959bf7bc221dc
--- /dev/null
+++ b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/databaseAccess.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ databaseAccess
+
+
+
+
+
+
\ No newline at end of file
diff --git a/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/domApi.html b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/domApi.html
new file mode 100644
index 0000000000000000000000000000000000000000..e794a087455ef43bb789a8f14ab300d9dbefbb80
--- /dev/null
+++ b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/domApi.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ domApi
+
+
+
+
+
+
\ No newline at end of file
diff --git a/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/geo.html b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/geo.html
new file mode 100644
index 0000000000000000000000000000000000000000..4a2992c3d22223f417ede519cfb351d0722c9854
--- /dev/null
+++ b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/geo.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ 地理位置
+
+
+
+
+
+
\ No newline at end of file
diff --git a/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/icon.png b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..474a55588fd7216113dd42073aadf254d4dba023
Binary files /dev/null and b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/icon.png differ
diff --git a/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html
index ff3ff3e0194aec48d5d2f234386ce882006b181c..bd56a8209695b0732a480ccf0b5ed2eced1ae3ab 100644
--- a/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html
+++ b/arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html
@@ -14,8 +14,15 @@
首页
+ 打开rawfile文件
+