提交 ef8e179b 编写于 作者: C chengxingzhen

XTS元能力用例适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 258b0fdd
...@@ -288,7 +288,7 @@ export default function getHapModuleInfoJsunit() { ...@@ -288,7 +288,7 @@ export default function getHapModuleInfoJsunit() {
expect(info.systemApp).assertEqual(true); expect(info.systemApp).assertEqual(true);
expect(info.enabled).assertEqual(true); expect(info.enabled).assertEqual(true);
expect(info.label).assertEqual("$string:entry_MainAbility"); expect(info.label).assertEqual("$string:entry_MainAbility");
expect(info.icon).assertEqual("$media:icon"); expect(info.icon).assertEqual("");
expect(info.process).assertEqual("com.ohos.acecollaboration"); expect(info.process).assertEqual("com.ohos.acecollaboration");
expect(info.supportedModes).assertEqual(0); expect(info.supportedModes).assertEqual(0);
expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" + expect(info.entryDir).assertEqual("/data/app/el1/bundle/public/" +
......
...@@ -94,7 +94,7 @@ export default function getHapModuleInfoJsunit() { ...@@ -94,7 +94,7 @@ export default function getHapModuleInfoJsunit() {
for (var k = 0; k < data.deviceTypes.length; k++) { for (var k = 0; k < data.deviceTypes.length; k++) {
console.log(msg + "getHapModuleInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]); console.log(msg + "getHapModuleInfo data.deviceTypes[" + k + "] : " + data.deviceTypes[k]);
} }
console.log(msg + "checkHapModuleInfo abilityInfos length : " + data.abilityInfos.length); console.log(msg + "checkHapModuleInfo abilityInfos length : " + data.abilityInfo.length);
console.log(msg + "checkHapModuleInfo moduleName : " + data.moduleName); console.log(msg + "checkHapModuleInfo moduleName : " + data.moduleName);
console.log(msg + "checkHapModuleInfo mainAbilityName : " + data.mainAbilityName); console.log(msg + "checkHapModuleInfo mainAbilityName : " + data.mainAbilityName);
console.log(msg + "checkHapModuleInfo installationFree : " + data.installationFree); console.log(msg + "checkHapModuleInfo installationFree : " + data.installationFree);
...@@ -110,23 +110,23 @@ export default function getHapModuleInfoJsunit() { ...@@ -110,23 +110,23 @@ export default function getHapModuleInfoJsunit() {
expect(typeof (data.supportedModes)).assertEqual("number"); expect(typeof (data.supportedModes)).assertEqual("number");
expect(Array.isArray(data.reqCapabilities)).assertEqual(true); expect(Array.isArray(data.reqCapabilities)).assertEqual(true);
expect(Array.isArray(data.deviceTypes)).assertEqual(true); expect(Array.isArray(data.deviceTypes)).assertEqual(true);
expect(Array.isArray(data.abilityInfos)).assertEqual(true); expect(Array.isArray(data.abilityInfo)).assertEqual(true);
expect(typeof (data.moduleName)).assertEqual("string"); expect(typeof (data.moduleName)).assertEqual("string");
expect(typeof (data.mainAbilityName)).assertEqual("string"); expect(typeof (data.mainAbilityName)).assertEqual("string");
expect(typeof (data.installationFree)).assertEqual("boolean"); expect(typeof (data.installationFree)).assertEqual("boolean");
expect(data.name).assertEqual("com.ohos.acecollaboration"); expect(data.name).assertEqual("com.ohos.acecollaboration.MyApplication");
expect(data.description).assertEqual(""); expect(data.description).assertEqual("");
expect(data.descriptionId).assertEqual(0); expect(data.descriptionId).assertEqual(0);
expect(data.icon).assertEqual("$media:icon"); expect(data.icon).assertEqual("$media:icon");
expect(data.label).assertEqual("$string:entry_MainAbility"); expect(data.label).assertEqual("$string:entry_MainAbility");
expect(data.labelId).assertEqual(0); expect(data.labelId).assertEqual(16777224);
expect(data.iconId).assertEqual(0); expect(data.iconId).assertEqual(16777227);
expect(data.backgroundImg).assertEqual(""); expect(data.backgroundImg).assertEqual("");
expect(data.supportedModes).assertEqual(0); expect(data.supportedModes).assertEqual(0);
expect(data.deviceTypes[0]).assertEqual("phone"); expect(data.deviceTypes[0]).assertEqual("phone");
checkAbilityInfo(msg,data.abilityInfos[0]); checkAbilityInfo(msg,data.abilityInfo[0]);
expect(data.moduleName).assertEqual("entry") expect(data.moduleName).assertEqual("entry")
expect(data.mainAbilityName).assertEqual(""); expect(data.mainAbilityName).assertEqual("com.ohos.acecollaboration.MainAbility");
expect(data.installationFree).assertEqual(false); expect(data.installationFree).assertEqual(false);
console.log(msg + "---checkHapModuleInfo End---"); console.log(msg + "---checkHapModuleInfo End---");
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"module": { "module": {
"package": "com.example.actsfeatureabilitytest", "package": "com.example.actsfeatureabilitytest",
"name": ".MyApplication", "name": ".MyApplication",
"mainAbility": "com.example.actsfeatureabilitytest.MainAbility",
"deviceType": [ "deviceType": [
"phone" "phone"
], ],
......
...@@ -847,7 +847,7 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -847,7 +847,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(info.enabled).assertEqual(true); expect(info.enabled).assertEqual(true);
expect(info.label).assertEqual("$string:app_name"); expect(info.label).assertEqual("$string:app_name");
// expect(info.labelId).assertEqual(0); //create by DevEco when building HAP. // expect(info.labelId).assertEqual(0); //create by DevEco when building HAP.
expect(info.icon).assertEqual("$media:icon"); expect(info.icon).assertEqual('');
// expect(info.iconId).assertEqual(0); //create by DevEco when building HAP. // expect(info.iconId).assertEqual(0); //create by DevEco when building HAP.
expect(info.process).assertEqual("processTest"); expect(info.process).assertEqual("processTest");
expect(info.supportedModes).assertEqual(0); expect(info.supportedModes).assertEqual(0);
...@@ -1060,7 +1060,7 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1060,7 +1060,7 @@ describe('ActsFeatureAbilityTest', function () {
// checkAbilityInfo // checkAbilityInfo
function checkAbilityInfo(data) { function checkAbilityInfo(data) {
console.info("checkAbilityInfo start " + data); console.info("checkAbilityInfo start " + JSON.stringify(data));
expect(typeof (data)).assertEqual("object"); expect(typeof (data)).assertEqual("object");
expect(typeof (data.bundleName)).assertEqual("string"); expect(typeof (data.bundleName)).assertEqual("string");
...@@ -1104,7 +1104,7 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1104,7 +1104,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(data.moduleName).assertEqual("entry"); expect(data.moduleName).assertEqual("entry");
expect(data.process).assertEqual("processTestAbility"); expect(data.process).assertEqual("processTestAbility");
expect(data.targetAbility).assertEqual(""); expect(data.targetAbility).assertEqual("");
expect(data.backgroundModes).assertEqual(0); expect(data.backgroundModes).assertEqual(1);
expect(data.isVisible).assertEqual(true); expect(data.isVisible).assertEqual(true);
expect(data.formEnabled).assertEqual(false); expect(data.formEnabled).assertEqual(false);
expect(data.type).assertEqual(1); expect(data.type).assertEqual(1);
...@@ -1185,20 +1185,20 @@ describe('ActsFeatureAbilityTest', function () { ...@@ -1185,20 +1185,20 @@ describe('ActsFeatureAbilityTest', function () {
expect(typeof (data.moduleName)).assertEqual("string"); expect(typeof (data.moduleName)).assertEqual("string");
expect(typeof (data.mainAbilityName)).assertEqual("string"); expect(typeof (data.mainAbilityName)).assertEqual("string");
expect(typeof (data.installationFree)).assertEqual("boolean"); expect(typeof (data.installationFree)).assertEqual("boolean");
expect(data.name).assertEqual("com.example.actsfeatureabilitytest"); expect(data.name).assertEqual("com.example.actsfeatureabilitytest.MyApplication");
expect(data.description).assertEqual("descriptionTest"); expect(data.description).assertEqual("descriptionTest");
expect(data.descriptionId).assertEqual(0); expect(data.descriptionId).assertEqual(0);
expect(data.icon).assertEqual("$media:icon"); expect(data.icon).assertEqual("$media:icon");
expect(data.label).assertEqual("$string:app_name"); expect(data.label).assertEqual("$string:app_name");
expect(data.labelId).assertEqual(0); expect(data.labelId).assertEqual(16777216);
expect(data.iconId).assertEqual(0); expect(data.iconId).assertEqual(16777219);
expect(data.backgroundImg).assertEqual(""); expect(data.backgroundImg).assertEqual("");
expect(data.supportedModes).assertEqual(0); expect(data.supportedModes).assertEqual(0);
expect(data.reqCapabilities[0]).assertEqual("reqCapabilitiesTest1"); expect(data.reqCapabilities[0]).assertEqual("reqCapabilitiesTest1");
expect(data.reqCapabilities[1]).assertEqual("reqCapabilitiesTest2"); expect(data.reqCapabilities[1]).assertEqual("reqCapabilitiesTest2");
expect(data.deviceTypes[0]).assertEqual("phone"); expect(data.deviceTypes[0]).assertEqual("phone");
expect(data.moduleName).assertEqual("entry") expect(data.moduleName).assertEqual("entry")
expect(data.mainAbilityName).assertEqual(""); expect(data.mainAbilityName).assertEqual("com.example.actsfeatureabilitytest.MainAbility");
expect(data.installationFree).assertEqual(false); expect(data.installationFree).assertEqual(false);
console.info("checkHapModuleInfo end " + data); console.info("checkHapModuleInfo end " + data);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册