From aa526375585b6a53ec8a7eb34a8187cade707fe7 Mon Sep 17 00:00:00 2001 From: wangxiaokai Date: Tue, 15 Mar 2022 19:40:20 +0800 Subject: [PATCH] Update and fix image xts test fail cases. Signed-off-by: wangxiaokai --- .../src/main/js/test/image.test.js | 2179 ++++++++++++++--- 1 file changed, 1826 insertions(+), 353 deletions(-) diff --git a/multimedia/image/image_js_standard/src/main/js/test/image.test.js b/multimedia/image/image_js_standard/src/main/js/test/image.test.js index 6e73679ba..7dd022335 100644 --- a/multimedia/image/image_js_standard/src/main/js/test/image.test.js +++ b/multimedia/image/image_js_standard/src/main/js/test/image.test.js @@ -1053,7 +1053,7 @@ describe('Image', function () { console.info('TC_25-1 success'); done(); }) - pixelmap.getBytesNumberPerRow( num => { + pixelmap.getBytesNumberPerRow().then(num => { console.info('TC_025-1 num is ' + num); expect(num == expectNum).assertTrue(); done(); @@ -1086,7 +1086,7 @@ describe('Image', function () { console.info('TC_026-1 success'); done(); }) - pixelmap.getPixelBytesNumber(num => { + pixelmap.getPixelBytesNumber().then(num => { console.info('TC_026-1 num is ' + num); expect(num == expectNum).assertTrue(); done(); @@ -1112,22 +1112,22 @@ describe('Image', function () { it('TC_027', 0, async function (done) { const color = new ArrayBuffer(96); let opts = { alphaType: 0, editable: true, pixelFormat: 3, scaleMode: 1, size: { height: 4, width: 6 } } - image.createPixelMap(color, opts) - .then( pixelmap => { - if (pixelmap == null) { - console.info('TC_027 createPixelMap failed'); - expect(false).assertTrue() - done(); - } - pixelmap.release().then(() => { - console.info('TC_027 success'); - expect(true).assertTrue(); + image.createPixelMap(color, opts).then(pixelmap => { + if (pixelmap == null) { + console.info('TC_027 createPixelMap failed'); + expect(false).assertTrue() + done(); + } + pixelmap.release().then(() => { + console.info('TC_027 success'); + expect(true).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_027 error: ' + error); + expect().assertFail(); done(); }) - }).catch(error => { - console.log('TC_027 error: ' + error); - expect().assertFail(); - done(); }) }) @@ -1145,21 +1145,18 @@ describe('Image', function () { it('TC_027-1', 0, async function (done) { const color = new ArrayBuffer(96); let opts = { alphaType: 0, editable: true, pixelFormat: 3, scaleMode: 1, size: { height: 4, width: 6 } } - image.createPixelMap(color, opts, pixelmap => { - expect(pixelmap !== null).assertTrue(); - console.info('TC_026-1 success'); - done(); - }) - pixelmap.release(()=>{ - expect(true).assertTrue(); - console.info('TC_027-1 success'); - done(); - }) - .catch(error => { - console.log('TC_027-1 error: ' + error); - expect().assertFail(); - done(); - }) + image.createPixelMap(color, opts, (error,pixelmap) => { + if (pixelmap == null) { + console.info('TC_027-1 createPixelMap failed'); + expect(false).assertTrue() + done(); + } + pixelmap.release(()=>{ + expect(true).assertTrue(); + console.log('TC_027-1 success'); + done(); + }) + }) }) /** @@ -1173,7 +1170,7 @@ describe('Image', function () { * @tc.level : Level 0 */ it('TC_041', 0, async function (done) { - const imageSourceApi = image.createImageSource('/data/local/tmp/test.jpg'); + const imageSourceApi = image.createImageSource('file:///data/local/tmp/test.jpg'); expect(imageSourceApi !== null).assertTrue(); console.info('TC_041 finished'); done(); @@ -1190,7 +1187,7 @@ describe('Image', function () { * @tc.level : Level 0 */ it('TC_041-1', 0, async function (done) { - const imageSourceApi = image.createImageSource('/data/local/tmp/test.bmp'); + const imageSourceApi = image.createImageSource('file:///data/local/tmp/test.bmp'); expect(imageSourceApi !== null).assertTrue(); console.info('TC_041-1 finished'); done(); @@ -1207,7 +1204,7 @@ describe('Image', function () { * @tc.level : Level 0 */ it('TC_041-2', 0, async function (done) { - const imageSourceApi = image.createImageSource('/data/local/tmp/test.gif'); + const imageSourceApi = image.createImageSource('file:///data/local/tmp/test.gif'); expect(imageSourceApi !== null).assertTrue(); console.info('TC_041-2 finished'); done(); @@ -1224,7 +1221,7 @@ describe('Image', function () { * @tc.level : Level 0 */ it('TC_041-3', 0, async function (done) { - const imageSourceApi = image.createImageSource('/data/local/tmp/test.png'); + const imageSourceApi = image.createImageSource('file:///data/local/tmp/test.png'); expect(imageSourceApi !== null).assertTrue(); console.info('TC_041-3 finished'); done(); @@ -1465,8 +1462,8 @@ describe('Image', function () { console.info('TC_044 release'); expect(true).assertTrue(); done(); - }).catch(()=>{ - console.log('TC_044 error: ' + error); + }).catch(error => { + console.info('TC_044 release'); expect(false).assertTrue(); done(); }) @@ -1778,10 +1775,6 @@ describe('Image', function () { console.info('TC_047 imageInfo'); expect(imageInfo !== null).assertTrue(); done(); - }).catch(()=>{ - console.log('TC_047 error: ' + error); - expect(false).assertTrue(); - done(); }) } }) @@ -1808,10 +1801,6 @@ describe('Image', function () { console.info('TC_047-1 imageInfo'); expect(imageInfo !== null).assertTrue(); done(); - }).catch(()=>{ - console.log('TC_047-1 error: ' + error); - expect(false).assertTrue(); - done(); }) } }) @@ -1838,10 +1827,6 @@ describe('Image', function () { console.info('TC_047-2 imageInfo'); expect(imageInfo !== null).assertTrue(); done(); - }).catch(()=>{ - console.log('TC_047-2 error: ' + error); - expect(false).assertTrue(); - done(); }) } }) @@ -1868,10 +1853,6 @@ describe('Image', function () { console.info('TC_047-3 '); expect(imageInfo !== null).assertTrue(); done(); - }).catch(()=>{ - console.log('TC_047-3 error: ' + error); - expect(false).assertTrue(); - done(); }) } }) @@ -1898,10 +1879,6 @@ describe('Image', function () { expect(imageInfo == null).assertTrue(); console.info('TC_047-4 suc'); done(); - }).catch(()=>{ - console.log('TC_047-4 error: ' + error); - expect(false).assertTrue(); - done(); }) } }) @@ -1928,10 +1905,6 @@ describe('Image', function () { expect(imageInfo == null).assertTrue(); console.info('TC_047-5 success'); done(); - }).catch(()=>{ - console.log('TC_047-5 error: ' + error); - expect(false).assertTrue(); - done(); }) } }) @@ -1939,13 +1912,10 @@ describe('Image', function () { /** * @tc.number : TC_050 * @tc.name : Decode the image to generate a bitmap - * @tc.desc : 1.create PixelMap - * 2.create imagesource - * 3.set index and DecodeOptions - * 4.call createPixelMap - * 5.callback return null - * 6.set DecodeOptions - * 7.callback return null + * @tc.desc : 1.create imagesource + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -1961,8 +1931,8 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, - desiredPixelFormat:2, + rotate:10, + desiredPixelFormat:3, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 }; @@ -1978,10 +1948,9 @@ describe('Image', function () { * @tc.number : TC_050-1 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -1997,8 +1966,8 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, - desiredPixelFormat:1, + rotate:10, + desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 }; @@ -2012,12 +1981,11 @@ describe('Image', function () { /** * @tc.number : TC_050-2 - * @tc.name : Decode the image to generate a bitmap + * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2033,7 +2001,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -2050,10 +2018,9 @@ describe('Image', function () { * @tc.number : TC_050-3 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2069,7 +2036,7 @@ describe('Image', function () { sampleSize:-1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -2086,10 +2053,9 @@ describe('Image', function () { * @tc.number : TC_050-4 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2105,7 +2071,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -2122,10 +2088,9 @@ describe('Image', function () { * @tc.number : TC_050-5 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2141,7 +2106,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 @@ -2158,10 +2123,9 @@ describe('Image', function () { * @tc.number : TC_050-6 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2177,7 +2141,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -2194,10 +2158,9 @@ describe('Image', function () { * @tc.number : TC_050-7 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2213,7 +2176,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -2230,10 +2193,9 @@ describe('Image', function () { * @tc.number : TC_050-8 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2249,7 +2211,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:400, height:400}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -2266,10 +2228,9 @@ describe('Image', function () { * @tc.number : TC_050-9 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2285,7 +2246,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 400, width: 500 }, x: 0, y: 0 }, index:0 @@ -2302,10 +2263,9 @@ describe('Image', function () { * @tc.number : TC_050-10 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2321,7 +2281,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: -1, y: -1 }, index:0 @@ -2337,13 +2297,10 @@ describe('Image', function () { /** * @tc.number : TC_050-11 * @tc.name : Decode the image to generate a bitmap - * @tc.desc : 1.create PixelMap - * 2.create imagesource - * 3.set index and DecodeOptions - * 4.call createPixelMap - * 5.callback return null - * 6.set DecodeOptions - * 7.callback return null + * @tc.desc : 1.create imagesource + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2370,13 +2327,10 @@ describe('Image', function () { /** * @tc.number : TC_050-12 * @tc.name : Decode the image to generate a bitmap - * @tc.desc : 1.create PixelMap - * 2.create imagesource - * 3.set index and DecodeOptions - * 4.call createPixelMap - * 5.callback return null - * 6.set DecodeOptions - * 7.callback return null + * @tc.desc : 1.create imagesource + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2399,13 +2353,10 @@ describe('Image', function () { /** * @tc.number : TC_050-13 * @tc.name : Decode the image to generate a bitmap - * @tc.desc : 1.create PixelMap - * 2.create imagesource - * 3.set index and DecodeOptions - * 4.call createPixelMap - * 5.callback return null - * 6.set DecodeOptions - * 7.callback return null + * @tc.desc : 1.create imagesource + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2421,7 +2372,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 400, y: 400 }, index:0 @@ -2437,13 +2388,10 @@ describe('Image', function () { /** * @tc.number : TC_050-14 * @tc.name : Decode the image to generate a bitmap - * @tc.desc : 1.create PixelMap - * 2.create imagesource - * 3.set index and DecodeOptions - * 4.call createPixelMap - * 5.callback return null - * 6.set DecodeOptions - * 7.callback return null + * @tc.desc : 1.create imagesource + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2459,7 +2407,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:500, + rotate:500, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 400, y: 400 }, index:0 @@ -2519,7 +2467,7 @@ describe('Image', function () { } else { done(); } - done(); + done(); } catch (error) { console.info('TC_053 updateData failed ' + error); } @@ -2607,11 +2555,8 @@ describe('Image', function () { console.info('TC_062 finished'); expect(data !== null).assertTrue(); done(); - }).catch(()=>{ - console.log('TC_062 error: ' + error); - expect(false).assertTrue(); - done(); - }) + }) + } } }) @@ -2975,10 +2920,9 @@ describe('Image', function () { * @tc.number : TC_067 * @tc.name : Decode the image to generate a bitmap gif * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -2994,7 +2938,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -3011,10 +2955,9 @@ describe('Image', function () { * @tc.number : TC_067-1 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3030,8 +2973,8 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, - desiredPixelFormat:1, + rotate:10, + desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 }; @@ -3047,10 +2990,9 @@ describe('Image', function () { * @tc.number : TC_067-2 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3066,7 +3008,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3083,10 +3025,9 @@ describe('Image', function () { * @tc.number : TC_067-3 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3102,7 +3043,7 @@ describe('Image', function () { sampleSize:-1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3119,10 +3060,9 @@ describe('Image', function () { * @tc.number : TC_067-4 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3138,7 +3078,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3155,10 +3095,9 @@ describe('Image', function () { * @tc.number : TC_067-5 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3174,7 +3113,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 @@ -3191,10 +3130,9 @@ describe('Image', function () { * @tc.number : TC_067-6 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3210,7 +3148,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3227,10 +3165,9 @@ describe('Image', function () { * @tc.number : TC_067-7 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3246,7 +3183,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3263,10 +3200,9 @@ describe('Image', function () { * @tc.number : TC_067-8 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3282,7 +3218,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:400, height:400}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -3299,10 +3235,9 @@ describe('Image', function () { * @tc.number : TC_067-9 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3318,7 +3253,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 400, width: 500 }, x: 0, y: 0 }, index:0 @@ -3335,10 +3270,9 @@ describe('Image', function () { * @tc.number : TC_067-10 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3354,7 +3288,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: -1, y: -1 }, index:0 @@ -3371,15 +3305,14 @@ describe('Image', function () { * @tc.number : TC_067-11 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 */ - it('TC_067-11', 0, async function (done) { + it('TC_067-11', 0, async function (done) { const imageSourceApi = image.createImageSource('/data/local/tmp/test.gif'); if (imageSourceApi == null) { console.info('TC_067-11 create image source failed'); @@ -3402,10 +3335,9 @@ describe('Image', function () { * @tc.number : TC_067-12 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3429,10 +3361,9 @@ describe('Image', function () { * @tc.number : TC_067-13 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3448,7 +3379,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 400, y: 400 }, index:0 @@ -3465,10 +3396,9 @@ describe('Image', function () { * @tc.number : TC_067-14 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3484,7 +3414,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:500, + rotate:500, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 400, y: 400 }, index:0 @@ -3501,10 +3431,9 @@ describe('Image', function () { * @tc.number : TC_068 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3520,7 +3449,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -3537,10 +3466,9 @@ describe('Image', function () { * @tc.number : TC_068-1 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3556,8 +3484,8 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, - desiredPixelFormat:1, + rotate:10, + desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 }; @@ -3573,10 +3501,9 @@ describe('Image', function () { * @tc.number : TC_068-2 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3592,7 +3519,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3609,10 +3536,9 @@ describe('Image', function () { * @tc.number : TC_068-3 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3628,7 +3554,7 @@ describe('Image', function () { sampleSize:-1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3645,10 +3571,9 @@ describe('Image', function () { * @tc.number : TC_068-4 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3664,7 +3589,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3681,10 +3606,9 @@ describe('Image', function () { * @tc.number : TC_068-5 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3700,7 +3624,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 @@ -3717,10 +3641,9 @@ describe('Image', function () { * @tc.number : TC_068-6 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3736,7 +3659,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3753,10 +3676,9 @@ describe('Image', function () { * @tc.number : TC_068-7 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3772,7 +3694,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -3789,10 +3711,9 @@ describe('Image', function () { * @tc.number : TC_068-8 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3808,7 +3729,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:400, height:400}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -3825,10 +3746,9 @@ describe('Image', function () { * @tc.number : TC_068-9 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3844,7 +3764,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 400, width: 500 }, x: 0, y: 0 }, index:0 @@ -3861,10 +3781,9 @@ describe('Image', function () { * @tc.number : TC_068-10 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3880,7 +3799,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: -1, y: -1 }, index:0 @@ -3897,10 +3816,9 @@ describe('Image', function () { * @tc.number : TC_068-11 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3928,10 +3846,9 @@ describe('Image', function () { * @tc.number : TC_068-12 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3955,10 +3872,9 @@ describe('Image', function () { * @tc.number : TC_068-13 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -3974,7 +3890,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 440, y:440 }, index:0 @@ -3991,10 +3907,9 @@ describe('Image', function () { * @tc.number : TC_068-14 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4010,7 +3925,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:550, + rotate:550, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 440, y:440 }, index:0 @@ -4027,10 +3942,9 @@ describe('Image', function () { * @tc.number : TC_163 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4046,7 +3960,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -4063,10 +3977,9 @@ describe('Image', function () { * @tc.number : TC_163-1 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4082,8 +3995,8 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, - desiredPixelFormat:1, + rotate:10, + desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 }; @@ -4118,7 +4031,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -4154,7 +4067,7 @@ describe('Image', function () { sampleSize:-1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:0, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -4190,7 +4103,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -4226,7 +4139,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:1 @@ -4262,7 +4175,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -4298,7 +4211,7 @@ describe('Image', function () { sampleSize:1, editable: false, desiredSize:{ width:1, height:2}, - rotateDegrees:-10, + rotate:-10, desiredPixelFormat:11, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:-1 @@ -4334,7 +4247,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:400, height:400}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -4370,7 +4283,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 400, width: 500 }, x: 0, y: 0 }, index:0 @@ -4406,7 +4319,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:1, desiredRegion: { size: { height: 1, width: 2 }, x: -1, y: -1 }, index:0 @@ -4423,10 +4336,9 @@ describe('Image', function () { * @tc.number : TC_163-11 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4454,10 +4366,9 @@ describe('Image', function () { * @tc.number : TC_163-12 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4481,10 +4392,9 @@ describe('Image', function () { * @tc.number : TC_163-13 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4500,7 +4410,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 500, y:500 }, index:0 @@ -4517,10 +4427,9 @@ describe('Image', function () { * @tc.number : TC_163-14 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4536,7 +4445,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:400, + rotate:400, desiredPixelFormat:2, desiredRegion: { size: { height: 1, width: 2 }, x: 500, y:500 }, index:0 @@ -4565,9 +4474,9 @@ describe('Image', function () { expect(false).assertTrue(); done(); } else { - expect(imageSourceApi.supportedFormats !=null).assertTrue(); + expect(imageSourceApi.supportedFormats != null).assertTrue(); console.info(imageSourceApi.supportedFormats); - console.info('TC_164 success '); + console.info('TC_164 suc '); done(); } }) @@ -4588,7 +4497,7 @@ describe('Image', function () { expect(false).assertTrue(); done(); } else { - expect(imagePackerApi.supportedFormats !=null).assertTrue(); + expect(imagePackerApi.supportedFormats != null).assertTrue(); console.info(imagePackerApi.supportedFormats); console.info('TC_166 success '); done(); @@ -4599,10 +4508,9 @@ describe('Image', function () { * @tc.number : TC_167 * @tc.name : Decode the image to generate a bitmap * @tc.desc : 1.create imagesource - * 2.set decodingOptions - * 3.call createPixelMap - * 4.set index,options - * 5.return null + * 2.set index and DecodeOptions + * 3.create PixelMap + * 4.callback return null * @tc.size : MEDIUM * @tc.type : Functional * @tc.level : Level 1 @@ -4613,7 +4521,7 @@ describe('Image', function () { sampleSize:1, editable: true, desiredSize:{ width:1, height:2}, - rotateDegrees:10, + rotate:10, desiredPixelFormat:3, desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, index:0 @@ -4624,4 +4532,1569 @@ describe('Image', function () { done(); }) }) + + /** + * @tc.number : TC_168 + * @tc.name : isEditable + * @tc.desc : 1.create pixelmap + * 2.call isEditable + * 3.return true + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_168', 0, async function (done) { + const Color = new ArrayBuffer(96); + let opts = { alphaType: 0, editable: true, pixelFormat: 3, scaleMode: 1, size: { height: 2, width: 3 } } + image.createPixelMap(Color, opts, (error,pixelmap) => { + if(pixelmap == null){ + console.info('TC_168 create pixelmap failed'); + expect(false).assertTrue(); + done(); + }else { + expect(pixelmap.isEditable == true).assertTrue(); + console.info('TC_168 success '); + done(); + } + }) + }) + + /** + * @tc.number : TC_169 + * @tc.name : Decode the image to generate a bitmap + * @tc.desc : 1.create imagesource + * 2.create pixelmap + * 3.call getimageinfo + * 4.Judging the length and width are opposite to the original + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_169', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test.jpg'); + if (imageSourceApi == null) { + console.info('TC_169 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let decodingOptions = { + sampleSize:1, + editable: true, + desiredSize:{ width:1, height:2}, + rotate:90, + desiredPixelFormat:3, + desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, + index:0 + }; + imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => { + console.info('TC_169 createPixelMap '); + pixelmap.getImageInfo( (err,imageInfo) => { + if (imageInfo !== null) { + console.info('TC_169 imageInfo is ready'); + expect(imageInfo.size.height == 2).assertTrue(); + expect(imageInfo.size.width == 1).assertTrue(); + done(); + }else { + console.info('TC_169 imageInfo is empty'); + expect(false).assertTrue() + done(); + } + }) + }) + } + }) + + /** + * @tc.number : TC_174 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + console.info('TC_174 start modifyImageProperty'); + imageSourceApi.modifyImageProperty("BitsPerSample","4") + .then(() => { + console.info('TC_174 start ImageProperty'); + imageSourceApi.getImageProperty("BitsPerSample").then((value) => { + console.info('TC_174 BitsPerSample ' + value); + expect(value == '4').assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174 getimageproperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_174-1 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174-1', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174-1 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("Orientation","2") + .then(() => { + imageSourceApi.getImageProperty("Orientation").then((value) => { + console.info('TC_174-1 Orientation ' + value); + expect(value == '2').assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174-1 getimageproperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174-1 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_174-2 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174-2', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174-2 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("ImageLength","200") + .then(() => { + imageSourceApi.getImageProperty("ImageLength").then((value) => { + console.info('TC_174-2 ImageLength ' + value); + expect(value == '200').assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174-2 getimageproperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174-2 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_174-3 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174-3', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174-3 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("ImageWidth","200") + .then(() => { + imageSourceApi.getImageProperty("ImageWidth").then((value) => { + console.info('TC_174-3 ImageWidth ' + value); + expect(value == '200').assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174-3 getimageproperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174-3 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_174-4 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174-4', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174-4 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("GPSLatitude","114,3").then(() => { + imageSourceApi.getImageProperty("GPSLatitude").then( value => { + console.info('TC_174-4 GPSLatitude ' + value); + expect(value == "114,3").assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174-4 getImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174-4 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_174-5 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174-5', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174-5 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("GPSLongitude","18,2") + .then(() => { + imageSourceApi.getImageProperty("GPSLongitude").then((value) => { + console.info('TC_174-5 GPSLongitude ' + value); + expect(value == "18,2").assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174-5 getimageproperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174-5 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_174-6 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174-6', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174-6 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'}; + imageSourceApi.modifyImageProperty("GPSLatitudeRef","N",property).then(() => { + imageSourceApi.getImageProperty("GPSLatitudeRef",property).then((value) => { + console.info('TC_174-6 GPSLatitudeRef ' + value); + expect(value == 'N').assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174-6 getimageproperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174-6 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_174-7 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_174-7', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_174-7 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'}; + imageSourceApi.modifyImageProperty("GPSLatitudeRef","W",property).then(() => { + imageSourceApi.getImageProperty("GPSLatitudeRef",property).then((value) => { + console.info('TC_174-7 GPSLatitudeRef ' + value); + expect(value == 'W').assertTrue(); + done(); + }).catch((err)=>{ + console.info(`TC_174-7 getimageproperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + }).catch((err)=>{ + console.info(`TC_174-7 modifyImageProperty failed, err:${err}`); + expect(false).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_175 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("BitsPerSample","4",() => { + imageSourceApi.getImageProperty("BitsPerSample",(error,value) => { + console.info('TC_175 BitsPerSample ' + value); + expect(value == "4").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_175-1 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175-1', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175-1 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("Orientation","2",() => { + imageSourceApi.getImageProperty("Orientation",(error,value) => { + console.info('TC_175-1 Orientation ' + value); + expect(value == "2").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_175-2 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175-2', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175-2 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("ImageLength","200",() => { + imageSourceApi.getImageProperty("ImageLength",(error,value) => { + console.info('TC_175-2 ImageLength ' + value); + expect(value == "200").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_175-3 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175-3', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175-3 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("ImageWidth","200",() => { + imageSourceApi.getImageProperty("ImageWidth",(error,value) => { + console.info('TC_175-3 ImageWidth ' + value); + expect(value == "200").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_175-4 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175-4', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175-4 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("GPSLatitude","114,3",() => { + imageSourceApi.getImageProperty("GPSLatitude",(error,value) => { + console.info('TC_175-4 GPSLatitude ' + value); + expect(value == "114,3").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_175-5 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175-5', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175-5 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("GPSLongitude","18,2",() => { + imageSourceApi.getImageProperty("GPSLongitude",(error,value) => { + console.info('TC_175-5 GPSLongitude ' + value); + expect(value == "18,2").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_175-6 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175-6', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175-6 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("GPSLatitudeRef","N",() => { + imageSourceApi.getImageProperty("GPSLatitudeRef",(error,value) => { + console.info('TC_175-6 GPSLatitudeRef ' + value); + expect(value == "N").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_175-7 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_175-7', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_175-7 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.modifyImageProperty("GPSLongitudeRef","W",() => { + imageSourceApi.getImageProperty("GPSLongitudeRef",(error,value) => { + console.info('TC_175-7 GPSLongitudeRef ' + value); + expect(value == "W").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("BitsPerSample","4",property,() => { + imageSourceApi.getImageProperty("BitsPerSample",property,(error,value) => { + console.info('TC_176 BitsPerSample ' + value); + expect(value == "4").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176-1 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176-1', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176-1 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("Orientation","2",property,() => { + imageSourceApi.getImageProperty("Orientation",property,(error,value) => { + console.info('TC_176-1 Orientation ' + value); + expect(value == "2").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176-2 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176-2', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176-2 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("ImageLength","200",property,() => { + imageSourceApi.getImageProperty("ImageLength",property,(error,value) => { + console.info('TC_176-2 ImageLength ' + value); + expect(value == "200").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176-3 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176-3', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176-3 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("ImageWidth","200",property,() => { + imageSourceApi.getImageProperty("ImageWidth",property,(error,value) => { + console.info('TC_176-3 ImageWidth ' + value); + expect(value == "200").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176-4 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176-4', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176-4 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("GPSLatitude","114,3",property,() => { + imageSourceApi.getImageProperty("GPSLatitude",property,(error,value) => { + console.info('TC_176-4 GPSLatitude ' + value); + expect(value == "114,3").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176-5 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176-5', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176-5 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("GPSLongitude","18,2",property,() => { + imageSourceApi.getImageProperty("GPSLongitude",property,(error,value) => { + console.info('TC_176-5 GPSLongitude ' + value); + expect(value == "18,2").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176-6 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176-6', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176-6 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("GPSLatitudeRef","N",property,() => { + imageSourceApi.getImageProperty("GPSLatitudeRef",property,(error,value) => { + console.info('TC_176-6 GPSLatitudeRef ' + value); + expect(value == "N").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_176-7 + * @tc.name : modifyImageProperty + * @tc.desc : 1.create imagesource + * 2.call modifyImageProperty(key,value,options) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_176-7', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_176-7 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:1,defaultValue:'1'} + imageSourceApi.modifyImageProperty("GPSLongitudeRef","W",property,() => { + imageSourceApi.getImageProperty("GPSLongitudeRef",property,(error,value) => { + console.info('TC_176-7 GPSLongitudeRef ' + value); + expect(value == "W").assertTrue(); + done(); + }) + }) + } + }) + + /** + * @tc.number : TC_171 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(BitsPerSample) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("BitsPerSample") + .then(data => { + console.info('TC_171 BitsPerSample ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-1 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(Orientation) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-1', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-1 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("Orientation") + .then(data => { + console.info('TC_171-1 Orientation ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-1 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-2 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(ImageLength) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-2', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-2 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("ImageLength") + .then(data => { + console.info('TC_171-2 ImageLength ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-2 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-3 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(ImageWidth) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-3', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-3 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("ImageWidth") + .then(data => { + console.info('TC_171-3 ImageWidth ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-3 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-4 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLatitude) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-4', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-4 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLatitude") + .then(data => { + console.info('TC_171-4 GPSLatitude ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-4 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-5 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLongitude) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-5', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-5 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLongitude") + .then(data => { + console.info('TC_171-5 GPSLongitude ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-5 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-6 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLatitudeRef) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-6', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-6 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLatitudeRef") + .then(data => { + console.info('TC_171-6 GPSLatitudeRef ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-6 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-7 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLongitudeRef) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-7', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-7 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLongitudeRef") + .then(data => { + console.info('TC_171-7 GPSLongitudeRef ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-7 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_171-8 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(ImageLength) + * 4.The return value is not empty + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_171-8', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_171-8 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("DateTimeOriginal") + .then(data => { + console.info('TC_171-8 DateTimeOriginal ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + .catch(error => { + console.log('TC_171-8 error: ' + error); + expect(false).assertFail(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(BitsPerSample) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("BitsPerSample",(error,data) => { + console.info('TC_172 BitsPerSample ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-1 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(Orientation) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-1', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-1 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("Orientation",(error,data) => { + console.info('TC_172-1 Orientation ' + data); + expect(data !== undefined && data !== null && data !== '').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-2 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(ImageLength) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-2', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-2 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("ImageLength",(error,data) => { + console.info('TC_172-2 ImageLength ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-3 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(ImageWidth) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-3', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-3 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("ImageWidth",(error,data) => { + console.info('TC_172-3 ImageWidth ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-4 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(GPSLatitude) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-4', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-4 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLatitude",(error,data) => { + console.info('TC_172-4 GPSLatitude ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-5 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(GPSLongitude) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-5', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-5 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLongitude",(error,data) => { + console.info('TC_172-5 GPSLongitude ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-6 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(GPSLatitudeRef) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-6', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-6 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLatitudeRef",(error,data) => { + console.info('TC_172-6 GPSLatitudeRef ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-7 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(GPSLongitudeRef) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-7', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-7 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("GPSLongitudeRef",(error,data) => { + console.info('TC_172-7 GPSLongitudeRef ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_172-8 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.call getImageProperty(DateTimeOriginal) + * 3.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_172-8', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_172-8 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + imageSourceApi.getImageProperty("DateTimeOriginal",(error,data) => { + console.info('TC_172-8 DateTimeOriginal ' + data); + expect(data !== null && data !== undefined && data !== '' ).assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(BitsPerSample,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("BitsPerSample",property,(error,data) => { + console.info('TC_173 BitsPerSample ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-1 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(Orientation,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-1', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-1 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("Orientation",property,(error,data) => { + console.info('TC_173-1 Orientation ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-2 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(ImageLength,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-2', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-2 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("ImageLength",property,(error,data) => { + console.info('TC_173-2 ImageLength ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-3 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(ImageWidth,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-3', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-3 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("ImageWidth",property,(error,data) => { + console.info('TC_173-3 ImageWidth ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-4 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLatitude,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-4', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-4 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("GPSLatitude",property,(error,data) => { + console.info('TC_173-4 GPSLatitude ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-5 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLongitude,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-5', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-5 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("GPSLongitude",property,(error,data) => { + console.info('TC_173-5 GPSLongitude ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-6 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLatitudeRef,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-6', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-6 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("GPSLatitudeRef",property,(error,data) => { + console.info('TC_173-6 GPSLatitudeRef ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-7 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(GPSLongitudeRef,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-7', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-7 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("GPSLongitudeRef",property,(error,data) => { + console.info('TC_173-7 GPSLongitudeRef ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) + + /** + * @tc.number : TC_173-8 + * @tc.name : getImageProperty + * @tc.desc : 1.create imagesource + * 2.set property + * 3.call getImageProperty(DateTimeOriginal,property) + * 4.return null + * @tc.size : MEDIUM + * @tc.type : Functional + * @tc.level : Level 1 + */ + it('TC_173-8', 0, async function (done) { + const imageSourceApi = image.createImageSource('/data/local/tmp/test_exif.jpg'); + if (imageSourceApi == null) { + console.info('TC_173-8 create image source failed'); + expect(false).assertTrue(); + done(); + } else { + let property = {index:0,defaultValue:'9999'} + imageSourceApi.getImageProperty("DateTimeOriginal",property,(error,data) => { + console.info('TC_173-8 DateTimeOriginal ' + data); + expect(data !== null && data !== undefined && data !== '').assertTrue(); + expect(data !== '9999').assertTrue(); + done(); + }) + } + }) }) \ No newline at end of file -- GitLab