From b31fafd2b2c563362e2b02d6b7ec4d4fea2cc843 Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Sat, 14 Jan 2023 17:50:13 +0800 Subject: [PATCH] =?UTF-8?q?xts-=E7=B3=BB=E7=BB=9FAPI=E9=89=B4=E6=9D=83?= =?UTF-8?q?=E6=96=B0=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: chengxingzhen --- ability/ability_runtime/BUILD.gn | 1 + .../actssystemapitest/AppScope/app.json | 21 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../actssystemapitest/BUILD.gn | 43 + .../actssystemapitest/Test.json | 21 + .../main/ets/Application/MyAbilityStage.ts | 23 + .../src/main/ets/MainAbility/MainAbility.ts | 60 ++ .../ets/TestRunner/OpenHarmonyTestRunner.ts | 75 ++ .../entry/src/main/ets/pages/index/index.ets | 44 + .../src/main/ets/test/AbilityContext.test.ets | 486 +++++++++ .../src/main/ets/test/AbilityManager.test.ets | 175 +++ .../src/main/ets/test/AppManager.test.ets | 246 +++++ .../entry/src/main/ets/test/Context.test.ets | 64 ++ .../entry/src/main/ets/test/FormHost.test.ets | 997 ++++++++++++++++++ .../src/main/ets/test/FormProvider.test.ets | 167 +++ .../entry/src/main/ets/test/List.test.ets | 34 + .../src/main/ets/test/MissionManager.test.ets | 436 ++++++++ .../src/main/ets/test/WantAgent.test.ets | 62 ++ .../entry/src/main/module.json | 27 + .../main/resources/base/element/string.json | 24 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/main_pages.json | 5 + .../signature/openharmony_sx.p7b | Bin 0 -> 3638 bytes 24 files changed, 3019 insertions(+) create mode 100644 ability/ability_runtime/actssystemapitest/AppScope/app.json create mode 100644 ability/ability_runtime/actssystemapitest/AppScope/resources/base/element/string.json create mode 100644 ability/ability_runtime/actssystemapitest/AppScope/resources/base/media/app_icon.png create mode 100644 ability/ability_runtime/actssystemapitest/BUILD.gn create mode 100644 ability/ability_runtime/actssystemapitest/Test.json create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/Application/MyAbilityStage.ts create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/pages/index/index.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityContext.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityManager.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AppManager.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/Context.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormHost.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormProvider.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/MissionManager.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/WantAgent.test.ets create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/module.json create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/element/string.json create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/media/icon.png create mode 100644 ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/profile/main_pages.json create mode 100644 ability/ability_runtime/actssystemapitest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/BUILD.gn b/ability/ability_runtime/BUILD.gn index b75f96a68..5b9daed00 100644 --- a/ability/ability_runtime/BUILD.gn +++ b/ability/ability_runtime/BUILD.gn @@ -35,6 +35,7 @@ group("ability_runtime") { "actsstartrunnertest:ActsStartRunnerTest", "actsstserviceabilityclientcase:ActsStServiceAbilityClientCaseTest", "actssupportfunction:actssupportfunction", + "actssystemapitest:ActsSystemAPITest", "actsusers:actsusers", "amscontextualinforquery:amscontextualinforquery", "amsdatauriutils:ActsAmsDataUriUtilsTest", diff --git a/ability/ability_runtime/actssystemapitest/AppScope/app.json b/ability/ability_runtime/actssystemapitest/AppScope/app.json new file mode 100644 index 000000000..1b07e263b --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.systemapitest", + "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/actssystemapitest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actssystemapitest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..ec48a8748 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "AbilityStageMonitor" + } + ] +} diff --git a/ability/ability_runtime/actssystemapitest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actssystemapitest/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL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NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y { + 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/actssystemapitest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/pages/index/index.ets new file mode 100644 index 000000000..43fab984f --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/pages/index/index.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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(){ + } + + build() { + Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('MainAbility Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityContext.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityContext.test.ets new file mode 100644 index 000000000..4aef6e4f7 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityContext.test.ets @@ -0,0 +1,486 @@ +/* + * 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, it, expect } from '@ohos/hypium' +import image from '@ohos.multimedia.image' + +let ERROR_CODE = 202; +let context; +export default function abilityContextTest() { + describe('abilityContextTest', function () { + beforeAll(function () { + context = globalThis.abilityContext; + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0100 + * @tc.name: callback form startAbilityWithAccount system interface interception test + * @tc.desc: Test third-party applications calling startAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0100', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0100'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + context.startAbilityWithAccount(want, account, (error) => { + if (error.code) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0200 + * @tc.name: Multi-parameter startAbilityWithAccount system interface interception test in the form of callback + * @tc.desc: Test third-party applications calling startAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0200', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0200'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + let options = { + windowMode: 0 + }; + context.startAbilityWithAccount(want, account, options, (error) => { + if (error.code) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0300 + * @tc.name: The promise form startAbilityWithAccount system interface interception test + * @tc.desc: Test third-party applications calling startAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0300', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0300'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + context.startAbilityWithAccount(want, account) + .then(() => { }) + .catch(error => { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0400 + * @tc.name: Multiple input arguments in the form of promise, startAbilityWithAccount system interface interception test + * @tc.desc: Test third-party applications calling startAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0400', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0400'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + let options = { + windowMode: 0 + }; + context.startAbilityWithAccount(want, account, options) + .then(() => { }) + .catch(error => { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0500 + * @tc.name: callback form startAbilityForResultWithAccount system interface interception test + * @tc.desc: Test the third-party application call startAbilityForResultWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0500', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0500'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + try { + context.startAbilityForResultWithAccount(want, account, (error) => { + + }) + } catch (error) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0600 + * @tc.name: Multi-parameter startAbilityForResultWithAccount system interface interception test in the form of callback + * @tc.desc: Test the third-party application call startAbilityForResultWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0600', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0600'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + let options = { + windowMode: 0 + }; + try { + context.startAbilityForResultWithAccount(want, account, options, (error) => { + + }) + } catch (error) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0700 + * @tc.name: promise form startAbilityForResultWithAccount system interface interception test + * @tc.desc: Test the third-party application call startAbilityForResultWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0700', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0700'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + try { + context.startAbilityForResultWithAccount(want, account) + .then(() => { }) + .catch(error => { + + }) + } catch (error) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0800 + * @tc.name: Multi-parameter startAbilityForResultWithAccount system interface interception test in the form of promise + * @tc.desc: Test the third-party application call startAbilityForResultWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0800', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0800'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + let options = { + windowMode: 0 + }; + try { + context.startAbilityForResultWithAccount(want, account, options) + .then(() => { }) + .catch(error => { + + }) + } catch (error) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_AbilityContext_0900 + * @tc.name: callback form startServiceExtensionAbility system interface interception test + * @tc.desc: Test the third-party application call startServiceExtensionAbility will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_0900', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_0900'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + context.startServiceExtensionAbility(want, (error) => { + if (error.code) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1000 + * @tc.name: promise form startServiceExtensionAbility system interface interception test + * @tc.desc: Test the third-party application call startServiceExtensionAbility will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1000', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1000'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + context.startServiceExtensionAbility(want) + .then(() => { }) + .catch(error => { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1100 + * @tc.name: callback form startServiceExtensionAbilityWithAccount system interface interception test + * @tc.desc: Test the third-party application call startServiceExtensionAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1100', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1100'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + context.startServiceExtensionAbilityWithAccount(want, account, (error) => { + if (error.code) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1200 + * @tc.name: promise form startServiceExtensionAbilityWithAccount system interface interception test + * @tc.desc: Test the third-party application call startServiceExtensionAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1200', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1200'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + context.startServiceExtensionAbilityWithAccount(want, account) + .then(() => { }) + .catch(error => { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1300 + * @tc.name: callback form stopServiceExtensionAbility system interface interception test + * @tc.desc: Test the third-party application call stopServiceExtensionAbility will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1300', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1300'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + context.stopServiceExtensionAbility(want, (error) => { + if (error.code) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1400 + * @tc.name: promise form stopServiceExtensionAbility system interface interception test + * @tc.desc: Test the third-party application call stopServiceExtensionAbility will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1400', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1400'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + context.stopServiceExtensionAbility(want) + .then(() => { }) + .catch(error => { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1500 + * @tc.name: calback form stopServiceExtensionAbilityWithAccount system interface interception test + * @tc.desc: Test the third-party application call stopServiceExtensionAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1500', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1500'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + context.stopServiceExtensionAbilityWithAccount(want, account, (error) => { + if (error.code) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1600 + * @tc.name: promise form stopServiceExtensionAbilityWithAccount system interface interception test + * @tc.desc: Test the third-party application call stopServiceExtensionAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1600', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1600'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let account = 110; + context.stopServiceExtensionAbilityWithAccount(want, account) + .then(() => { + expect().assertFail(); + done(); + }) + .catch(error => { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1700 + * @tc.name: promise form connectServiceExtensionAbilityWithAccount system interface interception test + * @tc.desc: Test the third-party application call connectServiceExtensionAbilityWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1700', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1700'; + let want = { + abilityName: "aaa", + bundleName: "bbb" + } + let accountId = 110; + let options = { + onConnect(elementName, remote) { console.log('----------- onConnect -----------') }, + onDisconnect(elementName) { console.log('----------- onDisconnect -----------') }, + onFailed(code) { + console.log(TAG + " error: " + code); + expect(code).assertEqual(ERROR_CODE); + done(); + } + } + + try { + context.connectServiceExtensionAbilityWithAccount(want, accountId, options); + } catch (paramError) { + console.log('error.code: ' + JSON.stringify(paramError.code) + + ' error.message: ' + JSON.stringify(paramError.message)); + } + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1800 + * @tc.name: callback form setMissionIcon system interface interception test + * @tc.desc: Test the third-party application call setMissionIcon will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1800', 0, async function (done) { + let TAG = 'System_API_Test_AbilityContext_1800'; + + const color = new ArrayBuffer(96); + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }; + image.createPixelMap(color, opts).then((pixelmap) => { + console.log(TAG + ' Succeeded in creating pixelmap.'); + context.setMissionIcon(pixelmap, (error) => { + console.log(TAG + ' ---------- setMissionIcon fail, err: -----------', error); + if (error.code) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }).catch(error => { + console.log(TAG + ' Failed to create pixelmap.'); + }) + }) + + /** + * @tc.number: System_API_Test_AbilityContext_1900 + * @tc.name: promise form setMissionIcon system interface interception test + * @tc.desc: Test the third-party application call setMissionIcon will be blocked + * @tc.level 3 + */ + it('System_API_Test_AbilityContext_1900', 0, function (done) { + let TAG = 'System_API_Test_AbilityContext_1900'; + const color = new ArrayBuffer(96); + let bufferArr = new Uint8Array(color); + let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }; + image.createPixelMap(color, opts).then((pixelmap) => { + console.log(TAG + ' Succeeded in creating pixelmap.'); + context.setMissionIcon(pixelmap) + .then(() => { + console.log('-------------- setMissionIcon success -------------'); + }) + .catch((error) => { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }); + }).catch(error => { + console.log(TAG + ' Failed to create pixelmap.'); + }) + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityManager.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityManager.test.ets new file mode 100644 index 000000000..b97741797 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AbilityManager.test.ets @@ -0,0 +1,175 @@ +/* + * 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' +import abilityManager from "@ohos.app.ability.abilityManager" + +let ERROR_CODE = 202; +export default function abilityManagerTest() { + describe('abilityManagerTest', function () { + + /** + * @tc.number: System_API_Test_Ability_Manager_0100 + * @tc.name: callback form updateConfiguration system interface interception test + * @tc.desc: Test the third-party application call updateConfiguration will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0100', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0100'; + let configInit = { + language: 'english' + } + abilityManager.updateConfiguration(configInit, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Ability_Manager_0200 + * @tc.name: promise form updateConfiguration system interface interception test + * @tc.desc: Test the third-party application call updateConfiguration will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0200', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0200'; + let configInit = { + language: 'english' + } + abilityManager.updateConfiguration(configInit) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Ability_Manager_0300 + * @tc.name: callback form getAbilityRunningInfos system interface interception test + * @tc.desc: Test the third-party application call getAbilityRunningInfos will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0300', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0300'; + abilityManager.getAbilityRunningInfos((err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Ability_Manager_0400 + * @tc.name: promise form getAbilityRunningInfos system interface interception test + * @tc.desc: Test the third-party application call getAbilityRunningInfos will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0400', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0400'; + abilityManager.getAbilityRunningInfos() + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Ability_Manager_0500 + * @tc.name: callback form getExtensionRunningInfos system interface interception test + * @tc.desc: Test the third-party application call getExtensionRunningInfos will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0500', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0500'; + let upperLimit = 10; + abilityManager.getExtensionRunningInfos(upperLimit, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Ability_Manager_0600 + * @tc.name: promise form getExtensionRunningInfos system interface interception test + * @tc.desc: Test the third-party application call getExtensionRunningInfos will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0600', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0600'; + let upperLimit = 10; + abilityManager.getExtensionRunningInfos(upperLimit) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Ability_Manager_0700 + * @tc.name: callback form getTopAbility system interface interception test + * @tc.desc: Test the third-party application call getTopAbility will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0700', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0700'; + try { + abilityManager.getTopAbility((data) => { + + }); + } catch (error) { + console.log(TAG + " err.code: " + error.code); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Ability_Manager_0800 + * @tc.name: promise form getTopAbility system interface interception test + * @tc.desc: Test the third-party application call getTopAbility will be blocked + * @tc.level 3 + */ + it('System_API_Test_Ability_Manager_0800', 0, function (done) { + let TAG = 'System_API_Test_Ability_Manager_0800'; + try { + abilityManager.getTopAbility().then().catch(); + } catch (error) { + console.log(TAG + " err.code: " + error.code); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AppManager.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AppManager.test.ets new file mode 100644 index 000000000..525265325 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AppManager.test.ets @@ -0,0 +1,246 @@ +/* + * 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' +import appManager from "@ohos.app.ability.appManager" + +let ERROR_CODE = 202; +export default function appManagerTest() { + describe('appManagerTest', function () { + + /** + * @tc.number: System_API_Test_App_Manager_0100 + * @tc.name: appManager.on system interface interception test + * @tc.desc: Test the third-party application call appManager.on will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0100',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0100'; + let applicationStateObserver = { + onForegroundApplicationChanged(appStateData) { + console.log(TAG + '------------ onForegroundApplicationChanged -----------', appStateData); + }, + onAbilityStateChanged(abilityStateData) { + console.log(TAG + '------------ onAbilityStateChanged -----------', abilityStateData); + }, + onProcessCreated(processData) { + console.log(TAG + '------------ onProcessCreated -----------', processData); + }, + onProcessDied(processData) { + console.log(TAG + '------------ onProcessDied -----------', processData); + }, + onProcessStateChanged(processData) { + console.log(TAG + '------------ onProcessStateChanged -----------', processData); + } + } + try { + const observerCode = appManager.on("applicationState", applicationStateObserver); + console.log('-------- observerCode: ---------', observerCode); + } catch (err) { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_App_Manager_0200 + * @tc.name: Multi-parameter appManager.on system interface interception test + * @tc.desc: Test the third-party application call appManager.on will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0200',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0200'; + let applicationStateObserver = { + onForegroundApplicationChanged(appStateData) { + console.log(TAG + '------------ onForegroundApplicationChanged -----------', appStateData); + }, + onAbilityStateChanged(abilityStateData) { + console.log(TAG + '------------ onAbilityStateChanged -----------', abilityStateData); + }, + onProcessCreated(processData) { + console.log(TAG + '------------ onProcessCreated -----------', processData); + }, + onProcessDied(processData) { + console.log(TAG + '------------ onProcessDied -----------', processData); + }, + onProcessStateChanged(processData) { + console.log(TAG + '------------ onProcessStateChanged -----------', processData); + } + } + let bundleNameList = ['bundleName1', 'bundleName2']; + try { + const observerCode = appManager.on("applicationState", applicationStateObserver, bundleNameList); + console.log('-------- observerCode: ---------', observerCode); + } catch (err) { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_App_Manager_0300 + * @tc.name: callback form getForegroundApplications system interface interception test + * @tc.desc: Test the third-party application call getForegroundApplications will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0300',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0300'; + appManager.getForegroundApplications((err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_App_Manager_0400 + * @tc.name: promise form getForegroundApplications system interface interception test + * @tc.desc: Test the third-party application call getForegroundApplications will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0400',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0400'; + appManager.getForegroundApplications() + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_App_Manager_0500 + * @tc.name: callback form killProcessWithAccount system interface interception test + * @tc.desc: Test the third-party application call killProcessWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0500',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0500'; + let bundleName = "com.ohos.application"; + let accountId = 100; + appManager.killProcessWithAccount(bundleName, accountId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_App_Manager_0600 + * @tc.name: promise form killProcessWithAccount system interface interception test + * @tc.desc: Test the third-party application call killProcessWithAccount will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0600',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0600'; + let bundleName = "com.ohos.application"; + let accountId = 100; + appManager.killProcessWithAccount(bundleName, accountId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_App_Manager_0700 + * @tc.name: callback form killProcessesByBundleName system interface interception test + * @tc.desc: Test the third-party application call killProcessesByBundleName will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0700',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0700'; + let bundleName = "com.ohos.application"; + appManager.killProcessesByBundleName(bundleName, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_App_Manager_0800 + * @tc.name: promise form killProcessesByBundleName system interface interception test + * @tc.desc: Test the third-party application call killProcessesByBundleName will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0800',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0800'; + let bundleName = "com.ohos.application"; + appManager.killProcessesByBundleName(bundleName) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_App_Manager_0900 + * @tc.name: callback form clearUpApplicationData system interface interception test + * @tc.desc: Test the third-party application call clearUpApplicationData will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_0900',0, function (done) { + let TAG = 'System_API_Test_App_Manager_0900'; + let bundleName = "com.ohos.application"; + appManager.clearUpApplicationData(bundleName, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_App_Manager_1000 + * @tc.name: promise form clearUpApplicationData system interface interception test + * @tc.desc: Test the third-party application call clearUpApplicationData will be blocked + * @tc.level 3 + */ + it('System_API_Test_App_Manager_1000',0, function (done) { + let TAG = 'System_API_Test_App_Manager_1000'; + let bundleName = "com.ohos.application"; + appManager.clearUpApplicationData(bundleName) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/Context.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/Context.test.ets new file mode 100644 index 000000000..5ae9d8161 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/Context.test.ets @@ -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 { describe, beforeAll, it, expect } from '@ohos/hypium' + +let ERROR_CODE = 202; +let context; +export default function contextTest() { + describe('contextTest', function () { + beforeAll(function () { + context = globalThis.abilityContext; + }) + + /** + * @tc.number: System_API_Test_Context_0100 + * @tc.name: callback form createBundleContext system interface interception test + * @tc.desc: Test the third-party application call createBundleContext will be blocked + * @tc.level 3 + */ + it('System_API_Test_Context_0100',0, function (done) { + let TAG = 'System_API_Test_Context_0100'; + console.log(`${TAG} context : ${context}`); + try { + let bundleName = "aaa"; + context.createBundleContext(bundleName); + } catch (error) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Context_0200 + * @tc.name: promise form createBundleContext system interface interception test + * @tc.desc: Test the third-party application call createBundleContext will be blocked + * @tc.level 3 + */ + it('System_API_Test_Context_0200',0, function (done) { + let TAG = 'System_API_Test_Context_0200'; + try { + let bundleName = "aaa"; + let moduleName = "aaa"; + context.createModuleContext(bundleName, moduleName); + } catch (error) { + console.log(TAG + " error: " + error.code + ", " + error.message); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormHost.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormHost.test.ets new file mode 100644 index 000000000..85f21a189 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormHost.test.ets @@ -0,0 +1,997 @@ +/* + * 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' +import formHost from '@ohos.app.form.formHost' + +let ERROR_CODE = 16500101; +export default function formHostTest() { + describe('formHostTest', function () { + + /** + * @tc.number: System_API_Test_Form_Host_0100 + * @tc.name: callback form deleteForm system interface interception test + * @tc.desc: Test the third-party application call deleteForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0100',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0100'; + console.log(TAG + ' formHost deleteForm BEGIN'); + try { + let formId = "12400633174999288"; + formHost.deleteForm(formId, (error, data) => { + if (error) { + console.log(TAG + ' formHost deleteForm, error:' + JSON.stringify(error.code)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost deleteForm success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_0200 + * @tc.name: promise form deleteForm system interface interception test + * @tc.desc: Test the third-party application call deleteForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0200',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0200'; + try { + let formId = "12400633174999288"; + formHost.deleteForm(formId) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost deleteForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + + + /** + * @tc.number: System_API_Test_Form_Host_0300 + * @tc.name: callback form deleteForm system interface interception test + * @tc.desc: Test the third-party application call deleteForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0300',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0300'; + try { + let formId = "12400633174999288"; + formHost.releaseForm(formId, (error, data) => { + if (error) { + console.log(TAG + ' formHost releaseForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost releaseForm success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_0400 + * @tc.name: Multi-parameter releaseForm system interface interception test in the form of callback + * @tc.desc: Test the third-party application call releaseForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0400',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0400'; + try { + let formId = "12400633174999288"; + formHost.releaseForm(formId, false, (error, data) => { + if (error) { + console.log(TAG + ' formHost releaseForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost releaseForm success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_0500 + * @tc.name: promise form releaseForm system interface interception test + * @tc.desc: Test the third-party application call releaseForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0500',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0500'; + try { + let formId = "12400633174999288"; + formHost.releaseForm(formId) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost releaseForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_0600 + * @tc.name: callback form requestForm system interface interception test + * @tc.desc: Test the third-party application call requestForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0600',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0600'; + try { + let formId = "12400633174999288"; + formHost.requestForm(formId, (error, data) => { + if (error) { + console.log(TAG + ' formHost requestForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost requestForm success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_0700 + * @tc.name: promise form requestForm system interface interception test + * @tc.desc: Test the third-party application call requestForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0700',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0700'; + try { + let formId = "12400633174999288"; + formHost.requestForm(formId) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost requestForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_0800 + * @tc.name: callback form castToNormalForm system interface interception test + * @tc.desc: Test the third-party application call castToNormalForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0800',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0800'; + try { + let formId = "12400633174999288"; + formHost.castToNormalForm(formId, (error, data) => { + if (error) { + console.log(TAG + ' formHost castToNormalForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost castToNormalForm success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_0900 + * @tc.name: promise form castToNormalForm system interface interception test + * @tc.desc: Test the third-party application call castToNormalForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_0900',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_0900'; + try { + let formId = "12400633174999288"; + formHost.castToNormalForm(formId) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost castToNormalForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1000 + * @tc.name: callback form notifyVisibleForms system interface interception test + * @tc.desc: Test the third-party application call notifyVisibleForms will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1000',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1000'; + try { + let formId = "12400633174999288"; + formHost.notifyVisibleForms([formId], (error, data) => { + if (error) { + console.log(TAG + ' formHost castToNormalForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost castToNormalForm success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1100 + * @tc.name: promise form notifyVisibleForms system interface interception test + * @tc.desc: Test the third-party application call notifyVisibleForms will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1100',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1100'; + try { + let formId = "12400633174999288"; + formHost.notifyVisibleForms([formId]) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost castToNormalForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1200 + * @tc.name: callback form notifyInvisibleForms system interface interception test + * @tc.desc: Test the third-party application call notifyInvisibleForms will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1200',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1200'; + try { + let formId = "12400633174999288"; + formHost.notifyInvisibleForms([formId], (error, data) => { + if (error) { + console.log(TAG + ' formHost notifyInvisibleForms, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost notifyInvisibleForms success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1300 + * @tc.name: promise form notifyInvisibleForms system interface interception test + * @tc.desc: Test the third-party application call notifyInvisibleForms will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1300',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1300'; + try { + let formId = "12400633174999288"; + formHost.notifyInvisibleForms([formId]) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost notifyInvisibleForms, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1400 + * @tc.name: callback form enableFormsUpdate system interface interception test + * @tc.desc: Test the third-party application call enableFormsUpdate will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1400',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1400'; + try { + let formId = "12400633174999288"; + formHost.enableFormsUpdate([formId], (error, data) => { + if (error) { + console.log(TAG + ' formHost enableFormsUpdate, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost enableFormsUpdate success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1500 + * @tc.name: promise form enableFormsUpdate system interface interception test + * @tc.desc: Test the third-party application call enableFormsUpdate will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1500',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1500'; + try { + let formId = "12400633174999288"; + formHost.enableFormsUpdate([formId]) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost enableFormsUpdate, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1600 + * @tc.name: callback form disableFormsUpdate system interface interception test + * @tc.desc: Test the third-party application call disableFormsUpdate will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1600',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1600'; + try { + let formId = "12400633174999288"; + formHost.disableFormsUpdate([formId], (error, data) => { + if (error) { + console.log(TAG + ' formHost disableFormsUpdate, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost disableFormsUpdate success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1700 + * @tc.name: promise form disableFormsUpdate system interface interception test + * @tc.desc: Test the third-party application call disableFormsUpdate will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1700',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1700'; + try { + let formId = "12400633174999288"; + formHost.disableFormsUpdate([formId]) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost disableFormsUpdate, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1800 + * @tc.name: callback form isSystemReady system interface interception test + * @tc.desc: Test the third-party application call isSystemReady will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1800',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1800'; + try { + formHost.isSystemReady((data) => { + + }) + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_1900 + * @tc.name: promise form isSystemReady system interface interception test + * @tc.desc: Test the third-party application call isSystemReady will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_1900',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_1900'; + try { + formHost.isSystemReady() + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ` promise catch err->${JSON.stringify(error)}`); + }) + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2000 + * @tc.name: callback form getAllFormsInfo system interface interception test + * @tc.desc: Test the third-party application call getAllFormsInfo will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2000',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2000'; + try { + formHost.getAllFormsInfo((error, data) => { + console.log(TAG + ' formHost getAllFormsInfo, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2100 + * @tc.name: promise form getAllFormsInfo system interface interception test + * @tc.desc: Test the third-party application call getAllFormsInfo will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2100',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2100'; + try { + formHost.getAllFormsInfo() + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost getAllFormsInfo, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + + /** + * @tc.number: System_API_Test_Form_Host_2200 + * @tc.name: callback form getFormsInfo system interface interception test + * @tc.desc: Test the third-party application call getFormsInfo will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2200',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2200'; + try { + let bundleName = "bundleName"; + formHost.getFormsInfo(bundleName, (error, data) => { + if (error) { + console.log(TAG + ' formHost getFormsInfo, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost getFormsInfo success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2300 + * @tc.name: Multiple input in the form of callback getFormsInfo system interface interception test + * @tc.desc: Test the third-party application call getFormsInfo will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2300',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2300'; + try { + let bundleName = "bundleName"; + let moduleName = "moduleName"; + formHost.getFormsInfo(bundleName, moduleName, (error, data) => { + if (error) { + console.log(TAG + ' formHost getFormsInfo, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost getFormsInfo success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2400 + * @tc.name: promise form getFormsInfo system interface interception test + * @tc.desc: Test the third-party application call getFormsInfo will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2400',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2400'; + try { + let bundleName = "bundleName"; + formHost.getFormsInfo(bundleName) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost getFormsInfo, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2500 + * @tc.name: callback form deleteInvalidForms system interface interception test + * @tc.desc: Test the third-party application call deleteInvalidForms will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2500',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2500'; + try { + let formId = "12400633174999288"; + formHost.deleteInvalidForms([formId], (error, data) => { + if (error) { + console.log(TAG + ' formHost deleteInvalidForms, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost deleteInvalidForms success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2600 + * @tc.name: promise form deleteInvalidForms system interface interception test + * @tc.desc: Test the third-party application call deleteInvalidForms will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2600',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2600'; + try { + let formId = "12400633174999288"; + formHost.deleteInvalidForms([formId]) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost deleteInvalidForms, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2700 + * @tc.name: callback form acquireFormState system interface interception test + * @tc.desc: Test the third-party application call acquireFormState will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2700',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2700'; + try { + let want = { + abilityName: "aaa", + bundleName: "bbb" + }; + formHost.acquireFormState(want, (error, data) => { + if (error) { + console.log(TAG + ' formHost acquireFormState, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost acquireFormState success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2800 + * @tc.name: promise form acquireFormState system interface interception test + * @tc.desc: Test the third-party application call deleteForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2800',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2800'; + try { + let want = { + abilityName: "aaa", + bundleName: "bbb" + }; + formHost.acquireFormState(want) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost acquireFormState, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_2900 + * @tc.name: callback form on system interface interception test + * @tc.desc: Test the third-party application call on will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_2900',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_2900'; + try { + formHost.on("formUninstall", (data) => { + console.log(TAG + ` data->${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }) + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_3000 + * @tc.name: callback form off system interface interception test + * @tc.desc: Test the third-party application call off will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3000',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3000'; + try { + formHost.off("formUninstall", (data) => { + console.log(TAG + ` data->${JSON.stringify(data)}`); + expect().assertFail(); + done(); + }) + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_3100 + * @tc.name: callback form notifyFormsVisible system interface interception test + * @tc.desc: Test the third-party application call notifyFormsVisible will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3100',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3100'; + try { + let formId = "12400633174999288"; + formHost.notifyFormsVisible([formId], false, (error, data) => { + if (error) { + console.log(TAG + ' formHost notifyFormsVisible, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost notifyFormsVisible success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_3200 + * @tc.name: promise form notifyFormsVisible system interface interception test + * @tc.desc: Test the third-party application call notifyFormsVisible will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3200',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3200'; + try { + let formId = "12400633174999288"; + formHost.notifyFormsVisible([formId], false) + .then(() => { + + }) + .catch((error) => { + console.log(TAG + ' formHost notifyFormsVisible, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_3300 + * @tc.name: callback form notifyFormsEnableUpdate system interface interception test + * @tc.desc: Test the third-party application call notifyFormsEnableUpdate will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3300',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3300'; + try { + let formId = "12400633174999288"; + formHost.notifyFormsEnableUpdate([formId], false, (error, data) => { + if (error) { + console.log(TAG + ' formHost notifyFormsEnableUpdate, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost notifyFormsEnableUpdate success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_3400 + * @tc.name: promise form notifyFormsEnableUpdate system interface interception test + * @tc.desc: Test the third-party application call notifyFormsEnableUpdate will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3400',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3400'; + let formId = "12400633174999288"; + formHost.notifyFormsEnableUpdate([formId], false) + .then(() => { + }) + .catch((error) => { + console.log(TAG + ' formHost notifyFormsEnableUpdate, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Form_Host_3500 + * @tc.name: callback form shareForm system interface interception test + * @tc.desc: Test the third-party application call shareForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3500',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3500'; + try { + let formId = "1337079774"; + formHost.shareForm(formId, null, (error, data) => { + if (error) { + console.log(TAG + ' formHost shareForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost shareForm success'); + } + }); + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_3600 + * @tc.name: promise form shareForm system interface interception test + * @tc.desc: Test the third-party application call shareForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3600',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3600'; + let formId = "12400633174999288"; + formHost.shareForm(formId, null) + .then(() => { + expect().assertFail(); + done(); + }) + .catch((error) => { + console.log(TAG + ' formHost shareForm, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Form_Host_3700 + * @tc.name: callback form notifyFormsPrivacyProtected system interface interception test + * @tc.desc: Test the third-party application call notifyFormsPrivacyProtected will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3700',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3700'; + try { + let formId = "12400633174999288"; + formHost.notifyFormsPrivacyProtected([formId], false, (error, data) => { + if (error) { + console.log(TAG + ' formHost notifyFormsPrivacyProtected, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log(TAG + ' formHost notifyFormsPrivacyProtected success'); + } + }); + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Host_3800 + * @tc.name: promise form notifyFormsPrivacyProtected system interface interception test + * @tc.desc: Test the third-party application call notifyFormsPrivacyProtected will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Host_3800',0, async function (done) { + let TAG = 'System_API_Test_Form_Host_3800'; + try { + let formId = "12400633174999288"; + formHost.notifyFormsPrivacyProtected([formId], false) + .then(() => { + + }) + .catch((error) => { + console.log(TAG + ' formHost notifyFormsPrivacyProtected, error:' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }) + } catch (error) { + console.log(`catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormProvider.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormProvider.test.ets new file mode 100644 index 000000000..a5596b75d --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/FormProvider.test.ets @@ -0,0 +1,167 @@ +/* + * 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' +import formProvider from '@ohos.app.form.formProvider' +import formBindingData from '@ohos.app.form.formBindingData' + +let ERROR_CODE = 16500101; +export default function formProviderTest() { + describe('formProviderTest', function () { + + /** + * @tc.number: System_API_Test_Form_Provider_0100 + * @tc.name: Multi-parameter requestPublishForm system interface interception test in the form of callback + * @tc.desc: Test the third-party application call requestPublishForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Provider_0100',0, async function (done) { + let TAG = 'System_API_Test_Form_Provider_0100'; + let want = { + abilityName: "FormAbility", + parameters: { + "ohos.extra.param.key.form_dimension": 2, + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.module_name": "entry" + } + }; + try { + let obj = formBindingData.createFormBindingData({temperature:"22c", time:"22:00"}); + formProvider.requestPublishForm(want, obj, (error, data) => { + if (error) { + console.log(TAG + ' formProvider requestPublishForm, error: ' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } else { + console.log('formProvider requestPublishForm, form ID is: ' + JSON.stringify(data)); + } + }); + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Provider_0200 + * @tc.name: Multi-parameter requestPublishForm system interface interception test in the form of promise + * @tc.desc: Test the third-party application call requestPublishForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Provider_0200',0, async function (done) { + let TAG = 'System_API_Test_Form_Provider_0200'; + let want = { + abilityName: "FormAbility", + parameters: { + "ohos.extra.param.key.form_dimension": 2, + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.module_name": "entry" + } + }; + try { + let obj = formBindingData.createFormBindingData({temperature:"22c", time:"22:00"}); + formProvider.requestPublishForm(want, obj).then((data) => { + console.log(TAG + ' formProvider requestPublishForm success, form ID is :' + JSON.stringify(data)); + }).catch((error) => { + console.log(TAG + ' formProvider requestPublishForm, error: ' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }); + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Provider_0300 + * @tc.name: promise form requestPublishForm system interface interception test + * @tc.desc: Test the third-party application call requestPublishForm will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Provider_0300',0, async function (done) { + let TAG = 'System_API_Test_Form_Provider_0300'; + let want = { + abilityName: "FormAbility", + parameters: { + "ohos.extra.param.key.form_dimension": 2, + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.module_name": "entry" + } + }; + try { + formProvider.requestPublishForm(want).then((data) => { + console.log(TAG + ' formProvider requestPublishForm success, form ID is :' + JSON.stringify(data)); + }).catch((error) => { + console.log(TAG + ' formProvider requestPublishForm, error: ' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }); + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Provider_0400 + * @tc.name: callback form isRequestPublishFormSupported system interface interception test + * @tc.desc: Test the third-party application call isRequestPublishFormSupported will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Provider_0400',0, async function (done) { + let TAG = 'System_API_Test_Form_Provider_0400'; + try { + formProvider.isRequestPublishFormSupported((error, data) => { + if (error) { + console.log(TAG + ' formProvider isRequestPublishFormSupported, error: ' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }); + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Form_Provider_0500 + * @tc.name: promise form isRequestPublishFormSupported system interface interception test + * @tc.desc: Test the third-party application call isRequestPublishFormSupported will be blocked + * @tc.level 3 + */ + it('System_API_Test_Form_Provider_0500',0, async function (done) { + let TAG = 'System_API_Test_Form_Provider_0500'; + try { + formProvider.isRequestPublishFormSupported().then((data) => { + console.log(TAG + ' formProvider isRequestPublishFormSupported success'); + }).catch((error) => { + console.log(TAG + ' formProvider isRequestPublishFormSupported, error: ' + JSON.stringify(error)); + expect(error.code).assertEqual(ERROR_CODE); + done(); + }); + } catch (error) { + console.log(TAG + ` catch err->${JSON.stringify(error)}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..62990200d --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/List.test.ets @@ -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 abilityManagerTest from './AbilityManager.test' +import appManagerTest from './AppManager.test' +import missionManagerTest from './MissionManager.test' +import wantAgentTest from './WantAgent.test' +import formHostTest from './FormHost.test' +import formProviderTest from './FormProvider.test' +import abilityContextTest from './AbilityContext.test' +import contextTest from './Context.test' + +export default function testsuite() { + abilityManagerTest(); + appManagerTest(); + missionManagerTest(); + wantAgentTest(); + formHostTest(); + formProviderTest(); + abilityContextTest(); + contextTest(); +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/MissionManager.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/MissionManager.test.ets new file mode 100644 index 000000000..d719c5407 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/MissionManager.test.ets @@ -0,0 +1,436 @@ +/* + * 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' +import missionManager from "@ohos.app.ability.missionManager" + +let ERROR_CODE = 202; +export default function missionManagerTest() { + describe('missionManagerTest', function () { + + /** + * @tc.number: System_API_Test_Mission_Manager_0100 + * @tc.name: missionManager.on system interface interception test + * @tc.desc: Test the third-party application call missionManager.on will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0100', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0100'; + let listener = { + onMissionCreated: function (mission) { console.log("--------onMissionCreated-------") }, + onMissionDestroyed: function (mission) { console.log("--------onMissionDestroyed-------") }, + onMissionSnapshotChanged: function (mission) { console.log("--------onMissionSnapshotChanged-------") }, + onMissionLabelUpdated: function (mission) { console.log("--------onMissionLabelUpdated-------") }, + onMissionMovedToFront: function (mission) { console.log("--------onMissionMovedToFront-------") }, + onMissionIconUpdated: function (mission, icon) { console.log("--------onMissionIconUpdated-------") }, + onMissionClosed: function (mission) { console.log("--------onMissionClosed-------") } + }; + try { + const observerCode = missionManager.on("mission", listener); + console.log('-------- observerCode: ---------', observerCode); + } catch (err) { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0200 + * @tc.name: callback form getMissionInfo system interface interception test + * @tc.desc: Test the third-party application call getMissionInfo will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0200', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0200'; + let deviceId = "deviceId"; + let missionId = 0; + missionManager.getMissionInfo(deviceId, missionId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0300 + * @tc.name: promise form getMissionInfo system interface interception test + * @tc.desc: Test the third-party application call getMissionInfo will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0300', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0300'; + let deviceId = "deviceId"; + let missionId = 0; + missionManager.getMissionInfo(deviceId, missionId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0400 + * @tc.name: callback form getMissionInfos system interface interception test + * @tc.desc: Test the third-party application call getMissionInfos will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0400', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0400'; + let deviceId = "deviceId"; + let numMax = 10; + missionManager.getMissionInfos(deviceId, numMax, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0500 + * @tc.name: promise form getMissionInfos system interface interception test + * @tc.desc: Test the third-party application call getMissionInfos will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0500', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0500'; + let deviceId = "deviceId"; + let numMax = 10; + missionManager.getMissionInfos(deviceId, numMax) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0600 + * @tc.name: callback form getMissionSnapShot system interface interception test + * @tc.desc: Test the third-party application call getMissionSnapShot will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0600', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0600'; + let deviceId = "deviceId"; + let missionId = 0; + missionManager.getMissionSnapShot(deviceId, missionId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0700 + * @tc.name: promise form isRequestPublishFormSupported system interface interception test + * @tc.desc: Test the third-party application call isRequestPublishFormSupported will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0700', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0700'; + let deviceId = "deviceId"; + let missionId = 0; + missionManager.getMissionSnapShot(deviceId, missionId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0800 + * @tc.name: promise form getLowResolutionMissionSnapShot system interface interception test + * @tc.desc: Test the third-party application call getLowResolutionMissionSnapShot will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0800', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0800'; + let deviceId = "deviceId"; + let missionId = 0; + missionManager.getLowResolutionMissionSnapShot(deviceId, missionId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_0900 + * @tc.name: promise form getLowResolutionMissionSnapShot system interface interception test + * @tc.desc: Test the third-party application call getLowResolutionMissionSnapShot will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_0900', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_0900'; + let deviceId = "deviceId"; + let missionId = 0; + missionManager.getLowResolutionMissionSnapShot(deviceId, missionId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1000 + * @tc.name: callback form lockMission system interface interception test + * @tc.desc: Test the third-party application call lockMission will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1000', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1000'; + let missionId = 0; + missionManager.lockMission(missionId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1100 + * @tc.name: promise form lockMission system interface interception test + * @tc.desc: Test the third-party application call lockMission will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1100', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1100'; + let missionId = 0; + missionManager.lockMission(missionId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1200 + * @tc.name: callback form unlockMission system interface interception test + * @tc.desc: Test the third-party application call unlockMission will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1200', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1200'; + let missionId = 0; + missionManager.unlockMission(missionId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1300 + * @tc.name: promise form unlockMission system interface interception test + * @tc.desc: Test the third-party application call unlockMission will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1300', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1300'; + let missionId = 0; + missionManager.unlockMission(missionId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1400 + * @tc.name: callback form clearMission system interface interception test + * @tc.desc: Test the third-party application call clearMission will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1400', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1400'; + let missionId = 0; + missionManager.clearMission(missionId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1500 + * @tc.name: promise form clearMission system interface interception test + * @tc.desc: Test the third-party application call clearMission will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1500', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1500'; + let missionId = 0; + missionManager.clearMission(missionId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1600 + * @tc.name: callback form clearAllMissions system interface interception test + * @tc.desc: Test the third-party application call clearAllMissions will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1600', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1600'; + missionManager.clearAllMissions((err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1700 + * @tc.name: promise form clearAllMissions system interface interception test + * @tc.desc: Test the third-party application call clearAllMissions will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1700', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1700'; + missionManager.clearAllMissions() + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1800 + * @tc.name: callback form moveMissionToFront system interface interception test + * @tc.desc: Test the third-party application call moveMissionToFront will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1800', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1800'; + let missionId = 0; + missionManager.moveMissionToFront(missionId, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_1900 + * @tc.name: promise form moveMissionToFront system interface interception test + * @tc.desc: Test the third-party application call moveMissionToFront will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_1900', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_1900'; + let missionId = 0; + missionManager.moveMissionToFront(missionId) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_2000 + * @tc.name: Multi-parameter moveMissionToFront system interface interception test in the form of callback + * @tc.desc: Test the third-party application call moveMissionToFront will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_2000', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_2000'; + let missionId = 0; + missionManager.moveMissionToFront(missionId, { windowMode: 101 }, (err) => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }); + }) + + /** + * @tc.number: System_API_Test_Mission_Manager_2100 + * @tc.name: Multi-parameter moveMissionToFront system interface interception test in the form of promise + * @tc.desc: Test the third-party application call moveMissionToFront will be blocked + * @tc.level 3 + */ + it('System_API_Test_Mission_Manager_2100', 0, function (done) { + let TAG = 'System_API_Test_Mission_Manager_2100'; + let missionId = 0; + missionManager.moveMissionToFront(missionId, { windowMode: 101 }) + .then(err => { + console.log(TAG + ` err->${JSON.stringify(err)}`); + expect().assertFail(); + done(); + }) + .catch(err => { + console.log(TAG + " err.code: " + err.code); + expect(err.code).assertEqual(ERROR_CODE); + done(); + }) + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/WantAgent.test.ets b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/WantAgent.test.ets new file mode 100644 index 000000000..83647d8fe --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/WantAgent.test.ets @@ -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 { describe, it, expect } from '@ohos/hypium' +import WantAgent from '@ohos.app.ability.wantAgent' + +let ERROR_CODE = 202; + +export default function wantAgentTest() { + describe('wantAgentTest', function () { + + /** + * @tc.number: SUB_AA_OpenHarmony_Context_0100 + * @tc.name: callback form getWant system interface interception test + * @tc.desc: Test the third-party application call getWant will be blocked + * @tc.level 3 + */ + it('System_API_Test_WantAgent_Manager_0100',0, async function (done) { + let TAG = 'System_API_Test_WantAgent_Manager_0100'; + let wantAgent; + try { + WantAgent.getWant(wantAgent, (error, data) => { + console.info(TAG + " ==========================>getWantCallback=======================>"); + }) + } catch (error) { + console.info(TAG + ` getWantCallback err: + ${error.code} + ${error.message}`); + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + + /** + * @tc.number: SUB_AA_OpenHarmony_Context_0100 + * @tc.name: promise form getWant system interface interception test + * @tc.desc: Test the third-party application call getWant will be blocked + * @tc.level 3 + */ + it('System_API_Test_QuickFix_Manager_0200',0, async function (done) { + let TAG = 'System_API_Test_QuickFix_Manager_0200'; + let wantAgent; + try { + WantAgent.getWant(wantAgent).then().catch(); + } catch (error) { + console.info(TAG + ` getWantCallback err: + ${error.code} + ${error.message}`) + expect(error.code).assertEqual(ERROR_CODE); + done(); + } + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/module.json b/ability/ability_runtime/actssystemapitest/entry/src/main/module.json new file mode 100644 index 000000000..f737641a3 --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/module.json @@ -0,0 +1,27 @@ +{ + "module": { + "name": "entry_test", + "type": "entry", + "srcEntrance": "./ets/Application/MyAbilityStage.ts", + "description": "$string:entry_test_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", + "visible": true + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..8c06d7f3a --- /dev/null +++ b/ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "entry_test_desc", + "value": "description" + }, + { + "name": "app_name", + "value": "ActsSystemAPITest" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "entry_MainAbility" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actssystemapitest/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(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