提交 7d065136 编写于 作者: D donglin

abilityManager

Signed-off-by: Ndonglin <donglin9@huawei.com>
Change-Id: I858819ba5fc8cb881c4b1a02db391ec9f7c1dfb1
上级 0bb97a3c
......@@ -14,6 +14,7 @@
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import abilityManager from '@ohos.app.ability.abilityManager';
import errorManager from '@ohos.app.ability.errorManager';
function sleep(time) {
......@@ -78,5 +79,99 @@ export default function ApiCoverTest() {
done();
}
});
/*
* @tc.number SUB_AA_GetTopAbility_0100
* @tc.name Test getTopAbility.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_GetTopAbility_0100', 0, async function (done) {
try {
await abilityManager.getTopAbility().then((data)=>{
expect(true).assertTrue();
done();
}).catch((err)=>{
expect().assertFail()
done();
})
} catch (error) {
expect().assertFail()
done();
}
});
/*
* @tc.number SUB_AA_GetAbilityRunningInfo_0100
* @tc.name Test getAbilityRunningInfo.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_GetAbilityRunningInfo_0100', 0, async function (done) {
try {
await abilityManager.getAbilityRunningInfos().then((data)=>{
expect(true).assertTrue();
done();
}).catch((err)=>{
expect().assertFail()
done();
})
} catch (error) {
expect().assertFail()
done();
}
});
/*
* @tc.number SUB_AA_GetExtensionRunningInfos_0100
* @tc.name Test getExtensionRunningInfos.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_GetExtensionRunningInfos_0100', 0, async function (done) {
try {
let upperLimit = 1;
await abilityManager.getExtensionRunningInfos(upperLimit).then((data)=>{
expect(true).assertTrue();
done();
}).catch((err)=>{
expect().assertFail()
done();
})
} catch (error) {
expect().assertFail()
done();
}
});
/*
* @tc.number SUB_AA_UpdateConfiguration_0100
* @tc.name Test updateConfiguration.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_UpdateConfiguration_0100', 0, async function (done) {
try {
// init for repeat test
var configInit = {
language: 'english'
}
await abilityManager.updateConfiguration(configInit, (err,data)=>{});
var config = {
language: 'chinese'
}
await abilityManager.updateConfiguration(config).then((data)=>{
expect(true).assertTrue();
done();
}).catch((err)=>{
expect().assertFail()
done();
})
} catch (error) {
expect().assertFail()
done();
}
});
})
}
......@@ -106,6 +106,9 @@
},
{
"name":"ohos.permission.START_INVISIBLE_ABILITY"
},
{
"name":"ohos.permission.UPDATE_CONFIGURATION"
}
]
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册