From f19c2c47b39ed5afdcc8d239c242999abe6aa01f Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Mon, 29 Aug 2022 20:04:52 +0800 Subject: [PATCH] =?UTF-8?q?XTS=E5=AF=B9=E9=BD=90HO=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- .../entry/src/main/config.json | 2 +- .../test/getAbilityInfoJsunit.test.ets | 2 +- .../test/getHapModuleInfoJsunit.test.ets | 4 +- .../src/main/js/test/ContextJsunit.test.js | 1 - .../entry/src/main/config.json | 2 +- .../main/js/test/FeatureAbilityJsunit.test.js | 7 ++-- .../main/js/test/StartAbilityJsunit.test.js | 42 ------------------- 7 files changed, 8 insertions(+), 52 deletions(-) diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json index 71c5e3628..0de4966db 100644 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json +++ b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/config.json @@ -18,7 +18,7 @@ "name": ".MyApplication", "mainAbility": "com.ohos.acecollaboration.MainAbility", "deviceType": [ - "phone" + "default" ], "reqPermissions": [ { diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets index a843beab5..c4ad56cd4 100644 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets +++ b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getAbilityInfoJsunit.test.ets @@ -191,7 +191,7 @@ export default function getHapModuleInfoJsunit() { expect(data.type).assertEqual(1); expect(data.orientation).assertEqual(0); expect(data.launchMode).assertEqual(1); - expect(data.deviceTypes[0]).assertEqual("phone"); + expect(data.deviceTypes[0]).assertEqual("default"); expect(data.readPermission).assertEqual(""); expect(data.writePermission).assertEqual(""); checkApplicationInfo(msg, data.applicationInfo); diff --git a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets index 7aa743e99..ff0918bd4 100644 --- a/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets +++ b/aafwk/aafwk_standard/actsabilitymanageretstest/entry/src/main/ets/MainAbility/test/getHapModuleInfoJsunit.test.ets @@ -123,7 +123,7 @@ export default function getHapModuleInfoJsunit() { expect(data.iconId).assertEqual(16777227); expect(data.backgroundImg).assertEqual(""); expect(data.supportedModes).assertEqual(0); - expect(data.deviceTypes[0]).assertEqual("phone"); + expect(data.deviceTypes[0]).assertEqual("default"); checkAbilityInfo(msg,data.abilityInfo[0]); expect(data.moduleName).assertEqual("entry") expect(data.mainAbilityName).assertEqual("com.ohos.acecollaboration.MainAbility"); @@ -216,7 +216,7 @@ export default function getHapModuleInfoJsunit() { expect(data.type).assertEqual(1); expect(data.orientation).assertEqual(0); expect(data.launchMode).assertEqual(1); - expect(data.deviceTypes[0]).assertEqual("phone"); + expect(data.deviceTypes[0]).assertEqual("default"); expect(data.readPermission).assertEqual(""); expect(data.writePermission).assertEqual(""); expect(data.formEntity).assertEqual(0); diff --git a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js b/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js index f476f53b3..5202dac85 100644 --- a/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js +++ b/aafwk/aafwk_standard/context/actscontexttest/entry/src/main/js/test/ContextJsunit.test.js @@ -56,7 +56,6 @@ describe('ActsContextTest', function () { var context = featureAbility.getContext(); var info = context.getBundleName( (err, data) => { - expect(err.code).assertEqual(0); expect(data).assertEqual('com.example.actscontext'); ret = true done(); diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json index 77cecc09f..64c2de4f1 100644 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json @@ -22,7 +22,7 @@ "name": ".MyApplication", "mainAbility": "com.example.actsfeatureabilitytest.MainAbility", "deviceType": [ - "phone" + "default" ], "distro": { "deliveryWithInstall": true, diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js index b47cf3c8e..33efd1ccb 100755 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js +++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js @@ -167,8 +167,7 @@ describe('ActsFeatureAbilityTest', function () { it('ACTS_HasWindowFocus_0300', 0, async function (done) { let result = featureAbility.hasWindowFocus( (err, data) => { - console.info("hasWindowFocus asyncCallback code: " + err.code + " data: " + data); - expect(err.code).assertEqual(0); + console.info("hasWindowFocus asyncCallback data: " + data); expect(data).assertTrue(); done() } @@ -1113,7 +1112,7 @@ describe('ActsFeatureAbilityTest', function () { expect(data.launchMode).assertEqual(0); expect(data.permissions[0]).assertEqual("ohos.permission.ACCELEROMETER"); - expect(data.deviceTypes[0]).assertEqual("phone"); + expect(data.deviceTypes[0]).assertEqual("default"); expect(data.deviceCapabilities[0]).assertEqual("SystemCapability.Ability.AbilityBase"); expect(data.readPermission).assertEqual(""); @@ -1196,7 +1195,7 @@ describe('ActsFeatureAbilityTest', function () { expect(data.supportedModes).assertEqual(0); expect(data.reqCapabilities[0]).assertEqual("reqCapabilitiesTest1"); expect(data.reqCapabilities[1]).assertEqual("reqCapabilitiesTest2"); - expect(data.deviceTypes[0]).assertEqual("phone"); + expect(data.deviceTypes[0]).assertEqual("default"); expect(data.moduleName).assertEqual("entry") expect(data.mainAbilityName).assertEqual("com.example.actsfeatureabilitytest.MainAbility"); expect(data.installationFree).assertEqual(false); diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js index 36d5ac0c2..9186a1b80 100644 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js +++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js @@ -141,48 +141,6 @@ describe('ConnectAbilityTest', function () { }) }) - /* - * @tc.number: SUB_AA_JsApi_Ability_0700 - * @tc.name: testAblity0700. - * @tc.desc: startAbility-want-configuration action+entities-entities is configured as a string.(by promise) - */ - it("SUB_AA_JsApi_Ability_0700", 0, async function (done) { - let parameter = { - 'want': { - 'action': 'action.ohos.acts.aafwk.jsapi.MainAbility', - 'entities': 'abc123' - } - } - await featureAbility.startAbility(parameter).then((data) => { - console.log('testAblity0700 data: ' + JSON.stringify(data)) - expect().assertFail() - }).catch((error) => { - console.log('testAblity0700 error: ' + JSON.stringify(error)) - expect(errCode).assertEqual(error.code) - }) - done() - }) - - /* - * @tc.number: SUB_AA_JsApi_Ability_0800 - * @tc.name: testAblity0800. - * @tc.desc: startAbility-want-configuration action+entities-entities is configured as a string.(by callback) - */ - it("SUB_AA_JsApi_Ability_0800", 0, async function (done) { - let parameter = { - 'want': { - 'action': 'action.ohos.acts.aafwk.jsapi.MainAbility', - 'entities': 'abc123' - } - } - featureAbility.startAbility((parameter), (error, data) => { - console.log('testAblity0800 data: ' + JSON.stringify(data)) - console.log('testAblity0800 error: ' + JSON.stringify(error)) - expect(errCode).assertEqual(error.code) - done() - }) - }) - /* * @tc.number: SUB_AA_JsApi_Ability_0900 * @tc.name: testAblity0900. -- GitLab