1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import image from '@ohos.multimedia.image' 17import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestType, Level, Size } from '@ohos/hypium' 18import { base64Image, scale2x1, translate3x1, rotate90, flipH, testBmp, testGif, crop3x3, scale1x4, setAlpha8, translate1x3 } from './testImg2' 19import { testPng, testJpg } from './testImg' 20import fs from "@ohos.file.fs"; 21import featureAbility from '@ohos.ability.featureAbility' 22import hdrCapability from '@ohos.graphics.hdrCapability'; 23import display from '@ohos.display'; 24 25export default function imagePixelMapFramework() { 26 describe('imagePixelMapFramework', async function () { 27 let globalpixelmap; 28 let globalImagesource; 29 let globalreceiver; 30 const WIDTH = 8192; 31 const HEIGHT = 8; 32 const CAPACITY = 8; 33 const DEVICE_CODE = 801; 34 const { JPEG: FORMATJPEG } = image.ImageFormat; 35 const { RGB_565, RGBA_8888, BGRA_8888, RGB_888, ALPHA_8, RGBA_F16, NV21, NV12, 36 RGBA_1010102, YCBCR_P010, YCRCB_P010 } = image.PixelMapFormat; 37 const CONVERTPIXELFOMAT_ERRORCODE = 62980115; 38 let context; 39 let filesDir; 40 let isSupportHdr = false; 41 beforeAll(async function () { 42 console.info('beforeAll case'); 43 isSupportHdr = await fs.access('/system/lib64/ndk/libvideo_processing_capi_impl.so').then((res) => { 44 if (res) { 45 console.info("file exists"); 46 return true; 47 } else { 48 console.info("file not exists"); 49 return false; 50 } 51 }).catch((err) => { 52 console.error("access failed with error message: " + err.message + ", error code: " + err.code); 53 return false; 54 }); 55 context = await featureAbility.getContext(); 56 filesDir = await context.getFilesDir(); 57 }) 58 59 beforeEach(function () { 60 console.info('beforeEach case'); 61 }) 62 63 afterEach(async function () { 64 if (globalpixelmap != undefined) { 65 console.info("globalpixelmap release start"); 66 try { 67 await globalpixelmap.release(); 68 } catch (error) { 69 console.info("globalpixelmap release fail"); 70 } 71 } 72 if (globalImagesource != undefined) { 73 console.info("globalpixelmap release start"); 74 try { 75 await globalImagesource.release(); 76 } catch (error) { 77 console.info("globalImagesource release fail"); 78 } 79 } 80 console.info('afterEach case'); 81 }) 82 83 afterAll(async function () { 84 console.info('afterAll case'); 85 }) 86 const ERROT_CODE = 62980115; 87 function genPicSource() { 88 var data = testPng.buffer; 89 return image.createImageSource(data); 90 } 91 92 async function genPixelMap() { 93 var color = new ArrayBuffer(96); 94 var bufferArr = new Uint8Array(color); 95 for (var i = 0; i < bufferArr.length; i++) { 96 bufferArr[i] = i + 1; 97 } 98 99 let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } 100 return image.createPixelMap(color, opts); 101 } 102 103 function loger(caseName) { 104 return { 105 myName: caseName, 106 log: function (msg) { 107 console.info(this.myName + ' ' + msg); 108 } 109 } 110 } 111 112 function fNumber(num) { 113 if (num > 99) { 114 return "" + num; 115 } 116 if (num > 9) { 117 return "" + num; 118 } 119 return " " + num; 120 } 121 122 function dumpArray(logger, arr, row) { 123 var tmpS = '' 124 for (var i = 0; i < arr.length; i++) { 125 tmpS = tmpS + fNumber(arr[i]) + ", " 126 if (i % row == (row - 1)) { 127 logger.log(tmpS); 128 tmpS = ''; 129 } 130 } 131 } 132 133 async function checkPixelMapInterface(done, logger, pixelMap, orgInfo, sizeCheck, data) { 134 var newInfo = await pixelMap.getImageInfo() 135 sizeCheck(done, logger, orgInfo, newInfo) 136 var pixelSize = pixelMap.getPixelBytesNumber(); 137 logger.log(`new pixel size ${pixelSize}`); 138 var readBuffer = new ArrayBuffer(pixelSize); 139 await pixelMap.readPixelsToBuffer(readBuffer); 140 var bufferArr2 = new Uint8Array(readBuffer); 141 for (var i = 0; i < bufferArr2.length; i++) { 142 if (bufferArr2[i] != data[i]) { 143 logger.log(`pixel[${i}] current[${bufferArr2[i]}] target[${data[i]}]`); 144 expect(false).assertTrue(); 145 done(); 146 break; 147 } 148 } 149 expect(true).assertTrue(); 150 done(); 151 } 152 153 async function pixelMapModifySizeTest(done, testNum, type, pixelMapInterface, sizeCheck, data, ...params) { 154 let logger = loger(testNum) 155 try { 156 var pixelMap = await genPixelMap() 157 logger.log("pixelMap " + (pixelMap != undefined)); 158 if (pixelMap != undefined) { 159 globalpixelmap = pixelMap; 160 var orgInfo = await pixelMap.getImageInfo() 161 162 if (type == 'callback') { 163 pixelMap[pixelMapInterface](...params, async () => { 164 await checkPixelMapInterface(done, logger, pixelMap, orgInfo, sizeCheck, data) 165 }) 166 } else { 167 await pixelMap[pixelMapInterface](...params); 168 await checkPixelMapInterface(done, logger, pixelMap, orgInfo, sizeCheck, data) 169 } 170 } else { 171 logger.log('create pixelMap fail '); 172 expect(false).assertTrue(); 173 done(); 174 } 175 } catch (error) { 176 logger.log('failed ' + error); 177 expect(false).assertTrue(); 178 done(); 179 } 180 } 181 182 async function checkAlphaPixelmap(done, logger, alphaPixelMap) { 183 logger.log("AlphaPixelMap " + alphaPixelMap); 184 if (alphaPixelMap != undefined) { 185 globalpixelmap = alphaPixelMap; 186 var imageInfo = await alphaPixelMap.getImageInfo(); 187 logger.log("AlphaPixelMap pixelformat " + imageInfo.pixelFormat); 188 expect(imageInfo.pixelFormat == 6).assertTrue(); 189 done(); 190 } else { 191 logger.log('creat alphaPixelMap failed'); 192 expect(false).assertTrue(); 193 done(); 194 } 195 } 196 197 async function createAlphaPixelmapTest(done, testNum, type, imageData) { 198 let logger = loger(testNum) 199 try { 200 let imageSource = image.createImageSource(imageData); 201 logger.log("ImageSource " + (imageSource != undefined)); 202 if (imageSource != undefined) { 203 globalImagesource = imageSource; 204 let pixelMap = await imageSource.createPixelMap(); 205 logger.log("PixelMap " + pixelMap); 206 if (pixelMap != undefined) { 207 globalpixelmap = pixelMap; 208 if (type == 'callback') { 209 pixelMap.createAlphaPixelmap(async (err, alphaPixelMap) => { 210 await checkAlphaPixelmap(done, logger, alphaPixelMap) 211 }) 212 } else { 213 var alphaPixelMap = await pixelMap.createAlphaPixelmap(); 214 await checkAlphaPixelmap(done, logger, alphaPixelMap) 215 } 216 } else { 217 logger.log('creat pixelMap failed'); 218 expect(false).assertTrue(); 219 done(); 220 } 221 } else { 222 logger.log('creat ImageSource failed'); 223 expect(false).assertTrue(); 224 done(); 225 } 226 } catch (error) { 227 logger.log('failed ' + error); 228 expect(false).assertTrue(); 229 done(); 230 } 231 } 232 233 async function sleep(times = 200) { 234 await new Promise((res) => 235 setTimeout(() => { 236 res(); 237 }, times) 238 ); 239 } 240 241 async function checkStridePixelmap(done, logger, stridePixelMap) { 242 logger.log("StridePixelMap " + stridePixelMap); 243 if (stridePixelMap != undefined) { 244 globalpixelmap = stridePixelMap; 245 var imageInfo = await stridePixelMap.getImageInfo(); 246 logger.log("StridePixelMap pixelformat " + imageInfo.pixelFormat); 247 expect(imageInfo.stride == imageInfo.size.width * 4).assertTrue(); 248 done(); 249 } else { 250 logger.log('creat stridePixelMap failed'); 251 expect(false).assertTrue(); 252 done(); 253 } 254 } 255 256 async function createStridePixelmapTest(done, testNum, imageData) { 257 let logger = loger(testNum); 258 try { 259 let imageSource = image.createImageSource(imageData); 260 logger.log("ImageSource " + (imageSource != undefined)); 261 if (imageSource != undefined) { 262 globalImagesource = imageSource; 263 let pixelMap = await imageSource.createPixelMap(); 264 logger.log("PixelMap " + pixelMap); 265 if (pixelMap != undefined) { 266 globalpixelmap = pixelMap; 267 await checkStridePixelmap(done, logger, pixelMap) 268 expect(true).assertTrue(); 269 done(); 270 }else{ 271 logger.log('creat pixelMap failed'); 272 expect(false).assertTrue(); 273 done(); 274 } 275 } else { 276 logger.log('creat ImageSource failed'); 277 expect(false).assertTrue(); 278 done(); 279 } 280 } catch (error) { 281 logger.log('failed ' + error); 282 expect(false).assertTrue(); 283 done(); 284 } 285 } 286 287 async function getDensityTest(done, testNum, imageData, decodingOptions) { 288 let logger = loger(testNum) 289 try { 290 var sourceOptions = { sourceDensity: 120 }; 291 let imageSource = image.createImageSource(imageData, sourceOptions); 292 logger.log("ImageSource " + (imageSource != undefined)); 293 if (imageSource != undefined) { 294 globalImagesource = imageSource; 295 let pixelMap = await imageSource.createPixelMap(decodingOptions); 296 logger.log("PixelMap " + pixelMap); 297 if (pixelMap != undefined) { 298 globalpixelmap = pixelMap; 299 var density = pixelMap.getDensity(); 300 logger.log("Density " + density); 301 expect(decodingOptions ? (density == 240) : (density == 120)).assertTrue(); 302 done(); 303 } else { 304 logger.log('creat pixelMap failed '); 305 expect(false).assertTrue(); 306 done(); 307 } 308 } else { 309 logger.log('creat imageSource failed '); 310 expect(false).assertTrue(); 311 done(); 312 } 313 } catch (error) { 314 logger.log('failed ' + error); 315 expect(false).assertTrue(); 316 done(); 317 } 318 } 319 320 async function setDensityTest(done, testNum, imageData) { 321 let logger = loger(testNum) 322 try { 323 var sourceOptions = { sourceDensity: 120 }; 324 let imageSource = image.createImageSource(imageData, sourceOptions); 325 logger.log("ImageSource " + (imageSource != undefined)); 326 if (imageSource != undefined) { 327 globalImagesource = imageSource; 328 let pixelMap = await imageSource.createPixelMap(); 329 logger.log("PixelMap " + pixelMap); 330 if (pixelMap != undefined) { 331 globalpixelmap = pixelMap; 332 var density = pixelMap.getDensity(); 333 logger.log("Density1 " + density); 334 pixelMap.setDensity(360); 335 density = pixelMap.getDensity(); 336 logger.log("Density2 " + density); 337 expect(density == 360).assertTrue(); 338 done(); 339 } else { 340 logger.log('creat pixelMap failed '); 341 expect(false).assertTrue(); 342 done(); 343 } 344 } else { 345 logger.log('creat imageSource failed '); 346 expect(false).assertTrue(); 347 done(); 348 } 349 } catch (error) { 350 logger.log('failed ' + error); 351 expect(false).assertTrue(); 352 done(); 353 } 354 } 355 356 async function isStrideAlignmentTest(done, testNum, imageData) { 357 let logger = loger(testNum) 358 try { 359 var sourceOptions = { sourceDensity: 120 }; 360 let imageSource = image.createImageSource(imageData, sourceOptions); 361 logger.log("ImageSource " + (imageSource != undefined)); 362 if (imageSource != undefined) { 363 globalImagesource = imageSource; 364 let pixelMap = await imageSource.createPixelMap(); 365 logger.log("PixelMap " + pixelMap); 366 if (pixelMap != undefined) { 367 globalpixelmap = pixelMap; 368 let ret = pixelMap.isStrideAlignment; 369 let imageInfo = await pixelMap.getImageInfo(); 370 logger.log("pixelMap.isStrideAlignment " + ret); 371 if (ret == false) { 372 expect(imageInfo.size.width * 4 == imageInfo.stride, true).assertTrue(); 373 } else { 374 if ((imageInfo.size.width % 64) && (imageInfo.size.width > 512)) { 375 expect(imageInfo.size.width * 4 == imageInfo.stride, true).assertTrue(); 376 } else { 377 expect(imageInfo.size.width * 4 == imageInfo.stride, false).assertTrue(); 378 } 379 } 380 done(); 381 if (ret == undefined) { 382 logger.log("pixelMap.isStrideAlignment is undefined"); 383 } 384 done(); 385 } else { 386 logger.log('creat pixelMap failed '); 387 expect(false).assertTrue(); 388 done(); 389 } 390 } else { 391 logger.log('creat imageSource failed '); 392 expect(false).assertTrue(); 393 done(); 394 } 395 } catch (error) { 396 logger.log('failed ' + error); 397 expect(false).assertTrue(); 398 done(); 399 } 400 } 401 402 async function pixelMapModifySizeTestErr(done, testNum, type, pixelMapInterface, ...params) { 403 let logger = loger(testNum) 404 try { 405 var pixelMap = await genPixelMap(); 406 logger.log("pixelMap " + (pixelMap != undefined)); 407 if (pixelMap != undefined) { 408 globalpixelmap = pixelMap; 409 if (type == 'callback') { 410 pixelMap[pixelMapInterface](...params, async (error) => { 411 expect(error == ERROT_CODE); 412 done(); 413 }) 414 } else { 415 try { 416 await pixelMap[pixelMapInterface](...params); 417 expect(false).assertTrue(); 418 done(); 419 } catch (error) { 420 expect(error == ERROT_CODE); 421 done(); 422 } 423 } 424 } else { 425 logger.log('create pixelMap fail '); 426 expect(false).assertTrue(); 427 done(); 428 } 429 } catch (error) { 430 logger.log('failed ' + error); 431 expect(false).assertTrue(); 432 done(); 433 } 434 } 435 436 async function opacityErr(done, testNum, param, type) { 437 let logger = loger(testNum) 438 try { 439 var pixelMap = await genPixelMap(); 440 logger.log("pixelMap " + (pixelMap != undefined)); 441 if (pixelMap != undefined) { 442 globalpixelmap = pixelMap; 443 if (type == 'callback') { 444 pixelMap.opacity(param, (err) => { 445 expect(err == ERROT_CODE).assertTrue(); 446 done(); 447 }) 448 } else { 449 try { 450 await pixelMap.opacity(param) 451 expect(false).assertTrue(); 452 done(); 453 } catch (error) { 454 expect(error == ERROT_CODE).assertTrue(); 455 done(); 456 } 457 } 458 } else { 459 logger.log('creat pixelMap failed '); 460 expect(false).assertTrue(); 461 done(); 462 } 463 } catch (error) { 464 logger.log('failed ' + error); 465 expect(false).assertTrue(); 466 done(); 467 } 468 } 469 470 async function setAlphaAbleErr(done, testNum, param) { 471 let logger = loger(testNum) 472 try { 473 let imageSource = genPicSource(); 474 logger.log("ImageSource " + (imageSource != undefined)); 475 if (imageSource != undefined) { 476 globalImagesource = imageSource; 477 let pixelMap = await imageSource.createPixelMap(); 478 logger.log("PixelMap " + pixelMap); 479 if (pixelMap != undefined) { 480 globalpixelmap = pixelMap; 481 try { 482 pixelMap.setAlphaAble(param); 483 expect(false).assertTrue(); 484 done(); 485 } catch (error) { 486 expect(error == ERROT_CODE); 487 done(); 488 } 489 } else { 490 logger.log('create pixelmap failed '); 491 expect(false).assertTrue(); 492 done(); 493 } 494 } else { 495 logger.log('create imagesource failed '); 496 expect(false).assertTrue(); 497 done(); 498 } 499 } catch (error) { 500 logger.log('failed ' + error); 501 expect(false).assertTrue(); 502 done(); 503 } 504 } 505 506 async function setDensityErr(done, testNum, imageData, param) { 507 let logger = loger(testNum) 508 try { 509 var sourceOptions = { sourceDensity: 120 }; 510 let imageSource = image.createImageSource(imageData, sourceOptions); 511 logger.log("ImageSource " + (imageSource != undefined)); 512 if (imageSource != undefined) { 513 globalImagesource = imageSource; 514 let pixelMap = await imageSource.createPixelMap(); 515 logger.log("PixelMap " + pixelMap); 516 if (pixelMap != undefined) { 517 globalpixelmap = pixelMap; 518 try { 519 pixelMap.setDensity(param); 520 expect(false).assertTrue(); 521 done(); 522 } catch (error) { 523 expect(true).assertTrue(); 524 logger.log('err message: ' + error); 525 done(); 526 } 527 } else { 528 logger.log('creat pixelMap failed '); 529 expect(false).assertTrue(); 530 done(); 531 } 532 } else { 533 logger.log('creat imageSource failed '); 534 expect(false).assertTrue(); 535 done(); 536 } 537 } catch (error) { 538 logger.log('failed ' + error); 539 expect(false).assertTrue(); 540 done(); 541 } 542 } 543 544 async function dumpPixelmap(logger, pixelmap) { 545 var imageInfo = await pixelmap.getImageInfo(); 546 var pixelSize = pixelmap.getPixelBytesNumber(); 547 var readBuffer = new ArrayBuffer(pixelSize); 548 await pixelmap.readPixelsToBuffer(readBuffer); 549 var bufferArr = new Uint8Array(readBuffer); 550 dumpArray(logger, bufferArr, imageInfo.size.width * 4); 551 } 552 553 function getBufferSize(height, width, format) { 554 switch (format) { 555 case RGBA_1010102: 556 case RGBA_8888: 557 case BGRA_8888: 558 return height * width * 4; 559 case RGBA_F16: 560 return height * width * 8; 561 case RGB_565: 562 return height * width * 2; 563 case RGB_888: 564 return height * width * 3; 565 case NV12: 566 case NV21: 567 return height * width + ((height + 1) / 2) * ((width + 1) / 2) * 2; 568 case YCBCR_P010: 569 case YCRCB_P010: 570 return (height * width + (((height + 1) / 2) * ((width + 1) / 2) * 2)) * 2; 571 default: 572 return 0; 573 } 574 } 575 576 function getBuffer(fileName) { 577 let filePath = filesDir + '/' + fileName; 578 console.log('filePath:', filePath) 579 let file = fs.openSync(filePath); 580 const stats = fs.statSync(filePath); 581 const fileSize = stats.size; 582 const bufferRead = new ArrayBuffer(fileSize) 583 fs.readSync(file.fd, bufferRead) 584 return bufferRead; 585 } 586 587 async function createPixelMapByFormat(expectFormat) { 588 let fileName; 589 if (expectFormat == 10 || expectFormat == 11 || expectFormat == 12) { 590 fileName = "CUVAHdrMulti.jpg"; 591 } else { 592 fileName = "JPG-480360-YUV311.jpg"; 593 } 594 let buffer = await getBuffer(fileName); 595 let imageSource = image.createImageSource(buffer); 596 let decodingOpt; 597 if (expectFormat == 10 || expectFormat == 11 || expectFormat == 12) { 598 decodingOpt = { 599 editable: true, 600 desiredPixelFormat: expectFormat, 601 desiredDynamicRange: image.DecodingDynamicRange.HDR 602 } 603 } else if (expectFormat == 8 || expectFormat == 9) { 604 decodingOpt = { 605 editable: true, 606 desiredPixelFormat: expectFormat 607 } 608 } else { 609 decodingOpt = { 610 editable: true, 611 desiredPixelFormat: 8 612 } 613 } 614 let pixelMap = await imageSource.createPixelMap(decodingOpt); 615 if (pixelMap.getImageInfoSync().pixelFormat != expectFormat) { 616 try { 617 await pixelMap.convertPixelFormat(expectFormat); 618 } catch (error) { 619 console.info(`convertPixelFormat:${expectFormat} failed. ` + error) 620 } 621 } 622 return pixelMap; 623 } 624 625 const checkConvertResult = (newInfo, dstPixelFormat) => { 626 console.info("converted to dstPixelFormat : " + newInfo.pixelFormat); 627 console.info(`pixelMap isHdr: ${newInfo.isHdr}`); 628 let ret = newInfo.pixelFormat == dstPixelFormat; 629 if (dstPixelFormat == RGBA_1010102 || dstPixelFormat == YCBCR_P010 || dstPixelFormat == YCRCB_P010) { 630 ret = ret && (newInfo.isHdr == true); 631 } else { 632 ret = ret && (newInfo.isHdr == false); 633 } 634 return ret; 635 } 636 637 async function testConvertPixelFormat(done, testNum, srcPixelFormat, dstPixelFormat) { 638 let logger = loger(testNum); 639 try { 640 let pixelMap = await createPixelMapByFormat(srcPixelFormat); 641 642 if (pixelMap != undefined) { 643 globalpixelmap = pixelMap; 644 let orgImageInfo = pixelMap.getImageInfoSync(); 645 expect(orgImageInfo.pixelFormat == srcPixelFormat).assertTrue(); 646 await pixelMap.convertPixelFormat(dstPixelFormat); 647 let newImageInfo = pixelMap.getImageInfoSync(); 648 expect(checkConvertResult(newImageInfo, dstPixelFormat)).assertTrue(); 649 done(); 650 651 } else { 652 logger.log("pixelmap is undefined."); 653 expect().assertFail(); 654 done(); 655 } 656 } catch (error) { 657 logger.log("failed. " + error); 658 expect().assertFail(); 659 done(); 660 } 661 } 662 663 async function testConvertPixelFormatErr(done, testNum, srcPixelFormat, dstPixelFormat) { 664 let logger = loger(testNum); 665 try { 666 let pixelMap = await createPixelMapByFormat(srcPixelFormat); 667 if (pixelMap != undefined) { 668 globalpixelmap = pixelMap; 669 let orgImageInfo = pixelMap.getImageInfoSync(); 670 expect(orgImageInfo.pixelFormat == srcPixelFormat).assertTrue(); 671 await pixelMap.convertPixelFormat(dstPixelFormat); 672 expect(false).assertTrue(); 673 done(); 674 } else { 675 logger.log("pixelmap is undefined."); 676 expect(false).assertTrue(); 677 done(); 678 } 679 } catch (error) { 680 logger.log("failed. " + JSON.stringify(error)); 681 expect(error.code == CONVERTPIXELFOMAT_ERRORCODE).assertTrue(); 682 done(); 683 } 684 } 685 686 /** 687 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_BASE64_0100 688 * @tc.name : BASE64 Image 689 * @tc.desc : 1.create imagesource with base64Image 690 * : 2.create pixelmap 691 * @tc.size : MEDIUM 692 * @tc.type : Functional 693 * @tc.level : Level 0 694 */ 695 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_BASE64_0100', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, 696 async function (done) { 697 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_BASE64_0100') 698 try { 699 const imageSource = image.createImageSource(base64Image) 700 logger.log("ImageSource " + (imageSource != undefined)); 701 if (imageSource != undefined) { 702 globalImagesource = imageSource; 703 let pixelMap = await imageSource.createPixelMap(); 704 globalpixelmap = pixelMap; 705 logger.log("PixelMap " + (pixelMap != undefined)); 706 expect(pixelMap != undefined).assertTrue(); 707 done(); 708 } else { 709 logger.log("ImageSource undefined"); 710 expect(false).assertTrue(); 711 done(); 712 } 713 } catch (error) { 714 logger.log('failed ' + error); 715 expect(false).assertTrue(); 716 done(); 717 } 718 }) 719 720 /** 721 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_PROMISE_0100 722 * @tc.name : Pixelmap Scale-promise 723 * @tc.desc : 1.create pixelmap 724 * : 2.call scale 725 * : 3.get pixelbytesnumber 726 * : 4.read pixels to buffer 727 * @tc.size : MEDIUM 728 * @tc.type : Functional 729 * @tc.level : Level 0 730 */ 731 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_PROMISE_0100', 732 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 733 function sizeCheck(done, logger, orgInfo, newInfo) { 734 if (newInfo.size.width != orgInfo.size.width * 2) { 735 logger.log(`org width ${orgInfo.size.width}, new width ${newInfo.size.width} `); 736 expect(false).assertTrue(); 737 done() 738 } 739 } 740 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_PROMISE_0100', 'promise', 'scale', sizeCheck, scale2x1, 2.0, 1.0) 741 }) 742 743 /** 744 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_PROMISE_0200 745 * @tc.name : Pixelmap Scale-promise 746 * @tc.desc : 1.create pixelmap 747 * : 2.call scale 748 * : 3.get pixelbytesnumber 749 * : 4.read pixels to buffer 750 * @tc.size : MEDIUM 751 * @tc.type : Functional 752 * @tc.level : Level 0 753 */ 754 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_PROMISE_0200', 755 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 756 function sizeCheck(done, logger, orgInfo, newInfo) { 757 if (newInfo.size.height != orgInfo.size.height * 4) { 758 logger.log(`org height ${orgInfo.size.height}, new height ${newInfo.size.height} `); 759 expect(false).assertTrue(); 760 done() 761 } 762 } 763 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_PROMISE_0200', 'promise', 'scale', sizeCheck, scale1x4, 1.0, 4.0) 764 }) 765 766 /** 767 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_CALLBACK_0100 768 * @tc.name : Pixelmap Scale-callback 769 * @tc.desc : 1.create pixelmap 770 * : 2.call scale 771 * : 3.get pixelbytesnumber 772 * : 4.read pixels to buffer 773 * @tc.size : MEDIUM 774 * @tc.type : Functional 775 * @tc.level : Level 0 776 */ 777 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_CALLBACK_0100', 778 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 779 function sizeCheck(done, logger, orgInfo, newInfo) { 780 if (newInfo.size.height != orgInfo.size.height * 4) { 781 logger.log(`org height ${orgInfo.size.height}, new height ${newInfo.size.height} `); 782 expect(false).assertTrue(); 783 done() 784 } 785 } 786 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_CALLBACK_0100', 'callback', 'scale', sizeCheck, scale1x4, 1.0, 4.0) 787 }) 788 789 /** 790 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_PROMISE_0100 791 * @tc.name : Pixelmap Translate -promise 792 * @tc.desc : 1.create pixelmap 793 * : 2.call translate 794 * : 3.get pixelbytesnumber 795 * : 4.read pixels to buffer 796 * @tc.size : MEDIUM 797 * @tc.type : Functional 798 * @tc.level : Level 0 799 */ 800 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_PROMISE_0100', 801 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 802 function sizeCheck(done, logger, orgInfo, newInfo) { 803 if (newInfo.size.width != orgInfo.size.width + 3) { 804 logger.log(`org width ${orgInfo.size.width}, new width ${newInfo.size.width} `); 805 expect(false).assertTrue(); 806 done(); 807 } 808 } 809 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_PROMISE_0100', 'promise', 'translate', sizeCheck, translate3x1, 3.0, 1.0) 810 }) 811 812 /** 813 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_PROMISE_0200 814 * @tc.name : Pixelmap Translate-promise 815 * @tc.desc : 1.create pixelmap 816 * : 2.call translate 817 * : 3.get pixelbytesnumber 818 * : 4.read pixels to buffer 819 * @tc.size : MEDIUM 820 * @tc.type : Functional 821 * @tc.level : Level 0 822 */ 823 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_PROMISE_0200', 824 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 825 function sizeCheck(done, logger, orgInfo, newInfo) { 826 if (newInfo.size.height != orgInfo.size.height + 3) { 827 logger.log(`org height ${orgInfo.size.height}, new height ${newInfo.size.height} `); 828 expect(false).assertTrue(); 829 done(); 830 } 831 } 832 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_PROMISE_0200', 'promise', 'translate', sizeCheck, translate1x3, 1.0, 3.0) 833 }) 834 835 /** 836 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_CALLBACK_0100 837 * @tc.name : Pixelmap Translate-callback 838 * @tc.desc : 1.create pixelmap 839 * : 2.call translate 840 * : 3.get pixelbytesnumber 841 * : 4.read pixels to buffer 842 * @tc.size : MEDIUM 843 * @tc.type : Functional 844 * @tc.level : Level 0 845 */ 846 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_CALLBACK_0100', 847 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 848 function sizeCheck(done, logger, orgInfo, newInfo) { 849 if (newInfo.size.height != orgInfo.size.height + 3) { 850 logger.log(`org height ${orgInfo.size.height}, new height ${newInfo.size.height} `); 851 expect(false).assertTrue(); 852 done(); 853 } 854 } 855 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_CALLBACK_0100', 'callback', 'translate', sizeCheck, translate1x3, 1.0, 3.0) 856 }) 857 858 /** 859 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_PROMISE_0100 860 * @tc.name : Pixelmap Rotate-promise 861 * @tc.desc : 1.create pixelmap 862 * : 2.call rotate 863 * : 3.get pixelbytesnumber 864 * : 4.read pixels to buffer 865 * @tc.size : MEDIUM 866 * @tc.type : Functional 867 * @tc.level : Level 0 868 */ 869 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_PROMISE_0100', 870 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 871 function sizeCheck(done, logger, orgInfo, newInfo) { 872 if (newInfo.size.width != orgInfo.size.height) { 873 logger.log(`org height ${orgInfo.size.height}, new width ${newInfo.size.width} `); 874 expect(false).assertTrue(); 875 done(); 876 } 877 } 878 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_PROMISE_0100', 'promise', 'rotate', sizeCheck, rotate90, 90.0) 879 }) 880 881 /** 882 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_CALLBACK_0100 883 * @tc.name : Pixelmap Rotate-callback 884 * @tc.desc : 1.create pixelmap 885 * : 2.call rotate 886 * : 3.get pixelbytesnumber 887 * : 4.read pixels to buffer 888 * @tc.size : MEDIUM 889 * @tc.type : Functional 890 * @tc.level : Level 0 891 */ 892 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_CALLBACK_0100', 893 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 894 function sizeCheck(done, logger, orgInfo, newInfo) { 895 if (newInfo.size.width != orgInfo.size.height) { 896 logger.log(`org height ${orgInfo.size.height}, new width ${newInfo.size.width} `); 897 expect(false).assertTrue(); 898 done(); 899 } 900 } 901 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_CALLBACK_0100', 'callback', 'rotate', sizeCheck, rotate90, 90.0) 902 }) 903 904 /** 905 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_PROMISE_0100 906 * @tc.name : Pixelmap Flip-promise 907 * @tc.desc : 1.create pixelmap 908 * : 2.call flip 909 * : 3.get pixelbytesnumber 910 * : 4.read pixels to buffer 911 * @tc.size : MEDIUM 912 * @tc.type : Functional 913 * @tc.level : Level 0 914 */ 915 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_PROMISE_0100', 916 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 917 function sizeCheck(done, logger, orgInfo, newInfo) { 918 if (newInfo.size.width != orgInfo.size.width) { 919 logger.log(`org width ${orgInfo.size.width}, new width ${newInfo.size.width} `); 920 expect(false).assertTrue(); 921 done(); 922 } 923 } 924 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_PROMISE_0100', 'promise', 'flip', sizeCheck, flipH, false, true) 925 }) 926 927 /** 928 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_CALLBACK_0100 929 * @tc.name : Pixelmap Flip-callback 930 * @tc.desc : 1.create pixelmap 931 * : 2.call flip 932 * : 3.get pixelbytesnumber 933 * : 4.read pixels to buffer 934 * @tc.size : MEDIUM 935 * @tc.type : Functional 936 * @tc.level : Level 0 937 */ 938 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_CALLBACK_0100', 939 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 940 function sizeCheck(done, logger, orgInfo, newInfo) { 941 if (newInfo.size.width != orgInfo.size.width) { 942 logger.log(`org width ${orgInfo.size.width}, new width ${newInfo.size.width} `); 943 expect(false).assertTrue(); 944 done(); 945 } 946 } 947 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_CALLBACK_0100', 'callback', 'flip', sizeCheck, flipH, false, true) 948 }) 949 950 /** 951 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_ISSUPPORTALPHA_SETSUPPORTALPHA_0100 952 * @tc.name : isSupportAlpha SetSupportAlpha 953 * @tc.desc : 1.create imagesource 954 * : 2.create pixelmap 955 * : 3.call setAlphaAble 956 * : 4.call isSupportAlpha 957 * @tc.size : MEDIUM 958 * @tc.type : Functional 959 * @tc.level : Level 0 960 */ 961 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_ISSUPPORTALPHA_SETSUPPORTALPHA_0100', 962 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 963 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_ISSUPPORTALPHA_SETSUPPORTALPHA_0100') 964 try { 965 let imageSource = genPicSource(); 966 logger.log("ImageSource " + (imageSource != undefined)); 967 if (imageSource != undefined) { 968 globalImagesource = imageSource; 969 let pixelMap = await imageSource.createPixelMap(); 970 logger.log("PixelMap " + pixelMap); 971 if (pixelMap != undefined) { 972 globalpixelmap = pixelMap; 973 var supportAlpha = pixelMap.isSupportAlpha(); 974 logger.log("isSupportAlpha before " + supportAlpha); 975 pixelMap.setAlphaAble(false); 976 var supportAlpha1 = pixelMap.isSupportAlpha(); 977 logger.log("isSupportAlpha after " + supportAlpha1); 978 expect(supportAlpha1 == false).assertTrue(); 979 done(); 980 } else { 981 logger.log('create pixelmap failed '); 982 expect(false).assertTrue(); 983 done(); 984 } 985 } else { 986 logger.log('create imagesource failed '); 987 expect(false).assertTrue(); 988 done(); 989 } 990 } catch (error) { 991 logger.log('failed ' + error); 992 expect(false).assertTrue(); 993 done(); 994 } 995 }) 996 /** 997 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_PROMISE_0100 998 * @tc.name : createAlphaPixelmap-promise 999 * @tc.desc : 1.create imagesource 1000 * : 2.create pixelmap 1001 * : 3.create AlphaPixelmap 1002 * : 4.call getImageInfo 1003 * @tc.size : MEDIUM 1004 * @tc.type : Functional 1005 * @tc.level : Level 0 1006 */ 1007 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_PROMISE_0100', 1008 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1009 var imageData = testPng.buffer; 1010 await createAlphaPixelmapTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_PROMISE_0100', 'promise', imageData); 1011 }) 1012 1013 /** 1014 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_CALLBACK_0100 1015 * @tc.name : createAlphaPixelmap-callback 1016 * @tc.desc : 1.create imagesource 1017 * : 2.create pixelmap 1018 * : 3.create AlphaPixelmap 1019 * : 4.call getImageInfo 1020 * @tc.size : MEDIUM 1021 * @tc.type : Functional 1022 * @tc.level : Level 0 1023 */ 1024 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_CALLBACK_0100', 1025 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1026 var imageData = testPng.buffer; 1027 await createAlphaPixelmapTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_CALLBACK_0100', 'callback', imageData); 1028 }) 1029 1030 /** 1031 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0100 1032 * @tc.name : createAlphaPixelmap-Jpg 1033 * @tc.desc : 1.create imagesource 1034 * : 2.create pixelmap 1035 * : 3.create AlphaPixelmap 1036 * : 4.call getImageInfo 1037 * @tc.size : MEDIUM 1038 * @tc.type : Functional 1039 * @tc.level : Level 0 1040 */ 1041 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0100', 1042 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1043 var imageData = testJpg.buffer; 1044 await createAlphaPixelmapTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0100', 'promise', imageData); 1045 }) 1046 1047 /** 1048 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0200 1049 * @tc.name : createAlphaPixelmap 1050 * @tc.desc : 1.create imagesource 1051 * : 2.create pixelmap 1052 * : 3.create AlphaPixelmap 1053 * : 4.call getImageInfo 1054 * @tc.size : MEDIUM 1055 * @tc.type : Functional 1056 * @tc.level : Level 0 1057 */ 1058 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0200', 1059 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1060 var imageData = testBmp.buffer; 1061 await createAlphaPixelmapTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0200', 'promise', imageData); 1062 }) 1063 1064 /** 1065 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0300 1066 * @tc.name : createAlphaPixelmap 1067 * @tc.desc : 1.create imagesource 1068 * : 2.create pixelmap 1069 * : 3.create AlphaPixelmap 1070 * : 4.call getImageInfo 1071 * @tc.size : MEDIUM 1072 * @tc.type : Functional 1073 * @tc.level : Level 0 1074 */ 1075 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0300', 1076 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1077 var imageData = testGif.buffer; 1078 await createAlphaPixelmapTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CREATEALPHAPIXELMAP_0300', 'promise', imageData); 1079 }) 1080 1081 /** 1082 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETALPHA_PROMISE_0100 1083 * @tc.name : setAlpha-promise 1084 * @tc.desc : 1.create pixelmap 1085 * : 2.setAlpha 1086 * : 3.get PixelBytesNumber 1087 * : 4.read Pixels To Buffer 1088 * @tc.size : MEDIUM 1089 * @tc.type : Functional 1090 * @tc.level : Level 0 1091 */ 1092 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETALPHA_PROMISE_0100', 1093 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1094 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETALPHA_PROMISE_0100') 1095 try { 1096 var pixelMap = await genPixelMap() 1097 logger.log("pixelMap " + (pixelMap != undefined)); 1098 if (pixelMap != undefined) { 1099 globalpixelmap = pixelMap; 1100 await pixelMap.opacity(0.8) 1101 var pixelSize = pixelMap.getPixelBytesNumber(); 1102 logger.log(`new pixel size ${pixelSize}`); 1103 var readBuffer = new ArrayBuffer(pixelSize); 1104 await pixelMap.readPixelsToBuffer(readBuffer); 1105 var bufferArr2 = new Uint8Array(readBuffer); 1106 for (var i = 0; i < bufferArr2.length; i++) { 1107 if (bufferArr2[i] != setAlpha8[i]) { 1108 logger.log(`pixel[${i}] current[${bufferArr2[i]}] target[${setAlpha8[i]}]`); 1109 expect(false).assertTrue(); 1110 break; 1111 } 1112 } 1113 expect(true).assertTrue(); 1114 done(); 1115 } else { 1116 logger.log('creat pixelMap failed '); 1117 expect(false).assertTrue(); 1118 done(); 1119 } 1120 } catch (error) { 1121 logger.log('failed ' + error); 1122 expect(false).assertTrue(); 1123 done(); 1124 } 1125 }) 1126 1127 /** 1128 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETALPHA_CALLBACK_0100 1129 * @tc.name : setAlpha -callback 1130 * @tc.desc : 1.create pixelmap 1131 * : 2.setAlpha 1132 * : 3.get PixelBytesNumber 1133 * : 4.read Pixels To Buffer 1134 * @tc.size : MEDIUM 1135 * @tc.type : Functional 1136 * @tc.level : Level 0 1137 */ 1138 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETALPHA_CALLBACK_0100', 1139 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1140 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETALPHA_CALLBACK_0100') 1141 try { 1142 var pixelMap = await genPixelMap() 1143 logger.log("pixelMap " + (pixelMap != undefined)); 1144 if (pixelMap != undefined) { 1145 globalpixelmap = pixelMap; 1146 pixelMap.opacity(0.8, async (err) => { 1147 var pixelSize = pixelMap.getPixelBytesNumber(); 1148 logger.log(`new pixel size ${pixelSize}`); 1149 var readBuffer = new ArrayBuffer(pixelSize); 1150 await pixelMap.readPixelsToBuffer(readBuffer); 1151 var bufferArr2 = new Uint8Array(readBuffer); 1152 for (var i = 0; i < bufferArr2.length; i++) { 1153 if (bufferArr2[i] != setAlpha8[i]) { 1154 logger.log(`pixel[${i}] current[${bufferArr2[i]}] target[${setAlpha8[i]}]`); 1155 expect(false).assertTrue(); 1156 break; 1157 } 1158 } 1159 expect(true).assertTrue(); 1160 done(); 1161 }) 1162 } else { 1163 logger.log('creat pixelMap failed '); 1164 expect(false).assertTrue(); 1165 done(); 1166 } 1167 } catch (error) { 1168 logger.log('failed ' + error); 1169 expect(false).assertTrue(); 1170 done(); 1171 } 1172 }) 1173 1174 /** 1175 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0100 1176 * @tc.name : SourceOptions getDensity fitDensity 1177 * @tc.desc : 1.create ImageSource 1178 * : 2.create PixelMap 1179 * : 3.getDensity 1180 * @tc.size : MEDIUM 1181 * @tc.type : Functional 1182 * @tc.level : Level 0 1183 */ 1184 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0100', 1185 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1186 var imageData = testPng.buffer; 1187 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0100', imageData) 1188 }) 1189 1190 /** 1191 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0100 1192 * @tc.name : fitDensity 1193 * @tc.desc : 1.create ImageSource 1194 * : 2.create PixelMap with fitDensity 1195 * : 3.getDensity 1196 * @tc.size : MEDIUM 1197 * @tc.type : Functional 1198 * @tc.level : Level 0 1199 */ 1200 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0100', 1201 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1202 var imageData = testPng.buffer; 1203 let decodingOptions = { fitDensity: 240 }; 1204 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0100', imageData, decodingOptions) 1205 }) 1206 1207 /** 1208 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0200 1209 * @tc.name : setDensity 1210 * @tc.desc : 1.create ImageSource 1211 * : 2.create PixelMap 1212 * : 3.set Density 1213 * : 4.getDensity 1214 * @tc.size : MEDIUM 1215 * @tc.type : Functional 1216 * @tc.level : Level 0 1217 */ 1218 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0200', 1219 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1220 var imageData = testPng.buffer; 1221 await setDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0200', imageData) 1222 }) 1223 1224 /** 1225 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0200 1226 * @tc.name : SourceOptions getDensity fitDensity 1227 * @tc.desc : 1.create ImageSource 1228 * : 2.create PixelMap 1229 * : 3.getDensity 1230 * @tc.size : MEDIUM 1231 * @tc.type : Functional 1232 * @tc.level : Level 0 1233 */ 1234 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0200', 1235 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1236 var imageData = testJpg.buffer; 1237 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0200', imageData) 1238 }) 1239 1240 /** 1241 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0300 1242 * @tc.name : SourceOptions getDensity fitDensity 1243 * @tc.desc : 1.create ImageSource 1244 * : 2.create PixelMap 1245 * : 3.getDensity 1246 * @tc.size : MEDIUM 1247 * @tc.type : Functional 1248 * @tc.level : Level 0 1249 */ 1250 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0300', 1251 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1252 var imageData = testBmp.buffer; 1253 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0300', imageData) 1254 }) 1255 1256 /** 1257 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0400 1258 * @tc.name : SourceOptions getDensity fitDensity 1259 * @tc.desc : 1.create ImageSource 1260 * : 2.create PixelMap 1261 * : 3.getDensity 1262 * @tc.size : MEDIUM 1263 * @tc.type : Functional 1264 * @tc.level : Level 0 1265 */ 1266 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0400', 1267 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1268 var imageData = testGif.buffer; 1269 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SOURCEOPTIONS_GETDENSITY_FITDENSITY_0400', imageData) 1270 }) 1271 1272 /** 1273 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0300 1274 * @tc.name : fitDensity-JPG 1275 * @tc.desc : 1.create ImageSource 1276 * : 2.create PixelMap with fitDensity 1277 * : 3.getDensity 1278 * @tc.size : MEDIUM 1279 * @tc.type : Functional 1280 * @tc.level : Level 0 1281 */ 1282 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0300', 1283 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1284 var imageData = testJpg.buffer; 1285 let decodingOptions = { fitDensity: 240 }; 1286 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0300', imageData, decodingOptions) 1287 }) 1288 1289 /** 1290 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0400 1291 * @tc.name : fitDensity-bmp 1292 * @tc.desc : 1.create ImageSource 1293 * : 2.create PixelMap with fitDensity 1294 * : 3.getDensity 1295 * @tc.size : MEDIUM 1296 * @tc.type : Functional 1297 * @tc.level : Level 0 1298 */ 1299 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0400', 1300 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1301 var imageData = testBmp.buffer; 1302 let decodingOptions = { fitDensity: 240 }; 1303 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0400', imageData, decodingOptions) 1304 }) 1305 1306 /** 1307 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0500 1308 * @tc.name : fitDensity-gif 1309 * @tc.desc : 1.create ImageSource 1310 * : 2.create PixelMap with fitDensity 1311 * : 3.getDensity 1312 * @tc.size : MEDIUM 1313 * @tc.type : Functional 1314 * @tc.level : Level 0 1315 */ 1316 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0500', 1317 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1318 var imageData = testGif.buffer; 1319 let decodingOptions = { fitDensity: 240 }; 1320 await getDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_FITDENSITY_0500', imageData, decodingOptions) 1321 }) 1322 1323 /** 1324 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0100 1325 * @tc.name : setDensity-Jpg 1326 * @tc.desc : 1.create ImageSource 1327 * : 2.create PixelMap 1328 * : 3.set Density 1329 * : 4.getDensity 1330 * @tc.size : MEDIUM 1331 * @tc.type : Functional 1332 * @tc.level : Level 0 1333 */ 1334 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0100', 1335 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1336 var imageData = testJpg.buffer; 1337 await setDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0100', imageData) 1338 }) 1339 1340 /** 1341 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0200 1342 * @tc.name : setDensity-bmp 1343 * @tc.desc : 1.create ImageSource 1344 * : 2.create PixelMap 1345 * : 3.set Density 1346 * : 4.getDensity 1347 * @tc.size : MEDIUM 1348 * @tc.type : Functional 1349 * @tc.level : Level 0 1350 */ 1351 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0200', 1352 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1353 var imageData = testBmp.buffer; 1354 await setDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0200', imageData) 1355 }) 1356 1357 /** 1358 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0300 1359 * @tc.name : setDensity-gif 1360 * @tc.desc : 1.create ImageSource 1361 * : 2.create PixelMap 1362 * : 3.set Density 1363 * : 4.getDensity 1364 * @tc.size : MEDIUM 1365 * @tc.type : Functional 1366 * @tc.level : Level 0 1367 */ 1368 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0300', 1369 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1370 var imageData = testGif.buffer; 1371 await setDensityTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_0300', imageData) 1372 }) 1373 1374 /** 1375 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_0100 1376 * @tc.name : crop-promise 1377 * @tc.desc : 1.create PixelMap 1378 * : 2.crop 1379 * : 3.getImageInfo 1380 * : 4.getPixelBytesNumber 1381 * : 5.readPixelsToBuffer 1382 * @tc.size : MEDIUM 1383 * @tc.type : Functional 1384 * @tc.level : Level 0 1385 */ 1386 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_0100', 1387 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1388 var region = { size: { height: 3, width: 3 }, x: 1, y: 1 }; 1389 function sizeCheck(done, logger, orgInfo, newInfo) { 1390 orgInfo = region; 1391 if (newInfo.size.width != orgInfo.size.width) { 1392 logger.log(`orgInfo width ${orgInfo.size.width}, new width ${newInfo.size.width} `); 1393 expect(false).assertTrue(); 1394 done(); 1395 } 1396 } 1397 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_0100', 'promise', 'crop', sizeCheck, crop3x3, region) 1398 }) 1399 1400 /** 1401 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_0100 1402 * @tc.name : crop -callback 1403 * @tc.desc : 1.create PixelMap 1404 * : 2.crop 1405 * : 3.getImageInfo 1406 * : 4.getPixelBytesNumber 1407 * : 5.readPixelsToBuffer 1408 * @tc.size : MEDIUM 1409 * @tc.type : Functional 1410 * @tc.level : Level 0 1411 */ 1412 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_0100', 1413 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1414 var region = { size: { height: 3, width: 3 }, x: 1, y: 1 }; 1415 function sizeCheck(done, logger, orgInfo, newInfo) { 1416 orgInfo = region; 1417 if (newInfo.size.width != orgInfo.size.width) { 1418 logger.log(`orgInfo width ${orgInfo.size.width}, new width ${newInfo.size.width} `); 1419 expect(false).assertTrue(); 1420 done(); 1421 } 1422 } 1423 await pixelMapModifySizeTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_0100', 'callback', 'crop', sizeCheck, crop3x3, region) 1424 }) 1425 1426 /** 1427 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0100 1428 * @tc.name : Pixelmap Scale-promise-wrong x 1429 * @tc.desc : 1.create pixelmap 1430 * : 2.call scale 1431 * @tc.size : MEDIUM 1432 * @tc.type : Functional 1433 * @tc.level : Level 0 1434 */ 1435 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0100', 1436 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1437 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0100', 'promise', 'scale', { a: 10 }, 1.0) 1438 }) 1439 1440 /** 1441 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0200 1442 * @tc.name : Pixelmap Scale-promise-wrong x 1443 * @tc.desc : 1.create pixelmap 1444 * : 2.call scale 1445 * @tc.size : MEDIUM 1446 * @tc.type : Functional 1447 * @tc.level : Level 0 1448 */ 1449 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0200', 1450 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1451 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0200', 'promise', 'scale', 'a', 1.0) 1452 }) 1453 1454 /** 1455 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0300 1456 * @tc.name : Pixelmap Scale-promise-wrong y 1457 * @tc.desc : 1.create pixelmap 1458 * : 2.call scale 1459 * @tc.size : MEDIUM 1460 * @tc.type : Functional 1461 * @tc.level : Level 0 1462 */ 1463 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0300', 1464 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1465 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0300', 'promise', 'scale', 1.0, null) 1466 1467 }) 1468 1469 /** 1470 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0400 1471 * @tc.name : Pixelmap Scale-promise-wrong y 1472 * @tc.desc : 1.create pixelmap 1473 * : 2.call scale 1474 * @tc.size : MEDIUM 1475 * @tc.type : Functional 1476 * @tc.level : Level 0 1477 */ 1478 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0400', 1479 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1480 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_PROMISE_0400', 'promise', 'scale', 1.0, true) 1481 1482 }) 1483 1484 /** 1485 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0100 1486 * @tc.name : Pixelmap Scale-callback-wrong x 1487 * @tc.desc : 1.create pixelmap 1488 * : 2.call scale 1489 * @tc.size : MEDIUM 1490 * @tc.type : Functional 1491 * @tc.level : Level 0 1492 */ 1493 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0100', 1494 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1495 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0100', 'callback', 'scale', { a: 10 }, 1.0) 1496 }) 1497 1498 /** 1499 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0200 1500 * @tc.name : Pixelmap Scale-callback-wrong x 1501 * @tc.desc : 1.create pixelmap 1502 * : 2.call scale 1503 * @tc.size : MEDIUM 1504 * @tc.type : Functional 1505 * @tc.level : Level 0 1506 */ 1507 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0200', 1508 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1509 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0200', 'callback', 'scale', 'a', 1.0) 1510 }) 1511 1512 /** 1513 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0300 1514 * @tc.name : Pixelmap Scale-callback-wrong y 1515 * @tc.desc : 1.create pixelmap 1516 * : 2.call scale 1517 * @tc.size : MEDIUM 1518 * @tc.type : Functional 1519 * @tc.level : Level 0 1520 */ 1521 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0300', 1522 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1523 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0300', 'callback', 'scale', 1.0, null) 1524 }) 1525 1526 /** 1527 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0400 1528 * @tc.name : Pixelmap Scale-callback-wrong y 1529 * @tc.desc : 1.create pixelmap 1530 * : 2.call scale 1531 * @tc.size : MEDIUM 1532 * @tc.type : Functional 1533 * @tc.level : Level 0 1534 */ 1535 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0400', 1536 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1537 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_SCALE_ERROR_CALLBACK_0400', 'callback', 'scale', 1.0, true) 1538 }) 1539 1540 /** 1541 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0100 1542 * @tc.name : Pixelmap Translate -promise-wrong x 1543 * @tc.desc : 1.create pixelmap 1544 * : 2.call translate 1545 * @tc.size : MEDIUM 1546 * @tc.type : Functional 1547 * @tc.level : Level 0 1548 */ 1549 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0100', 1550 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1551 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0100', 'promise', 'translate', { a: 10 }, 1.0) 1552 }) 1553 1554 /** 1555 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0200 1556 * @tc.name : Pixelmap Translate -promise-wrong x 1557 * @tc.desc : 1.create pixelmap 1558 * : 2.call translate 1559 * @tc.size : MEDIUM 1560 * @tc.type : Functional 1561 * @tc.level : Level 0 1562 */ 1563 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0200', 1564 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1565 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0200', 'promise', 'translate', 'a', 1.0) 1566 }) 1567 1568 /** 1569 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0300 1570 * @tc.name : Pixelmap Translate -promise-wrong y 1571 * @tc.desc : 1.create pixelmap 1572 * : 2.call translate 1573 * @tc.size : MEDIUM 1574 * @tc.type : Functional 1575 * @tc.level : Level 0 1576 */ 1577 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0300', 1578 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1579 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0300', 'promise', 'translate', 1.0, null) 1580 }) 1581 1582 /** 1583 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0400 1584 * @tc.name : Pixelmap Translate -promise-wrong y 1585 * @tc.desc : 1.create pixelmap 1586 * : 2.call translate 1587 * @tc.size : MEDIUM 1588 * @tc.type : Functional 1589 * @tc.level : Level 0 1590 */ 1591 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0400', 1592 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1593 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_PROMISE_0400', 'promise', 'translate', 1.0, false) 1594 }) 1595 1596 /** 1597 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0100 1598 * @tc.name : Pixelmap Translate -callback-wrong x 1599 * @tc.desc : 1.create pixelmap 1600 * : 2.call translate 1601 * @tc.size : MEDIUM 1602 * @tc.type : Functional 1603 * @tc.level : Level 0 1604 */ 1605 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0100', 1606 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1607 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0100', 'callback', 'translate', { a: 10 }, 1.0) 1608 }) 1609 1610 /** 1611 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0200 1612 * @tc.name : Pixelmap Translate -callback-wrong x 1613 * @tc.desc : 1.create pixelmap 1614 * : 2.call translate 1615 * @tc.size : MEDIUM 1616 * @tc.type : Functional 1617 * @tc.level : Level 0 1618 */ 1619 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0200', 1620 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1621 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0200', 'callback', 'translate', 'a', 1.0) 1622 }) 1623 1624 /** 1625 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0300 1626 * @tc.name : Pixelmap Translate -callback-wrong y 1627 * @tc.desc : 1.create pixelmap 1628 * : 2.call translate 1629 * @tc.size : MEDIUM 1630 * @tc.type : Functional 1631 * @tc.level : Level 0 1632 */ 1633 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0300', 1634 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1635 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0300', 'callback', 'translate', 1.0, null) 1636 }) 1637 1638 /** 1639 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0400 1640 * @tc.name : Pixelmap Translate -callback-wrong y 1641 * @tc.desc : 1.create pixelmap 1642 * : 2.call translate 1643 * @tc.size : MEDIUM 1644 * @tc.type : Functional 1645 * @tc.level : Level 0 1646 */ 1647 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0400', 1648 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1649 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_TRANSLATE_ERROR_CALLBACK_0400', 'callback', 'translate', 1.0, false) 1650 }) 1651 1652 /** 1653 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0100 1654 * @tc.name : Pixelmap Rotate-promise-wrong angle 1655 * @tc.desc : 1.create pixelmap 1656 * : 2.call rotate 1657 * @tc.size : MEDIUM 1658 * @tc.type : Functional 1659 * @tc.level : Level 0 1660 */ 1661 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0100', 1662 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1663 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0100', 'promise', 'rotate', 'a') 1664 }) 1665 1666 /** 1667 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0200 1668 * @tc.name : Pixelmap Rotate-promise-wrong angle 1669 * @tc.desc : 1.create pixelmap 1670 * : 2.call rotate 1671 * @tc.size : MEDIUM 1672 * @tc.type : Functional 1673 * @tc.level : Level 0 1674 */ 1675 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0200', 1676 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1677 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0200', 'promise', 'rotate', { a: 10 }) 1678 }) 1679 1680 /** 1681 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0300 1682 * @tc.name : Pixelmap Rotate-promise-wrong angle 1683 * @tc.desc : 1.create pixelmap 1684 * : 2.call rotate 1685 * @tc.size : MEDIUM 1686 * @tc.type : Functional 1687 * @tc.level : Level 0 1688 */ 1689 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0300', 1690 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1691 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0300', 'promise', 'rotate', null) 1692 }) 1693 1694 /** 1695 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0400 1696 * @tc.name : Pixelmap Rotate-promise-wrong angle 1697 * @tc.desc : 1.create pixelmap 1698 * : 2.call rotate 1699 * @tc.size : MEDIUM 1700 * @tc.type : Functional 1701 * @tc.level : Level 0 1702 */ 1703 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0400', 1704 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1705 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_PROMISE_0400', 'promise', 'rotate', false) 1706 }) 1707 1708 /** 1709 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0100 1710 * @tc.name : Pixelmap Rotate-callback-wrong angle 1711 * @tc.desc : 1.create pixelmap 1712 * : 2.call rotate 1713 * @tc.size : MEDIUM 1714 * @tc.type : Functional 1715 * @tc.level : Level 0 1716 */ 1717 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0100', 1718 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1719 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0100', 'callback', 'rotate', 'a') 1720 }) 1721 1722 /** 1723 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0200 1724 * @tc.name : Pixelmap Rotate-callback-wrong angle 1725 * @tc.desc : 1.create pixelmap 1726 * : 2.call rotate 1727 * @tc.size : MEDIUM 1728 * @tc.type : Functional 1729 * @tc.level : Level 0 1730 */ 1731 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0200', 1732 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1733 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0200', 'callback', 'rotate', { a: 10 }) 1734 }) 1735 1736 /** 1737 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0300 1738 * @tc.name : Pixelmap Rotate-callback-wrong angle 1739 * @tc.desc : 1.create pixelmap 1740 * : 2.call rotate 1741 * @tc.size : MEDIUM 1742 * @tc.type : Functional 1743 * @tc.level : Level 0 1744 */ 1745 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0300', 1746 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1747 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0300', 'callback', 'rotate', null) 1748 }) 1749 1750 /** 1751 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0400 1752 * @tc.name : Pixelmap Rotate-callback-wrong angle 1753 * @tc.desc : 1.create pixelmap 1754 * : 2.call rotate 1755 * @tc.size : MEDIUM 1756 * @tc.type : Functional 1757 * @tc.level : Level 0 1758 */ 1759 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0400', 1760 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1761 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_ROTATE_ERROR_ANGLE_CALLBACK_0400', 'callback', 'rotate', false) 1762 }) 1763 1764 /** 1765 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0100 1766 * @tc.name : Pixelmap Flip-promise-wrong x 1767 * @tc.desc : 1.create pixelmap 1768 * : 2.call flip 1769 * @tc.size : MEDIUM 1770 * @tc.type : Functional 1771 * @tc.level : Level 0 1772 */ 1773 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0100', 1774 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1775 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0100', 'promise', 'flip', 'false', true) 1776 }) 1777 1778 /** 1779 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0200 1780 * @tc.name : Pixelmap Flip-promise-wrong x 1781 * @tc.desc : 1.create pixelmap 1782 * : 2.call flip 1783 * @tc.size : MEDIUM 1784 * @tc.type : Functional 1785 * @tc.level : Level 0 1786 */ 1787 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0200', 1788 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1789 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0200', 'promise', 'flip', 1, true) 1790 }) 1791 1792 /** 1793 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0300 1794 * @tc.name : Pixelmap Flip-promise-wrong y 1795 * @tc.desc : 1.create pixelmap 1796 * : 2.call flip 1797 * @tc.size : MEDIUM 1798 * @tc.type : Functional 1799 * @tc.level : Level 0 1800 */ 1801 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0300', 1802 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1803 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0300', 'promise', 'flip', true, { a: 10 }) 1804 }) 1805 1806 /** 1807 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0400 1808 * @tc.name : Pixelmap Flip-promise-wrong y 1809 * @tc.desc : 1.create pixelmap 1810 * : 2.call flip 1811 * @tc.size : MEDIUM 1812 * @tc.type : Functional 1813 * @tc.level : Level 0 1814 */ 1815 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0400', 1816 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1817 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_PROMISE_0400', 'promise', 'flip', true, null) 1818 }) 1819 1820 /** 1821 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0100 1822 * @tc.name : Pixelmap Flip-callback-wrong x 1823 * @tc.desc : 1.create pixelmap 1824 * : 2.call flip 1825 * @tc.size : MEDIUM 1826 * @tc.type : Functional 1827 * @tc.level : Level 0 1828 */ 1829 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0100', 1830 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1831 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0100', 'callback', 'flip', 'false', true) 1832 }) 1833 1834 /** 1835 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0200 1836 * @tc.name : Pixelmap Flip-callback-wrong x 1837 * @tc.desc : 1.create pixelmap 1838 * : 2.call flip 1839 * @tc.size : MEDIUM 1840 * @tc.type : Functional 1841 * @tc.level : Level 0 1842 */ 1843 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0200', 1844 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1845 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0200', 'callback', 'flip', 1, true) 1846 }) 1847 1848 /** 1849 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0300 1850 * @tc.name : Pixelmap Flip-callback-wrong y 1851 * @tc.desc : 1.create pixelmap 1852 * : 2.call flip 1853 * @tc.size : MEDIUM 1854 * @tc.type : Functional 1855 * @tc.level : Level 0 1856 */ 1857 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0300', 1858 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1859 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0300', 'callback', 'flip', true, { a: 10 }) 1860 }) 1861 1862 /** 1863 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0400 1864 * @tc.name : Pixelmap Flip-callback-wrong y 1865 * @tc.desc : 1.create pixelmap 1866 * : 2.call flip 1867 * @tc.size : MEDIUM 1868 * @tc.type : Functional 1869 * @tc.level : Level 0 1870 */ 1871 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0400', 1872 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1873 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_PIXELMAP_FLIP_ERROR_CALLBACK_0400', 'callback', 'flip', true, null) 1874 }) 1875 1876 /** 1877 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0100 1878 * @tc.name : SetSupportAlpha-wrong alpha 1879 * @tc.desc : 1.create imagesource 1880 * : 2.create pixelmap 1881 * : 3.call setAlphaAble 1882 * @tc.size : MEDIUM 1883 * @tc.type : Functional 1884 * @tc.level : Level 0 1885 */ 1886 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0100', 1887 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1888 setAlphaAbleErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0100', 'a') 1889 }) 1890 1891 /** 1892 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0200 1893 * @tc.name : SetSupportAlpha-wrong alpha 1894 * @tc.desc : 1.create imagesource 1895 * : 2.create pixelmap 1896 * : 3.call setAlphaAble 1897 * @tc.size : MEDIUM 1898 * @tc.type : Functional 1899 * @tc.level : Level 0 1900 */ 1901 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0200', 1902 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1903 setAlphaAbleErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0200', { a: 1 }) 1904 }) 1905 1906 /** 1907 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0300 1908 * @tc.name : SetSupportAlpha-wrong alpha 1909 * @tc.desc : 1.create imagesource 1910 * : 2.create pixelmap 1911 * : 3.call setAlphaAble 1912 * @tc.size : MEDIUM 1913 * @tc.type : Functional 1914 * @tc.level : Level 0 1915 */ 1916 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0300', 1917 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1918 setAlphaAbleErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0300', null) 1919 }) 1920 1921 /** 1922 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0400 1923 * @tc.name : SetSupportAlpha-wrong alpha 1924 * @tc.desc : 1.create imagesource 1925 * : 2.create pixelmap 1926 * : 3.call setAlphaAble 1927 * @tc.size : MEDIUM 1928 * @tc.type : Functional 1929 * @tc.level : Level 0 1930 */ 1931 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0400', 1932 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1933 setAlphaAbleErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETSUPPORTALPHA_ERROR_ALPHA_0400', 1) 1934 }) 1935 1936 /** 1937 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0100 1938 * @tc.name : crop-promise- size: { height: 3, width: 3 }, x: -1, y: 1 1939 * @tc.desc : 1.create PixelMap 1940 * : 2.crop 1941 * : 3.getImageInfo 1942 * : 4.getPixelBytesNumber 1943 * : 5.readPixelsToBuffer 1944 * @tc.size : MEDIUM 1945 * @tc.type : Functional 1946 * @tc.level : Level 0 1947 */ 1948 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0100', 1949 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1950 var region = { size: { height: 3, width: 3 }, x: -1, y: 1 }; 1951 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0100', 'promise', 'crop', region) 1952 }) 1953 1954 /** 1955 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0200 1956 * @tc.name : crop-promise-size: { height: 3, width: 3 }, x: 1, y: -1 1957 * @tc.desc : 1.create PixelMap 1958 * : 2.crop 1959 * : 3.getImageInfo 1960 * : 4.getPixelBytesNumber 1961 * : 5.readPixelsToBuffer 1962 * @tc.size : MEDIUM 1963 * @tc.type : Functional 1964 * @tc.level : Level 0 1965 */ 1966 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0200', 1967 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1968 var region = { size: { height: 3, width: 3 }, x: 1, y: -1 }; 1969 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0200', 'promise', 'crop', region) 1970 }) 1971 1972 /** 1973 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0300 1974 * @tc.name : crop-promise-size: { height: 3, width: -3 }, x: 1, y: 1 1975 * @tc.desc : 1.create PixelMap 1976 * : 2.crop 1977 * : 3.getImageInfo 1978 * : 4.getPixelBytesNumber 1979 * : 5.readPixelsToBuffer 1980 * @tc.size : MEDIUM 1981 * @tc.type : Functional 1982 * @tc.level : Level 0 1983 */ 1984 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0300', 1985 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 1986 var region = { size: { height: 3, width: -3 }, x: 1, y: 1 }; 1987 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0300', 'promise', 'crop', region) 1988 }) 1989 1990 /** 1991 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0400 1992 * @tc.name : crop-promise-size: { height: -3, width: 3 }, x: 1, y: 1 1993 * @tc.desc : 1.create PixelMap 1994 * : 2.crop 1995 * : 3.getImageInfo 1996 * : 4.getPixelBytesNumber 1997 * : 5.readPixelsToBuffer 1998 * @tc.size : MEDIUM 1999 * @tc.type : Functional 2000 * @tc.level : Level 0 2001 */ 2002 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0400', 2003 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2004 var region = { size: { height: -3, width: 3 }, x: 1, y: 1 }; 2005 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_PROMISE_SIZE_0400', 'promise', 'crop', region) 2006 }) 2007 2008 /** 2009 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0100 2010 * @tc.name : crop-callback-size: { height: 3, width: 3 }, x: -1, y: 1 2011 * @tc.desc : 1.create PixelMap 2012 * : 2.crop 2013 * : 3.getImageInfo 2014 * : 4.getPixelBytesNumber 2015 * : 5.readPixelsToBuffer 2016 * @tc.size : MEDIUM 2017 * @tc.type : Functional 2018 * @tc.level : Level 0 2019 */ 2020 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0100', 2021 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2022 var region = { size: { height: 3, width: 3 }, x: -1, y: 1 }; 2023 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0100', 'callback', 'crop', region) 2024 }) 2025 2026 /** 2027 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0200 2028 * @tc.name : crop-callback-size: { height: 3, width: 3 }, x: 1, y: -1 2029 * @tc.desc : 1.create PixelMap 2030 * : 2.crop 2031 * : 3.getImageInfo 2032 * : 4.getPixelBytesNumber 2033 * : 5.readPixelsToBuffer 2034 * @tc.size : MEDIUM 2035 * @tc.type : Functional 2036 * @tc.level : Level 0 2037 */ 2038 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0200', 2039 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2040 var region = { size: { height: 3, width: 3 }, x: 1, y: -1 }; 2041 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0200', 'callback', 'crop', region) 2042 }) 2043 2044 /** 2045 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0300 2046 * @tc.name : crop-callback-size: { height: 3, width: -3 }, x: 1, y: 1 2047 * @tc.desc : 1.create PixelMap 2048 * : 2.crop 2049 * : 3.getImageInfo 2050 * : 4.getPixelBytesNumber 2051 * : 5.readPixelsToBuffer 2052 * @tc.size : MEDIUM 2053 * @tc.type : Functional 2054 * @tc.level : Level 0 2055 */ 2056 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0300', 2057 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2058 var region = { size: { height: 3, width: -3 }, x: 1, y: 1 }; 2059 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0300', 'callback', 'crop', region) 2060 }) 2061 2062 /** 2063 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0400 2064 * @tc.name : crop-callback-size: { height: -3, width: 3 }, x: 1, y: 1 2065 * @tc.desc : 1.create PixelMap 2066 * : 2.crop 2067 * : 3.getImageInfo 2068 * : 4.getPixelBytesNumber 2069 * : 5.readPixelsToBuffer 2070 * @tc.size : MEDIUM 2071 * @tc.type : Functional 2072 * @tc.level : Level 0 2073 */ 2074 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0400', 2075 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2076 var region = { size: { height: -3, width: 3 }, x: 1, y: 1 }; 2077 await pixelMapModifySizeTestErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_CROP_CALLBACK_SIZE_0400', 'callback', 'crop', region) 2078 }) 2079 2080 /** 2081 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0100 2082 * @tc.name : setDensity-gif-wrong density 2083 * @tc.desc : 1.create ImageSource 2084 * : 2.create PixelMap 2085 * : 3.set Density 2086 * @tc.size : MEDIUM 2087 * @tc.type : Functional 2088 * @tc.level : Level 0 2089 */ 2090 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0100', 2091 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2092 var imageData = testGif.buffer; 2093 setDensityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0100', imageData, null) 2094 }) 2095 2096 /** 2097 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0200 2098 * @tc.name : setDensity-gif-wrong density 2099 * @tc.desc : 1.create ImageSource 2100 * : 2.create PixelMap 2101 * : 3.set Density 2102 * @tc.size : MEDIUM 2103 * @tc.type : Functional 2104 * @tc.level : Level 0 2105 */ 2106 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0200', 2107 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2108 var imageData = testGif.buffer; 2109 setDensityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0200', imageData, 'a') 2110 }) 2111 2112 /** 2113 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0300 2114 * @tc.name : setDensity-gif-wrong density 2115 * @tc.desc : 1.create ImageSource 2116 * : 2.create PixelMap 2117 * : 3.set Density 2118 * @tc.size : MEDIUM 2119 * @tc.type : Functional 2120 * @tc.level : Level 0 2121 */ 2122 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0300', 2123 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2124 var imageData = testGif.buffer; 2125 setDensityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0300', imageData, true) 2126 }) 2127 2128 /** 2129 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0400 2130 * @tc.name : setDensity-gif-wrong density 2131 * @tc.desc : 1.create ImageSource 2132 * : 2.create PixelMap 2133 * : 3.set Density 2134 * @tc.size : MEDIUM 2135 * @tc.type : Functional 2136 * @tc.level : Level 0 2137 */ 2138 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0400', 2139 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2140 var imageData = testGif.buffer; 2141 setDensityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_SETDENSITY_GIF_ERROR_DENSITY_0400', imageData, { a: 1 }) 2142 }) 2143 2144 /** 2145 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0100 2146 * @tc.name : opacity-promise-wrong alpha 2147 * @tc.desc : 1.create pixelmap 2148 * : 2.opacity 2149 * @tc.size : MEDIUM 2150 * @tc.type : Functional 2151 * @tc.level : Level 0 2152 */ 2153 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0100', 2154 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2155 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0100', { a: 1 }, 'Promise') 2156 }) 2157 2158 /** 2159 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0200 2160 * @tc.name : opacity-promise-wrong alpha 2161 * @tc.desc : 1.create pixelmap 2162 * : 2.opacity 2163 * @tc.size : MEDIUM 2164 * @tc.type : Functional 2165 * @tc.level : Level 0 2166 */ 2167 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0200', 2168 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2169 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0200', 'a', 'Promise') 2170 }) 2171 2172 /** 2173 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0300 2174 * @tc.name : opacity-promise-wrong alpha 2175 * @tc.desc : 1.create pixelmap 2176 * : 2.opacity 2177 * @tc.size : MEDIUM 2178 * @tc.type : Functional 2179 * @tc.level : Level 0 2180 */ 2181 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0300', 2182 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2183 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0300', null, 'Promise') 2184 }) 2185 2186 /** 2187 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0400 2188 * @tc.name : opacity-promise-wrong alpha 2189 * @tc.desc : 1.create pixelmap 2190 * : 2.opacity 2191 * @tc.size : MEDIUM 2192 * @tc.type : Functional 2193 * @tc.level : Level 0 2194 */ 2195 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0400', 2196 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2197 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_PROMISE_ERROR_ALPHA_0400', 2, 'Promise') 2198 }) 2199 2200 /** 2201 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0100 2202 * @tc.name : opacity-callback-wrong alpha 2203 * @tc.desc : 1.create pixelmap 2204 * : 2.opacity 2205 * @tc.size : MEDIUM 2206 * @tc.type : Functional 2207 * @tc.level : Level 0 2208 */ 2209 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0100', 2210 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2211 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0100', { a: 1 }, 'callback') 2212 }) 2213 2214 /** 2215 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0200 2216 * @tc.name : opacity-callback-wrong alpha 2217 * @tc.desc : 1.create pixelmap 2218 * : 2.opacity 2219 * @tc.size : MEDIUM 2220 * @tc.type : Functional 2221 * @tc.level : Level 0 2222 */ 2223 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0200', 2224 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2225 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0200', 'a', 'callback') 2226 }) 2227 2228 /** 2229 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0300 2230 * @tc.name : opacity-callback-wrong alpha 2231 * @tc.desc : 1.create pixelmap 2232 * : 2.opacityErr 2233 * @tc.size : MEDIUM 2234 * @tc.type : Functional 2235 * @tc.level : Level 0 2236 */ 2237 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0300', 2238 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2239 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0300', null, 'callback') 2240 }) 2241 2242 /** 2243 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0400 2244 * @tc.name : opacity-callback-wrong alpha 2245 * @tc.desc : 1.create pixelmap 2246 * : 2.opacity 2247 * @tc.size : MEDIUM 2248 * @tc.type : Functional 2249 * @tc.level : Level 0 2250 */ 2251 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0400', 2252 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2253 opacityErr(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_OPACITY_CALLBACK_ERROR_ALPHA_0400', 2, 'callback') 2254 }) 2255 2256 /** 2257 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_ISSTRIDEALIGNMENT_0100 2258 * @tc.name : isStrideAlignment 2259 * @tc.desc : 1.create ImageSource 2260 * : 2.create PixelMap with isStrideAlignment 2261 * : 3.isStrideAlignment 2262 * @tc.size : MEDIUM 2263 * @tc.type : Functional 2264 * @tc.level : Level 0 2265 */ 2266 it('SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_ISSTRIDEALIGNMENT_0100', 2267 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2268 var imageData = testPng.buffer; 2269 await isStrideAlignmentTest(done, 'SUB_MULTIMEDIA_IMAGE_PIXELMAPFRAMEWORK_ISSTRIDEALIGNMENT_0100', imageData) 2270 }) 2271 2272 /** 2273 * @tc.number : SUB_MULTIMEDIA_IMAGE_RECEIVER_CREATEPIXELMAPFROMSURFACE_0100 2274 * @tc.name : on 2275 * @tc.desc : 1.create ImageReceiver 2276 * 2.createPixelMapFromSurface 2277 * @tc.size : MEDIUM 2278 * @tc.type : Functional 2279 * @tc.level : Level 0 2280 */ 2281 it("SUB_MULTIMEDIA_IMAGE_RECEIVER_CREATEPIXELMAPFROMSURFACE_0100", 2282 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2283 var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY); 2284 if (receiver == undefined) { 2285 expect(false).assertTrue(); 2286 done(); 2287 return; 2288 } else { 2289 globalreceiver = receiver; 2290 var error = receiver.checkDeviceTest; 2291 if (DEVICE_CODE == error) { 2292 expect(error == DEVICE_CODE).assertTrue(); 2293 done(); 2294 return; 2295 } 2296 let pass = false; 2297 receiver.on("imageArrival", (err) => { 2298 if (err) { 2299 console.info("SUB_MULTIMEDIA_IMAGE_RECEIVER_CREATEPIXELMAPFROMSURFACE_0100 on err" + err); 2300 expect(false).assertTrue(); 2301 done(); 2302 return; 2303 } else { 2304 pass = true; 2305 console.info("SUB_MULTIMEDIA_IMAGE_RECEIVER_CREATEPIXELMAPFROMSURFACE_0100 on call back IN"); 2306 } 2307 }); 2308 receiver.getReceivingSurfaceId().then((id) => { 2309 logger.log('SurfaceId success'+ id); 2310 expect(isString(id)).assertTrue(); 2311 let region = { size: { height: 3, width: 3 }, x: 1, y: 1 }; 2312 image.createPixelMapFromSurface(id, region).then((pixelMap) =>{ 2313 logger.log("PixelMap " + pixelMap); 2314 if (pixelMap != undefined) { 2315 globalpixelmap = pixelMap; 2316 pixelMap.getImageInfo().then((imageInfo) => { 2317 if(imageInfo == undefined) { 2318 logger.log('failed to obtain the image pixel map information'); 2319 expect(false).assertTrue(); 2320 done(); 2321 } else if (imageInfo.size.height == 3 && imageInfo.size.width == 3) { 2322 logger.log('success in obtaining the pixelmap information'); 2323 expect(true).assertTrue(); 2324 done(); 2325 } 2326 }) 2327 } else { 2328 expect(true).assertTrue(); 2329 done(); 2330 } 2331 done(); 2332 return; 2333 }).catch ((error) =>{ 2334 expect(true).assertTrue(); 2335 done(); 2336 }) 2337 }) 2338 var dummy = receiver.test; 2339 await sleep(2000); 2340 expect(pass).assertTrue(); 2341 done(); 2342 return; 2343 } 2344 }); 2345 2346 /** 2347 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0100 2348 * @tc.name : test convert pixelformat RGBA_1010102 to NV21 2349 * @tc.desc : 1.create RGBA_1010102 pixelmap 2350 * 2.call convertPixelFormat(NV21) 2351 * 3.get pixelformat 2352 * @tc.size : MEDIUM 2353 * @tc.type : Functional 2354 * @tc.level : Level 0 2355 */ 2356 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0100', 2357 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2358 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0100') 2359 if (!isSupportHdr) { 2360 logger.log('device is not support hdr'); 2361 expect(true).assertTrue(); 2362 done(); 2363 } else { 2364 await testConvertPixelFormat( 2365 done, 2366 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0100", 2367 RGBA_1010102, 2368 NV21 2369 ); 2370 } 2371 }) 2372 2373 /** 2374 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0200 2375 * @tc.name : test convert pixelformat RGBA_1010102 to NV12 2376 * @tc.desc : 1.create RGBA_1010102 pixelmap 2377 * 2.call convertPixelFormat(NV12) 2378 * 3.get pixelformat 2379 * @tc.size : MEDIUM 2380 * @tc.type : Functional 2381 * @tc.level : Level 0 2382 */ 2383 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0200', 2384 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2385 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0200') 2386 if (!isSupportHdr) { 2387 logger.log('device is not support hdr'); 2388 expect(true).assertTrue(); 2389 done(); 2390 } else { 2391 await testConvertPixelFormat( 2392 done, 2393 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0200", 2394 RGBA_1010102, 2395 NV12 2396 ); 2397 } 2398 }); 2399 2400 /** 2401 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0300 2402 * @tc.name : test convert pixelformat RGBA_1010102 to YCRCB_P010 2403 * @tc.desc : 1.create RGBA_1010102 pixelmap 2404 * 2.call convertPixelFormat(YCRCB_P010) 2405 * 3.get pixelformat 2406 * @tc.size : MEDIUM 2407 * @tc.type : Functional 2408 * @tc.level : Level 0 2409 */ 2410 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0300', 2411 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2412 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0300') 2413 if (!isSupportHdr) { 2414 logger.log('device is not support hdr'); 2415 expect(true).assertTrue(); 2416 done(); 2417 } else { 2418 await testConvertPixelFormat( 2419 done, 2420 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0300", 2421 RGBA_1010102, 2422 YCRCB_P010 2423 ); 2424 } 2425 }); 2426 2427 /** 2428 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0400 2429 * @tc.name : test convert pixelformat RGBA_1010102 to YCBCR_P010 2430 * @tc.desc : 1.create RGBA_1010102 pixelmap 2431 * 2.call convertPixelFormat(YCBCR_P010) 2432 * 3.get pixelformat 2433 * @tc.size : MEDIUM 2434 * @tc.type : Functional 2435 * @tc.level : Level 0 2436 */ 2437 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0400', 2438 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2439 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0400') 2440 if (!isSupportHdr) { 2441 logger.log('device is not support hdr'); 2442 expect(true).assertTrue(); 2443 done(); 2444 } else { 2445 await testConvertPixelFormat( 2446 done, 2447 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0400", 2448 RGBA_1010102, 2449 YCBCR_P010 2450 ); 2451 } 2452 }); 2453 2454 /** 2455 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0500 2456 * @tc.name : test convert pixelformat YCBCR_P010 to RGB_565 2457 * @tc.desc : 1.create YCBCR_P010 pixelmap 2458 * 2.call convertPixelFormat(RGB_565) 2459 * 3.get pixelformat 2460 * @tc.size : MEDIUM 2461 * @tc.type : Functional 2462 * @tc.level : Level 0 2463 */ 2464 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0500', 2465 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2466 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0500') 2467 if (!isSupportHdr) { 2468 logger.log('device is not support hdr'); 2469 expect(true).assertTrue(); 2470 done(); 2471 } else { 2472 await testConvertPixelFormat( 2473 done, 2474 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0500", 2475 YCBCR_P010, 2476 RGB_565 2477 ); 2478 } 2479 }); 2480 2481 /** 2482 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0600 2483 * @tc.name : test convert pixelformat YCBCR_P010 to RGBA_8888 2484 * @tc.desc : 1.create YCBCR_P010 pixelmap 2485 * 2.call convertPixelFormat(RGBA_8888) 2486 * 3.get pixelformat 2487 * @tc.size : MEDIUM 2488 * @tc.type : Functional 2489 * @tc.level : Level 0 2490 */ 2491 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0600', 2492 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2493 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0600') 2494 if (!isSupportHdr) { 2495 logger.log('device is not support hdr'); 2496 expect(true).assertTrue(); 2497 done(); 2498 } else { 2499 await testConvertPixelFormat( 2500 done, 2501 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0600", 2502 YCBCR_P010, 2503 RGBA_8888 2504 ); 2505 } 2506 }); 2507 2508 /** 2509 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0700 2510 * @tc.name : test convert pixelformat YCBCR_P010 to BGRA_8888 2511 * @tc.desc : 1.create YCBCR_P010 pixelmap 2512 * 2.call convertPixelFormat(BGRA_8888) 2513 * 3.get pixelformat 2514 * @tc.size : MEDIUM 2515 * @tc.type : Functional 2516 * @tc.level : Level 0 2517 */ 2518 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0700', 2519 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2520 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0700') 2521 if (!isSupportHdr) { 2522 logger.log('device is not support hdr'); 2523 expect(true).assertTrue(); 2524 done(); 2525 } else { 2526 await testConvertPixelFormat( 2527 done, 2528 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0700", 2529 YCBCR_P010, 2530 BGRA_8888 2531 ); 2532 } 2533 }); 2534 2535 /** 2536 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0800 2537 * @tc.name : test convert pixelformat YCBCR_P010 to RGB_888 2538 * @tc.desc : 1.create YCBCR_P010 pixelmap 2539 * 2.call convertPixelFormat(RGB_888) 2540 * 3.get pixelformat 2541 * @tc.size : MEDIUM 2542 * @tc.type : Functional 2543 * @tc.level : Level 0 2544 */ 2545 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0800', 2546 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2547 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0800') 2548 if (!isSupportHdr) { 2549 logger.log('device is not support hdr'); 2550 expect(true).assertTrue(); 2551 done(); 2552 } else { 2553 await testConvertPixelFormat( 2554 done, 2555 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0800", 2556 YCBCR_P010, 2557 RGB_888 2558 ); 2559 } 2560 }); 2561 2562 /** 2563 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0900 2564 * @tc.name : test convert pixelformat YCBCR_P010 to RGBA_F16 2565 * @tc.desc : 1.create YCBCR_P010 pixelmap 2566 * 2.call convertPixelFormat(RGBA_F16) 2567 * 3.get pixelformat 2568 * @tc.size : MEDIUM 2569 * @tc.type : Functional 2570 * @tc.level : Level 0 2571 */ 2572 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0900', 2573 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2574 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0900') 2575 if (!isSupportHdr) { 2576 logger.log('device is not support hdr'); 2577 expect(true).assertTrue(); 2578 done(); 2579 } else { 2580 await testConvertPixelFormat( 2581 done, 2582 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_0900", 2583 YCBCR_P010, 2584 RGBA_F16 2585 ); 2586 } 2587 }); 2588 2589 /** 2590 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1000 2591 * @tc.name : test convert pixelformat YCRCB_P010 to RGB_565 2592 * @tc.desc : 1.create YCRCB_P010 pixelmap 2593 * 2.call convertPixelFormat(RGB_565) 2594 * 3.get pixelformat 2595 * @tc.size : MEDIUM 2596 * @tc.type : Functional 2597 * @tc.level : Level 0 2598 */ 2599 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1000', 2600 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2601 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1000') 2602 if (!isSupportHdr) { 2603 logger.log('device is not support hdr'); 2604 expect(true).assertTrue(); 2605 done(); 2606 } else { 2607 await testConvertPixelFormat( 2608 done, 2609 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1000", 2610 YCRCB_P010, 2611 RGB_565 2612 ); 2613 } 2614 }); 2615 2616 /** 2617 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1100 2618 * @tc.name : test convert pixelformat YCRCB_P010 to RGBA_8888 2619 * @tc.desc : 1.create YCRCB_P010 pixelmap 2620 * 2.call convertPixelFormat(RGBA_8888) 2621 * 3.get pixelformat 2622 * @tc.size : MEDIUM 2623 * @tc.type : Functional 2624 * @tc.level : Level 0 2625 */ 2626 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1100', 2627 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2628 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1100') 2629 if (!isSupportHdr) { 2630 logger.log('device is not support hdr'); 2631 expect(true).assertTrue(); 2632 done(); 2633 } else { 2634 await testConvertPixelFormat( 2635 done, 2636 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1100", 2637 YCRCB_P010, 2638 RGBA_8888 2639 ); 2640 } 2641 }); 2642 2643 /** 2644 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1200 2645 * @tc.name : test convert pixelformat YCRCB_P010 to BGRA_8888 2646 * @tc.desc : 1.create YCRCB_P010 pixelmap 2647 * 2.call convertPixelFormat(BGRA_8888) 2648 * 3.get pixelformat 2649 * @tc.size : MEDIUM 2650 * @tc.type : Functional 2651 * @tc.level : Level 0 2652 */ 2653 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1200', 2654 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2655 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1200') 2656 if (!isSupportHdr) { 2657 logger.log('device is not support hdr'); 2658 expect(true).assertTrue(); 2659 done(); 2660 } else { 2661 await testConvertPixelFormat( 2662 done, 2663 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1200", 2664 YCRCB_P010, 2665 BGRA_8888 2666 ); 2667 } 2668 }); 2669 2670 /** 2671 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1300 2672 * @tc.name : test convert pixelformat YCRCB_P010 to RGB_888 2673 * @tc.desc : 1.create YCRCB_P010 pixelmap 2674 * 2.call convertPixelFormat(RGB_888) 2675 * 3.get pixelformat 2676 * @tc.size : MEDIUM 2677 * @tc.type : Functional 2678 * @tc.level : Level 0 2679 */ 2680 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1300', 2681 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2682 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1300') 2683 if (!isSupportHdr) { 2684 logger.log('device is not support hdr'); 2685 expect(true).assertTrue(); 2686 done(); 2687 } else { 2688 await testConvertPixelFormat( 2689 done, 2690 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1300", 2691 YCRCB_P010, 2692 RGB_888 2693 ); 2694 } 2695 }); 2696 2697 /** 2698 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1400 2699 * @tc.name : test convert pixelformat YCRCB_P010 to RGBA_F16 2700 * @tc.desc : 1.create YCRCB_P010 pixelmap 2701 * 2.call convertPixelFormat(RGBA_F16) 2702 * 3.get pixelformat 2703 * @tc.size : MEDIUM 2704 * @tc.type : Functional 2705 * @tc.level : Level 0 2706 */ 2707 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1400', 2708 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2709 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1400') 2710 if (!isSupportHdr) { 2711 logger.log('device is not support hdr'); 2712 expect(true).assertTrue(); 2713 done(); 2714 } else { 2715 await testConvertPixelFormat( 2716 done, 2717 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1400", 2718 YCRCB_P010, 2719 RGBA_F16 2720 ); 2721 } 2722 }); 2723 2724 /** 2725 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1500 2726 * @tc.name : test convert pixelformat NV21 to RGBA_1010102 2727 * @tc.desc : 1.create RGBA_1010102 pixelmap 2728 * 2.call convertPixelFormat(NV21) 2729 * 3.get pixelformat 2730 * @tc.size : MEDIUM 2731 * @tc.type : Functional 2732 * @tc.level : Level 0 2733 */ 2734 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1500', 2735 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2736 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1500') 2737 if (!isSupportHdr) { 2738 logger.log('device is not support hdr'); 2739 expect(true).assertTrue(); 2740 done(); 2741 } else { 2742 await testConvertPixelFormat( 2743 done, 2744 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1500", 2745 NV21, 2746 RGBA_1010102 2747 ); 2748 } 2749 }); 2750 2751 /** 2752 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1600 2753 * @tc.name : test convert pixelformat NV12 to RGBA_1010102 2754 * @tc.desc : 1.create RGBA_1010102 pixelmap 2755 * 2.call convertPixelFormat(NV12) 2756 * 3.get pixelformat 2757 * @tc.size : MEDIUM 2758 * @tc.type : Functional 2759 * @tc.level : Level 0 2760 */ 2761 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1600', 2762 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2763 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1600') 2764 if (!isSupportHdr) { 2765 logger.log('device is not support hdr'); 2766 expect(true).assertTrue(); 2767 done(); 2768 } else { 2769 await testConvertPixelFormat( 2770 done, 2771 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1600", 2772 NV12, 2773 RGBA_1010102 2774 ); 2775 } 2776 }); 2777 2778 /** 2779 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1700 2780 * @tc.name : test convert pixelformat YCRCB_P010 to RGBA_1010102 2781 * @tc.desc : 1.create RGBA_1010102 pixelmap 2782 * 2.call convertPixelFormat(YCRCB_P010) 2783 * 3.get pixelformat 2784 * @tc.size : MEDIUM 2785 * @tc.type : Functional 2786 * @tc.level : Level 0 2787 */ 2788 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1700', 2789 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2790 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1700') 2791 if (!isSupportHdr) { 2792 logger.log('device is not support hdr'); 2793 expect(true).assertTrue(); 2794 done(); 2795 } else { 2796 await testConvertPixelFormat( 2797 done, 2798 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1700", 2799 YCRCB_P010, 2800 RGBA_1010102 2801 ); 2802 } 2803 }); 2804 2805 /** 2806 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1800 2807 * @tc.name : test convert pixelformat YCBCR_P010 to RGBA_1010102 2808 * @tc.desc : 1.create RGBA_1010102 pixelmap 2809 * 2.call convertPixelFormat(YCBCR_P010) 2810 * 3.get pixelformat 2811 * @tc.size : MEDIUM 2812 * @tc.type : Functional 2813 * @tc.level : Level 0 2814 */ 2815 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1800', 2816 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2817 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1800') 2818 if (!isSupportHdr) { 2819 logger.log('device is not support hdr'); 2820 expect(true).assertTrue(); 2821 done(); 2822 } else { 2823 await testConvertPixelFormat( 2824 done, 2825 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1800", 2826 YCBCR_P010, 2827 RGBA_1010102 2828 ); 2829 } 2830 }); 2831 2832 /** 2833 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1900 2834 * @tc.name : test convert pixelformat RGB_565 to YCBCR_P010 2835 * @tc.desc : 1.create YCBCR_P010 pixelmap 2836 * 2.call convertPixelFormat(RGB_565) 2837 * 3.get pixelformat 2838 * @tc.size : MEDIUM 2839 * @tc.type : Functional 2840 * @tc.level : Level 0 2841 */ 2842 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1900', 2843 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2844 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1900') 2845 if (!isSupportHdr) { 2846 logger.log('device is not support hdr'); 2847 expect(true).assertTrue(); 2848 done(); 2849 } else { 2850 await testConvertPixelFormat( 2851 done, 2852 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_1900", 2853 RGB_565, 2854 YCBCR_P010 2855 ); 2856 } 2857 }); 2858 2859 /** 2860 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2000 2861 * @tc.name : test convert pixelformat RGBA_8888 to YCBCR_P010 2862 * @tc.desc : 1.create YCBCR_P010 pixelmap 2863 * 2.call convertPixelFormat(RGBA_8888) 2864 * 3.get pixelformat 2865 * @tc.size : MEDIUM 2866 * @tc.type : Functional 2867 * @tc.level : Level 0 2868 */ 2869 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2000', 2870 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2871 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2000') 2872 if (!isSupportHdr) { 2873 logger.log('device is not support hdr'); 2874 expect(true).assertTrue(); 2875 done(); 2876 } else { 2877 await testConvertPixelFormat( 2878 done, 2879 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2000", 2880 RGBA_8888, 2881 YCBCR_P010 2882 ); 2883 } 2884 }); 2885 2886 /** 2887 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2100 2888 * @tc.name : test convert pixelformat BGRA_8888 to YCBCR_P010 2889 * @tc.desc : 1.create YCBCR_P010 pixelmap 2890 * 2.call convertPixelFormat(BGRA_8888) 2891 * 3.get pixelformat 2892 * @tc.size : MEDIUM 2893 * @tc.type : Functional 2894 * @tc.level : Level 0 2895 */ 2896 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2100', 2897 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2898 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2100') 2899 if (!isSupportHdr) { 2900 logger.log('device is not support hdr'); 2901 expect(true).assertTrue(); 2902 done(); 2903 } else { 2904 await testConvertPixelFormat( 2905 done, 2906 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2100", 2907 BGRA_8888, 2908 YCBCR_P010 2909 ); 2910 } 2911 }); 2912 2913 /** 2914 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2200 2915 * @tc.name : test convert pixelformat RGB_888 to YCBCR_P010 2916 * @tc.desc : 1.create YCBCR_P010 pixelmap 2917 * 2.call convertPixelFormat(RGB_888) 2918 * 3.get pixelformat 2919 * @tc.size : MEDIUM 2920 * @tc.type : Functional 2921 * @tc.level : Level 0 2922 */ 2923 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2200', 2924 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2925 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2200') 2926 if (!isSupportHdr) { 2927 logger.log('device is not support hdr'); 2928 expect(true).assertTrue(); 2929 done(); 2930 } else { 2931 await testConvertPixelFormat( 2932 done, 2933 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2200", 2934 RGB_888, 2935 YCBCR_P010 2936 ); 2937 } 2938 }); 2939 2940 /** 2941 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2300 2942 * @tc.name : test convert pixelformat RGBA_F16 to YCBCR_P010 2943 * @tc.desc : 1.create YCBCR_P010 pixelmap 2944 * 2.call convertPixelFormat(RGBA_F16) 2945 * 3.get pixelformat 2946 * @tc.size : MEDIUM 2947 * @tc.type : Functional 2948 * @tc.level : Level 0 2949 */ 2950 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2300', 2951 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2952 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2300') 2953 if (!isSupportHdr) { 2954 logger.log('device is not support hdr'); 2955 expect(true).assertTrue(); 2956 done(); 2957 } else { 2958 await testConvertPixelFormat( 2959 done, 2960 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2300", 2961 RGBA_F16, 2962 YCBCR_P010 2963 ); 2964 } 2965 }); 2966 2967 /** 2968 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2400 2969 * @tc.name : test convert pixelformat RGB_565 to YCRCB_P010 2970 * @tc.desc : 1.create YCRCB_P010 pixelmap 2971 * 2.call convertPixelFormat(RGB_565) 2972 * 3.get pixelformat 2973 * @tc.size : MEDIUM 2974 * @tc.type : Functional 2975 * @tc.level : Level 0 2976 */ 2977 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2400', 2978 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 2979 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2400') 2980 if (!isSupportHdr) { 2981 logger.log('device is not support hdr'); 2982 expect(true).assertTrue(); 2983 done(); 2984 } else { 2985 await testConvertPixelFormat( 2986 done, 2987 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2400", 2988 RGB_565, 2989 YCRCB_P010 2990 ); 2991 } 2992 }); 2993 2994 /** 2995 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2500 2996 * @tc.name : test convert pixelformat RGBA_8888 to YCRCB_P010 2997 * @tc.desc : 1.create YCRCB_P010 pixelmap 2998 * 2.call convertPixelFormat(RGBA_8888) 2999 * 3.get pixelformat 3000 * @tc.size : MEDIUM 3001 * @tc.type : Functional 3002 * @tc.level : Level 0 3003 */ 3004 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2500', 3005 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3006 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2500') 3007 if (!isSupportHdr) { 3008 logger.log('device is not support hdr'); 3009 expect(true).assertTrue(); 3010 done(); 3011 } else { 3012 await testConvertPixelFormat( 3013 done, 3014 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2500", 3015 RGBA_8888, 3016 YCRCB_P010 3017 ); 3018 } 3019 }); 3020 3021 /** 3022 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2600 3023 * @tc.name : test convert pixelformat BGRA_8888 to YCRCB_P010 3024 * @tc.desc : 1.create YCRCB_P010 pixelmap 3025 * 2.call convertPixelFormat(BGRA_8888) 3026 * 3.get pixelformat 3027 * @tc.size : MEDIUM 3028 * @tc.type : Functional 3029 * @tc.level : Level 0 3030 */ 3031 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2600', 3032 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3033 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2600') 3034 if (!isSupportHdr) { 3035 logger.log('device is not support hdr'); 3036 expect(true).assertTrue(); 3037 done(); 3038 } else { 3039 await testConvertPixelFormat( 3040 done, 3041 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2600", 3042 BGRA_8888, 3043 YCRCB_P010 3044 ); 3045 } 3046 }); 3047 3048 /** 3049 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2700 3050 * @tc.name : test convert pixelformat RGB_888 to YCRCB_P010 3051 * @tc.desc : 1.create YCRCB_P010 pixelmap 3052 * 2.call convertPixelFormat(RGB_888) 3053 * 3.get pixelformat 3054 * @tc.size : MEDIUM 3055 * @tc.type : Functional 3056 * @tc.level : Level 0 3057 */ 3058 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2700', 3059 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3060 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2700') 3061 if (!isSupportHdr) { 3062 logger.log('device is not support hdr'); 3063 expect(true).assertTrue(); 3064 done(); 3065 } else { 3066 await testConvertPixelFormat( 3067 done, 3068 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2700", 3069 RGB_888, 3070 YCRCB_P010 3071 ); 3072 } 3073 }); 3074 3075 /** 3076 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2800 3077 * @tc.name : test convert pixelformat RGBA_F16 to YCRCB_P010 3078 * @tc.desc : 1.create YCRCB_P010 pixelmap 3079 * 2.call convertPixelFormat(RGBA_F16) 3080 * 3.get pixelformat 3081 * @tc.size : MEDIUM 3082 * @tc.type : Functional 3083 * @tc.level : Level 0 3084 */ 3085 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2800', 3086 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3087 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2800') 3088 if (!isSupportHdr) { 3089 logger.log('device is not support hdr'); 3090 expect(true).assertTrue(); 3091 done(); 3092 } else { 3093 await testConvertPixelFormat( 3094 done, 3095 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_FUNC_2800", 3096 RGBA_F16, 3097 YCRCB_P010 3098 ); 3099 } 3100 }); 3101 3102 /** 3103 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0100 3104 * @tc.name : test convert pixelformat RGBA_1010102 to RGB_565 3105 * @tc.desc : 1.create RGBA_1010102 pixelmap 3106 * 2.call convertPixelFormat(RGB_565) 3107 * 3.check error code 3108 * @tc.size : MEDIUM 3109 * @tc.type : Functional 3110 * @tc.level : Level 0 3111 */ 3112 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0100', 3113 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3114 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0100') 3115 if (!isSupportHdr) { 3116 logger.log('device is not support hdr'); 3117 expect(true).assertTrue(); 3118 done(); 3119 } else { 3120 await testConvertPixelFormatErr( 3121 done, 3122 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0100", 3123 RGBA_1010102, 3124 RGB_565 3125 ); 3126 } 3127 }); 3128 /** 3129 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0200 3130 * @tc.name : test convert pixelformat RGBA_1010102 to RGBA_8888 3131 * @tc.desc : 1.create RGBA_1010102 pixelmap 3132 * 2.call convertPixelFormat(RGBA_8888) 3133 * 3.check error code 3134 * @tc.size : MEDIUM 3135 * @tc.type : Functional 3136 * @tc.level : Level 0 3137 */ 3138 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0200', 3139 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3140 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0200') 3141 if (!isSupportHdr) { 3142 logger.log('device is not support hdr'); 3143 expect(true).assertTrue(); 3144 done(); 3145 } else { 3146 await testConvertPixelFormatErr( 3147 done, 3148 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0200", 3149 RGBA_1010102, 3150 RGBA_8888 3151 ); 3152 } 3153 }); 3154 /** 3155 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0300 3156 * @tc.name : test convert pixelformat RGBA_1010102 to BGRA_8888 3157 * @tc.desc : 1.create RGBA_1010102 pixelmap 3158 * 2.call convertPixelFormat(BGRA_8888) 3159 * 3.check error code 3160 * @tc.size : MEDIUM 3161 * @tc.type : Functional 3162 * @tc.level : Level 0 3163 */ 3164 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0300', 3165 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3166 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0300') 3167 if (!isSupportHdr) { 3168 logger.log('device is not support hdr'); 3169 expect(true).assertTrue(); 3170 done(); 3171 } else { 3172 await testConvertPixelFormatErr( 3173 done, 3174 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0300", 3175 RGBA_1010102, 3176 BGRA_8888 3177 ); 3178 } 3179 }); 3180 /** 3181 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0400 3182 * @tc.name : test convert pixelformat RGBA_1010102 to RGB_888 3183 * @tc.desc : 1.create RGBA_1010102 pixelmap 3184 * 2.call convertPixelFormat(RGB_888) 3185 * 3.check error code 3186 * @tc.size : MEDIUM 3187 * @tc.type : Functional 3188 * @tc.level : Level 0 3189 */ 3190 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0400', 3191 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3192 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0400') 3193 if (!isSupportHdr) { 3194 logger.log('device is not support hdr'); 3195 expect(true).assertTrue(); 3196 done(); 3197 } else { 3198 await testConvertPixelFormatErr( 3199 done, 3200 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0400", 3201 RGBA_1010102, 3202 RGB_888 3203 ); 3204 } 3205 }); 3206 /** 3207 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0500 3208 * @tc.name : test convert pixelformat RGBA_1010102 to RGBA_F16 3209 * @tc.desc : 1.create RGBA_1010102 pixelmap 3210 * 2.call convertPixelFormat(RGBA_F16) 3211 * 3.check error code 3212 * @tc.size : MEDIUM 3213 * @tc.type : Functional 3214 * @tc.level : Level 0 3215 */ 3216 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0500', 3217 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3218 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0500') 3219 if (!isSupportHdr) { 3220 logger.log('device is not support hdr'); 3221 expect(true).assertTrue(); 3222 done(); 3223 } else { 3224 await testConvertPixelFormatErr( 3225 done, 3226 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0500", 3227 RGBA_1010102, 3228 RGBA_F16 3229 ); 3230 } 3231 }); 3232 /** 3233 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0600 3234 * @tc.name : test convert pixelformat YCBCR_P010 to NV21 3235 * @tc.desc : 1.create YCBCR_P010 pixelmap 3236 * 2.call convertPixelFormat(NV21) 3237 * 3.check error code 3238 * @tc.size : MEDIUM 3239 * @tc.type : Functional 3240 * @tc.level : Level 0 3241 */ 3242 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0600', 3243 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3244 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0600') 3245 if (!isSupportHdr) { 3246 logger.log('device is not support hdr'); 3247 expect(true).assertTrue(); 3248 done(); 3249 } else { 3250 await testConvertPixelFormatErr( 3251 done, 3252 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0600", 3253 YCBCR_P010, 3254 NV21 3255 ); 3256 } 3257 }); 3258 /** 3259 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0700 3260 * @tc.name : test convert pixelformat YCBCR_P010 to NV12 3261 * @tc.desc : 1.create YCBCR_P010 pixelmap 3262 * 2.call convertPixelFormat(NV12) 3263 * 3.check error code 3264 * @tc.size : MEDIUM 3265 * @tc.type : Functional 3266 * @tc.level : Level 0 3267 */ 3268 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0700', 3269 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3270 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0700') 3271 if (!isSupportHdr) { 3272 logger.log('device is not support hdr'); 3273 expect(true).assertTrue(); 3274 done(); 3275 } else { 3276 await testConvertPixelFormatErr( 3277 done, 3278 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0700", 3279 YCBCR_P010, 3280 NV12 3281 ); 3282 } 3283 }); 3284 /** 3285 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0800 3286 * @tc.name : test convert pixelformat YCRCB_P010 to NV21 3287 * @tc.desc : 1.create YCRCB_P010 pixelmap 3288 * 2.call convertPixelFormat(NV21) 3289 * 3.check error code 3290 * @tc.size : MEDIUM 3291 * @tc.type : Functional 3292 * @tc.level : Level 0 3293 */ 3294 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0800', 3295 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3296 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0800') 3297 if (!isSupportHdr) { 3298 logger.log('device is not support hdr'); 3299 expect(true).assertTrue(); 3300 done(); 3301 } else { 3302 await testConvertPixelFormatErr( 3303 done, 3304 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0800", 3305 YCRCB_P010, 3306 NV21 3307 ); 3308 } 3309 }); 3310 /** 3311 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0900 3312 * @tc.name : test convert pixelformat YCRCB_P010 to NV12 3313 * @tc.desc : 1.create YCRCB_P010 pixelmap 3314 * 2.call convertPixelFormat(NV12) 3315 * 3.check error code 3316 * @tc.size : MEDIUM 3317 * @tc.type : Functional 3318 * @tc.level : Level 0 3319 */ 3320 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0900', 3321 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3322 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0900') 3323 if (!isSupportHdr) { 3324 logger.log('device is not support hdr'); 3325 expect(true).assertTrue(); 3326 done(); 3327 } else { 3328 await testConvertPixelFormatErr( 3329 done, 3330 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_0900", 3331 YCRCB_P010, 3332 NV12 3333 ); 3334 } 3335 }); 3336 /** 3337 * @tc.number : SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_1000 3338 * @tc.name : test convert pixelformat YCRCB_P010 to YCBCR_P010 3339 * @tc.desc : 1.create YCRCB_P010 pixelmap 3340 * 2.call convertPixelFormat(YCBCR_P010) 3341 * 3.check error code 3342 * @tc.size : MEDIUM 3343 * @tc.type : Functional 3344 * @tc.level : Level 0 3345 */ 3346 it('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_1000', 3347 TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { 3348 let logger = loger('SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_1000') 3349 if (!isSupportHdr) { 3350 logger.log('device is not support hdr'); 3351 expect(true).assertTrue(); 3352 done(); 3353 } else { 3354 await testConvertPixelFormatErr( 3355 done, 3356 "SUB_MULTIMEDIA_IMAGE_PIXELMAP_CONVERTPIXELFORMAT_ERROR_1000", 3357 YCRCB_P010, 3358 YCBCR_P010 3359 ); 3360 } 3361 }); 3362 }) 3363}