提交 76a59d20 编写于 作者: L ling990

modify testcases Signed-off-by: ling990 <liling96@huawei.com>

Signed-off-by: Nling990 <ling990@qq.com>
上级 37fb879c
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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 = {
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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) => {
......
......@@ -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) => {
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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) => {
......
......@@ -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) => {
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册