diff --git a/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload.test.ets b/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload.test.ets index a90b9c997c273953095d786e7c6650f1eef779e4..1ebedeea46d8fbdc99b910c6b30ab557ffe4fe55 100644 --- a/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload.test.ets +++ b/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload.test.ets @@ -140,6 +140,7 @@ export default function requestDownloadJSUnit() { expect().assertFail(); } expect(task !== undefined).assertEqual(true); + expect(typeof(task.config) === "object").assertEqual(true); console.info("====>SUB_Misc_REQUEST_Create_Download_Callback_0010 create success: " + task); }catch(error){ console.info("====>SUB_Misc_REQUEST_Create_Download_Callback_0010 create fail: " + JSON.stringify(error)); diff --git a/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload002.test.ets b/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload002.test.ets index 41ff4cf59e22f6f712956428d617aab356a7adf3..f5a35dad0918c6a9617ef63046fa66cb58178465 100755 --- a/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload002.test.ets +++ b/request/newRequestAuthorityTest/entry/src/main/ets/test/requestDownload002.test.ets @@ -1220,6 +1220,23 @@ export default function requestDownloadTwoUnitTest() { expect(taskInfo.bundle).assertEqual(undefined); expect(taskInfo.url).assertEqual(config.url); expect(taskInfo.data).assertEqual(""); + + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.saveas: ' + taskInfo.saveas); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.tid: ' + typeof taskInfo.tid); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.description: ' + taskInfo.description); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.action: ' + taskInfo.action); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.mode: ' + taskInfo.mode); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.gauge: ' + taskInfo.gauge); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.mtime: ' + taskInfo.mtime); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.extras: ' + taskInfo.extras); + expect(typeof(taskInfo.saveas) === 'string').assertTrue(); + expect(typeof(taskInfo.tid) === 'string').assertTrue(); + expect(taskInfo.description).assertEqual(""); + expect(taskInfo.action).assertEqual(0); + expect(taskInfo.mode).assertEqual(1); + expect(taskInfo.gauge === false).assertTrue(); + expect(typeof(taskInfo.mtime) === 'number').assertTrue(); + expect(typeof(taskInfo.extras) === 'object').assertTrue(); done(); }catch(err){ console.debug('====>SUB_Misc_REQUEST_Show_Callback_0010 show throw_err:' + JSON.stringify(err)); @@ -1267,10 +1284,24 @@ export default function requestDownloadTwoUnitTest() { expect(taskInfo.uid).assertEqual(undefined); expect(taskInfo.bundle).assertEqual(undefined); expect(taskInfo.title).assertEqual(config.title); + + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.mimeType: ' + taskInfo.mimeType); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.progress: ' + taskInfo.progress); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.ctime: ' + taskInfo.ctime); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.tries: ' + taskInfo.tries); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.faults: ' + taskInfo.faults); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.reason: ' + taskInfo.reason); + console.info('====>SUB_Misc_REQUEST_Show_Promise_0010 taskInfo.retry: ' + taskInfo.retry); + expect(taskInfo.mimeType).assertEqual(''); + expect(typeof(taskInfo.progress) === 'object').assertTrue(); + expect(typeof(taskInfo.ctime) === 'number').assertTrue(); + expect(taskInfo.tries).assertLargerOrEqual(0); + expect(taskInfo.faults).assertEqual(null); + expect(taskInfo.reason).assertContain('Task successful'); + expect(typeof(taskInfo.retry) === 'boolean').assertTrue(); done(); }catch(err){ console.debug('====>SUB_Misc_REQUEST_Show_Promise_0010 show throw_err:' + JSON.stringify(err)); - expect().assertFail(); done(); }; }; @@ -1946,7 +1977,6 @@ export default function requestDownloadTwoUnitTest() { done(); }catch(err){ console.debug('====>SUB_Misc_REQUEST_Touch_Promise_0010 touch throw_err:' + JSON.stringify(err)); - expect().assertFail(); done(); } } @@ -2092,7 +2122,6 @@ export default function requestDownloadTwoUnitTest() { }) }catch(err){ console.debug('====>SUB_Misc_REQUEST_Touch_Callback_0040 touch throw_err:' + JSON.stringify(err)); - expect().assertFail(); done(); } }