提交 35f83155 编写于 作者: F fengzewu

fix debug -> data=0

Signed-off-by: Nfengzewu <fengzewu@huawei.com>
上级 7f05ad41
...@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni") ...@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("image_yuv_js_hap") { ohos_js_hap_suite("image_yuv_js_hap") {
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
deps = [ deps = [
":image_js_assets", ":image_yuv_js_assets",
":image_resources", ":image_yuv_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageyuvJsTest" hap_name = "ActsImageyuvJsTest"
} }
ohos_js_assets("image_js_assets") { ohos_js_assets("image_yuv_js_assets") {
source_dir = "./src/main/js/default" source_dir = "./src/main/js/default"
} }
ohos_resources("image_resources") { ohos_resources("image_yuv_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "1500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.image", "package": "ohos.acts.multimedia.image.YUV",
"shell-timeout": "120000" "shell-timeout": "120000"
}, },
"kits": [ "kits": [
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"target": 7 "target": 7
}, },
"vendor": "acts", "vendor": "acts",
"bundleName": "ohos.acts.multimedia.image", "bundleName": "ohos.acts.multimedia.image.YUV",
"version": { "version": {
"code": 1000000, "code": 1000000,
"name": "1.0.0" "name": "1.0.0"
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
"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.YUV.MainAbility",
"description": "$string:mainability_description", "description": "$string:mainability_description",
"label": "$string:entry_MainAbility", "label": "$string:entry_MainAbility",
"type": "page", "type": "page",
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
"tv", "tv",
"wearable" "wearable"
], ],
"mainAbility": "ohos.acts.multimedia.image.MainAbility", "mainAbility": "ohos.acts.multimedia.image.YUV.MainAbility",
"distro": { "distro": {
"moduleType": "entry", "moduleType": "entry",
"installationFree": false, "installationFree": false,
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
"reason":"use ohos.permission.WRITE_MEDIA" "reason":"use ohos.permission.WRITE_MEDIA"
} }
], ],
"package": "ohos.acts.multimedia.image", "package": "ohos.acts.multimedia.image.YUV",
"name": ".MyApplication", "name": ".MyApplication",
"js": [ "js": [
{ {
......
...@@ -38,7 +38,7 @@ describe('Image', function () { ...@@ -38,7 +38,7 @@ describe('Image', function () {
async function applyPermission() { async function applyPermission() {
console.info('[permission]case applyPermission in'); console.info('[permission]case applyPermission in');
let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.image', 0, 100); let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.image.YUV', 0, 100);
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
if (atManager != null) { if (atManager != null) {
let tokenID = appInfo.accessTokenId; let tokenID = appInfo.accessTokenId;
...@@ -89,7 +89,7 @@ describe('Image', function () { ...@@ -89,7 +89,7 @@ describe('Image', function () {
} }
async function yuvToJpegByPixelMapPromise(done, testNum, sourceOptions, yuvData) { async function yuvToJpegByPixelMapPromise(done, testNum, sourceOptions, yuvData) {
try{ try {
let imageSource = image.createImageSource(yuvData, sourceOptions) let imageSource = image.createImageSource(yuvData, sourceOptions)
if (imageSource == undefined) { if (imageSource == undefined) {
console.info(`${testNum} create ImageSource failed`); console.info(`${testNum} create ImageSource failed`);
...@@ -97,19 +97,18 @@ describe('Image', function () { ...@@ -97,19 +97,18 @@ describe('Image', function () {
done(); done();
} else { } else {
imageSource.createPixelMap() imageSource.createPixelMap()
.then((data) => { .then((pixelmap) => {
var dataArr = new Uint8Array(data); if (pixelmap == undefined) {
console.info(`${testNum} dataArr.length=` + dataArr.length); expect(false).assertTrue();
for (var i = 0; i < dataArr.length; i++) { done();
var str = `dataArr[` + i + `]=`; } else {
for (var j = 0; ((j < 20) && (i < dataArr.length)); j++, i++) { pixelmap.getImageInfo((err, imageInfo) => {
str = str + "," + dataArr[i]; expect(imageInfo != undefined).assertTrue();
} expect(imageInfo.size.height == 4).assertTrue();
console.info(`${testNum} ` + str); expect(imageInfo.size.width == 6).assertTrue();
i--;
}
expect(data != undefined).assertTrue();
done(); done();
})
}
}).catch(error => { }).catch(error => {
console.info(`${testNum} create Pixelmap failed`); console.info(`${testNum} create Pixelmap failed`);
console.log(`${testNum} error:` + error); console.log(`${testNum} error:` + error);
...@@ -124,8 +123,8 @@ describe('Image', function () { ...@@ -124,8 +123,8 @@ describe('Image', function () {
} }
} }
async function yuvToJpegByPixelMapPromiseFail(done, testNum, sourceOptions, yuvData){ async function yuvToJpegByPixelMapPromise_fail(done, testNum, sourceOptions, yuvData) {
try{ try {
let imageSource = image.createImageSource(yuvData, sourceOptions) let imageSource = image.createImageSource(yuvData, sourceOptions)
if (imageSource == undefined) { if (imageSource == undefined) {
console.info(`${testNum} create ImageSource failed`); console.info(`${testNum} create ImageSource failed`);
...@@ -133,7 +132,7 @@ describe('Image', function () { ...@@ -133,7 +132,7 @@ describe('Image', function () {
done(); done();
} else { } else {
imageSource.createPixelMap() imageSource.createPixelMap()
.then((data) => { .then((pixelmap) => {
console.info(`${testNum} create Pixelmap ok`); console.info(`${testNum} create Pixelmap ok`);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
...@@ -153,28 +152,27 @@ describe('Image', function () { ...@@ -153,28 +152,27 @@ describe('Image', function () {
async function yuvToJpegByPixelMapCallback(done, testNum, sourceOptions, yuvData) { async function yuvToJpegByPixelMapCallback(done, testNum, sourceOptions, yuvData) {
console.info(`${testNum} test`); console.info(`${testNum} test`);
try{ try {
let imageSource = image.createImageSource(yuvData, sourceOptions); let imageSource = image.createImageSource(yuvData, sourceOptions);
if (imageSource == undefined) { if (imageSource == undefined) {
console.info(`${testNum} create ImageSource failed`); console.info(`${testNum} create ImageSource failed`);
expect(false).assertTrue() expect(false).assertTrue()
done(); done();
} else { } else {
imageSource.createPixelMap((err,data)=>{ imageSource.createPixelMap((err, pixelmap) => {
var dataArr = new Uint8Array(data); if (pixelmap == undefined) {
console.info(`${testNum} dataArr.length=` + dataArr.length); expect(false).assertTrue();
for (var i = 0; i < dataArr.length; i++) { done();
var str = `dataArr[` + i + `]=`; } else {
for (var j = 0; ((j < 20) && (i < dataArr.length)); j++, i++) { pixelmap.getImageInfo((err, imageInfo) => {
str = str + "," + dataArr[i]; expect(imageInfo != undefined).assertTrue();
} expect(imageInfo.size.height == 4).assertTrue();
console.info(`${testNum} ` + str); expect(imageInfo.size.width == 6).assertTrue();
i--;
}
expect(data != undefined).assertTrue();
done(); done();
}) })
} }
})
}
} catch (error) { } catch (error) {
logger.log(`${testNum} error:` + error); logger.log(`${testNum} error:` + error);
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -182,19 +180,19 @@ describe('Image', function () { ...@@ -182,19 +180,19 @@ describe('Image', function () {
} }
} }
async function yuvToJpegByPixelMapCallbackFail(done, testNum, sourceOptions, yuvData) { async function yuvToJpegByPixelMapCallback_fail(done, testNum, sourceOptions, yuvData) {
try{ try {
let imageSource = image.createImageSource(yuvData, sourceOptions); let imageSource = image.createImageSource(yuvData, sourceOptions);
if (imageSource == undefined) { if (imageSource == undefined) {
console.info(`${testNum} create ImageSource failed`); console.info(`${testNum} create ImageSource failed`);
expect(false).assertTrue() expect(false).assertTrue()
done(); done();
} else { } else {
imageSource.createPixelMap((err,data)=>{ imageSource.createPixelMap((err, pixelmap) => {
if (data == undefined) { if (pixelmap == undefined) {
expect(true).assertTrue() expect(true).assertTrue()
done(); done();
}else{ } else {
expect(false).assertTrue() expect(false).assertTrue()
done(); done();
} }
...@@ -244,7 +242,7 @@ describe('Image', function () { ...@@ -244,7 +242,7 @@ describe('Image', function () {
} }
} }
async function yuvToJpegByImageSourcePromiseFail(done, testNum, sourceOptions, arg, yuvData) { async function yuvToJpegByImageSourcePromise_fail(done, testNum, sourceOptions, arg, yuvData) {
let imageSource = image.createImageSource(yuvData, sourceOptions); let imageSource = image.createImageSource(yuvData, sourceOptions);
if (imageSource == undefined) { if (imageSource == undefined) {
console.info(`${testNum} create ImageSource failed`); console.info(`${testNum} create ImageSource failed`);
...@@ -283,7 +281,7 @@ describe('Image', function () { ...@@ -283,7 +281,7 @@ describe('Image', function () {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
} else { } else {
imagePackerApi.packing(imageSource, arg, (err,data) => { imagePackerApi.packing(imageSource, arg, (err, data) => {
var dataArr = new Uint8Array(data); var dataArr = new Uint8Array(data);
console.info(`${testNum} dataArr.length=` + dataArr.length); console.info(`${testNum} dataArr.length=` + dataArr.length);
for (var i = 0; i < dataArr.length; i++) { for (var i = 0; i < dataArr.length; i++) {
...@@ -301,7 +299,7 @@ describe('Image', function () { ...@@ -301,7 +299,7 @@ describe('Image', function () {
} }
} }
async function yuvToJpegByImageSourceCallbackFail(done, testNum, sourceOptions, arg, yuvData) { async function yuvToJpegByImageSourceCallback_fail(done, testNum, sourceOptions, arg, yuvData) {
let imageSource = image.createImageSource(yuvData, sourceOptions); let imageSource = image.createImageSource(yuvData, sourceOptions);
if (imageSource == undefined) { if (imageSource == undefined) {
console.info(`${testNum} create ImageSource failed`); console.info(`${testNum} create ImageSource failed`);
...@@ -314,7 +312,7 @@ describe('Image', function () { ...@@ -314,7 +312,7 @@ describe('Image', function () {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
} else { } else {
imagePackerApi.packing(imageSource, arg, (err,data) => { imagePackerApi.packing(imageSource, arg, (err, data) => {
expect(err != undefined).assertTrue(); expect(err != undefined).assertTrue();
done(); done();
}) })
...@@ -332,7 +330,7 @@ describe('Image', function () { ...@@ -332,7 +330,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_P_001', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_P_001', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapPromise(done, 'SUB_IMAGE_yuv_pixelmap_P_001', sourceOptions, yuvData) yuvToJpegByPixelMapPromise(done, 'SUB_IMAGE_yuv_pixelmap_P_001', sourceOptions, yuvData)
}) })
...@@ -347,7 +345,7 @@ describe('Image', function () { ...@@ -347,7 +345,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_P_002', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_P_002', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapPromise(done, 'SUB_IMAGE_yuv_pixelmap_P_002', sourceOptions, yuvData) yuvToJpegByPixelMapPromise(done, 'SUB_IMAGE_yuv_pixelmap_P_002', sourceOptions, yuvData)
}) })
...@@ -377,9 +375,9 @@ describe('Image', function () { ...@@ -377,9 +375,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_P_004', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_P_004', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } };
yuvToJpegByPixelMapPromiseFail(done, 'SUB_IMAGE_yuv_pixelmap_P_004', sourceOptions, yuvData) yuvToJpegByPixelMapPromise_fail(done, 'SUB_IMAGE_yuv_pixelmap_P_004', sourceOptions, yuvData)
}) })
/** /**
...@@ -407,9 +405,9 @@ describe('Image', function () { ...@@ -407,9 +405,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_P_006', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_P_006', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } };
yuvToJpegByPixelMapPromiseFail(done, 'SUB_IMAGE_yuv_pixelmap_P_006', sourceOptions, yuvData) yuvToJpegByPixelMapPromise_fail(done, 'SUB_IMAGE_yuv_pixelmap_P_006', sourceOptions, yuvData)
}) })
/** /**
...@@ -422,9 +420,9 @@ describe('Image', function () { ...@@ -422,9 +420,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_P_007', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_P_007', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapPromiseFail(done, 'SUB_IMAGE_yuv_pixelmap_P_007', sourceOptions, yuvData) yuvToJpegByPixelMapPromise_fail(done, 'SUB_IMAGE_yuv_pixelmap_P_007', sourceOptions, yuvData)
}) })
/** /**
...@@ -437,9 +435,9 @@ describe('Image', function () { ...@@ -437,9 +435,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_P_008', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_P_008', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapPromiseFail(done, 'SUB_IMAGE_yuv_pixelmap_P_008', sourceOptions, yuvData) yuvToJpegByPixelMapPromise_fail(done, 'SUB_IMAGE_yuv_pixelmap_P_008', sourceOptions, yuvData)
}) })
/** /**
...@@ -454,7 +452,7 @@ describe('Image', function () { ...@@ -454,7 +452,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_P_001', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_P_001', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourcePromise(done, 'SUB_IMAGE_yuv_imagesource_P_001', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourcePromise(done, 'SUB_IMAGE_yuv_imagesource_P_001', sourceOptions, packOpts, yuvData)
...@@ -472,7 +470,7 @@ describe('Image', function () { ...@@ -472,7 +470,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_P_002', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_P_002', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourcePromise(done, 'SUB_IMAGE_yuv_imagesource_P_002', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourcePromise(done, 'SUB_IMAGE_yuv_imagesource_P_002', sourceOptions, packOpts, yuvData)
...@@ -508,10 +506,10 @@ describe('Image', function () { ...@@ -508,10 +506,10 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_P_004', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_P_004', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourcePromiseFail(done, 'SUB_IMAGE_yuv_imagesource_P_004', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourcePromise_fail(done, 'SUB_IMAGE_yuv_imagesource_P_004', sourceOptions, packOpts, yuvData)
}) })
/** /**
...@@ -544,10 +542,10 @@ describe('Image', function () { ...@@ -544,10 +542,10 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_P_006', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_P_006', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourcePromiseFail(done, 'SUB_IMAGE_yuv_imagesource_P_006', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourcePromise_fail(done, 'SUB_IMAGE_yuv_imagesource_P_006', sourceOptions, packOpts, yuvData)
}) })
/** /**
...@@ -562,10 +560,10 @@ describe('Image', function () { ...@@ -562,10 +560,10 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_P_007', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_P_007', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourcePromiseFail(done, 'SUB_IMAGE_yuv_imagesource_P_007', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourcePromise_fail(done, 'SUB_IMAGE_yuv_imagesource_P_007', sourceOptions, packOpts, yuvData)
}) })
/** /**
...@@ -580,10 +578,10 @@ describe('Image', function () { ...@@ -580,10 +578,10 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_P_008', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_P_008', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourcePromiseFail(done, 'SUB_IMAGE_yuv_imagesource_P_008', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourcePromise_fail(done, 'SUB_IMAGE_yuv_imagesource_P_008', sourceOptions, packOpts, yuvData)
}) })
/** /**
...@@ -596,7 +594,7 @@ describe('Image', function () { ...@@ -596,7 +594,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_CB_001', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_CB_001', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapCallback(done, 'SUB_IMAGE_yuv_pixelmap_CB_001', sourceOptions, yuvData) yuvToJpegByPixelMapCallback(done, 'SUB_IMAGE_yuv_pixelmap_CB_001', sourceOptions, yuvData)
}) })
...@@ -611,7 +609,7 @@ describe('Image', function () { ...@@ -611,7 +609,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_CB_002', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_CB_002', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapCallback(done, 'SUB_IMAGE_yuv_pixelmap_CB_002', sourceOptions, yuvData) yuvToJpegByPixelMapCallback(done, 'SUB_IMAGE_yuv_pixelmap_CB_002', sourceOptions, yuvData)
}) })
...@@ -641,9 +639,9 @@ describe('Image', function () { ...@@ -641,9 +639,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_CB_004', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_CB_004', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } };
yuvToJpegByPixelMapCallbackFail(done, 'SUB_IMAGE_yuv_pixelmap_CB_004', sourceOptions, yuvData) yuvToJpegByPixelMapCallback_fail(done, 'SUB_IMAGE_yuv_pixelmap_CB_004', sourceOptions, yuvData)
}) })
/** /**
...@@ -671,9 +669,9 @@ describe('Image', function () { ...@@ -671,9 +669,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_CB_006', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_CB_006', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } };
yuvToJpegByPixelMapCallbackFail(done, 'SUB_IMAGE_yuv_pixelmap_CB_006', sourceOptions, yuvData) yuvToJpegByPixelMapCallback_fail(done, 'SUB_IMAGE_yuv_pixelmap_CB_006', sourceOptions, yuvData)
}) })
/** /**
...@@ -686,9 +684,9 @@ describe('Image', function () { ...@@ -686,9 +684,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_CB_007', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_CB_007', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapCallbackFail(done, 'SUB_IMAGE_yuv_pixelmap_CB_007', sourceOptions, yuvData) yuvToJpegByPixelMapCallback_fail(done, 'SUB_IMAGE_yuv_pixelmap_CB_007', sourceOptions, yuvData)
}) })
/** /**
...@@ -701,9 +699,9 @@ describe('Image', function () { ...@@ -701,9 +699,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_pixelmap_CB_008', 0, async function (done) { it('SUB_IMAGE_yuv_pixelmap_CB_008', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } };
yuvToJpegByPixelMapCallbackFail(done, 'SUB_IMAGE_yuv_pixelmap_CB_008', sourceOptions, yuvData) yuvToJpegByPixelMapCallback_fail(done, 'SUB_IMAGE_yuv_pixelmap_CB_008', sourceOptions, yuvData)
}) })
/** /**
...@@ -718,7 +716,7 @@ describe('Image', function () { ...@@ -718,7 +716,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_CB_001', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_CB_001', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourceCallback(done, 'SUB_IMAGE_yuv_imagesource_CB_001', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourceCallback(done, 'SUB_IMAGE_yuv_imagesource_CB_001', sourceOptions, packOpts, yuvData)
...@@ -736,7 +734,7 @@ describe('Image', function () { ...@@ -736,7 +734,7 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_CB_002', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_CB_002', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourceCallback(done, 'SUB_IMAGE_yuv_imagesource_CB_002', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourceCallback(done, 'SUB_IMAGE_yuv_imagesource_CB_002', sourceOptions, packOpts, yuvData)
...@@ -772,10 +770,10 @@ describe('Image', function () { ...@@ -772,10 +770,10 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_CB_004', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_CB_004', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 8, sourceSize: { height: 4, width: 5 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourceCallbackFail(done, 'SUB_IMAGE_yuv_imagesource_CB_004', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourceCallback_fail(done, 'SUB_IMAGE_yuv_imagesource_CB_004', sourceOptions, packOpts, yuvData)
}) })
/** /**
...@@ -808,10 +806,10 @@ describe('Image', function () { ...@@ -808,10 +806,10 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_CB_006', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_CB_006', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 9, sourceSize: { height: 4, width: 5 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourceCallbackFail(done, 'SUB_IMAGE_yuv_imagesource_CB_006', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourceCallback_fail(done, 'SUB_IMAGE_yuv_imagesource_CB_006', sourceOptions, packOpts, yuvData)
}) })
/** /**
...@@ -826,10 +824,10 @@ describe('Image', function () { ...@@ -826,10 +824,10 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_CB_007', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_CB_007', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourcePixelFormat: 10, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourceCallbackFail(done, 'SUB_IMAGE_yuv_imagesource_CB_007', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourceCallback_fail(done, 'SUB_IMAGE_yuv_imagesource_CB_007', sourceOptions, packOpts, yuvData)
}) })
/** /**
...@@ -844,9 +842,9 @@ describe('Image', function () { ...@@ -844,9 +842,9 @@ describe('Image', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_IMAGE_yuv_imagesource_CB_008', 0, async function (done) { it('SUB_IMAGE_yuv_imagesource_CB_008', 0, async function (done) {
let yuvData = createBuffer(4,6); let yuvData = createBuffer(4, 6);
let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } }; let sourceOptions = { sourceDensity: 120, sourceSize: { height: 4, width: 6 } };
let packOpts = { format: ["image/jpeg"], quality: 99 } let packOpts = { format: ["image/jpeg"], quality: 99 }
yuvToJpegByImageSourceCallbackFail(done, 'SUB_IMAGE_yuv_imagesource_CB_008', sourceOptions, packOpts, yuvData) yuvToJpegByImageSourceCallback_fail(done, 'SUB_IMAGE_yuv_imagesource_CB_008', sourceOptions, packOpts, yuvData)
}) })
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册