提交 5a0e07e3 编写于 作者: O openharmony_ci 提交者: Gitee

!363 modify testcase to async function(done)

Merge pull request !363 from 杨清/0720
......@@ -23,10 +23,11 @@ describe('resMgrTest', function () {
* @tc.name test getResourceManager method in callback mode
* @tc.desc get the resource manager in callback mode
*/
it('getResourceManager_test_001', 0, function () {
it('getResourceManager_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
expect(mgr != null).assertTrue();
})
done();
})
/* *
......@@ -34,10 +35,11 @@ describe('resMgrTest', function () {
* @tc.name test getResourceManager method in callback mode with bundlename
* @tc.desc get the resource manager in callback mode with bundlename
*/
it('getResourceManager_test_002', 0, function () {
it('getResourceManager_test_002', 0, async function (done) {
resmgr.getResourceManager("com.ohos.settings", (error, mgr) => {
expect(mgr != null).assertTrue();
})
done();
})
/* *
......@@ -45,10 +47,11 @@ describe('resMgrTest', function () {
* @tc.name test getResourceManager method in promise mode
* @tc.desc get the resource manager in promise mode
*/
it('getResourceManager_test_001', 0, function () {
it('getResourceManager_test_003', 0, async function (done) {
resmgr.getResourceManager().then(mgr => {
expect(mgr != null).assertTrue();
})
done();
})
/* *
......@@ -56,10 +59,11 @@ describe('resMgrTest', function () {
* @tc.name test getResourceManager method in promise mode with bundlename
* @tc.desc get the resource manager in promise mode with bundlename
*/
it('getResourceManager_test_002', 0, function () {
it('getResourceManager_test_004', 0, async function (done) {
resmgr.getResourceManager("com.ohos.settings").then(mgr => {
expect(mgr != null).assertTrue();
})
done();
})
/* *
......@@ -67,12 +71,13 @@ describe('resMgrTest', function () {
* @tc.name test getString method in callback mode
* @tc.desc get the string in callback mode
*/
it('getString_test_001', 0, function () {
it('getString_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getString(0x1000000, (err, value) => {
expect(value != null).assertTrue();
})
})
done();
})
/* *
......@@ -80,12 +85,13 @@ describe('resMgrTest', function () {
* @tc.name test getString method in promise mode
* @tc.desc get the string in promise mode
*/
it('getString_test_002', 0, function () {
it('getString_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getString(0x1000000).then(value => {
expect(value != null).assertTrue();
})
})
done();
})
/* *
......@@ -93,12 +99,13 @@ describe('resMgrTest', function () {
* @tc.name test getStringArray method in callback mode
* @tc.desc get the string array in callback mode
*/
it('getStringArray_test_001', 0, function () {
it('getStringArray_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getStringArray(0x1000002, (err, value) => {
expect(value != null).assertTrue();
})
})
done();
})
/* *
......@@ -106,12 +113,13 @@ describe('resMgrTest', function () {
* @tc.name test getStringArray method in promise mode
* @tc.desc get the string array in promise mode
*/
it('getStringArray_test_002', 0, function () {
it('getStringArray_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getStringArray(0x1000002).then(value => {
expect(value != null).assertTrue();
})
})
done();
})
/* *
......@@ -119,12 +127,13 @@ describe('resMgrTest', function () {
* @tc.name test getMedia method in callback mode
* @tc.desc get the media in callback mode
*/
it('getMedia_test_001', 0, function () {
it('getMedia_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getMedia(0x1000004, (err, value) => {
expect(value.length > 0).assertTrue();
})
})
done();
})
/* *
......@@ -132,12 +141,13 @@ describe('resMgrTest', function () {
* @tc.name test getMedia method in promise mode
* @tc.desc get the media in promise mode
*/
it('getMedia_test_002', 0, function () {
it('getMedia_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getMedia(0x1000004).then(value => {
expect(value.length > 0).assertTrue();
})
})
done();
})
/* *
......@@ -145,12 +155,13 @@ describe('resMgrTest', function () {
* @tc.name test getMediaBase64 method in callback mode
* @tc.desc get the media base64 in callback mode
*/
it('getMediaBase64_test_001', 0, function () {
it('getMediaBase64_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getMediaBase64(0x1000004, (err, value) => {
expect(value.length > 0).assertTrue();
})
})
done();
})
/* *
......@@ -158,12 +169,13 @@ describe('resMgrTest', function () {
* @tc.name test getMediaBase64 method in promise mode
* @tc.desc get the media base64 in promise mode
*/
it('getMediaBase64_test_002', 0, function () {
it('getMediaBase64_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getMediaBase64(0x1000004).then(value => {
expect(value.length > 0).assertTrue();
})
})
done();
})
/* *
......@@ -171,12 +183,13 @@ describe('resMgrTest', function () {
* @tc.name test getConfiguration method in callback mode
* @tc.desc get the configuration in callback mode
*/
it('getConfiguration_test_001', 0, function () {
it('getConfiguration_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getConfiguration((error, cfg) => {
expect(cfg != null).assertTrue();
})
})
done();
})
/* *
......@@ -184,12 +197,13 @@ describe('resMgrTest', function () {
* @tc.name test getConfiguration method in promise mode
* @tc.desc get the configuration in promise mode
*/
it('getConfiguration_test_002', 0, function () {
it('getConfiguration_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getConfiguration().then(cfg => {
expect(cfg != null).assertTrue();
})
})
done();
})
/* *
......@@ -197,12 +211,13 @@ describe('resMgrTest', function () {
* @tc.name test getDeviceCapability method in callback mode
* @tc.desc get the device capability in callback mode
*/
it('getDeviceCapability_test_001', 0, function () {
it('getDeviceCapability_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getDeviceCapability((error, dc) => {
expect(dc != null).assertTrue();
})
})
done();
})
/* *
......@@ -210,12 +225,13 @@ describe('resMgrTest', function () {
* @tc.name test getDeviceCapability method in promise mode
* @tc.desc get the device capability in promise mode
*/
it('getDeviceCapability_test_002', 0, function () {
it('getDeviceCapability_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getDeviceCapability().then(dc => {
expect(dc != null).assertTrue();
})
})
done();
})
/* *
......@@ -223,12 +239,13 @@ describe('resMgrTest', function () {
* @tc.name test getPluralString method in callback mode
* @tc.desc get the plural string in callback mode
*/
it('getPluralString_test_001', 0, function () {
it('getPluralString_test_001', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getPluralString(0x1000003, 1, (error, value) => {
expect(value != null).assertTrue();
})
})
done();
})
/* *
......@@ -236,11 +253,12 @@ describe('resMgrTest', function () {
* @tc.name test getPluralString method in promise mode
* @tc.desc get the plural string in promise mode
*/
it('getPluralString_test_002', 0, function () {
it('getPluralString_test_002', 0, async function (done) {
resmgr.getResourceManager((error, mgr) => {
mgr.getPluralString(0x1000003, 1).then(value => {
expect(value != null).assertTrue();
})
})
done();
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册