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

!9903 【卡片XTS】修复ApiCoverAbility失败用例

Merge pull request !9903 from yuyaozhi/master
...@@ -33,6 +33,7 @@ let INNER_ERROR = 16000050; ...@@ -33,6 +33,7 @@ let INNER_ERROR = 16000050;
let CROSS_USER_DENY = 201; let CROSS_USER_DENY = 201;
let array = new Array(); let array = new Array();
let TAG = ''; let TAG = '';
let createModuleContext: any;
function sleep(time) { function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time)); return new Promise((resolve)=>setTimeout(resolve,time));
} }
...@@ -366,8 +367,13 @@ export default function ApiCoverTest() { ...@@ -366,8 +367,13 @@ export default function ApiCoverTest() {
expect("/data/storage/el1/bundle").assertEqual(globalThis.abilityContext.bundleCodeDir) expect("/data/storage/el1/bundle").assertEqual(globalThis.abilityContext.bundleCodeDir)
expect("/data/storage/el2/distributedfiles").assertEqual(globalThis.abilityContext.distributedFilesDir) expect("/data/storage/el2/distributedfiles").assertEqual(globalThis.abilityContext.distributedFilesDir)
expect(1).assertEqual(globalThis.abilityContext.area) expect(1).assertEqual(globalThis.abilityContext.area)
let moduleContext = globalThis.abilityContext.createModuleContext("module1") createModuleContext = null;
expect("/data/storage/el2/base/cache").assertEqual(moduleContext.cacheDir) try{
let createModuleContext = globalThis.abilityContext.createModuleContext("module1")
expect("/data/storage/el2/base/cache").assertEqual(createModuleContext.cacheDir)
}catch(error){
console.log("createModuleContext fail")
}
globalThis.abilityContext.area = 0 globalThis.abilityContext.area = 0
expect(0).assertEqual(globalThis.abilityContext.area) expect(0).assertEqual(globalThis.abilityContext.area)
globalThis.abilityContext.resourceManager.getConfiguration((err, data) => { globalThis.abilityContext.resourceManager.getConfiguration((err, data) => {
...@@ -606,10 +612,11 @@ export default function ApiCoverTest() { ...@@ -606,10 +612,11 @@ export default function ApiCoverTest() {
function UnSubscribeInfoCallback(err, data) { function UnSubscribeInfoCallback(err, data) {
console.info("SUB_AA_FMS_AcquireForm_0100 ===UnSubscribeInfoCallback===") console.info("SUB_AA_FMS_AcquireForm_0100 ===UnSubscribeInfoCallback===")
} }
function SubscribeInfoCallback(err, data) { async function SubscribeInfoCallback(err, data) {
console.info("SUB_AA_FMS_AcquireForm_0100 ===SubscribeInfoCallback===" + JSON.stringify(data)) console.info("SUB_AA_FMS_AcquireForm_0100 ===SubscribeInfoCallback===" + JSON.stringify(data))
expect(data.parameters["Life"]).assertEqual("onForeground") expect(data.parameters["Life"]).assertEqual("onForeground")
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback) commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
await sleep(4000)
done() done()
} }
commonEvent.createSubscriber(subscribeInfo, (err, data) => { commonEvent.createSubscriber(subscribeInfo, (err, data) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册