提交 04caf089 编写于 作者: J JH C

<iamageXTS工程整改>

Signed-off-by: NJH C <chenjiahuan@huawei.com>
上级 f0e73a66
...@@ -19,7 +19,9 @@ group("multimedia") { ...@@ -19,7 +19,9 @@ group("multimedia") {
deps = [ deps = [
"audio/audio_js_standard/audioManager:audio_manager_js_hap", "audio/audio_js_standard/audioManager:audio_manager_js_hap",
"camera/camera_js_standard:camera_standard_ets_hap", "camera/camera_js_standard:camera_standard_ets_hap",
"image/image_js_standard:image_js_hap", "image/image_js_standard/image:image_js_hap",
"image/image_js_standard/imageDecodeOptions:image_DecodeOptions_js_hap",
"image/image_js_standard/imageExif:image_exif_js_hap",
"media/media_js_standard/audioCodecFormat:audio_codec_format_js_hap", "media/media_js_standard/audioCodecFormat:audio_codec_format_js_hap",
"media/media_js_standard/audioDecoder:audio_decoder_js_hap", "media/media_js_standard/audioDecoder:audio_decoder_js_hap",
"media/media_js_standard/audioEncoder:audio_encoder_js_hap", "media/media_js_standard/audioEncoder:audio_encoder_js_hap",
......
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1500000",
"package": "ohos.acts.multimedia.image",
"shell-timeout": "120000"
},
"kits": [
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./resource/image/test.tiff ->/storage/media/100/local/files",
"./resource/image/test.123 ->/storage/media/100/local/files",
"./resource/image/test.bmp ->/storage/media/100/local/files",
"./resource/image/test.png ->/storage/media/100/local/files",
"./resource/image/test.gif ->/storage/media/100/local/files",
"./resource/image/test.jpg ->/storage/media/100/local/files",
"./resource/image/test_exif.jpg ->/storage/media/100/local/files",
"./resource/image/moving_test.gif ->/storage/media/100/local/files"
]
},
{
"type": "ShellKit",
"run-command": [
"mkdir /storage/media/100/local/files/cjh",
"cp /storage/media/100/local/files/test.tiff /storage/media/100/local/files/cjh/",
"cp /storage/media/100/local/files/test.123 /storage/media/100/local/files/cjh/",
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/cjh/",
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/cjh/",
"cp /storage/media/100/local/files/test.gif /storage/media/100/local/files/cjh/",
"cp /storage/media/100/local/files/test.jpg /storage/media/100/local/files/cjh/",
"cp /storage/media/100/local/files/test_exif.jpg /storage/media/100/local/files/cjh/",
"cp /storage/media/100/local/files/moving_test.gif /storage/media/100/local/files/cjh/",
"chmod -R 666 /data/media/*",
"chmod -R 666 /storage/media/100/local/files/cjh/*",
"killall com.ohos.medialibrary.MediaScannerAbilityA",
"aa start -a MediaScannerAbility -b com.ohos.medialibrary.MediaScannerAbilityA"
],
"teardown-command":[
]
},
{
"test-file-name": [
"ActsImageJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "ohos.acts.multimedia.image",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImageJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"mkdir /data/app/el2/100/base/ohos.acts.multimedia.image/files",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image/files"
]
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./resource/image/test.bmp ->/data/app/el2/100/base/ohos.acts.multimedia.image/files",
"./resource/image/test.png ->/data/app/el2/100/base/ohos.acts.multimedia.image/files",
"./resource/image/test.123 ->/data/app/el2/100/base/ohos.acts.multimedia.image/files",
"./resource/image/test.gif ->/data/app/el2/100/base/ohos.acts.multimedia.image/files",
"./resource/image/test.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image/files",
"./resource/image/moving_test.gif ->/data/app/el2/100/base/ohos.acts.multimedia.image/files"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image/files/test.bmp",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image/files/test.png",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image/files/test.123",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image/files/test.gif",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image/files/test.jpg",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image/files/moving_test.gif"
],
"teardown-command":[
]
}
]
}
{ {
"app": { "app": {
"apiVersion": { "apiVersion": {
"compatible": 6, "compatible": 6,
"releaseType": "Beta1", "releaseType": "Beta1",
"target": 7 "target": 7
}, },
"vendor": "acts", "vendor": "acts",
"bundleName": "ohos.acts.multimedia.image", "bundleName": "ohos.acts.multimedia.image",
"version": { "version": {
"code": 1000000, "code": 1000000,
"name": "1.0.0" "name": "1.0.0"
} }
}, },
"deviceConfig": { "deviceConfig": {
"default": { "default": {
"debug": true "debug": true
} }
}, },
"module": { "module": {
"abilities": [ "abilities": [
{ {
"iconId": 16777218, "iconId": 16777218,
"skills": [ "skills": [
{ {
"entities": [ "entities": [
"entity.system.home" "entity.system.home"
], ],
"actions": [ "actions": [
"action.system.home" "action.system.home"
] ]
} }
], ],
"descriptionId": 16777217, "descriptionId": 16777217,
"visible": true, "visible": true,
"labelId": 16777216, "labelId": 16777216,
"icon": "$media:icon", "icon": "$media:icon",
"name": "ohos.acts.multimedia.image.MainAbility", "name": "ohos.acts.multimedia.image.MainAbility",
"description": "$string:mainability_description", "description": "$string:mainability_description",
"label": "$string:entry_MainAbility", "label": "$string:entry_MainAbility",
"type": "page", "type": "page",
"homeAbility": true, "homeAbility": true,
"launchType": "standard" "launchType": "standard"
} }
], ],
"deviceType": [ "deviceType": [
"phone", "phone",
"tablet", "tablet",
"tv", "tv",
"wearable" "wearable"
], ],
"mainAbility": "ohos.acts.multimedia.image.MainAbility", "mainAbility": "ohos.acts.multimedia.image.MainAbility",
"distro": { "distro": {
"moduleType": "entry", "moduleType": "entry",
"installationFree": false, "installationFree": false,
"deliveryWithInstall": true, "deliveryWithInstall": true,
"moduleName": "entry" "moduleName": "entry"
}, },
"reqPermissions": [ "reqPermissions": [
{ {
"name": "ohos.permission.GET_BUNDLE_INFO", "name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO" "reason": "use ohos.permission.GET_BUNDLE_INFO"
}, },
{ {
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" "reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
}, },
{ {
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
}, },
{ {
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
}, },
{ {
"name": "ohos.permission.MEDIA_LOCATION", "name": "ohos.permission.MEDIA_LOCATION",
"reason":"use ohos.permission.MEDIA_LOCATION" "reason":"use ohos.permission.MEDIA_LOCATION"
}, },
{ {
"name": "ohos.permission.READ_MEDIA", "name": "ohos.permission.READ_MEDIA",
"reason":"use ohos.permission.READ_MEDIA" "reason":"use ohos.permission.READ_MEDIA"
}, },
{ {
"name": "ohos.permission.WRITE_MEDIA", "name": "ohos.permission.WRITE_MEDIA",
"reason":"use ohos.permission.WRITE_MEDIA" "reason":"use ohos.permission.WRITE_MEDIA"
} }
], ],
"package": "ohos.acts.multimedia.image", "package": "ohos.acts.multimedia.image",
"name": ".MyApplication", "name": ".MyApplication",
"js": [ "js": [
{ {
"pages": [ "pages": [
"pages/index/index" "pages/index/index"
], ],
"name": "default", "name": "default",
"window": { "window": {
"designWidth": 720, "designWidth": 720,
"autoDesignWidth": true "autoDesignWidth": true
} }
} }
] ]
} }
} }
\ No newline at end of file
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
export default { export default {
onCreate() { onCreate() {
console.info('AceApplication onCreate'); console.info('AceApplication onCreate');
}, },
onDestroy() { onDestroy() {
console.info('AceApplication onDestroy'); console.info('AceApplication onDestroy');
} }
}; };
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
require('./image.test.js') require('./image.test.js')
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import image from '@ohos.multimedia.image'
import fileio from '@ohos.fileio'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import {testPng, testJpg} from './testImg'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle'
describe('Image', function () {
var pathJpg = '/data/storage/el2/base/files/test.jpg';
var pathBmp = '/data/storage/el2/base/files/test.bmp';
var pathGif = '/data/storage/el2/base/files/test.gif';
var pathPng = '/data/storage/el2/base/files/test.png';
var pathMovingGif = '/data/storage/el2/base/files/moving_test.gif';
beforeAll(async function () {
await applyPermission();
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(async function () {
console.info('afterEach case');
})
afterAll(async function () {
console.info('afterAll case');
})
async function applyPermission(){
let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.image',0,100);
let atManager = abilityAccessCtrl.createAtManager();
if(atManager != null){
let tokenID = appInfo.accessTokenId;
console.info('[permission]case accessTokenId is' + tokenID);
let permissionName1 = 'ohos.permission.MEDIA_LOCATION';
let permissionName2 = 'ohos.permission.READ_MEDIA';
let permissionName3 = 'ohos.permission.WRITE_MEDIA';
await atManager.grantUserGrantedPermission(tokenID,permissionName1).then((result)=>{
console.info('[permission]case grantUserGrantedPermission success:' + result);
}).catch((err)=>{
console.info('[permission]case grantUserGrantedPermission failed:' + err);
});
await atManager.grantUserGrantedPermission(tokenID,permissionName2).then((result)=>{
console.info('[permission]case grantUserGrantedPermission success:' + result);
}).catch((err)=>{
console.info('[permission]case grantUserGrantedPermission failed:' + err);
});
await atManager.grantUserGrantedPermission(tokenID,permissionName3).then((result)=>{
console.info('[permission]case grantUserGrantedPermission success:' + result);
}).catch((err)=>{
console.info('[permission]case grantUserGrantedPermission failed:' + err);
});
}else{
console.info('[permission]case apply permission failed,createAtManager failed');
}
}
/**
* @tc.number : TC_041
* @tc.name : createImageSource(uri)-jpg
* @tc.desc : 1.set uri
* 2.call createImageSource(uri)
* 3.return imagesource
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_041', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
expect(imageSourceApi != undefined).assertTrue();
console.info('TC_041 success');
fileio.closeSync(fdNumber);
done();
}catch(error){
console.info('TC_041 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_041-1
* @tc.name : createImageSource(uri)-bmp
* @tc.desc : 1.seturi
* 2.call createImageSource(uri)
* 3.return imagesource
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_041-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
expect(imageSourceApi != undefined).assertTrue();
console.info('TC_041-1 success');
done();
}catch(error){
console.info('TC_041-1 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_041-2
* @tc.name : createImageSource(uri)-gif
* @tc.desc : 1.seturi
* 2.call createImageSource(uri)
* 3.return imagesource
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_041-2', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
expect(imageSourceApi != undefined).assertTrue();
console.info('TC_041-2 success');
done();
}catch(error){
console.info('TC_041-2 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_041-3
* @tc.name : createImageSource(uri)-png
* @tc.desc : 1.seturi
* 2.call createImageSource(uri)
* 3.return imagesource
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_041-3', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
expect(imageSourceApi != undefined).assertTrue();
console.info('TC_041-3 success');
done();
}catch(error){
console.info('TC_041-3 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_041-4
* @tc.name : createImageSource(uri)-wrong suffix file
* @tc.desc : 1.call createImageSource(uri)
* 2.Incoming wrong suffix file
* 3.imagesource null
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_041-4', 0, async function (done) {
const imageSourceApi = image.createImageSource('file:///data/local/tmp/test.123');
expect(imageSourceApi == undefined).assertTrue();
console.info('TC_041-4 success');
done();
})
/**
* @tc.number : TC_041-5
* @tc.name : createImageSource(uri)-wrong uri
* @tc.desc : 1.call createImageSource(uri)
* 2.set wrong uri
* 3.return null
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_041-5', 0, async function (done) {
try{
const imageSourceApi = image.createImageSource('file:///multimedia/test.jpg');
expect(imageSourceApi == undefined).assertTrue();
console.info('TC_041-5 success');
done();
}catch(error){
console.info('TC_041-5 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_042
* @tc.name : createImageSource(fd)
* @tc.desc : 1.call createImageSource
* 2.set fd
* 3.return imagesource
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_042', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_042 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo((err,imageInfo) => {
if (err){
expect(false).assertTrue();
console.info('TC_042 err: ' + err);
done();
return
}
if (imageInfo != undefined){
expect(true).assertTrue();
fileio.closeSync(fdNumber);
done();
}else{
console.info('TC_042 failed');
expect(false).assertTrue();
done();
}
})
}
}catch(error){
console.info('TC_042 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_042-1
* @tc.name : createImageSource(fd) fd<0
* @tc.desc : 1.call createImageSource
* 2.set wrong fd
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_042-1', 0, async function (done) {
const imageSourceApi = image.createImageSource(-2);
expect(imageSourceApi == undefined).assertTrue();
console.info('TC_042-1 success');
done();
})
/**
* @tc.number : TC_043
* @tc.name : createImageSource(data)
* @tc.desc : 1.setdata
* 2.createImageSource
* 3.return imagesource
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_043', 0, async function (done) {
const data = testJpg.buffer;
const imageSourceApi = image.createImageSource(data);
if (imageSourceApi == undefined) {
console.info('TC_043 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo((err,imageInfo) => {
console.info('TC_043 imageInfo');
expect(imageInfo != undefined).assertTrue();
done();
})
}
})
/**
* @tc.number : TC_043-1
* @tc.name : createImageSource(data) buffer:0
* @tc.desc : 1.setdata
* 2.createImageSource
* 3.return imagesource
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_043-1', 0, async function (done) {
const data = new ArrayBuffer(0);
const imageSourceApi = image.createImageSource(data);
expect(imageSourceApi == undefined).assertTrue();
console.info('TC_043-1 success');
done();
})
/**
* @tc.number : TC_044
* @tc.name : release-imagesource-promise-jpg
* @tc.desc : 1.create ImageSource
* 2.call release()
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_044', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_044 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release().then(()=>{
console.info('TC_044 success');
expect(true).assertTrue();
done();
}).catch(error => {
console.info('TC_044 error');
expect(false).assertTrue();
done();
})
}
}catch(error){
console.info('TC_044 err:' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_044-1
* @tc.name : release-imagesource-callback-jpg
* @tc.desc : 1.create ImageSource
* 2.call release()
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_044-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_044-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release(() => {
console.info('TC_044-1 Success');
expect(true).assertTrue();
done();
})
}
}catch(error){
console.info('TC_044-1 err:' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_045
* @tc.name : getImageInfo(callback: AsyncCallback<ImageInfo>)-jpg
* @tc.desc : 1.create imageSource
* 2.imageSourcecall getImageInfo(ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_045', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_045 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo((err,imageInfo) => {
if(err){
expect(false).assertTrue();
console.info('TC_045 err:' + err);
done();
return
}
if (imageInfo != undefined){
console.info('TC_045 imageInfo.size.height:'+imageInfo.size.height);
console.info('TC_045 imageInfo.size.width:'+imageInfo.size.width);
expect(true).assertTrue();
fileio.closeSync(fdNumber);
done();
}else{
console.info('TC_045 failed');
expect(false).assertTrue();
done();
}
})
}
}catch(error){
console.info('TC_045 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_045-1
* @tc.name : getImageInfo(callback: AsyncCallback<ImageInfo>)-bmp
* @tc.desc : 1.create imageSource
* 2.imageSourcecall getImageInfo(ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_045-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_045-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo((err,imageInfo) => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_045-1 imageInfo.size.height:'+imageInfo.size.height);
console.info('TC_045-1 imageInfo.size.width:'+imageInfo.size.width);
done();
})
}
}catch(error){
console.info('TC_045-1 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_045-2
* @tc.name : getImageInfo(callback: AsyncCallback<ImageInfo>)-png
* @tc.desc : 1.create imageSource
* 2.imageSourcecall getImageInfo(ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_045-2', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_045-2 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo((err,imageInfo) => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_045-2 imageInfo.size.height:'+imageInfo.size.height);
console.info('TC_045-2 imageInfo.size.width:'+imageInfo.size.width);
done();
})
}
}catch(error){
console.info('TC_045-2 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_045-3
* @tc.name : getImageInfo(callback: AsyncCallback<ImageInfo>)-gif
* @tc.desc : 1.create ImageInfo
* 2.call getImageInfo(index, ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_045-3', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_045-3 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo((err,imageInfo) => {
if (err){
expect(false).assertTrue();
console.info('TC_045-3 error' + err);
done();
return
}
if (imageInfo != undefined && imageInfo != null){
expect(true).assertTrue();
console.info('TC_045-3 imageInfo.size.height:' + imageInfo.size.height);
console.info('TC_045-3 imageInfo.size.width:'+imageInfo.size.width);
console.info('TC_045-3 success')
done();
}else{
expect(false).assertTrue();
console.info('TC_045-3 failed')
done();
}
})
}
}catch(error){
console.info('TC_045-3 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_046
* @tc.name : getImageInfo(index: number, callback: AsyncCallback<ImageInfo>)-jpg
* @tc.desc : 1.create ImageInfo
* 2.call getImageInfo(index, ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_046', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_046 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0, (err, imageInfo) => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_046 imageInfo.size.height:'+imageInfo.size.height);
console.info('TC_046 imageInfo.size.width:'+imageInfo.size.width);
done();
})
}
}catch(error){
console.info('TC_046 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_046-1
* @tc.name : getImageInfo(index: number, callback: AsyncCallback<ImageInfo>)-bmp
* @tc.desc : 1.create ImageInfo
* 2.call getImageInfo(index, ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_046-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_046-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0, (err, imageInfo) => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_046-1 imageInfo.size.height:'+imageInfo.size.height);
console.info('TC_046-1 imageInfo.size.width:'+imageInfo.size.width);
done();
})
}
}catch(error){
console.info('TC_046-1 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number: TC_046-2
* @tc.name : getImageInfo(index: number, callback: AsyncCallback<ImageInfo>)-png
* @tc.desc : 1.create ImageInfo
* 2.call getImageInfo(index, ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_046-2', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_046-2 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0, (err, imageInfo) => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_046-2 imageInfo.size.height:'+imageInfo.size.height);
console.info('TC_046-2 imageInfo.size.width:'+imageInfo.size.width);
done();
})
}
}catch{
console.info('TC_046-2 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number: TC_046-3
* @tc.name : getImageInfo(index: number, callback: AsyncCallback<ImageInfo>)-gif
* @tc.desc : 1.create ImageInfo
* 2.call getImageInfo(index, ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_046-3', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_046-3 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0,(err, imageInfo) => {
if (err){
expect(false).assertTrue();
console.info('TC_046-3 error' + err);
done();
return
}
if (imageInfo != undefined && imageInfo != null){
expect(true).assertTrue();
console.info('TC_046-3 imageInfo.size.height:' + imageInfo.size.height);
console.info('TC_046-3 imageInfo.size.width:'+imageInfo.size.width);
console.info('TC_046-3 success')
done();
}else{
expect(false).assertTrue();
console.info('TC_046-3 failed')
done();
}
})
}
}catch(error){
console.info('TC_046-3 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number: TC_046-4
* @tc.name : getImageInfo(index: number, callback: AsyncCallback<ImageInfo>)-gif(frame:1)-index:1
* @tc.desc : 1.create ImageInfo
* 2.call getImageInfo(index, ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_046-4', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_046-4 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(1, (err, imageInfo) => {
if(imageInfo == undefined) {
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
done();
}
})
}
}catch(error){
console.info('TC_046-4 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number: TC_046-5
* @tc.name : getImageInfo(index: number, callback: AsyncCallback<ImageInfo>)-gif-index:-1
* @tc.desc : 1.create ImageInfo
* 2.call getImageInfo(index, ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_046-5', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_046-5 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(-1, (err, imageInfo) => {
expect(imageInfo == undefined).assertTrue();
done();
})
}
}catch(error){
console.info('TC_046-5 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_047
* @tc.name : getImageInfo(index?: number): Promise<ImageInfo>-jpg
* @tc.desc : 1.create imagesource
* 2.call getImageInfo(index)
* 3.callbackcall ,return imageinfo
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_047', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_047 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0)
.then(imageInfo => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_047 imageInfo');
console.info('imageInfo.size.height:'+imageInfo.size.height);
console.info('imageInfo.size.width:'+imageInfo.size.width);
done();
}).catch(error => {
console.log('TC_047 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_047 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_047-1
* @tc.name : getImageInfo(index?: number): Promise<ImageInfo>-bmp
* @tc.desc : 1.create imagesource
* 2.call getImageInfo(index)
* 3.callbackcall ,return imageinfo
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_047-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_047-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0)
.then(imageInfo => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_047-1 imageInfo');
console.info('imageInfo.size.height:'+imageInfo.size.height);
console.info('imageInfo.size.width:'+imageInfo.size.width);
done();
}).catch(error => {
console.log('TC_047-1 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_047-1 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_047-2
* @tc.name : getImageInfo(index?: number): Promise<ImageInfo>-png
* @tc.desc : 1.create imagesource
* 2.call getImageInfo(index)
* 3.callbackcall ,return imageinfo
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_047-2', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_047-2 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0)
.then(imageInfo => {
expect(imageInfo != undefined).assertTrue();
console.info('TC_047-2 imageInfo');
console.info('imageInfo.size.height:'+imageInfo.size.height);
console.info('imageInfo.size.width:'+imageInfo.size.width);
done();
}).catch(error => {
console.log('TC_047-2 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_047-2 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_047-3
* @tc.name : getImageInfo(index?: number): Promise<ImageInfo>-gif
* @tc.desc : 1.create imagesource
* 2.call getImageInfo(index)
* 3.callbackcall ,return imageinfo
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_047-3', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_047-3 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(0)
.then(imageInfo => {
if (imageInfo != undefined && imageInfo != null){
expect(true).assertTrue();
console.info('TC_047-3 imageInfo.size.height:'+imageInfo.size.height);
console.info('TC_047-3 imageInfo.size.width:'+imageInfo.size.width);
done();
}else{
expect(false).assertTrue();
console.info('TC_047-3 failed');
done();
}
}).catch(error => {
console.log('TC_047-3 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_047-3 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number: TC_047-4
* @tc.name : getImageInfo(index?: number): Promise<ImageInfo>-gif(frame:1)-index:1
* @tc.desc : 1.create imagesource
* 2.call getImageInfo(index=1)
* 3.callback return imageinfo undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_047-4', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_047-4 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(1)
.then(() => {
console.log('TC_047-4 failed');
expect().assertFail();
done();
}).catch(error => {
console.log('TC_047-4 success');
expect(true).assertTrue();
done();
})
}
}catch(error){
console.info('TC_047-4 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_047-5
* @tc.name : getImageInfo(index?: number): Promise<ImageInfo>-gif-index:-1
* @tc.desc : 1.create imagesource
* 2.call getImageInfo(index=-1)
* 3.callback return imageinfo undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_047-5', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_047-5 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageInfo(-1)
.then(() => {
console.log('TC_047-5 failed');
expect().assertFail();
done();
}).catch(error => {
console.log('TC_047-5 success');
expect(true).assertTrue();
done();
})
}
}catch(error){
console.info('TC_047-5 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_050-14
* @tc.name : createPixelMap-promise-jpg
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_050-14', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_050-14 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap().then(pixelmap => {
console.info('TC_050-14 success ');
expect(pixelmap != undefined ).assertTrue();
done();
}).catch(error => {
console.log('TC_050-14 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_050-14 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_050-15
* @tc.name : createPixelMap-callback-jpg
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_050-15', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_050-15 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap((err, pixelmap) => {
console.info('TC_050-15 success ');
expect(pixelmap != undefined ).assertTrue();
done();
})
}
}catch(error){
console.info('TC_050-15 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_053
* @tc.name : createIncrementalSource-updateData-png
* @tc.desc : 1.create imagesource
* 2.update data
* 3.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_053', 0, async function (done) {
try {
let testimagebuffer = testPng;
console.info('TC_053 0003 ' + testimagebuffer.length);
let bufferSize = testimagebuffer.length;
let offset = 0;
const incSouce = image.createIncrementalSource(new ArrayBuffer(1));
let ret;
let isFinished = false;
while (offset < testimagebuffer.length) {
console.info('TC_053 0006 ' + testimagebuffer.length);
var oneStep = testimagebuffer.slice(offset, offset + bufferSize);
console.info('TC_053 0007 ' + oneStep.length);
if (oneStep.length < bufferSize) {
isFinished = true;
}
ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length);
if (!ret) {
console.info('TC_053 updateData failed');
expect(ret).assertTrue();
break;
}
offset = offset + oneStep.length;
console.info('TC_053 0011 ' + offset);
}
if (ret) {
console.info('TC_053 updateData success ');
let decodingOptions = {
sampleSize:1
};
incSouce.createPixelMap(decodingOptions, (err, pixelmap) => {
console.info('TC_053 0014' + pixelmap);
expect(pixelmap != undefined ).assertTrue();
done();
})
} else {
done();
}
} catch (error) {
console.info('TC_053 updateData failed ' + error);
}
})
/**
* @tc.number : TC_053-1
* @tc.name : createIncrementalSource-updateData-jpg
* @tc.desc : 1.create imagesource
* 2.update data
* 3.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_053-1', 0, async function (done) {
try {
let testimagebuffer = testJpg;
console.info('TC_053-1 0003 ' + testimagebuffer.length);
let bufferSize = testimagebuffer.length;
let offset = 0;
const incSouce = image.createIncrementalSource(new ArrayBuffer(1));
let isFinished = false;
let ret;
while (offset < testimagebuffer.length) {
console.info('TC_053-1 0006 ' + testimagebuffer.length);
var oneStep = testimagebuffer.slice(offset, offset + bufferSize);
console.info('TC_053-1 0007 ' + oneStep.length);
if (oneStep.length < bufferSize) {
isFinished = true;
}
ret = await incSouce.updateData(oneStep, isFinished, 0, oneStep.length);
if (!ret) {
console.info('TC_053-1 updateData failed');
expect(ret).assertTrue();
break;
}
offset = offset + oneStep.length;
console.info('TC_053-1 0011 ' + offset);
}
if (ret) {
console.info('TC_053-1 updateData success ');
let decodingOptions = {
sampleSize:1
};
incSouce.createPixelMap(decodingOptions, (err, pixelmap) => {
expect(pixelmap != undefined ).assertTrue();
done();
})
} else {
done();
}
} catch (error) {
console.info('TC_053-1 updateData failed ' + error);
}
})
/**
* @tc.number : TC_064
* @tc.name : release ImageSource - promise - png
* @tc.desc : 1.create ImageSource
* 2.call release()
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_064', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_064 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release().then(()=>{
console.info('TC_064 success');
expect(true).assertTrue();
done();
}).catch(error => {
console.log('TC_064 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_064 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_064-1
* @tc.name : release ImageSource - callback - png
* @tc.desc : 1.create ImageSource
* 2.call release()
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_064-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_064-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release(async(err) => {
if (err){
console.info('TC_064-1 err:' + err);
expect(false).assertTrue();
done();
return
}
console.info('TC_064-1 Success');
expect(true).assertTrue();
expect(true).assertTrue();
done();
})
}
}catch(error){
console.info('TC_064-1 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_065
* @tc.name : release ImageSource - promise - bmp
* @tc.desc : 1.create ImageSource
* 2.call release()
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_065', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_065 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release().then(()=>{
console.info('TC_065 success');
expect(true).assertTrue();
done();
}).catch(error => {
console.log('TC_065 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_065 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_065-1
* @tc.name : release ImageSource - callback - bmp
* @tc.desc : 1.create ImageSource
* 2.create SourceStream
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_065-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_065-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release(async() => {
console.info('TC_065-1 Success');
expect(true).assertTrue();
done();
})
}
}catch(error){
console.info('TC_065-1 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_066
* @tc.name : release ImageSource - promise - gif
* @tc.desc : 1.create ImageSource
* 2.call release()
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_066', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_066 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release().then(()=>{
console.info('TC_066 success');
expect(true).assertTrue();
done();
}).catch(error => {
console.log('TC_066 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_066 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_066-1
* @tc.name : release ImageSource - callback - gif
* @tc.desc : 1.create ImageSource
* 2.call release()
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_066-1', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_066-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.release(() => {
console.info('TC_066-1 Success');
expect(true).assertTrue();
done();
})
}
}catch(error){
console.info('TC_066-1 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_067-14
* @tc.name : createPixelMap-promise-gif
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_067-14', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathMovingGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_067-14 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap().then(pixelmap => {
console.info('TC_067-14 success ');
expect(pixelmap !== undefined ).assertTrue();
done();
}).catch(error => {
console.log('TC_067-14 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_067-14 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_067-15
* @tc.name : createPixelMap-pcallback-gif
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_067-15', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathMovingGif);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_067-15 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap((err, pixelmap) => {
console.info('TC_067-15 success ');
expect(pixelmap !== undefined ).assertTrue();
done();
})
}
}catch(error){
console.info('TC_067-15 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_068-14
* @tc.name : createPixelMap-promise-bmp
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_068-14', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_068-14 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap().then(pixelmap => {
console.info('TC_068-14 success ');
expect(pixelmap != undefined ).assertTrue();
done();
}).catch(error => {
console.log('TC_068-14 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_068-14 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_068-15
* @tc.name : createPixelMap-callback-bmp
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_068-15', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathBmp);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_068-15 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap((err, pixelmap) => {
console.info('TC_068-15 success ');
expect(pixelmap != undefined ).assertTrue();
done();
})
}
}catch(error){
console.info('TC_068-15 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_163-14
* @tc.name : createPixelMap-promise-png
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_163-14', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_163-14 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap().then(pixelmap => {
console.info('TC_163-14 success');
expect(pixelmap != undefined ).assertTrue();
done();
}).catch(error => {
console.log('TC_163-14 error: ' + error);
expect().assertFail();
done();
})
}
}catch(error){
console.info('TC_163-14 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_163-15
* @tc.name : createPixelMap-callback-png
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_163-15', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathPng);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_163-15 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.createPixelMap((err, pixelmap) => {
console.info('TC_163-15 success');
expect(pixelmap != undefined ).assertTrue();
done();
})
}
}catch(error){
console.info('TC_163-15 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_164
* @tc.name : imagesource supportedFormats
* @tc.desc : 1.create imagesource
* 2.call supportedFormats
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_164', 0, async function (done) {
try{
let fdNumber = fileio.openSync(pathJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_164 create image source failed');
expect(false).assertTrue();
done();
} else {
expect(imageSourceApi.supportedFormats != undefined).assertTrue();
console.info(imageSourceApi.supportedFormats);
console.info('TC_164 success ');
done();
}
}catch(error){
console.info('TC_164 error: ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : TC_166
* @tc.name : imagepacker supportedFormats
* @tc.desc : 1.create imagepacker
* 2.call supportedFormats
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_166', 0, async function (done) {
const imagePackerApi = image.createImagePacker();
if (imagePackerApi == undefined) {
console.info('TC_166 create image packer failed');
expect(false).assertTrue();
done();
} else {
expect(imagePackerApi.supportedFormats != undefined).assertTrue();
console.info(imagePackerApi.supportedFormats);
console.info('TC_166 success ');
done();
}
})
/**
* @tc.number : TC_168
* @tc.name : isEditable
* @tc.desc : 1.create pixelmap
* 2.call isEditable
* 3.return true
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_168', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (error,pixelmap) => {
if(pixelmap == undefined){
console.info('TC_168 create pixelmap failed');
expect(false).assertTrue();
done();
}else {
expect(pixelmap.isEditable == true).assertTrue();
console.info('TC_168 success ');
done();
}
})
})
})
\ No newline at end of file
...@@ -13,88 +13,6 @@ ...@@ -13,88 +13,6 @@
* limitations under the License. * limitations under the License.
*/ */
let tc_020buf = new Uint8Array([0,0,0,4,0,0,0,8,1,0,0,12,1,1,1,16,1,1,1,20,2,2,2,24,3,3,3,28,4,4,4,32,5,5,5,36,6,6,6,40,7,7,7,44,9,9,8,48,10,10,10,52,12,12,12,56,14,14,13,60,16,16,15,64,18,18,17,68,20,20,19,72,22,22,22,76,25,24,24,80,27,27,27,84,30,30,29,88,33,32,32,92,36,35,35,96])
let tc_020_1buf = new Uint8Array([0,0,0,4,0,0,0,8,1,0,0,12,1,1,1,16,1,1,1,20,2,2,2,24,3,3,3,28,4,4,4,32,5,5,5,36,6,6,6,40,7,7,7,44,9,9,8,48,10,10,10,52,12,12,12,56,14,14,13,60,16,16,15,64,18,18,17,68,20,20,19,72,22,22,22,76,25,24,24,80,27,27,27,84,30,30,29,88,33,32,32,92,36,35,35,96])
let tc_021buf = new Uint8Array([0,0,0,4,0,0,0,8])
let tc_021_1buf = new Uint8Array([0,0,0,4,0,0,0,8])
let tc_022buf = new Uint8Array([0,0,0,4,0,0,0,8])
let testJpg = new Uint8Array([255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 96, 0, 96, 0, 0, 255, 219, 0, 67, 0, 2, 1, 1, 2, 1, 1, 2,
2, 2, 2, 2, 2, 2, 2, 3, 5, 3, 3, 3, 3, 3, 6, 4, 4, 3, 5, 7, 6, 7, 7, 7, 6, 7, 7, 8, 9, 11, 9, 8,
8, 10, 8, 7, 7, 10, 13, 10, 10, 11, 12, 12, 12, 12, 7, 9, 14, 15, 13, 12, 14, 11, 12, 12, 12, 255, 219, 0, 67, 1, 2, 2,
2, 3, 3, 3, 6, 3, 3, 6, 12, 8, 7, 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 255, 192,
0, 17, 8, 0, 226, 1, 216, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1, 255, 196, 0, 31, 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 255, 196, 0, 181, 16, 0, 2, 1, 3, 3, 2, 4, 3, 5,
5, 4, 4, 0, 0, 1, 125, 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35,
66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58,
67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122,
131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183,
184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241,
242, 243, 244, 245, 246, 247, 248, 249, 250, 255, 196, 0, 31, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 255, 196, 0, 181, 17, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119, 0,
1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21,
98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73,
74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136,
137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196,
197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249,
250, 255, 218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0, 253, 16, 162, 138, 43, 252, 99, 63, 170, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 15, 255, 217])
let testPng = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 100, 0, 0, 0, 100, 8, 6, 0, 0, 0, 112, 226, 149, let testPng = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 100, 0, 0, 0, 100, 8, 6, 0, 0, 0, 112, 226, 149,
84, 0, 0, 32, 0, 73, 68, 65, 84, 120, 1, 212, 193, 123, 176, 231, 247, 93, 223, 247, 231, 251, 253, 249, 254, 126, 231, 156, 61, 123, 191, 105, 84, 0, 0, 32, 0, 73, 68, 65, 84, 120, 1, 212, 193, 123, 176, 231, 247, 93, 223, 247, 231, 251, 253, 249, 254, 126, 231, 156, 61, 123, 191, 105,
37, 173, 180, 186, 95, 173, 187, 228, 43, 166, 182, 133, 109, 44, 108, 160, 6, 154, 105, 157, 116, 104, 50, 64, 72, 155, 41, 195, 64, 167, 13, 80, 37, 173, 180, 186, 95, 173, 187, 228, 43, 166, 182, 133, 109, 44, 108, 160, 6, 154, 105, 157, 116, 104, 50, 64, 72, 155, 41, 195, 64, 167, 13, 80,
...@@ -611,5 +529,82 @@ let testPng = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, ...@@ -611,5 +529,82 @@ let testPng = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73,
19, 255, 28, 240, 23, 223, 64, 127, 237, 65, 62, 251, 233, 207, 228, 181, 27, 215, 87, 115, 206, 40, 125, 211, 16, 0, 0, 0, 35, 73, 68, 65, 19, 255, 28, 240, 23, 223, 64, 127, 237, 65, 62, 251, 233, 207, 228, 181, 27, 215, 87, 115, 206, 40, 125, 211, 16, 0, 0, 0, 35, 73, 68, 65,
84, 149, 164, 204, 8, 133, 132, 13, 22, 190, 173, 132, 22, 133, 166, 164, 186, 251, 158, 143, 248, 248, 248, 136, 103, 158, 125, 134, 127, 94, 252, 223, 84, 149, 164, 204, 8, 133, 132, 13, 22, 190, 173, 132, 22, 133, 166, 164, 186, 251, 158, 143, 248, 248, 248, 136, 103, 158, 125, 134, 127, 94, 252, 223,
160, 16, 125, 12, 251, 15, 241, 139, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130]) 160, 16, 125, 12, 251, 15, 241, 139, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130])
export {testPng, testJpg, tc_020buf, tc_020_1buf, tc_021buf, tc_021_1buf, tc_022buf} let testJpg = new Uint8Array([255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 96, 0, 96, 0, 0, 255, 219, 0, 67, 0, 2, 1, 1, 2, 1, 1, 2,
\ No newline at end of file 2, 2, 2, 2, 2, 2, 2, 3, 5, 3, 3, 3, 3, 3, 6, 4, 4, 3, 5, 7, 6, 7, 7, 7, 6, 7, 7, 8, 9, 11, 9, 8,
8, 10, 8, 7, 7, 10, 13, 10, 10, 11, 12, 12, 12, 12, 7, 9, 14, 15, 13, 12, 14, 11, 12, 12, 12, 255, 219, 0, 67, 1, 2, 2,
2, 3, 3, 3, 6, 3, 3, 6, 12, 8, 7, 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 255, 192,
0, 17, 8, 0, 226, 1, 216, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1, 255, 196, 0, 31, 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0,
0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 255, 196, 0, 181, 16, 0, 2, 1, 3, 3, 2, 4, 3, 5,
5, 4, 4, 0, 0, 1, 125, 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35,
66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58,
67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122,
131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183,
184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241,
242, 243, 244, 245, 246, 247, 248, 249, 250, 255, 196, 0, 31, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 255, 196, 0, 181, 17, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119, 0,
1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21,
98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73,
74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136,
137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196,
197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249,
250, 255, 218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0, 253, 16, 162, 138, 43, 252, 99, 63, 170, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160,
2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 2, 138, 40, 160, 15, 255, 217])
export {testPng, testJpg}
\ No newline at end of file
{ {
"string": [ "string": [
{ {
"name": "entry_MainAbility", "name": "entry_MainAbility",
"value": "ImageJSTestMain" "value": "ImageJSTestMain"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
"value": "ImageJSTestMain Ability" "value": "ImageJSTestMain Ability"
} }
] ]
} }
\ No newline at end of file
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("image_DecodeOptions_js_hap") {
hap_profile = "./src/main/config.json"
deps = [
":image_DecodeOptions_js_assets",
":image_DecodeOptions_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageDecodeOptionsJsTest"
}
ohos_js_assets("image_DecodeOptions_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("image_DecodeOptions_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1200000",
"package": "ohos.acts.multimedia.image.DecodeOptions",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImageDecodeOptionsJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"mkdir /data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files"
]
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./resource/image/test.bmp ->/data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files",
"./resource/image/test.png ->/data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files",
"./resource/image/test.tiff ->/data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files",
"./resource/image/test.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files",
"./resource/image/moving_test.gif ->/data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files/test.bmp",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files/test.png",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files/test.tiff",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files/test.jpg",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.DecodeOptions/files/moving_test.gif"
],
"teardown-command":[
]
}
]
}
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.image.DecodeOptions",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.image.DecodeOptions.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.image.DecodeOptions.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MEDIA_LOCATION",
"reason":"use ohos.permission.MEDIA_LOCATION"
},
{
"name": "ohos.permission.READ_MEDIA",
"reason":"use ohos.permission.READ_MEDIA"
},
{
"name": "ohos.permission.WRITE_MEDIA",
"reason":"use ohos.permission.WRITE_MEDIA"
}
],
"package": "ohos.acts.multimedia.image.DecodeOptions",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ohos.acts.multimedia.image; export default {
onCreate() {
import ohos.aafwk.ability.AbilityPackage; console.info('AceApplication onCreate');
},
/* onDestroy() {
* java MyApplication console.info('AceApplication onDestroy');
*/ }
public class MyApplication extends AbilityPackage { };
@Override
public void onInitialize() {
super.onInitialize();
}
}
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./image.test.js')
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "ImageJSTestMain"
},
{
"name": "mainability_description",
"value": "ImageJSTestMain Ability"
}
]
}
\ No newline at end of file
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("image_exif_js_hap") {
hap_profile = "./src/main/config.json"
deps = [
":image_exif_js_assets",
":image_exif_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageExifJsTest"
}
ohos_js_assets("image_exif_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("image_exif_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "ohos.acts.multimedia.image.Exif",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImageExifJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"mkdir /data/app/el2/100/base/ohos.acts.multimedia.image.Exif/files",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Exif/files"
]
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./resource/image/test_exif.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image.Exif/files"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Exif/files/test_exif.jpg"
],
"teardown-command":[
]
}
]
}
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.image.Exif",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.image.Exif.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.image.Exif.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MEDIA_LOCATION",
"reason":"use ohos.permission.MEDIA_LOCATION"
},
{
"name": "ohos.permission.READ_MEDIA",
"reason":"use ohos.permission.READ_MEDIA"
},
{
"name": "ohos.permission.WRITE_MEDIA",
"reason":"use ohos.permission.WRITE_MEDIA"
}
],
"package": "ohos.acts.multimedia.image.Exif",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/* /*
* Copyright (C) 2021 Huawei Device Co., Ltd. * Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ohos.acts.multimedia.image; export default {
onCreate() {
import ohos.ace.ability.AceAbility; console.info('AceApplication onCreate');
import ohos.aafwk.content.Intent; },
onDestroy() {
/* console.info('AceApplication onDestroy');
* java MainAbility }
*/ };
public class MainAbility extends AceAbility {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
}
@Override
public void onStop() {
super.onStop();
}
}
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./image.test.js')
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import image from '@ohos.multimedia.image'
import fileio from '@ohos.fileio'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import {tc_020buf, tc_020_1buf, tc_021buf, tc_021_1buf, tc_022buf} from './testImg'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle'
describe('Image', function () {
var pathExifJpg = '/data/storage/el2/base/files/test_exif.jpg';
beforeAll(async function () {
await applyPermission();
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(async function () {
console.info('afterEach case');
})
afterAll(async function () {
console.info('afterAll case');
})
async function applyPermission(){
let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.image.Exif',0,100);
let atManager = abilityAccessCtrl.createAtManager();
if(atManager != null){
let tokenID = appInfo.accessTokenId;
console.info('[permission]case accessTokenId is' + tokenID);
let permissionName1 = 'ohos.permission.MEDIA_LOCATION';
let permissionName2 = 'ohos.permission.READ_MEDIA';
let permissionName3 = 'ohos.permission.WRITE_MEDIA';
await atManager.grantUserGrantedPermission(tokenID,permissionName1).then((result)=>{
console.info('[permission]case grantUserGrantedPermission success:' + result);
}).catch((err)=>{
console.info('[permission]case grantUserGrantedPermission failed:' + err);
});
await atManager.grantUserGrantedPermission(tokenID,permissionName2).then((result)=>{
console.info('[permission]case grantUserGrantedPermission success:' + result);
}).catch((err)=>{
console.info('[permission]case grantUserGrantedPermission failed:' + err);
});
await atManager.grantUserGrantedPermission(tokenID,permissionName3).then((result)=>{
console.info('[permission]case grantUserGrantedPermission success:' + result);
}).catch((err)=>{
console.info('[permission]case grantUserGrantedPermission failed:' + err);
});
}else{
console.info('[permission]case apply permission failed,createAtManager failed');
}
}
/**
* @tc.number : TC_001
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: RGBA_8888, size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts)
.then( pixelmap => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001 success');
done();
})
.catch(error => {
console.log('TC_001 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_001-1
* @tc.name : create pixelmap-callback (editable: false, pixelFormat: RGBA_8888, size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using colorand opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-1', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: false, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001-1 success');
done();
})
})
/**
* @tc.number : TC_001-2
* @tc.name : createpixelmap-promise (editable: true, pixelFormat: RGB_565, size: { height: 6, width: 8 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using colorand opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-2', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 2, size: { height: 6, width: 8 } }
image.createPixelMap(Color, opts)
.then( pixelmap => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001-2 success');
done();
})
.catch(error => {
console.log('TC_001-2 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_001-3
* @tc.name : createpixelmap-callback (editable: false, pixelFormat: RGB_565, size: { height: 6, width: 8 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using colorand opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-3', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: false, pixelFormat: 2, size: { height: 6, width: 8 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001-3 success');
done();
})
})
/**
* @tc.number : TC_001-4
* @tc.name : createpixelmap-promise(editable: true, pixelFormat: unkonwn, size: { height: 6, width: 8 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using colorand opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-4', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 0, size: { height: 6, width: 8 } }
image.createPixelMap(Color, opts)
.then( pixelmap => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001-4 success');
done();
})
.catch(error => {
console.log('TC_001-4 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_001-5
* @tc.name : create pixelmap-callback(editable: false, pixelFormat: unkonwn, size: { height: 6, width: 8 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using colorand opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-5', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: false, pixelFormat: 0, size: { height: 6, width: 8 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001-5 success');
done();
})
})
/**
* @tc.number : TC_001-6
* @tc.name : create pixelmap-callback(editable: true, pixelFormat: RGBA_8888, size: { height: 6, width: 8 } bytes > buffer )
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-6', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 6, width: 8 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001-6 success');
done();
})
})
/**
* @tc.number : TC_001-7
* @tc.name : create pixelmap-callback(editable: true, pixelFormat: RGB_565, size: { height: 2, width: 3 }, bytes < buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-7', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 2, size: { height: 2, width: 3 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
expect(pixelmap != undefined).assertTrue();
console.info('TC_001-7 success');
done();
})
})
/**
* @tc.number : TC_001-8
* @tc.name : create pixelmap-callback(editable: true, pixelFormat: unkonwn, size: { height: -1, width: -1 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-8', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 0, size: { height: -1, width: -1 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
expect(pixelmap == undefined).assertTrue();
console.info('TC_001-8 success');
done();
})
})
/**
* @tc.number : TC_001-9
* @tc.name : create pixelmap-callback(editable: true, pixelFormat: unsupported format, size: { height: 6, width: 8 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('TC_001-9', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 1, size: { height: 6, width: 8 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
expect(pixelmap == undefined).assertTrue();
console.info('TC_001-9 success');
done();
})
})
/**
* @tc.number : TC_020
* @tc.name : readPixelsToBuffer-promise
* @tc.desc : read all pixels to an buffer
* 1.create PixelMap,buffer
* 2.call readPixelsToBuffer
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_020', 0, async function (done) {
console.info('TC_020 in');
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts)
.then( pixelmap => {
if (pixelmap == undefined) {
console.info('TC_020 createPixelMap failed');
expect(false).assertTrue()
done();
}
const readBuffer = new ArrayBuffer(96);
pixelmap.readPixelsToBuffer(readBuffer).then(() => {
var bufferArr2 = new Uint8Array(readBuffer);
var res = true;
for (var i = 0; i < bufferArr2.length; i++) {
if (bufferArr2[i] != tc_020buf[i]) {
res = false;
console.info('TC_20_buffer'+ bufferArr2[i]);
console.info('TC_020 failed');
expect(false).assertTrue();
done();
break;
}
}
if (res) {
console.info('TC_020 success');
expect(true).assertTrue()
done();
}
}).catch(error => {
console.log('TC_020 read error: ' + error);
expect().assertFail();
done();
})
}).catch(error => {
console.log('TC_020 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_020-1
* @tc.name : readPixelsToBuffer-callback
* @tc.desc : read all pixels to an buffer
* 1.create PixelMap,buffer
* 2.call readPixelsToBuffer
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_020-1', 0, async function (done) {
console.info('TC_020-1 in');
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err, pixelmap) => {
if(pixelmap == undefined){
console.info('TC_020-1 createPixelMap failed');
expect(false).assertTrue();
done();
}else{
const readBuffer = new ArrayBuffer(96);
pixelmap.readPixelsToBuffer(readBuffer,() => {
var bufferArr = new Uint8Array(readBuffer);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
if (bufferArr[i] != tc_020_1buf[i]) {
res = false;
console.info('TC_020-1 failed');
expect(false).assertTrue();
done();
break;
}
}
if (res) {
console.info('TC_020-1 success');
expect(true).assertTrue()
done();
}
})
}
})
})
/**
* @tc.number : TC_020-2
* @tc.name : readPixelsToBuffer-callback(buffer:0)
* @tc.desc : read all pixels to an buffer
* 1.create PixelMap,buffer
* 2.call readPixelsToBuffer
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_020-2', 0, async function (done) {
console.info('TC_020-2 in');
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 2, size: { height: 6, width: 8 } }
image.createPixelMap(color, opts, (err,pixelmap) => {
if(pixelmap == undefined){
console.info('TC_020-2 createPixelMap failed');
expect(false).assertTrue();
done();
}else{
const readBuffer = new ArrayBuffer(0);
pixelmap.readPixelsToBuffer(readBuffer,() => {
var bufferArr = new Uint8Array(readBuffer);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
if (bufferArr[i] == 0) {
res = false;
console.info('TC_020-2 failed');
expect(false).assertTrue();
done();
break;
}
}
if (res) {
console.info('TC_020-2 success');
expect(true).assertTrue()
done();
}
})
}
})
})
/**
* @tc.number : TC_021
* @tc.name : readPixels-promise
* @tc.desc : 1.create PixelMap
* 2.call readPixels
* 3.promise return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_021', 0, async function (done) {
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts)
.then( pixelmap => {
if (pixelmap == undefined) {
console.info('TC_021 createPixelMap failed');
expect(false).assertTrue()
done();
}
const area = { pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
pixelmap.readPixels(area).then(() => {
var bufferArr2 = new Uint8Array(area.pixels);
var res = true;
for (var i = 0; i < bufferArr2.length; i++) {
if (bufferArr2[i] != tc_021buf[i]) {
res = false;
console.info('TC_021 failed');
expect(false).assertTrue();
done();
break;
}
}
if (res) {
console.info('TC_021 success');
expect(true).assertTrue()
done();
}
})
})
.catch(error => {
console.log('TC_021 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_021-1
* @tc.name : readPixels-callback
* @tc.desc : 1.create PixelMap
* 2.call readPixels
* 3.promise return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_021-1', 0, async function (done) {
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err, pixelmap) => {
if(pixelmap == undefined){
console.info('TC_020-1 createPixelMap failed');
expect(false).assertTrue();
done();
}else{
const area = { pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }}
pixelmap.readPixels(area, () => {
var bufferArr = new Uint8Array(area.pixels);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
console.info('TC_021-1 buffer ' + bufferArr[i]);
if(bufferArr[i] != tc_021_1buf[i]) {
res = false;
console.info('TC_021-1 failed');
expect(false).assertTrue();
done();
break;
}
}
if (res) {
console.info('TC_021-1 success');
expect(true).assertTrue()
done();
}
})
}
})
})
/**
* @tc.number : TC_021-2
* @tc.name : readPixels-callback( region: { size: { height: 1, width: 2 }, x: -1, y: -1 })
* @tc.desc : 1.create PixelMap
* 2.call readPixels
* 3.promise return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_021-2', 0, async function (done) {
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err,pixelmap) => {
if(pixelmap == undefined){
expect(false).assertTrue();
console.info('TC_021-2 create pixelmap fail');
done();
}else{
const area = { pixels: new ArrayBuffer(20),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: -1, y: -1 }}
pixelmap.readPixels(area).then(()=>{
console.info('TC_021-2 failed');
expect(false).assertTrue();
done();
}).catch(()=>{
expect(true).assertTrue();
console.info('TC_021-2 success');
done();
})
}
})
})
/**
* @tc.number : TC_021-3
* @tc.name : readPixels-promise(buffer:0)
* @tc.desc : 1.create PixelMap
* 2.call readPixels
* 3.promise return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_021-3', 0, async function (done) {
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err,pixelmap) => {
if(pixelmap == undefined){
expect(false).assertTrue();
console.info('TC_021-3 create pixelmap failed');
done();
}else{
const area = { pixels: new ArrayBuffer(0),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }}
pixelmap.readPixels(area).then(()=>{
console.info('TC_021-3 failed');
expect(false).assertTrue();
done();
}).catch(()=>{
expect(true).assertTrue();
console.info('TC_021-3 success');
done();
})
}
})
})
/**
* @tc.number : TC_021-4
* @tc.name : readPixels-promise(offset > buffer)
* @tc.desc : 1.create PixelMap
* 2.call readPixels
* 3.promise return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_021-4', 0, async function (done) {
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err, pixelmap) => {
if(pixelmap == undefined){
expect(false).assertTrue();
console.info('TC_021-4 createPixelMap success');
done();
}
const area = { pixels: new ArrayBuffer(20),
offset: 21,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }}
pixelmap.readPixels(area).then(()=>{
console.info('TC_021-4 failed');
expect(false).assertTrue();
done();
}).catch(()=>{
expect(true).assertTrue();
console.info('TC_021-4 success');
done();
})
})
})
/**
* @tc.number : TC_021-5
* @tc.name : readPixels-promise(region: { size: { height: -1, width:-1}, x: 0, y: 0 })
* @tc.desc : 1.create PixelMap
* 2.call readPixels
* 3.promise return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_021-5', 0, async function (done) {
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err,pixelmap) => {
if(pixelmap == undefined){
expect(false).assertTrue();
console.info('TC_021-5 createPixelMap success');
done();
}
const area = { pixels: new ArrayBuffer(20),
offset: 0,
stride: 8,
region: { size: { height: -1, width:-1}, x: 0, y: 0 }}
pixelmap.readPixels(area).then(()=>{
console.info('TC_021-5 failed');
expect(false).assertTrue();
done();
}).catch(()=>{
expect(true).assertTrue();
console.info('TC_021-5 success');
done();
})
})
})
/**
* @tc.number : TC_022
* @tc.name : writePixels-promise
* @tc.desc : 1.create PixelMap
* 2.call writePixels
* 3.call return undefined
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_022', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts)
.then( pixelmap => {
if (pixelmap == undefined) {
console.info('TC_022 createPixelMap failed');
expect(false).assertTrue()
done();
}
const area = { pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
var bufferArr = new Uint8Array(area.pixels);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
pixelmap.writePixels(area).then(() => {
const readArea = { pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
pixelmap.readPixels(readArea).then(() => {
var readArr = new Uint8Array(readArea.pixels);
var res = true;
for (var i = 0; i < readArr.length; i++) {
if (readArr[i] != tc_022buf[i]) {
res = false;
console.info('TC_022 failed');
expect(false).assertTrue();
done();
break;
}
}
if (res) {
console.info('TC_022 success');
expect(true).assertTrue()
done();
}
})
})
})
.catch(error => {
console.log('TC_022 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_022-1
* @tc.name : writePixels-callback
* @tc.desc : 1.create PixelMap
* 2.call writePixels
* 3.call return undefined
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_022-1', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err, pixelmap) => {
if (pixelmap == undefined) {
console.info('TC_022-1 createPixelMap failed');
expect(false).assertTrue()
done();
}
const area = {
pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
var bufferArr = new Uint8Array(area.pixels);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
pixelmap.writePixels(area, () => {
const readArea = {
pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
pixelmap.readPixels(readArea, () => {
var readArr = new Uint8Array(readArea.pixels);
var res = true;
for (var i = 0; i < readArr.length; i++) {
if (readArr[i] != tc_022buf[i]) {
res = false;
console.info('TC_022-1 failed');
expect(false).assertTrue();
done();
break;
}
}
if (res) {
console.info('TC_022-1 success');
expect(true).assertTrue()
done();
}
})
})
})
.catch(error => {
console.log('TC_022-1 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_023
* @tc.name : writeBufferToPixels-promise
* @tc.desc : 1.create PixelMap,buffer
* 2.call writeBufferToPixels
* 3.call return undefined
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_023', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 }}
image.createPixelMap(color, opts)
.then( pixelmap => {
if (pixelmap == undefined) {
console.info('TC_023 createPixelMap failed');
expect(false).assertTrue()
done();
}
const writeColor = new ArrayBuffer(96);
var bufferArr = new Uint8Array(writeColor);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
pixelmap.writeBufferToPixels(writeColor).then(() => {
const readBuffer = new ArrayBuffer(96);
pixelmap.readPixelsToBuffer(readBuffer).then(() => {
var bufferArr = new Uint8Array(readBuffer);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
if (bufferArr[i] == 0) {
res = false;
console.info('TC_023 failed');
expect(false).assertTrue()
done();
break;
}
}
if (res) {
console.info('TC_023 success');
expect(true).assertTrue();
done();
}
})
})
})
.catch(error => {
console.log('TC_023 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_023-1
* @tc.name : writeBufferToPixels-callback
* @tc.desc : 1.create PixelMap,buffer
* 2.call writeBufferToPixels
* 3.call return undefined
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_023-1', 0, async function (done) {
const color = new ArrayBuffer(96);
var bufferArr = new Uint8Array(color);
for (var i = 0; i < bufferArr.length; i++) {
bufferArr[i] = i + 1;
}
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts).then( pixelmap => {
if(pixelmap == undefined){
expect(false).assertTrue()
console.info('TC_023-1 failed');
done();
}
const writeColor = new ArrayBuffer(96);
pixelmap.writeBufferToPixels(writeColor,() => {
const readBuffer = new ArrayBuffer(96);
pixelmap.readPixelsToBuffer(readBuffer,() => {
var bufferArr = new Uint8Array(readBuffer);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
if(res) {
if (bufferArr[i] == 0) {
res = false;
console.info('TC_023-1 Success');
expect(true).assertTrue()
done();
break;
}
}
}
if (res) {
console.info('TC_023-1 no change after writeBuffer');
expect(false).assertTrue();
done();
}
})
})
})
})
/**
* @tc.number : TC_024
* @tc.name : getImageInfo-pixelmap-promise
* @tc.desc : 1.create PixelMap,ImageInfo
* 2.call getImageInfo
* 3.call return imageinfo
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_024', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 2, size: { height: 6, width: 8 } }
image.createPixelMap(color, opts)
.then( pixelmap => {
if (pixelmap == undefined) {
console.info('TC_024 createPixelMap failed');
expect(false).assertTrue()
done();
}
pixelmap.getImageInfo().then( imageInfo => {
if (imageInfo == undefined) {
console.info('TC_024 imageInfo is empty');
expect(false).assertTrue()
done();
}
if(imageInfo.size.height == 4 && imageInfo.size.width == 6){
console.info('TC_024 success ');
expect(true).assertTrue()
done();
}
done();
}).catch(error => {
console.log('TC_024 getimageinfo error: ' + error);
expect().assertFail();
done();
})
done();
})
.catch(error => {
console.log('TC_024 error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_024-1
* @tc.name : getImageInfo-pixelmap-callback
* @tc.desc : 1.create PixelMap,ImageInfo
* 2.call getImageInfo
* 3.call return imageinfo
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_024-1', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err,pixelmap) => {
if(pixelmap == undefined){
expect(false).assertTrue()
console.info('TC_024-1 create pixelmap fail');
done();
}
pixelmap.getImageInfo( (err,imageInfo) => {
if (imageInfo == undefined) {
console.info('TC_024-1 imageInfo is empty');
expect(false).assertTrue()
done();
}
if(imageInfo.size.height == 4 && imageInfo.size.width == 6){
console.info('TC_024-1 imageInfo success');
expect(true).assertTrue()
done();
}
done();
})
})
})
/**
* @tc.number : TC_025-1
* @tc.name : getBytesNumberPerRow
* @tc.desc : 1.create PixelMap
* 2.set PixelMap
* 3.call getBytesNumberPerRow
* 4. call return number
* 5.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_025-1', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
const expectNum = 4 * opts.size.width;
image.createPixelMap(color, opts, (err,pixelmap) => {
if(pixelmap == undefined){
expect(false).assertTrue()
console.info('TC_25-1 create pixelmap fail');
done();
} else {
const num = pixelmap.getBytesNumberPerRow();
console.info('TC_025-1 num is ' + num);
expect(num == expectNum).assertTrue();
if(num == expectNum) {
console.info('TC_25-1 success');
} else {
console.info('TC_25-1 fail');
}
done();
}
})
})
/**
* @tc.number : TC_026-1
* @tc.name : getPixelBytesNumber
* @tc.desc : 1.create PixelMap
* 2.set Pixel
* 3.call getPixelBytesNumber
* 4. call return number
* 5.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_026-1', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
const expectNum = 4 * opts.size.width * opts.size.height;
image.createPixelMap(color, opts,(err,pixelmap) => {
if(pixelmap == undefined){
expect(false).assertTrue()
console.info('TC_026-1 create pixelmap fail');
done();
} else {
const num = pixelmap.getPixelBytesNumber();
console.info('TC_026-1 num is ' + num);
expect(num == expectNum).assertTrue();
if(num == expectNum) {
console.info('TC_026-1 success');
} else {
console.info('TC_026-1 fail');
}
done();
}
})
})
/**
* @tc.number : TC_027
* @tc.name : release-pixelmap-promise
* @tc.desc : 1.create PixelMap
* 2.set Pixel
* 3.call release
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_027', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts).then(pixelmap => {
if (pixelmap == undefined) {
console.info('TC_027 createPixelMap failed');
expect(false).assertTrue()
done();
}
pixelmap.release().then(() => {
console.info('TC_027 success');
expect(true).assertTrue();
done();
}).catch(error => {
console.log('TC_027 error: ' + error);
expect().assertFail();
done();
})
}).catch(error => {
console.log('TC_027 createPixelMap failed error: ' + error);
expect().assertFail();
done();
})
})
/**
* @tc.number : TC_027-1
* @tc.name : release-pixelmap-callback
* @tc.desc : 1.create PixelMap
* 2.set Pixel
* 3.call release
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_027-1', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (err, pixelmap) => {
if (pixelmap == undefined) {
console.info('TC_027-1 createPixelMap failed');
expect(false).assertTrue()
done();
}
pixelmap.release(()=>{
expect(true).assertTrue();
console.log('TC_027-1 success');
done();
})
})
})
/**
* @tc.number : TC_171
* @tc.name : getImageProperty(BitsPerSample)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(BitsPerSample)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("BitsPerSample")
.then(data => {
console.info('TC_171 BitsPerSample ' + data);
expect(data != undefined).assertTrue();
done();
})
.catch(error => {
console.log('TC_171 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-1
* @tc.name : getImageProperty(Orientation)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(Orientation)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-1', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("Orientation")
.then(data => {
console.info('TC_171-1 Orientation ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-1 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-2
* @tc.name : getImageProperty(ImageLength)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ImageLength)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-2', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-2 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("ImageLength")
.then(data => {
console.info('TC_171-2 ImageLength ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-2 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-3
* @tc.name : getImageProperty(ImageWidth)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ImageWidth)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-3', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-3 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("ImageWidth")
.then(data => {
console.info('TC_171-3 ImageWidth ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-3 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-4
* @tc.name : getImageProperty(GPSLatitude)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLatitude)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-4', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-4 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLatitude")
.then(data => {
console.info('TC_171-4 GPSLatitude ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-4 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-5
* @tc.name : getImageProperty(GPSLongitude)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLongitude)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-5', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-5 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLongitude")
.then(data => {
console.info('TC_171-5 GPSLongitude ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-5 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-6
* @tc.name : getImageProperty(GPSLatitudeRef)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLatitudeRef)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-6', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-6 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLatitudeRef")
.then(data => {
console.info('TC_171-6 GPSLatitudeRef ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-6 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-7
* @tc.name : getImageProperty(GPSLongitudeRef)-promise
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLongitudeRef)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-7', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-7 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLongitudeRef")
.then(data => {
console.info('TC_171-7 GPSLongitudeRef ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-7 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_171-8
* @tc.name : getImageProperty(DateTimeOriginal)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ImageLength)
* 4.The return value is not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_171-8', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_171-8 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("DateTimeOriginal")
.then(data => {
console.info('TC_171-8 DateTimeOriginal ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
})
.catch(error => {
console.log('TC_171-8 error: ' + error);
expect(false).assertFail();
done();
})
}
})
/**
* @tc.number : TC_172
* @tc.name : getImageProperty(BitsPerSample)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(BitsPerSample)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("BitsPerSample",(error,data) => {
if (error){
console.info('TC_172 getImageProperty BitsPerSample error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172 BitsPerSample ' + data);
expect(data != undefined).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-1
* @tc.name : getImageProperty(Orientation)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(Orientation)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-1', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-1 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("Orientation",(error,data) => {
if (error){
console.info('TC_172-1 getImageProperty Orientation error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-1 Orientation ' + data);
expect(data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-2
* @tc.name : getImageProperty(ImageLength)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(ImageLength)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-2', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-2 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("ImageLength",(error,data) => {
if (error){
console.info('TC_172-2 getImageProperty ImageLength error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-2 ImageLength ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-3
* @tc.name : getImageProperty(ImageWidth)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(ImageWidth)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-3', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-3 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("ImageWidth",(error,data) => {
if (error){
console.info('TC_172-3 getImageProperty ImageWidth error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-3 ImageWidth ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-4
* @tc.name : getImageProperty(GPSLatitude)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(GPSLatitude)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-4', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-4 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLatitude",(error,data) => {
if (error){
console.info('TC_172-4 getImageProperty GPSLatitude error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-4 GPSLatitude ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-5
* @tc.name : getImageProperty(GPSLongitude)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(GPSLongitude)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-5', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-5 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLongitude",(error,data) => {
if (error){
console.info('TC_172-5 getImageProperty GPSLongitude error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-5 GPSLongitude ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-6
* @tc.name : getImageProperty(GPSLatitudeRef)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(GPSLatitudeRef)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-6', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-6 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLatitudeRef",(error,data) => {
if (error){
console.info('TC_172-6 getImageProperty GPSLatitudeRef error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-6 GPSLatitudeRef ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-7
* @tc.name : getImageProperty(GPSLongitudeRef)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(GPSLongitudeRef)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-7', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-7 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("GPSLongitudeRef",(error,data) => {
if (error){
console.info('TC_172-7 getImageProperty GPSLongitudeRef error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-7 GPSLongitudeRef ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_172-8
* @tc.name : getImageProperty(DateTimeOriginal)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(DateTimeOriginal)
* 3.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_172-8', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_172-8 create image source failed');
expect(false).assertTrue();
done();
} else {
imageSourceApi.getImageProperty("DateTimeOriginal",(error,data) => {
if (error){
console.info('TC_172-8 getImageProperty DateTimeOriginal error');
expect(false).assertTrue();
done();
}else{
console.info('TC_172-8 DateTimeOriginal ' + data);
expect(data != undefined && data != '' ).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173
* @tc.name : getImageProperty(BitsPerSample,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(BitsPerSample,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("BitsPerSample",property,(error,data) => {
if (error){
console.info('TC_173 getImageProperty BitsPerSample error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173 BitsPerSample ' + data);
expect(data != '9999' && data != undefined).assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-1
* @tc.name : getImageProperty(Orientation,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(Orientation,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-1', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-1 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("Orientation",property,(error,data) => {
if (error){
console.info('TC_173-1 getImageProperty Orientation error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-1 Orientation ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-2
* @tc.name : getImageProperty(ImageLength,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ImageLength,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-2', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-2 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("ImageLength",property,(error,data) => {
if (error){
console.info('TC_173-2 getImageProperty ImageLength error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-2 ImageLength ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-3
* @tc.name : getImageProperty(ImageWidth,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ImageWidth,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-3', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-3 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("ImageWidth",property,(error,data) => {
if (error){
console.info('TC_173-3 getImageProperty ImageWidth error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-3 ImageWidth ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-4
* @tc.name : getImageProperty(GPSLatitude,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLatitude,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-4', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-4 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("GPSLatitude",property,(error,data) => {
if (error){
console.info('TC_173-4 getImageProperty GPSLatitude error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-4 GPSLatitude ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-5
* @tc.name : getImageProperty(GPSLongitude,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLongitude,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-5', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-5 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("GPSLongitude",property,(error,data) => {
if (error){
console.info('TC_173-5 getImageProperty GPSLongitude error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-5 GPSLongitude ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-6
* @tc.name : getImageProperty(GPSLatitudeRef,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLatitudeRef,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-6', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-6 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("GPSLatitudeRef",property,(error,data) => {
if (error){
console.info('TC_173-6 getImageProperty GPSLatitudeRef error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-6 GPSLatitudeRef ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-7
* @tc.name : getImageProperty(GPSLongitudeRef,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(GPSLongitudeRef,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-7', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-7 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("GPSLongitudeRef",property,(error,data) => {
if (error){
console.info('TC_173-7 getImageProperty GPSLongitudeRef error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-7 GPSLongitudeRef ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
/**
* @tc.number : TC_173-8
* @tc.name : getImageProperty(DateTimeOriginal,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(DateTimeOriginal,property)
* 4.return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('TC_173-8', 0, async function (done) {
let fdNumber = fileio.openSync(pathExifJpg);
const imageSourceApi = image.createImageSource(fdNumber);
if (imageSourceApi == undefined) {
console.info('TC_173-8 create image source failed');
expect(false).assertTrue();
done();
} else {
let property = {index:0,defaultValue:'9999'}
imageSourceApi.getImageProperty("DateTimeOriginal",property,(error,data) => {
if (error){
console.info('TC_173-8 getImageProperty DateTimeOriginal error');
expect(false).assertTrue();
done();
}else{
console.info('TC_173-8 DateTimeOriginal ' + data);
expect(data != '9999' && data != undefined && data != '').assertTrue();
done();
}
})
}
})
})
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
let tc_020buf = new Uint8Array([0,0,0,4,0,0,0,8,1,0,0,12,1,1,1,16,1,1,1,20,2,2,2,24,3,3,3,28,4,4,4,32,5,5,5,36,6,6,6,40,7,7,7,44,9,9,8,48,10,10,10,52,12,12,12,56,14,14,13,60,16,16,15,64,18,18,17,68,20,20,19,72,22,22,22,76,25,24,24,80,27,27,27,84,30,30,29,88,33,32,32,92,36,35,35,96])
let tc_020_1buf = new Uint8Array([0,0,0,4,0,0,0,8,1,0,0,12,1,1,1,16,1,1,1,20,2,2,2,24,3,3,3,28,4,4,4,32,5,5,5,36,6,6,6,40,7,7,7,44,9,9,8,48,10,10,10,52,12,12,12,56,14,14,13,60,16,16,15,64,18,18,17,68,20,20,19,72,22,22,22,76,25,24,24,80,27,27,27,84,30,30,29,88,33,32,32,92,36,35,35,96])
let tc_021buf = new Uint8Array([0,0,0,4,0,0,0,8])
let tc_021_1buf = new Uint8Array([0,0,0,4,0,0,0,8])
let tc_022buf = new Uint8Array([0,0,0,4,0,0,0,8])
export {tc_020buf, tc_020_1buf, tc_021buf, tc_021_1buf, tc_022buf}
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "ImageJSTestMain"
},
{
"name": "mainability_description",
"value": "ImageJSTestMain Ability"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册