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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
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,41 +12,39 @@
* 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
;
describe
(
"
ImageReceiver
"
,
function
()
{
const
WIDTH
=
8192
;
const
HEIGHT
=
8
;
const
FORMAT
=
4
;
const
CAPACITY
=
8
;
const
YCBCR_422_SP
=
1000
;
const
FORMATJPEG
=
2000
;
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
'
);
})
console
.
info
(
"
beforeAll case
"
);
});
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
console
.
info
(
"
beforeEach case
"
);
});
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
})
console
.
info
(
"
afterEach case
"
);
});
afterAll
(
async
function
()
{
console
.
info
(
'
afterAll case
'
);
})
console
.
info
(
"
afterAll case
"
);
});
async
function
sleep
(
times
=
200
)
{
await
new
Promise
(
res
=>
setTimeout
(()
=>
{
res
()
},
times
));
await
new
Promise
((
res
)
=>
setTimeout
(()
=>
{
res
();
},
times
)
);
}
async
function
createRecriver
(
done
,
testNum
,
wid
,
hei
,
fmt
,
cap
)
{
...
...
@@ -62,13 +60,13 @@ describe('ImageReceiver', function () {
}
async
function
getComponentProErr
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
);
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
}
...
...
@@ -80,7 +78,7 @@ describe('ImageReceiver', function () {
}
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
();
...
...
@@ -88,27 +86,28 @@ describe('ImageReceiver', function () {
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
);
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
}
...
...
@@ -120,7 +119,7 @@ describe('ImageReceiver', function () {
}
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
();
...
...
@@ -128,29 +127,29 @@ describe('ImageReceiver', function () {
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
getComponentP
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
);
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
();
done
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
}
...
...
@@ -162,45 +161,45 @@ describe('ImageReceiver', function () {
}
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
();
img
.
getComponent
(
param
).
then
(
component
=>
{
img
.
getComponent
(
param
)
.
then
((
component
)
=>
{
if
(
component
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
return
;
}
expect
(
component
.
componentType
==
param
).
assertTrue
();
expect
(
component
.
byteBuffer
!=
undefined
).
assertTrue
();
expect
(
component
.
rowStride
==
0
).
assertTrue
();
expect
(
component
.
pixelStride
==
0
).
assertTrue
();
expect
(
component
.
rowStride
==
8192
).
assertTrue
();
expect
(
component
.
pixelStride
==
1
).
assertTrue
();
done
();
}
}).
catch
(
error
=>
{
console
.
log
(
`
${
testNum
}
error:`
+
error
)
})
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error:`
+
error
);
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
);
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
YCBCR_422_SP
,
CAPACITY
);
let
once
=
false
;
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
if
(
once
)
{
return
;
}
...
...
@@ -212,34 +211,34 @@ describe('ImageReceiver', function () {
}
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
();
img
.
getComponent
(
param
,
(
err
,
component
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
log
(
`
${
testNum
}
geterror: `
+
err
)
console
.
log
(
`
${
testNum
}
geterror: `
+
err
);
done
();
}
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
();
expect
(
component
.
rowStride
==
8192
).
assertTrue
();
expect
(
component
.
pixelStride
==
1
).
assertTrue
();
done
();
}
})
});
}
})
});
expect
(
true
).
assertTrue
();
})
});
var
dummy
=
receiver
.
test
;
}
async
function
onErr
(
done
,
testNum
,
param
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
);
expect
(
receiver
!=
undefined
).
assertTrue
();
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
...
...
@@ -248,7 +247,7 @@ describe('ImageReceiver', function () {
try
{
receiver
.
on
(
param
,
()
=>
{
expect
(
false
).
assertTrue
();
})
});
}
catch
(
error
)
{
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
...
...
@@ -256,11 +255,10 @@ describe('ImageReceiver', function () {
}
var
dummy
=
receiver
.
test
;
}
}
function
isString
(
value
)
{
return
typeof
value
===
'
string
'
;
return
typeof
value
===
"
string
"
;
}
/**
...
...
@@ -273,20 +271,20 @@ describe('ImageReceiver', function () {
* @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
)
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
'
)
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
();
expect
(
receiver
.
format
==
FORMATJPEG
).
assertTrue
();
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0200
...
...
@@ -298,9 +296,16 @@ describe('ImageReceiver', function () {
* @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!
'
)
})
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
...
...
@@ -312,9 +317,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -326,9 +338,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -340,9 +359,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -354,9 +380,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -368,9 +401,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -382,9 +422,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -396,9 +443,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -410,9 +464,16 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -424,11 +485,11 @@ describe('ImageReceiver', function () {
* @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
)
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
'
)
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0400 undefined
"
);
done
();
}
else
{
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
...
...
@@ -437,7 +498,7 @@ describe('ImageReceiver', function () {
expect
(
receiver
.
format
==
FORMATJPEG
).
assertTrue
();
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500
...
...
@@ -449,11 +510,11 @@ describe('ImageReceiver', function () {
* @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
)
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
'
)
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_CREATEIMAGERECEIVER_0500 undefined
"
);
done
();
}
else
{
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
...
...
@@ -462,7 +523,7 @@ describe('ImageReceiver', function () {
expect
(
receiver
.
format
==
YCBCR_422_SP
).
assertTrue
();
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100
...
...
@@ -474,23 +535,30 @@ describe('ImageReceiver', function () {
* @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
)
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
+
"
]
"
);
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
);
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
});
}
else
{
expect
(
false
).
assertTrue
();
done
()
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100
...
...
@@ -502,20 +570,24 @@ describe('ImageReceiver', function () {
* @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
)
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
+
"
]
"
);
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_GETRECEIVINGSURFACEID_CALLBACK_0100 finished
'
);
done
()
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_GETRECEIVINGSURFACEID_CALLBACK_0100 finished
"
);
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100
...
...
@@ -526,23 +598,26 @@ describe('ImageReceiver', function () {
* @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
)
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
'
);
receiver
.
release
()
.
then
(()
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 release
"
);
expect
(
true
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
})
.
catch
((
error
)
=>
{
expect
(
false
).
assertTrue
();
done
();
})
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 finished
'
);
done
()
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0100 finished
"
);
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100
...
...
@@ -553,26 +628,26 @@ describe('ImageReceiver', function () {
* @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
)
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
()
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
'
);
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
()
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_CALLBACK_0100 finished
"
);
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100
...
...
@@ -584,25 +659,28 @@ describe('ImageReceiver', function () {
* @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
)
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
'
);
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
);
})
.
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
()
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_PROMISE_0100 finished
"
);
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100
...
...
@@ -614,21 +692,23 @@ describe('ImageReceiver', function () {
* @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
)
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
'
);
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_READLATESTIMAGE_CALLBACK_0100 finished
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READLATESTIMAGE_CALLBACK_0100 finished
"
);
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100
...
...
@@ -640,26 +720,29 @@ describe('ImageReceiver', function () {
* @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
)
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
'
);
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
();
})
.
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
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_PROMISE_0100 finished
"
);
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100
...
...
@@ -671,26 +754,28 @@ describe('ImageReceiver', function () {
* @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
)
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
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 readNextImage call back Success
"
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
}
})
});
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 finished
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_READNEXTIMAGE_CALLBACK_0100 finished
"
);
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_PROMISE_JPEG_0100
...
...
@@ -703,9 +788,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -718,9 +803,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -733,9 +818,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -748,9 +833,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -763,9 +848,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -778,9 +863,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -793,9 +878,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -808,9 +893,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -821,30 +906,30 @@ describe('ImageReceiver', function () {
* @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
)
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
)
=>
{
receiver
.
on
(
"
imageArrival
"
,
(
err
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on err
'
+
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
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RECEIVER_RECEIVERON_0100 on call back IN
"
);
}
})
});
var
dummy
=
receiver
.
test
await
sleep
(
2000
)
var
dummy
=
receiver
.
test
;
await
sleep
(
2000
);
expect
(
pass
).
assertTrue
();
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_RELEASE_PROMISE_0200
...
...
@@ -858,48 +943,53 @@ describe('ImageReceiver', function () {
* @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
)
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
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
expect
(
true
).
assertTrue
();
})
});
var
dummy
=
receiver
.
test
var
dummy
=
receiver
.
test
;
receiver
.
readLatestImage
().
then
(
img
=>
{
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
==
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
();
img
.
release
().
then
(()
=>
{
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
)
.
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
...
...
@@ -913,30 +1003,30 @@ describe('ImageReceiver', function () {
* @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
)
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
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
receiver
.
on
(
"
imageArrival
"
,
()
=>
{
expect
(
true
).
assertTrue
();
})
});
var
dummy
=
receiver
.
test
var
dummy
=
receiver
.
test
;
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
img
==
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
.
format
==
RGBA
).
assertTrue
();
expect
(
img
.
clipRect
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
clipRect
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
clipRect
.
x
==
0
).
assertTrue
();
...
...
@@ -950,9 +1040,9 @@ describe('ImageReceiver', function () {
expect
(
true
).
assertTrue
();
done
();
}
})
})
})
});
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RECEIVER_GETCOMPONENT_ERROR_0100
...
...
@@ -965,9 +1055,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -980,9 +1070,9 @@ describe('ImageReceiver', function () {
* @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
'
)
})
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
...
...
@@ -995,9 +1085,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -1010,9 +1100,9 @@ describe('ImageReceiver', function () {
* @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
})
})
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
...
...
@@ -1025,9 +1115,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -1040,9 +1130,9 @@ describe('ImageReceiver', function () {
* @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
'
)
})
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
...
...
@@ -1055,9 +1145,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -1070,9 +1160,9 @@ describe('ImageReceiver', function () {
* @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
})
})
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
...
...
@@ -1083,9 +1173,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -1096,9 +1186,9 @@ describe('ImageReceiver', function () {
* @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
)
})
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
...
...
@@ -1109,9 +1199,9 @@ describe('ImageReceiver', function () {
* @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
})
})
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
...
...
@@ -1122,8 +1212,8 @@ describe('ImageReceiver', function () {
* @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
'
)
})
})
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录