Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
dc12624e
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,发现更多精彩内容 >>
提交
dc12624e
编写于
9月 19, 2022
作者:
B
bayanxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ace_ets_component部分用例未走回调便判断pass问题修复
Signed-off-by:
N
bayanxing
<
bayanxing@kaihong.com
>
上级
e84cc522
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
84 addition
and
104 deletion
+84
-104
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets
...component/entry/src/main/ets/MainAbility/pages/appear.ets
+24
-9
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets
...onent/entry/src/main/ets/MainAbility/pages/areaChange.ets
+3
-3
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets
...component/entry/src/main/ets/MainAbility/pages/swiper.ets
+1
-1
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets
...ponent/entry/src/main/ets/MainAbility/pages/touchAble.ets
+1
-19
arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets
...s_component/entry/src/main/ets/test/AppearJsunit.test.ets
+30
-31
arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets
...mponent/entry/src/main/ets/test/AreaChangeJsunit.test.ets
+11
-30
arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets
..._component/entry/src/main/ets/test/MarqueeJsunit.test.ets
+6
-3
arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets
...s_component/entry/src/main/ets/test/SwiperJsunit.test.ets
+4
-3
arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets
...omponent/entry/src/main/ets/test/TouchAbleJsunit.test.ets
+3
-4
arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets
...ts_component/entry/src/main/ets/test/TouchJsunit.test.ets
+1
-1
未找到文件。
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/appear.ets
浏览文件 @
dc12624e
...
...
@@ -22,7 +22,7 @@ import prompt from '@system.prompt'
@Component
struct AppearExample {
@State isShow: boolean = true
@State appearFlag:
boolean = false
@State appearFlag:
string = "appearStatusOff"
@State disAppearFlag: boolean = false
private changeAppear: string = 'Hide Text'
private myText: string = 'Text for onAppear'
...
...
@@ -52,26 +52,41 @@ struct AppearExample {
.key('appear')
.onClick(() => {
this.isShow = !this.isShow
try {
var backData = {
data: {
"ACTION": this.isShow,
}
}
var backEvent = {
eventId: 58,
priority: events_emitter.EventPriority.LOW
}
console.info("appearFlag start to emit action state")
events_emitter.emit(backEvent, backData)
} catch {
console.info("appearFlag emit action state err: " + JSON.stringify(err.message))
}
}).margin(3).backgroundColor(0x2788D9)
if (this.isShow) {
Text(this.myText)
.onAppear(() => {
this.appearFlag =
true
this.appearFlag =
"appearStatusOn"
this.changeAppear = 'Show Text'
console.info('appearFlag current action state is: ' + this.appearFlag);
prompt.showToast({ message: 'The text is shown', duration: 2000 })
try {
var backData = {
var backData
2
= {
data: {
"A
CTION
": this.appearFlag,
"A
PPEAR
": this.appearFlag,
}
}
var backEvent = {
var backEvent
2
= {
eventId: 59,
priority: events_emitter.EventPriority.LOW
}
console.info("appearFlag start to emit action state")
events_emitter.emit(backEvent
, backData
)
events_emitter.emit(backEvent
2, backData2
)
} catch {
console.info("appearFlag emit action state err: " + JSON.stringify(err.message))
}
...
...
@@ -82,17 +97,17 @@ struct AppearExample {
console.info('disAppearFlag current action state is: ' + this.disAppearFlag);
prompt.showToast({ message: 'The text is hidden', duration: 2000 })
try {
var backData = {
var backData
1
= {
data: {
"ACTION": this.disAppearFlag,
}
}
var backEvent = {
var backEvent
1
= {
eventId: 60,
priority: events_emitter.EventPriority.LOW
}
console.info("disAppearFlag start to emit action state")
events_emitter.emit(backEvent
, backData
)
events_emitter.emit(backEvent
1, backData1
)
} catch {
console.info("disAppearFlag emit action state err: " + JSON.stringify(err.message))
}
...
...
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/areaChange.ets
浏览文件 @
dc12624e
...
...
@@ -54,17 +54,17 @@ struct AreaExample {
this.onActionCalled = true;
console.info('onAreaChange current action state is: ' + this.onActionCalled);
try {
var backData = {
var backData
1
= {
data: {
"ACTION": this.onActionCalled,
}
}
var backEvent = {
var backEvent
1
= {
eventId: 62,
priority: events_emitter.EventPriority.LOW
}
console.info("onAreaChange start to emit action state")
events_emitter.emit(backEvent
, backData
)
events_emitter.emit(backEvent
1, backData1
)
} catch (err) {
console.info("onAreaChange emit action state err: " + JSON.stringify(err.message))
}
...
...
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets
浏览文件 @
dc12624e
...
...
@@ -210,7 +210,7 @@ struct SwiperExample {
this.loop = eventData.data.loop;
}
if (eventData.data.duration != null) {
this.duration =
parseInt(eventData.data.duration)
;
this.duration =
eventData.data.duration
;
}
if (eventData.data.vertical != null) {
this.vertical = eventData.data.vertical;
...
...
arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/touchAble.ets
浏览文件 @
dc12624e
...
...
@@ -22,25 +22,6 @@ import events_emitter from '@ohos.events.emitter';
struct TouchAbleExample {
@State text1: string = '';
@State text2: string = '';
@State touchableValue: boolean = false;
private stateChangCallBack = (eventData) => {
console.info("[TouchAble] page stateChangCallBack");
if (eventData != null) {
console.info("[TouchAble] page state change called:" + JSON.stringify(eventData));
if (eventData.data.touchableValue != null) {
this.touchableValue = eventData.data.touchableValue;
}
}
}
onPageShow() {
console.info('[TouchAble] page show called');
var stateChangeEvent = {
eventId: 44,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEvent, this.stateChangCallBack);
}
build() {
Stack() {
...
...
@@ -52,6 +33,7 @@ struct TouchAbleExample {
console.info(this.text1 = 'Rect Clicked')
})
.overlay(this.text1, { align: Alignment.Bottom, offset: { x: 0, y: 20 } })
Ellipse()
.fill(Color.Pink)
.width(150)
...
...
arkui/ace_ets_component/entry/src/main/ets/test/AppearJsunit.test.ets
浏览文件 @
dc12624e
...
...
@@ -51,58 +51,57 @@ export default function appearJsunit() {
console.info('[testAppear01] START');
await Utils.sleep(1000);
try {
let callBackAppear = (backData) => {
console.info("testAppear01 get appearEvent result is: " + JSON.stringify(appearEvent));
expect(backData.data.ACTION).assertEqual(true);
let callBackAppear1 = (backData) => {
console.info("testAppear01 get appearEvent result is: " + JSON.stringify(backData));
expect(backData.data.ACTION).assertEqual(false);
done();
}
var appearEvent = {
var appearEvent
1
= {
eventId: 58,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(appearEvent
, callBackAppear
);
events_emitter.on(appearEvent
1, callBackAppear1
);
} catch (err) {
console.info("testAppear01 on appearEvent err : " + JSON.stringify(err));
}
console.info("testAppear01 click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
console.info('[testAppear01] END');
done();
});
it('testAppear02', 0, async function (done) {
console.info('[testAppear02] START');
await Utils.sleep(1000);
try {
let callBackAppear = (backData) => {
console.info("testAppear02 get appearEvent result is: " + JSON.stringify(appearEvent));
expect(backData.data.ACTION).assertEqual(true);
let callBackDisAppear = (backData1) => {
console.info("testAppear02 get disAppearEvent result is: " + JSON.stringify(backData1));
console.info("testAppear02 get backData1.data.ACTION result is: " + backData1.data.ACTION);
expect(backData1.data.ACTION).assertEqual(true);
done();
}
var
a
ppearEvent = {
eventId:
59
,
var
disA
ppearEvent = {
eventId:
60
,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(
appearEvent, callBack
Appear);
events_emitter.on(
disAppearEvent, callBackDis
Appear);
} catch (err) {
console.info("testAppear02 on
a
ppearEvent err : " + JSON.stringify(err));
console.info("testAppear02 on
disA
ppearEvent err : " + JSON.stringify(err));
}
console.info("testAppear02 appearEvent click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
try {
let callBackDisAppear = (backData) => {
console.info("testAppear02 get disAppearEvent result is: " + JSON.stringify(disAppearEvent));
expect(backData.data.ACTION).assertEqual(true);
await Utils.sleep(1000);
console.info('[testAppear03] START');
let callBackAppear2 = (backData2) => {
console.info("testAppear03 get appearEvent result is: " + JSON.stringify(backData2));
console.info("testAppear03 get backData2.data.APPEAR: " + backData2.data.APPEAR);
expect(backData2.data.APPEAR).assertEqual("appearStatusOn");
done();
}
var disAppearEvent
= {
eventId: 60
,
var appearEvent2
= {
eventId: 59
,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(disAppearEvent, callBackDisAppear);
try {
console.info("testAppear03 appearEvent click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
events_emitter.on(appearEvent2, callBackAppear2);
} catch (err) {
console.info("testAppear0
2 on disA
ppearEvent err : " + JSON.stringify(err));
console.info("testAppear0
3 on a
ppearEvent err : " + JSON.stringify(err));
}
console.info("testAppear02 disAppearEvent click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
console.info('[testAppear02] END');
done();
});
})
}
arkui/ace_ets_component/entry/src/main/ets/test/AreaChangeJsunit.test.ets
浏览文件 @
dc12624e
...
...
@@ -48,9 +48,10 @@ export default function areaChangeJsunit() {
it('areaChangeTest_0300', 0, async function (done) {
console.info('areaChangeTest_0300 START');
await Utils.sleep(1000);
let callback = (indexEvent) => {
console.info("areaChangeTest_0300 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.value).assertEqual('TextText');
let callback = (backData) => {
console.info("areaChangeTest_0300 get state result is: " + JSON.stringify(backData));
expect(backData.data.value).assertEqual('TextText');
done();
}
let indexEvent = {
eventId: 61,
...
...
@@ -61,44 +62,24 @@ export default function areaChangeJsunit() {
} catch (err) {
console.info("areaChangeTest_0300 on events_emitter err : " + JSON.stringify(err));
}
console.info("areaChangeTest_0300 click result is: " + JSON.stringify(sendEventByKey('text1', 10, "")));
var innerEventOne = {
eventId: 62,
priority: events_emitter.EventPriority.LOW
}
await Utils.sleep(1500);
var callback1 = (eventData) => {
console.info("areaChangeTest_0300 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual(true);
}
try {
events_emitter.on(innerEventOne, callback1);
} catch (err) {
console.info("areaChangeTest_0300 on events_emitter err : " + JSON.stringify(err));
}
console.info('areaChangeTest_0300 END');
done();
});
it('areaChangeTest_0400', 0, async function (done) {
console.info('areaChangeTest_0400 START');
await Utils.sleep(1000);
let callback = (indexEvent) => {
console.info("areaChangeTest_0400 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.value).assertEqual('TextTextText');
let callback1 = (eventData) => {
console.info("areaChangeTest_0400 get state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual(true);
done();
}
let indexEvent = {
let indexEvent
1
= {
eventId: 62,
priority: events_emitter.EventPriority.LOW
}
try {
events_emitter.on(indexEvent
, callback
);
events_emitter.on(indexEvent
1, callback1
);
} catch (err) {
console.info("areaChangeTest_0400 on events_emitter err : " + JSON.stringify(err));
}
console.info("areaChangeTest_0400 click result is: " + JSON.stringify(sendEventByKey('text1', 10, "")));
console.info('areaChangeTest_0400 END');
done();
console.info("areaChangeTest_0300 click result is: " + JSON.stringify(sendEventByKey('text1', 10, "")));
});
})
}
arkui/ace_ets_component/entry/src/main/ets/test/MarqueeJsunit.test.ets
浏览文件 @
dc12624e
...
...
@@ -52,6 +52,7 @@ export default function marqueeJsunit() {
let callback = (indexEvent) => {
console.info("testMarquee_0100 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.start).assertEqual(true);
done();
}
let indexEvent = {
eventId: 130,
...
...
@@ -67,6 +68,7 @@ export default function marqueeJsunit() {
var callback1 = (eventData) => {
console.info("testMarquee_0100 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.fontColor).assertEqual(Color.Blue);
done();
}
var innerEventOne = {
eventId: 127,
...
...
@@ -78,7 +80,6 @@ export default function marqueeJsunit() {
console.info("testMarquee_0100 on events_emitter err : " + JSON.stringify(err));
}
console.info('testMarquee_0100 END');
done();
});
it('testMarquee_0200', 0, async function (done) {
...
...
@@ -87,6 +88,7 @@ export default function marqueeJsunit() {
let callback = (indexEvent) => {
console.info("testMarquee_0200 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.start).assertEqual(true);
done();
}
let indexEvent = {
eventId: 130,
...
...
@@ -102,6 +104,7 @@ export default function marqueeJsunit() {
var callback1 = (eventData) => {
console.info("testMarquee_0200 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.fontSize).assertEqual(50);
done();
}
var innerEventOne = {
eventId: 128,
...
...
@@ -113,7 +116,6 @@ export default function marqueeJsunit() {
console.info("testMarquee_0200 on events_emitter err : " + JSON.stringify(err));
}
console.info('testMarquee_0200 END');
done();
});
it('testMarquee_0300', 0, async function (done) {
...
...
@@ -122,6 +124,7 @@ export default function marqueeJsunit() {
let callback = (indexEvent) => {
console.info("testMarquee_0300 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.start).assertEqual(true);
done();
}
let indexEvent = {
eventId: 130,
...
...
@@ -137,6 +140,7 @@ export default function marqueeJsunit() {
var callback1 = (eventData) => {
console.info("testMarquee_0300 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual(true);
done();
}
var innerEventOne = {
eventId: 129,
...
...
@@ -148,7 +152,6 @@ export default function marqueeJsunit() {
console.info("testMarquee_0300 on events_emitter err : " + JSON.stringify(err));
}
console.info('testMarquee_0300 END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets
浏览文件 @
dc12624e
...
...
@@ -164,6 +164,7 @@ export default function swiperJsunit() {
let callback = (indexEvent) => {
console.info("swiperTest_0800 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
done();
}
let indexEvent = {
eventId: 205,
...
...
@@ -177,7 +178,6 @@ export default function swiperJsunit() {
console.info("swiperTest_0800 click result is: " + JSON.stringify(sendEventByKey('button1', 10, "")));
await Utils.sleep(1000);
console.info('swiperTest_0800 END');
done();
});
it('swiperTest_0900', 0, async function (done) {
...
...
@@ -186,6 +186,7 @@ export default function swiperJsunit() {
let callback = (indexEvent) => {
console.info("swiperTest_0900 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
done();
}
let indexEvent = {
eventId: 206,
...
...
@@ -199,7 +200,6 @@ export default function swiperJsunit() {
console.info("swiperTest_0900 click result is: " + JSON.stringify(sendEventByKey('button2', 10, "")));
await Utils.sleep(1000);
console.info('swiperTest_0900 END');
done();
});
it('swiperTest_1000', 0, async function (done) {
...
...
@@ -208,6 +208,7 @@ export default function swiperJsunit() {
let callbackOne = (indexEventOne) => {
console.info("swiperTest_1000 get state result is: " + JSON.stringify(indexEventOne));
expect(indexEventOne.data.ACTION).assertEqual(true);
done();
}
let indexEventOne = {
eventId: 206,
...
...
@@ -223,6 +224,7 @@ export default function swiperJsunit() {
let callback = (indexEvent) => {
console.info("swiperTest_1000 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual(true);
done();
}
let indexEvent = {
eventId: 204,
...
...
@@ -234,7 +236,6 @@ export default function swiperJsunit() {
console.info("swiperTest_1000 on events_emitter err : " + JSON.stringify(err));
}
console.info('swiperTest_1000 END');
done();
});
it('swiperTest_1100', 0, async function (done) {
...
...
arkui/ace_ets_component/entry/src/main/ets/test/TouchAbleJsunit.test.ets
浏览文件 @
dc12624e
...
...
@@ -60,6 +60,8 @@ export default function touchAbleJsunit() {
var callbackTwo = (eventData) => {
console.info("[testTouchAble002] get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ACTION).assertEqual('Ellipse Clicked')
console.info('[testTouchAble002] END');
done();
}
var innerEventTwo = {
eventId: 237,
...
...
@@ -70,10 +72,7 @@ export default function touchAbleJsunit() {
} catch (err) {
console.info("[testTouchAble002] on events_emitter err : " + JSON.stringify(err));
}
console.info('[testClickEvent001] sendEventByKey ' + JSON.stringify(sendEventByKey('ellipse', 10, "")));
await Utils.sleep(1000)
console.info('[testTouchAble002] END');
done();
console.info("testClickEvent002 click result is: " + JSON.stringify(sendEventByKey('ellipse', 10, "")));
});
})
}
\ No newline at end of file
arkui/ace_ets_component/entry/src/main/ets/test/TouchJsunit.test.ets
浏览文件 @
dc12624e
...
...
@@ -55,6 +55,7 @@ export default function touchJsunit() {
console.info("testTouch01 get backEvent result is: " + JSON.stringify(backEvent));
console.info("testTouch01 get flag result is: " + JSON.stringify(backData.data.ACTION));
expect(backData.data.ACTION).assertEqual(true);
done();
}
var backEvent = {
eventId: 43,
...
...
@@ -66,7 +67,6 @@ export default function touchJsunit() {
}
console.info("testTouch01 click result is: " + JSON.stringify(sendEventByKey('touch', 10, "")));
console.info('[testTouch01] END');
done();
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录