未验证 提交 c2d7ebed 编写于 作者: O openharmony_ci 提交者: Gitee

!7845 【ACE子系统】修改测试用例

Merge pull request !7845 from hekun/monthly_20221018
...@@ -126,7 +126,7 @@ export default function scrollOnScrollBeginJsunit() { ...@@ -126,7 +126,7 @@ export default function scrollOnScrollBeginJsunit() {
console.info("[testscrollOnScrollBegin0005] component align strJson:" + strJson); console.info("[testscrollOnScrollBegin0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Scroll'); expect(obj.$type).assertEqual('Scroll');
expect(obj.$attrs.scrollBarWidth).assertEqual("30.00px"); expect(obj.$attrs.scrollBarWidth).assertEqual("30.00vp");
console.info("[testscrollOnScrollBegin0005] scrollBarWidth value :" + obj.$attrs.scrollBarWidth); console.info("[testscrollOnScrollBegin0005] scrollBarWidth value :" + obj.$attrs.scrollBarWidth);
done(); done();
}); });
......
...@@ -56,7 +56,7 @@ export default function appVersionCodeJsunit() { ...@@ -56,7 +56,7 @@ export default function appVersionCodeJsunit() {
} }
var callback = (eventData) => { var callback = (eventData) => {
console.info("testappVersionCode_0011 get event state result is: " + JSON.stringify(eventData)); console.info("testappVersionCode_0011 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.Code).assertEqual("1"); expect(eventData.data.Code).assertEqual(1000000);
} }
console.info("testappVersion click result is: " + JSON.stringify(sendEventByKey('versionCodeText', 10, ""))); console.info("testappVersion click result is: " + JSON.stringify(sendEventByKey('versionCodeText', 10, "")));
events_emitter.on(innerEvent, callback); events_emitter.on(innerEvent, callback);
......
...@@ -62,7 +62,7 @@ export default function unitsModuleNameJsunit() { ...@@ -62,7 +62,7 @@ export default function unitsModuleNameJsunit() {
} }
var callback = (eventData) => { var callback = (eventData) => {
console.info("testunitsModuleName0001 get event state result is: " + JSON.stringify(eventData)); console.info("testunitsModuleName0001 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.ModuleName).assertEqual(true); expect(eventData.data.ModuleName).assertFalse();
} }
events_emitter.on(innerEvent, callback); events_emitter.on(innerEvent, callback);
} catch (err) { } catch (err) {
......
// @ts-nocheck
/** /**
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -20,36 +20,36 @@ import prompt from '@system.prompt' ...@@ -20,36 +20,36 @@ import prompt from '@system.prompt'
@Entry @Entry
@Component @Component
struct ohosMatrix4 { struct ohosMatrix4 {
@State rotateValue: object= { @State rotateValue:RotateOptions = {
x: 1, x: 1,
y: 1, y: 1,
z: 1, z: 1,
centerX: '50%', centerX: 7,
centerY: '50%', centerY: 8,
angle: 300 angle: 300
} }
@State translateValue: object= { x: 100, y: 5 } @State translateValue: object= { x: 100, y: 5 }
@State scaleValue: object= { x: 2, y: 0.5 } @State scaleValue: object= { x: 2, y: 0.5 }
@State transformValue: object= Matrix4.identity().translate({ x: 100, y: 100, z: 30 }) @State transformValue: object= Matrix4.identity().translate({ x: 100, y: 100, z: 30 })
@State transformValue: object= Matrix4.identity().translate({ x: 100, y: 100, z: 30 }) @State transformValue1: object= Matrix4.identity().translate({ x: 100, y: 100, z: 30 })
@State matrix1: object= Matrix4.identity().transformPoint([100, 10]) @State matrix1: object= Matrix4.identity().transformPoint([100, 10])
@State matrix2: object = Matrix4.identity().translate({ x: 300 }).copy() @State matrix2: Matrix4.Matrix4Transit = Matrix4.identity().translate({ x: 300 }).copy()
@State matrix3: object = Matrix4.identity().scale({ x: 3 }).copy() @State matrix3: Matrix4.Matrix4Transit= Matrix4.identity().scale({ x: 3 }).copy()
@State matrix4: object = Matrix4.identity().rotate({x:1, y:1, z:2, angle:30}) @State matrix4: object = Matrix4.identity().rotate({x:1, y:1, z:2, angle:30})
@State matrix5: object = Matrix4.identity().scale({x:5, y:1, z:1, centerX:50, centerY:50}) @State matrix5: object = Matrix4.identity().scale({x:5, y:1, z:1, centerX:50, centerY:50})
@State matrix6: object = Matrix4.identity().translate({x:100, y:200, z:30}) @State matrix6: object = Matrix4.identity().translate({x:100, y:200, z:30})
@State matrix7: Matrix4.Matrix4Transit = Matrix4.identity().translate({ x: 300 }).combine(Matrix4.identity().scale({ x: 3 }));
@State onClickValue:boolean = false;
private stateChangCallBack = (eventData) => { private stateChangCallBack = (eventData) => {
console.info("transFormExample page state change called:" + JSON.stringify(eventData)); console.info("transFormExample page state change called:" + JSON.stringify(eventData));
if (eventData != null) { if (eventData != null) {
console.info("eventData value is"); console.info("eventData value is");
if (eventData.data.matrix2 != null && eventData.data.matrix3 != null) { if (eventData.data.matrix2 != null && eventData.data.matrix3 != null) {
console.info("this.matrix2 value is" + Matrix4.identity() let matrixV = Matrix4.identity().translate(eventData.data.matrix2);
.translate(eventData.data.matrix2) if (matrixV != null) {
.copy() + "2" + JSON.stringify(Matrix4.identity().translate(eventData.data.matrix2).copy()));
this.matrix2 = Matrix4.identity().translate(eventData.data.matrix2).copy(); this.matrix2 = Matrix4.identity().translate(eventData.data.matrix2).copy();
console.info("this.matrix3 value is");
this.matrix3 = Matrix4.identity().scale(eventData.data.matrix3).copy(); this.matrix3 = Matrix4.identity().scale(eventData.data.matrix3).copy();
}
} else { } else {
console.info("this.matrix value is not"); console.info("this.matrix value is not");
} }
...@@ -129,7 +129,7 @@ struct ohosMatrix4 { ...@@ -129,7 +129,7 @@ struct ohosMatrix4 {
}).backgroundColor(0x2788D9).key('rotate5') }).backgroundColor(0x2788D9).key('rotate5')
Image('/images/bg.jpg') Image('/images/bg.jpg')
.padding(5) .padding(5)
.transform(this.matrix2.combine(this.matrix3)) .transform(this.matrix7)
.width("40%") .width("40%")
.height(100) .height(100)
.margin({ top: 5 }) .margin({ top: 5 })
......
...@@ -169,9 +169,7 @@ export default function ohosMatrix4Jsunit() { ...@@ -169,9 +169,7 @@ export default function ohosMatrix4Jsunit() {
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("[test_OhosMatrix4_006] component objNew is: " + JSON.stringify(objNew)); console.info("[test_OhosMatrix4_006] component objNew is: " + JSON.stringify(objNew));
console.info("[test_OhosMatrix4_006] component transform is: " + JSON.stringify(objNew.$attrs.transform)); console.info("[test_OhosMatrix4_006] component transform is: " + JSON.stringify(objNew.$attrs.transform));
expect(JSON.stringify(objNew.$attrs.transform)).assertEqual('{"type":"matrix",' + expect(JSON.stringify(objNew.$attrs.transform)).assertEqual('{"type":"matrix","matrix":"3.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,900.000000,0.000000,0.000000,1.000000,"}');
'"matrix":"0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,' +
'0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,"}');
done(); done();
}); });
}) })
......
...@@ -28,9 +28,9 @@ struct QrCode { ...@@ -28,9 +28,9 @@ struct QrCode {
var colorValue = eventData.data.color; var colorValue = eventData.data.color;
if (colorValue != null && colorValue.length != 0) { if (colorValue != null && colorValue.length != 0) {
this.qrCodeColor = colorValue; this.qrCodeColor = colorValue;
console.info("qrCodeColor:" + qrCodeColor); console.info("qrCodeColor:" + this.qrCodeColor);
} else { } else {
console.info("qrCodeColor is null or empty " + qrCodeColor); console.info("qrCodeColor is null or empty " + this.qrCodeColor);
} }
} else { } else {
console.info("qrCode page color not change called:" + JSON.stringify(eventData)); console.info("qrCode page color not change called:" + JSON.stringify(eventData));
...@@ -42,9 +42,9 @@ struct QrCode { ...@@ -42,9 +42,9 @@ struct QrCode {
var backgroundColorValue = eventData.data.backgroundColor; var backgroundColorValue = eventData.data.backgroundColor;
if (backgroundColorValue != null && backgroundColorValue.length != 0) { if (backgroundColorValue != null && backgroundColorValue.length != 0) {
this.qrCodeBackgroundColor = backgroundColorValue; this.qrCodeBackgroundColor = backgroundColorValue;
console.info("qrCodeBackgroundColor:" + qrCodeBackgroundColor); console.info("qrCodeBackgroundColor:" + this.qrCodeBackgroundColor);
} else { } else {
console.info("backgroundColorValue is null or empty " + qrCodeColor); console.info("backgroundColorValue is null or empty " + this.qrCodeColor);
} }
} else { } else {
console.info("qrCode page backgroundColorValue not change called:" + JSON.stringify(eventData)); console.info("qrCode page backgroundColorValue not change called:" + JSON.stringify(eventData));
......
// @ts-nocheck
/** /**
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -92,6 +92,31 @@ struct ButtonExample { ...@@ -92,6 +92,31 @@ struct ButtonExample {
console.info("button2 emit action state err: " + JSON.stringify(err.message)) console.info("button2 emit action state err: " + JSON.stringify(err.message))
} }
}) })
Button('ok2')
.type(this.buttonTypeValue)
.key('buttontest')
.fontSize(this.fontSizeValue)
.backgroundColor(0x317aff)
.width(90)
.fontColor(this.fontColorValue)
.onClick(() => {
try {
var backData = {
data: {
"fontColorValue": this.fontColorValue,
}
}
var backEvent = {
eventId: 9907,
priority: events_emitter.EventPriority.LOW
}
console.info("buttontest start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("buttontest emit action state err: " + JSON.stringify(err.message))
}
})
Button('ok!') Button('ok!')
.type(this.buttonTypeValue) .type(this.buttonTypeValue)
.key('button3') .key('button3')
......
// @ts-nocheck
/** /**
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -243,7 +243,7 @@ export default function buttonJsunit() { ...@@ -243,7 +243,7 @@ export default function buttonJsunit() {
} }
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("testButton10 get state result is: " + JSON.stringify(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)
} }
try { try {
events_emitter.on(indexEvent, callback); events_emitter.on(indexEvent, callback);
...@@ -280,7 +280,7 @@ export default function buttonJsunit() { ...@@ -280,7 +280,7 @@ export default function buttonJsunit() {
} }
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("testButton11 get state result is: " + JSON.stringify(indexEvent)) console.info("testButton11 get state result is: " + JSON.stringify(indexEvent))
except(indexEvent.data.fontColorValue).assertEqual(332) expect(indexEvent.data.fontColorValue).assertEqual(332)
} }
try { try {
events_emitter.on(indexEvent, callback); events_emitter.on(indexEvent, callback);
...@@ -327,7 +327,7 @@ export default function buttonJsunit() { ...@@ -327,7 +327,7 @@ export default function buttonJsunit() {
try { try {
var eventData = { var eventData = {
data: { data: {
"buttonTypeValue": qaq, "buttonTypeValue": "qaq",
} }
} }
var innerEvent = { var innerEvent = {
...@@ -378,7 +378,7 @@ export default function buttonJsunit() { ...@@ -378,7 +378,7 @@ export default function buttonJsunit() {
try { try {
let eventData = { let eventData = {
data: { data: {
"fontColorValue": ab996 "fontColorValue": "ab996"
} }
} }
let indexEventOne = { let indexEventOne = {
...@@ -390,21 +390,21 @@ export default function buttonJsunit() { ...@@ -390,21 +390,21 @@ export default function buttonJsunit() {
} catch (err) { } catch (err) {
console.log("testButton15 change component data error: " + err.message); console.log("testButton15 change component data error: " + err.message);
} }
await Utils.sleep(1000); await Utils.sleep(2000);
let indexEvent = { let indexEvent = {
eventId: 77, eventId: 9907,
priority: events_emitter.EventPriority.LOW priority: events_emitter.EventPriority.LOW
} }
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("testButton15 get state result is: " + JSON.stringify(indexEvent)) console.info("testButton15 get state result is: " + JSON.stringify(indexEvent))
except(indexEvent.data.fontColorValue).assertEqual('ab996') expect(indexEvent.data.fontColorValue).assertEqual("ab996")
} }
try { try {
events_emitter.on(indexEvent, callback); events_emitter.on(indexEvent, callback);
} catch (err) { } catch (err) {
console.info("testButton15 on events_emitter err : " + JSON.stringify(err)); console.info("testButton15 on events_emitter err : " + JSON.stringify(err));
} }
console.info("testButton15 click result is: " + JSON.stringify(sendEventByKey('button4', 10, ""))); console.info("testButton15 click result is: " + JSON.stringify(sendEventByKey('buttontest', 10, "")));
await Utils.sleep(1000); await Utils.sleep(1000);
console.info('[testButton15] END'); console.info('[testButton15] END');
done(); done();
......
...@@ -55,7 +55,7 @@ export default function scrollCodeJsunit() { ...@@ -55,7 +55,7 @@ export default function scrollCodeJsunit() {
expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.Vertical'); expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.Vertical');
expect(obj.$attrs.scrollBar).assertEqual('BarState.On'); expect(obj.$attrs.scrollBar).assertEqual('BarState.On');
expect(obj.$attrs.scrollBarColor).assertEqual('#FF0000FF'); expect(obj.$attrs.scrollBarColor).assertEqual('#FF0000FF');
expect(obj.$attrs.scrollBarWidth).assertEqual('30.00px'); expect(obj.$attrs.scrollBarWidth).assertEqual('30.00vp');
done(); done();
}); });
...@@ -159,7 +159,7 @@ export default function scrollCodeJsunit() { ...@@ -159,7 +159,7 @@ export default function scrollCodeJsunit() {
let strJson = getInspectorByKey('ScrollCode'); let strJson = getInspectorByKey('ScrollCode');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[test_scrollCode_005] component obj is: " + JSON.stringify(obj)); console.info("[test_scrollCode_005] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.scrollBarWidth).assertEqual('40.00px'); expect(obj.$attrs.scrollBarWidth).assertEqual('40.00vp');
done(); done();
}); });
......
...@@ -50,7 +50,7 @@ export default function timeStampJsunit() { ...@@ -50,7 +50,7 @@ export default function timeStampJsunit() {
await Utils.sleep(1500); await Utils.sleep(1500);
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("timeStampTest_0100 get state result is: " + JSON.stringify(indexEvent)); console.info("timeStampTest_0100 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.Text).assertNotEqual(null); expect(isNaN(indexEvent.data.Text)).assertFalse();
} }
let indexEvent = { let indexEvent = {
eventId: 230, eventId: 230,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册