Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
32e75430
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
32e75430
编写于
10月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5454 image modify receiver-yuv testcase
Merge pull request !5454 from caochuan/image/raw
上级
e513872c
2796b31d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
1136 addition
and
1046 deletion
+1136
-1046
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
..._standard/imageReceiver/src/main/js/test/receiver.test.js
+1136
-1046
未找到文件。
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
浏览文件 @
32e75430
...
...
@@ -12,1118 +12,1208 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
image
from
'
@ohos.multimedia.image
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
image
from
"
@ohos.multimedia.image
"
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
@ohos/hypium
"
;
export
default
function
ImageReceiver
()
{
describe
(
'
ImageReceiver
'
,
function
()
{
const
YUV_Y
=
1
;
const
YUV_U
=
2
;
const
YUV_V
=
3
;
const
JPEG
=
4
;
const
WIDTH
=
8192
;
const
HEIGHT
=
8
;
const
FORMAT
=
4
;
const
CAPACITY
=
8
;
const
YCBCR_422_SP
=
1000
;
const
FORMATJPEG
=
2000
;
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
})
afterAll
(
async
function
()
{
console
.
info
(
'
afterAll case
'
);
})
async
function
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
();
describe
(
"
ImageReceiver
"
,
function
()
{
const
WIDTH
=
8192
;
const
HEIGHT
=
8
;
const
CAPACITY
=
8
;
const
RGBA
=
12
;
const
{
JPEG
:
FORMATJPEG
,
YCBCR_422_SP
}
=
image
.
ImageFormat
;
const
{
YUV_Y
,
YUV_U
,
YUV_V
,
JPEG
}
=
image
.
ComponentType
;
beforeAll
(
async
function
()
{
console
.
info
(
"
beforeAll case
"
);
});
beforeEach
(
function
()
{
console
.
info
(
"
beforeEach case
"
);
});
afterEach
(
async
function
()
{
console
.
info
(
"
afterEach case
"
);
});
afterAll
(
async
function
()
{
console
.
info
(
"
afterAll case
"
);
});
async
function
sleep
(
times
=
200
)
{
await
new
Promise
((
res
)
=>
setTimeout
(()
=>
{
res
();
},
times
)
);
}
}
async
function
getComponentProErr
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
if
(
once
)
{
return
;
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
();
}
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
==
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
();
try
{
await
img
.
getComponent
(
param
);
expect
(
false
).
assertTrue
();
}
catch
(
error
)
{
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
}
async
function
getComponentProErr
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
}
}
})
expect
(
true
).
assertTrue
();
})
var
dummy
=
receiver
.
test
;
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
{
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
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
async
function
getComponentCbErr
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
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
)
{
return
;
}
once
=
true
;
receiver
.
readLatestImage
(
async
(
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
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
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
clipRect
.
x
==
0
).
assertTrue
();
expect
(
img
.
clipRect
.
y
==
0
).
assertTrue
();
try
{
img
.
getComponent
(
param
,
(
err
,
component
)
=>
{
expect
(
false
).
assertTrue
();
img
.
getComponent
(
param
)
.
then
((
component
)
=>
{
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
)
{
expect
(
error
.
code
==
1
).
assertTrue
(
);
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
}
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
(
);
done
();
});
}
})
})
;
expect
(
true
).
assertTrue
();
})
})
;
var
dummy
=
receiver
.
test
;
}
}
async
function
getComponentP
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
if
(
once
)
{
async
function
getComponentCb
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
YCBCR_422_SP
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
once
=
true
;
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
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
).
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
)
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
}
once
=
true
;
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
})
}
})
expect
(
true
).
assertTrue
();
})
var
dummy
=
receiver
.
test
;
}
async
function
getComponentCb
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
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
();
img
.
getComponent
(
param
,
(
err
,
component
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
log
(
`
${
testNum
}
geterror: `
+
err
);
done
();
}
else
{
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
'
,
()
=>
{
if
(
once
)
{
return
;
}
once
=
true
;
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
async
function
onErr
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
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
();
}
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
();
}
})
}
})
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
;
}
var
dummy
=
receiver
.
test
;
}
}
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
();
function
isString
(
value
)
{
return
typeof
value
===
"
string
"
;
}
})
/**
* @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
,
FORMAT
,
CAPACITY
)
if
(
receiver
!=
undefined
)
{
receiver
.
getReceivingSurfaceId
().
then
(
id
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 getReceivingSurfaceId [
'
+
id
+
"
]
"
);
expect
(
isString
(
id
)).
assertTrue
();
/**
* @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
,
FORMATJPEG
,
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
==
FORMATJPEG
).
assertTrue
();
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
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400 undefined
"
);
done
();
})
}
else
{
expect
(
false
).
assertTrue
();
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.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
();
}
else
{
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
expect
(
receiver
.
format
==
FORMATJPEG
).
assertTrue
();
done
();
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 finished
'
);
done
()
}
})
/**
* @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
,
FORMAT
,
CAPACITY
)
if
(
receiver
!=
undefined
)
{
receiver
.
release
().
then
(()
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 release
'
);
expect
(
true
).
assertTrue
();
}
});
/**
* @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
();
}).
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
();
done
();
})
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_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.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
!=
undefined
)
{
receiver
.
release
((
err
)
=>
{
if
(
err
)
{
expect
(
false
).
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
();
}
});
/**
* @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
,
FORMATJPEG
,
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
();
}
});
}
else
{
expect
(
false
).
assertTrue
();
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
();
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 finished
"
);
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
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 finished
"
);
done
();
})
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_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.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
receiver
.
readLatestImage
((
err
,
img
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 readLatestImage call back Success
'
);
expect
(
img
!=
undefined
).
assertTrue
();
}
});
/**
* @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.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
if
(
receiver
!=
undefined
)
{
receiver
.
release
((
err
)
=>
{
if
(
err
)
{
expect
(
false
).
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
();
}
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 finished
"
);
done
();
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 finished
'
);
done
();
}
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100
* @tc.name : readNextImage-promise
* @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_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
var
dummy
=
receiver
.
test
;
expect
(
receiver
!=
undefined
).
assertTrue
();
if
(
receiver
!=
undefined
)
{
receiver
.
readNextImage
().
then
(
img
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 readNextImage Success
'
);
expect
(
img
!=
undefined
).
assertTrue
();
done
()
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 error:
'
+
error
);
}
});
/**
* @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
,
FORMATJPEG
,
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
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 finished
"
);
done
();
})
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 finished
'
);
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
,
FORMAT
,
CAPACITY
)
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
'
);
}
});
/**
* @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.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
receiver
.
readLatestImage
((
err
,
img
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 readLatestImage call back Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
}
})
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 finished
'
);
done
();
}
})
/**
* @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
)
{
getComponentP
(
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
)
{
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
)
{
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 finished
"
);
done
();
}
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100
* @tc.name : readNextImage-promise
* @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_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
var
dummy
=
receiver
.
test
;
expect
(
receiver
!=
undefined
).
assertTrue
();
if
(
receiver
!=
undefined
)
{
receiver
.
readNextImage
()
.
then
((
img
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 readNextImage Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 finished
"
);
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
{
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
();
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 finished
"
);
done
();
}
});
/**
* @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
(()
=>
{
expect
(
true
).
assertTrue
();
done
()
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200 err
'
+
error
)
expect
(
false
).
assertTrue
();
done
();
})
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
,
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
'
,
()
=>
{
expect
(
true
).
assertTrue
();
})
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
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
)
=>
{
if
(
img
==
undefined
)
{
img
.
release
()
.
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
();
done
()
done
()
;
return
;
}
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
();
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
expect
(
true
).
assertTrue
();
});
var
dummy
=
receiver
.
test
;
img
.
release
((
err
)
=>
{
if
(
err
)
{
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
expect
(
true
).
assertTrue
();
done
();
return
;
}
})
})
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100
* @tc.name : getComponent-wrong format
* @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_ERROR_0100
'
,
0
,
async
function
(
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
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
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_0300
* @tc.name : getComponent-wrong format
* @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_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_0400
* @tc.name : getComponent-wrong format
* @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_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_0500
* @tc.name : getComponent-wrong format
* @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_ERROR_0500
'
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
'
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500
'
,
null
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600
* @tc.name : getComponent-wrong format
* @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_ERROR_0600
'
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
'
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600
'
,
'
ab
'
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700
* @tc.name : getComponent-wrong format
* @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_ERROR_0700
'
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
'
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700
'
,
0.1
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800
* @tc.name : getComponent-wrong format
* @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_ERROR_0800
'
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
'
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800
'
,
{
a
:
1
})
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100
* @tc.name : on-1
* @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_0100
'
,
0
,
async
function
(
done
)
{
onErr
(
done
,
'
SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100
'
,
1
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200
* @tc.name : on-null
* @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_0200
'
,
0
,
async
function
(
done
)
{
onErr
(
done
,
'
SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200
'
,
null
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300
* @tc.name : on-{a : 1}
* @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_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
'
)
})
})
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
();
img
.
release
((
err
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
expect
(
true
).
assertTrue
();
done
();
}
});
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100
* @tc.name : getComponent-wrong format
* @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_ERROR_0100
"
,
0
,
async
function
(
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
* 2.call on
* 3.readLatestImage
* 4.call getComponent
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
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_0300
* @tc.name : getComponent-wrong format
* @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_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_0400
* @tc.name : getComponent-wrong format
* @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_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_0500
* @tc.name : getComponent-wrong format
* @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_ERROR_0500
"
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0500
"
,
null
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600
* @tc.name : getComponent-wrong format
* @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_ERROR_0600
"
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0600
"
,
"
ab
"
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700
* @tc.name : getComponent-wrong format
* @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_ERROR_0700
"
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0700
"
,
0.1
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800
* @tc.name : getComponent-wrong format
* @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_ERROR_0800
"
,
0
,
async
function
(
done
)
{
getComponentProErr
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0800
"
,
{
a
:
1
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100
* @tc.name : on-1
* @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_0100
"
,
0
,
async
function
(
done
)
{
onErr
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0100
"
,
1
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200
* @tc.name : on-null
* @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_0200
"
,
0
,
async
function
(
done
)
{
onErr
(
done
,
"
SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0200
"
,
null
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_IMAGERECEIVER_ON_ERROR_0300
* @tc.name : on-{a : 1}
* @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_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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录