Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1a9b24e2
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,发现更多精彩内容 >>
提交
1a9b24e2
编写于
12月 29, 2022
作者:
B
bayanxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决ace_ets_component_three部分用例无效及存在断言设置错误、eventId冲突等问题
Signed-off-by:
N
bayanxing
<
bayanxing@kaihong.com
>
上级
3de19324
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
71 addition
and
41 deletion
+71
-41
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/button.ets
...ent_three/entry/src/main/ets/MainAbility/pages/button.ets
+23
-0
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/parallelGesture.ets
.../entry/src/main/ets/MainAbility/pages/parallelGesture.ets
+1
-1
arkui/ace_ets_component_three/entry/src/main/ets/test/AboutToDisappearJsunit.test.ets
...e/entry/src/main/ets/test/AboutToDisappearJsunit.test.ets
+1
-1
arkui/ace_ets_component_three/entry/src/main/ets/test/AnimateJsunit.test.ets
...nent_three/entry/src/main/ets/test/AnimateJsunit.test.ets
+22
-22
arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets
...onent_three/entry/src/main/ets/test/ButtonJsunit.test.ets
+18
-13
arkui/ace_ets_component_three/entry/src/main/ets/test/LongPressGesture.test.ets
...t_three/entry/src/main/ets/test/LongPressGesture.test.ets
+2
-1
arkui/ace_ets_component_three/entry/src/main/ets/test/MotionPathJsunit.test.ets
...t_three/entry/src/main/ets/test/MotionPathJsunit.test.ets
+2
-1
arkui/ace_ets_component_three/entry/src/main/ets/test/ResponseRegionJsunit.test.ets
...ree/entry/src/main/ets/test/ResponseRegionJsunit.test.ets
+1
-1
arkui/ace_ets_component_three/entry/src/main/ets/test/TabsJsunit.test.ets
...mponent_three/entry/src/main/ets/test/TabsJsunit.test.ets
+1
-1
未找到文件。
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/button.ets
浏览文件 @
1a9b24e2
...
...
@@ -115,6 +115,29 @@ struct ButtonExample {
console.info("button3 emit action state err: " + JSON.stringify(err.message))
}
})
Button('button4')
.key('button4')
.backgroundColor(0x317aff)
.width(90)
.fontColor(this.fontColorValue)
.onClick(() => {
try {
var backData = {
data: {
"fontColorValue": this.fontColorValue,
}
}
var backEvent = {
eventId: 77996,
priority: events_emitter.EventPriority.LOW
}
console.info("button4 start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("button4 emit action state err: " + JSON.stringify(err.message))
}
})
Button('Click')
.backgroundColor(0x2788D9)
.width(200)
...
...
arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/parallelGesture.ets
浏览文件 @
1a9b24e2
...
...
@@ -32,7 +32,7 @@ struct GestureSettingsExample {
}
}
var backEvent = {
eventId: 50,
eventId:
1
50,
priority: events_emitter.EventPriority.LOW
}
console.info("click to emit action state")
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/AboutToDisappearJsunit.test.ets
浏览文件 @
1a9b24e2
...
...
@@ -52,6 +52,7 @@ export default function aboutToDisappearJsunit() {
let callback = (indexEvent) => {
console.info("aboutToDisappearTest_0100 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(false);
done();
}
let indexEvent = {
eventId: 49,
...
...
@@ -65,7 +66,6 @@ export default function aboutToDisappearJsunit() {
console.info("aboutToDisappearTest_0100 click result is: " + JSON.stringify(sendEventByKey('button1', 10, "")));
await Utils.sleep(1000);
console.info('aboutToDisappearTest_0100 END');
done();
});
})
}
arkui/ace_ets_component_three/entry/src/main/ets/test/AnimateJsunit.test.ets
浏览文件 @
1a9b24e2
...
...
@@ -55,7 +55,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0100 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.duration).assertEqual('100')
ex
pec
t(indexEvent.data.duration).assertEqual('100')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -76,8 +76,8 @@ export default function animateJsunit() {
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_0
5
00 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.curve).assertEqual('Ease')
console.info("animateTest_0
2
00 get state result is: " + JSON.stringify(indexEvent))
ex
pec
t(indexEvent.data.curve).assertEqual('Ease')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -98,8 +98,8 @@ export default function animateJsunit() {
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("animateTest_0
5
00 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.iteration).assertEqual('1')
console.info("animateTest_0
3
00 get state result is: " + JSON.stringify(indexEvent))
ex
pec
t(indexEvent.data.iteration).assertEqual('1')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -121,7 +121,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0400 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.tempo).assertEqual(1000)
ex
pec
t(indexEvent.data.tempo).assertEqual(1000)
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -143,7 +143,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0500 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.playmode).assertEqual('normal')
ex
pec
t(indexEvent.data.playmode).assertEqual('normal')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -179,7 +179,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0600 get state result is: " + JSON.stringify(indexEvent))
ex
cept(indexEvent.data.duration).assertEqual('2000'
)
ex
pect(indexEvent.data.duration).assertEqual(2000
)
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -215,7 +215,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0700 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.curve).assertEqual('Linear')
ex
pec
t(indexEvent.data.curve).assertEqual('Linear')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -251,7 +251,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0800 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.iteration).assertEqual('2')
ex
pec
t(indexEvent.data.iteration).assertEqual('2')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -287,7 +287,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_0900 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.tempo).assertEqual('20000')
ex
pec
t(indexEvent.data.tempo).assertEqual('20000')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -323,7 +323,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1000 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.playmode).assertEqual('alternate')
ex
pec
t(indexEvent.data.playmode).assertEqual('alternate')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -359,7 +359,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1100 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.duration).assertEqual('-1000')
ex
pec
t(indexEvent.data.duration).assertEqual('-1000')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -395,7 +395,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1200 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.duration).assertEqual('100000000')
ex
pec
t(indexEvent.data.duration).assertEqual('100000000')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -431,7 +431,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1300 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.curve).assertEqual('123')
ex
pec
t(indexEvent.data.curve).assertEqual('123')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -467,7 +467,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1400 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.curve).assertEqual('abc')
ex
pec
t(indexEvent.data.curve).assertEqual('abc')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -503,7 +503,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1500 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.iteration).assertEqual('121212121212')
ex
pec
t(indexEvent.data.iteration).assertEqual('121212121212')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -539,7 +539,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1600 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.iteration).assertEqual('-5')
ex
pec
t(indexEvent.data.iteration).assertEqual('-5')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -575,7 +575,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1700 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.tempo).assertEqual('12121212121212')
ex
pec
t(indexEvent.data.tempo).assertEqual('12121212121212')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -611,7 +611,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1800 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.tempo).assertEqual('-5')
ex
pec
t(indexEvent.data.tempo).assertEqual('-5')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -647,7 +647,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_1900 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.playmode).assertEqual('aaa')
ex
pec
t(indexEvent.data.playmode).assertEqual('aaa')
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -683,7 +683,7 @@ export default function animateJsunit() {
}
let callback = (indexEvent) => {
console.info("animateTest_2000 get state result is: " + JSON.stringify(indexEvent))
ex
cep
t(indexEvent.data.playmode).assertEqual('123456')
ex
pec
t(indexEvent.data.playmode).assertEqual('123456')
}
try {
events_emitter.on(indexEvent, callback);
...
...
arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets
浏览文件 @
1a9b24e2
...
...
@@ -42,6 +42,11 @@ export default function buttonJsunit() {
done()
});
beforeEach(async function () {
await Utils.sleep(1000);
console.info("button before each called");
})
afterEach(async function () {
await Utils.sleep(1000);
console.info("button after each called");
...
...
@@ -65,7 +70,7 @@ export default function buttonJsunit() {
let obj = JSON.parse(strJson);
console.info("[testButton02] component obj is: " + JSON.stringify(obj));
expect(obj.$type).assertEqual('Button');
expect(obj.$attrs.type).assertEqual('ButtonType.
Normal
');
expect(obj.$attrs.type).assertEqual('ButtonType.
Capsule
');
done();
});
...
...
@@ -243,7 +248,8 @@ export default function buttonJsunit() {
}
let callback = (indexEvent) => {
console.info("testButton10 get state result is: " + JSON.stringify(indexEvent))
except(indexEvent.data.fontColorValue).assertEqual(Color.Pink)
expect(indexEvent.data.fontColorValue).assertEqual(Color.Pink)
done();
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -253,7 +259,6 @@ export default function buttonJsunit() {
console.info("testButton10 click result is: " + JSON.stringify(sendEventByKey('button3', 10, "")));
await Utils.sleep(1000);
console.info('[testButton10] END');
done();
});
it('testButton11', 0, async function (done) {
...
...
@@ -280,7 +285,8 @@ export default function buttonJsunit() {
}
let callback = (indexEvent) => {
console.info("testButton11 get state result is: " + JSON.stringify(indexEvent))
except(indexEvent.data.fontColorValue).assertEqual(332)
expect(indexEvent.data.fontColorValue).assertEqual(332)
done();
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -290,7 +296,6 @@ export default function buttonJsunit() {
console.info("testButton11 click result is: " + JSON.stringify(sendEventByKey('button2', 10, "")));
await Utils.sleep(1000);
console.info('[testButton11] END');
done();
});
it('testButton12', 0, async function (done) {
...
...
@@ -305,6 +310,7 @@ export default function buttonJsunit() {
expect(event.screenY).assertEqual(485)
expect(event.x).assertEqual(100)
expect(event.y).assertEqual(50)
done();
}
var innerEvent = {
eventId: 4,
...
...
@@ -318,7 +324,6 @@ export default function buttonJsunit() {
console.info('[testButton12] sendEventByKey ' + JSON.stringify(sendEventByKey('buttonClick', 10, "")));
await Utils.sleep(1000)
console.info('[testButton12] testSendTouchEvent END');
done();
});
it('testButton13', 0, async function (done) {
...
...
@@ -378,7 +383,7 @@ export default function buttonJsunit() {
try {
let eventData = {
data: {
"fontColorValue":
ab996
"fontColorValue":
"ab996"
}
}
let indexEventOne = {
...
...
@@ -390,14 +395,17 @@ export default function buttonJsunit() {
} catch (err) {
console.log("testButton15 change component data error: " + err.message);
}
await Utils.sleep(
10
00);
await Utils.sleep(
5
00);
let indexEvent = {
eventId: 77,
eventId: 77
996
,
priority: events_emitter.EventPriority.LOW
}
let callback = (indexEvent) => {
console.info("testButton15 get state result is: " + JSON.stringify(indexEvent))
except(indexEvent.data.fontColorValue).assertEqual('ab996')
console.info("testButton15 indexEvent.data.fontColorValue is: " + indexEvent.data.fontColorValue)
expect(indexEvent.data.fontColorValue).assertEqual('ab996')
console.info('[testButton15] END');
done();
}
try {
events_emitter.on(indexEvent, callback);
...
...
@@ -405,9 +413,6 @@ export default function buttonJsunit() {
console.info("testButton15 on events_emitter err : " + JSON.stringify(err));
}
console.info("testButton15 click result is: " + JSON.stringify(sendEventByKey('button4', 10, "")));
await Utils.sleep(1000);
console.info('[testButton15] END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_component_three/entry/src/main/ets/test/LongPressGesture.test.ets
浏览文件 @
1a9b24e2
...
...
@@ -52,6 +52,7 @@ export default function longPressGestureJsunit() {
let callback = (eventData) => {
console.info("testLongPressGesture01 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual('onAction')
done();
}
let innerEvent = {
eventId: 125,
...
...
@@ -75,6 +76,7 @@ export default function longPressGestureJsunit() {
let callback = (eventData) => {
console.info("testLongPressGesture02 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual('onActionEnd')
done();
}
let innerEvent = {
eventId: 126,
...
...
@@ -89,7 +91,6 @@ export default function longPressGestureJsunit() {
console.info("testLongPressGesture02 sendEventByKey result: " + JSON.stringify(sendEventByKey('flex', 11, "")));
await Utils.sleep(1000);
console.info('testLongPressGesture02 END');
done();
});
})
}
arkui/ace_ets_component_three/entry/src/main/ets/test/MotionPathJsunit.test.ets
浏览文件 @
1a9b24e2
...
...
@@ -62,6 +62,7 @@ export default function motionPathJsunit() {
console.info("motionPathTest_0200 get state result is: " + JSON.stringify(indexEventOne));
expect(indexEventOne.data.fromX).assertEqual(0);
expect(indexEventOne.data.toY).assertEqual(1);
done();
}
let indexEventOne = {
eventId: 133,
...
...
@@ -84,6 +85,7 @@ export default function motionPathJsunit() {
let callback = (indexEvent) => {
console.info("motionPathTest_0300 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
done();
}
let indexEvent = {
eventId: 132,
...
...
@@ -97,7 +99,6 @@ export default function motionPathJsunit() {
console.info("motionPathTest_0300 click result is: " + JSON.stringify(sendEventByKey('button', 10, "")));
await Utils.sleep(1000);
console.info('motionPathTest_0300 END');
done();
});
})
}
arkui/ace_ets_component_three/entry/src/main/ets/test/ResponseRegionJsunit.test.ets
浏览文件 @
1a9b24e2
...
...
@@ -87,6 +87,7 @@ export default function ResponseRegionJsunit() {
console.info("[testResponseRegion02] get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual(true)
expect(eventData.data.EVENT_TYPE).assertEqual('Down')
done();
}
var innerEventTwo = {
eventId: 31,
...
...
@@ -100,7 +101,6 @@ export default function ResponseRegionJsunit() {
console.info('[testResponseRegion02] testSendTouchEvent ' + sendTouchEvent(point));
await Utils.sleep(1000)
console.info('[testResponseRegion02] END');
done();
});
})
}
arkui/ace_ets_component_three/entry/src/main/ets/test/TabsJsunit.test.ets
浏览文件 @
1a9b24e2
...
...
@@ -286,6 +286,7 @@ export default function tabsJsunit() {
let callback = (indexEvent) => {
console.info("testTabs_1400 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
done();
}
let indexEvent = {
eventId: 212,
...
...
@@ -299,7 +300,6 @@ export default function tabsJsunit() {
console.info("testTabs_1400 click result is: " + JSON.stringify(sendEventByKey('tabContent1', 10, "")));
await Utils.sleep(1000);
console.info('testTabs_1400 END');
done();
});
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录