diff --git a/miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js b/miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js index 1cab984235adf887856c9158a71b4fa70287f082..7e7822e9cf4bf83ee3c1c052727faafba18aa396 100644 --- a/miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js +++ b/miscservices/RequestTest_js/entry/src/main/js/Test/Publicfunction.js @@ -40,10 +40,10 @@ function getUploadConfig(fileurl){ } let FileArray=new Array(); FileArray[0] = File; - let Header_Http = { headers: 'http' } + let headerHttp = { headers: 'http' } let UploadConfig = { url: 'http://192.168.112.124/upload_test/',// Resource address. - header: Header_Http, // Adds an HTTP or HTTPS header to be included with the upload request. + header: headerHttp, // Adds an HTTP or HTTPS header to be included with the upload request. method: 'POST', // Request method: POST, PUT. The default POST. files: FileArray, // A list of files to be uploaded. Please use multipart/form-data to submit. data: RequestData // The requested form data. diff --git a/miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js b/miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js index 2e37bd96c7a63ba5a875989ac01a022142083e45..8f7c4a320721dfc203c34aa99e7055150d1cd2c1 100644 --- a/miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js +++ b/miscservices/RequestTest_js/entry/src/main/js/Test/UploadCallbackXTSJsunit.test.js @@ -17,9 +17,9 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' import request from '@ohos.request'; import * as pubfun from './Publicfunction.js' -var Type_Progress = 'progress'; -var Type_HeaderReceive = 'headerReceive'; -var Type_Fail = 'fail'; +var typeProgress = 'progress'; +var typeHeaderReceive = 'headerReceive'; +var typeFail = 'fail'; let uploadTask; let file7url = 'internal://cache/test.txt'; @@ -40,6 +40,7 @@ describe('UploadTest', function () { console.info('afterAll: Test suite-level cleanup condition, ' + 'which is executed after the test suite is executed'); }) + /* * @tc.number : InitUploadtaskCallback001 * @tc.name : Use getEntries get the value by mixing the string key @@ -81,7 +82,7 @@ describe('UploadTest', function () { */ it('SwitchOnProgressCallback001', 0, async function (done) { try { - pubfun.publiconprogress(uploadTask, Type_Progress); + pubfun.publiconprogress(uploadTask, typeProgress); expect(true).assertEqual(0 == 0); done(); } catch (err) { @@ -101,10 +102,10 @@ describe('UploadTest', function () { */ it('SwitchOffProgressCallback001', 0, async function (done) { try { - pubfun.publiconprogress(uploadTask, Type_Progress); + pubfun.publiconprogress(uploadTask, typeProgress); expect(true).assertEqual(0 == 0); - await pubfun.publicoffprogress(uploadTask, Type_Progress).then((data) => { + await pubfun.publicoffprogress(uploadTask, typeProgress).then((data) => { console.log("SwitchOffProgressCallback001 data" + JSON.stringify(data)); expect(7).assertEqual(data.totalSize); done(); @@ -130,7 +131,7 @@ describe('UploadTest', function () { */ it('SwitchOnFailCallback001', 0, async function (done) { try { - await pubfun.publicon(uploadTask, Type_Fail).then((data) => { + await pubfun.publicon(uploadTask, typeFail).then((data) => { console.log("SwitchOnFailCallback001 data " + data); expect(5).assertEqual(data); done(); @@ -156,8 +157,8 @@ describe('UploadTest', function () { */ it('SwitchOffFailCallback001', 0, async function (done) { try { - await pubfun.publicon(uploadTask, Type_Fail) - await pubfun.publicoff(uploadTask, Type_Fail).then((data) => { + await pubfun.publicon(uploadTask, typeFail) + await pubfun.publicoff(uploadTask, typeFail).then((data) => { console.log("SwitchOffFailCallback001 data " + data); expect(5).assertEqual(data); done();