提交 d29f0374 编写于 作者: B bayanxing

ActsGetWantAllTest、ExampleJsunit checkstyle问题整改

Signed-off-by: Nbayanxing <bayanxing@kaihongdigi.com>
上级 cc070174
......@@ -146,29 +146,7 @@ describe('ActsGetWantTest', function () {
},
},
}).then((data) => {
console.info('====> ACTS_GetWant_0300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.entities[1]).assertEqual("entity2");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("!@#$%");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_0300 before done=====>')
checkOnAbilityResult0300(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
......@@ -179,6 +157,32 @@ describe('ActsGetWantTest', function () {
})
})
function checkOnAbilityResult0300(data) {
console.info('====> ACTS_GetWant_0300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.entities[1]).assertEqual("entity2");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("!@#$%");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_0300 before done=====>')
}
// @tc.number: ACTS_GetWant_0400
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -207,35 +211,39 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_0400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.entities[1]).assertEqual("entity2");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("!@#$%");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_0400 before done=====>')
checkOnAbilityResult0400(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult0400(data) {
console.info('====> ACTS_GetWant_0400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.entities[1]).assertEqual("entity2");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("!@#$%");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_0400 before done=====>')
}
// @tc.number: ACTS_GetWant_0500
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -438,34 +446,38 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_0800 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_0800 before done=====>')
checkOnAbilityResult0800(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult0800(data) {
console.info('====> ACTS_GetWant_0800 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_0800 before done=====>')
}
// @tc.number: ACTS_GetWant_0900
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -553,34 +565,38 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_1000 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1000 before done=====>')
checkOnAbilityResult1000(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult1000(data) {
console.info('====> ACTS_GetWant_1000 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1000 before done=====>')
}
// @tc.number: ACTS_GetWant_1100
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -607,27 +623,7 @@ describe('ActsGetWantTest', function () {
},
},
}).then((data) => {
console.info('====> ACTS_GetWant_1100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1100 before done=====>')
checkOnAbilityResult1100(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
......@@ -638,6 +634,30 @@ describe('ActsGetWantTest', function () {
})
})
function checkOnAbilityResult1100(data) {
console.info('====> ACTS_GetWant_1100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1100 before done=====>')
}
// @tc.number: ACTS_GetWant_1200
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -779,34 +799,38 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_1400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_NOT_OHOS_COMPONENT);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1400 before done=====>')
checkOnAbilityResult1400(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult1400(data) {
console.info('====> ACTS_GetWant_1400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_NOT_OHOS_COMPONENT);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1400 before done=====>')
}
// @tc.number: ACTS_GetWant_1500
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -834,28 +858,7 @@ describe('ActsGetWantTest', function () {
},
},
}).then((data) => {
console.info('====> ACTS_GetWant_1500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITYSLICE_MULTI_DEVICE );
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1500 setTimeout before done.=====>')
checkOnAbilityResult1500(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
......@@ -866,6 +869,31 @@ describe('ActsGetWantTest', function () {
})
})
function checkOnAbilityResult1500(data) {
console.info('====> ACTS_GetWant_1500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITYSLICE_MULTI_DEVICE );
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1500 setTimeout before done.=====>')
}
// @tc.number: ACTS_GetWant_1600
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -1064,28 +1092,7 @@ describe('ActsGetWantTest', function () {
},
},
}).then((data) => {
console.info('====> ACTS_GetWant_1900 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1900 setTimeout before done.=====>')
checkOnAbilityResult1900(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
......@@ -1096,6 +1103,31 @@ describe('ActsGetWantTest', function () {
})
})
function checkOnAbilityResult1900(data) {
console.info('====> ACTS_GetWant_1900 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1900 setTimeout before done.=====>')
}
// @tc.number: ACTS_GetWant_2000
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -1124,34 +1156,38 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_2000 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2000 setTimeout before done.=====>')
checkOnAbilityResult2000(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult2000(data) {
console.info('====> ACTS_GetWant_2000 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2000 setTimeout before done.=====>')
}
// @tc.number: ACTS_GetWant_2100
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -1179,28 +1215,7 @@ describe('ActsGetWantTest', function () {
},
},
}).then((data) => {
console.info('====> ACTS_GetWant_2100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_CLEAR_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2100 setTimeout before done.=====>')
checkOnAbilityResult2100(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
......@@ -1211,6 +1226,31 @@ describe('ActsGetWantTest', function () {
})
})
function checkOnAbilityResult2100(data) {
console.info('====> ACTS_GetWant_2100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_CLEAR_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2100 setTimeout before done.=====>')
}
// @tc.number: ACTS_GetWant_2200
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -1239,34 +1279,38 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_2200 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_CLEAR_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2200 setTimeout before done.=====>')
checkOnAbilityResult2200(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult2200(data) {
console.info('====> ACTS_GetWant_2200 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_CLEAR_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2200 setTimeout before done.=====>')
}
// @tc.number: ACTS_GetWant_2300
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -1294,28 +1338,7 @@ describe('ActsGetWantTest', function () {
},
},
}).then((data) => {
console.info('====> ACTS_GetWant_2300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_NEW_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2300 setTimeout before done.=====>')
checkOnAbilityResult2300(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
......@@ -1326,6 +1349,31 @@ describe('ActsGetWantTest', function () {
})
})
function checkOnAbilityResult2300(data) {
console.info('====> ACTS_GetWant_2300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_NEW_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2300 setTimeout before done.=====>')
}
// @tc.number: ACTS_GetWant_2400
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -1354,33 +1402,37 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_2400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_NEW_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2400 setTimeout before done.=====>')
checkOnAbilityResult2400(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult2400(data) {
console.info('====> ACTS_GetWant_2400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_NEW_MISSION);
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.0000000003);
expect(data.want.parameters.mykey2).assertEqual("[a, b, c]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2400 setTimeout before done.=====>')
}
/*
* @tc.number ACTS_GetWant_2500
......@@ -1411,28 +1463,7 @@ describe('ActsGetWantTest', function () {
},
},
}).then((data) => {
console.info('====> ACTS_GetWant_2500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT );
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("test123");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_2500 before done=====>')
checkOnAbilityResult2500(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
......@@ -1443,6 +1474,31 @@ describe('ActsGetWantTest', function () {
})
});
function checkOnAbilityResult2500(data) {
console.info('====> ACTS_GetWant_2500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT );
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("test123");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_2500 before done=====>')
}
/*
* @tc.number ACTS_GetWant_2600
* @tc.name Misconfigured bundlename validation
......@@ -1473,34 +1529,38 @@ describe('ActsGetWantTest', function () {
},
},
(err, data) => {
console.info('====> ACTS_GetWant_2600 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT );
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("test123");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_2600 before done=====>')
checkOnAbilityResult2600(data);
setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
});
function checkOnAbilityResult2600(data) {
console.info('====> ACTS_GetWant_2600 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action2");
expect(data.want.entities[0]).assertEqual("entity1");
expect(data.want.type).assertEqual("MIMETYPE");
expect(data.want.uri).assertEqual("key={true,true,false}");
expect(data.want.flags).assertEqual(wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT );
expect(data.want.parameters.mykey0).assertEqual(0.1);
expect(data.want.parameters.mykey1[0]).assertEqual(0.1);
expect(data.want.parameters.mykey1[1]).assertEqual(0.2);
expect(data.want.parameters.mykey1[2]).assertEqual(0.3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("test123");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_2600 before done=====>')
}
/**
* @tc.number: SUB_AA_OpenHarmony_wantConstantEnumeration_0100
* @tc.name: Check the enumerated value ACTION_IMAGE_CAPTURE of wantConstant.
......
......@@ -95,56 +95,61 @@ describe('ActsBundleManagerTest', function () {
*/
it('getBundleInfo_0200', 0, async function (done) {
await demo.getBundleInfo(NAME1,
demo.BundleFlag.GET_BUNDLE_WITH_ABILITIES | demo.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION, OnReceiveEvent);
demo.BundleFlag.GET_BUNDLE_WITH_ABILITIES | demo.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION,
OnReceiveEvent);
function OnReceiveEvent(err, datainfo) {
console.info("getBundleInfo_0200 dataInfo ====" + datainfo);
expect(datainfo.name).assertEqual(NAME1);
expect(datainfo.vendor).assertEqual("example");
expect(datainfo.versionCode).assertEqual(VERSIONCODE1);
expect(datainfo.versionName).assertEqual("1.0");
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.compatibleVersion).assertEqual(5);
expect(datainfo.targetVersion).assertEqual(5);
expect(datainfo.uid).assertLarger(0);
expect(datainfo.appId).assertContain(NAME1);
expect(datainfo.type).assertEqual("");
expect(datainfo.cpuAbi).assertEqual("");
expect(datainfo.appInfo.name).assertEqual(NAME1);
expect(datainfo.appInfo.description).assertEqual(DESCRIPTION);
expect(datainfo.appInfo.descriptionId >= 0).assertTrue();
expect(datainfo.appInfo.icon).assertEqual("$media:icon");
expect(datainfo.appInfo.iconId >= 0).assertTrue();
expect(datainfo.appInfo.label).assertEqual("$string:app_name");
expect(datainfo.appInfo.labelId >= 0).assertTrue();
expect(datainfo.appInfo.systemApp).assertEqual(true);
expect(datainfo.appInfo.supportedModes).assertEqual(0);
expect(datainfo.installTime).assertLarger(0);
expect(datainfo.updateTime).assertLarger(0);
expect(datainfo.reqPermissions[0]).assertEqual("com.permission.PERMISSION_A");
expect(datainfo.reqPermissionDetails[0].name).assertEqual("com.permission.PERMISSION_A");
expect(datainfo.reqPermissionDetails[0].reason).assertEqual("Need PERMISSION_A");
expect(datainfo.reqPermissionDetails[0].usedScene.abilities[0]).assertEqual(NAME1 + ".MainAbility");
expect(datainfo.reqPermissionDetails[0].usedScene.when).assertEqual("always");
expect(datainfo.compatibleVersion).assertEqual(5);
expect(datainfo.targetVersion).assertEqual(5);
expect(datainfo.isCompressNativeLibs).assertEqual(false);
for (let s = 0; s < datainfo.hapModuleInfos; s++) {
expect(datainfo.moduleInfos[s].name).assertEqual("com.example.myapplication1");
expect(datainfo.moduleInfos[s].moduleName).assertEqual("entry");
}
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.isSilentInstallation.length).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(0);
expect(datainfo.entryInstallationFree).assertEqual(false);
for (let j = 0; j < datainfo.appInfo.moduleInfos; j++) {
expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry");
expect(datainfo.appInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1);
}
expect(datainfo.appInfo.enabled).assertEqual(true);
checkBundleInfo0200(datainfo)
done();
}
})
function checkBundleInfo0200(datainfo) {
console.info("getBundleInfo_0200 dataInfo ====" + datainfo);
expect(datainfo.name).assertEqual(NAME1);
expect(datainfo.vendor).assertEqual("example");
expect(datainfo.versionCode).assertEqual(VERSIONCODE1);
expect(datainfo.versionName).assertEqual("1.0");
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.compatibleVersion).assertEqual(5);
expect(datainfo.targetVersion).assertEqual(5);
expect(datainfo.uid).assertLarger(0);
expect(datainfo.appId).assertContain(NAME1);
expect(datainfo.type).assertEqual("");
expect(datainfo.cpuAbi).assertEqual("");
expect(datainfo.appInfo.name).assertEqual(NAME1);
expect(datainfo.appInfo.description).assertEqual(DESCRIPTION);
expect(datainfo.appInfo.descriptionId >= 0).assertTrue();
expect(datainfo.appInfo.icon).assertEqual("$media:icon");
expect(datainfo.appInfo.iconId >= 0).assertTrue();
expect(datainfo.appInfo.label).assertEqual("$string:app_name");
expect(datainfo.appInfo.labelId >= 0).assertTrue();
expect(datainfo.appInfo.systemApp).assertEqual(true);
expect(datainfo.appInfo.supportedModes).assertEqual(0);
expect(datainfo.installTime).assertLarger(0);
expect(datainfo.updateTime).assertLarger(0);
expect(datainfo.reqPermissions[0]).assertEqual("com.permission.PERMISSION_A");
expect(datainfo.reqPermissionDetails[0].name).assertEqual("com.permission.PERMISSION_A");
expect(datainfo.reqPermissionDetails[0].reason).assertEqual("Need PERMISSION_A");
expect(datainfo.reqPermissionDetails[0].usedScene.abilities[0]).assertEqual(NAME1 + ".MainAbility");
expect(datainfo.reqPermissionDetails[0].usedScene.when).assertEqual("always");
expect(datainfo.compatibleVersion).assertEqual(5);
expect(datainfo.targetVersion).assertEqual(5);
expect(datainfo.isCompressNativeLibs).assertEqual(false);
for (let s = 0; s < datainfo.hapModuleInfos; s++) {
expect(datainfo.moduleInfos[s].name).assertEqual("com.example.myapplication1");
expect(datainfo.moduleInfos[s].moduleName).assertEqual("entry");
}
expect(datainfo.entryModuleName).assertEqual("entry");
expect(datainfo.isSilentInstallation.length).assertEqual(0);
expect(datainfo.minCompatibleVersionCode).assertEqual(0);
expect(datainfo.entryInstallationFree).assertEqual(false);
for (let j = 0; j < datainfo.appInfo.moduleInfos; j++) {
expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry");
expect(datainfo.appInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1);
}
expect(datainfo.appInfo.enabled).assertEqual(true);
}
/**
* @tc.number getBundleInfo_0300
* @tc.name BUNDLE::getBundleInfo
......@@ -415,39 +420,14 @@ describe('ActsBundleManagerTest', function () {
}
})
/**
* @tc.number getBundleInfo_1300
* @tc.name BUNDLE::getBundleInfo
* @tc.desc Test getBundleInfo interfaces with LAUNCHER hap. (by promise)
*/
it('getBundleInfo_1300', 0, async function (done) {
await demo.getBundleInfo(LAUNCHER, demo.BundleFlag.GET_BUNDLE_WITH_ABILITIES).then(datainfo => {
console.info("getBundleInfo_1300 success:" + JSON.stringify(datainfo));
expect(datainfo.name).assertEqual(LAUNCHER);
expect(datainfo.vendor).assertEqual("ohos");
expect(datainfo.versionCode).assertEqual(1000000);
expect(datainfo.versionName.length).assertLarger(0);
expect(datainfo.uid).assertLarger(2099);
expect(datainfo.appInfo.name).assertEqual(LAUNCHER);
expect(datainfo.appInfo.systemApp).assertEqual(true);
expect(datainfo.appInfo.supportedModes).assertEqual(0);
expect(datainfo.appInfo.moduleInfos.length).assertLarger(0);
expect(datainfo.appInfo.enabled).assertEqual(true);
done();
}).catch(err => {
console.info("getBundleInfo_1300 fail:" + JSON.stringify(err));
expect(err).assertFail();
done();
})
})
/**
* @tc.number getBundleInfo_1400
* @tc.name BUNDLE::getBundleInfo
* @tc.desc Test getBundleInfo interfaces with LAUNCHER hap.(by callback)
*/
it('getBundleInfo_1400', 0, async function (done) {
await demo.getBundleInfo(LAUNCHER, demo.BundleFlag.GET_BUNDLE_WITH_ABILITIES, bundleOptions, (err, dataInfo) => {
await demo.getBundleInfo(LAUNCHER, demo.BundleFlag.GET_BUNDLE_WITH_ABILITIES,
bundleOptions, (err, dataInfo) => {
if (err) {
console.info("getBundleInfo_1400 fail:" + JSON.stringify(err));
expect(err).assertFail();
......@@ -1033,7 +1013,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with one hap. (by promise)
*/
it('getApplicationInfo_1300', 0, async function (done) {
await demo.getApplicationInfo(NAME1, demo.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION, USERID).then(datainfo => {
await demo.getApplicationInfo(NAME1, demo.BundleFlag.GET_APPLICATION_INFO_WITH_PERMISSION,
USERID).then(datainfo => {
console.info("getApplicationInfo_1300 success:" + JSON.stringify(datainfo));
expect(typeof datainfo).assertEqual(OBJECT);
expect(datainfo.name).assertEqual(NAME1);
......@@ -1454,7 +1435,7 @@ describe('ActsBundleManagerTest', function () {
}, demo.BundleFlag.GET_ABILITY_INFO_WITH_APPLICATION |
demo.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION |
demo.BundleFlag.GET_ABILITY_INFO_WITH_METADATA,
USERID, (error, datainfo) => {
USERID, (error, data) => {
if (err) {
console.info("queryAbilityByWant_0200 err" + JSON.stringify(err));
expect(err).assertFail();
......@@ -1547,7 +1528,7 @@ describe('ActsBundleManagerTest', function () {
{
"bundleName": "com.example.myapplication2",
"abilityName": "com.example.myapplication1.MainAbility",
}, demo.BundleFlag.GET_ALL_APPLICATION_INFO, USERID, (error, datainfo) => {
}, demo.BundleFlag.GET_ALL_APPLICATION_INFO, USERID, (error, data) => {
expect(data.length).assertLarger(0);
for (let i = 0, len = data.length; i < len; i++) {
let datainfo = data[i];
......@@ -1588,47 +1569,7 @@ describe('ActsBundleManagerTest', function () {
await demo.queryAbilityByWant({
entities: ['entity.system.home', 'entitiesentities']
}, 4, USERID).then(data => {
let queryResultCount = 0;
for (let i = 0, len = data.length; i < len; i++) {
let datainfo = data[i];
console.info("queryAbilityByWant_0500 success:" + JSON.stringify(datainfo));
if (datainfo.bundleName == NAME3) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.label).assertEqual("$string:app_name");
expect(datainfo.description).assertEqual(DESCRIPTION);
expect(datainfo.icon).assertEqual("$media:icon");
expect(datainfo.moduleName).assertEqual("entry");
expect(datainfo.bundleName).assertEqual(NAME3);
expect(datainfo.applicationInfo.name).assertEqual(NAME3);
expect(datainfo.applicationInfo.description).assertEqual(DESCRIPTION);
expect(datainfo.applicationInfo.descriptionId >= 0).assertTrue();
expect(datainfo.applicationInfo.icon).assertEqual("$media:icon");
expect(datainfo.applicationInfo.iconId >= 0).assertTrue();
expect(datainfo.applicationInfo.label).assertEqual("$string:app_name");
expect(datainfo.applicationInfo.labelId >= 0).assertTrue();
expect(datainfo.applicationInfo.systemApp).assertEqual(true);
expect(datainfo.applicationInfo.supportedModes).assertEqual(0);
expect(datainfo.orientation).assertEqual(2);
expect(datainfo.applicationInfo.enabled).assertEqual(true);
for (let j = 0; j < datainfo.applicationInfo.moduleInfos; j++) {
expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry");
}
queryResultCount++;
}
if (datainfo.bundleName == NAME4) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME4);
expect(datainfo.orientation).assertEqual(3);
queryResultCount++;
}
if (datainfo.bundleName == NAME5) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME5);
expect(datainfo.orientation).assertEqual(0);
queryResultCount++;
}
}
expect(queryResultCount).assertEqual(3);
checkAbilityInfo0500(data)
done();
}).catch(err => {
console.info("queryAbilityByWant_0500 err" + JSON.stringify(err));
......@@ -1637,6 +1578,50 @@ describe('ActsBundleManagerTest', function () {
})
})
function checkAbilityInfo0500(data) {
let queryResultCount = 0;
for (let i = 0, len = data.length; i < len; i++) {
let datainfo = data[i];
console.info("queryAbilityByWant_0500 success:" + JSON.stringify(datainfo));
if (datainfo.bundleName == NAME3) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.label).assertEqual("$string:app_name");
expect(datainfo.description).assertEqual(DESCRIPTION);
expect(datainfo.icon).assertEqual("$media:icon");
expect(datainfo.moduleName).assertEqual("entry");
expect(datainfo.bundleName).assertEqual(NAME3);
expect(datainfo.applicationInfo.name).assertEqual(NAME3);
expect(datainfo.applicationInfo.description).assertEqual(DESCRIPTION);
expect(datainfo.applicationInfo.descriptionId >= 0).assertTrue();
expect(datainfo.applicationInfo.icon).assertEqual("$media:icon");
expect(datainfo.applicationInfo.iconId >= 0).assertTrue();
expect(datainfo.applicationInfo.label).assertEqual("$string:app_name");
expect(datainfo.applicationInfo.labelId >= 0).assertTrue();
expect(datainfo.applicationInfo.systemApp).assertEqual(true);
expect(datainfo.applicationInfo.supportedModes).assertEqual(0);
expect(datainfo.orientation).assertEqual(2);
expect(datainfo.applicationInfo.enabled).assertEqual(true);
for (let j = 0; j < datainfo.applicationInfo.moduleInfos; j++) {
expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry");
}
queryResultCount++;
}
if (datainfo.bundleName == NAME4) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME4);
expect(datainfo.orientation).assertEqual(3);
queryResultCount++;
}
if (datainfo.bundleName == NAME5) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME5);
expect(datainfo.orientation).assertEqual(0);
queryResultCount++;
}
}
expect(queryResultCount).assertEqual(3);
}
/**
* @tc.number queryAbilityByWant_0600
* @tc.name BUNDLE::queryAbilityByWant
......@@ -1646,58 +1631,62 @@ describe('ActsBundleManagerTest', function () {
await demo.queryAbilityByWant(
{
entities: ['entity.system.home', 'entitiesentities']
}, 4, USERID, (err, datainfo) => {
}, 4, USERID, (err, data) => {
if (err) {
console.info("queryAbilityByWant_0600 err" + JSON.stringify(err));
expect(err).assertFail();
done();
return;
}
let queryResultCount = 0;
for (let i = 0, len = data.length; i < len; i++) {
let datainfo = data[i];
console.info("queryAbilityByWant_0600 success:" + JSON.stringify(datainfo));
if (datainfo.bundleName == NAME3) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.label).assertEqual("$string:app_name");
expect(datainfo.description).assertEqual(DESCRIPTION);
expect(datainfo.icon).assertEqual("$media:icon");
expect(datainfo.moduleName).assertEqual("entry");
expect(datainfo.bundleName).assertEqual(NAME3);
expect(datainfo.applicationInfo.name).assertEqual(NAME3);
expect(datainfo.applicationInfo.description).assertEqual(DESCRIPTION);
expect(datainfo.applicationInfo.descriptionId >= 0).assertTrue();
expect(datainfo.applicationInfo.icon).assertEqual("$media:icon");
expect(datainfo.applicationInfo.iconId >= 0).assertTrue();
expect(datainfo.applicationInfo.label).assertEqual("$string:app_name");
expect(datainfo.applicationInfo.labelId >= 0).assertTrue();
expect(datainfo.applicationInfo.systemApp).assertEqual(true);
expect(datainfo.applicationInfo.supportedModes).assertEqual(0);
expect(datainfo.orientation).assertEqual(2);
expect(datainfo.applicationInfo.enabled).assertEqual(true);
for (let j = 0; j < datainfo.applicationInfo.moduleInfos; j++) {
expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry");
}
queryResultCount++;
}
if (datainfo.bundleName == NAME4) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME4);
expect(datainfo.orientation).assertEqual(3);
queryResultCount++;
}
if (datainfo.bundleName == NAME5) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME5);
expect(datainfo.orientation).assertEqual(0);
queryResultCount++;
}
}
expect(queryResultCount).assertEqual(3);
checkAbilityInfo0600(data);
done();
})
})
function checkAbilityInfo0600(data) {
let queryResultCount = 0;
for (let i = 0, len = data.length; i < len; i++) {
let datainfo = data[i];
console.info("queryAbilityByWant_0600 success:" + JSON.stringify(datainfo));
if (datainfo.bundleName == NAME3) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.label).assertEqual("$string:app_name");
expect(datainfo.description).assertEqual(DESCRIPTION);
expect(datainfo.icon).assertEqual("$media:icon");
expect(datainfo.moduleName).assertEqual("entry");
expect(datainfo.bundleName).assertEqual(NAME3);
expect(datainfo.applicationInfo.name).assertEqual(NAME3);
expect(datainfo.applicationInfo.description).assertEqual(DESCRIPTION);
expect(datainfo.applicationInfo.descriptionId >= 0).assertTrue();
expect(datainfo.applicationInfo.icon).assertEqual("$media:icon");
expect(datainfo.applicationInfo.iconId >= 0).assertTrue();
expect(datainfo.applicationInfo.label).assertEqual("$string:app_name");
expect(datainfo.applicationInfo.labelId >= 0).assertTrue();
expect(datainfo.applicationInfo.systemApp).assertEqual(true);
expect(datainfo.applicationInfo.supportedModes).assertEqual(0);
expect(datainfo.orientation).assertEqual(2);
expect(datainfo.applicationInfo.enabled).assertEqual(true);
for (let j = 0; j < datainfo.applicationInfo.moduleInfos; j++) {
expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry");
}
queryResultCount++;
}
if (datainfo.bundleName == NAME4) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME4);
expect(datainfo.orientation).assertEqual(3);
queryResultCount++;
}
if (datainfo.bundleName == NAME5) {
expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility");
expect(datainfo.bundleName).assertEqual(NAME5);
expect(datainfo.orientation).assertEqual(0);
queryResultCount++;
}
}
expect(queryResultCount).assertEqual(3);
}
/**
* @tc.number queryAbilityByWant_0700
* @tc.name BUNDLE::queryAbilityByWant
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册