提交 faf02efb 编写于 作者: O openharmony_ci 提交者: Gitee

!1032 Modify test code

Merge pull request !1032 from blackleon/master_1102
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for hjunit demo Tests", "description": "Configuration for hjunit demo Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "180000", "test-timeout": "120000",
"package": "com.example.amsZipfileUnzipfileST", "package": "com.example.amsZipfileUnzipfileST",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
...@@ -24,16 +24,33 @@ ...@@ -24,16 +24,33 @@
{ {
"type": "PushKit", "type": "PushKit",
"push": [ "push": [
"amsZipfileUnzipfileST.hap->/data/test/amsZipfileUnzipfileST.hap" "ceshi.txt->/data/test/ceshi.txt"
] ]
}, },
{ {
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"chmod 644 /data/test/*.hap" "chmod 777 /data/test/*"
]
},
{
"type": "ShellKit",
"run-command": [
"remount",
"mkdir /data/testA"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/testA/*"
] ]
} }
] ]
} }
...@@ -19,20 +19,21 @@ ...@@ -19,20 +19,21 @@
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"remount", "remount",
"mkdir /system/vendor" "mkdir /data/test"
] ]
}, },
{ {
"type": "PushKit", "type": "PushKit",
"push": [ "push": [
"amsStDataAbility.hap->/system/vendor/amsStDataAbility.hap" "amsStDataAbility.hap->/data/test/amsStDataAbility.hap"
] ]
}, },
{ {
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"chmod 644 /system/vendor/*.hap" "chmod 644 /data/test/*.hap",
"bm install -p /data/test/amsStDataAbility.hap"
] ]
} }
] ]
......
...@@ -26,7 +26,8 @@ group("bundlemanager") { ...@@ -26,7 +26,8 @@ group("bundlemanager") {
"actsbmsmoduleusagerecordtest:ActsBmsModuleUsageRecordTest", "actsbmsmoduleusagerecordtest:ActsBmsModuleUsageRecordTest",
"actsbundlemanagertest:ActsBundleManagerTest", "actsbundlemanagertest:ActsBundleManagerTest",
"actsbundlemanageruninstall:ActsBundleManagerUninstall", "actsbundlemanageruninstall:ActsBundleManagerUninstall",
"bmscheckpermissiontest:BmsCheckPermissionTest",
# "bmscheckpermissiontest:BmsCheckPermissionTest",
"sceneProject/bmsgetinfosfifthscene:bmsThirdBundleTest5", "sceneProject/bmsgetinfosfifthscene:bmsThirdBundleTest5",
"sceneProject/bmsgetinfosfirstscene:bmsThirdBundleTest1", "sceneProject/bmsgetinfosfirstscene:bmsThirdBundleTest1",
"sceneProject/bmsgetinfosfirstsceneupdate:bmsThirdBundleTestA1", "sceneProject/bmsgetinfosfirstsceneupdate:bmsThirdBundleTestA1",
......
...@@ -19,7 +19,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -19,7 +19,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const BUNDLE_NAME = 'com.example.actsbmscheckpermissiontest'; const BUNDLE_NAME = 'com.example.actsbmscheckpermissiontest';
const PERMISSION_ONE = 'com.permission.PERMISSION_A'; const PERMISSION_ONE = 'com.permission.PERMISSION_A';
const PERMISSION_TWO = 'com.permission.PERMISSION_B'; const PERMISSION_TWO = 'com.permission.PERMISSION_B';
const TIMEOUT = 1000;
const NAMECOUNT = 10000; const NAMECOUNT = 10000;
describe('ActsBmsCheckPermissionTest', function () { describe('ActsBmsCheckPermissionTest', function () {
...@@ -34,9 +33,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -34,9 +33,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_ONE) var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_ONE)
expect(data).assertEqual(0); expect(data).assertEqual(0);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_0100==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -51,9 +47,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -51,9 +47,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(0); expect(data).assertEqual(0);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_0200==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -67,9 +60,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -67,9 +60,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission('', PERMISSION_ONE) var data = await bundle.checkPermission('', PERMISSION_ONE)
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_0300==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -85,9 +75,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -85,9 +75,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_0400==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -101,9 +88,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -101,9 +88,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission(BUNDLE_NAME, '') var data = await bundle.checkPermission(BUNDLE_NAME, '')
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_0500==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -119,9 +103,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -119,9 +103,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_0600==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -135,9 +116,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -135,9 +116,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345') var data = await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345')
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_0700==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -153,9 +131,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -153,9 +131,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_0800==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -169,9 +144,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -169,9 +144,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE) var data = await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE)
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_0900==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -187,9 +159,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -187,9 +159,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_1000==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -207,9 +176,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -207,9 +176,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission(BUNDLE_NAME, permissionName) var data = await bundle.checkPermission(BUNDLE_NAME, permissionName)
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_1100==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -229,9 +195,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -229,9 +195,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_1200==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -249,9 +212,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -249,9 +212,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission(bundleName, PERMISSION_ONE) var data = await bundle.checkPermission(bundleName, PERMISSION_ONE)
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_1300==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -271,9 +231,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -271,9 +231,6 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_1400==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -287,9 +244,6 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -287,9 +244,6 @@ describe('ActsBmsCheckPermissionTest', function () {
var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO) var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO)
expect(data).assertEqual(0); expect(data).assertEqual(0);
done(); done();
setTimeout(function () {
console.info('=====================bms_checkPermission_1500==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -305,8 +259,5 @@ describe('ActsBmsCheckPermissionTest', function () { ...@@ -305,8 +259,5 @@ describe('ActsBmsCheckPermissionTest', function () {
expect(data).assertEqual(0); expect(data).assertEqual(0);
done(); done();
}) })
setTimeout(function () {
console.info('=====================bms_checkPermission_1600==================end');
}, TIMEOUT)
}) })
}) })
\ No newline at end of file
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsBmsKitTest.hap", "bmsThirdBundleTest1.hap",
"bmsThirdBundleTest1.hap" "ActsBmsKitTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
......
...@@ -18,7 +18,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -18,7 +18,6 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import featureAbility from '@ohos.ability.featureability' import featureAbility from '@ohos.ability.featureability'
import commonEvent from '@ohos.commonevent' import commonEvent from '@ohos.commonevent'
const TIMEOUT = 2000;
const STRESSLEVEL = 20; const STRESSLEVEL = 20;
const BUNDLE_NAME = 'com.example.actsbmskittest'; const BUNDLE_NAME = 'com.example.actsbmskittest';
const PERMISSION_NAME = 'com.permission.PERMISSION_A'; const PERMISSION_NAME = 'com.permission.PERMISSION_A';
...@@ -64,9 +63,6 @@ describe('ActsBmsKitTest', function () { ...@@ -64,9 +63,6 @@ describe('ActsBmsKitTest', function () {
} }
} }
) )
setTimeout(function () {
console.info('==================beforeAll==================end');
}, TIMEOUT)
}) })
/* /*
* @tc.number: ActsBmsKit_getAllShortcutInfo_0100 * @tc.number: ActsBmsKit_getAllShortcutInfo_0100
...@@ -85,9 +81,6 @@ describe('ActsBmsKitTest', function () { ...@@ -85,9 +81,6 @@ describe('ActsBmsKitTest', function () {
break; break;
} }
done(); done();
setTimeout(function () {
console.info('==================ActsBmsKit_getAllShortcutInfo_0100==================end');
}, TIMEOUT)
}); });
/* /*
...@@ -112,9 +105,6 @@ describe('ActsBmsKitTest', function () { ...@@ -112,9 +105,6 @@ describe('ActsBmsKitTest', function () {
} }
}) })
} }
setTimeout(function () {
console.info('=====================ActsBmsKit_getAllShortcutInfo_0200==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -133,9 +123,6 @@ describe('ActsBmsKitTest', function () { ...@@ -133,9 +123,6 @@ describe('ActsBmsKitTest', function () {
} }
} }
done(); done();
setTimeout(function () {
console.info('=====================ActsBmsKit_checkPermission_0100==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -159,9 +146,6 @@ describe('ActsBmsKitTest', function () { ...@@ -159,9 +146,6 @@ describe('ActsBmsKitTest', function () {
} }
}) })
} }
setTimeout(function () {
console.info('=====================ActsBmsKit_checkPermission_0200==================end');
}, TIMEOUT)
}) })
/* /*
...@@ -213,9 +197,6 @@ describe('ActsBmsKitTest', function () { ...@@ -213,9 +197,6 @@ describe('ActsBmsKitTest', function () {
count++; count++;
}); });
} }
setTimeout(function () {
console.debug('==========ActsBmsKit_getModuleUsageRecordTest_0200==================end');
}, TIMEOUT)
}) })
function checkModuleUsageRecord(data, caseName) { function checkModuleUsageRecord(data, caseName) {
console.debug('======================check ModuleUsageRecord begin=========================='); console.debug('======================check ModuleUsageRecord begin==========================');
...@@ -226,21 +207,21 @@ describe('ActsBmsKitTest', function () { ...@@ -226,21 +207,21 @@ describe('ActsBmsKitTest', function () {
console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName)); console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName));
expect(data[i].bundleName.length).assertLarger(0); expect(data[i].bundleName.length).assertLarger(0);
console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId)); console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId));
expect(data[i].appLabelId).assertLarger(0); expect(data[i].appLabelId >= 0).assertTrue();
console.debug('=============name==============' + JSON.stringify(data[i].name)); console.debug('=============name==============' + JSON.stringify(data[i].name));
expect(data[i].name.length).assertLarger(0); expect(data[i].name.length).assertLarger(0);
console.debug('=============labelId==============' + JSON.stringify(data[i].labelId)); console.debug('=============labelId==============' + JSON.stringify(data[i].labelId));
expect(data[i].labelId >=0 ).assertTrue(); expect(data[i].labelId >= 0).assertTrue();
console.debug('=============descriptionId==============' + JSON.stringify(data[i].descriptionId)); console.debug('=============descriptionId==============' + JSON.stringify(data[i].descriptionId));
expect(data[i].descriptionId).assertEqual(0); expect(data[i].descriptionId).assertEqual(0);
console.debug('=============abilityName==============' + JSON.stringify(data[i].abilityName)); console.debug('=============abilityName==============' + JSON.stringify(data[i].abilityName));
expect(data[i].abilityName.length).assertLarger(0); expect(data[i].abilityName.length).assertLarger(0);
console.debug('=============abilityLabelId==============' + JSON.stringify(data[i].abilityLabelId)); console.debug('=============abilityLabelId==============' + JSON.stringify(data[i].abilityLabelId));
expect(data[i].abilityLabelId).assertLarger(0); expect(data[i].abilityLabelId >= 0).assertTrue();
console.debug('===========abilityDescriptionId===========' + JSON.stringify(data[i].abilityDescriptionId)); console.debug('===========abilityDescriptionId===========' + JSON.stringify(data[i].abilityDescriptionId));
expect(data[i].abilityDescriptionId).assertLarger(0); expect(data[i].abilityDescriptionId >= 0).assertTrue();
console.debug('=============abilityIconId==============' + JSON.stringify(data[i].abilityIconId)); console.debug('=============abilityIconId==============' + JSON.stringify(data[i].abilityIconId));
expect(data[i].abilityIconId).assertLarger(0); expect(data[i].abilityIconId >= 0).assertTrue();
console.debug('=============launchedCount==============' + JSON.stringify(data[i].launchedCount)); console.debug('=============launchedCount==============' + JSON.stringify(data[i].launchedCount));
expect(data[i].launchedCount).assertLarger(0); expect(data[i].launchedCount).assertLarger(0);
console.debug('=============lastLaunchTime==============' + JSON.stringify(data[i].lastLaunchTime)); console.debug('=============lastLaunchTime==============' + JSON.stringify(data[i].lastLaunchTime));
......
...@@ -20,7 +20,7 @@ group("publish_test") { ...@@ -20,7 +20,7 @@ group("publish_test") {
#"badgedisplayed:badgedisplayed", #"badgedisplayed:badgedisplayed",
#"enablenotification:enablenotification", #"enablenotification:enablenotification",
"getactive:getactive", "getactive:getactive",
"getwantagentinfo:getwantagentinfo", "getwantagentinfo:ActsAnsGetWantAgentInfoTest",
#"publishcontentype:publishcontentype", #"publishcontentype:publishcontentype",
#"subscribe:subscribe", #"subscribe:subscribe",
......
...@@ -13,18 +13,14 @@ ...@@ -13,18 +13,14 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_hap("localcandisplay") { ohos_js_hap_suite("localcandisplay") {
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
hap_name = "localcandisplay"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [ deps = [
":hjs_demo_js_assets", ":hjs_demo_js_assets",
":hjs_demo_resources", ":hjs_demo_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "localcandisplay"
} }
ohos_js_assets("hjs_demo_js_assets") { ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default" source_dir = "./entry/src/main/js/default"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import notify from '@ohos.notification' import notify from '@ohos.notification'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
var time = 1000 var time = 1000
var errorCode = 67108870 var ERR_ANS_INVALID_BUNDLE = 67108870
describe('ActsAnsEnableNotificationTest', function () { describe('ActsAnsEnableNotificationTest', function () {
console.info("===========ActsAnsEnableNotificationTest start====================>"); console.info("===========ActsAnsEnableNotificationTest start====================>");
/* /*
...@@ -78,14 +78,13 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -78,14 +78,13 @@ describe('ActsAnsEnableNotificationTest', function () {
* @tc.desc: verify the function of isNotificationEnabled * @tc.desc: verify the function of isNotificationEnabled
*/ */
it('ActsGetEnable_test_0400', 0, async function (done) { it('ActsGetEnable_test_0400', 0, async function (done) {
var promise = await notify.isNotificationEnabled({ notify.isNotificationEnabled({
bundle:"wrong BundleName", bundle:"wrong BundleName",
}) }).then().catch((err)=>{
expect(promise).assertEqual(false) console.debug("====>ActsGetEnable_test_0400 promsie====>"+err.code);
done(); expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE)
setTimeout(function(){ done();
console.debug("====>time out ActsGetEnable_test_0400====>"); })
}, time);
}) })
/* /*
* @tc.number: ActsGetEnable_test_0500 * @tc.number: ActsGetEnable_test_0500
...@@ -98,9 +97,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -98,9 +97,6 @@ describe('ActsAnsEnableNotificationTest', function () {
expect(typeof(data)).assertEqual('boolean') expect(typeof(data)).assertEqual('boolean')
}) })
done(); done();
setTimeout(function(){
console.debug("====>time out ActsGetDisplay_test_0500====>");
}, time);
}) })
/* /*
* @tc.number: ActsGetEnable_test_0600 * @tc.number: ActsGetEnable_test_0600
...@@ -111,9 +107,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -111,9 +107,6 @@ describe('ActsAnsEnableNotificationTest', function () {
var promise = await notify.isNotificationEnabled("#$#$%$%^") var promise = await notify.isNotificationEnabled("#$#$%$%^")
expect(promise).assertEqual(undefined) expect(promise).assertEqual(undefined)
done(); done();
setTimeout(function(){
console.debug("====>time out ActsGetEnable_test_0600====>");
}, time);
}) })
/* /*
* @tc.number: ActsGetDisplay_test_0700 * @tc.number: ActsGetDisplay_test_0700
...@@ -126,9 +119,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -126,9 +119,6 @@ describe('ActsAnsEnableNotificationTest', function () {
expect(typeof(data)).assertEqual('boolean') expect(typeof(data)).assertEqual('boolean')
}) })
done(); done();
setTimeout(function(){
console.debug("====>time out ActsGetDisplay_test_0700====>");
}, time);
}) })
/* /*
* @tc.number: ActsGetEnable_test_0800 * @tc.number: ActsGetEnable_test_0800
...@@ -139,9 +129,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -139,9 +129,6 @@ describe('ActsAnsEnableNotificationTest', function () {
var promise = await notify.isNotificationEnabled({}) var promise = await notify.isNotificationEnabled({})
expect(promise).assertEqual(undefined) expect(promise).assertEqual(undefined)
done(); done();
setTimeout(function(){
console.debug("====>time out ActsGetEnable_test_0800====>");
}, time);
}) })
/* /*
* @tc.number: ActsGetEnable_test_0900 * @tc.number: ActsGetEnable_test_0900
...@@ -162,9 +149,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -162,9 +149,6 @@ describe('ActsAnsEnableNotificationTest', function () {
done(); done();
}) })
}) })
setTimeout(function(){
console.debug("====>time out ActsGetDisplay_test_0900====>");
}, time);
}) })
/* /*
* @tc.number: ActsGetEnable_test_1000 * @tc.number: ActsGetEnable_test_1000
...@@ -184,9 +168,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -184,9 +168,6 @@ describe('ActsAnsEnableNotificationTest', function () {
expect(promise).assertEqual(true) expect(promise).assertEqual(true)
done(); done();
}) })
setTimeout(function(){
console.debug("===>time out ActsGetDisplay_test_1000===>");
}, time);
}) })
/* /*
* @tc.number: ActsSetEnable_test_0100 * @tc.number: ActsSetEnable_test_0100
...@@ -200,9 +181,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -200,9 +181,6 @@ describe('ActsAnsEnableNotificationTest', function () {
console.log("===>ActsSetEnable_test_0100 success===>"+err) console.log("===>ActsSetEnable_test_0100 success===>"+err)
}) })
done(); done();
setTimeout(function(){
console.debug("====>time out ActsSetEnable_test_0100====>");
}, time);
}) })
/* /*
* @tc.number: ActsSetEnable_test_0200 * @tc.number: ActsSetEnable_test_0200
...@@ -215,9 +193,6 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -215,9 +193,6 @@ describe('ActsAnsEnableNotificationTest', function () {
},100) },100)
expect(promise).assertEqual(undefined) expect(promise).assertEqual(undefined)
done(); done();
setTimeout(function(){
console.debug("===>time out ActsSetEnable_test_0200===>");
}, time);
}) })
/* /*
* @tc.number: ActsSetEnable_test_0300 * @tc.number: ActsSetEnable_test_0300
...@@ -229,12 +204,9 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -229,12 +204,9 @@ describe('ActsAnsEnableNotificationTest', function () {
bundle:"Wrong BundleName" bundle:"Wrong BundleName"
},true,(err) => { },true,(err) => {
console.log("===>ActsSetEnable_test_0300 success===>"+err.code) console.log("===>ActsSetEnable_test_0300 success===>"+err.code)
expect(err.code).assertEqual(errorCode) expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE)
}) })
done(); done();
setTimeout(function(){
console.debug("====>time out ActsSetDisplay_test_0300====>");
}, time);
}) })
/* /*
* @tc.number: ActsSetEnable_test_0400 * @tc.number: ActsSetEnable_test_0400
...@@ -242,14 +214,13 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -242,14 +214,13 @@ describe('ActsAnsEnableNotificationTest', function () {
* @tc.desc: verify the function of enableNotification * @tc.desc: verify the function of enableNotification
*/ */
it('ActsSetEnable_test_0400', 0, async function (done) { it('ActsSetEnable_test_0400', 0, async function (done) {
var promise = await notify.enableNotification({ notify.enableNotification({
bundle:"Wrong BundleName" bundle:"Wrong BundleName"
},true) },true).then().catch((err)=>{
expect(promise).assertEqual(undefined) console.log("===>ActsSetEnable_test_0400 err===>"+err.code)
done(); expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE)
setTimeout(function(){ done();
console.debug("===>time out ActsSetEnable_test_0400===>"); })
}, time);
}) })
/* /*
* @tc.number: ActsSetEnable_test_0500 * @tc.number: ActsSetEnable_test_0500
...@@ -346,7 +317,7 @@ describe('ActsAnsEnableNotificationTest', function () { ...@@ -346,7 +317,7 @@ describe('ActsAnsEnableNotificationTest', function () {
await notify.isNotificationEnabled({ await notify.isNotificationEnabled({
bundle:"com.example.actsanslocalnotificationtest", bundle:"com.example.actsanslocalnotificationtest",
},(err,data) => { },(err,data) => {
console.log("===>ActsGetEnable_test_0100 success===>"+err+data) console.log("===>ActsSetEnable_test_0900 success===>"+err+data)
expect(typeof(data)).assertEqual('boolean') expect(typeof(data)).assertEqual('boolean')
expect(data).assertEqual(false) expect(data).assertEqual(false)
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册