From 143ea1d7b8add277abff34a1ece278feac52d591 Mon Sep 17 00:00:00 2001 From: zhaoyuan17 Date: Tue, 30 Nov 2021 16:51:35 +0000 Subject: [PATCH] Update test code Signed-off-by: zhaoyuan17 --- .../src/main/js/test/ExampleJsunit.test.js | 44 +++++++++++++++++++ .../bmsscenefive/src/main/config.json | 6 ++- .../bmsscenefour/src/main/config.json | 3 +- .../bmssceneone/src/main/config.json | 1 + .../bmsscenethree/src/main/config.json | 9 ++-- .../bmsscenetwo/src/main/config.json | 7 +-- 6 files changed, 60 insertions(+), 10 deletions(-) diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js index 092c60f86..72ae13fe9 100755 --- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js @@ -58,6 +58,23 @@ var BundleFlag = { GET_BUNDLE_WITH_ABILITIES: 1, GET_APPLICATION_INFO_WITH_PERMISSION: 2 }; +var AbilityType = { + UNKNOWN : 0, + PAGE : 1, + SERVICE : 2, + DATA : 3, + FORM : 4, +}; +var DisplayOrientation = { + UNSPECIFIED: 0, + LANDSCAPE: 1, + PORTRAIT: 2, + FOLLOW_RECENT: 3 +}; +var LaunchMode = { + SINGLETON : 0, + STANDARD : 1 +}; describe('ActsBundleManagerTest', function () { @@ -1785,6 +1802,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.label).assertEqual("$string:app_name") expect(datainfo.description).assertEqual("$string:mainability_description") expect(datainfo.icon).assertEqual("$media:icon") + expect(datainfo.type).assertEqual(AbilityType.SERVICE) + expect(datainfo.launchMode).assertEqual(LaunchMode.SINGLETON) + expect(datainfo.orientation).assertEqual(DisplayOrientation.LANDSCAPE) expect(datainfo.moduleName).assertEqual("entry") expect(datainfo.bundleName).assertEqual(NAME2) expect(datainfo.applicationInfo.name).assertEqual(NAME2) @@ -2812,6 +2832,26 @@ describe('ActsBundleManagerTest', function () { }, } }, 0, 0) + var data1 = + await demo.queryAbilityByWant({ + want: { + action: "action.system.home", + entities: ["entity.system.home"], + elementName: { + deviceId: "0", + bundleName: "com.example.myapplication5", + abilityName: "com.example.myapplication.MainAbility", + uri: "", + shortName: "" + }, + } + }, 0, 0) + expect(data1.length).assertLarger(0); + for (let i = 0, len = data1.length; i < len; i++) { + var datainfo = data1[i]; + expect(datainfo.type).assertEqual(AbilityType.DATA) + expect(datainfo.orientation).assertEqual(DisplayOrientation.FOLLOW_RECENT) + } expect(data.length).assertLarger(0); for (let i = 0, len = data.length; i < len; i++) { var datainfo = data[i]; @@ -2821,6 +2861,8 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.icon).assertEqual("$media:icon") expect(datainfo.moduleName).assertEqual("entry") expect(datainfo.bundleName).assertEqual(NAME3) + expect(datainfo.type).assertEqual(AbilityType.PAGE) + expect(datainfo.orientation).assertEqual(DisplayOrientation.PORTRAIT) expect(datainfo.applicationInfo.name).assertEqual(NAME3) expect(datainfo.applicationInfo.description).assertEqual("$string:mainability_description") expect(datainfo.applicationInfo.descriptionId >= 0).assertTrue() @@ -3341,6 +3383,8 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.icon).assertEqual("$media:icon") expect(datainfo.moduleName).assertEqual("entry") expect(datainfo.bundleName).assertEqual(NAME1) + expect(datainfo.launchMode).assertEqual(LaunchMode.STANDARD) + expect(datainfo.orientation).assertEqual(DisplayOrientation.UNSPECIFIED) expect(datainfo.applicationInfo.name).assertEqual(NAME1) expect(datainfo.applicationInfo.description).assertEqual("$string:mainability_description") expect(datainfo.applicationInfo.descriptionId >= 0).assertTrue() diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefive/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefive/src/main/config.json index 1350cbad3..bebeedbed 100644 --- a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefive/src/main/config.json +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefive/src/main/config.json @@ -40,10 +40,12 @@ "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", - "type": "page", + "type": "data", "isVisible": "true", "launchType": "standard", - "language": "C++" + "language": "C++", + "orientation": "followrecent", + "uri":"dataability://" } ], "js": [ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefour/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefour/src/main/config.json index 55305f311..8d1bc3617 100644 --- a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefour/src/main/config.json +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenefour/src/main/config.json @@ -42,8 +42,9 @@ "label": "$string:app_name", "type": "page", "isVisible": "true", + "language": "C++", "launchType": "standard", - "language": "C++" + "orientation": "portrait" } ], "js": [ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json index 4917f8423..20109aaad 100644 --- a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json @@ -43,6 +43,7 @@ "type": "page", "isVisible": "true", "launchType": "standard", + "orientation": "unspecified", "language": "C++", "metaData": { "customizeData": [ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenethree/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenethree/src/main/config.json index d94271367..e6a32fd29 100644 --- a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenethree/src/main/config.json +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenethree/src/main/config.json @@ -36,11 +36,12 @@ "icon": "$media:icon", "name": ".MainAbility", "description": "$string:mainability_description", - "language": "C++", - "isVisible": "true", "label": "$string:app_name", - "type": "page", - "launchType": "standard" + "type": "service", + "isVisible": "true", + "launchType": "singleton", + "language": "C++", + "orientation": "landscape" } ], "deviceType": [ diff --git a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenetwo/src/main/config.json b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenetwo/src/main/config.json index 7a512befa..d30d8e797 100644 --- a/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenetwo/src/main/config.json +++ b/appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsscenetwo/src/main/config.json @@ -40,10 +40,11 @@ "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:app_name", - "type": "page", + "type": "service", "isVisible": "true", - "launchType": "standard", - "language": "C++" + "launchType": "singleton", + "language": "C++", + "orientation": "landscape" } ], "js": [ -- GitLab