提交 c886084c 编写于 作者: L lxq

<liuxueqi3@huawei.com>

Signed-off-by: Nlxq <liuxueqi3@huawei.com>
上级 0f7b47fa
......@@ -2351,111 +2351,6 @@ describe('Image', function () {
}
})
/**
* @tc.number : TC_053
* @tc.name : createIncrementalSource-updateData-png
* @tc.desc : 1.create imagesource
* 2.update data
* 3.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_053', 0, async function (done) {
try {
let testimagebuffer = testPng;
console.info('TC_053 0003 ' + testimagebuffer.length);
let bufferSize = testimagebuffer.length;
let offset = 0;
const incSouce = image.createIncrementalSource(new ArrayBuffer(1));
let ret;
let isFinished = false;
while (offset < testimagebuffer.length) {
console.info('TC_053 0006 ' + testimagebuffer.length);
var oneStep = testimagebuffer.slice(offset, offset + bufferSize);
console.info('TC_053 0007 ' + oneStep.length);
if (oneStep.length < bufferSize) {
isFinished = true;
}
ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length);
if (!ret) {
console.info('TC_053 updateData failed');
expect(ret).assertTrue();
break;
}
offset = offset + oneStep.length;
console.info('TC_053 0011 ' + offset);
}
if (ret) {
console.info('TC_053 updateData success ');
let decodingOptions = {
sampleSize:1
};
incSouce.createPixelMap(decodingOptions, (err, pixelmap) => {
console.info('TC_053 0014' + pixelmap);
expect(pixelmap != undefined ).assertTrue();
done();
})
} else {
done();
}
} catch (error) {
console.info('TC_053 updateData failed ' + error);
}
})
/**
* @tc.number : TC_053-1
* @tc.name : createIncrementalSource-updateData-jpg
* @tc.desc : 1.create imagesource
* 2.update data
* 3.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_053-1', 0, async function (done) {
try {
let testimagebuffer = testJpg;
console.info('TC_053-1 0003 ' + testimagebuffer.length);
let bufferSize = testimagebuffer.length;
let offset = 0;
const incSouce = image.createIncrementalSource(new ArrayBuffer(1));
let isFinished = false;
let ret;
while (offset < testimagebuffer.length) {
console.info('TC_053-1 0006 ' + testimagebuffer.length);
var oneStep = testimagebuffer.slice(offset, offset + bufferSize);
console.info('TC_053-1 0007 ' + oneStep.length);
if (oneStep.length < bufferSize) {
isFinished = true;
}
ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length);
if (!ret) {
console.info('TC_053-1 updateData failed');
expect(ret).assertTrue();
break;
}
offset = offset + oneStep.length;
console.info('TC_053-1 0011 ' + offset);
}
if (ret) {
console.info('TC_053-1 updateData success ');
let decodingOptions = {
sampleSize:1
};
incSouce.createPixelMap(decodingOptions, (err, pixelmap) => {
expect(pixelmap != undefined ).assertTrue();
done();
})
} else {
done();
}
} catch (error) {
console.info('TC_053-1 updateData failed ' + error);
}
})
/**
* @tc.number : TC_062
* @tc.name : packing ImageSource - promise
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册