From 35922fa886ebabbfda8db61acc845d09d9752f62 Mon Sep 17 00:00:00 2001 From: Zwx1144765 Date: Thu, 11 Apr 2024 15:27:52 +0800 Subject: [PATCH] =?UTF-8?q?DMS=5Fdcts=E6=B5=8B=E8=AF=95=E5=A5=97=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=96=B0=E8=AE=BE=E5=A4=87=E4=BB=A5=E5=8F=8A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zwx1144765 --- ability/dmsfwk/dmsfwk/src/main/config.json | 3 +- .../main/js/test/FeatureAbilityTest.test.js | 2 +- .../dmsfwk/dmsfwkfatest/src/main/config.json | 3 +- .../src/main/js/test/DmsFwkFaTest.test.js | 125 ++++++++++++++++++ .../dmsfwk/dmsfwkserver/src/main/config.json | 2 +- .../entry/src/main/module.json | 3 +- .../entry/src/main/module.json | 3 +- .../src/main/ets/test/DmsFwkStageTest.ets | 31 ++++- .../entry/src/main/module.json | 3 +- .../entry/src/main/module.json | 3 +- 10 files changed, 168 insertions(+), 10 deletions(-) diff --git a/ability/dmsfwk/dmsfwk/src/main/config.json b/ability/dmsfwk/dmsfwk/src/main/config.json index 200a1d9..f89c16e 100644 --- a/ability/dmsfwk/dmsfwk/src/main/config.json +++ b/ability/dmsfwk/dmsfwk/src/main/config.json @@ -20,7 +20,8 @@ "srcPath":"", "deviceType": [ "default", - "tablet" + "tablet", + "2in1" ], "distro": { "deliveryWithInstall": true, diff --git a/ability/dmsfwk/dmsfwk/src/main/js/test/FeatureAbilityTest.test.js b/ability/dmsfwk/dmsfwk/src/main/js/test/FeatureAbilityTest.test.js index 9b9b9f6..9654b70 100644 --- a/ability/dmsfwk/dmsfwk/src/main/js/test/FeatureAbilityTest.test.js +++ b/ability/dmsfwk/dmsfwk/src/main/js/test/FeatureAbilityTest.test.js @@ -913,7 +913,7 @@ export default function dmsJsUnitTest() { want: wantValue }).then((data) => { console.info('SUB_DMS_StandardOs_collaboration_Startability_StartRemoteAbility_3500 data' + JSON.stringify(data)); - expect(data == 0).assertTrue(); + expect(JSON.stringify(data) == 0).assertTrue(); done(); }).catch((err) => { console.info('SUB_DMS_StandardOs_collaboration_Startability_StartRemoteAbility_3500 err: ' + err.code); diff --git a/ability/dmsfwk/dmsfwkfatest/src/main/config.json b/ability/dmsfwk/dmsfwkfatest/src/main/config.json index 9cb3b62..571db69 100644 --- a/ability/dmsfwk/dmsfwkfatest/src/main/config.json +++ b/ability/dmsfwk/dmsfwkfatest/src/main/config.json @@ -20,7 +20,8 @@ "srcPath":"", "deviceType": [ "default", - "tablet" + "tablet", + "2in1" ], "distro": { "deliveryWithInstall": true, diff --git a/ability/dmsfwk/dmsfwkfatest/src/main/js/test/DmsFwkFaTest.test.js b/ability/dmsfwk/dmsfwkfatest/src/main/js/test/DmsFwkFaTest.test.js index 20ba2f4..6308311 100644 --- a/ability/dmsfwk/dmsfwkfatest/src/main/js/test/DmsFwkFaTest.test.js +++ b/ability/dmsfwk/dmsfwkfatest/src/main/js/test/DmsFwkFaTest.test.js @@ -769,6 +769,131 @@ export default function DmsFwkFaTest() { console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0300 is end---------------"); }); + /* + * @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400 + * @tc.name StartRemoteAbilityForResult remote MainAbility want is null + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400", 0, async function (done) { + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400 is start---------------"); + let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400'; + let wantValue = { + } + featureAbility.startAbilityForResult({ + want: wantValue + }, (error) => { + if (error && error.code !== 0) { + console.error(TAG + ' fail, error: ' + error.code); + expect(error.code).assertEqual(1); + } else { + console.log(TAG + ' StartAbilityForResult_callback success'); + expect().assertFail() + } + }); + done(); + await sleep(1000); + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0400 is end---------------"); + }); + + /* + * @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500 + * @tc.name StartRemoteAbilityForResult remote MainAbility abilityName is undefined + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500", 0, async function (done) { + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500 is start---------------"); + let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500'; + let wantValue = { + deviceId: dvId, + bundleName: "com.acts.example.dmsfwkstageserver", + abilityName: undefined, + parameters: { + startReason: "terminateSelfWithResult" + } + } + featureAbility.startAbilityForResult({ + want: wantValue + }, (error) => { + if (error && error.code !== 0) { + console.error(TAG + ' fail, error: ' + error.code); + expect(error.code).assertEqual(1); + } else { + console.log(TAG + ' StartAbilityForResult_callback success'); + expect().assertFail() + } + }); + done(); + await sleep(1000); + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0500 is end---------------"); + }); + + /* + * @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600 + * @tc.name StartRemoteAbilityForResult remote MainAbility abilityName is null + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600", 0, async function (done) { + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600 is start---------------"); + let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600'; + let wantValue = { + deviceId: dvId, + bundleName: "com.acts.example.dmsfwkstageserver", + abilityName: null, + parameters: { + startReason: "terminateSelfWithResult" + } + } + featureAbility.startAbilityForResult({ + want: wantValue + }, (error) => { + if (error && error.code !== 0) { + console.error(TAG + ' fail, error: ' + error.code); + expect(error.code).assertEqual(1); + } else { + console.log(TAG + ' StartAbilityForResult_callback success'); + expect().assertFail() + } + }); + done(); + await sleep(1000); + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0600 is end---------------"); + }); + + /* + * @tc.number SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700 + * @tc.name StartRemoteAbilityForResult remote MainAbility abilityName is err + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700", 0, async function (done) { + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700 is start---------------"); + let TAG = 'SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700'; + let wantValue = { + deviceId: dvId, + bundleName: "com.acts.example.dmsfwkstageserver", + abilityName: 's1234wersds', + parameters: { + startReason: "terminateSelfWithResult" + } + } + featureAbility.startAbilityForResult({ + want: wantValue + }, (error) => { + if (error && error.code !== 0) { + console.error(TAG + ' fail, error: ' + error.code); + expect(error.code).assertEqual(9); + } else { + console.log(TAG + ' StartAbilityForResult_callback success'); + expect().assertFail() + } + }); + done(); + await sleep(1000); + console.info("---------------SUB_DMS_StandardOs_collaboration_Startability_StartAbilityForResult_callback_0700 is end---------------"); + }); /* * @tc.number SUB_DMS_StandardOs_collaboration_connetability_connectRemoteAbility_1300 diff --git a/ability/dmsfwk/dmsfwkserver/src/main/config.json b/ability/dmsfwk/dmsfwkserver/src/main/config.json index 296908b..4f5c131 100644 --- a/ability/dmsfwk/dmsfwkserver/src/main/config.json +++ b/ability/dmsfwk/dmsfwkserver/src/main/config.json @@ -33,7 +33,7 @@ "deviceType": [ "tablet", "default", - "phone" + "2in1" ], "distro": { "deliveryWithInstall": true, diff --git a/ability/dmsfwk/dmsfwkstagepermissiontest/entry/src/main/module.json b/ability/dmsfwk/dmsfwkstagepermissiontest/entry/src/main/module.json index 5829e31..e9841e7 100644 --- a/ability/dmsfwk/dmsfwkstagepermissiontest/entry/src/main/module.json +++ b/ability/dmsfwk/dmsfwkstagepermissiontest/entry/src/main/module.json @@ -7,7 +7,8 @@ "mainElement": "MainAbility", "deviceTypes": [ "default", - "tablet" + "tablet", + "2in1" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/ability/dmsfwk/dmsfwkstageserver/entry/src/main/module.json b/ability/dmsfwk/dmsfwkstageserver/entry/src/main/module.json index 4fccf75..0d07712 100644 --- a/ability/dmsfwk/dmsfwkstageserver/entry/src/main/module.json +++ b/ability/dmsfwk/dmsfwkstageserver/entry/src/main/module.json @@ -7,7 +7,8 @@ "mainElement": "MainAbility", "deviceTypes": [ "default", - "tablet" + "tablet", + "2in1" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/ability/dmsfwk/dmsfwkstagetest/entry/src/main/ets/test/DmsFwkStageTest.ets b/ability/dmsfwk/dmsfwkstagetest/entry/src/main/ets/test/DmsFwkStageTest.ets index 795eef9..d4b52bb 100644 --- a/ability/dmsfwk/dmsfwkstagetest/entry/src/main/ets/test/DmsFwkStageTest.ets +++ b/ability/dmsfwk/dmsfwkstagetest/entry/src/main/ets/test/DmsFwkStageTest.ets @@ -125,12 +125,12 @@ export default function DmsFwkStageTest() { afterEach(async (done: Function) => { console.info('DmsFwkStageTest after each called'); let connectIdList: number[] = [connectId,connectId2,extensionConnectId,extensionConnectId2] - await sleep(1000) for (let i in connectIdList) { await sleep(1000) await DisconnectServiceExtensionAbility(connectIdList[i]) console.log('connectIdList i is' + i + connectIdList[i]) } + await sleep(2000) done(); }); @@ -1538,8 +1538,8 @@ export default function DmsFwkStageTest() { console.info('SUB_DMS_StandardOs_collaboration_connectAbility_StopConnectServiceExtensionAbility_1400 catch error is' + error.code); expect(true).assertTrue() } - done(); await sleep(1000); + done(); console.info("---------------SUB_DMS_StandardOs_collaboration_connectAbility_StopConnectServiceExtensionAbility_1400 is end---------------" + connectId) }); @@ -2604,5 +2604,32 @@ export default function DmsFwkStageTest() { done() console.info("-----------------SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1500 end------------------------"); }) + + /* + * @tc.number SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600 + * @tc.name Get call various applications + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600', 0, async (done: Function) => { + console.info("-----------------SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600 start------------------------"); + let context: common.UIAbilityContext | undefined = AppStorage.get('context') as common.UIAbilityContext + context.startAbilityByCall({ + bundleName: 'com.acts.example.dmsfwkstageserver', + abilityName: 'MainAbility', + deviceId: dvId + }) + .then((data: Caller) => { + call = data; + console.log('get caller is success caller is ' + call) + expect().assertFail() + }).catch((err: BusinessError) => { + console.log('get caller is failed err is ' + JSON.stringify(err)) + expect(err.code == 16000050).assertTrue() + }) + done() + await sleep(2000) + console.info("-----------------SUB_DMS_StandardOs_Collaboration_Bycall_singletonOncall_1600 end------------------------"); + }); }) } \ No newline at end of file diff --git a/ability/dmsfwk/dmsfwkstagetest/entry/src/main/module.json b/ability/dmsfwk/dmsfwkstagetest/entry/src/main/module.json index fd8e4a8..72bb5e8 100644 --- a/ability/dmsfwk/dmsfwkstagetest/entry/src/main/module.json +++ b/ability/dmsfwk/dmsfwkstagetest/entry/src/main/module.json @@ -7,7 +7,8 @@ "mainElement": "MainAbility", "deviceTypes": [ "default", - "tablet" + "tablet", + "2in1" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/ability/dmsfwk/dmsfwkstagetestserver/entry/src/main/module.json b/ability/dmsfwk/dmsfwkstagetestserver/entry/src/main/module.json index 97ef9bc..e5cd073 100644 --- a/ability/dmsfwk/dmsfwkstagetestserver/entry/src/main/module.json +++ b/ability/dmsfwk/dmsfwkstagetestserver/entry/src/main/module.json @@ -7,7 +7,8 @@ "mainElement": "MainAbility", "deviceTypes": [ "default", - "tablet" + "tablet", + "2in1" ], "deliveryWithInstall": true, "installationFree": false,