提交 d6d677f6 编写于 作者: Z zhaoyuan17

Fix sound&vibra visible config etc.

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 72172efa
......@@ -241,4 +241,746 @@ describe('ActsGetWantTest', function () {
done();
})
})
// @tc.number: ACTS_GetWant_0600
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0600', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0600 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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_0700
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0700', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0700 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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_0800
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0800', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITY_CONTINUATION ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_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_ABILITY_CONTINUATION );
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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_0900
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0900', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_NOT_OHOS_COMPONENT ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0900 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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1000
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1000', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_AUTH_PERSISTABLE_URI_PERMISSION ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_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_PERSISTABLE_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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1100
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1100', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_AUTH_PREFIX_URI_PERMISSION ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_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.flags).assertEqual(wantConstant.Flags.FLAG_AUTH_PREFIX_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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1200
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1200', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITYSLICE_MULTI_DEVICE ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_1200 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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1300
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1300', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_START_FOREGROUND_ABILITY ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_1300 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_START_FOREGROUND_ABILITY );
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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1400
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1400', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITY_CONTINUATION_REVERSIBLE,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_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_ABILITY_CONTINUATION_REVERSIBLE);
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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1500
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1500', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_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_INSTALL_ON_DEMAND);
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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1600
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1600', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_INSTALL_WITH_BACKGROUND_MODE,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_1600 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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1700
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1700', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITY_CLEAR_MISSION,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_1700 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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1800
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1800', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITY_NEW_MISSION,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_1800 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('====> before done=====>')
done();
})
})
// @tc.number: ACTS_GetWant_1900
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_1900', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITY_MISSION_TOP ,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_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_ABILITY_MISSION_TOP );
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('====> before done=====>')
done();
})
})
})
......@@ -16,15 +16,20 @@ group("publish_test") {
testonly = true
if (is_standard_system) {
deps = [
#"actsanspublishcontroltest:ActsAnsPublishControlTest",
#"badgedisplayed:badgedisplayed",
#"enablenotification:enablenotification",
"actsanspublishcontroltest:ActsAnsPublishControlTest",
"badgedisplayed:badgedisplayed",
"enablenotification:enablenotification",
"getactive:getactive",
"getwantagentinfo:ActsAnsGetWantAgentInfoTest",
#"publishcontentype:publishcontentype",
#"subscribe:subscribe",
#"unsubscribe:ActsAnsUnSubscriberTest",
"ansactscancelgroup:ActsAnsCancelGroup",
"ansactsremovegroup:ActsAnsRemoveGroup",
"donotdisturbmode:ActsAnsDoNotDisturbTest",
"publishsound:ActsAnsPublishSoundTest",
"publishvibra:ActsAnsPublishVibraTest",
"unsubscribe:ActsAnsUnSubscriberTest",
"wantagent:wantagent",
]
}
......
......@@ -7,7 +7,7 @@
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
......@@ -15,20 +15,10 @@
"deviceConfig": {},
"module": {
"package": "com.example.actsanspublishsoundtest",
"name": ".MyApplication",
"name": ".actsansnotificationcancel",
"deviceType": [
"phone"
],
"reqPermissions": [{
"name": "ohos.permission.NOTIFICATION_CONTROLLER",
"reason": "install bundle",
"usedScene": {
"ability": [
"KitFramework"
],
"when": "always"
}
}],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
......@@ -51,8 +41,8 @@
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......
......@@ -7,7 +7,7 @@
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
......@@ -15,22 +15,10 @@
"deviceConfig": {},
"module": {
"package": "com.example.actsanspublishvibratest",
"name": ".MyApplication",
"name": ".actsansnotificationcancel",
"deviceType": [
"phone"
],
"reqPermissions": [
{
"name": "ohos.permission.NOTIFICATION_CONTROLLER",
"reason": "install bundle",
"usedScene": {
"ability": [
"KitFramework"
],
"when": "always"
}
}
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
......@@ -53,8 +41,8 @@
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"isVisible": "true",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册