未验证 提交 ec86a2ee 编写于 作者: O openharmony_ci 提交者: Gitee

!6426 Adaption code getwant and ActsAbilityDelegatorCaseTest

Merge pull request !6426 from xinking129/master
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"description": "$string:phone_entry_dsc", "description": "$string:phone_entry_dsc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"default" "default",
"tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"description": "$string:phone_entry_dsc", "description": "$string:phone_entry_dsc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"default" "default",
"tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"description": "$string:phone_entry_dsc", "description": "$string:phone_entry_dsc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"default" "default",
"tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"description": "$string:phone_entry_dsc", "description": "$string:phone_entry_dsc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"default" "default",
"tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
......
...@@ -37,14 +37,6 @@ export default function actsStServiceAbilityTest() { ...@@ -37,14 +37,6 @@ export default function actsStServiceAbilityTest() {
done(); done();
}, gSetTimeout); }, gSetTimeout);
}) })
afterAll((done) => {
console.debug('= ACTS_AAAfterAll ====<begin');
setTimeout(function () {
console.debug('= ACTS_AAAfterAll ====<end');
featureAbility.terminateSelf();
done();
}, gSetTimeout);
})
/** /**
* @tc.number: ACTS_AExecuteShellCommand_0100 * @tc.number: ACTS_AExecuteShellCommand_0100
......
...@@ -63,14 +63,6 @@ describe('ActsStServiceAbilityTest', function () { ...@@ -63,14 +63,6 @@ describe('ActsStServiceAbilityTest', function () {
done(); done();
}, gSetTimeout); }, gSetTimeout);
}) })
afterAll((done) => {
console.debug('= ACTS_AafterAll ====<begin');
setTimeout(function () {
console.debug('= ACTS_AafterAll ====<end');
featureAbility.terminateSelf();
done();
}, gSetTimeout);
})
/* /*
* @tc.number ACTS_AAbilityStartSetting_0100 * @tc.number ACTS_AAbilityStartSetting_0100
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"description": "$string:hap4_desc", "description": "$string:hap4_desc",
"mainElement": "Hap4MainAbility1", "mainElement": "Hap4MainAbility1",
"deviceTypes": [ "deviceTypes": [
"default" "default",
"tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
......
...@@ -18,13 +18,13 @@ import wantConstant from '@ohos.ability.wantConstant' ...@@ -18,13 +18,13 @@ import wantConstant from '@ohos.ability.wantConstant'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function ActsGetWantTest() { export default function ActsGetWantTest() {
describe('ActsGetWantTest', function () { describe('ActsGetWantTest', function () {
beforeAll(async (done) => { var TIMEOUT_NUMBER = 3000;
console.info('ActsGetWantTest begin') afterEach(async (done) => {
setTimeout(function () {
done(); done();
}, 1500);
}) })
var TIMEOUT_NUMBER = 2500;
// @tc.number: ACTS_GetWant_0100 // @tc.number: ACTS_GetWant_0100
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult, // @tc.desc:Start the ability through startabilityforresult,
...@@ -48,6 +48,7 @@ describe('ActsGetWantTest', function () { ...@@ -48,6 +48,7 @@ describe('ActsGetWantTest', function () {
}, },
} }
}).then((data) => { }).then((data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_0100 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -68,7 +69,6 @@ describe('ActsGetWantTest', function () { ...@@ -68,7 +69,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey6["subKey1"]).assertEqual("STRING"); expect(data.want.parameters.mykey6["subKey1"]).assertEqual("STRING");
expect(data.want.parameters.mykey6["subKey2"]).assertEqual(10); expect(data.want.parameters.mykey6["subKey2"]).assertEqual(10);
expect(data.want.parameters.mykey6["subKey3"]).assertEqual(true); expect(data.want.parameters.mykey6["subKey3"]).assertEqual(true);
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}).catch((error) => { }).catch((error) => {
...@@ -101,6 +101,7 @@ describe('ActsGetWantTest', function () { ...@@ -101,6 +101,7 @@ describe('ActsGetWantTest', function () {
} }
}, },
(err, data) => { (err, data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_0200 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0200 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -118,7 +119,6 @@ describe('ActsGetWantTest', function () { ...@@ -118,7 +119,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[0]).assertEqual("str"); expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}) })
...@@ -151,18 +151,7 @@ describe('ActsGetWantTest', function () { ...@@ -151,18 +151,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
checkOnAbilityResult0300(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_0300 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
function checkOnAbilityResult0300(data) {
console.info('====> ACTS_GetWant_0300 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -186,7 +175,14 @@ describe('ActsGetWantTest', function () { ...@@ -186,7 +175,14 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("!@#$%"); expect(data.want.parameters.mykey5[1]).assertEqual("!@#$%");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_0300 before done=====>') console.info('====> ACTS_GetWant_0300 before done=====>')
} done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_0300 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
// @tc.number: ACTS_GetWant_0500 // @tc.number: ACTS_GetWant_0500
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -215,6 +211,7 @@ describe('ActsGetWantTest', function () { ...@@ -215,6 +211,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_0500 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -237,7 +234,6 @@ describe('ActsGetWantTest', function () { ...@@ -237,7 +234,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_0500 before done=====>') console.info('====> ACTS_GetWant_0500 before done=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}).catch((error) => { }).catch((error) => {
...@@ -275,6 +271,7 @@ describe('ActsGetWantTest', function () { ...@@ -275,6 +271,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_0600 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0600 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -297,7 +294,6 @@ describe('ActsGetWantTest', function () { ...@@ -297,7 +294,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_0600 before done=====>') console.info('====> ACTS_GetWant_0600 before done=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}) })
...@@ -330,6 +326,7 @@ describe('ActsGetWantTest', function () { ...@@ -330,6 +326,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_0700 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0700 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -352,7 +349,6 @@ describe('ActsGetWantTest', function () { ...@@ -352,7 +349,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_0700 before done=====>') console.info('====> ACTS_GetWant_0700 before done=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}).catch((error) => { }).catch((error) => {
...@@ -390,14 +386,7 @@ describe('ActsGetWantTest', function () { ...@@ -390,14 +386,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
checkOnAbilityResult0800(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult0800(data) {
console.info('====> ACTS_GetWant_0800 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0800 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -420,7 +409,10 @@ describe('ActsGetWantTest', function () { ...@@ -420,7 +409,10 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_0800 before done=====>') console.info('====> ACTS_GetWant_0800 before done=====>')
} done();
}, 3500);
})
})
// @tc.number: ACTS_GetWant_0900 // @tc.number: ACTS_GetWant_0900
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -449,6 +441,7 @@ describe('ActsGetWantTest', function () { ...@@ -449,6 +441,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_0900 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_0900 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -471,7 +464,6 @@ describe('ActsGetWantTest', function () { ...@@ -471,7 +464,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_0900 before done=====>') console.info('====> ACTS_GetWant_0900 before done=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}).catch((error) => { }).catch((error) => {
...@@ -509,14 +501,7 @@ describe('ActsGetWantTest', function () { ...@@ -509,14 +501,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
checkOnAbilityResult1000(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult1000(data) {
console.info('====> ACTS_GetWant_1000 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1000 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -539,7 +524,10 @@ describe('ActsGetWantTest', function () { ...@@ -539,7 +524,10 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1000 before done=====>') console.info('====> ACTS_GetWant_1000 before done=====>')
} done();
}, TIMEOUT_NUMBER);
})
})
// @tc.number: ACTS_GetWant_1100 // @tc.number: ACTS_GetWant_1100
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -567,18 +555,7 @@ describe('ActsGetWantTest', function () { ...@@ -567,18 +555,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
checkOnAbilityResult1100(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_1100 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
function checkOnAbilityResult1100(data) {
console.info('====> ACTS_GetWant_1100 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -600,7 +577,14 @@ describe('ActsGetWantTest', function () { ...@@ -600,7 +577,14 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1100 before done=====>') console.info('====> ACTS_GetWant_1100 before done=====>')
} done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_1100 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
// @tc.number: ACTS_GetWant_1200 // @tc.number: ACTS_GetWant_1200
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -629,6 +613,7 @@ describe('ActsGetWantTest', function () { ...@@ -629,6 +613,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_1200 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1200 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -650,7 +635,6 @@ describe('ActsGetWantTest', function () { ...@@ -650,7 +635,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1200 before done=====>') console.info('====> ACTS_GetWant_1200 before done=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}) })
...@@ -683,6 +667,7 @@ describe('ActsGetWantTest', function () { ...@@ -683,6 +667,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_1300 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -705,9 +690,8 @@ describe('ActsGetWantTest', function () { ...@@ -705,9 +690,8 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1300 before done=====>') console.info('====> ACTS_GetWant_1300 before done=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, 3500);
}).catch((error) => { }).catch((error) => {
console.log('ACTS_GetWant_1300 error: ' + JSON.stringify(error)) console.log('ACTS_GetWant_1300 error: ' + JSON.stringify(error))
expect.assertFail() expect.assertFail()
...@@ -743,14 +727,7 @@ describe('ActsGetWantTest', function () { ...@@ -743,14 +727,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
checkOnAbilityResult1400(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult1400(data) {
console.info('====> ACTS_GetWant_1400 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -773,7 +750,10 @@ describe('ActsGetWantTest', function () { ...@@ -773,7 +750,10 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1400 before done=====>') console.info('====> ACTS_GetWant_1400 before done=====>')
} done();
}, 3500);
})
})
// @tc.number: ACTS_GetWant_1500 // @tc.number: ACTS_GetWant_1500
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -802,18 +782,7 @@ describe('ActsGetWantTest', function () { ...@@ -802,18 +782,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
checkOnAbilityResult1500(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_1500 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
function checkOnAbilityResult1500(data) {
console.info('====> ACTS_GetWant_1500 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -836,7 +805,14 @@ describe('ActsGetWantTest', function () { ...@@ -836,7 +805,14 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1500 setTimeout before done.=====>') console.info('====> ACTS_GetWant_1500 setTimeout before done.=====>')
} done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_1500 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
// @tc.number: ACTS_GetWant_1600 // @tc.number: ACTS_GetWant_1600
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -866,6 +842,7 @@ describe('ActsGetWantTest', function () { ...@@ -866,6 +842,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_1600 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1600 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -888,9 +865,8 @@ describe('ActsGetWantTest', function () { ...@@ -888,9 +865,8 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1600 setTimeout before done.=====>') console.info('====> ACTS_GetWant_1600 setTimeout before done.=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, 3500);
}) })
}) })
...@@ -921,6 +897,7 @@ describe('ActsGetWantTest', function () { ...@@ -921,6 +897,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
setTimeout(()=>{
console.info('====> ACTS_GetWant_1700 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1700 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -943,7 +920,6 @@ describe('ActsGetWantTest', function () { ...@@ -943,7 +920,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1700 setTimeout before done.=====>') console.info('====> ACTS_GetWant_1700 setTimeout before done.=====>')
setTimeout(()=>{
done(); done();
}, TIMEOUT_NUMBER); }, TIMEOUT_NUMBER);
}).catch((error) => { }).catch((error) => {
...@@ -980,18 +956,7 @@ describe('ActsGetWantTest', function () { ...@@ -980,18 +956,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
checkOnAbilityResult1900(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_1900 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
function checkOnAbilityResult1900(data) {
console.info('====> ACTS_GetWant_1900 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_1900 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -1014,7 +979,14 @@ describe('ActsGetWantTest', function () { ...@@ -1014,7 +979,14 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_1900 setTimeout before done.=====>') console.info('====> ACTS_GetWant_1900 setTimeout before done.=====>')
} done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_1900 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
// @tc.number: ACTS_GetWant_2100 // @tc.number: ACTS_GetWant_2100
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -1043,18 +1015,7 @@ describe('ActsGetWantTest', function () { ...@@ -1043,18 +1015,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
checkOnAbilityResult2100(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_2100 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
function checkOnAbilityResult2100(data) {
console.info('====> ACTS_GetWant_2100 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_2100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -1077,7 +1038,14 @@ describe('ActsGetWantTest', function () { ...@@ -1077,7 +1038,14 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2100 setTimeout before done.=====>') console.info('====> ACTS_GetWant_2100 setTimeout before done.=====>')
} done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_2100 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
// @tc.number: ACTS_GetWant_2200 // @tc.number: ACTS_GetWant_2200
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -1107,14 +1075,7 @@ describe('ActsGetWantTest', function () { ...@@ -1107,14 +1075,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
checkOnAbilityResult2200(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult2200(data) {
console.info('====> ACTS_GetWant_2200 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_2200 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -1137,7 +1098,10 @@ describe('ActsGetWantTest', function () { ...@@ -1137,7 +1098,10 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2200 setTimeout before done.=====>') console.info('====> ACTS_GetWant_2200 setTimeout before done.=====>')
} done();
}, TIMEOUT_NUMBER);
})
})
// @tc.number: ACTS_GetWant_2300 // @tc.number: ACTS_GetWant_2300
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -1166,18 +1130,7 @@ describe('ActsGetWantTest', function () { ...@@ -1166,18 +1130,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
checkOnAbilityResult2300(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_2300 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
function checkOnAbilityResult2300(data) {
console.info('====> ACTS_GetWant_2300 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_2300 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -1200,7 +1153,14 @@ describe('ActsGetWantTest', function () { ...@@ -1200,7 +1153,14 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2300 setTimeout before done.=====>') console.info('====> ACTS_GetWant_2300 setTimeout before done.=====>')
} done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_2300 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
})
// @tc.number: ACTS_GetWant_2400 // @tc.number: ACTS_GetWant_2400
// @tc.name: getWant : get want in current ability // @tc.name: getWant : get want in current ability
...@@ -1230,14 +1190,7 @@ describe('ActsGetWantTest', function () { ...@@ -1230,14 +1190,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
checkOnAbilityResult2400(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
})
function checkOnAbilityResult2400(data) {
console.info('====> ACTS_GetWant_2400 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_2400 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -1260,7 +1213,10 @@ describe('ActsGetWantTest', function () { ...@@ -1260,7 +1213,10 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("STR"); expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> ACTS_GetWant_2400 setTimeout before done.=====>') console.info('====> ACTS_GetWant_2400 setTimeout before done.=====>')
} done();
}, TIMEOUT_NUMBER);
})
})
/* /*
* @tc.number ACTS_GetWant_2500 * @tc.number ACTS_GetWant_2500
...@@ -1291,18 +1247,7 @@ describe('ActsGetWantTest', function () { ...@@ -1291,18 +1247,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
}).then((data) => { }).then((data) => {
checkOnAbilityResult2500(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_2500 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
});
function checkOnAbilityResult2500(data) {
console.info('====> ACTS_GetWant_2500 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_2500 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -1325,7 +1270,14 @@ describe('ActsGetWantTest', function () { ...@@ -1325,7 +1270,14 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("test123"); expect(data.want.parameters.mykey5[1]).assertEqual("test123");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_2500 before done=====>') console.info('====> ACTS_GetWant_2500 before done=====>')
} done();
}, TIMEOUT_NUMBER);
}).catch((error) => {
console.log('ACTS_GetWant_2500 error: ' + JSON.stringify(error))
expect.assertFail()
done();
})
});
/* /*
* @tc.number ACTS_GetWant_2600 * @tc.number ACTS_GetWant_2600
...@@ -1357,14 +1309,7 @@ describe('ActsGetWantTest', function () { ...@@ -1357,14 +1309,7 @@ describe('ActsGetWantTest', function () {
}, },
}, },
(err, data) => { (err, data) => {
checkOnAbilityResult2600(data);
setTimeout(()=>{ setTimeout(()=>{
done();
}, TIMEOUT_NUMBER);
})
});
function checkOnAbilityResult2600(data) {
console.info('====> ACTS_GetWant_2600 start ability=====>' + JSON.stringify(data)) console.info('====> ACTS_GetWant_2600 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual(""); expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap"); expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
...@@ -1387,7 +1332,10 @@ describe('ActsGetWantTest', function () { ...@@ -1387,7 +1332,10 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[1]).assertEqual("test123"); expect(data.want.parameters.mykey5[1]).assertEqual("test123");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony"); expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> ACTS_GetWant_2600 before done=====>') console.info('====> ACTS_GetWant_2600 before done=====>')
} done();
}, TIMEOUT_NUMBER);
})
});
/** /**
* @tc.number: SUB_AA_OpenHarmony_wantConstantEnumeration_0100 * @tc.number: SUB_AA_OpenHarmony_wantConstantEnumeration_0100
......
...@@ -44,15 +44,13 @@ export default { ...@@ -44,15 +44,13 @@ export default {
}) })
}else{ }else{
setTimeout(function(){ setTimeout(function(){
console.debug("==========data1 bundleName is==========="
+ JSON.stringify(data.bundleName));
featureAbility.terminateSelfWithResult( featureAbility.terminateSelfWithResult(
{ {
resultCode: 1, resultCode: 1,
want: data want: data
} }
); );
},1000); },800);
} }
} }
) )
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"description": "$string:phone_entry_dsc", "description": "$string:phone_entry_dsc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"default" "default",
"tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"description": "$string:phone_entry_dsc", "description": "$string:phone_entry_dsc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"default" "default",
"tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册