提交 17e6a0c6 编写于 作者: D dy

检视意见修改2

Signed-off-by: Ndy <dingyao5@huawei.com>
上级 c372c2e5
...@@ -36,7 +36,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -36,7 +36,6 @@ export default function getAbilityLabelJsUnit() {
* @tc.level 0 * @tc.level 0
*/ */
it('context_getAbilityLabel_test_0100', 0, async function (done) { it('context_getAbilityLabel_test_0100', 0, async function (done) {
await Utils.sleep(1000);
let mData; let mData;
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
await Bundle.getAbilityLabel(BUNDLE_NAME, ABILITY_NAME) await Bundle.getAbilityLabel(BUNDLE_NAME, ABILITY_NAME)
...@@ -44,7 +43,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -44,7 +43,6 @@ export default function getAbilityLabelJsUnit() {
var timeNewStamp = Utils.getNowTime(); var timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[context_getAbilityLabel_test_0100]', timeOldStamp, timeNewStamp); Utils.getDurationTime('[context_getAbilityLabel_test_0100]', timeOldStamp, timeNewStamp);
mData = data; mData = data;
console.info('[context_getAbilityLabel_test_0100] promise in ');
console.info('[context_getAbilityLabel_test_0100] promise data is: ' + JSON.stringify(data)); console.info('[context_getAbilityLabel_test_0100] promise data is: ' + JSON.stringify(data));
}) })
.catch((error) => { .catch((error) => {
...@@ -62,7 +60,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -62,7 +60,6 @@ export default function getAbilityLabelJsUnit() {
* @tc.level 0 * @tc.level 0
*/ */
it('context_getAbilityLabel_test_0200', 0, async function (done) { it('context_getAbilityLabel_test_0200', 0, async function (done) {
await Utils.sleep(1000);
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
let mData; let mData;
Bundle.getAbilityLabel(BUNDLE_NAME, ABILITY_NAME, (error, data) => { Bundle.getAbilityLabel(BUNDLE_NAME, ABILITY_NAME, (error, data) => {
...@@ -73,7 +70,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -73,7 +70,6 @@ export default function getAbilityLabelJsUnit() {
var timeNewStamp = Utils.getNowTime(); var timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[context_getAbilityLabel_test_0200]', timeOldStamp, timeNewStamp); Utils.getDurationTime('[context_getAbilityLabel_test_0200]', timeOldStamp, timeNewStamp);
mData = data; mData = data;
console.info('[context_getAbilityLabel_test_0200] callBack in');
console.info('[context_getAbilityLabel_test_0200] callBack error: ' + error); console.info('[context_getAbilityLabel_test_0200] callBack error: ' + error);
console.info('[context_getAbilityLabel_test_0200] callBack data is:' + JSON.stringify(data)); console.info('[context_getAbilityLabel_test_0200] callBack data is:' + JSON.stringify(data));
}); });
...@@ -89,14 +85,12 @@ export default function getAbilityLabelJsUnit() { ...@@ -89,14 +85,12 @@ export default function getAbilityLabelJsUnit() {
* @tc.level 0 * @tc.level 0
*/ */
it('context_getAbilityLabel_test_0300', 0, async function (done) { it('context_getAbilityLabel_test_0300', 0, async function (done) {
await Utils.sleep(1000);
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
let mError; let mError;
await Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR) await Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR)
.then((data) => { .then((data) => {
var timeNewStamp = Utils.getNowTime(); var timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[context_getAbilityLabel_test_0300]', timeOldStamp, timeNewStamp); Utils.getDurationTime('[context_getAbilityLabel_test_0300]', timeOldStamp, timeNewStamp);
console.info('[context_getAbilityLabel_test_0300] promise in ');
console.info('[context_getAbilityLabel_test_0300] promise data is: ' + JSON.stringify(data)); console.info('[context_getAbilityLabel_test_0300] promise data is: ' + JSON.stringify(data));
}) })
.catch((error) => { .catch((error) => {
...@@ -118,7 +112,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -118,7 +112,6 @@ export default function getAbilityLabelJsUnit() {
* @tc.level 0 * @tc.level 0
*/ */
it('context_getAbilityLabel_test_0400', 0, async function (done) { it('context_getAbilityLabel_test_0400', 0, async function (done) {
await Utils.sleep(1000);
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
let mError; let mError;
Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR, (error, data) => { Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR, (error, data) => {
...@@ -129,7 +122,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -129,7 +122,6 @@ export default function getAbilityLabelJsUnit() {
var timeNewStamp = Utils.getNowTime(); var timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[context_getAbilityLabel_test_0400]', timeOldStamp, timeNewStamp); Utils.getDurationTime('[context_getAbilityLabel_test_0400]', timeOldStamp, timeNewStamp);
mError = error; mError = error;
console.info('[context_getAbilityLabel_test_0400] callBack in');
console.info('[context_getAbilityLabel_test_0400] callBack data is:' + JSON.stringify(data)); console.info('[context_getAbilityLabel_test_0400] callBack data is:' + JSON.stringify(data));
}); });
await Utils.sleep(2000); await Utils.sleep(2000);
...@@ -144,7 +136,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -144,7 +136,6 @@ export default function getAbilityLabelJsUnit() {
* @tc.level 0 * @tc.level 0
*/ */
it('context_getAbilityLabel_test_0500', 0, async function (done) { it('context_getAbilityLabel_test_0500', 0, async function (done) {
await Utils.sleep(1000);
let mData; let mData;
let mError = null; let mError = null;
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
...@@ -154,13 +145,11 @@ export default function getAbilityLabelJsUnit() { ...@@ -154,13 +145,11 @@ export default function getAbilityLabelJsUnit() {
Utils.getDurationTime('[context_getAbilityLabel_test_0500]', timeOldStamp, timeNewStamp); Utils.getDurationTime('[context_getAbilityLabel_test_0500]', timeOldStamp, timeNewStamp);
mData = data; mData = data;
expect(mData).assertFail(); expect(mData).assertFail();
console.info('[context_getAbilityLabel_test_0500] promise in ');
console.info('[context_getAbilityLabel_test_0500] promise data is: ' + JSON.stringify(data)); console.info('[context_getAbilityLabel_test_0500] promise data is: ' + JSON.stringify(data));
}) })
.catch((error) => { .catch((error) => {
mError = error; mError = error;
console.info('[context_getAbilityLabel_test_0500] promise error is: ' + error); console.info('[context_getAbilityLabel_test_0500] promise error is: ' + error);
expect(mError).assertEqual(1);
getAbilityLabelFailure('[context_getAbilityLabel_test_0500]', mError); getAbilityLabelFailure('[context_getAbilityLabel_test_0500]', mError);
}); });
done(); done();
...@@ -173,22 +162,14 @@ export default function getAbilityLabelJsUnit() { ...@@ -173,22 +162,14 @@ export default function getAbilityLabelJsUnit() {
* @tc.level 0 * @tc.level 0
*/ */
it('context_getAbilityLabel_test_0600', 0, async function (done) { it('context_getAbilityLabel_test_0600', 0, async function (done) {
await Utils.sleep(1000);
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
let mError = null;
Bundle.getAbilityLabel(OTHER_BUNDLE_NAME, OTHER_ABILITY_NAME, (error, data) => { Bundle.getAbilityLabel(OTHER_BUNDLE_NAME, OTHER_ABILITY_NAME, (error, data) => {
mError = error;
var timeNewStamp = Utils.getNowTime(); var timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[context_getAbilityLabel_test_0600]', timeOldStamp, timeNewStamp); Utils.getDurationTime('[context_getAbilityLabel_test_0600]', timeOldStamp, timeNewStamp);
if(mError !== null){ console.info('[context_getAbilityLabel_test_0600] callBack error: ' + error);
console.info('[context_getAbilityLabel_test_0600] callBack error: ' + error); getAbilityLabelFailure('[context_getAbilityLabel_test_0600]', error);
expect(mError).assertEqual(1); expect(data).assertEqual(undefined);
getAbilityLabelFailure('[context_getAbilityLabel_test_0600]', mError);
}
console.info('[context_getAbilityLabel_test_0600] callBack in');
console.info('[context_getAbilityLabel_test_0600] callBack data is:' + JSON.stringify(data));
}); });
await Utils.sleep(2000);
done(); done();
}); });
...@@ -200,7 +181,6 @@ export default function getAbilityLabelJsUnit() { ...@@ -200,7 +181,6 @@ export default function getAbilityLabelJsUnit() {
* @tc.level 0 * @tc.level 0
*/ */
it('context_getAbilityLabel_test_0700', 0, async function (done) { it('context_getAbilityLabel_test_0700', 0, async function (done) {
await Utils.sleep(1000);
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
let mError; let mError;
Bundle.getAbilityLabel(BUNDLE_NAME, SERVICE_ABILITY_NAME, (error, data) => { Bundle.getAbilityLabel(BUNDLE_NAME, SERVICE_ABILITY_NAME, (error, data) => {
...@@ -209,10 +189,7 @@ export default function getAbilityLabelJsUnit() { ...@@ -209,10 +189,7 @@ export default function getAbilityLabelJsUnit() {
mError = error; mError = error;
if(mError !== null){ if(mError !== null){
console.info('[context_getAbilityLabel_test_0600] callBack error: ' + error); console.info('[context_getAbilityLabel_test_0600] callBack error: ' + error);
expect(mError).assertEqual(1);
} }
console.info('[context_getAbilityLabel_test_0700] callBack in');
console.info('[context_getAbilityLabel_test_0700] callBack error: ' + error);
console.info('[context_getAbilityLabel_test_0700] callBack data is:' + JSON.stringify(data)); console.info('[context_getAbilityLabel_test_0700] callBack data is:' + JSON.stringify(data));
}); });
await Utils.sleep(2000); await Utils.sleep(2000);
......
...@@ -84,20 +84,14 @@ export default function GetabilityInfo() { ...@@ -84,20 +84,14 @@ export default function GetabilityInfo() {
*/ */
it('bundle_GetabilityInfo_test_0300', 0, async function (done) { it('bundle_GetabilityInfo_test_0300', 0, async function (done) {
var timeOldStamp = await Utils.getNowTime(); var timeOldStamp = await Utils.getNowTime();
let err;
var mData;
await bundleManager.getAbilityInfo(bundleName_other, abilityName_other) await bundleManager.getAbilityInfo(bundleName_other, abilityName_other)
.then((data) => { .then((data) => {
var timeNewStamp = Utils.getNowTime(); var timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('bundle_GetabilityInfo_test_0300',timeOldStamp,timeNewStamp) Utils.getDurationTime('bundle_GetabilityInfo_test_0300',timeOldStamp,timeNewStamp)
mData = data expect(data).assertFail();
console.info('[bundle_GetabilityInfo_test_0300] getApplicationInfo promise data is: ' + JSON.stringify(data));
expect(typeof (mData)).assertEqual("object");
checkAbilityInfo_other(mData);
}).catch((error) => { }).catch((error) => {
err = error
console.error('[bundle_GetabilityInfo_test_0300]Operation failed. Cause: ' + JSON.stringify(error)); console.error('[bundle_GetabilityInfo_test_0300]Operation failed. Cause: ' + JSON.stringify(error));
expect(err).assertEqual(1); expect(error).assertEqual(1);
}); });
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册