提交 2796b31d 编写于 作者: C caochuan

modify receiver-yuv testcase

Signed-off-by: Ncaochuan <caochuan@huawei.com>
上级 ba50f67c
...@@ -12,1118 +12,1208 @@ ...@@ -12,1118 +12,1208 @@
* 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.
*/ */
import image from '@ohos.multimedia.image' import image from "@ohos.multimedia.image";
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
export default function ImageReceiver() { export default function ImageReceiver() {
describe('ImageReceiver', function () { describe("ImageReceiver", function () {
const WIDTH = 8192;
const YUV_Y = 1; const HEIGHT = 8;
const YUV_U = 2; const CAPACITY = 8;
const YUV_V = 3; const RGBA = 12;
const JPEG = 4; const { JPEG: FORMATJPEG, YCBCR_422_SP } = image.ImageFormat;
const WIDTH = 8192; const { YUV_Y, YUV_U, YUV_V, JPEG } = image.ComponentType;
const HEIGHT = 8; beforeAll(async function () {
const FORMAT = 4; console.info("beforeAll case");
const CAPACITY = 8; });
const YCBCR_422_SP = 1000;
const FORMATJPEG = 2000; beforeEach(function () {
console.info("beforeEach case");
beforeAll(async function () { });
console.info('beforeAll case');
}) afterEach(async function () {
console.info("afterEach case");
beforeEach(function () { });
console.info('beforeEach case');
}) afterAll(async function () {
console.info("afterAll case");
afterEach(async function () { });
console.info('afterEach case');
}) async function sleep(times = 200) {
await new Promise((res) =>
afterAll(async function () { setTimeout(() => {
console.info('afterAll case'); res();
}) }, times)
);
async function sleep(times = 200) {
await new Promise(res => setTimeout(() => { res() }, times));
}
async function createRecriver(done, testNum, wid, hei, fmt, cap) {
try {
image.createImageReceiver(wid, hei, fmt, cap);
expect(false).assertTrue();
done();
} catch (error) {
expect(error.code == 1).assertTrue();
console.info(`${testNum} err message` + error);
done();
} }
}
async function createRecriver(done, testNum, wid, hei, fmt, cap) {
async function getComponentProErr(done, testNum, param) { try {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY); image.createImageReceiver(wid, hei, fmt, cap);
let once = false; expect(false).assertTrue();
if (receiver == undefined) { done();
expect(false).assertTrue(); } catch (error) {
done(); expect(error.code == 1).assertTrue();
} else { console.info(`${testNum} err message` + error);
receiver.on('imageArrival', () => { done();
if (once) {
return;
} }
once = true; }
receiver.readLatestImage(async (err, img) => {
if (img == undefined) { async function getComponentProErr(done, testNum, param) {
expect(false).assertTrue(); var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
done(); let once = false;
} else { if (receiver == undefined) {
expect(img.size.width == WIDTH).assertTrue(); expect(false).assertTrue();
expect(img.size.height == HEIGHT).assertTrue(); done();
expect(img.format == 12).assertTrue(); } else {
expect(img.clipRect.size.width == WIDTH).assertTrue(); receiver.on("imageArrival", () => {
expect(img.clipRect.size.height == HEIGHT).assertTrue(); if (once) {
expect(img.clipRect.x == 0).assertTrue(); return;
expect(img.clipRect.y == 0).assertTrue();
try {
await img.getComponent(param);
expect(false).assertTrue();
} catch (error) {
expect(error.code == 1).assertTrue();
console.log(`${testNum} error msg: ` + error);
done();
} }
} once = true;
}) receiver.readLatestImage(async (err, img) => {
expect(true).assertTrue(); if (img == undefined) {
}) expect(false).assertTrue();
var dummy = receiver.test; done();
} else {
expect(img.size.width == WIDTH).assertTrue();
expect(img.size.height == HEIGHT).assertTrue();
expect(img.format == RGBA).assertTrue();
expect(img.clipRect.size.width == WIDTH).assertTrue();
expect(img.clipRect.size.height == HEIGHT).assertTrue();
expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue();
try {
await img.getComponent(param);
expect(false).assertTrue();
done();
} catch (error) {
expect(error.code == 1).assertTrue();
console.log(`${testNum} error msg: ` + error);
done();
}
}
});
expect(true).assertTrue();
});
var dummy = receiver.test;
}
} }
}
async function getComponentCbErr(done, testNum, param) {
async function getComponentCbErr(done, testNum, param) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY); let once = false;
let once = false; if (receiver == undefined) {
if (receiver == undefined) { expect(false).assertTrue();
expect(false).assertTrue(); done();
done(); } else {
} else { receiver.on("imageArrival", () => {
receiver.on('imageArrival', () => { if (once) {
return;
}
once = true;
receiver.readLatestImage(async (err, img) => {
if (img == undefined) {
expect(false).assertTrue();
done();
} else {
expect(img.size.width == WIDTH).assertTrue();
expect(img.size.height == HEIGHT).assertTrue();
expect(img.format == RGBA).assertTrue();
expect(img.clipRect.size.width == WIDTH).assertTrue();
expect(img.clipRect.size.height == HEIGHT).assertTrue();
expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue();
try {
img.getComponent(param, (err, component) => {
expect(false).assertTrue();
done();
});
} catch (error) {
expect(error.code == 1).assertTrue();
console.log(`${testNum} error msg: ` + error);
done();
}
}
});
expect(true).assertTrue();
});
var dummy = receiver.test;
}
}
async function getComponentPromise(done, testNum, param) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, YCBCR_422_SP, CAPACITY);
let once = false;
if (receiver == undefined) {
expect(false).assertTrue();
return;
}
receiver.on("imageArrival", () => {
if (once) { if (once) {
return; return;
} }
once = true; once = true;
receiver.readLatestImage(async (err, img) => { receiver.readLatestImage((err, img) => {
if (img == undefined) { if (err) {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
} else { } else {
expect(img.size.width == WIDTH).assertTrue(); expect(img.size.width == WIDTH).assertTrue();
expect(img.size.height == HEIGHT).assertTrue(); expect(img.size.height == HEIGHT).assertTrue();
expect(img.format == 12).assertTrue(); expect(img.format == RGBA).assertTrue();
expect(img.clipRect.size.width == WIDTH).assertTrue(); expect(img.clipRect.size.width == WIDTH).assertTrue();
expect(img.clipRect.size.height == HEIGHT).assertTrue(); expect(img.clipRect.size.height == HEIGHT).assertTrue();
expect(img.clipRect.x == 0).assertTrue(); expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue(); expect(img.clipRect.y == 0).assertTrue();
try { img.getComponent(param)
img.getComponent(param, (err, component) => { .then((component) => {
expect(false).assertTrue(); if (component == undefined) {
expect(false).assertTrue();
done();
return;
}
expect(component.componentType == param).assertTrue();
expect(component.byteBuffer != undefined).assertTrue();
expect(component.rowStride == 8192).assertTrue();
expect(component.pixelStride == 1).assertTrue();
done();
}) })
} catch (error) { .catch((error) => {
expect(error.code == 1).assertTrue(); console.log(`${testNum} error:` + error);
console.log(`${testNum} error msg: ` + error); expect(false).assertTrue();
done(); done();
} });
} }
}) });
expect(true).assertTrue(); expect(true).assertTrue();
}) });
var dummy = receiver.test; var dummy = receiver.test;
} }
}
async function getComponentCb(done, testNum, param) {
async function getComponentP(done, testNum, param) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, YCBCR_422_SP, CAPACITY);
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY); let once = false;
let once = false; if (receiver == undefined) {
if (receiver == undefined) { expect(false).assertTrue();
expect(false).assertTrue(); done();
done();
return;
}
receiver.on('imageArrival', () => {
if (once) {
return; return;
} }
once = true; receiver.on("imageArrival", () => {
receiver.readLatestImage((err, img) => { if (once) {
if (err) { return;
expect(false).assertTrue(); }
done(); once = true;
} else { receiver.readLatestImage((err, img) => {
expect(img.size.width == WIDTH).assertTrue(); if (err) {
expect(img.size.height == HEIGHT).assertTrue();
expect(img.format == 12).assertTrue();
expect(img.clipRect.size.width == WIDTH).assertTrue();
expect(img.clipRect.size.height == HEIGHT).assertTrue();
expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue();
img.getComponent(param).then(component => {
if (component == undefined) {
expect(false).assertTrue();
done();
} else {
expect(component.componentType == param).assertTrue();
expect(component.byteBuffer != undefined).assertTrue();
expect(component.rowStride == 0).assertTrue();
expect(component.pixelStride == 0).assertTrue();
done();
}
}).catch(error => {
console.log(`${testNum} error:` + error)
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}) } else {
} expect(img.size.width == WIDTH).assertTrue();
}) expect(img.size.height == HEIGHT).assertTrue();
expect(true).assertTrue(); expect(img.format == RGBA).assertTrue();
}) expect(img.clipRect.size.width == WIDTH).assertTrue();
var dummy = receiver.test; expect(img.clipRect.size.height == HEIGHT).assertTrue();
} expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue();
async function getComponentCb(done, testNum, param) { img.getComponent(param, (err, component) => {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY); if (err) {
let once = false; expect(false).assertTrue();
if (receiver == undefined) { console.log(`${testNum} geterror: ` + err);
expect(false).assertTrue(); done();
done(); } else {
return; expect(component != undefined).assertTrue();
expect(component.componentType == param).assertTrue();
expect(component.byteBuffer != undefined).assertTrue();
expect(component.rowStride == 8192).assertTrue();
expect(component.pixelStride == 1).assertTrue();
done();
}
});
}
});
expect(true).assertTrue();
});
var dummy = receiver.test;
} }
receiver.on('imageArrival', () => { async function onErr(done, testNum, param) {
if (once) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
return; expect(receiver != undefined).assertTrue();
} if (receiver == undefined) {
once = true; expect(false).assertTrue();
receiver.readLatestImage((err, img) => { done();
if (err) { } else {
expect(false).assertTrue(); try {
receiver.on(param, () => {
expect(false).assertTrue();
});
} catch (error) {
expect(error.code == 1).assertTrue();
console.log(`${testNum} error msg: ` + error);
done(); done();
} else {
expect(img.size.width == WIDTH).assertTrue();
expect(img.size.height == HEIGHT).assertTrue();
expect(img.format == 12).assertTrue();
expect(img.clipRect.size.width == WIDTH).assertTrue();
expect(img.clipRect.size.height == HEIGHT).assertTrue();
expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue();
img.getComponent(param, (err, component) => {
if (err) {
expect(false).assertTrue();
console.log(`${testNum} geterror: ` + err)
} else {
expect(component != undefined).assertTrue();
expect(component.componentType == param).assertTrue();
expect(component.byteBuffer != undefined).assertTrue();
expect(component.rowStride == 0).assertTrue();
expect(component.pixelStride == 0).assertTrue();
done();
}
})
} }
}) var dummy = receiver.test;
expect(true).assertTrue();
})
var dummy = receiver.test;
}
async function onErr(done, testNum, param) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
expect(receiver != undefined).assertTrue();
if (receiver == undefined) {
expect(false).assertTrue();
done();
} else {
try {
receiver.on(param, () => {
expect(false).assertTrue();
})
} catch (error) {
expect(error.code == 1).assertTrue();
console.log(`${testNum} error msg: ` + error);
done();
} }
var dummy = receiver.test;
} }
} function isString(value) {
return typeof value === "string";
function isString(value) {
return typeof value === 'string';
}
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0100
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0100', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
if (receiver == undefined) {
expect(false).assertTrue();
console.info('receiver_001 undefined')
done();
} else {
expect(receiver.size.width == WIDTH).assertTrue();
expect(receiver.size.height == HEIGHT).assertTrue();
expect(receiver.capacity == CAPACITY).assertTrue();
expect(receiver.format == FORMAT).assertTrue();
done();
}
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0200
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0200', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0200', WIDTH, HEIGHT, FORMAT, 'hd!')
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0100
* @tc.name : createImageReceiver-wrong format
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0100', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0100', WIDTH, HEIGHT, null, CAPACITY)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0200
* @tc.name : createImageReceiver-wrong height
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0200', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0200', WIDTH, null, FORMAT, CAPACITY)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0300
* @tc.name : createImageReceiver-wrong width
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0300', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0300', null, HEIGHT, FORMAT, CAPACITY)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0400
* @tc.name : createImageReceiver-wrong capacity
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0400', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0400', WIDTH, HEIGHT, FORMAT, null)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0500
* @tc.name : createImageReceiver-wrong width
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0500', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0500', false, HEIGHT, FORMAT, CAPACITY)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0600
* @tc.name : createImageReceiver- wrong width
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0600', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0600', { a: 10 }, HEIGHT, FORMAT, CAPACITY)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0300
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0300', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0300', WIDTH, false, FORMAT, CAPACITY)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0700
* @tc.name : createImageReceiver- wrong format
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0700', 0, async function (done) {
createRecriver(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0700', WIDTH, HEIGHT, 'form.', CAPACITY)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY)
if (receiver == undefined) {
expect(false).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400 undefined')
done();
} else {
expect(receiver.size.width == WIDTH).assertTrue();
expect(receiver.size.height == HEIGHT).assertTrue();
expect(receiver.capacity == CAPACITY).assertTrue();
expect(receiver.format == FORMATJPEG).assertTrue();
done();
}
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, YCBCR_422_SP, CAPACITY)
if (receiver == undefined) {
expect(false).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500 undefined')
done();
} else {
expect(receiver.size.width == WIDTH).assertTrue();
expect(receiver.size.height == HEIGHT).assertTrue();
expect(receiver.capacity == CAPACITY).assertTrue();
expect(receiver.format == YCBCR_422_SP).assertTrue();
done();
} }
})
/**
/** * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0100
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 * @tc.name : createImageReceiver
* @tc.name : getReceivingSurfaceId-promise * @tc.desc : 1.set width,height,format,capacity
* @tc.desc : 1.create ImageReceiver * 2.create ImageReceiver
* 2.call getReceivingSurfaceId * 3.return ImageReceiver not empty
* 3.return SurfaceId * @tc.size : MEDIUM
* @tc.size : MEDIUM * @tc.type : Functional
* @tc.type : Functional * @tc.level : Level 0
* @tc.level : Level 0 */
*/ it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0100", 0, async function (done) {
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100', 0, async function (done) { var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY) if (receiver == undefined) {
if (receiver != undefined) { expect(false).assertTrue();
receiver.getReceivingSurfaceId().then(id => { console.info("receiver_001 undefined");
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 getReceivingSurfaceId [' + id + "]"); done();
expect(isString(id)).assertTrue(); } else {
expect(receiver.size.width == WIDTH).assertTrue();
expect(receiver.size.height == HEIGHT).assertTrue();
expect(receiver.capacity == CAPACITY).assertTrue();
expect(receiver.format == FORMATJPEG).assertTrue();
done(); done();
}).catch(error => { }
console.log('SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 error: ' + error); });
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0200
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0200", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0200",
WIDTH,
HEIGHT,
FORMATJPEG,
"hd!"
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0100
* @tc.name : createImageReceiver-wrong format
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0100", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0100",
WIDTH,
HEIGHT,
null,
CAPACITY
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0200
* @tc.name : createImageReceiver-wrong height
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0200", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0200",
WIDTH,
null,
FORMATJPEG,
CAPACITY
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0300
* @tc.name : createImageReceiver-wrong width
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0300", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0300",
null,
HEIGHT,
FORMATJPEG,
CAPACITY
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0400
* @tc.name : createImageReceiver-wrong capacity
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0400", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0400",
WIDTH,
HEIGHT,
FORMATJPEG,
null
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0500
* @tc.name : createImageReceiver-wrong width
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0500", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0500",
false,
HEIGHT,
FORMATJPEG,
CAPACITY
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0600
* @tc.name : createImageReceiver- wrong width
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0600", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0600",
{ a: 10 },
HEIGHT,
FORMATJPEG,
CAPACITY
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0300
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0300", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0300",
WIDTH,
false,
FORMATJPEG,
CAPACITY
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0700
* @tc.name : createImageReceiver- wrong format
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0700", 0, async function (done) {
createRecriver(
done,
"SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_ERROR_0700",
WIDTH,
HEIGHT,
"form.",
CAPACITY
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400
* @tc.name : createImageReceiver
* @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
* 3.return ImageReceiver not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400", 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
if (receiver == undefined) {
expect(false).assertTrue(); expect(false).assertTrue();
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400 undefined");
done(); done();
}) } else {
} else { expect(receiver.size.width == WIDTH).assertTrue();
expect(false).assertTrue(); expect(receiver.size.height == HEIGHT).assertTrue();
done() expect(receiver.capacity == CAPACITY).assertTrue();
} expect(receiver.format == FORMATJPEG).assertTrue();
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100
* @tc.name : getReceivingSurfaceId-callback
* @tc.desc : 1.create ImageReceiver
* 2.call getReceivingSurfaceId
* 3.return SurfaceId
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
if (receiver != undefined) {
receiver.getReceivingSurfaceId((err, id) => {
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 getReceivingSurfaceId call back [' + id + "]");
expect(isString(id)).assertTrue();
done(); done();
}); }
} else { });
expect(false).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 finished'); /**
done() * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500
} * @tc.name : createImageReceiver
}) * @tc.desc : 1.set width,height,format,capacity
* 2.create ImageReceiver
/** * 3.return ImageReceiver not empty
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 * @tc.size : MEDIUM
* @tc.name : release-promise * @tc.type : Functional
* @tc.desc : 1.create ImageReceiver * @tc.level : Level 0
* 2.call release */
* @tc.size : MEDIUM it("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500", 0, async function (done) {
* @tc.type : Functional var receiver = image.createImageReceiver(WIDTH, HEIGHT, YCBCR_422_SP, CAPACITY);
* @tc.level : Level 0 if (receiver == undefined) {
*/ expect(false).assertTrue();
it('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100', 0, async function (done) { console.info("SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500 undefined");
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
if (receiver != undefined) {
receiver.release().then(() => {
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 release ');
expect(true).assertTrue();
done(); done();
}).catch(error => { } else {
expect(receiver.size.width == WIDTH).assertTrue();
expect(receiver.size.height == HEIGHT).assertTrue();
expect(receiver.capacity == CAPACITY).assertTrue();
expect(receiver.format == YCBCR_422_SP).assertTrue();
done();
}
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100
* @tc.name : getReceivingSurfaceId-promise
* @tc.desc : 1.create ImageReceiver
* 2.call getReceivingSurfaceId
* 3.return SurfaceId
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100", 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
if (receiver != undefined) {
receiver
.getReceivingSurfaceId()
.then((id) => {
console.info(
"SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 getReceivingSurfaceId [" +
id +
"]"
);
expect(isString(id)).assertTrue();
done();
})
.catch((error) => {
console.log("SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 error: " + error);
expect(false).assertTrue();
done();
});
} else {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}) }
} else { });
expect(false).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 finished'); /**
done() * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100
} * @tc.name : getReceivingSurfaceId-callback
}) * @tc.desc : 1.create ImageReceiver
* 2.call getReceivingSurfaceId
/** * 3.return SurfaceId
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 * @tc.size : MEDIUM
* @tc.name : release-callback * @tc.type : Functional
* @tc.desc : 1.create ImageReceiver * @tc.level : Level 0
* 2.call release */
* @tc.size : MEDIUM it("SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100", 0, async function (done) {
* @tc.type : Functional var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
* @tc.level : Level 0 if (receiver != undefined) {
*/ receiver.getReceivingSurfaceId((err, id) => {
it('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100', 0, async function (done) { console.info(
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY) "SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 getReceivingSurfaceId call back [" +
if (receiver != undefined) { id +
receiver.release((err) => { "]"
if (err) { );
expect(false).assertTrue(); expect(isString(id)).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 release fail');
done()
} else {
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 release call back');
expect(true).assertTrue();
done(); done();
} });
}); } else {
} else { expect(false).assertTrue();
expect(false).assertTrue(); console.info("SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 finished");
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 finished');
done()
}
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100
* @tc.name : readLatestImage-promise
* @tc.desc : 1.create ImageReceiver
* 2.call readLatestImage
* 3.return image
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
var dummy = receiver.test;
if (receiver != undefined) {
receiver.readLatestImage().then(img => {
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 readLatestImage Success');
expect(img != undefined).assertTrue();
done(); done();
}).catch(error => { }
console.log('SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 error: ' + error); });
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100
* @tc.name : release-promise
* @tc.desc : 1.create ImageReceiver
* 2.call release
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100", 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
if (receiver != undefined) {
receiver
.release()
.then(() => {
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 release ");
expect(true).assertTrue();
done();
})
.catch((error) => {
expect(false).assertTrue();
done();
});
} else {
expect(false).assertTrue(); expect(false).assertTrue();
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 finished");
done(); done();
}) }
} else { });
expect(false).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 finished'); /**
done() * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100
} * @tc.name : release-callback
}) * @tc.desc : 1.create ImageReceiver
* 2.call release
/** * @tc.size : MEDIUM
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 * @tc.type : Functional
* @tc.name : readLatestImage-callback * @tc.level : Level 0
* @tc.desc : 1.create ImageReceiver */
* 2.call readLatestImage it("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100", 0, async function (done) {
* 3.return image var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
* @tc.size : MEDIUM if (receiver != undefined) {
* @tc.type : Functional receiver.release((err) => {
* @tc.level : Level 0 if (err) {
*/ expect(false).assertTrue();
it('SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100', 0, async function (done) { console.info("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 release fail");
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY) done();
var dummy = receiver.test; } else {
if (receiver != undefined) { console.info("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 release call back");
receiver.readLatestImage((err, img) => { expect(true).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 readLatestImage call back Success'); done();
expect(img != undefined).assertTrue(); }
});
} else {
expect(false).assertTrue();
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 finished");
done(); done();
}); }
} else { });
expect(false).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 finished'); /**
done(); * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100
} * @tc.name : readLatestImage-promise
}) * @tc.desc : 1.create ImageReceiver
* 2.call readLatestImage
/** * 3.return image
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 * @tc.size : MEDIUM
* @tc.name : readNextImage-promise * @tc.type : Functional
* @tc.desc : 1.create ImageReceiver * @tc.level : Level 0
* 2.call readNextImage */
* 3.return image it("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100", 0, async function (done) {
* @tc.size : MEDIUM var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
* @tc.type : Functional var dummy = receiver.test;
* @tc.level : Level 0 if (receiver != undefined) {
*/ receiver
it('SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100', 0, async function (done) { .readLatestImage()
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY) .then((img) => {
var dummy = receiver.test; console.info("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 readLatestImage Success");
expect(receiver != undefined).assertTrue(); expect(img != undefined).assertTrue();
if (receiver != undefined) { done();
receiver.readNextImage().then(img => { })
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 readNextImage Success'); .catch((error) => {
expect(img != undefined).assertTrue(); console.log("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 error: " + error);
done() expect(false).assertTrue();
}).catch(error => { done();
console.log('SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 error: ' + error); });
} else {
expect(false).assertTrue(); expect(false).assertTrue();
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 finished");
done(); done();
}) }
} else { });
expect(false).assertTrue();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 finished'); /**
done(); * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100
} * @tc.name : readLatestImage-callback
}) * @tc.desc : 1.create ImageReceiver
* 2.call readLatestImage
/** * 3.return image
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 * @tc.size : MEDIUM
* @tc.name : readNextImage-callback * @tc.type : Functional
* @tc.desc : 1.create ImageReceiver * @tc.level : Level 0
* 2.call readNextImage */
* 3.return image it("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100", 0, async function (done) {
* @tc.size : MEDIUM var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
* @tc.type : Functional var dummy = receiver.test;
* @tc.level : Level 0 if (receiver != undefined) {
*/ receiver.readLatestImage((err, img) => {
it('SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100', 0, async function (done) { console.info(
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY) "SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 readLatestImage call back Success"
var dummy = receiver.test; );
if (receiver != undefined) {
receiver.readNextImage((err, img) => {
if (err) {
expect(false).assertTrue();
} else {
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 readNextImage call back Success');
expect(img != undefined).assertTrue(); expect(img != undefined).assertTrue();
done(); done();
} });
} else {
}) expect(false).assertTrue();
} else { console.info("SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 finished");
expect(false).assertTrue(); done();
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 finished'); }
done(); });
}
}) /**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100
/** * @tc.name : readNextImage-promise
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100 * @tc.desc : 1.create ImageReceiver
* @tc.name : getComponent-jpeg * 2.call readNextImage
* @tc.desc : 1.create ImageReceiver * 3.return image
* 2.call on * @tc.size : MEDIUM
* 3.readLatestImage * @tc.type : Functional
* 4.call getComponent * @tc.level : Level 0
* @tc.size : MEDIUM */
* @tc.type : Functional it("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100", 0, async function (done) {
* @tc.level : Level 0 var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
*/ var dummy = receiver.test;
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100', 0, async function (done) { expect(receiver != undefined).assertTrue();
getComponentP(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100', JPEG) if (receiver != undefined) {
}) receiver
.readNextImage()
/** .then((img) => {
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100 console.info("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 readNextImage Success");
* @tc.name : getComponent-YUV_U expect(img != undefined).assertTrue();
* @tc.desc : 1.create ImageReceiver done();
* 2.call on })
* 3.readLatestImage .catch((error) => {
* 4.call getComponent console.log("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 error: " + error);
* @tc.size : MEDIUM expect(false).assertTrue();
* @tc.type : Functional done();
* @tc.level : Level 0 });
*/ } else {
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100', 0, async function (done) {
getComponentP(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100', YUV_U)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100
* @tc.name : getComponent-YUV_V
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100', 0, async function (done) {
getComponentP(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100', YUV_V)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100
* @tc.name : getComponent-YUV_Y
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100', 0, async function (done) {
getComponentP(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100', YUV_Y)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100
* @tc.name : getComponent-jpeg
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100', 0, async function (done) {
getComponentCb(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100', JPEG)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100
* @tc.name : getComponent-YUV_Y
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100', 0, async function (done) {
getComponentCb(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100', YUV_Y)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100
* @tc.name : getComponent-YUV_V
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100', 0, async function (done) {
getComponentCb(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100', YUV_V)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100
* @tc.name : getComponent-YUV_U
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100', 0, async function (done) {
getComponentCb(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100', YUV_U)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100
* @tc.name : on
* @tc.desc : 1.create ImageReceiver
* 2.call on
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
if (receiver == undefined) {
expect(false).assertTrue();
done();
} else {
let pass = false;
receiver.on('imageArrival', (err) => {
if (err) {
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on err' + err);
expect(false).assertTrue();
done();
} else {
pass = true;
console.info('SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on call back IN');
}
})
var dummy = receiver.test
await sleep(2000)
expect(pass).assertTrue();
done();
}
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200
* @tc.name : release-promise
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call release
* 5.return the operation result
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
if (receiver == undefined) {
expect(false).assertTrue();
done();
return;
}
receiver.on('imageArrival', () => {
expect(true).assertTrue();
})
var dummy = receiver.test
receiver.readLatestImage().then(img => {
if (img == undefined) {
expect(false).assertTrue(); expect(false).assertTrue();
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 finished");
done(); done();
}
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100
* @tc.name : readNextImage-callback
* @tc.desc : 1.create ImageReceiver
* 2.call readNextImage
* 3.return image
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100", 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
var dummy = receiver.test;
if (receiver != undefined) {
receiver.readNextImage((err, img) => {
if (err) {
expect(false).assertTrue();
done();
} else {
console.info(
"SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 readNextImage call back Success"
);
expect(img != undefined).assertTrue();
done();
}
});
} else { } else {
expect(img.size.width == WIDTH).assertTrue(); expect(false).assertTrue();
expect(img.size.height == HEIGHT).assertTrue(); console.info("SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 finished");
expect(img.format == 12).assertTrue(); done();
expect(img.clipRect.size.width == WIDTH).assertTrue(); }
expect(img.clipRect.size.height == HEIGHT).assertTrue(); });
expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue(); /**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100
* @tc.name : getComponent-jpeg
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100", 0, async function (done) {
getComponentPromise(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100", JPEG);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100
* @tc.name : getComponent-YUV_U
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100", 0, async function (done) {
getComponentPromise(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_U_0100", YUV_U);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100
* @tc.name : getComponent-YUV_V
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100", 0, async function (done) {
getComponentPromise(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_V_0100", YUV_V);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100
* @tc.name : getComponent-YUV_Y
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100", 0, async function (done) {
getComponentPromise(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_YUV_Y_0100", YUV_Y);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100
* @tc.name : getComponent-jpeg
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100", 0, async function (done) {
getComponentCb(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_JPEG_0100", JPEG);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100
* @tc.name : getComponent-YUV_Y
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100", 0, async function (done) {
getComponentCb(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_Y_0100", YUV_Y);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100
* @tc.name : getComponent-YUV_V
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100", 0, async function (done) {
getComponentCb(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_V_0100", YUV_V);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100
* @tc.name : getComponent-YUV_U
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100", 0, async function (done) {
getComponentCb(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_CALLBACK_YUV_U_0100", YUV_U);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100
* @tc.name : on
* @tc.desc : 1.create ImageReceiver
* 2.call on
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100", 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
if (receiver == undefined) {
expect(false).assertTrue();
done();
} else {
let pass = false;
receiver.on("imageArrival", (err) => {
if (err) {
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on err" + err);
expect(false).assertTrue();
done();
} else {
pass = true;
console.info("SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on call back IN");
}
});
img.release().then(() => { var dummy = receiver.test;
expect(true).assertTrue(); await sleep(2000);
done() expect(pass).assertTrue();
}).catch(error => { done();
console.log('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200 err' + error) }
expect(false).assertTrue(); });
done();
}) /**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200
* @tc.name : release-promise
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call release
* 5.return the operation result
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200", 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
if (receiver == undefined) {
expect(false).assertTrue();
done();
return;
} }
}).catch(error => {
console.log('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200 readLatestImage err' + error)
expect(false).assertTrue();
done();
})
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0200
* @tc.name : release-callback
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call release
* 5.return the operation result
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0200', 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMAT, CAPACITY)
if (receiver == undefined) {
expect(false).assertTrue();
done();
return;
}
receiver.on('imageArrival', () => { receiver.on("imageArrival", () => {
expect(true).assertTrue(); expect(true).assertTrue();
}) });
var dummy = receiver.test;
var dummy = receiver.test receiver
.readLatestImage()
.then((img) => {
if (img == undefined) {
expect(false).assertTrue();
done();
} else {
expect(img.size.width == WIDTH).assertTrue();
expect(img.size.height == HEIGHT).assertTrue();
expect(img.format == RGBA).assertTrue();
expect(img.clipRect.size.width == WIDTH).assertTrue();
expect(img.clipRect.size.height == HEIGHT).assertTrue();
expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue();
receiver.readLatestImage((err, img) => { img.release()
if (img == undefined) { .then(() => {
expect(true).assertTrue();
done();
})
.catch((error) => {
console.log("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200 err" + error);
expect(false).assertTrue();
done();
});
}
})
.catch((error) => {
console.log("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200 readLatestImage err" + error);
expect(false).assertTrue();
done();
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0200
* @tc.name : release-callback
* @tc.desc : 1.create ImageReceiver
* 2.call on
* 3.readLatestImage
* 4.call release
* 5.return the operation result
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0200", 0, async function (done) {
var receiver = image.createImageReceiver(WIDTH, HEIGHT, FORMATJPEG, CAPACITY);
if (receiver == undefined) {
expect(false).assertTrue(); expect(false).assertTrue();
done() done();
return; return;
} }
expect(img.size.width == WIDTH).assertTrue(); receiver.on("imageArrival", () => {
expect(img.size.height == HEIGHT).assertTrue(); expect(true).assertTrue();
expect(img.format == 12).assertTrue(); });
expect(img.clipRect.size.width == WIDTH).assertTrue();
expect(img.clipRect.size.height == HEIGHT).assertTrue(); var dummy = receiver.test;
expect(img.clipRect.x == 0).assertTrue();
expect(img.clipRect.y == 0).assertTrue();
img.release((err) => { receiver.readLatestImage((err, img) => {
if (err) { if (img == undefined) {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
} else { return;
expect(true).assertTrue();
done();
} }
})
}) expect(img.size.width == WIDTH).assertTrue();
}) expect(img.size.height == HEIGHT).assertTrue();
expect(img.format == RGBA).assertTrue();
/** expect(img.clipRect.size.width == WIDTH).assertTrue();
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100 expect(img.clipRect.size.height == HEIGHT).assertTrue();
* @tc.name : getComponent-wrong format expect(img.clipRect.x == 0).assertTrue();
* @tc.desc : 1.create ImageReceiver expect(img.clipRect.y == 0).assertTrue();
* 2.call on
* 3.readLatestImage img.release((err) => {
* 4.call getComponent if (err) {
* @tc.size : MEDIUM expect(false).assertTrue();
* @tc.type : Functional done();
* @tc.level : Level 0 } else {
*/ expect(true).assertTrue();
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100', 0, async function (done) { done();
getComponentCbErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100', null) }
}) });
});
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0200
* @tc.name : getComponent-wrong format /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100
* 2.call on * @tc.name : getComponent-wrong format
* 3.readLatestImage * @tc.desc : 1.create ImageReceiver
* 4.call getComponent * 2.call on
* @tc.size : MEDIUM * 3.readLatestImage
* @tc.type : Functional * 4.call getComponent
* @tc.level : Level 0 * @tc.size : MEDIUM
*/ * @tc.type : Functional
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0200', 0, async function (done) { * @tc.level : Level 0
getComponentCbErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0200', 'ab') */
}) it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100", 0, async function (done) {
getComponentCbErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100", null);
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0300
* @tc.name : getComponent-wrong format /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0200
* 2.call on * @tc.name : getComponent-wrong format
* 3.readLatestImage * @tc.desc : 1.create ImageReceiver
* 4.call getComponent * 2.call on
* @tc.size : MEDIUM * 3.readLatestImage
* @tc.type : Functional * 4.call getComponent
* @tc.level : Level 0 * @tc.size : MEDIUM
*/ * @tc.type : Functional
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0300', 0, async function (done) { * @tc.level : Level 0
getComponentCbErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0300', 0.1) */
}) it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0200", 0, async function (done) {
getComponentCbErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0200", "ab");
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0400
* @tc.name : getComponent-wrong format /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0300
* 2.call on * @tc.name : getComponent-wrong format
* 3.readLatestImage * @tc.desc : 1.create ImageReceiver
* 4.call getComponent * 2.call on
* @tc.size : MEDIUM * 3.readLatestImage
* @tc.type : Functional * 4.call getComponent
* @tc.level : Level 0 * @tc.size : MEDIUM
*/ * @tc.type : Functional
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0400', 0, async function (done) { * @tc.level : Level 0
getComponentCbErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0400', { a: 1 }) */
}) it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0300", 0, async function (done) {
getComponentCbErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0300", 0.1);
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500
* @tc.name : getComponent-wrong format /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0400
* 2.call on * @tc.name : getComponent-wrong format
* 3.readLatestImage * @tc.desc : 1.create ImageReceiver
* 4.call getComponent * 2.call on
* @tc.size : MEDIUM * 3.readLatestImage
* @tc.type : Functional * 4.call getComponent
* @tc.level : Level 0 * @tc.size : MEDIUM
*/ * @tc.type : Functional
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500', 0, async function (done) { * @tc.level : Level 0
getComponentProErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500', null) */
}) it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0400", 0, async function (done) {
getComponentCbErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0400", { a: 1 });
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600
* @tc.name : getComponent-wrong format /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500
* 2.call on * @tc.name : getComponent-wrong format
* 3.readLatestImage * @tc.desc : 1.create ImageReceiver
* 4.call getComponent * 2.call on
* @tc.size : MEDIUM * 3.readLatestImage
* @tc.type : Functional * 4.call getComponent
* @tc.level : Level 0 * @tc.size : MEDIUM
*/ * @tc.type : Functional
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600', 0, async function (done) { * @tc.level : Level 0
getComponentProErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600', 'ab') */
}) it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500", 0, async function (done) {
getComponentProErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500", null);
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700
* @tc.name : getComponent-wrong format /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600
* 2.call on * @tc.name : getComponent-wrong format
* 3.readLatestImage * @tc.desc : 1.create ImageReceiver
* 4.call getComponent * 2.call on
* @tc.size : MEDIUM * 3.readLatestImage
* @tc.type : Functional * 4.call getComponent
* @tc.level : Level 0 * @tc.size : MEDIUM
*/ * @tc.type : Functional
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700', 0, async function (done) { * @tc.level : Level 0
getComponentProErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700', 0.1) */
}) it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600", 0, async function (done) {
getComponentProErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600", "ab");
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800
* @tc.name : getComponent-wrong format /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700
* 2.call on * @tc.name : getComponent-wrong format
* 3.readLatestImage * @tc.desc : 1.create ImageReceiver
* 4.call getComponent * 2.call on
* @tc.size : MEDIUM * 3.readLatestImage
* @tc.type : Functional * 4.call getComponent
* @tc.level : Level 0 * @tc.size : MEDIUM
*/ * @tc.type : Functional
it('SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800', 0, async function (done) { * @tc.level : Level 0
getComponentProErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800', { a: 1 }) */
}) it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700", 0, async function (done) {
getComponentProErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700", 0.1);
/** });
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100
* @tc.name : on-1 /**
* @tc.desc : 1.create ImageReceiver * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800
* 2.call on * @tc.name : getComponent-wrong format
* @tc.size : MEDIUM * @tc.desc : 1.create ImageReceiver
* @tc.type : Functional * 2.call on
* @tc.level : Level 0 * 3.readLatestImage
*/ * 4.call getComponent
it('SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100', 0, async function (done) { * @tc.size : MEDIUM
onErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100', 1) * @tc.type : Functional
}) * @tc.level : Level 0
*/
/** it("SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800", 0, async function (done) {
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200 getComponentProErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800", { a: 1 });
* @tc.name : on-null });
* @tc.desc : 1.create ImageReceiver
* 2.call on /**
* @tc.size : MEDIUM * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100
* @tc.type : Functional * @tc.name : on-1
* @tc.level : Level 0 * @tc.desc : 1.create ImageReceiver
*/ * 2.call on
it('SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200', 0, async function (done) { * @tc.size : MEDIUM
onErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200', null) * @tc.type : Functional
}) * @tc.level : Level 0
*/
/** it("SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100", 0, async function (done) {
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300 onErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100", 1);
* @tc.name : on-{a : 1} });
* @tc.desc : 1.create ImageReceiver
* 2.call on /**
* @tc.size : MEDIUM * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200
* @tc.type : Functional * @tc.name : on-null
* @tc.level : Level 0 * @tc.desc : 1.create ImageReceiver
*/ * 2.call on
it('SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300', 0, async function (done) { * @tc.size : MEDIUM
onErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300', { a: 1 }) * @tc.type : Functional
}) * @tc.level : Level 0
*/
/** it("SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200", 0, async function (done) {
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0400 onErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200", null);
* @tc.name : on-'a' });
* @tc.desc : 1.create ImageReceiver
* 2.call on /**
* @tc.size : MEDIUM * @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300
* @tc.type : Functional * @tc.name : on-{a : 1}
* @tc.level : Level 0 * @tc.desc : 1.create ImageReceiver
*/ * 2.call on
it('SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0400', 0, async function (done) { * @tc.size : MEDIUM
onErr(done, 'SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0400', 'a') * @tc.type : Functional
}) * @tc.level : Level 0
}) */
it("SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300", 0, async function (done) {
onErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300", { a: 1 });
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0400
* @tc.name : on-'a'
* @tc.desc : 1.create ImageReceiver
* 2.call on
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it("SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0400", 0, async function (done) {
onErr(done, "SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0400", "a");
});
});
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册