提交 316adcf5 编写于 作者: Q qlw

<image decodingoption用例修改适配开发修改>

Signed-off-by: Nqlw <qinliwen3@huawei.com>
上级 af82ced3
......@@ -1067,16 +1067,24 @@ describe('Image', function () {
index: 0
};
imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => {
globalpixelmap = pixelmap;
if (pixelmap == undefined) {
console.info('TC_050-10 success ');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
done();
}
if (err) {
console.info('TC_050-10 fail ');
expect(false).assertTrue();
done();
} else {
globalpixelmap = pixelmap;
pixelmap.getImageInfo().then((imageInfo) => {
expect(imageInfo.size.height == 2).assertTrue();
expect(imageInfo.size.width == 1).assertTrue();
console.info('TC_050-10 success ');
console.info("imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width);
done();
}).catch((err) => {
console.info('TC_050-10 getimageInfo err ' + JSON.stringify(err));
expect(false).assertTrue();
done();
})
}
})
}
} catch (error) {
......@@ -1731,16 +1739,24 @@ describe('Image', function () {
index: 0
};
imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => {
globalpixelmap = pixelmap;
if (pixelmap == undefined) {
console.info('TC_067-10 success ');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
done();
}
if (err) {
console.info('TC_067-10 fail ');
expect(false).assertTrue();
done();
} else {
globalpixelmap = pixelmap;
pixelmap.getImageInfo().then((imageInfo) => {
expect(imageInfo.size.height == 2).assertTrue();
expect(imageInfo.size.width == 1).assertTrue();
console.info('TC_067-10 success ');
console.info("imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width);
done();
}).catch((err) => {
console.info('TC_067-10 getimageInfo err ' + JSON.stringify(err));
expect(false).assertTrue();
done();
})
}
})
}
})
......@@ -2369,16 +2385,24 @@ describe('Image', function () {
index: 0
};
imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => {
globalpixelmap = pixelmap;
if (pixelmap == undefined) {
console.info('TC_068-10 success ');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
done();
}
if (err) {
console.info('TC_068-10 fail ');
expect(false).assertTrue();
done();
} else {
globalpixelmap = pixelmap;
pixelmap.getImageInfo().then((imageInfo) => {
expect(imageInfo.size.height == 2).assertTrue();
expect(imageInfo.size.width == 1).assertTrue();
console.info('TC_068-10 success ');
console.info("imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width);
done();
}).catch((err) => {
console.info('TC_068-10 getimageInfo err ' + JSON.stringify(err));
expect(false).assertTrue();
done();
})
}
})
}
})
......@@ -2950,16 +2974,24 @@ describe('Image', function () {
index: 0
};
imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => {
globalpixelmap = pixelmap;
if (pixelmap == undefined) {
console.info('TC_163-10 success ');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
done();
}
if (err) {
console.info('TC_163-10 fail ');
expect(false).assertTrue();
done();
} else {
globalpixelmap = pixelmap;
pixelmap.getImageInfo().then((imageInfo) => {
expect(imageInfo.size.height == 2).assertTrue();
expect(imageInfo.size.width == 1).assertTrue();
console.info('TC_163-10 success ');
console.info("imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width);
done();
}).catch((err) => {
console.info('TC_163-10 getimageInfo err ' + JSON.stringify(err));
expect(false).assertTrue();
done();
})
}
})
}
})
......
......@@ -70,7 +70,35 @@ describe('Image', function () {
console.info('[permission]case apply permission failed,createAtManager failed');
}
}
async function createPixMapCb(done, testNum, arg) {
let fdNumber = fileio.openSync(pathWebp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info(`${testNum} create image source failed`);
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap(arg, (err, pixelmap) => {
if (err) {
console.info(`${testNum} - fail `);
expect(false).assertTrue();
done();
} else {
pixelmap.getImageInfo().then((imageInfo) => {
expect(imageInfo.size.height == 2).assertTrue();
expect(imageInfo.size.width == 1).assertTrue();
console.info(`${testNum} - success `);
console.info("imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width);
done();
}).catch((err) => {
console.info(`${testNum} getimageInfo err ` + JSON.stringify(err));
})
}
})
}
}
async function createPixMapCbErr(done, testNum, arg) {
let fdNumber = fileio.openSync(pathWebp);
const imageSourceApi = image.createImageSource(fdNumber);
......@@ -91,6 +119,33 @@ describe('Image', function () {
})
}
}
async function createPixMapPromise(done, testNum, arg) {
let fdNumber = fileio.openSync(pathWebp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info(`${testNum} create image source failed`);
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap(arg).then(pixelmap => {
pixelmap.getImageInfo().then((imageInfo) => {
expect(imageInfo.size.height == 2).assertTrue();
expect(imageInfo.size.width == 1).assertTrue();
console.info(`${testNum} - success `);
console.info("imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width);
done();
}).catch((err) => {
console.info(`${testNum} getimageInfo err ` + JSON.stringify(err));
})
}).catch(error => {
console.log(`${testNum} fail `);
expect(flase).assertTrue();
done();
})
}
}
async function createPixMapPromiseErr(done, testNum, arg) {
let fdNumber = fileio.openSync(pathWebp);
const imageSourceApi = image.createImageSource(fdNumber);
......@@ -752,7 +807,7 @@ describe('Image', function () {
desiredRegion: { size: { height: 10000, width: 10000 }, x: 0, y: 0 },
index: 0
};
createPixMapCbErr(done, 'wbp_009', decodingOptions)
createPixMapCb(done, 'wbp_009', decodingOptions)
})
/**
......@@ -873,7 +928,7 @@ describe('Image', function () {
desiredRegion: { size: { height: 10000, width: 10000 }, x: 0, y: 0 },
index: 0
};
createPixMapPromiseErr(done, 'wbp_014', decodingOptions)
createPixMapPromise(done, 'wbp_014', decodingOptions)
})
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册