Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b9d59d0e
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看板
未验证
提交
b9d59d0e
编写于
7月 05, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3987 Image master新增xts合入
Merge pull request !3987 from 秦莉文/master
上级
9725b692
e284019e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
128 addition
and
129 deletion
+128
-129
multimedia/image/image_js_standard/imageReceiver/src/main/java/ohos/acts/multimedia/image/MainAbility.java
...src/main/java/ohos/acts/multimedia/image/MainAbility.java
+0
-34
multimedia/image/image_js_standard/imageReceiver/src/main/java/ohos/acts/multimedia/image/MyApplication.java
...c/main/java/ohos/acts/multimedia/image/MyApplication.java
+0
-28
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
..._standard/imageReceiver/src/main/js/test/receiver.test.js
+128
-67
未找到文件。
multimedia/image/image_js_standard/imageReceiver/src/main/java/ohos/acts/multimedia/image/MainAbility.java
已删除
100644 → 0
浏览文件 @
9725b692
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
ohos.acts.multimedia.image
;
import
ohos.ace.ability.AceAbility
;
import
ohos.aafwk.content.Intent
;
/*
* java MainAbility
*/
public
class
MainAbility
extends
AceAbility
{
@Override
public
void
onStart
(
Intent
intent
)
{
super
.
onStart
(
intent
);
}
@Override
public
void
onStop
()
{
super
.
onStop
();
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageReceiver/src/main/java/ohos/acts/multimedia/image/MyApplication.java
已删除
100644 → 0
浏览文件 @
9725b692
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
ohos.acts.multimedia.image
;
import
ohos.aafwk.ability.AbilityPackage
;
/*
* java MyApplication
*/
public
class
MyApplication
extends
AbilityPackage
{
@Override
public
void
onInitialize
()
{
super
.
onInitialize
();
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageReceiver/src/main/js/test/receiver.test.js
浏览文件 @
b9d59d0e
...
...
@@ -25,6 +25,8 @@ describe('ImageReceiver', function () {
const
HEIGHT
=
8
;
const
FORMAT
=
4
;
const
CAPACITY
=
8
;
const
YCBCR_422_SP
=
1000
;
const
FORMATJPEG
=
2000
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -63,19 +65,19 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
;
}
else
{
done
()
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
expect
(
true
).
assertTrue
();
})
var
dummy
=
receiver
.
test
receiver
.
readLatestImage
(
async
(
err
,
img
)
=>
{
receiver
.
readLatestImage
(
async
(
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
;
}
else
{
done
()
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
12
).
assertTrue
();
...
...
@@ -100,19 +102,19 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
;
}
else
{
done
()
}
else
{
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
expect
(
true
).
assertTrue
();
})
var
dummy
=
receiver
.
test
receiver
.
readLatestImage
(
async
(
err
,
img
)
=>
{
receiver
.
readLatestImage
(
async
(
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
()
;
}
else
{
done
()
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
12
).
assertTrue
();
...
...
@@ -138,7 +140,8 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
done
()
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -151,7 +154,7 @@ describe('ImageReceiver', function () {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
12
).
assertTrue
();
...
...
@@ -164,9 +167,11 @@ describe('ImageReceiver', function () {
if
(
component
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
}
else
{
expect
(
component
.
componentType
==
param
).
assertTrue
();
expect
(
component
.
byteBuffer
!=
undefined
).
assertTrue
();
expect
(
component
.
rowStride
==
0
).
assertTrue
();
expect
(
component
.
pixelStride
==
0
).
assertTrue
();
done
();
}
}).
catch
(
error
=>
{
...
...
@@ -182,7 +187,8 @@ describe('ImageReceiver', function () {
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMAT
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
done
()
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -195,7 +201,7 @@ describe('ImageReceiver', function () {
if
(
err
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
}
else
{
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
img
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
img
.
format
==
12
).
assertTrue
();
...
...
@@ -205,13 +211,15 @@ describe('ImageReceiver', function () {
expect
(
img
.
clipRect
.
y
==
0
).
assertTrue
();
img
.
getComponent
(
param
,
(
err
,
component
)
=>
{
if
(
err
)
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
log
(
`
${
testNum
}
geterror: `
+
err
)
}
else
{
}
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
();
}
})
...
...
@@ -225,7 +233,7 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
}
else
{
try
{
receiver
.
on
(
param
,
()
=>
{
expect
(
false
).
assertTrue
();
...
...
@@ -241,7 +249,7 @@ describe('ImageReceiver', function () {
}
function
isString
(
value
)
{
return
typeof
value
===
'
string
'
;
return
typeof
value
===
'
string
'
;
}
/**
...
...
@@ -395,6 +403,56 @@ describe('ImageReceiver', function () {
createRecriver
(
done
,
'
Receiver_001-9
'
,
WIDTH
,
HEIGHT
,
'
form.
'
,
CAPACITY
)
})
/**
* @tc.number : Receiver_001-10
* @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
(
'
Receiver_001-10
'
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
FORMATJPEG
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_001-10 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 : Receiver_001-11
* @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
(
'
Receiver_001-11
'
,
0
,
async
function
(
done
)
{
var
receiver
=
image
.
createImageReceiver
(
WIDTH
,
HEIGHT
,
YCBCR_422_SP
,
CAPACITY
)
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_001-11 undefined
'
)
done
();
}
else
{
expect
(
receiver
.
size
.
width
==
WIDTH
).
assertTrue
();
expect
(
receiver
.
size
.
height
==
HEIGHT
).
assertTrue
();
expect
(
receiver
.
capacity
==
CAPACITY
).
assertTrue
();
expect
(
receiver
.
format
==
YCBCR_422_SP
).
assertTrue
();
done
();
}
})
/**
* @tc.number : Receiver_002
* @tc.name : getReceivingSurfaceId-promise
...
...
@@ -491,7 +549,7 @@ describe('ImageReceiver', function () {
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_005 release fail
'
);
done
()
;
done
()
}
else
{
console
.
info
(
'
Receiver_005 release call back
'
);
expect
(
true
).
assertTrue
();
...
...
@@ -501,7 +559,7 @@ describe('ImageReceiver', function () {
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_005 finished
'
);
done
()
;
done
()
}
})
...
...
@@ -531,7 +589,7 @@ describe('ImageReceiver', function () {
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
Receiver_006 finished
'
);
done
()
;
done
()
}
})
...
...
@@ -579,7 +637,7 @@ describe('ImageReceiver', function () {
receiver
.
readNextImage
().
then
(
img
=>
{
console
.
info
(
'
Receiver_008 readNextImage Success
'
);
expect
(
img
!=
undefined
).
assertTrue
();
done
()
;
done
()
}).
catch
(
error
=>
{
console
.
log
(
'
Receiver_008 error:
'
+
error
);
expect
(
false
).
assertTrue
();
...
...
@@ -607,9 +665,9 @@ describe('ImageReceiver', function () {
var
dummy
=
receiver
.
test
;
if
(
receiver
!=
undefined
)
{
receiver
.
readNextImage
((
err
,
img
)
=>
{
if
(
err
)
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
}
else
{
}
else
{
console
.
info
(
'
Receiver_009 readNextImage call back Success
'
);
expect
(
img
!=
undefined
).
assertTrue
();
done
();
...
...
@@ -757,14 +815,14 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
}
else
{
let
pass
=
false
;
receiver
.
on
(
'
imageArrival
'
,
(
err
)
=>
{
if
(
err
)
{
console
.
info
(
'
Receiver_011 on err
'
+
err
);
if
(
err
)
{
console
.
info
(
'
Receiver_011 on err
'
+
err
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
}
else
{
pass
=
true
;
console
.
info
(
'
Receiver_011 on call back IN
'
);
}
...
...
@@ -794,6 +852,7 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -848,6 +907,7 @@ describe('ImageReceiver', function () {
if
(
receiver
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
receiver
.
on
(
'
imageArrival
'
,
()
=>
{
...
...
@@ -856,10 +916,11 @@ describe('ImageReceiver', function () {
var
dummy
=
receiver
.
test
receiver
.
readLatestImage
((
err
,
img
)
=>
{
receiver
.
readLatestImage
((
err
,
img
)
=>
{
if
(
img
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
done
()
return
;
}
expect
(
img
.
size
.
width
==
WIDTH
).
assertTrue
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录