From 76a59d201d3ce88a30acdd281b1fe40a4821c8a1 Mon Sep 17 00:00:00 2001 From: ling990 Date: Mon, 11 Apr 2022 13:58:33 +0800 Subject: [PATCH] modify testcases Signed-off-by: ling990 Signed-off-by: ling990 --- .../AudioDecoderFormatCallbackTest.test.js | 30 ++++++++--------- .../AudioDecoderFormatPromiseTest.test.js | 30 ++++++++--------- .../test/AudioDecoderFuncCallbackTest.test.js | 30 ++++++++--------- .../test/AudioDecoderFuncPromiseTest.test.js | 30 ++++++++--------- ...udioDecoderReliabilityCallbackTest.test.js | 8 ++--- ...AudioDecoderReliabilityPromiseTest.test.js | 8 ++--- .../test/AudioEncoderFuncCallbackTest.test.js | 32 +++++++++---------- .../test/AudioEncoderFuncPromiseTest.test.js | 32 +++++++++---------- ...udioEncoderReliabilityCallbackTest.test.js | 8 ++--- ...AudioEncoderReliabilityPromiseTest.test.js | 8 ++--- .../main/js/test/VideoDecoderEnumTest.test.js | 8 ++--- .../test/VideoDecoderFuncCallbackTest.test.js | 8 ++--- .../test/VideoDecoderFuncPromiseTest.test.js | 8 ++--- .../test/VideoDecoderReliCallbackTest.test.js | 8 ++--- .../test/VideoDecoderReliPromiseTest.test.js | 8 ++--- ...deoDecoderSoftwareFuncCallbackTest.test.js | 8 ++--- ...ideoDecoderSoftwareFuncPromiseTest.test.js | 8 ++--- ...deoDecoderSoftwareReliCallbackTest.test.js | 8 ++--- ...ideoDecoderSoftwareReliPromiseTest.test.js | 8 ++--- .../VideoEncoderMultiInstancesTest.test.js | 22 ++++++------- ...deoEncoderSoftwareFuncCallbackTest.test.js | 22 ++++++------- ...ideoEncoderSoftwareFuncPromiseTest.test.js | 22 ++++++------- 22 files changed, 177 insertions(+), 177 deletions(-) diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js index 12a6fcb9a..c25110155 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js @@ -45,9 +45,9 @@ describe('AudioDecoderFormatCallback', function () { let isVorbis = false; let readpath; let savepath; - let fd_Read; - let fd_Write; - let fileAsset_Write; + let fdRead; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -99,8 +99,8 @@ describe('AudioDecoderFormatCallback', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -150,29 +150,29 @@ describe('AudioDecoderFormatCallback', function () { } let fetchWriteFileResult = await mediaTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } function writeFile(path, buf, len) { try{ - let res = fileio.writeSync(fd_Write, buf, {length: len}); + let res = fileio.writeSync(fdWrite, buf, {length: len}); console.info('case fileio.writeSync buffer success'); } catch(e) { console.info('case fileio.writeSync buffer error is ' + e); @@ -183,7 +183,7 @@ describe('AudioDecoderFormatCallback', function () { console.info('read file start execution'); try{ console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js index 4b9c2a164..43cb445f7 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js @@ -44,9 +44,9 @@ describe('AudioDecoderFormatPromise', function () { let isVorbis = false; let readpath; let savepath; - let fd_Read; - let fd_Write; - let fileAsset_Write; + let fdRead; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -108,8 +108,8 @@ describe('AudioDecoderFormatPromise', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -159,29 +159,29 @@ describe('AudioDecoderFormatPromise', function () { } let fetchWriteFileResult = await mediaTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } function writeFile(path, buf, len) { try{ - let res = fileio.writeSync(fd_Write, buf, {length: len}); + let res = fileio.writeSync(fdWrite, buf, {length: len}); console.info('case fileio.writeSync buffer success'); } catch(e) { console.info('case fileio.writeSync buffer error is ' + e); @@ -192,7 +192,7 @@ describe('AudioDecoderFormatPromise', function () { console.info('read file start execution'); try{ console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js index 7976ee662..284bd9c30 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js @@ -136,9 +136,9 @@ describe('AudioDecoderFuncCallback', function () { let ES_LENGTH = 1500; let readpath; let savepath; - let fd_Read; - let fd_Write; - let fileAsset_Write; + let fdRead; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -300,8 +300,8 @@ describe('AudioDecoderFuncCallback', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -351,29 +351,29 @@ describe('AudioDecoderFuncCallback', function () { } let fetchWriteFileResult = await mediaTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } function writeFile(path, buf, len) { try{ - let res = fileio.writeSync(fd_Write, buf, {length: len}); + let res = fileio.writeSync(fdWrite, buf, {length: len}); console.info('case fileio.writeSync buffer success'); } catch(e) { console.info('case fileio.writeSync buffer error is ' + e); @@ -384,7 +384,7 @@ describe('AudioDecoderFuncCallback', function () { console.info('read file start execution'); try{ console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js index 71af5e03a..822b94fe9 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js @@ -136,9 +136,9 @@ describe('AudioDecoderFuncPromise', function () { let ES_LENGTH = 1500; let readpath; let savepath; - let fd_Read; - let fd_Write; - let fileAsset_Write; + let fdRead; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -310,8 +310,8 @@ describe('AudioDecoderFuncPromise', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -361,29 +361,29 @@ describe('AudioDecoderFuncPromise', function () { } let fetchWriteFileResult = await mediaTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } function writeFile(path, buf, len) { try{ - let res = fileio.writeSync(fd_Write, buf, {length: len}); + let res = fileio.writeSync(fdWrite, buf, {length: len}); console.info('case fileio.writeSync buffer success'); } catch(e) { console.info('case fileio.writeSync buffer error is ' + e); @@ -394,7 +394,7 @@ describe('AudioDecoderFuncPromise', function () { console.info('read file start execution'); try{ console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js index cc58f3fdc..d3f625f7d 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js @@ -147,7 +147,7 @@ describe('AudioDecoderReliabilityCallback', function () { "sample_rate": 44100, "audio_sample_format": 1, }; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -310,8 +310,8 @@ describe('AudioDecoderReliabilityCallback', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -320,7 +320,7 @@ describe('AudioDecoderReliabilityCallback', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js index 7861209e8..ea218b19a 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js @@ -149,7 +149,7 @@ describe('AudioDecoderReliabilityPromise', function () { "audio_sample_format": 1, }; let expectError = false; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -331,8 +331,8 @@ describe('AudioDecoderReliabilityPromise', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -341,7 +341,7 @@ describe('AudioDecoderReliabilityPromise', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js index 512ab87f2..0e7086cd9 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js @@ -45,9 +45,9 @@ describe('AudioEncoderFuncCallback', function () { let ES_LENGTH = 1500; let readpath; let savepath; - let fd_Read; - let fd_Write; - let fileAsset_Write; + let fdRead; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -119,8 +119,8 @@ describe('AudioEncoderFuncCallback', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -170,22 +170,22 @@ describe('AudioEncoderFuncCallback', function () { } let fetchWriteFileResult = await mediaTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } @@ -193,7 +193,7 @@ describe('AudioEncoderFuncCallback', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } @@ -211,7 +211,7 @@ describe('AudioEncoderFuncCallback', function () { try{ let head = new ArrayBuffer(7); addADTStoPacket(head, len); - let res = fileio.write(fd_Write, head, {length: 7}); + let res = fileio.write(fdWrite, head, {length: 7}); console.info('case fileio.write head success'); } catch(e) { console.info('case fileio.write head error is ' + e); @@ -220,7 +220,7 @@ describe('AudioEncoderFuncCallback', function () { function writeFile(path, buf, len) { try{ - let res = fileio.write(fd_Write, buf, {length: len}); + let res = fileio.write(fdWrite, buf, {length: len}); console.info('case fileio.write buffer success'); } catch(e) { console.info('case fileio.write buffer error is ' + e); diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js index 06b46628f..4831a1ebc 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js @@ -45,9 +45,9 @@ describe('AudioEncoderFuncPromise', function () { let ES_LENGTH = 1500; let readpath; let savepath; - let fd_Read; - let fd_Write; - let fileAsset_Write; + let fdRead; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -129,8 +129,8 @@ describe('AudioEncoderFuncPromise', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -180,22 +180,22 @@ describe('AudioEncoderFuncPromise', function () { } let fetchWriteFileResult = await mediaTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } @@ -203,7 +203,7 @@ describe('AudioEncoderFuncPromise', function () { console.info('read file start execution'); try{ console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } @@ -220,7 +220,7 @@ describe('AudioEncoderFuncPromise', function () { try{ let head = new ArrayBuffer(7); addADTStoPacket(head, len); - let res = fileio.write(fd_Write, head, {length: 7}); + let res = fileio.write(fdWrite, head, {length: 7}); console.info('case fileio.write head success'); } catch(e) { console.info('case fileio.write head error is ' + e); @@ -229,7 +229,7 @@ describe('AudioEncoderFuncPromise', function () { function writeFile(path, buf, len) { try{ - let res = fileio.write(fd_Write, buf, {length: len}); + let res = fileio.write(fdWrite, buf, {length: len}); console.info('case fileio.write buffer success'); } catch(e) { console.info('case fileio.write buffer error is ' + e); diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js index 3c87421ec..1029f0e44 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js @@ -59,7 +59,7 @@ describe('AudioEncoderReliabilityCallback', function () { "sample_rate": 44100, "audio_sample_format": 1, }; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -133,8 +133,8 @@ describe('AudioEncoderReliabilityCallback', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -143,7 +143,7 @@ describe('AudioEncoderReliabilityCallback', function () { console.info('read file start execution'); try{ console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js index 3f3c4da77..57a31709b 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js @@ -60,7 +60,7 @@ describe('AudioEncoderReliabilityPromise', function () { "audio_sample_format": 1, }; let expectError = false; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -150,8 +150,8 @@ describe('AudioEncoderReliabilityPromise', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -160,7 +160,7 @@ describe('AudioEncoderReliabilityPromise', function () { console.info('read file start execution'); try{ console.info('filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js index f7b516025..f1dbc787d 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js @@ -39,7 +39,7 @@ describe('VideoDecoderEnum', function () { const H264_FRAME_SIZE_60FPS_320 = [ 2106, 11465]; let readpath; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -92,7 +92,7 @@ describe('VideoDecoderEnum', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.error('in case readFile' + e); } @@ -322,8 +322,8 @@ describe('VideoDecoderEnum', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) let mediaDescription = { diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js index 15b29f13e..2977be9f8 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js @@ -92,7 +92,7 @@ describe('VideoDecoderFuncCallbackTest', function () { 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fd_Read; + let fdRead; let readpath; beforeAll(function() { @@ -164,8 +164,8 @@ describe('VideoDecoderFuncCallbackTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -174,7 +174,7 @@ describe('VideoDecoderFuncCallbackTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js index 02b501e0f..f704d190b 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js @@ -93,7 +93,7 @@ describe('VideoDecoderFuncPromiseTest', function () { 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fd_Read; + let fdRead; let readpath; beforeAll(function() { @@ -163,8 +163,8 @@ describe('VideoDecoderFuncPromiseTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -173,7 +173,7 @@ describe('VideoDecoderFuncPromiseTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js index 0ed79caf3..954682cb0 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js @@ -75,7 +75,7 @@ describe('VideoDecoderReliCallbackTest', function () { 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -151,7 +151,7 @@ describe('VideoDecoderReliCallbackTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } @@ -422,8 +422,8 @@ describe('VideoDecoderReliCallbackTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) media.createVideoDecoderByMime(mime, (err, processor) => { diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js index 1e676ca15..f0caca42f 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js @@ -75,7 +75,7 @@ describe('VideoDecoderReliPromiseTest', function () { 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -157,7 +157,7 @@ describe('VideoDecoderReliPromiseTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } @@ -419,8 +419,8 @@ describe('VideoDecoderReliPromiseTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) media.createVideoDecoderByMime(mime).then((processor) => { diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js index 5196d7a34..8f52cd3dc 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js @@ -108,7 +108,7 @@ describe('VideoDecoderFuncCallbackTest', function () { 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fd_Read; + let fdRead; let readpath; beforeAll(function() { @@ -178,8 +178,8 @@ describe('VideoDecoderFuncCallbackTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -188,7 +188,7 @@ describe('VideoDecoderFuncCallbackTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js index ebb0bdf18..3d0ccdba2 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js @@ -109,7 +109,7 @@ describe('VideoDecoderFuncPromiseTest', function () { 295, 206, 264, 349, 4071, 242, 296, 271, 231, 307, 265, 254, 267, 317, 232, 348, 4077, 259, 222, 268, 235, 324, 266, 256, 312, 246, 248, 325, 4000, 266, 201, 230, 293, 264, 265, 273, 301, 304, 253, 266, 3978, 228, 232, 250, 248, 281, 219, 243, 293, 287, 253, 328, 3719]; - let fd_Read; + let fdRead; let readpath; beforeAll(function() { @@ -179,8 +179,8 @@ describe('VideoDecoderFuncPromiseTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) } @@ -189,7 +189,7 @@ describe('VideoDecoderFuncPromiseTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js index 6effbd0b2..374bdd1fb 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js @@ -75,7 +75,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () { 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -151,7 +151,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } @@ -431,8 +431,8 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) media.createVideoDecoderByName(name, (err, processor) => { diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js index 8056f9907..a529b627b 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js @@ -75,7 +75,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () { 574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140, 1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124]; let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320; - let fd_Read; + let fdRead; beforeAll(function() { console.info('beforeAll case'); @@ -157,7 +157,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () { console.info('case read file start execution'); try{ console.info('case filepath: ' + path); - readStreamSync = fileio.fdopenStreamSync(fd_Read, 'rb'); + readStreamSync = fileio.fdopenStreamSync(fdRead, 'rb'); }catch(e) { console.info(e); } @@ -428,8 +428,8 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () { console.info('case error fileDescriptor undefined, open file fail'); done(); } else { - fd_Read = res.fd; - console.info("case fd_Read is: " + fd_Read); + fdRead = res.fd; + console.info("case fdRead is: " + fdRead); } }) media.createVideoDecoderByName(name).then((processor) => { diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js index 204ca2e6c..71e990ddc 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js @@ -38,8 +38,8 @@ describe('videoEncoderSoftwareMultiInstances', function () { let flushAtEOS = false; let sawOutputEOS = false; let needGetMediaDes = false; - let fd_Write; - let fileAsset_Write; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaLibraryTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -148,28 +148,28 @@ describe('videoEncoderSoftwareMultiInstances', function () { } let fetchWriteFileResult = await mediaLibraryTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } function writeFile(buf, len) { try{ - let res = fileio.write(fd_Write, buf, {length: len}); + let res = fileio.write(fdWrite, buf, {length: len}); console.info('case fileio.write buffer success'); } catch(e) { console.info('case fileio.write buffer error is ' + e); diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js index 306b9d0e6..a7a351692 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js @@ -37,8 +37,8 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () { const eventEmitter = new events.EventEmitter(); const ROOT = '/data/app/el1/bundle/results/'; const BASIC_PATH = ROOT + 'video_func_callback_'; - let fd_Write; - let fileAsset_Write; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaLibraryTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -137,28 +137,28 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () { } let fetchWriteFileResult = await mediaLibraryTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } function writeFile(buf, len) { try{ - let res = fileio.write(fd_Write, buf, {length: len}); + let res = fileio.write(fdWrite, buf, {length: len}); console.info('case fileio.write buffer success'); } catch(e) { console.info('case fileio.write buffer error is ' + e); diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js index 64781c2f9..fbd871d50 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js @@ -35,8 +35,8 @@ describe('videoSoftwareEncoderFuncPromise', function () { let flushAtEOS = false; let sawOutputEOS = false; let needGetMediaDes = false; - let fd_Write; - let fileAsset_Write; + let fdWrite; + let fileAsset; const context = featureAbility.getContext(); const mediaLibraryTest = mediaLibrary.getMediaLibrary(context); let fileKeyObj = mediaLibrary.FileKey; @@ -157,28 +157,28 @@ describe('videoSoftwareEncoderFuncPromise', function () { } let fetchWriteFileResult = await mediaLibraryTest.getFileAssets(fetchOp); console.info('[mediaLibrary] case getFdWrite getFileAssets() success'); - fileAsset_Write = await fetchWriteFileResult.getAllObject(); + fileAsset = await fetchWriteFileResult.getAllObject(); console.info('[mediaLibrary] case getFdWrite getAllObject() success'); - fd_Write = await fileAsset_Write[0].open('Rw'); - console.info('[mediaLibrary] case getFdWrite fd_Write is ' + fd_Write); + fdWrite = await fileAsset[0].open('Rw'); + console.info('[mediaLibrary] case getFdWrite fdWrite is ' + fdWrite); } } async function closeFdWrite() { - if (fileAsset_Write != null) { - await fileAsset_Write[0].close(fd_Write).then(() => { - console.info('[mediaLibrary] case close fd_Write success, fd is ' + fd_Write); + if (fileAsset != null) { + await fileAsset[0].close(fdWrite).then(() => { + console.info('[mediaLibrary] case close fdWrite success, fd is ' + fdWrite); }).catch((err) => { - console.info('[mediaLibrary] case close fd_Write failed'); + console.info('[mediaLibrary] case close fdWrite failed'); }); } else { - console.info('[mediaLibrary] case fileAsset_Write is null'); + console.info('[mediaLibrary] case fileAsset is null'); } } function writeFile(buf, len) { try{ - let res = fileio.write(fd_Write, buf, {length: len}); + let res = fileio.write(fdWrite, buf, {length: len}); console.info('case fileio.write buffer success'); } catch(e) { console.info('case fileio.write buffer error is ' + e); -- GitLab